ZHANGYUXUAN-zR commited on
Commit
dd58ff2
·
verified ·
1 Parent(s): d2bcbba

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. md/train/0-uUGPbIjD/0-uUGPbIjD.md +559 -0
  2. md/train/1_gaHBaRYt/1_gaHBaRYt.md +358 -0
  3. md/train/5PiSFHhRe2C/5PiSFHhRe2C.md +374 -0
  4. md/train/6rEnMF1okeiBO/6rEnMF1okeiBO.md +209 -0
  5. md/train/7R7fAoUygoa/7R7fAoUygoa.md +698 -0
  6. md/train/9sF3n8eAco/9sF3n8eAco.md +187 -0
  7. md/train/B1lG42C9Km/B1lG42C9Km.md +392 -0
  8. md/train/BJg15lrKvS/BJg15lrKvS.md +0 -0
  9. md/train/BJxLH2AcYX/BJxLH2AcYX.md +369 -0
  10. md/train/Bk6qQGWRb/Bk6qQGWRb.md +331 -0
  11. md/train/BkSmc8qll/BkSmc8qll.md +451 -0
  12. md/train/ByRWCqvT-/ByRWCqvT-.md +384 -0
  13. md/train/BygzbyHFvB/BygzbyHFvB.md +313 -0
  14. md/train/ByldLrqlx/ByldLrqlx.md +496 -0
  15. md/train/ByxXZpVtPB/ByxXZpVtPB.md +204 -0
  16. md/train/ByxpMd9lx/ByxpMd9lx.md +230 -0
  17. md/train/GSXEx6iYd0/GSXEx6iYd0.md +355 -0
  18. md/train/H1cWzoxA-/H1cWzoxA-.md +490 -0
  19. md/train/H1lj0nNFwB/H1lj0nNFwB.md +870 -0
  20. md/train/H8VDvtm1ij8/H8VDvtm1ij8.md +341 -0
  21. md/train/Hk6a8N5xe/Hk6a8N5xe.md +245 -0
  22. md/train/Hkbd5xZRb/Hkbd5xZRb.md +439 -0
  23. md/train/HyMS8iRcK7/HyMS8iRcK7.md +415 -0
  24. md/train/QZpx42n0BWr/QZpx42n0BWr.md +253 -0
  25. md/train/S1ANxQW0b/S1ANxQW0b.md +747 -0
  26. md/train/SJg4Y3VFPS/SJg4Y3VFPS.md +324 -0
  27. md/train/SkNSehA9FQ/SkNSehA9FQ.md +301 -0
  28. md/train/SyCSsUDee/SyCSsUDee.md +323 -0
  29. md/train/SyfiiMZA-/SyfiiMZA-.md +225 -0
  30. md/train/Z7xSQ3SXLQU/Z7xSQ3SXLQU.md +233 -0
  31. md/train/ZPa2SyGcbwh/ZPa2SyGcbwh.md +346 -0
  32. md/train/_IY3_4psXuf/_IY3_4psXuf.md +307 -0
  33. md/train/b8Kl8mcK6tb/b8Kl8mcK6tb.md +357 -0
  34. md/train/cAvgPMAA3hb/cAvgPMAA3hb.md +413 -0
  35. md/train/e8WWUBeafM/e8WWUBeafM.md +377 -0
  36. md/train/hGmrNwR8qQP/hGmrNwR8qQP.md +313 -0
  37. md/train/nkap3LV7t7O/nkap3LV7t7O.md +349 -0
  38. md/train/qda7-sVg84/qda7-sVg84.md +0 -0
  39. md/train/r1G4z8cge/r1G4z8cge.md +495 -0
  40. md/train/r1WUqIceg/r1WUqIceg.md +131 -0
  41. md/train/rJliMh09F7/rJliMh09F7.md +414 -0
  42. md/train/rJrTwxbCb/rJrTwxbCb.md +249 -0
  43. md/train/rkZzY-lCb/rkZzY-lCb.md +401 -0
  44. md/train/ryeK6nNFDr/ryeK6nNFDr.md +394 -0
  45. md/train/rygf-kSYwH/rygf-kSYwH.md +464 -0
  46. md/train/ryuxYmvel/ryuxYmvel.md +262 -0
  47. md/train/ryxY73AcK7/ryxY73AcK7.md +0 -0
  48. md/train/ud-WYSo9JSL/ud-WYSo9JSL.md +282 -0
  49. md/train/v_4XcXsAZUn/v_4XcXsAZUn.md +264 -0
  50. md/train/xzqLpqRzxLq/xzqLpqRzxLq.md +406 -0
md/train/0-uUGPbIjD/0-uUGPbIjD.md ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HUMAN-LEVEL PERFORMANCE IN NO-PRESS DIPLOMACY VIA EQUILIBRIUM SEARCH
2
+
3
+ Jonathan Gray∗, Adam Lerer∗, Anton Bakhtin, Noam Brown Facebook AI Research {jsgray,alerer,yolo,noambrown}@fb.com
4
+
5
+ # ABSTRACT
6
+
7
+ Prior AI breakthroughs in complex games have focused on either the purely adversarial or purely cooperative settings. In contrast, Diplomacy is a game of shifting alliances that involves both cooperation and competition. For this reason, Diplomacy has proven to be a formidable research challenge. In this paper we describe an agent for the no-press variant of Diplomacy that combines supervised learning on human data with one-step lookahead search via regret minimization. Regret minimization techniques have been behind previous AI successes in adversarial games, most notably poker, but have not previously been shown to be successful in large-scale games involving cooperation. We show that our agent greatly exceeds the performance of past no-press Diplomacy bots, is unexploitable by expert humans, and ranks in the top $2 \%$ of human players when playing anonymous games on a popular Diplomacy website.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ A primary goal for AI research is to develop agents that can act optimally in real-world multi-agent interactions (i.e., games). In recent years, AI agents have achieved expert-level or even superhuman performance in benchmark games such as backgammon (Tesauro, 1994), chess (Campbell et al., 2002), Go (Silver et al., 2016; 2017; 2018), poker (Moravcík et al., 2017; Brown & Sandholm, ˇ 2017; 2019b), and real-time strategy games (Berner et al., 2019; Vinyals et al., 2019). However, previous large-scale game AI results have focused on either purely competitive or purely cooperative settings. In contrast, real-world games, such as business negotiations, politics, and traffic navigation, involve a far more complex mixture of cooperation and competition. In such settings, the theoretical grounding for the techniques used in previous AI breakthroughs falls apart.
12
+
13
+ In this paper we augment neural policies trained through imitation learning with regret minimization search techniques, and evaluate on the benchmark game of no-press Diplomacy. Diplomacy is a longstanding benchmark for research that features a rich mixture of cooperation and competition. Like previous researchers, we evaluate on the widely played no-press variant of Diplomacy, in which communication can only occur through the actions in the game (i.e., no cheap talk is allowed).
14
+
15
+ Specifically, we begin with a blueprint policy that approximates human play in a dataset of Diplomacy games. We then improve upon the blueprint during play by approximating an equilibrium for the current phase of the game, assuming all players (including our agent) play the blueprint for the remainder of the game. Our agent then plays its part of the computed equilibrium. The equilibrium is computed via regret matching (RM) (Blackwell et al., 1956; Hart & Mas-Colell, 2000).
16
+
17
+ Search via RM has led to remarkable success in poker. However, RM only converges to a Nash equilibrium in two-player zero-sum games and other special cases, and RM was never previously shown to produce strong policies in a mixed cooperative/competitive game as complex as no-press Diplomacy. Nevertheless, we show that our agent exceeds the performance of prior agents and for the first time convincingly achieves human-level performance in no-press Diplomacy. Specifically, we show that our agent soundly defeats previous agents, that our agent is far less exploitable than previous agents, that an expert human cannot exploit our agent even in repeated play, and, most importantly, that our agent ranks in the top $2 \%$ of human players when playing anonymous games on a popular Diplomacy website.
18
+
19
+ # 2 BACKGROUND AND RELATED WORK
20
+
21
+ Search has previously been used in almost every major game AI breakthrough, including backgammon (Tesauro, 1994), chess (Campbell et al., 2002), Go (Silver et al., 2016; 2017; 2018), poker (Moravcík et al., 2017; Brown & Sandholm, 2017; 2019b), and Hanabi (Lerer et al., 2020). ˇ A major exception is real-time strategy games (Vinyals et al., 2019; Berner et al., 2019). Similar to SPARTA as used in Hanabi (Lerer et al., 2020), our agent conducts one-ply lookahead search (i.e., changes the policy just for the current game turn) and thereafter assumes all players play according to the blueprint. Similar to the Pluribus poker agent (Brown & Sandholm, 2019b), our search technique uses regret matching to compute an approximate equilibrium. In a manner similar to the sampled best response algorithm of Anthony et al. (2020), we sample a limited number of actions from the blueprint policy rather than search over all possible actions, which would be intractable.
22
+
23
+ Learning effective policies in games involving cooperation and competition has been studied extensively in the field of multi-agent reinforcement learning (MARL) (Shoham et al., 2003). Nash-Q and CE-Q applied Q learning for general sum games by using Q values derived by computing Nash (or correlated) equilibrium values at the target states (Hu & Wellman, 2003; Greenwald et al., 2003). Friend-or-foe Q learning treats other agents as either cooperative or adversarial, where the Nash Q values are well defined Littman (2001). The recent focus on “deep” MARL has led to learning rules from game theory such as fictitious play and regret minimization being adapted to deep reinforcement learning (Heinrich & Silver, 2016; Brown et al., 2019), as well as work on game-theoretic challenges of mixed cooperative/competitive settings such as social dilemmas and multiple equilibria in the MARL setting (Leibo et al., 2017; Lerer & Peysakhovich, 2017; 2019).
24
+
25
+ Diplomacy in particular has served for decades as a benchmark for multi-agent AI research (Kraus & Lehmann, 1988; Kraus et al., 1994; Kraus & Lehmann, 1995; Johansson & Håård, 2005; Ferreira et al., 2015). Recently, Paquette et al. (2019) applied imitation learning (IL) via deep neural networks on a dataset of more than 150,000 Diplomacy games. This work greatly improved the state of the art for no-press Diplomacy, which was previously a handcrafted agent (van Hal, 2013). Paquette et al. (2019) also tested reinforcement learning (RL) in no-press Diplomacy via Advantage Actor-Critic (A2C) (Mnih et al., 2016). Anthony et al. (2020) introduced sampled best response policy iteration, a self-play technique, which further improved upon the performance of Paquette et al. (2019).
26
+
27
+ # 2.1 DESCRIPTION OF DIPLOMACY
28
+
29
+ The rules of no-press Diplomacy are complex; a full description is provided by Paquette et al. (2019). No-press Diplomacy is a seven-player zero-sum board game in which a map of Europe is divided into 75 provinces. 34 of these provinces contain supply centers (SCs), and the goal of the game is for a player to control a majority (18) of the SCs. Each players begins the game controlling three or four SCs and an equal number of units.
30
+
31
+ The game consists of three types of phases: movement phases in which each player assigns an order to each unit they control, retreat phases in which defeated units retreat to a neighboring province, and adjustment phases in which new units are built or existing units are destroyed.
32
+
33
+ During a movement phase, a player assigns an order to each unit they control. A unit’s order may be to hold (defend its province), move to a neighboring province, convoy a unit over water, or support a neighboring unit’s hold or move order. Support may be provided to units of any player. We refer to a tuple of orders, one order for each of a player’s units, as an action. That is, each player chooses one action each turn. There are an average of 26 valid orders for each unit (Paquette et al., 2019), so the game’s branching factor is massive and on some turns enumerating all actions is intractable.
34
+
35
+ Importantly, all actions occur simultaneously. In live games, players write down their orders and then reveal them at the same time. This makes Diplomacy an imperfect-information game in which an optimal policy may need to be stochastic in order to prevent predictability.
36
+
37
+ Diplomacy is designed in such a way that cooperation with other players is almost essential in order to achieve victory, even though only one player can ultimately win.
38
+
39
+ A game may end in a draw on any turn if all remaining players agree. Draws are a common outcome among experienced players because players will often coordinate to prevent any individual from reaching 18 centers. The two most common scoring systems for draws are draw-size scoring (DSS), in which all surviving players equally split a win, and sum-of-squares scoring (SoS), in which player $i$ receives a score o f C2P ij∈N C2j , where Ci is the number of SCs that player i controls (Fogel, 2020). Throughout this paper we use SoS scoring except in anonymous games against humans where the human host chooses a scoring system.
40
+
41
+ # 2.2 REGRET MATCHING
42
+
43
+ Regret Matching (RM) (Blackwell et al., 1956; Hart & Mas-Colell, 2000) is an iterative algorithm that converges to a Nash equilibrium (NE) (Nash, 1951) in two-player zero-sum games and other special cases, and converges to a coarse correlated equilibrium (CCE) (Hannan, 1957) in general.
44
+
45
+ We consider a game with $\mathcal { N }$ players where each player $i$ chooses an action $a _ { i }$ from a set of actions $\mathbf { \mathcal { A } } _ { i }$ . We denote the joint action as $a = ( a _ { 1 } , a _ { 2 } , \dotsc , a _ { N } )$ , the actions of all players other than $i$ as $a _ { - i }$ , and the set of joint actions as $\mathcal { A }$ . After all players simultaneously choose an action, player $i$ receives a reward of $v _ { i } ( a )$ (which can also be represented as $v _ { i } ( a _ { i } , a _ { - i } ) )$ . Players may also choose a probability distribution over actions, where the probability of action $a _ { i }$ is denoted $\pi _ { i } ( a _ { i } )$ and the vector of probabilities is denoted $\pi _ { i }$ .
46
+
47
+ Normally, each iteration of RM has a computational complexity of $\Pi _ { i \in { \mathcal { N } } } | { \mathcal { A } } _ { i } |$ . In a seven-player game, this is typically intractable. We therefore use a sampled form of RM in which each iteration has a computational complexity of $\textstyle \sum _ { i \in { \mathcal { N } } } | A _ { i } |$ . We now describe this sampled form of RM.
48
+
49
+ Each agent $i$ maintains an external regret value for each action $a _ { i } \in { \mathcal { A } } _ { i }$ , which we refer to simply as regret. The regret on iteration $t$ is denoted $R _ { i } ^ { t } ( a _ { i } )$ . Initially, all regrets are zero. On each iteration $t$ of RM, $\pi _ { i } ^ { t } ( a _ { i } )$ is set according to
50
+
51
+ $$
52
+ \pi _ { i } ^ { t } ( a _ { i } ) = \left\{ \begin{array} { l l } { \frac { \operatorname* { m a x } \{ 0 , R _ { i } ^ { t } ( a _ { i } ) \} } { \sum _ { a _ { i } ^ { \prime } \in A _ { i } } \operatorname* { m a x } \{ 0 , R _ { i } ^ { t } ( a _ { i } ^ { \prime } ) \} } } & { \mathrm { i f } \sum _ { a _ { i } ^ { \prime } \in A _ { i } } \operatorname* { m a x } \{ 0 , R _ { i } ^ { t } ( a _ { i } ^ { \prime } ) \} > 0 } \\ { \frac { 1 } { | A _ { i } | } } & { \mathrm { o t h e r w i s e } } \end{array} \right.
53
+ $$
54
+
55
+ Next, each player samples an action $a _ { i } ^ { * }$ from $\mathbf { \mathcal { A } } _ { i }$ according to $\pi _ { i } ^ { t }$ and all regrets are updated such that
56
+
57
+ $$
58
+ R _ { i } ^ { t + 1 } ( a _ { i } ) = R _ { i } ^ { t } ( a _ { i } ) + v _ { i } ( a _ { i } , a _ { - i } ^ { * } ) - \sum _ { a _ { i } ^ { \prime } \in { \cal A } _ { i } } \pi _ { i } ^ { t } ( a _ { i } ^ { \prime } ) v _ { i } ( a _ { i } ^ { \prime } , a _ { - i } ^ { * } )
59
+ $$
60
+
61
+ This sampled form of RM guarantees that $R _ { i } ^ { t } ( a _ { i } ) \in \mathcal { O } ( \sqrt { t } )$ with high probability (Lanctot et al., 2009). If $R _ { i } ^ { t } ( a _ { i } )$ grows sublinearly for all players’ actions, as is the case in RM, then the average policy over all iterations converges to a NE in two-player zero-sum games and in general the empirical distribution of players’ joint policies converges to a CCE as $t \to \infty$ .
62
+
63
+ In order to improve empirical performance, we use linear RM (Brown & Sandholm, 2019a), which weighs updates on iteration $t$ by $t$ .1 We also use optimism (Syrgkanis et al., 2015), in which the most recent iteration is counted twice when computing regret. Additionally, the action our agent ultimately plays is sampled from the final iteration’s policy, rather than the average policy over all iterations. This reduces the risk of sampling a non-equilibrium action due to insufficient convergence. We explain this modification in more detail in Appendix F.
64
+
65
+ # 3 AGENT DESCRIPTION
66
+
67
+ Our agent is composed of two major components. The first is a blueprint policy and state-value function trained via imitation learning on human data. The second is a search algorithm that utilizes the blueprint. This algorithm is executed on every turn, and approximates an equilibrium policy (for all players, not just the agent) for the current turn via RM, assuming that the blueprint is played by all players for the remaining game beyond the current turn.
68
+
69
+ # 3.1 SUPERVISED LEARNING
70
+
71
+ We construct a blueprint policy via imitation learning on a corpus of 46,148 Diplomacy games collected from online play, building on the methodology and model architecture described by Paquette et al. (2019) and Anthony et al. (2020). A blueprint policy and value function estimated from human play is ideal for performing search in a general-sum game, because it is likely to realistically approximate state values and other players’ actions when playing with humans. Our blueprint supervised model is based on the DipNet agent from Paquette et al. (2019), but we make a number of modifications to the architecture and training. A detailed description of the architecture is provided in Appendix A; in this section we highlight the key differences from prior work.
72
+
73
+ We trained the blueprint policy using only a subset of the data used by Paquette et al. (2019), specifically those games obtained from webdiplomacy.net. For this subset of the data, we obtained metadata about the press variant (full-press vs. no-press) which we add as a feature to the model, and anonymized player IDs for the participants in each game. Using the IDs, we computed ratings $s _ { i }$ for each player $i$ and only trained the policy on actions from players with above-average ratings. Appendix B describes our method for computing these ratings.
74
+
75
+ Our model closely follows the architecture of Paquette et al. (2019), with additional dropout of 0.4 between GNN encoder layers. We model sets of build orders as single tokens because there are a small number of build order combinations and it is tricky to predict sets auto-regressively with teacher forcing. We adopt the encoder changes of Anthony et al. (2020), but do not adopt their relational order decoder because it is more expensive to compute and leads to only marginal accuracy improvements after tuning dropout.
76
+
77
+ We make a small modification to the encoder GNN architecture that improves modeling. In addition to the standard residual that skips the entire GNN layer, we replace the graph convolution2 with the sum of a graph convolution and a linear layer. This allows the model to learn a hierarchy of features for each graph node (through the linear layer) without requiring a concomitant increase in graph smoothing (the GraphConv). The resulting GNN layer computes (modification in red)
78
+
79
+ $$
80
+ x _ { i + 1 } = D r o p o u t ( R e L U ( B N ( G r a p h C o n v ( x _ { i } ) + \mathbf { A x _ { i } } ) ) ) + x _ { i } .
81
+ $$
82
+
83
+ where $A$ is a learned linear transformation.
84
+
85
+ Finally, we achieve a substantial improvement in order prediction accuracy using a featurized order decoder. Diplomacy has over 13,000 possible orders, many of which will be observed infrequently in the training data. Therefore, by featurizing the orders by the order type, and encodings of the source, destination, and support locations, we observe improved prediction accuracy.
86
+
87
+ Specifically, in a standard decoder each order $o$ has a learned representation $e _ { o }$ , and for some board encoding $x$ and learned order embedding $e _ { o }$ , $P ( o ) = s o f t m a x ( x \cdot e _ { o } )$ . With order featurization, we use $\tilde { e } _ { o } = e _ { o } + A f _ { o }$ , where $f _ { o }$ are static order features and $A$ is a learned linear transformation. The order featurization we use is the concatenation of the one-hot order type with the board encodings for the source, destination, and support locations. We found that representing order location features by their location encodings works better than one-hot locations, presumably because the model can learn more state-contextual features.3
88
+
89
+ We add an additional value head to the model immediately after the dipnet encoder, that is trained to estimate the final SoS scores given a board situation. We use this value estimate during equilibrium search (Sec. 3.2) to estimate the value of a Monte Carlo rollout after a fixed number of steps. The value head is an MLP with one hidden layer that takes as input the concatenated vector of all board position encodings. A softmax over powers’ SoS scores is applied at the end to enforce that all players’ SoS scores sum to 1.
90
+
91
+ <table><tr><td>Model</td><td>Policy Accuracy</td><td>SoS v. DipNet temp=0.5</td><td>temp=0.1</td></tr><tr><td>DipNet (Paquette et al. (2019))</td><td>60.5%4</td><td>0.143</td><td></td></tr><tr><td>+ combined build orders &amp; encoder dropout + encoder changes from Anthony et al. (2020)</td><td>62.0% 62.4%</td><td>0.150</td><td>0.198</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>switch to webdiplomacy training data only</td><td>61.3%</td><td>0.175</td><td>0.206</td></tr><tr><td>+ output featurization</td><td>62.0%</td><td>0.184 0.183</td><td>0.188 0.205</td></tr><tr><td>+ improved GNN layer</td><td>62.4%</td><td></td><td></td></tr><tr><td>+ merged GNN trunk</td><td>62.9%</td><td>0.199</td><td>0.202</td></tr></table>
92
+
93
+ Table 1: Effect of model and training data changes on supervised model quality. We measure policy accuracy as well as average SoS score achieved by each agent against 6 of the original DipNet model. We measure the SoS scores in two settings: with all 7 agents sampling orders at a temperature of either 0.5 or 0.1.
94
+
95
+ ![](images/d0231dafd4b7597875a4de295857ab95a8cfcc1ccca58ecdd4153b083e0531b0.jpg)
96
+ Figure 1: Left: Score of SearchBot using different numbers of sampled subgame actions, against 6 DipNet agents ((Paquette et al., 2019) at temperature 0.1). A score of $1 4 . 3 \%$ would be a tie. Even when sampling only two actions, SearchBot dramatically outperforms our blueprint, which achieves a score of $2 0 . 2 \%$ . Middle: The effect of the number iterations of sampled regret matching on SearchBot performance. Right: The effect of different rollout lengths on SearchBot performance.
97
+
98
+ # 3.2 EQUILIBRIUM SEARCH
99
+
100
+ The policy that is actually played results from a search algorithm which utilizes the blueprint policy. Let $s$ be the current state of the game. On each turn, the search algorithm computes an equilibrium for a subgame and our agent plays according to its part of the equilibrium solution for its next action.
101
+
102
+ Conceptually, the subgame is a well-defined game that begins at state $s$ . The set of actions available to each player is a subset of the possible actions in state $s$ in the full game, and are referred to as the subgame actions. Each player $i$ chooses a subgame action $a _ { i }$ , resulting in joint subgame action $a$ . After $a$ is taken, the players make no further decisions in the subgame. Instead, the players receive a reward corresponding to the players sampling actions according to the blueprint policy $\pi ^ { b }$ for the remaining game.
103
+
104
+ The subgame actions for player $i$ are the $M k _ { i }$ highest-probability actions according to the blueprint model, where $k _ { i }$ is the number of units controlled by player $i$ and $M$ is a hyperparameter (usually set to 5). The effect of different numbers of subgame actions is plotted in Figure 1 (left).
105
+
106
+ Rolling out $\pi ^ { b }$ to the end of the game is very expensive, so in practice we instead roll out $\pi ^ { b }$ for a small number of turns (usually 2 or 3 movement phases in our experiments) until state $s ^ { \prime }$ is reached, and then use the value for $s ^ { \prime }$ from the blueprint’s value network as the reward vector. Figure 1 (right) shows the performance of our search agent using different rollout lengths. We do not observe improved performance for rolling out farther than 3 or 4 movement phases.
107
+
108
+ We compute a policy for each agent by running the sampled regret matching algorithm described in Section 2.2. The search algorithm used $2 5 6 - 4 { , } 0 9 6$ iterations of RM and typically required between 2 minutes and 20 minutes per turn using a single Volta GPU and 8 CPU cores, depending on the hyperparameters used for the game. Details on the hyperparameters we used are provided in Appendix G.
109
+
110
+ # 4 RESULTS
111
+
112
+ Using the techniques described in Section 3, we developed an agent we call SearchBot. Our experiments focus on two formats. The first evaluates the head-to-head performance of SearchBot playing against the population of human players on a popular Diplomacy website, as well as against prior AI agents. The second measures the exploitability of SearchBot.
113
+
114
+ # 4.1 PERFORMANCE AGAINST A POPULATION OF HUMAN PLAYERS
115
+
116
+ The ultimate test of an AI system is how well it performs in the real world with humans. To measure this, we had SearchBot anonymously play no-press Diplomacy games on the popular Diplomacy website webdiplomacy.net. Since there are 7 players in each game, average human performance is a score of $1 4 . 3 \%$ . In contrast, SearchBot scored $2 6 . 6 \% \pm 3 . 2 \%$ .6 Table 2 shows the agent’s performance and a detailed breakdown is presented in Table 6 in Appendix G. A qualitative analysis of the bot’s play by three-time world Diplomacy champion Andrew Goff is presented in Appendix I.
117
+
118
+ <table><tr><td>Power</td><td>Bot Score</td><td> Human Mean</td><td>Games</td><td>Wins</td><td>Draws</td><td>Losses</td></tr><tr><td>All Games</td><td>26.6% ± 3.2%</td><td>14.3%</td><td>116</td><td>16</td><td>43</td><td>57</td></tr></table>
119
+
120
+ Table 2: Average SoS score of our agent in anonymous games against humans on webdiplomacy.net. Average human performance is $1 4 . 3 \%$ . Score in the case of draws was determined by the rules of the joined game. The $\pm$ shows one standard error.
121
+
122
+ In addition to raw score, we measured SearchBot’s performance using the Ghost-Rating system (Anthony, 2020), which is a Diplomacy rating system inspired by the Elo system that accounts for the relative strength of opponents and that is used to semi-officially rank players on webdiplomacy.net. Among no-press Diplomacy players on the site, our agent ranked 17 out of 901 players with a Ghost-Rating of 183.4.7 Details on the setup for experiments are provided in Appendix G.
123
+
124
+ # 4.2 PERFORMANCE AGAINST OTHER AI AGENTS
125
+
126
+ In addition to playing against humans, we also evaluated SearchBot against prior AI agents from Paquette et al. (2019) (one based on supervised learning, and another based on reinforcement learning), our blueprint agent, and a best-response agent (BRBot). Table 3 shows these results. Following prior work, we compute average scores in ‘1v6’ games containing a single agent of type A and six agents of type B. The average score of an identical agent should therefore be $1 / 7 \stackrel { \cdot } { \approx } 1 4 . 3 \%$ . SearchBot achieves its highest 1v6 score when matched against its own blueprint, since it is most accurately able to approximate the behavior of that agent. It outperforms all three agents by a large margin, and none of the three baselines is able to achieve a score of more than $1 \%$ against our search agent.
127
+
128
+ BRBot is an agent that computes a best response to the blueprint policy in the subgame. Like SearchBot, BRBot considers the $M k _ { i }$ highest-probability actions according to the blueprint. Unlike SearchBot, BRBot searches over only its own actions, and rather than computing an equilibrium, it plays the action that yields the greatest reward assuming other powers play the blueprint policy.
129
+
130
+ Finally, we ran 25 games between one SearchBot and six copies of Albert (van Hal, 2013), the state-of-the-art rule-based bot. SearchBot achieved an average SoS score of $6 9 . 3 \%$ .
131
+
132
+ # 4.3 EXPLOITABILITY
133
+
134
+ While performance of an agent within a population of human players is the most important metric, that metric alone does not capture how the population of players might adapt to the agent’s presence.
135
+
136
+ Table 3: Average SoS scores achieved by each of the agents against each other. DipNet agents from (Paquette et al., 2019) and the Blueprint agent use a temperature of 0.1. BRBot scores higher than SearchBot against the Blueprint, but SearchBot outperforms BRBot in a head-to-head comparison.
137
+
138
+ <table><tr><td>1x↓6x→</td><td>DipNet</td><td>DipNet RL</td><td>Blueprint</td><td>BRBot</td><td>SearchBot</td></tr><tr><td>DipNet</td><td>1</td><td>6.7% ± 0.9%</td><td>11.6% ± 0.1%</td><td>0.1% ± 0.1%</td><td>0.7% ± 0.2%</td></tr><tr><td>DipNet RL</td><td>18.9% ±1.4%</td><td></td><td>10.5% ±1.1%</td><td>0.1% ±0.1%</td><td>0.6% ±0.2%</td></tr><tr><td>Blueprint</td><td>20.2% ±1.3%</td><td>7.5% ± 1.0%</td><td>-</td><td>0.3% ± 0.1%</td><td>0.9% ± 0.2%</td></tr><tr><td>BRBot</td><td>67.3% ± 1.0%</td><td>43.7% ± 1.0%</td><td>69.3% ± 1.7%</td><td></td><td>11.1% ±1.1%</td></tr><tr><td>SearchBot</td><td>51.1% ± 1.9%</td><td>35.2% ± 1.8%</td><td>52.7% ± 1.3%</td><td>17.2% ± 1.3%</td><td>-</td></tr></table>
139
+
140
+ For example, if our agent is extremely strong then over time other players might adopt the bot’s playstyle. As the percentage of players playing like the bot increases, other players might adopt a policy that seeks to exploit this playstyle. Thus, if the bot’s policy is highly exploitable then it might eventually do poorly even if it initially performs well against the population of human players.
141
+
142
+ Motivated by this, we measure the exploitability of our agent. Exploitability of a policy profile $\pi$ (denoted $e ( \pi ) )$ ) measures worst-case performance when all but one agents follows $\pi$ . Formally, the exploitability of $\pi$ is defined as $\begin{array} { r } { e ( \pi ) { \bf \bar { \Phi } } = \sum _ { i \in \mathcal { N } } ( \operatorname* { m a x } _ { \pi _ { i } ^ { * } } v _ { i } ( \pi _ { i } ^ { * } , \pi _ { - i } ) - { \bf \bar { \Phi } } v _ { i } ( \pi ) ) / N } \end{array}$ , where $\pi _ { - i }$ denotes the policies of all players other than $i$ . Agent $i$ ’s best response to $\pi _ { - i }$ is defined as $B R ( \pi _ { - i } ) =$ arg maxπi $v _ { i } ( \pi _ { i } , \pi _ { - i } )$ .
143
+
144
+ We estimate our agent’s full-game exploitability in two ways: by training an RL agent to best respond to the bot, and by having expert humans repeatedly play against six copies of the bot. We also measure the ‘local’ exploitability in the search subgame and show that it converges to an approximate Nash equilibrium.
145
+
146
+ # 4.3.1 PERFORMANCE AGAINST A BEST-RESPONDING AGENT
147
+
148
+ When the policies of all players but one are fixed, the game becomes a Markov Decision Process (MDP) (Howard, 1960) for the non-fixed player because the actions of the fixed players can be viewed as stochastic transitions in the “environment”. Thus, we can estimate the exploitability of $\pi$ by first training a best response policy $B R ( \pi _ { - i } )$ for each agent $i$ using any single-agent RL algorithm, and then computing $\begin{array} { r } { \sum _ { i \in \mathcal { N } } v _ { i } ( B R ( \pi _ { - i } ) , \pi _ { - i } ) / N } \end{array}$ . Since the best response RL policy will not be an exact best response (which is intractable to compute in a game as complex as no-press Diplomacy) this only gives us a lower-bound estimate of the exploitability.
149
+
150
+ Following other work on environments with huge action spaces (Vinyals et al., 2019; Berner et al., 2019), we use a distributed asynchronous actor-critic RL approach to optimize the exploiter policy (Espeholt et al., 2018). We use the same architecture for the exploiter agent as for the fixed model. Moreover, to simplify the training we initialize the exploiter agent from the fixed model.
151
+
152
+ We found that training becomes unstable when the policy entropy gets too low. The standard remedy is to use an entropy regularization term. However, due to the immense action space, an exact computation of the entropy term, $E _ { a } \log p _ { \theta } ( a )$ , is infeasible. Instead, we optimize a surrogate loss that gives an unbiased estimate of the gradient of the entropy loss (see Appendix D). We found this to be critical for the stability of the training.
153
+
154
+ Training an RL agent to exploit SearchBot is prohibitively expensive. Even when choosing hyperparameters that would result in the agent playing as fast as possible, SearchBot typically requires at least a full minute in order to act each turn. Instead, we collect a dataset of self-play games of SearchBot and train a supervised agent on this dataset. The resulting agent, which we refer to as SearchBot-clone, is weaker than SearchBot but requires only a single pass through the neural network in order to act on a turn. By training an agent to exploit SearchBot-clone, we can obtain a (likely) upper bound on what the performance would be if a similar RL agent were trained against SearchBot.
155
+
156
+ We report the reward of the exploiter agents against the blueprint and SearchBot-clone agents in Figure 2. The results show that SearchBot-clone is highly exploitable, with a best responder able to score at least $42 \%$ against SearchBot-clone. Any score above $1 4 . 3 \%$ means the best responder is winning in expectation. However, SearchBot-clone appears to be much less exploitable than the blueprint, which a best responder can beat with a score of at least $54 \%$ . Also, we emphasize again that SearchBot is almost certainly far less exploitable than SearchBot-clone.
157
+
158
+ ![](images/bc26077a58a58351b9784748f651bf9997b26e6c7d77ab4fd35ca42db834cec8.jpg)
159
+ Figure 2: Score of the exploiting agent against the blueprint and SearchBot-clone as a function of training time. We report the average of six runs. The shaded area corresponds to three standard errors. We use temperature 0.5 for both agents as it minimizes exploitability for the blueprint. Since SearchBot-clone is trained through imitation learning of SearchBot, the exploitability of SearchBot is almost certainly lower than SearchBot-clone.
160
+
161
+ # 4.3.2 PERFORMANCE AGAINST EXPERT HUMAN EXPLOITERS
162
+
163
+ In addition to training a best-responding agent, we also invited Doug Moore and Marvin Fried, the 1st and 2nd place finishers, respectively, in the 2017 World Diplomacy Convention (widely considered the world championship for full-press Diplomacy) to play games against six copies of our agent. The purpose was to determine whether the human experts could discover exploitable weaknesses in the bot.
164
+
165
+ The humans played games against three types of bots: DipNet (Paquette et al., 2019) (with temperature set to 0.5), our blueprint agent (with temperature set to 0.5), and SearchBot. In total, the participants played 35 games against each bot; each of the seven powers was controlled by a human player five times, while the other six powers were controlled by identical copies of the bot. The performance of the humans is shown in Table 4. While the sample size is relatively small, the results suggest that our agent is less exploitable than prior bots. Our improvements to the supervised learning policy reduced the humans’ score from $3 9 . 1 \%$ to $2 2 . 5 \%$ , which is itself a large improvement. However, the largest gains came from search. Adding search reduced the humans’ score from $2 2 . 5 \%$ to $5 . 7 \%$ . A score below $1 4 . 3 \%$ means the humans are losing on average.
166
+
167
+ <table><tr><td>Power</td><td></td><td>1Human vs. 6 DipNet1Human vs. 6 Blueprint1Human vs.6 SearchBot</td><td></td></tr><tr><td> All Games</td><td>39.1%</td><td>22.5%</td><td>5.7%</td></tr></table>
168
+
169
+ Table 4: Average SoS score of one expert human playing against six bots under repeated play. A score less than $1 4 . 3 \%$ means the human is unable to exploit the bot. Five games were played for each power for each agent, for a total of 35 games per agent. For each power, the human first played all games against DipNet, then the blueprint model described in Section 3.1, and then finally SearchBot.
170
+
171
+ # 4.3.3 EXPLOITABILITY IN LOCAL SUBGAME
172
+
173
+ We also investigate the exploitability of our agent in the local subgame defined by a given board state, sampled actions, and assumed blueprint policy for the rest of the game. We simulate 7 games between a search agent and 6 DipNet agents, and plot the total exploitability of the average strategy of the search procedure as a function of the number of RM iterations, as well as the exploitability of the blueprint policies. Utilities $u _ { i }$ are computed using Monte Carlo rollouts with the same (blueprint)
174
+
175
+ ![](images/1d173bf012ec5fa19f91ac011a980673978c5e914495bc2ef0cc0b7bd4fa5507.jpg)
176
+ Figure 3: Left: Distance of the RM average strategy from equilibrium as a function of the RM iteration, computed as the sum of all agents’ exploitability in the matrix game in which RM is employed. RM reduces exploitability, while the blueprint policy has only slightly lower exploitability than the uniform distribution over the 50 sampled actions used in RM (i.e. RM iteration 1). For comparison, our human evaluations used $2 5 6 { - } 2 0 4 8 ~ \mathrm { R M }$ iterations, depending on the time per turn. Right: Comparison of convergence of individual strategies to the average of two independently computed strategies. The similarity of these curves suggests that independent RM computations lead to compatible equilibria. Note: In both figures, exploitability is averaged over all phases in 28 simulated games; per-phase results are provided in Appendix E.
177
+
178
+ rollout policy used during RM, and total exploitability for a joint policy $\pi$ is computed as $e ( \pi ) =$ $\begin{array} { r } { \sum _ { i } \operatorname* { m a x } _ { a _ { i } \in \mathcal { A } _ { i } } u _ { i } \big ( a _ { i } , \pi _ { - i } \big ) - u _ { i } ( \pi ) } \end{array}$ . The exploitability curves aggregated over all phases are shown in Figure 3 (left) and broken down by phase in the Appendix.
179
+
180
+ In Figure 3 (right), we verify that the average of policies from multiple independent executions of RM also converges to an approximate Nash. For example, it is possible that if each agent independently running RM converged to a different incompatible equilibrium and played their part of it, then the joint policy of all the agents would not be an equilibrium. However, we observe that the exploitibility of the average of policies closely matches the exploitability of the individual policies.
181
+
182
+ # 5 CONCLUSIONS
183
+
184
+ No-press Diplomacy is a complex game involving both cooperation and competition that poses major theoretical and practical challenges for past AI techniques. Nevertheless, our AI agent achieves human-level performance in this game with a combination of supervised learning on human data and one-ply search using regret minimization. The massive improvement in performance from conducting search just one action deep matches a larger trend seen in other games, such as chess, Go, poker, and Hanabi, in which search dramatically improves performance. While regret minimization has been behind previous AI breakthroughs in purely competitive games such as poker, it was never previously shown to be successful in a complex game involving cooperation. The success of RM in no-press Diplomacy suggests that its use is not limited to purely adversarial games.
185
+
186
+ Our work points to several avenues for future research. SearchBot conducts search only for the current turn. In principle, this search could extend deeper into the game tree using counterfactual regret minimization (CFR) (Zinkevich et al., 2008). However, the size of the subgame grows exponentially with the depth of the subgame. Developing search techniques that scale more effectively with the depth of the game tree may lead to substantial improvements in performance. Another direction is combining our search technique with reinforcement learning. Combining search with reinforcement learning has led to tremendous success in perfect-information games (Silver et al., 2018) and more recently in two-player zero-sum imperfect-information games as well (Brown et al., 2020). Finally, it remains to be seen whether similar search techniques can be developed for variants of Diplomacy that allow for coordination between agents.
187
+
188
+ # ACKNOWLEDGEMENTS
189
+
190
+ We thank Kestas Kuliukas and the entire webdiplomacy.net team for their cooperation and for providing the dataset used in this research. We also thank Thomas Anthony, Spencer D., and Joshua M. for computing the agent’s Ghost-Rating. We additionally thank Doug Moore and Marvin Fried for participating in the human exploiter experiments in Section 4.3.2, and thank Andrew Goff for providing expert commentary on the bot’s play. Finally, we thank Jakob Foerster for helpful discussions.
191
+
192
+ # REFERENCES
193
+
194
+ Thomas Anthony. Ghost-ratings, 2020. URL https://sites.google.com/view/ webdipinfo/ghost-ratings.
195
+ Thomas Anthony, Tom Eccles, Andrea Tacchetti, János Kramár, Ian Gemp, Thomas C Hudson, Nicolas Porcel, Marc Lanctot, Julien Pérolat, Richard Everett, et al. Learning to play no-press diplomacy with best response policy iteration. arXiv preprint arXiv:2006.04635, 2020.
196
+ Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław D˛ebiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, et al. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019.
197
+ David Blackwell et al. An analog of the minimax theorem for vector payoffs. Pacific Journal of Mathematics, 6(1):1–8, 1956.
198
+ Noam Brown and Tuomas Sandholm. Superhuman AI for heads-up no-limit poker: Libratus beats top professionals. Science, pp. eaao1733, 2017.
199
+ Noam Brown and Tuomas Sandholm. Solving imperfect-information games via discounted regret minimization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 1829–1836, 2019a.
200
+ Noam Brown and Tuomas Sandholm. Superhuman AI for multiplayer poker. Science, pp. eaay2400, 2019b.
201
+ Noam Brown, Adam Lerer, Sam Gross, and Tuomas Sandholm. Deep counterfactual regret minimization. In International Conference on Machine Learning, pp. 793–802, 2019.
202
+ Noam Brown, Anton Bakhtin, Adam Lerer, and Qucheng Gong. Combining deep reinforcement learning and search for imperfect-information games. arXiv preprint arXiv:2007.13544, 2020.
203
+ Murray Campbell, A Joseph Hoane Jr, and Feng-hsiung Hsu. Deep Blue. Artificial intelligence, 134 (1-2):57–83, 2002.
204
+ Arpad E Elo. The rating of chessplayers, past and present. Arco Pub., 1978.
205
+ Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561, 2018.
206
+ André Ferreira, Henrique Lopes Cardoso, and Luis Paulo Reis. Dipblue: A diplomacy agent with strategic and trust reasoning. In ICAART International Conference on Agents and Artificial Intelligence, Proceedings, 2015.
207
+ Brandon Fogel. To whom tribute is due: The next step in scoring systems, 2020. URL http://windycityweasels.org/wp-content/uploads/2020/04/ 2020-03-To-Whom-Tribute-Is-Due-The-Next-Step-in-Scoring-Systems. pdf.
208
+ Amy Greenwald, Keith Hall, and Roberto Serrano. Correlated q-learning. In ICML, volume 20, pp. 242, 2003.
209
+ James Hannan. Approximation to bayes risk in repeated play. Contributions to the Theory of Games, 3:97–139, 1957.
210
+
211
+ Sergiu Hart and Andreu Mas-Colell. A simple adaptive procedure leading to correlated equilibrium. Econometrica, 68(5):1127–1150, 2000.
212
+
213
+ Johannes Heinrich and David Silver. Deep reinforcement learning from self-play in imperfectinformation games. arXiv preprint arXiv:1603.01121, 2016.
214
+
215
+ Ralf Herbrich, Tom Minka, and Thore Graepel. TrueskillTM: a bayesian skill rating system. In Advances in neural information processing systems, pp. 569–576, 2007.
216
+
217
+ Ronald A Howard. Dynamic programming and markov processes. 1960.
218
+
219
+ Junling Hu and Michael P Wellman. Nash q-learning for general-sum stochastic games. Journal of machine learning research, 4(Nov):1039–1069, 2003.
220
+
221
+ Stefan J Johansson and Fredrik Håård. Tactical coordination in no-press diplomacy. In International Joint Conference on Autonomous Agents and Multiagent Systems, pp. 423–430, 2005.
222
+
223
+ Sarit Kraus and Daniel Lehmann. Diplomat, an agent in a multi agent environment: An overview. In IEEE International Performance Computing and Communications Conference, pp. 434–435. IEEE Computer Society, 1988.
224
+
225
+ Sarit Kraus and Daniel Lehmann. Designing and building a negotiating automated agent. Computational Intelligence, 11(1):132–171, 1995.
226
+
227
+ Sarit Kraus, Eithan Ephrati, and Daniel Lehmann. Negotiation in a non-cooperative environment. Journal of Experimental & Theoretical Artificial Intelligence, 3(4):255–281, 1994.
228
+
229
+ Marc Lanctot, Kevin Waugh, Martin Zinkevich, and Michael Bowling. Monte carlo sampling for regret minimization in extensive games. In Advances in neural information processing systems, pp. 1078–1086, 2009.
230
+
231
+ Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. arXiv preprint arXiv:1702.03037, 2017.
232
+
233
+ Adam Lerer and Alexander Peysakhovich. Maintaining cooperation in complex social dilemmas using deep reinforcement learning. arXiv preprint arXiv:1707.01068, 2017.
234
+
235
+ 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.
236
+
237
+ Adam Lerer, Hengyuan Hu, Jakob Foerster, and Noam Brown. Improving policies via search in cooperative partially observable games. In AAAI Conference on Artificial Intelligence, 2020.
238
+
239
+ Michael L Littman. Friend-or-foe q-learning in general-sum games. In ICML, volume 1, pp. 322– 328, 2001.
240
+
241
+ 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.
242
+
243
+ Matej Moravcík, Martin Schmid, Neil Burch, Viliam Lis ˇ y, Dustin Morrill, Nolan Bard, Trevor \` Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in heads-up no-limit poker. Science, 356(6337):508–513, 2017.
244
+
245
+ John Nash. Non-cooperative games. Annals of mathematics, pp. 286–295, 1951.
246
+
247
+ Philip Paquette, Yuchen Lu, Seton Steven Bocco, Max Smith, O-G Satya, Jonathan K Kummerfeld, Joelle Pineau, Satinder Singh, and Aaron C Courville. No-press diplomacy: Modeling multi-agent gameplay. In Advances in Neural Information Processing Systems, pp. 4474–4485, 2019.
248
+
249
+ Yoav Shoham, Rob Powers, and Trond Grenager. Multi-agent reinforcement learning: a critical survey. Web manuscript, 2, 2003.
250
+
251
+ 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, 2016.
252
+
253
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
254
+
255
+ David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140– 1144, 2018.
256
+
257
+ Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E Schapire. Fast convergence of regularized learning in games. In Advances in Neural Information Processing Systems, pp. 2989–2997, 2015.
258
+
259
+ Gerald Tesauro. TD-Gammon, a self-teaching backgammon program, achieves master-level play. Neural computation, 6(2):215–219, 1994.
260
+
261
+ Jason van Hal. Diplomacy AI - Albert, 2013. URL https://sites.google.com/site/ diplomacyai/.
262
+
263
+ Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
264
+
265
+ Martin Zinkevich, Michael Johanson, Michael Bowling, and Carmelo Piccione. Regret minimization in games with incomplete information. In Advances in neural information processing systems, pp. 1729–1736, 2008.
266
+
267
+ In this section, we provide a full description of the model architecture used for the supervised Diplomacy agent.
268
+
269
+ ![](images/22e85ed3011177bc8e42f3d698966c93c72d67deda9be69b7bdce9c876d3a738.jpg)
270
+ Figure 4: Architecture of the model used for imitation learning in no-press. Diplomacy.
271
+
272
+ # Board State Encoding
273
+
274
+ 1.Unit Type (Army, Fleet, None)
275
+ 2.Unit PoWer (AUS,ENG,FRA,ITA,GER,RUS,TUR,None)
276
+ 3.Buildable, Removable
277
+ 4.Dislodged Unit Type (Army Fleet, None)
278
+ 5.Dislodged Unit Power (AUS,., TUR, None)
279
+ 6.Area Type (Land,Water, Coast)
280
+ 7.Supply Center Owner (AUS,., TUR, None)
281
+ 8.Season (Spring,Fall,Winter)
282
+ 9.Build Numbers(Integer value for each power)
283
+ 10.Press Type (NoPress,Press)
284
+
285
+ ![](images/cdd8c3b7b687bb9ee0b8020854001315f527dfb527298ebee868a35d322ba158.jpg)
286
+ Figure 5: Features used for the board state encoding.
287
+
288
+ ![](images/3f1461aade75355fdc682ff9977f383d03c2f43f5f5a30c81b86ce158153ee2a.jpg)
289
+ Figure 6: Architecture of an encoder GNN layer.
290
+
291
+ The model architecture is shown in Figure 4 . It consists of a shared encoder and separate policy and value decoder heads.
292
+
293
+ The input to the encoder is a set of features for each of the 81 board locations (75 regions $+ ~ 6$ coasts). The features provided for each location are shown in Figure 5. The first 7 feature types (35 features/location) match those of Paquette et al. (2019), and the last three feature types (in italics) are for global board features that are common across all locations: a 20-d embedding of the current season; the net number of builds for each power during a build phase; and a single feature identifying whether it is a no-press or full-press game.
294
+
295
+ The encoder has two parallel GNN trunks. The Current State Encoder takes the current board state as input, while the Previous State Encoder takes the board state features from the last movement phase, concatenated with a 20-dimensional feature at each location that is a sum of learned embeddings for each order that ocurred at this location during all phases starting at the last movement phase.
296
+
297
+ The current board state and previous board state are each fed to an 8-layer GNN, whose layer architecture is shown in Figure 6. The GraphConv operation consists of a separate learned linear transformation applied at each board location, followed by application of the normalized board adjacency matrix.8 In parallel with the GraphConv is a linear layer that allows the learning of a feature hierarchy without graph smoothing. This is followed by batchnorm, a ReLU non-linearity, and dropout probability 0.4. The $8 1 \times 1 2 0$ output features from each of these GNNs are then concatenated and fed to another 8-layer GNN with dimensional 240. The output of this encoder are 240 features for each board location.
298
+
299
+ The value head takes as input all $8 1 \times 2 4 0$ encoder features concatenated into a single 19440- dimensional vector. An MLP with a single hidden layer followed by a softmax produces predicted sum-of-squares values for each power summing to 1. They are trained to predict the final SoS values with an MSE loss function.
300
+
301
+ The policy head auto-regressively predicts the policy for a particular power one unit at a time with a 2-layer LSTM of width 200. Unit orders are predicted in the global order used by Paquette et al. (2019). The input to the LSTM at each step is the concatenation of (a) the 240-d encoder features of the location whose orders are being predicted; (b) a 60-d embedding of the power whose policy is being computed; (c) an 80-d embedding of the predicted orders for the last unit.
302
+
303
+ A standard decoder matrix can be thought of as a learned vector for each valid order, whose dot product with the LSTM output predicts the logit of the order probability given the state. We featurize these order vectors as shown in Figure 7. The decoder vector for “PAR S RUH - BUR” , for example, would be the sum of a learned vector for this order and learned linear transformations of (a) one-hot features for the order source (RUH), destination (BUR), type (S); and (b) the encoder features of the source (RUH) and destination (BUR) locations.
304
+
305
+ Build orders are different than other order types because the set of source locations for build orders is not known in advance. So the decoder needs to predict an unordered set of build orders during a build phase, which is tricky to compute correctly with an autoregressive decoder and teacher forcing. Luckily, since a power can only build in its 3-4 home supply centers, there are only 170 sets of build orders across all powers, so we just consider each possible set of builds as a single order, rather than predicting them one by one. We do not do featurized order decoding for build orders.
306
+
307
+ # B COMPUTING PLAYER RATINGS IN HUMAN DATA
308
+
309
+ To compute player ratings, we used a regularized logistic outcome model. Specifically, we optimize a vector of ratings s by gradient descent that minimizes the regularized negative log likelihood loss
310
+
311
+ $$
312
+ L ( \mathbf { s } | \mathcal { D } ) = \sum _ { ( i , j ) \in \mathcal { D } } - \log \sigma ( s _ { i } - s _ { j } ) + \lambda | \mathbf { s } | _ { 2 }
313
+ $$
314
+
315
+ over a dataset $\mathcal { D }$ consisting of all pairs of players $( i , j )$ where player $i$ achieved a "better" outcome than player $j$ in a game. We found this approach led to more plausible scores than Elo (Elo, 1978) or TrueSkill (Herbrich et al., 2007) ratings.
316
+
317
+ ![](images/59be53dda6ca23dd4af7b9c3b39b7dbcdffeb156ab0d7b9ed3f71eecf1b94e33.jpg)
318
+ Figure 7: Illustration of featurized order decoding.
319
+
320
+ Paquette et al. (2019) took an orthogonal approach to filter poor players from the training data: they only trained on "winning" powers, i.e. those who ended the game with at least 7 SCs. This filtering is sensible for training a policy for play, but is problematic for training policies for search. In a general-sum game, it is crucial for the agent to be able to predict the empirical distribution of actions even for other agents who are destined to lose.
321
+
322
+ # C SEARCH EXAMPLE
323
+
324
+ The listing below shows the policy generated by one run of our search algorithm for the opening move of Diplomacy when running for 512 iterations and considering 8 possible actions per power.
325
+
326
+ For each possible action, the listing below shows probs $:$ The probability of the action in the final strategy. bp_p : The probability of the action in the blueprint strategy. avg_u $:$ The average predicted sum-of-squares utility of this action. orders : The orders for this action
327
+
328
+ AUSTRIA avg_utility=0.15622 probs bp_p avg_u orders 0.53648 0.13268 0.15697 (’A VIE - TRI’, ’F TRI - ALB’, ’A BUD - SER’) 0.46092 0.52008 0.14439 (’A VIE - GAL’, ’F TRI - ALB’, ’A BUD - SER’) 0.00122 0.03470 0.14861 (’A VIE - TRI’, ’F TRI - ALB’, ’A BUD - GAL’) 0.00077 0.03031 0.11967 (’A VIE - BUD’, ’F TRI - ALB’, ’A BUD - SER’) 0.00039 0.05173 0.11655 (’A VIE - GAL’, ’F TRI S A VEN’, ’A BUD - SER’) 0.00015 0.04237 0.12087 (’A VIE - GAL’, ’F TRI H’, ’A BUD - SER’) 0.00007 0.14803 0.09867 (’A VIE - GAL’, ’F TRI - VEN’, ’A BUD - SER’) 0.00000 0.04009 0.03997 (’A VIE H’, ’F TRI H’, ’A BUD H’)
329
+
330
+ ENGLAND avg_utility=0.07112
331
+
332
+ 0.41978 0.20069 0.07151 (’F EDI - NTH’, ’F LON - ENG’, ’A LVP - YOR’)
333
+ 0.34925 0.29343 0.07161 (’F EDI - NWG’, ’F LON - NTH’, ’A LVP - YOR’)
334
+ 0.10536 0.06897 0.07282 (’F EDI - NTH’, ’F LON - ENG’, ’A LVP - WAL’)
335
+ 0.07133 0.36475 0.07381 (’F EDI - NWG’, ’F LON - NTH’, ’A LVP - EDI’)
336
+ 0.05174 0.01649 0.07202 (’F EDI - NTH’, ’F LON - ENG’, ’A LVP - EDI’)
337
+ 0.00249 0.00813 0.06560 (’F EDI - NWG’, ’F LON - NTH’, ’A LVP - WAL’)
338
+ 0.00006 0.00820 0.06878 (’F EDI - NWG’, ’F LON - ENG’, ’A LVP - EDI’)
339
+ 0.00000 0.03933 0.03118 (’F EDI H’, ’F LON H’, ’A LVP H’)
340
+
341
+ FRANCE avg_utility=0.21569
342
+
343
+ 0.92038 0.09075 0.21772 (’F BRE - MAO’, ’A PAR - GAS’, ’A MAR - BUR’)
344
+ 0.06968 0.42617 0.18878 (’F BRE - MAO’, ’A PAR - BUR’, ’A MAR S A PAR - BUR’)
345
+ 0.00917 0.07987 0.16941 (’F BRE - MAO’, ’A PAR - PIC’, ’A MAR - BUR’)
346
+ 0.00049 0.05616 0.16729 (’F BRE - ENG’, ’A PAR - BUR’, ’A MAR - SPA’)
347
+ 0.00023 0.17040 0.17665 (’F BRE - MAO’, ’A PAR - BUR’, ’A MAR - SPA’)
348
+ 0.00004 0.04265 0.18629 (’F BRE - MAO’, ’A PAR - PIC’, ’A MAR - SPA’)
349
+ 0.00001 0.09291 0.15828 (’F BRE - ENG’, ’A PAR - BUR’, ’A MAR S A PAR - BUR’)
350
+ probs bp_p avg_u
351
+ 0.39050 0.01382 0.21360
352
+ 0.38959 0.02058 0.21381
353
+ 0.16608 0.01628 0.21739
354
+ 0.04168 0.21879 0.21350
355
+ 0.01212 0.47409 0.21287
356
+ 0.00003 0.05393 0.14238
357
+ 0.00000 0.16896 0.13748
358
+ 0.00000 0.03355 0.05917
359
+
360
+ orders (’F KIE - DEN’, ’A MUN - TYR’, ’A BER - KIE’) (’F KIE - DEN’, ’A MUN S A PAR - BUR’, ’A BER - KIE’) (’F KIE - DEN’, ’A MUN H’, ’A BER - KIE’) (’F KIE - DEN’, ’A MUN - BUR’, ’A BER - KIE’) (’F KIE - DEN’, ’A MUN - RUH’, ’A BER - KIE’) (’F KIE - HOL’, ’A MUN - BUR’, ’A BER - KIE’) (’F KIE - HOL’, ’A MUN - RUH’, ’A BER - KIE’) (’F KIE H’, ’A MUN H’, ’A BER H’)
361
+
362
+ ITALY avg_utility=0.13444
363
+
364
+ probs bp_p avg_u orders
365
+ 0.41740 0.19181 0.13609 (’F NAP - ION’, ’A ROM - APU’, ’A VEN S F TRI’)
366
+ 0.25931 0.07652 0.12465 (’F NAP ION’, ’A ROM - VEN’, ’A VEN - TRI’)
367
+ 0.13084 0.29814 0.12831 (’F NAP ION’, ’A ROM - VEN’, ’A VEN - TYR’)
368
+ 0.09769 0.03761 0.13193 (’F NAP ION’, ’A ROM - APU’, ’A VEN - TRI’)
369
+ 0.09412 0.16622 0.13539 (’F NAP ION’, ’A ROM - APU’, ’A VEN H’)
370
+ 0.00034 0.05575 0.11554 (’F NAP - ION’, ’A ROM - APU’, ’A VEN - PIE’)
371
+ 0.00028 0.13228 0.10953 (’F NAP - ION’, ’A ROM - VEN’, ’A VEN - PIE’)
372
+ 0.00000 0.04167 0.05589 (’F NAP H’, ’A ROM H’, ’A VEN H’)
373
+
374
+ RUSSIA avg_utility=0.06623
375
+
376
+ probs bp_p avg_u orders
377
+ 0.64872 0.05988 0.06804 (’F STP/SC - FIN’, ’A MOS - UKR’, ’A WAR - GAL’, ’F SEV - BLA’)
378
+ 0.28869 0.07200 0.06801 (’F STP/SC - BOT’, ’A MOS - STP’, ’A WAR - UKR’, ’F SEV - BLA’)
379
+ 0.04914 0.67998 0.05929 (’F STP/SC - BOT’, ’A MOS - UKR’, ’A WAR - GAL’, ’F SEV - BLA’)
380
+ 0.01133 0.01147 0.05023 (’F STP/SC - BOT’, ’A MOS - SEV’, ’A WAR - UKR’, ’F SEV - RUM’)
381
+ 0.00120 0.02509 0.05008 (’F STP/SC - BOT’, ’A MOS - UKR’, ’A WAR - GAL’, ’F SEV - RUM’)
382
+ 0.00064 0.09952 0.05883 (’F STP/SC - BOT’, ’A MOS - STP’, ’A WAR - GAL’, ’F SEV - BLA’)
383
+ 0.00027 0.01551 0.04404 (’F STP/SC - BOT’, ’A MOS - SEV’, ’A WAR - GAL’, ’F SEV - RUM’)
384
+ 0.00000 0.03655 0.02290 (’F STP/SC H’, ’A MOS H’, ’A WAR H’, ’F SEV H’)
385
+
386
+ TURKEY avg_utility=0.13543
387
+
388
+ probs bp_p avg_u orders
389
+ 0.82614 0.25313 0.13787 (’F ANK - BLA’, ’A SMY - ARM’, ’A CON - BUL’)
390
+ 0.14130 0.00651 0.12942 (’F ANK - BLA’, ’A SMY - ANK’, ’A CON - BUL’)
391
+ 0.03080 0.61732 0.12760 (’F ANK - BLA’, ’A SMY - CON’, ’A CON - BUL’)
392
+ 0.00074 0.01740 0.11270 (’F ANK - CON’, ’A SMY - ARM’, ’A CON - BUL’)
393
+ 0.00069 0.05901 0.12192 (’F ANK - CON’, ’A SMY - ANK’, ’A CON - BUL’)
394
+ 0.00030 0.00750 0.11557 (’F ANK - CON’, ’A SMY H’, ’A CON - BUL’)
395
+ 0.00001 0.00598 0.10179 (’F ANK S F SEV - BLA’, ’A SMY - CON’, ’A CON - BUL’)
396
+ 0.00001 0.03314 0.04464 (’F ANK H’, ’A SMY H’, ’A CON H’)
397
+
398
+ D RL DETAILS
399
+
400
+ Each action $a$ in the MDP is a sequence of orders $\left( o _ { 1 } , \ldots , o _ { t } \right)$ . The probability of the order $a$ under policy $\pi _ { \theta }$ is defined by an LSTM in auto regressive fashion, i.e., $\begin{array} { r } { \pi _ { \theta } ( a ) = \prod _ { i = 1 } ^ { t } \bigl ( \pi _ { \theta } \bigl ( o _ { i } \vert o _ { 1 } \dots o _ { i - 1 } \bigr ) \bigr ) } \end{array}$ . To make training more stable, we would like to prevent entropy $H ( \pi _ { \theta } ) : = - E _ { a \sim \pi _ { \theta } } \log ( \pi _ { \theta } ( a )$ from collapsing to zero. The naive way to optimize the entropy of the joint distribution is to use a sum of entropies for each individual order, i.e., $\begin{array} { r } { \frac { d } { d \theta } H ( \pi _ { \boldsymbol { \theta } } ( \bullet ) ) \approx \sum _ { i = 1 } ^ { t } \frac { \dot { d } } { d \boldsymbol { \theta } } H ( \pi _ { \boldsymbol { \theta } } ( \bullet | o _ { 1 } \ldots o _ { i - 1 } ) ) } \end{array}$ . However, we found that this does not work well for our case probably because there are strong correlations between orders. Instead we use an unbiased estimate of the joint entropy that is agnostic to the size of the action space and requires only to be able to sample from a model and to adjust probabilities of the samples.
401
+
402
+ Statement 1. Let $\pi _ { \boldsymbol { \theta } } ( \bullet )$ be a probability distribution over a discrete set $A$ , such that $\forall a \in A \pi _ { \theta } ( a )$ is a smooth function of a vector of parameters $\theta$ . Then
403
+
404
+ $$
405
+ \frac { d } { d \theta } \left( H ( \pi _ { \theta } ( \bullet ) ) \right) = - E _ { a \sim \pi _ { \theta } } ( 1 + \log \pi _ { \theta } ( a ) ) \frac { d } { d \theta } \log \pi _ { \theta } ( a ) .
406
+ $$
407
+
408
+ Proof. Proof is similar to one for REINFORCE:
409
+
410
+ $$
411
+ \begin{array} { r l } { \frac { d } { d t } ( \mathcal { W } ( \{ \mathbf { x } \} ( \omega ) ( s ) ) ) } & { = \frac { d } { d t } ( - F _ { \mathrm { e x c , \omega , \Psi } } \log \log ( \omega ) ) } \\ { = } & { - \frac { d } { d t } ( \sum _ { \mathbf { x } \in \mathcal { X } _ { \neq } } \omega _ { \mathbf { x } } \log ( s ) \cup \mathbf { x } _ { \mathbf { x } } ) } \\ { = } & { - \frac { d } { \sqrt { d s } } ( \frac { d } { d t } ) \mathrm { e x c } ( \omega ) \mathrm { d } \mathbf { x } \mathrm { g } _ { \mathbf { x } } \mathrm { \cdot } } \\ { = } & { - \sum _ { \mathbf { x } \in \mathcal { X } _ { \neq } } ( \frac { d } { d t } ) \mathrm { e x c } ( \omega ) \mathrm { d } \mathbf { x } \mathrm { g } _ { \mathbf { x } } \mathrm { \cdot } } \\ { = } & { - \sum _ { \mathbf { x } \neq \mathbf { x } } ( \omega ) \frac { d } { d t } \mathrm { e x c } ( \omega ) + \log \mathrm { r c } ( \omega ) \mathrm { d } \frac { d } { d t } \mathrm { e x c } ( \omega ) \mathrm { d } \frac { d } { d t } \mathrm { e x c } ( \omega ) ) } \\ { = } & { - \sum _ { \mathbf { x } \neq \mathbf { x } } ( \omega ) \frac { d } { d t } \mathrm { e x c } ( \omega ) + \log \mathrm { r c } ( \omega ) \mathrm { d } \mathrm { e x c } ( \omega ) \mathrm { d } \frac { d } { d t } \mathrm { e x c } ( \omega ) \mathrm { d } \frac { d } { d t } \mathrm { e x c } ( \omega ) ) } \\ { = } & { - \sum _ { \mathbf { x } \neq \mathbf { x } } ( \omega ) ( ( 1 + \log \mathrm { r c } ( \omega ) ) \frac { d } { d t } \mathrm { e x c } ( \omega ) \mathrm { d } \frac { d } { d t } ) } \\ & { - \sum _ { \mathbf { x } \neq \mathbf { x } } ( \omega ) ( 1 + \log \mathrm { r c } ( \omega ) ) \frac { d } { d t } \mathrm { e x c } ( \omega ) } \\ { = } & - \mathrm { e x c } ( \omega ) \mathrm { d } \frac { d } { d t } \mathrm { e x c } ( \omega ) \mathrm { d } \end{array}
412
+ $$
413
+
414
+ # E SUBGAME EXPLOITABILITY RESULTS
415
+
416
+ Figure 8 plots the total exploitability of joint policies computed by RM in the subgame used for equilibrium search at each phase in 7 simulated Diplomacy games.
417
+
418
+ # F PLAYING ACCORDING TO THE FINAL ITERATION’S POLICY IN RM
419
+
420
+ As described in Section 2.2, in RM it is the average policy over all iterations that converges to an equilibrium, not the final iteration’s policy. Nevertheless, in our experiments we sample an action from the final iteration’s policy. This technique has been used successfully in past poker agents (Brown & Sandholm, 2019b). At first glance this modification may appear to increase exploitability because the final iteration’s policy is not an equilibrium and in practice is often quite pure. However, in this section we provide evidence that sampling from the final iteration’s policy when using a Monte Carlo version of RM may lower exploitability compared to sampling from the average policy, and conjecture an explanation.
421
+
422
+ Critically, in the sampled form of RM the final iteration’s policy depends on the random seed, which is unknown to the opponents (while we assume opponents have access to our code, we assume they do not have access to our run-time random seeds). Therefore, the opponent is unlikely to be able to predict the final iteration’s policy. Instead, from the opponent’s perspective, the policy we play is sampled from an average of final-iteration policies from all possible random seeds. Due to randomness in the behavior of sampled RM, we conjecture that this average has low exploitability.
423
+
424
+ To measure whether this is indeed the case, we ran sampled RM for 256 iterations on two Diplomacy situations (the first turn in the game and the second turn in the game) using 1,024 different random seeds, and averaged together the final iteration of each run. We also ran sampled RM on two random matrix games with 10,000 different random seeds. The results, shown in Table 5, confirm that averaging the final iteration over multiple random seeds leads to low exploitability.
425
+
426
+ We emphasize that while we measured exploitability in these experiments by running sampled regret matching over multiple random seeds, we only need to run it for a single random seed in order to achieve this low exploitability because the opponents do not know which random seed we use. Unfortunately, measuring the exploitability of the final iteration over 1,024 random seeds is about $1 { , } 0 2 4 \mathrm { x }$ as expensive as measuring the exploitability of the average strategy over all iterations (and even 1,024 seeds would provide only an approximate upper bound on exploitability, since computing the true exploitability would require averaging over all possible random seeds). Therefore, in order to keep the computation tractable, we measure the exploitability of the average strategy of single runs in Figure 3.
427
+
428
+ ![](images/718675c2fee4580995a8970fd192425c61c10e7e279b5cd1d583d51387d008fb.jpg)
429
+ Figure 8: Exploitability as a function of RM iteration at each phase of 7 simulated games with our search agent (until the game ends or the search agent is eliminated). Aggregate results in Figure 3.
430
+
431
+ Table 5: Exploitability of 256 iterations of RM using either the final iteration’s policy or the average iteration’s policy, and either using the policy from a single run or the policy average over multiple runs. Subgame 1 and Subgame 2 are subgames from Diplomacy S1901 and F1901, respectively. $1 0 \mathrm { x } 1 0$ Random and $1 0 0 \mathrm { x } 1 0 0$ Random are random matrix two-player zero-sum games with entries having value in $[ 0 , 1 )$ sampled uniformly randomly. For Subgame 1 and Subgame 2, “Ave. of Final Policies” and “Ave. of Ave. Policies” are the average of 1,024 runs with different random seeds. For $1 0 \mathrm { x } 1 0$ Random and $1 0 0 \mathrm { x } 1 0 0$ Random, 10,000 seeds were used.
432
+
433
+ <table><tr><td>Method</td><td> Subgame 1</td><td> Subgame 2</td><td>10x10 Random</td><td>100x100 Random</td></tr><tr><td>Ave.of Final Policies</td><td>0.00038</td><td>0.0077</td><td>0.019</td><td>0.063</td></tr><tr><td>Ave. of Ave.Policies</td><td>0.00027</td><td>0.0074</td><td>0.035</td><td>0.092</td></tr><tr><td>Single Ave. Policy</td><td>0.00065</td><td>0.0140</td><td>0.078</td><td>0.225</td></tr><tr><td>Single Final Policy</td><td>0.00880</td><td>0.0580</td><td>0.478</td><td>0.706</td></tr></table>
434
+
435
+ # G DETAILS ON EXPERIMENTAL SETUP
436
+
437
+ Most games on webdiplomacy.net were played with 24-hour turns, though the agent also played in some “live” games with 5-minute turns. Different hyperparameters were used for live games versus non-live games. In non-live games, we typically ran RM for 2,048 iterations with a rollout length of 3 movement phases, and set $M$ (the constant which is multiplied by the number of units to determine the number of subgame actions) equal to 5. This typically required about 20 minutes to compute. In live games (including games in which one human played against six bots) and in games against non-human opponents, we ran RM for 256 iterations with a rollout length of 2 movement phases, and set $M$ equal to 3.5. This typically required about 2 minutes to compute. In all cases, the temperature for the blueprint in rollouts was set to 0.75.
438
+
439
+ Table 6: Average SoS score of our agent in anonymous games against humans on webdiplomacy.net. Average human performance is $1 4 . 3 \%$ . Score in the case of draws was determined by the rules of the joined game. The $\pm$ shows one standard error. Average human performance was calculated based on SoS scoring of historical games on webdiplomacy.net.
440
+
441
+ <table><tr><td>Power</td><td>Score</td><td>Human Mean</td><td>Games</td><td>Wins</td><td>Draws</td><td>Losses</td></tr><tr><td>All Games</td><td>26.6% ± 3.2%</td><td>14.3%</td><td>116</td><td>16</td><td>43</td><td>57</td></tr><tr><td>Normalized By Power</td><td>26.9% ± 3.3%</td><td>14.3%</td><td>116</td><td>16</td><td>43</td><td>57</td></tr><tr><td>Austria</td><td>31.4% ± 9.4%</td><td>11.0%</td><td>17</td><td>3</td><td>6</td><td>8</td></tr><tr><td>England</td><td>38.0% ±10.1%</td><td>12.6%</td><td>16</td><td>4</td><td>6</td><td>6</td></tr><tr><td>France</td><td>19.0% ± 6.2%</td><td>16.9%</td><td>19</td><td>1</td><td>8</td><td>10</td></tr><tr><td>Germany</td><td>36.8% ± 8.0%</td><td>15.0%</td><td>16</td><td>2</td><td>10</td><td>4</td></tr><tr><td>Italy</td><td>31.5% ± 10.5%</td><td>11.6%</td><td>14</td><td>3</td><td>5</td><td>6</td></tr><tr><td>Russia</td><td>17.6% ± 7.6%</td><td>14.8%</td><td>18</td><td>2</td><td>4</td><td>12</td></tr><tr><td>Turkey</td><td>14.6% ± 7.0%</td><td>18.2%</td><td>16</td><td>1</td><td>4</td><td>11</td></tr></table>
442
+
443
+ The experiments on webdiplomacy.net occurred over a three-month timespan, with games commonly taking one to two months to complete (players are typically given 24 hours to act). Freezing research and development over such a period would have been impractical, so our agent was not fixed for the entire time period. Instead, serious bugs were fixed, improvements to the algorithm were made, and the model was updated.
444
+
445
+ In games on webdiplomacy.net, a draw was submitted if SearchBot did not gain a center in two years, or if the agent’s projected sum-of-squares score was less than the score it would achieve by an immediate draw. Since there was no way to submit draws through the webdiplomacy.net API, draws were submitted manually once the above criteria was satisfied. Games against other bots, shown in Table 3, automatically ended in a draw if no player won by 1935.
446
+
447
+ <table><tr><td>Power</td><td>1 Human vs.6DipNet</td><td>1 Human vs. 6 Blueprint</td><td>1Human vs. 6 SearchBot</td></tr><tr><td>All Games</td><td>39.1%</td><td>22.5%</td><td>5.7%</td></tr><tr><td>Austria</td><td>40%</td><td>20%</td><td>0%</td></tr><tr><td>England</td><td>28.4%</td><td>20%</td><td>0%</td></tr><tr><td>France</td><td>20%</td><td>4.3%</td><td>40%</td></tr><tr><td>Germany</td><td>40%</td><td>33%</td><td>0%</td></tr><tr><td>Italy</td><td>60%</td><td>20%</td><td>0%</td></tr><tr><td>Russia</td><td>40%</td><td>20%</td><td>0%</td></tr><tr><td>Turkey</td><td>45.1%</td><td>40%</td><td>0%</td></tr></table>
448
+
449
+ Table 7: Average SoS score of one expert human playing against six bots under repeated play. A score less than $1 4 . 3 \%$ suggests the human is unable to exploit the bot. Five games were played for each power for each agent, for a total of 35 games per agent. For each power, the human first played all games against DipNet, then the blueprint model described in Section 3.1, and then finally SearchBot.
450
+
451
+ # H QUALITATIVE ASSESSMENT OF SEARCHBOT
452
+
453
+ Qualitatively, we observe that SearchBot performs particularly well in the early and mid game. However, we observe that it sometimes struggles with endgame situations. In particular, when it is clear that one power will win unless the others work together to stop it, SearchBot will sometimes continue to attack its would-be allies. There may be multiple contributing factors to this. One important limitation, which we have verified in some situations, is that the sampled subgame actions may not contain any action that could prevent a loss. This is exacerbated by the fact that players typically control far more units in the endgame and the number of possible actions grows exponentially with the number of units, so the sampled subgame actions contain a smaller fraction of all possible actions. Another possible contributing factor is that the state space near the end of the game is far larger, so there is relatively less data for supervised learning in this part of the game. Finally, another possibility is that because the network only has a dependence on the state of the board and the most recent player actions, it is unable to sufficiently model the future behavior of other players in response to being attacked.
454
+
455
+ Although the sample size is small, the results suggest that SearchBot performed particularly well with the central powers of Austria, Germany, and Italy. These powers are considered to be the most difficult to play by humans because they are believed to require an awareness of the interactions between all players in the game.
456
+
457
+ # I ANECDOTAL ANALYSIS OF GAMES BY EXPERT HUMAN
458
+
459
+ Below we present commentary from Andrew Goff, three-time winner of the world championship for Diplomacy. The comments are lightly edited for clarity. This is intended purely as anecdotal commentary from a selection of interesting games.
460
+
461
+ # GAME 1
462
+
463
+ http://webdiplomacy.net/board.php?gameID=319258 (bot as Germany)
464
+
465
+ The bot is doing a lot of things right here, particularly if they are playing for an 18. The opening to Tyrolia is stronger than most players realise, and the return to defend Munich is exactly how to play it. Building 2 fleets is hyper-aggressive but in Gunboat it is a good indication move, particularly after the early fight between England and France. 1902 the board breaks very favourably for Germany, but its play is textbook effective. The bounce in Belgium in Fall is a very computer move. . . 9/10 times it bounces as it does in the game, but the 1/10 times it is a train wreck, as England retreats to Holland and France is angry so it is a risk human players don’t often take.
466
+
467
+ 1903 is a bit wilder. The play in the North is solid (Scandinavia is more important than England centres – I agree) but the move to Burgundy seems premature. In gunboat it is probably fine, but why not Ruhr then Belgium? Why not give France greater opportunity to suicidally help you against
468
+
469
+ England and Italy. I suspect this is an artefact of being trained against other AI that would not do that?
470
+
471
+ 1904 has a nice convoy (to Yorkshire) and strong moves over the line into Russia. It is all good play, but in fairness the defences put up by the opponents are weak. After that the next few years are good consolidations – a little fidgety in Norway but not unreasonable. 1907 see Turkey dot9 Russia and from here you should expect an $1 8 - { \mathrm { a } }$ terrible move by Turkey. It should be all over now and it is just clean-up. Even as Turkey and Russia patch things up quite quickly, Turkey picks off an Italian centre and now it really is all over. France collapses, Germany cleans up professionally, and score one for AI.
472
+
473
+ Overall, Germany’s play was aggressive early and then clinical late. Some pretty bad errors by Turkey gave Germany the chance, and they took it. 9/10
474
+
475
+ # GAME 2
476
+
477
+ http://webdiplomacy.net/board.php?gameID $=$ 319189 (bot as Italy)
478
+
479
+ Spoiler Alert: this one isn’t so good. The opening is sleepy and the attack on Vienna in 1902 is just wrong against human players. Then the whole rest of the board is playing terribly too – Austria goes for a Hail Mary by attacking their only potential ally. . . Turkey tries a convoy that if it had worked would suggest collusion. . . this is all terrible. Now everyone is fighting everyone and meanwhile Germany and France have cleaned up England. By 1905 at least the AI has given up attacking Austria for the time being – picking the competent over the nonsense – and the day is saved as France and Germany descend into brawling over the spoils.
480
+
481
+ It doesn’t last. Another year another flip/flop. The same attempted trick again (move to Pie then up to Tyrol). Italy requires patience and the AI is showing none at all. Austria gets around to Armenia – they’re playing OK tactically but they have a mad Italian hamstringing them both. Meanwhile France is now officially on top and will present a solo threat soon. The start of 1908 sees Italy finally making some progress against Austria, but France is too big now. . . it is all strategically a mess from 1902 onward and it shows. As a positive though, some of the tactics here are first rate. . . Nap – Alb is tidy, the progress that is being made against Austria is good in isolation.
482
+
483
+ Then follows 8 years of stalemate tactics none of which is interesting. Italy played well, was lucky Turkey didn’t take their centres at the death, and that’s all there is.
484
+
485
+ Overall, I’d say this looked like a human player. And just like most human players: rubbish at Italy. 3/10
486
+
487
+ # GAME 3
488
+
489
+ http://webdiplomacy.net/board.php?gameID $=$ 318752 (bot as Austria)
490
+
491
+ I was about to say 1901 was all boring and then the AI in Austria has built a fleet. That’s wild. With Italy attacking France it isn’t unreasonable. . . but still. Anyhow as the game continues into 1903 he deploys that fleet beautifully. Italy just doesn’t care about it – which is strategically very poor by them. The weird thing here is that Austria seems more intent on attacking Russia than Turkey. If you have the second fleet then surely Turkey is the objective, otherwise you’re splitting forces a lot. In gunboat it is. . . passable. In non-Gunboat this is all-but suicidal. If RT get their heads together they’ll belt Austria, but as we see in this game they don’t so Austria does well from it. It’s similar to game 1 in that this is the most aggressive way to play.
492
+
493
+ One thing really stands out here and that is that the AI is making the moves that are most likely to result in an error by the opponent (See: Turkey, S1904). This is present elsewhere but this turn captures it beautifully. Why did Smyrna go to Con? What a shocker. But without moves that can take advantage of errors like this it doesn’t matter. Italy also makes a key mistake here: Mar holds instead of $ \mathrm { G a s }$ . They’ve lost momentum on the turn Austria gains a lot. In Fall Austria builds 3 armies and Italy gets nothing and the chance is there to solo.
494
+
495
+ The stab comes immediately and appropriately, and Austria has a fleet in the Black Sea and Aegean. Italy is a turn too late into the Northern French centres. There is a subtle problem to the AI’s play here though, not seen in the Germany game. There’s no effort to move over the stalemate positions. At this point in the German game it moved aggressively into Russia. . . here it ignores Germany and aims for the Russian centres again and that shows a lack of awareness of where the 18th centre must come from.
496
+
497
+ The game continues and Austria cleans up the Eastern centres very effectively. I like ignoring the German move to Tyrolia and Vienna – not very human but also very correct (as we will see – there’s nothing there to support it so it just gets yeeted in Spring 1908. However, Spring 1908 has a tactical error (one of the few outright wrong moves I’ve seen!) where:
498
+
499
+ Gre s Adr – Ion; Aeg s Adr – Ion; Adr – Ion.
500
+
501
+ You only need one support and Adriatic is more useful than Greece. . . so better is: Gre – Ion; Aeg s Gre – Ion; Adr – Apu.
502
+
503
+ This allows Nap – Rom; Apu – Nap next turn. A very odd mistake as this is the kind of detail I’d expect AI to do better than human. Ultimately it doesn’t matter so much as Italy is going to concede Tunis to set up a rock-solid defence of Spa/Mar. But still.
504
+
505
+ And now. . . . The ultimate “Not good”. For four turns in a row England fails to defend StP correctly and the AI misses it and therefore the chance to get 18. England is attacking Livonia with 3 and moving only one unit into StP behind it. Germany is not cutting Prussia. So:
506
+
507
+ Pru s Lvn, War s Lvn, Lvn s Mos – StP, Mos – StP
508
+
509
+ And Austria gets an 18. This is a really bad miss by the AI (not to mention England). As in every decent human player or better would have got an 18 here.
510
+
511
+ Overall, Austria played a really good game but didn’t do some of the things I had high hopes for after game 1 – they didn’t move over the stalemate and they didn’t play as tactically precisely. Then the miss at the end. . . makes me feel good about being human. 7/10 until the last move, but in the end 5/10.
512
+
513
+ # GAME 4
514
+
515
+ http://webdiplomacy.net/board.php?gameID=318726 (bot as Russia)
516
+
517
+ StP – Fin. Cute. The whole board just completely opens in the other direction from Russia so they get 7 centres at the end of 1901. I wish that happened to me when I played Russia. Of course, now everyone moves against Russia so we’ll see how the AI defends. Italy has just demolished France, which makes this a strange game strategically too.
518
+
519
+ F1903 you could write a whole article on. What it looks like is Russia and Turkey successfully signalling “alliance” and that is impressive for an AI. The tactics are good – ignoring Warsaw to get Budapest, but the bounce in Sweden and drop to Baltic not so much. Why England didn’t support Den – Swe is a mystery and it is probably all over for Russia if they do. But they didn’t so play on.
520
+
521
+ The English play from here on is just great. F1905 the move through Swe – Den is the height of excellence. It obviously helped Russia too, but from an awful position there is now real potential. . . what a great move. Focussing on the AI – it just gets the tactics right. It pushes Germany back and nails the timing to take Vienna. But then it builds a Fleet in Sev. No no no. An Army in Sev is better tactically and it also doesn’t tip off the Turk. Just as it got the signalling right earlier it got it exactly wrong here.
522
+
523
+ In the end the Turk starts blundering under pressure so as the kids say: “Whatever”. The F1906 move of Adr – Alb instead of supporting Tri is egregiously bad and turns a bad position into a terrible one. They proceed to self-immolate and Russia and Italy are cruising now, and England’s play remains first class. The clean-up of Turkish dots is effective, and then the rest is quite boring.
524
+
525
+ The biggest thing that struck me about this game (apart from England’s brilliant recovery) was that Russia didn’t manage unit balance well. Disbanding their only Northern fleet was a long-term error even if it made the most sense at the time; build F Sev instead of A Sev. . . and then ironically being left with too few Southern Fleets anyhow. Russia is hard like that, but the AI played no better than a good human player on that score. To give a practical example – England never had enough Fleets to blow up F Bal, so if you swap A Pru for F Bal then this is a real chance at an 18.
526
+
527
+ Overall, an interesting game characterised by the best and worst of human play (England/Turkey) and a strong but flawed game by the AI. 7/10.
528
+
529
+ # GAME 5
530
+
531
+ http://webdiplomacy.net/board.php?gameID $=$ 318335 (bot as France)
532
+
533
+ Right off the bat I am biased as I love this kind of opening as France. The Fleet in English Channel is not good news though. We get to see defence from the AI, and frankly the next 5 years are boring as we watch a clinical tactics lesson. About F1906/S1907 there needed to be a pivot to help Italy and stop attacking Germany in order to stop the 18, and it just never came. What had been a good display of defence turned into a disaster of AI greed and lack of appreciation for the risk of another player getting an 18. Not only did the AI allow the 18 to happen, but it can fairly reasonably be blamed for it. I think this is something in the reward conditions you might need to look at, as this play makes no sense – it isn’t even worth digging into it further here – it is just flat out strategically wrong.
534
+
535
+ Overall, good tactics but terrible game awareness and strategy. 2/10.
536
+
537
+ GAME 6
538
+
539
+ http://webdiplomacy.net/board.php?gameID $=$ 318329 (bot as England)
540
+
541
+ This is more like it. In fact, I think this is the best game of Gunboat I’ve seen in ages. There’s a pressure and inevitability about it from about 1903 onward. . . Turkey is aggravating everyone near them, and England is moving in second and having people just let it take their centres – it outplays Germany (and punishes F Kie – Hol by bouncing Denmark. . . heartily approved), then Russia and Austria just walk out of their centres for it. This makes the attack against France with Italy easy. The game should draw at this point, but Turkey just can’t help themselves and stabs Italy when England is already on 15 – terrible, inexcusable play. Italy doesn’t even turn around to fight Turkey, but it doesn’t matter as there are just too many disbands and Turkey’s armies are not fast enough to get to the front.
542
+
543
+ It’s an 18 and it is going on 34. Solo victories are usually caused by someone else making terrible play and this is no exception – Turkey was awful. But they also require precise play by the winner. The AI delivered. Even though this is not the style I prefer to play England as, every move makes sense. The builds are precise, the critical moments are executed perfectly (For example: S1908 convoy Lon – Pic, then ignoring Holland to force English Channel. . . that’s a high level play right there) and the sense of not attacking Russia when given the chance a few times is [chef’s kiss]. Then, above all, the presence to stop building fleets and get the armies rolling – this is the inflection point of great England play and it caught Turkey off guard – as they built another fleet, then an army that moved to Armenia, England rushed the middle of the board and Turkey just can’t cover all the gaps alone. This opened the door to “The Mistake” and Turkey walked right through it.
544
+
545
+ This is the easiest game to analyse because there’s just no glaring mistakes by the AI and it takes correct advantage of the situation throughout. This is the only game that made me think the AI could eventually consistently beat human players. As impressive as the German game was it was hyper-win-oriented so it is high risk/high reward. This. . . this is just excellent Gunboat Diplomacy from start to finish.
546
+
547
+ Overall – superb. 10/10.
548
+
549
+ GAME 7
550
+
551
+ http://webdiplomacy.net/board.php?gameID $=$ 319187 (bot as Austria)
552
+
553
+ Sometimes you just get killed.
554
+
555
+ I saw the first four turns and thought “this will be over by $1 9 0 5 '$ but to my delight the AI fought it out bravely and also did its very best to try and get back in the game – rather than accepting being tucked in Greece it made a run for a home centre and then did everything it could to get a second build. All to no avail in the end, but the play is hard to fault.
556
+
557
+ Obviously this is a shorter review as there really isn’t anything to see here. But as a finishing thought it will be this challenge that an AI faces most when it starts playing with natural language as well as just gunboat. In gunboat it is just a crap shoot who gets attacked early and how vicious it is; in non-gunboat this is a factor very much in control of the player. I think the AI has proven tactically savvy enough to cut it once it gets a start, but will it get starts in non-gunboats?
558
+
559
+ Overall – just forget this game ever happened, the same as any good human player would. 5/10.
md/train/1_gaHBaRYt/1_gaHBaRYt.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Fast Federated Learning in the Presence of Arbitrary Device Unavailability
2
+
3
+ Xinran Gu∗ IIIS Tsinghua University gxr21@mails.tsinghua.edu.cn
4
+
5
+ Kaixuan Huang∗ ECE Princeton University kaixuanh@princeton.edu
6
+
7
+ Jingzhao Zhang EECS Massachusetts Institute of Technology jzhzhang@mit.edu
8
+
9
+ Longbo Huang† IIIS Tsinghua University longbohuang@tsinghua.edu.cn
10
+
11
+ # Abstract
12
+
13
+ Federated Learning (FL) coordinates with numerous heterogeneous devices to collaboratively train a shared model while preserving user privacy. Despite its multiple advantages, FL faces new challenges. One challenge arises when devices drop out of the training process beyond the control of the central server. In this case, the convergence of popular FL algorithms such as FedAvg is severely influenced by the straggling devices. To tackle this challenge, we study federated learning algorithms under arbitrary device unavailability and propose an algorithm named Memory-augmented Impatient Federated Averaging (MIFA). Our algorithm efficiently avoids excessive latency induced by inactive devices, and corrects the gradient bias using the memorized latest updates from the devices. We prove that MIFA achieves minimax optimal convergence rates on non-i.i.d. data for both strongly convex and non-convex smooth functions. We also provide an explicit characterization of the improvement over baseline algorithms through a case study, and validate the results by numerical experiments on real-world datasets.
14
+
15
+ # 1 Introduction
16
+
17
+ Federated learning is a machine learning setting in which a central server coordinates with a large number of devices to collectively train a shared model [28, 34, 20, 33, 25, 26]. Practical advantages of this training scheme are mainly twofold. First, each device keeps the private data locally and hence preserves its data privacy. Second, federated learning can make use of idle computing resources and lower computation costs. Although federated learning successfully scales up with data sizes and accelerates training via more affordable computing power [43, 38, 36], the collaborative setup leads to new challenges due to large variations among individual computing devices. Our work aims to formulate and investigate the impact of device variations on FL from an optimization perspective.
18
+
19
+ In FL, a device can differ from its peers in multiple aspects [17, 25]. First, the data distribution and local task can be different among devices. To address the data variation, non-i.i.d. objective models were proposed and analyzed by [26, 18, 19, 42, 25]. We follow this line of work and formulate our optimization objective as a sum of stochastic functions on individual devices (See Eqn. (1)).
20
+
21
+ A second variation among devices is caused by different computing and communication speeds. One natural way to formulate the variation in computation speeds is to allow asynchronous updates and model the updates as delayed responses. Lots of novel research has studied the problem with different delay models, e.g., [35, 4, 27, 11, 45, 1, 5, 13]. However, the delayed setup assumes that all devices make roughly the same number of (delayed) responses in the end. This behavior may deviate largely from the FL practice, where each device, e.g., personal cell phones, can have very different active duration when participating in the FL training, and hence make different numbers of responses. For this reason, our work aims to address this third discrepancy among devices caused by individual availability patterns.
22
+
23
+ The third device heterogeneity caused by different availability patterns is less studied in optimization for federated learning problems. In this model, instead of making a delayed response, devices can abort the training halfway, e.g., due to battery level, incoming calls, etc, and fail to return their responses upon the central server’s requests [28, 7, 17]. To handle missing responses, researchers propose algorithms where the central server may collect responses from only a fraction of the devices and make updates [18, 28, 42, 25, 26, 17, 30, 14].
24
+
25
+ Previous works on collecting responses from a fraction of devices can be divided into two categories. When the response distribution is known, one could collect only the fastest responses and re-weight according to their response probability [17, 26, 30]. This model can be restrictive, as in practice, the exact distribution may not be available and may evolve. Another line of work assumes that the server can arbitrarily decide and sample a set of devices to collect responses accordingly in every communication round [18, 28, 42, 25, 14]. This model does not require knowing the response possibility. However, the response time can be very long if the selected subset contains unavailable devices.
26
+
27
+ In this work, we address the above limitations by studying federated learning in the presence of arbitrary device unavailability. Within this practical setup, we propose an algorithm that automatically accommodates for the underlying unavailability and allows patterns of the device unavailability to be non-stationary and even adversarial. Furthermore, our algorithm can achieve optimal convergence rates in the presence of device inactivity and automatically reduce to best-known rates if all devices are active. Our contributions are summarized as follows.
28
+
29
+ • We investigate the federated learning problem with a practical formulation of device participation, which does not require each device to be online according to an (either known or unknown) distribution. • We propose the Memory-augmented Impatient Federated Averaging (MIFA) algorithm that is agnostic to the availability pattern. It efficiently avoids excessive latency induced by inactive devices, successfully exploits the information about the descent direction in stale and noisy gradients, and corrects the gradient bias using the memorized latest updates. • We prove that MIFA achieves minimax optimal convergence rates $\begin{array} { r } { \mathcal { O } \left( \frac { \bar { \tau } _ { T } + 1 } { N K T } \right) } \end{array}$ for smooth, strongly convex functions, and $\mathcal { O } \left( \sqrt { \frac { \bar { \nu } + 1 } { N K T } } \right)$ for smooth, non-convex functions, and establish matching lower bounds. Here, $N , K$ and $T$ stand for the number of devices, local updates and communication rounds respectively. $\bar { \tau } _ { T }$ and $\bar { \nu }$ characterize how actively devices participate in training (see formal definitions in Sections 3, 5 and 6). MIFA also achieves optimal convergence rates in the ideal case when all devices are active. • We provide an explicit characterization of the improvement over baseline algorithms through a case study and empirically verify our results on real-world datasets.
30
+
31
+ # 2 Related work
32
+
33
+ Federated learning. Federated Averaging (FedAvg) was first proposed in [28]. [26, 19, 18, 42] provided convergence analysis for FedAvg on non-i.i.d. data and quantified how data heterogeneity degrades the convergence rate. Several variants of FedAvg were designed to deal with data heterogeneity. FedProx [25] adds a proximal term to local objective functions, while FSVRG [21] and SCAFFOLD [18] employ variance reduction techniques.
34
+
35
+ One line of work focused on variations in computation capabilities among devices [39, 31, 40]. These models assume that responses are delayed but not missing. To address the missing response, some work assumes that the server can actively sample a subset of devices to respond [18, 28, 42, 25, 14] or that the pattern of device availability is known [26, 17, 10, 30]. These results do not generalize to adversarial inactive patterns. [32] discussed the impact of device inactivity on convergence but their proposed algorithm diverges if there exists an inactive device in each round of communication. However, our setup allows adversarial patterns under certain non-distributional assumptions (see Section 5) while our proposed algorithm still achieves convergence.
36
+
37
+ Asynchronous distributed optimization. Our work is related to literature in the field of traditional asynchronous distributed optimization in that our proposed algorithm uses stale gradients. The problem setup for asynchronous distributed algorithms can be divided into two categories [13]. One is the shared-data (i.i.d.) setting, where all workers can access the whole dataset. In this setting, the local gradient is an unbiased estimator of the global gradient [35, 4, 27, 11, 45, 1]. In contrast, we assume each worker has non-i.i.d. data, and hence the local stochastic gradient can not be viewed as an unbiased estimator of the global gradient.
38
+
39
+ The other less studied setting in distributed optimization is the distributed-data setting (non-i.i.d.), where data are partitioned among workers. Specifically, [5] proposed an asynchronous incremental aggregated gradient algorithm that uses buffered gradients to update the global model. Unlike our setup, this algorithm evaluates full local gradients, performs only one local step, and was analyzed under the bounded delay assumption. [13] models the delay as stochastic and assumes that the server has knowledge of the distribution, but our formulation is distribution-free. [6] allows workers to perform multiple local steps and communicate with the server at different times, but the authors assume that all workers are available and compute at the same rate.
40
+
41
+ Comparison with an independent work. While preparing the manuscript, we were unaware of an independent work [41] that investigated the same setup and proposed a similar algorithm called FedLaAvg. Their main theorem established the convergence rate of $\mathcal { O } \left( \sqrt { \frac { \nu _ { \mathrm { m a x } } } { N ^ { 0 . 5 } T } } ( \mathbf { \bar { G } } ^ { 2 } + \sigma ^ { 2 } ) \right)$ for smooth and non-convex problems, where $G ^ { 2 }$ is the uniform upper bound for the squared norm of stochastic gradients and $\nu _ { m a x }$ is the maximum number of inactive rounds. In comparison, we prove the minimax optimal rate of $\mathcal { O } ( \sqrt { \frac { \bar { \nu } } { N K T } } \sigma ^ { 2 } )$ without the bounded gradient assumption, also improving $\nu _ { \mathrm { m a x } }$ to $\bar { \nu }$ . Furthermore, our result achieves a linear speedup in $N$ and $K$ .
42
+
43
+ Apart from non-convex functions, we also derive the minimax optimal rates for strongly convex smooth functions under the mild assumption that allows for arbitrary and unbounded number of inactive rounds. Both of our results achieve linear speedups in terms of $N$ and $K$ , and automatically recover the best-known rates of FedAvg when all devices are active. We also show that our proposed algorithm achieves acceleration over unbiased baseline algorithms in the presence of stragglers.
44
+
45
+ # 3 Problem Setup
46
+
47
+ We consider optimizing the following problem in a Federated Learning setting:
48
+
49
+ $$
50
+ \begin{array} { r } { \underset { w \in \mathbb { R } ^ { d } } { \operatorname* { m i n } } f ( w ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } f _ { i } ( w ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { \xi _ { i } } [ f _ { i } ( w , \xi _ { i } ) ] , } \end{array}
51
+ $$
52
+
53
+ where $w$ is the optimization variable, e.g., parameters of a machine learning model, $N$ is the number of participating devices, $f _ { i }$ is the local loss function on device $i$ , and $\xi _ { i }$ describes the randomness in local data distribution.
54
+
55
+ In the ideal federated learning setup (see Figure 1 (a)), all devices return responses within similar time, and hence the central server collects all the local updates. In this case, the computation cost is usually measured by the number of local stochastic oracle evaluations, which is proportional to the number of rounds. In a delayed FL setup (see Figure 1 (b)), devices are always active upon the central server’s request but may return responses with a delay. Here, all devices return almost the same number of responses in the long term.
56
+
57
+ As we discussed, the above setups do not depict a real-world scenario in which a device can have a longer inactive duration than active duration. In such cases, the communication interval is much longer than the local computation time required for each update, and each device generates an unequal number of responses [28, 17]. This motivates our setup in Figure 1 (c).
58
+
59
+ ![](images/dbec5db87e22ee0dc55043253dc815eff5fd652c994f67ee8a04489f10ef06e1.jpg)
60
+ Figure 1: An illustration of setup. (a) Ideal setup: all devices return their responses within similar time. (b) Delayed setup: all devices are available, but may return responses with a delay. (c) Our setup: devices can be unavailable arbitrarily, and the communication interval is long enough for active devices to return responses.
61
+
62
+ In our proposed setup, we use $t$ to index the global communication rounds. We say a device participates or is active at round $t$ if it can complete the computation task and send back the update at the end of round $t$ . We define $\boldsymbol { \mathcal { A } } ( t )$ as the set of all active devices at round $t$ . Notice that we make no assumptions on the distribution of the participation patterns of devices and allow them to be arbitrary.
63
+
64
+ Directly applying FedAvg to the proposed setup can be problematic due to the existence of inactive devices. To accommodate for inactive devices, we discuss three natural variants of FedAvg and their limitations. The detailed algorithms can be found in Appendix A.
65
+
66
+ • Biased FedAvg. At each communication round, the global model is updated with a direct average of local updates from the active devices. This naive approach induces bias when data distribution and response patterns vary among devices.
67
+ • FedAvg with device sampling. The server selects a subset of $S$ devices randomly without replacement, and then waits until all devices in the subset $s$ respond. This is how original FedAvg [28] addresses device unavailability. Note that over $T$ communication rounds, the global model is updated less than $T$ times due to waiting. This approach is prone to stragglers and we refer the readers to Section 5.1 for a detailed discussion.
68
+ • FedAvg with importance sampling [26, 13, 17]. The local updates from the active devices are weighted by the reciprocal of the participation probabilities to avoid bias. This approach is only applicable when the response of each device is i.i.d. over rounds and it requires the knowledge of participation probabilities.
69
+
70
+ # 4 Memory-augmented Impatient Federated Averaging (MIFA)
71
+
72
+ In this section, we introduce our algorithm — Memory-augmented Impatient Federated Averaging (MIFA). MIFA maintains an update-array $\{ G ^ { i } \}$ in the memory that stores the latest updates for all devices. As the name suggests, MIFA has two components. First, the algorithm is impatient and avoids waiting for any specific device when facing heterogeneous devices with arbitrary availability. Second, the algorithm augments the received updates of the active devices with the stored updates of the inactive devices to perform averaging.
73
+
74
+ Specifically, at the beginning of round $t$ , the server broadcasts the latest model parameter $w _ { t }$ to all active devices $\boldsymbol { \mathcal { A } } ( t )$ . After receiving $w _ { t }$ , each active device, say, the $i$ -th device, sets $w _ { t , 0 } ^ { i } = w _ { t }$ and performs $K$ steps of SGD with respect to the local objective function to get $w _ { t , K } ^ { i }$ :
75
+
76
+ $$
77
+ \boldsymbol w _ { t , k + 1 } ^ { i } = \boldsymbol w _ { t , k } ^ { i } - \eta _ { t } \tilde { \nabla } f _ { i } ( \boldsymbol w _ { t , k } ^ { i } ) , \boldsymbol k = 0 , \cdots , \boldsymbol K - 1 ,
78
+ $$
79
+
80
+ where $\eta _ { t }$ is the learning rate and $\tilde { \nabla } f _ { i } ( w _ { t , k } ^ { i } )$ is the stochastic gradient evaluated on device $i$ . Next, the server stores the received update $\begin{array} { r } { \frac { 1 } { \eta _ { t } } \big ( w _ { t } - w _ { t , K } ^ { i } \big ) } \end{array}$ in $G ^ { i }$ . Denote by $\{ G _ { t } ^ { i } \}$ the update-array after round $t$ , then we have
81
+
82
+ $$
83
+ \begin{array} { r } { G _ { t } ^ { i } = \left\{ \begin{array} { l l } { G _ { t - 1 } ^ { i } , } & { \mathrm { ~ i f ~ } i \notin \mathcal { A } ( t ) , } \\ { \frac { 1 } { \eta _ { t } } ( w _ { t } - w _ { t , K } ^ { i } ) , } & { \mathrm { ~ i f ~ } i \in \mathcal { A } ( t ) . } \end{array} \right. } \end{array}
84
+ $$
85
+
86
+ At the end of round $t$ , the server updates the global model with the average of $\{ G _ { t } ^ { i } \}$ (line 9). In other words, our algorithm MIFA updates the model with the latest available accumulated gradients for all devices.
87
+
88
+ Algorithm 1 Memory-augmented Impatient Federated Averaging (MIFA)
89
+
90
+ <table><tr><td colspan="2">1: Input: initial wi,learning rate {nt }</td></tr><tr><td>2: Server executes:</td><td>1: DeviceUpdate(i, Wt , nt):</td></tr><tr><td>3: initialize Gi ←O,i∈[N]</td><td>2:w,←Wt</td></tr><tr><td>4: fort=1,.,T-1do</td><td>3: for local step k = O,.,K -1 do</td></tr><tr><td>5: broadcast wt to all active devices i ∈ A(t)</td><td> 4:compute stochastic gradient Vfi(wt,)</td></tr><tr><td>6: for each active device ido</td><td>Wk+1←W,k-ntvfi(w,) 5:</td></tr><tr><td>7: G ←DeviceUpdate(i,Wt, nt) 8: end for</td><td>6: end for</td></tr><tr><td>Wt+1←wt-∑1 N 9: Gi</td><td>7:Return (wt - wi,k) to the server</td></tr></table>
91
+
92
+ MIFA efficiently progresses without waiting for inactive devices and re-uses their latest updates as the surrogate for missing responses. Being impatient accelerates convergence, whereas memory augmentation corrects the update bias. Our algorithm differs from asynchronous algorithms in traditional distributed optimization [35, 4, 27, 11, 45, 1, 13, 6] in that we utilize the noisy updates of inactive devices more than once to avoid biasing against stragglers. In the following part of the paper, we show that MIFA successfully exploits information about the descent direction contained in the stale and noisy gradients.
93
+
94
+ Discussion on implementation. In practice, to implement MIFA, the server needs to maintain a huge array to store the latest update for each device, which scales with the model size and the total number of devices. To avoid exhausting the server’s memory, one strategy is to distribute the memory consumption among devices. Specifically, each device, say the $i$ -th, stores its previous update $G _ { t _ { i } ^ { \prime } } ^ { \ i }$ computed at round $t _ { i } ^ { \prime }$ in its local memory. When it becomes active and computes $G _ { t } ^ { i }$ , the device sends $G _ { t } ^ { i } - G _ { t _ { i } ^ { \prime } } ^ { i }$ to the server, which is the difference between the current update and the previous one. In this case, the server only needs to maintain the average $\bar { G }$ in the memory and updates it by $\begin{array} { r } { \bar { G } _ { t } = \bar { G } _ { t - 1 } + \frac { 1 } { N } \sum _ { i \in \mathcal { A } ( t ) } ( G _ { t } ^ { \bar { i } } - G _ { t _ { i } ^ { \prime } } ^ { i } ) } \end{array}$ at round $t$ . Then the server updates the global model by $w _ { t + 1 } = w _ { t } - \eta _ { t } \bar { G } _ { t }$ .
95
+
96
+ # 5 Convergence Analysis for strongly convex objective functions
97
+
98
+ In this section, we present the convergence results for MIFA on $\mu$ -strongly convex $L$ -smooth functions. Typical examples for the strongly convex case are $\ell _ { 2 }$ regularized logistic regression and linear regression problems.
99
+
100
+ In order to capture how the unavailability of devices affects algorithm performance, we introduce the following notion to quantify the dynamics of devices in our setting.
101
+
102
+ Definition 5.1 (Number of inactive rounds). We define the number of inactive rounds of device $i$ at round $t$ as $\tau ( t , i ) = t - \operatorname* { m a x } \{ t ^ { \prime } \mid t ^ { \prime } \leq t , i \in A ( t ^ { \prime } ) \}$ , which is the difference between current round $t$ and the latest round when device $i$ is active.
103
+
104
+ It can be seen that $\tau ( t , i ) = 0$ if device $i$ is active at round $t$ and $\tau ( t , i ) = \tau ( t - 1 , i ) + 1$ otherwise. Also, $t - \tau ( t , i )$ is the latest round when the device $i$ is active. Next, we present the assumptions made for establishing our convergence theorem.
105
+
106
+ Assumption 1. $f _ { 1 } , \cdots , f _ { N }$ are all $L$ -smooth, i.e., for all $w$ and $v _ { \scriptscriptstyle { i } }$ , $\begin{array} { r c l } { f _ { i } ( v ) } & { \leq } & { f _ { i } ( w ) \ + } \end{array}$ $\begin{array} { r } { \left. \nabla f _ { i } ( w ) , v - w \right. + \frac { L } { 2 } \left\| w - v \right\| ^ { 2 } } \end{array}$ .
107
+
108
+ Assumption 2. $\tilde { \nabla } f _ { i } ( \boldsymbol { w } )$ is an unbiased estimator of $\nabla f _ { i }$ with variance bounded by $\sigma ^ { 2 }$ , i.e., $\mathbb { E } _ { \boldsymbol { \xi } } \left[ \tilde { \nabla } f _ { i } ( \boldsymbol { w } ) \right] = \nabla f _ { i } ( \boldsymbol { w } ) , \mathbb { E } _ { \boldsymbol { \xi } } \left[ \left\| \tilde { \nabla } f _ { i } ( \boldsymbol { w } ) - \nabla f _ { i } ( \boldsymbol { w } ) \right\| ^ { 2 } \right] \leq \sigma ^ { 2 } .$ .
109
+
110
+ Assumption 3. $f _ { 1 } , \cdots , f _ { N }$ are all $\mu$ -strongly convex: for all $w$ and $v _ { \scriptscriptstyle { i } }$ , $f _ { i } ( v ) \geq f _ { i } ( w ) +$ $\begin{array} { r } { \left. \nabla f _ { i } ( w ) , v - w \right. + \frac { \mu } { 2 } \left\| w - v \right\| ^ { 2 } } \end{array}$ .
111
+
112
+ Assumption 4. There exists a constant $t _ { 0 } > 0$ , such that for all $t \geq 1$ and $i \in [ N ]$ , the number of inactive rounds of device $i$ at communication round $t$ satisfies $\begin{array} { r } { \tau ( t , i ) \leq t _ { 0 } + \frac { 1 } { b } \dot { t } } \end{array}$ , where $b =$ $4 0 \left( L / \mu \right) ^ { 1 . 5 }$ .
113
+
114
+ Assumptions 1, 2, and 3 are standard and common in the FL literature, e.g., [26, 18, 19, 42, 36]. In Assumption 2, we relax the bounded gradient assumption that is often required in prior work, e.g., [6, 26, 40, 1]. Lastly, Assumption 4 is a very mild assumption on device availability, since it allows the number of inactive rounds to grow as ${ \mathcal { O } } ( t )$ . In contrast, existing results on asynchronous updates mostly assume a bounded or fixed latency, e.g., [6, 1, 5, 40, 35, 4].
115
+
116
+ We are now ready to present our first convergence result. Define $\begin{array} { r l } { D = } & { { } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left. \nabla f _ { i } ( w _ { * } ) \right. ^ { 2 } } \end{array}$ to measure data dissimilarity, where $w _ { * } = \arg \operatorname* { m i n } f ( w )$ is the global optimum. Also, define $\bar { \tau } _ { T }$ and $\tau _ { \operatorname* { m a x } , T }$ to be the average and maximum numbers of inactive rounds $\tau ( t , i )$ across all devices and rounds, respectively. That is,
117
+
118
+ $$
119
+ \bar { \tau } _ { T } = \frac { 1 } { N ( T - 1 ) } \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { N } \tau ( t , i ) , \tau _ { \operatorname* { m a x } , T } = \operatorname* { m a x } _ { i \in [ N ] } \operatorname* { m a x } _ { 1 \leq t \leq T - 1 } \tau ( t , i ) .
120
+ $$
121
+
122
+ The following theorem summarizes the performance of MIFA in this case.
123
+
124
+ Theorem 5.1. Assume that Assumptions $^ { l }$ to 3 hold. Further assume that the device availability sequence $\tau ( t , i )$ satisfies Assumption $^ { 4 }$ and $\tau ( 1 , i ) = 0$ for all $i \in [ N ]$ . By setting the learning rate $\begin{array} { r } { \eta _ { t } = \frac { 4 } { \mu K ( t + a ) } } \end{array}$ with $a = \operatorname* { m a x } \{ 1 0 0 , 4 0 t _ { 0 } \} ( L / \mu ) ^ { 1 . 5 }$ , after $T - 1$ communication rounds, MIFA satisfies:
125
+
126
+ $$
127
+ \mathbb { E } _ { \xi } \left[ f ( \overline { { w } } _ { T } ) \right] - f ( w _ { * } ) = \mathcal { O } \left( \frac { \bar { \tau } _ { T } + 1 } { \mu N K T } \sigma ^ { 2 } + \frac { \tau _ { \operatorname* { m a x } , T } ^ { 2 } A _ { 1 } + ( K - 1 ) ^ { 2 } A _ { 2 } + A _ { 3 } } { \mu ^ { 2 } T ^ { 2 } } \right) ,
128
+ $$
129
+
130
+ where $\overline { { w } } _ { T }$ is a weighted average of $w _ { t }$ defined as:
131
+
132
+ $$
133
+ \overline { { w } } _ { T } = \frac { 1 } { W _ { T } } \sum _ { t = 1 } ^ { T } ( t + a - 1 ) ( t + a - 2 ) w _ { t } , W _ { T } = \sum _ { t = 1 } ^ { T } ( t + a - 1 ) ( t + a - 2 ) ,
134
+ $$
135
+
136
+ Our results hold under Assumption 4, which allows for arbitrary device availability sequences with $\tau _ { \mathrm { m a x } , T } = \mathcal { O } ( T )$ . However, for MIFA to converge, we require $\tau _ { \operatorname* { m a x } , T } = o ( T )$ and $\dot { t _ { 0 } } = \bar { o } ( T )$ . When ( NK(τ2max,T +t20)τ¯+1 ), the first term dominates and the impact of the second O(1/T 2) term is negligible. In fact the first term in Theorem 5.1 is minimax optimal by our information-theoretic lower bound for the problem in the next proposition.
137
+
138
+ Proposition 5.1. Let $c _ { 0 } > 0$ be a universal constant. For any potentially randomized algorithm, there exists a stochastic strongly convex problem satisfying Assumptions $^ { l }$ to 3, such that the output $w _ { T }$ after $T$ rounds of communication has expected sub-optimality lower bounded by
139
+
140
+ $$
141
+ \mathbb { E } [ f ( w _ { T } ) - f ( w ^ { * } ) ] \geq c _ { 0 } \frac { \bar { \tau } _ { T } \sigma ^ { 2 } } { \mu N K T } .
142
+ $$
143
+
144
+ The proof is based on the observation that the number of gradient evaluation can scale inversely with $\bar { \tau } _ { T }$ and that the oracle complexity is tight even for centralized stochastic optimization problems. The optimality of the first term in Theorem 5.1 is independent of the distributed or the FL setup.
145
+
146
+ The second term in Theorem 5.1 converges at the rate $\mathcal { O } ( 1 / T ^ { 2 } )$ and consists of three parts, where the first part reflects the slowdown caused by device unavailability through $\tau _ { \operatorname* { m a x } , T }$ , the second part shows the effect of multiple $( K > 1 )$ ) local steps, and the third part tells how the initial error decreases.
147
+
148
+ Remark 5.1. When $\tau ( t , i ) ~ = ~ 0$ for all $i$ and $t _ { : }$ , our setup reduces to FedAvg with full device pbound $\bar { \tau } _ { T } ~ = ~ 0$ d , $\tau _ { \mathrm { m a x } , T } ~ = ~ 0$ . Iate $\begin{array} { r } { \mathcal { O } \left( \frac { \sigma ^ { 2 } } { \mu K N T } + \frac { L ( \sigma ^ { 2 } / K + D + L ^ { 2 } \| w _ { 1 } - w _ { * } \| ^ { 2 } ) } { \mu ^ { 2 } T ^ { 2 } } \right) } \end{array}$ $\begin{array} { r } { \mathcal { O } \bigg ( \frac { \sigma ^ { 2 } \log T } { \mu K N T } + \frac { L ( \sigma ^ { 2 } / K + D ) ( \log T ) ^ { 2 } } { \mu ^ { 2 } T ^ { 2 } } + } \end{array}$ $\begin{array} { r } { \mu \left. w _ { 1 } - w _ { * } \right. ^ { 2 } \exp ( - \frac { \mu } { 4 8 L } T ) \Bigr ) } \end{array}$ in [18] (Thm. V. $B ^ { 2 } = 2 , \eta _ { g } = 1 ,$ ) up to logarithmic terms. Besides, in the general case, our $\mathcal { O } ( \tau _ { \mathrm { m a x } , T } ^ { 2 } A _ { 1 } / T ^ { 2 } )$ term matches the last term in $I 6 J \left( C o r . 5 \right)$ .
149
+
150
+ Remark 5.2. Our analysis relies on the technical assumption that all devices respond in the first round. Intuitively, this is because we need at least one valid stochastic gradient evaluation for each device to get a complete picture of the global objective, or otherwise any update would be biased. In practice, this can be achieved by waiting for the updates from all devices on $w _ { 1 }$ at the very beginning.
151
+
152
+ # 5.1 Case Study: i.i.d. Bernoulli participation
153
+
154
+ Though our algorithm can be applied to non-stationary and non-independent response patterns, we show in this subsection that even in the simple i.i.d. Bernoulli participation scenario our algorithm can achieve considerable improvement compared to known algorithms. In particular, we consider a setup where each device becomes active independently with a fixed probability $p _ { i }$ . It serves as the first motivating example towards modeling the participation patterns of devices, and provides a clean view of how the heterogeneity of the device participation influences the Federated optimization algorithms.
155
+
156
+ We will show that in this scenario, Assumption 4 holds with high probability, and the terms involving the inactive rounds $\tau ( t , i )$ in Theorem 5.1 can also be bounded. Furthermore, we theoretically demonstrate that algorithms such as FedAvg [28] and SCAFFOLD [18], which sample $S$ devices for each global update, are more prone to stragglers than our algorithm.
157
+
158
+ Definition 5.2. Assume that for all $i \in [ N ]$ , the i-th device is assigned with a probability $p _ { i }$ . We say the participation of the devices follows i.i.d. Bernoulli participation model with participation probabilities $\{ p _ { i } \}$ , if (1). at the first round, all devices are active, and (2). at round $t > 1$ , device $i$ is active with probability $p _ { i }$ , which is independent of the history and other devices.
159
+
160
+ Next theorem shows that under i.i.d. Bernoulli participation scenario, with high probability, $\tau ( t , i )$ only grows logarithmically in $t$ . Also Assumption 4 holds for a mild choice of $t _ { 0 }$ .
161
+
162
+ Theorem 5.2. For i.i.d. Bernoulli participation model defined in Definition 5.2, given any $\delta > 0$ , with probability at least $1 - \delta$ , we have the following holds for all $t \geq 1$ and $i \in [ N ]$ simultaneously,
163
+
164
+ $$
165
+ \tau ( t , i ) \leq \mathcal { O } \Big ( \frac { 1 } { p _ { i } } ( \log ( N t / \delta ) + 1 ) \Big ) .
166
+ $$
167
+
168
+ Furthermore, $( l )$ . Assumption $^ { 4 }$ holds true $\begin{array} { r } { \mathrm { \ddot { \it f } } t _ { 0 } = \Omega \bigg ( \frac { 1 } { p _ { m i n } } \log \frac { b N } { p _ { m i n } \delta } \bigg ) } \end{array}$ , where $p _ { m i n } = \operatorname* { m i n } \{ p _ { i } \}$ , and $b = 4 0 ( L / \mu ) ^ { 1 . 5 }$ ;(2). $\tau _ { \operatorname* { m a x } , T }$ can be upper bounded as
169
+
170
+ $$
171
+ \tau _ { \operatorname* { m a x } , T } \leq \mathcal { O } \Big ( \frac { 1 } { p _ { m i n } } \cdot \big ( \log ( T N / \delta ) + 1 \big ) \Big ) .
172
+ $$
173
+
174
+ The next theorem provides a high probability upper bound for $\bar { \tau } _ { T }$ .
175
+
176
+ Theorem 5.3. For i.i.d. Bernoulli participation model defined in Definition 5.2, given any $\delta > 0$ and $T > 1$ , with probability at least $1 - \delta$ , we have
177
+
178
+ $$
179
+ \bar { \tau } _ { T } \leq \Big ( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { 1 } { p _ { i } } \Big ) \cdot \mathcal { O } \Big ( 1 + \log \frac { 1 } { \delta } \Big ) .
180
+ $$
181
+
182
+ By Theorem 5.2 and Theorem 5.3, we conclude that the dominant term of our convergence bound is $\begin{array} { r } { \stackrel { \triangledown } { \mathcal { O } } \left( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { 1 } { p _ { i } } \cdot \frac { \sigma ^ { 2 } } { \mu N K T } \right) } \end{array}$ . Therefore, to achieve $\epsilon$ accuracy, the dominant term of the number of the required rounds is
183
+
184
+ $$
185
+ T _ { \epsilon } ^ { \left( \mathrm { M I F A } \right) } = \widetilde { \mathcal { O } } \Bigl ( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { 1 } { p _ { i } } \cdot \frac { \sigma ^ { 2 } } { \mu N K \epsilon } \Bigr ) .
186
+ $$
187
+
188
+ For both FedAvg and SCAFFOLD that sample $S$ devices uniformly at random, [18] (Thm I. & III.) showed that the dominant term of the number of global updates needed to achieve $\epsilon$ accuracy is $\begin{array} { r } { R _ { \epsilon } = \widetilde { \mathcal { O } } \left( \frac { \sigma ^ { 2 } } { \mu S K \epsilon } \right) } \end{array}$ . Notice that in our setting, to accomplish each global update, the server needs to wait for a few rounds for the $S$ devices to respond. Let $T ( S )$ be the expected rounds for which the server needs to wait for the selected devices $\boldsymbol { S }$ to be active. Then the expected total rounds to achieve $\epsilon$ accuracy is $R _ { \epsilon } \cdot \mathbb { E } _ { S } \left[ T ( S ) \right]$ . For i.i.d. Bernoulli participation model, we have $\begin{array} { r } { T ( S ) \geq \frac { 1 } { \operatorname* { m i n } \{ p _ { i } | i \in S \} } } \end{array}$ , and we can further show that $\begin{array} { r } { \mathbb { E } _ { S } \left[ T ( S ) \right] \ge \frac { 1 } { p _ { m i n } } \frac { S } { N } } \end{array}$ ≥ 1p min SN ( see Appendix D.3 for details). Therefore,
189
+
190
+ $$
191
+ \mathbb { E } \left[ T _ { \epsilon } ^ { ( \mathsf { F e d A v g , S C A F F O L D } ) } \right] \geq \frac { S } { N } \frac { 1 } { p _ { m i n } } \widetilde { \mathcal { O } } \Big ( \frac { \sigma ^ { 2 } } { \mu S K \epsilon } \Big ) = \widetilde { \mathcal { O } } \Big ( \frac { 1 } { p _ { m i n } } \cdot \frac { \sigma ^ { 2 } } { \mu N K \epsilon } \Big ) .
192
+ $$
193
+
194
+ By comparing Eqn. 2 and Eqn. 3, we see that both FedAvg and SCAFFOLD are more vulnerable to stragglers, that is, the devices with very small participation probabilities; on the contrary, the convergence rate of MIFA only depends on the average of $1 / p _ { i }$ instead of $1 / p _ { m i n }$ . We also provide empirical experiments showing that MIFA converges faster than FedAvg in Section 7.
195
+
196
+ # 6 Convergence result for non-convex objective functions
197
+
198
+ In this section, we present the convergence guarantee of MIFA for the non-convex case. First we list the additional assumptions as below.
199
+
200
+ Assumption 5 (Hessian Lipschitz). $f _ { 1 } , \cdots , f _ { N }$ are all $\rho$ -Hessian Lipschitz: for all $w$ and $v$ $\bigl \| \nabla ^ { 2 } f _ { i } \bigl ( \tilde { \boldsymbol { w } } \bigr ) - \nabla ^ { 2 } f _ { i } ( \boldsymbol { v } ) \bigr \| \leq \dot { \rho } \bigl \| \boldsymbol { w } - \boldsymbol { \tilde { v } } \bigr \|$ .
201
+
202
+ Assumption 6 (Bounded noise). The noise of the local stochastic gradients is upper bounded by $a$ constant $\delta$ almost surely: $\begin{array} { r } { \left\| \tilde { \nabla } f _ { i } ( w ) - \nabla f _ { i } ( w ) \right\| \le \delta a . s . , \forall i \in [ N ] } \end{array}$ .
203
+
204
+ Assand y). There exist . Furthermore, $\alpha > 0$ anfine $\beta _ { i } > 0$ at for all . $w$ $\in [ N ] \colon \left\| \nabla f _ { i } ( w ) \right\| ^ { 2 } \leq \alpha \left\| \nabla f ( w ) \right\| ^ { 2 } + \beta _ { i }$ $\begin{array} { r } { \beta = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \beta _ { i } } \end{array}$
205
+
206
+ Assumption 8. There exists a constant $\nu _ { i }$ such that $\tau ( t , i ) \ \leq \ \nu _ { i }$ , for all $i \in [ N ]$ and $t \geq 1$ Furthermore, define ν¯ = 1N PNi=1 νi and νmax = maxi∈[N] νi.
207
+
208
+ The analysis of non-convex functions is much more technically involved, and our results rely on strong assumptions that provide a finer control of the gradient difference (Assumption 5), gradient noise (Assumption 6), gradient dissimilarity among devices (Assumption 7), and device unavailability (Assumption 8). We remark that Assumption 5 is also made in [9, 16], and Assumption 7 is also made in [18, 39]. We leave it as future work to study whether and how MIFA converges for non-convex functions with weaker assumptions.
209
+
210
+ Theorem 6.1. Assume that Assumptions $I , ~ 2 , ~$ , and $^ { 5 }$ to 7 hold. Further assume that the device availability sequence $\tau ( t , i )$ satisfies Assumption 8 and $\tau ( 1 , i ) = 0$ for all $i \in [ N ]$ . By using $a$ learning rate η = q $\begin{array} { r } { \eta = \sqrt { \frac { N } { K T L \left( 1 + \bar { \nu } \right) } } } \end{array}$ NKT L(1+¯ν), for T ≥ max{32αLNK, 16LNK , 8KNν2max(L2+ρδ) }, after T − 1 communication rounds, MIFA satisfies:
211
+
212
+ $$
213
+ \operatorname* { m i n } _ { 1 \leq t \leq T } \mathbb { E } _ { \xi } \left[ \left\| \nabla f ( w _ { t } ) \right\| ^ { 2 } \right] = \mathcal { O } \left( \sqrt { \frac { ( 1 + \bar { \nu } ) L } { T K N } } ( f ( w _ { 1 } ) - f ^ { * } + \sigma ^ { 2 } ) + \frac { A _ { 4 } + A _ { 5 } } { T } \right) ,
214
+ $$
215
+
216
+ where $f ^ { * }$ is the optimal value, and:
217
+
218
+ $$
219
+ \begin{array} { l } { { A _ { 4 } = N K L \left( \alpha \sigma ^ { 2 } \hat { \nu } + \frac { \sigma ^ { 2 } \nu _ { \mathrm { m a x } } } { \sqrt { K N } } + \sigma \nu _ { \mathrm { m a x } } \sqrt { \beta } \right) + \frac { { ( L ^ { 2 } + \rho \delta ) \sigma ^ { 2 } \nu _ { \mathrm { m a x } } } } { L } , } } \\ { { A _ { 5 } = \frac { { ( K - 1 ) N L ( \beta + \sigma ^ { 2 } / K ) } } { \hat { \nu } + 1 } . } } \end{array}
220
+ $$
221
+
222
+ Next, we show that the leading $\mathcal { O } ( 1 / \sqrt { T } )$ term is theoretically optimal for zero-respecting algorithms.
223
+
224
+ Proposition 6.1. Let $c _ { 0 } > 0$ be a universal constant. For any randomized zero-respecting algorithm, there exists a stochastic non-convex problem satisfying Assumption1, 2, 5 and 7, such that the output $w _ { T }$ after $T$ rounds of communication has expected sub-optimality lower bounded by
225
+
226
+ $$
227
+ \mathbb { E } [ \| \nabla f ( w _ { T } ) \| ^ { 2 } ] \ge \mathbb { E } [ \| \nabla f ( w _ { T } ) \| ] ^ { 2 } \ge c _ { 0 } \sqrt { \frac { \bar { \nu } L \sigma ^ { 2 } ( f ( w _ { 0 } ) - f ^ { * } ) } { N K T } } .
228
+ $$
229
+
230
+ The above proposition show that when $\sigma \sqrt { ( f ( w _ { 0 } ) - f ^ { * } ) } \sim \sigma ^ { 2 } + ( f ( w _ { 0 } ) - f ^ { * } )$ , the result in Theorem 6.1 is tight. However, note that the counter example we used requires the quantity $\delta$ in Assumption 6 to scale with $T$ , hence requiring $\delta$ to be large enough. This does not change the optimality of the first term as the first term is independent of $\delta$ . Whether this requirement can be relaxed is left as an open problem.
231
+
232
+ Remark 6.1. When all $\nu _ { i } = 0$ (i.e. all the devices are active), our convergence bound reduces to $\begin{array} { r } { \mathcal { O } \Big ( \sqrt { \frac { L } { T K N } } ( f ( w _ { 1 } ) - f ^ { * } + \sigma ^ { 2 } ) + \frac { ( K - 1 ) N L ( \beta + \sigma ^ { 2 } / K ) } { T } \Big ) } \end{array}$ . This matches the result in [42] (Thm. 1, $\begin{array} { r } { \eta = 1 , \eta _ { L } = \sqrt { \frac { N } { K T L } } ) } \end{array}$ .
233
+
234
+ # 7 Numerical Experiments
235
+
236
+ In this section, we conduct numerical experiments3. to verify our theoretical results and investigate how the heterogeneity of the device availability influences the Federated optimization algorithms. We compare the performance of the following four algorithms: FedAvg with importance sampling (FedAvg-IS), Biased FedAvg, FedAvg with device sampling, and our proposed MIFA. For the detailed discussions of the algorithms, we refer the readers to Sections 3 and 4. We remark that for a fair comparison, we deliberately include the first few rounds that MIFA needs to wait to receive responses from all devices for initializing the update-array $\{ G ^ { i } \}$ .
237
+
238
+ Following [26, 25], we construct non-i.i.d. datasets from two commonly used computer vision datasets — MNIST [23] and CIFAR-10 [22] . Specifically, we divide the data into $N = 1 0 0$ devices with each device holding samples of only two classes, which creates a high level of data heterogeneity. For simplicity, we ensure that each device holds the same number of samples. We do not use any data augmentation. We use multinomial logistic regression as the convex model and LeNet-5 [24] with ReLU activations as the non-convex model. For all experiments, we use weight decay in the training process, which corresponds to adding $\ell _ { 2 }$ penalty. We use logistic models for MNIST dataset, while we use LeNet-5 for CIFAR-10. Our code is adapted from [26], which is under MIT License.
239
+
240
+ We model the availability of the devices as independent Bernoulli random trials. The $i \cdot$ -th device is assigned with a probability $p _ { i }$ , where at each time step, the device becomes active with probability $p _ { i }$ . In our experiments, the $p _ { i }$ ’s are chosen such that devices holding data of smaller labels participate less frequently. Specifically, if the $i$ -th device holds the data of label $j$ and $k$ , we set $\bar { p } _ { i } = \bar { p _ { \operatorname* { m i n } } } \operatorname* { m i n } ( j , k ) / 9 + \bar { ( 1 - p _ { \operatorname* { m i n } } ) }$ , where $p _ { \mathrm { m i n } }$ controls the lower bound of the participation probabilities. The correlation between the participation patterns and local datasets increases the difficulty of the problem [17]. To investigate this phenomenon, we repeat the experiments for $p _ { \mathrm { m i n } } = 0 . 1$ and 0.2. We control the randomness of device participation when testing different algorithms.
241
+
242
+ In all the experiments, we set the initial learning rate to be $\eta _ { 0 } = 0 . 1$ and decay the learning rate as $\begin{array} { r } { \eta _ { t } = \eta _ { 0 } \cdot \frac { 1 } { t } } \end{array}$ . We set the weight decay to be 0.001. The local batch size is 100 and each local update consists of 2 epochs. Therefore, the actual number of local steps $K$ depends on the size of the dataset. We run all the experiments with 4 GPUs of type GeForce RTX 2080 Ti. We repeat the experiments for 5 different random seeds, and all of the experiments exhibit similar training curves. We report the averaged training loss and test accuracy with error bars in Figure 2.
243
+
244
+ We observe that FedAvg with device sampling (FedAvg ( $S = 5 0$ ) and FedAvg $S = 1 0 0$ ) in Figure 2) is severely influenced by the straggling devices and makes progress relatively slowly compared to the other algorithms. Although biased FedAvg converges fast at the beginning, this simple algorithm is biased, and the optimality gaps are prominent for the harder CIFAR-10 dataset and when $p _ { \mathrm { m i n } }$ is small. On the contrary, our proposed MIFA avoids waiting for stragglers, converges fast without bias, and is competitive with FedAvg with importance sampling, which requires knowledge of the participation probabilities. We refer the readers to Appendix G for additional experiments on CIFAR-10.
245
+
246
+ # 8 Conclusions and Discussions
247
+
248
+ In this paper, we study FL algorithms in the presence of arbitrary device unavailability and propose MIFA, which avoids waiting for straggling devices and re-uses the memorized latest updates as the surrogate when the device is unavailable. We theoretically analyze MIFA without any structural assumptions on the device availability and prove the convergence for strongly convex and non-convex smooth functions. Different from the literature that studies oracle complexity in terms of stochastic gradient evaluations, we argue that in federated learning system, the bottleneck lies in the nonstationary and possibly adversarial pattern of device participation. Therefore, it is important to study how the number of inactive rounds influences the convergence rate. In Theorem 5.1, the dependency upon $\tau _ { \operatorname* { m a x } , T }$ might be an artifact of our analysis, and a future direction is to study whether we can remove this dependency. Another important direction is to analyze algorithms for non-convex functions under weaker assumptions.
249
+
250
+ ![](images/c1142e9ecbf7a3052e86380ac3f4c818747910b17c29f238aaf9134bafeb112a.jpg)
251
+ Figure 2: Training losses and test accuracies. Fig. 2(a)–2(d): logistic models on non-iid MNIST. Fig. 2(e)–2(h): LeNet-5 on non-iid CIFAR-10. FedAvg $S = 5 0$ ) and FedAvg $S = 1 0 0$ ) refer to FedAvg with device sampling that samples $S$ devices for each global update. FedAvg-IS is short for FedAvg with importance sampling, which requires knowledge of the participation probabilities.
252
+
253
+ # Acknowledgments and Disclosure of Funding
254
+
255
+ The work of Xinran Gu and Longbo Huang is supported in part by the Technology and Innovation Major Project of the Ministry of Science and Technology of China under Grant 2020AAA0108400 and2020AAA0108403. Xinran Gu would like to thank Kaifeng Lyu for the discussion on the convergence analysis. The authors would like to thank Sai Praneeth Karimireddy for the discussion on the problem settings.
256
+
257
+ # References
258
+
259
+ [1] Alekh Agarwal and John C Duchi. Distributed delayed stochastic optimization. In 2012 IEEE 51st IEEE Conference on Decision and Control (CDC), pages 5451–5452. IEEE, 2012.
260
+ [2] Alekh Agarwal, Martin J Wainwright, Peter Bartlett, and Pradeep Ravikumar. Informationtheoretic lower bounds on the oracle complexity of convex optimization. Advances in Neural Information Processing Systems, 22:1–9, 2009.
261
+ [3] Yossi Arjevani, Yair Carmon, John C. Duchi, Dylan J. Foster, Nathan Srebro, and Blake Woodworth. Lower bounds for non-convex stochastic optimization, 2019.
262
+ [4] Yossi Arjevani, Ohad Shamir, and Nathan Srebro. A tight convergence analysis for stochastic gradient descent with delayed updates. In Algorithmic Learning Theory, pages 111–132. PMLR, 2020.
263
+ [5] Arda Aytekin, Hamid Reza Feyzmahdavian, and Mikael Johansson. Analysis and implementation of an asynchronous optimization algorithm for the parameter server. arXiv preprint arXiv:1610.05507, 2016.
264
+ [6] Debraj Basu, Deepesh Data, Can Karakus, and Suhas Diggavi. Qsparse-local-sgd: Distributed sgd with quantization, sparsification, and local computations. arXiv preprint arXiv:1906.02367, 2019.
265
+ [7] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloé Kiddon, Jakub Konecný, Stefano Mazzocchi, Brendan McMahan, Timon ˇ
266
+
267
+ Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. Towards federated learning at scale: System design. In A. Talwalkar, V. Smith, and M. Zaharia, editors, Proceedings of Machine Learning and Systems, volume 1, pages 374–388, 2019.
268
+
269
+ [8] Sébastien Bubeck, Nicolo Cesa-Bianchi, and Gábor Lugosi. Bandits with heavy tail. IEEE Transactions on Information Theory, 59(11):7711–7717, 2013.
270
+
271
+ [9] Yair Carmon, John C Duchi, Oliver Hinder, and Aaron Sidford. Accelerated methods for nonconvex optimization. SIAM Journal on Optimization, 28(2):1751–1772, 2018.
272
+
273
+ [10] Hubert Eichner, Tomer Koren, Brendan McMahan, Nathan Srebro, and Kunal Talwar. Semicyclic stochastic gradient descent. In International Conference on Machine Learning, pages 1764–1773. PMLR, 2019.
274
+
275
+ [11] Hamid Reza Feyzmahdavian, Arda Aytekin, and Mikael Johansson. An asynchronous minibatch algorithm for regularized stochastic optimization. IEEE Transactions on Automatic Control, 61(12):3740–3754, 2016.
276
+
277
+ [12] Saeed Ghadimi and Guanghui Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization i: A generic algorithmic framework. SIAM Journal on Optimization, 22(4):1469–1492, 2012.
278
+
279
+ [13] Margalit Glasgow and Mary Wootters. Asynchronous distributed optimization with stochastic delays. arXiv preprint arXiv:2009.10717, 2020.
280
+
281
+ [14] Eduard Gorbunov, Konstantin P. Burlachenko, Zhize Li, and Peter Richtarik. Marina: Faster non-convex distributed learning with compression. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 3788–3798. PMLR, 18–24 Jul 2021.
282
+
283
+ [15] 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.
284
+
285
+ [16] Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. In International Conference on Machine Learning, pages 1724–1732. PMLR, 2017.
286
+
287
+ [17] Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
288
+
289
+ [18] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pages 5132–5143. PMLR, 2020.
290
+
291
+ [19] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. Tighter theory for local sgd on identical and heterogeneous data. In International Conference on Artificial Intelligence and Statistics, pages 4519–4529. PMLR, 2020.
292
+
293
+ [20] Jakub Konecnˇ y, Brendan McMahan, and Daniel Ramage. Federated optimization: Distributed \` optimization beyond the datacenter. arXiv preprint arXiv:1511.03575, 2015.
294
+
295
+ [21] 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.
296
+
297
+ [22] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
298
+
299
+ [23] 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.
300
+
301
+ [24] Yann LeCun et al. Lenet-5, convolutional neural networks. URL: http://yann. lecun. com/exdb/lenet, 20(5):14, 2015.
302
+
303
+ [25] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. In I. Dhillon, D. Papailiopoulos, and V. Sze, editors, Proceedings of Machine Learning and Systems, volume 2, pages 429–450, 2020.
304
+ [26] Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of fedavg on non-iid data. In International Conference on Learning Representations, 2020.
305
+ [27] Xiangru Lian, Yijun Huang, Yuncheng Li, and Ji Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015.
306
+ [28] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pages 1273–1282. PMLR, 2017.
307
+ [29] Arkadij Semenovic Nemirovskij and David Borisovich Yudin. Problem complexity and method ˇ efficiency in optimization. 1983.
308
+ [30] Constantin Philippenko and Aymeric Dieuleveut. Bidirectional compression in heterogeneous settings for distributed or federated learning with partial participation: tight convergence guarantees. arXiv preprint arXiv:2006.14591, 2020.
309
+ [31] Amirhossein Reisizadeh, Isidoros Tziotis, Hamed Hassani, Aryan Mokhtari, and Ramtin Pedarsani. Straggler-resilient federated learning: Leveraging the interplay between statistical accuracy and system heterogeneity. arXiv preprint arXiv:2012.14453, 2020.
310
+ [32] Yichen Ruan, Xiaoxi Zhang, Shu-Che Liang, and Carlee Joe-Wong. Towards flexible device participation in federated learning. In International Conference on Artificial Intelligence and Statistics, pages 3403–3411. PMLR, 2021.
311
+ [33] Felix Sattler, Simon Wiedemann, Klaus-Robert Müller, and Wojciech Samek. Robust and communication-efficient federated learning from non-iid data. IEEE transactions on neural networks and learning systems, 31(9):3400–3413, 2019.
312
+ [34] Virginia Smith, Chao-Kai Chiang, Maziar Sanjabi, and Ameet Talwalkar. Federated multi-task learning. arXiv preprint arXiv:1705.10467, 2017.
313
+ [35] Sebastian U Stich and Sai Praneeth Karimireddy. The error-feedback framework: Better rates for sgd with delayed gradients and compressed updates. Journal of Machine Learning Research, 21:1–36, 2020.
314
+ [36] Sebastian Urban Stich. Local sgd converges fast and communicates little. In ICLR 2019- International Conference on Learning Representations, number CONF, 2019.
315
+ [37] Roman Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018.
316
+ [38] Jianyu Wang and Gauri Joshi. Cooperative sgd: A unified framework for the design and analysis of communication-efficient sgd algorithms. In ICML Workshop on Coding Theory for Machine Learning, 2019.
317
+ [39] Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. Advances in Neural Information Processing Systems, 33, 2020.
318
+ [40] Cong Xie, Sanmi Koyejo, and Indranil Gupta. Asynchronous federated optimization. arXiv preprint arXiv:1903.03934, 2019.
319
+ [41] Yikai Yan, Chaoyue Niu, Yucheng Ding, Zhenzhe Zheng, Fan Wu, Guihai Chen, Shaojie Tang, and Zhihua Wu. Distributed non-convex optimization with sublinear speedup under intermittent client availability. arXiv preprint arXiv:2002.07399, 2020.
320
+ [42] Haibo Yang, Minghong Fang, and Jia Liu. Achieving linear speedup with partial worker participation in non-iid federated learning. arXiv preprint arXiv:2101.11203, 2021.
321
+ [43] Hao Yu, Rong Jin, and Sen Yang. On the linear speedup analysis of communication efficient momentum sgd for distributed non-convex optimization. In International Conference on Machine Learning, pages 7184–7193. PMLR, 2019.
322
+ [44] Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank J Reddi, Sanjiv Kumar, and Suvrit Sra. Why are adaptive methods good for attention models?, 2020.
323
+ [45] Xin Zhang, Jia Liu, and Zhengyuan Zhu. Taming convergence for asynchronous stochastic gradient descent with unbounded delay in non-convex learning. In 2020 59th IEEE Conference on Decision and Control (CDC), pages 3580–3585. IEEE, 2020.
324
+
325
+ # Checklist
326
+
327
+ 1. For all authors...
328
+
329
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
330
+ (b) Did you describe the limitations of your work? [Yes] See Section 8.
331
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A] Our work is mainly theoretical and targets at providing theoretical analysis of the FL algorithms, which has almost no negative societal impacts.
332
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
333
+
334
+ 2. If you are including theoretical results...
335
+
336
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] The assumptions are rigorously stated in Section 5 and Section 6.
337
+ (b) Did you include complete proofs of all theoretical results? [Yes] All the proofs are deferred to the appendix.
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] Our code will be included in the supplemental material. The datasets we use are public. The instructions needed to reproduce the main experimental results are clearly stated in Section 7.
342
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 7.
343
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 7.
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] See Section 7.
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] See Section 7.
349
+ (b) Did you mention the license of the assets? [Yes] See Section 7.
350
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our code for reproducing the experiments in the supplemental material.
351
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We choose the commonly-used MNIST and CIFAR-10 datasets.
352
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We choose the commonly-used MNIST and CIFAR-10 datasets.
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]
md/train/5PiSFHhRe2C/5PiSFHhRe2C.md ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # META AUXILIARY LABELS WITH CONSTITUENTBASED TRANSFORMER FOR ASPECT-BASED SENTIMENT ANALYSIS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Aspect based sentiment analysis (ABSA) is a challenging natural language processing task that could benefit from syntactic information. Previous work exploit dependency parses to improve performance on the task, but this requires the existence of good dependency parsers. In this paper, we build a constituent-based transformer for ABSA that can induce constituents without constituent parsers. We also apply meta auxiliary learning to generate labels on edges between tokens, supervised by the objective of the ABSA task. Without input from dependency parsers, our models outperform previous work on three Twitter data sets and match previous work closely on two review data sets.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Aspect-based Sentiment Analysis (ABSA) is the task of predicting sentiment polarity towards observed aspects in a sentence. Recent work (Bai et al., 2020; Huang & Carley, 2019; Sun et al., 2019; Wang et al., 2020) used syntactic information from dependency parses to achieve new stateof-the-art results on benchmark ABSA data sets. However, these works (i) assumed the existence of good dependency parsers, and (ii) could not further optimize the pre-defined dependency labels for downstream performance of ABSA. Motivated by these limitations, we propose to induce syntactic information with supervision from the ABSA task.
12
+
13
+ To take syntax into account, we aim to induce the necessary syntactic information for the ABSA task with inductive biases. We first design a Constituent-based Transformer (ConsTrans) to group tokens into constituents supervised by the ABSA objective. We argue that the formation of constituents provides a hierarchical structure of the sentence that is suitable for sentiment analysis. For example, in the sentence “Chinese dumplings in this restaurant taste very good” with the aspect term “Chinese dumplings”, it is important to accurately assign the phrase “taste very good” to the aspect.
14
+
15
+ Next, as seen in Figure 1, even though the dependency graph structures for both sentences are identical, the sentiment towards “Chelsea” is positive for the input sentence on the left and negative for the one on the right. Therefore, the type of syntactic relationship between tokens would be useful to identify the sentiment towards the aspect term. Hence, we further extend ConsTrans into a Relational Constituent-based Transformer (RelConsTrans) to learn relation embeddings between every pair of tokens in the input sentence. We find that simply adding relation embedding fails to outperform ConsTrans. Inspired by Liu et al. (2019), we further extend RelConsTrans to supervise the relation embedding with an auxiliary label generator (RelConsTransLG). In previous work (e.g. Bai et al., 2020; Huang & Carley, 2019), the dependency parser played the role of the auxiliary label generator. However, such dependency parsers were not trained to provide auxiliary labels meant to improve ABSA. RelConsTransLG enables us to train the auxiliary label generator alongside the primary task to generate auxiliary labels that could directly enhance the performance of ABSA.
16
+
17
+ We evaluate our models on five data sets - restaurant and laptop reviews (Pontiki et al., 2014), ACL14 Twitter14 data (Dong et al., 2014), Twitter15 and Twitter17 from a multi-modal ABSA data set (Yu & Jiang, 2019). Compared against previous work which used dependency parsers, our models outperform them on all the Twitter data sets and matched previous work closely on the review data sets even without the use of constituent or dependency parser.
18
+
19
+ ![](images/f57e000dccb28e324dcabde6487f92da0967ffdecdf4a9cae1be5853934df60f.jpg)
20
+
21
+ ![](images/94484a4d51f973d547de9dfe3b3688aa232259c0ec362f977c1f2e2329844785.jpg)
22
+ Figure 1: Dependency parse labels as auxiliary labels that help sentiment disambiguation. Tokens in bold and underlined are the aspect terms. Example taken from Bai et al. (2020).
23
+ (a) ConsTrans Encoder Stack: dotted arrows refer to lower attention weights between tokens from different constituents.
24
+ (b) A lower ConsTrans layer: the shaded region is different from the vanilla Transformer.
25
+
26
+ # 2 MODEL FORMULATION
27
+
28
+ Given a sentence of $m$ tokens, $s = \{ w _ { 0 } , \ldots , w _ { m - 1 } \}$ , and a target aspect, $t = \left\{ w _ { j } , \ldots , w _ { j + q - 1 } \right\}$ of length $q$ , the objective of ABSA is to predict the sentiment polarity $y \in \{$ {negative, neutral, positive $\}$ towards the target aspect $t$ mentioned in sentence $s$ . In all our models, we use the pretrained BERT (Devlin et al., 2018) model (BERT-base-uncased) to obtain contextual embeddings as inputs to our model, and we fine tune it together with the model. We format the input to the BERT model as a e pair: obtai $[ C L S ] + s + [ S E P ] + t + [ S E P ]$ . We represent each tokenas input to our model. O $w _ { i }$ with the representationbase model is a 4-layer $h _ { i } ^ { b e r t , 1 2 }$
29
+ transformer on this representation, similar to the baseline Transformer(B) in Bai et al. (2020). In the rest of this section, we describe the modifications we make to this transformer to build our three proposed models, ConsTrans, RelConsTrans and RelConsTransLG.
30
+
31
+ # 2.1 CONSTITUENT-BASED TRANSFORMER (ConsTrans)
32
+
33
+ ConsTrans contains a stack of 4 Transformer encoder layers (Vaswani et al., 2017) with Multi-Head Attention (MHA) and a point-wise feed forward sub-layer in each layer. As illustrated in Figure 2a, the encoder stack of ConsTrans is grouped into two parts - the lower layers and the upper layers. In all our experiments, we have 2 layers each in both the lower and upper layers. The main difference between a vanilla Transformer network and ConsTrans is that the attention scores computed in the MHA layer between a pair of tokens are adjusted based on the probability that the two tokens belong to the same constituent. In the lower layers, attention weights are adjusted such that greater attention weights are assigned to tokens within the same constituent. This adjustment is not imposed at upper layers of the encoder to allow for longer range interactions.
34
+
35
+ Figure 2b shows a single encoder layer from the lower layers of the encoder stack. The shaded region in the figure, which emphasizes the difference from a vanilla Transformer encoder layer, contains three components: the MHA which provides the vanilla attention scores, the constituent probability scorer, and finally the adjusted MHA scorer that computes the final attention.
36
+
37
+ Constituent Probability Scorer Kim et al. (2020b) found that tokens from the same constituent tend to exhibit similar attention distributions. Hence we propose to determine the probability that a pair of tokens belong to the same constituent by the similarity of their attention distributions. We use the scaled dot-product attention (Vaswani et al., 2017) in the MHA layer to first obtain the attention
38
+
39
+ distributions of a token:
40
+
41
+ $$
42
+ \alpha _ { i , j } ^ { l z } = \frac { \exp { F ^ { l z } ( h _ { i } ^ { l } , h _ { j } ^ { l } ) } } { \sum _ { j ^ { \prime } } \exp { F ^ { l z } ( h _ { i } ^ { l } , h _ { j ^ { \prime } } ^ { l } ) } } ; \quad F ^ { l z } ( h _ { i } ^ { l } , h _ { j } ^ { l } ) = \frac { ( W _ { Q } ^ { l z } h _ { i } ^ { l } ) ( W _ { K } ^ { l z } h _ { j } ^ { l } ) ^ { T } } { \sqrt { d _ { k } } } ,
43
+ $$
44
+
45
+ where $W _ { Q } ^ { l z } \in \mathbb { R } ^ { d _ { m o d e l } , d _ { q } }$ and $W _ { K } ^ { l z } \in \mathbb { R } ^ { d _ { m o d e l } , d _ { k } }$ are projection layers that project the query and key to the various attention heads with dimension $d _ { q }$ and $d _ { k }$ respectively. The attention distribution for token $i$ at layer $l$ and attention head $z$ is then defined to be the vector $\alpha _ { i } ^ { l z } = [ \alpha _ { i j } ^ { l z } ] _ { j }$ . To obtain the attention distribution similarity for two tokens, $i$ and $j$ , we concatenate the attention patterns of the pair before passing it through a projection layer:
46
+
47
+ $$
48
+ s i m _ { i , j } ^ { l z } = \sqrt { \sigma ( W _ { \alpha } [ \alpha _ { i } ^ { l z } , \alpha _ { j } ^ { l z } ] ) \times \sigma ( W _ { \alpha } [ \alpha _ { j } ^ { l z } , \alpha _ { i } ^ { l z } ] ) }
49
+ $$
50
+
51
+ where $s i m _ { i , j } ^ { l z }$ refers to the attention distribution similarity score for token $i$ and token $j$ in layer $l$ for attention head $z$ , $W _ { \alpha } \in \mathbb { R } ^ { d , 1 }$ is a linear projection, [: , :] refers to the concatenation function and $\sigma$ the sigmoid function so that $s i m _ { i , j } ^ { l z } \in [ \bar { 0 , 1 } ]$ . We also note that this ensures $s i m _ { i , j } ^ { l z } = s i m _ { j , i } ^ { l z }$
52
+
53
+ We then use the attention distribution similarity scores to compute the probability that a pair of tokens belong to the same constituent. The base probability $c _ { i , j } ^ { ' l z }$ , that tokens $i$ and $j$ belong to the same constituent, is computed as follows:
54
+
55
+ $$
56
+ c _ { i , j } ^ { ' l z } = \left\{ \prod _ { k = 0 } ^ { j - i } s i m _ { i + k , i + k + 1 } ^ { l z } \quad j \leq i \right.
57
+ $$
58
+
59
+ This formulation considers the probability that tokens spanned by the two tokens $i$ and $j$ form a contiguous constituent. Moreover, since $\dot { s } i m _ { i , j } ^ { l z } \in [ 0 , 1 ]$ , the probability that two tokens are in the same constituent would decrease monotonically with the distance between $i$ and $j$ . To encourage the induced constituents to be consistent across layers, the final constituent probabilities obtained at the current layer would be the weighted sum of itself and constituent probabilities from the previous layer:
60
+
61
+ $$
62
+ c _ { i , j } ^ { l z } = \lambda * c _ { i , j } ^ { ' l z } + \left( 1 - \lambda \right) * c _ { i , j } ^ { ' l - 1 , z } ,
63
+ $$
64
+
65
+ where $\lambda \in [ 0 , 1 ]$ is a hyper-parameter that we tune.
66
+
67
+ Adjusted Attention in the Lower Constituent Layers Finally, we adjust the attention scores between a pair of tokens according to the probability that the pair belongs to the same constituent, through a softmax layer:
68
+
69
+ $$
70
+ \alpha _ { i , j } ^ { ' l z } = \frac { \exp c _ { i , j } ^ { l z } * \alpha _ { i , j } ^ { l z } } { \sum _ { j ^ { \prime } } \exp c _ { i , j } ^ { l z } * \alpha _ { i , j ^ { \prime } } ^ { l z } }
71
+ $$
72
+
73
+ where $\alpha _ { i , j } ^ { ' l z }$ denotes the adjusted attention score for token $i$ and $j$ for layer $l$ and attention head $z$
74
+
75
+ # 2.2 RELATIONAL CONSTITUENT-BASED TRANSFORMER (RelConsTrans)
76
+
77
+ We extend ConsTrans with the objective of learning relation embedding between pairs of tokens. For each pair of tokens, the goal is to learn an embedding that represents the syntactic relation between the pair. To generate the relation embedding, we learn a non-linear projection for the concatenation of the representation for the tokens:
78
+
79
+ $$
80
+ r _ { i , j } = W _ { r 2 } E L U ( W _ { r 1 } [ h _ { i } , h _ { j } ] ) ,
81
+ $$
82
+
83
+ where $r _ { i , j }$ is the learnt embedding for token $i$ and token $j$ , $E L U$ is the exponential linear unit, $h _ { i }$ and $h _ { j }$ are BERT embeddings for token $i$ and $j$ respectively. The learnt embedding would be included in two ways - during attention computation and during information propagation stage.
84
+
85
+ Relation-aware Attention Computation To perform relation-aware attention computation, we make the following changes to the adjusted scaled dot-product attention formulation in Equation 1 before adjusting the attention scores with constituent probability as in Equation 5:
86
+
87
+ ![](images/68f7341739d50c71930d36b84c5c19ea207dede4f9001672b318819c0d5b9a88.jpg)
88
+ Figure 3: Oveview of Relational Constituent-based Transformer and Relation Label Generator.
89
+
90
+ $$
91
+ \alpha _ { i , j } ^ { l z } = \frac { \exp F ^ { l z } ( h _ { i } ^ { l } , h _ { j } ^ { l } ) } { \sum _ { j ^ { \prime } } \exp F ^ { l z } ( h _ { i } ^ { l } , h _ { j ^ { \prime } } ^ { l } ) } ; \quad F ^ { l z } ( h _ { i } ^ { l } , h _ { j } ^ { l } ) = \frac { ( W _ { Q } ^ { l z } h _ { i } ^ { l } ) ( W _ { K } ^ { l z } h _ { j } ^ { l } + W _ { K r } ^ { l } r _ { i j } ) ^ { T } } { \sqrt { d _ { k } } }
92
+ $$
93
+
94
+ where $W _ { K r } ^ { l } \in \mathbb { R } ^ { d _ { r } , d _ { k } }$ projects the learnt relation embedding $r _ { i j }$ and is shared across attention heads. The attention weights would be determined by both textual features, $h _ { j } ^ { l }$ , and syntactic relation represented by $r _ { i j }$ .
95
+
96
+ Relation-aware information propagation The attention weights obtained from Equation 7 would then be used to weigh the contribution of other tokens in updating the representation of a token, $h _ { i } ^ { l }$ with the following equation:
97
+
98
+ $$
99
+ h _ { i } ^ { l + 1 } = W _ { p } ^ { l } [ \sum _ { j } \alpha _ { i , j } ^ { ' l 1 } * ( W _ { V } ^ { l z } h _ { j } ^ { l } + W _ { V r } ^ { l } r _ { i j } ) ] _ { z }
100
+ $$
101
+
102
+ where $W _ { V } ^ { l z } \in \mathbb R ^ { d _ { m o d e l } , d _ { v } }$ is a projection layer that project the value vector to various attention heads with dimension $d _ { v }$ . $W _ { p } ^ { l } \in \mathbb R ^ { d _ { v } , d _ { m o d e l } }$ projects the concatenation of vectors from each attention head to size $d _ { m o d e l }$ for layer $l$ . $W _ { V r } ^ { l } \in \mathbb { R } ^ { d _ { r } , d _ { v } }$ is a projection layer and is shared across attention heads. Therefore, both textual and syntactic and features would be propagated from one token to another.
103
+
104
+ # 2.3 RelConsTrans WITH LABEL GENERATOR (RelConsTransLG)
105
+
106
+ We found that RelConsTrans fails to outperform ConsTrans, possibly due to a lack of guidance on how the relation embedding should be learned. Previous work (e.g., Bai et al., 2020) used the dependency parser as an auxiliary label generator to improve ABSA. To avoid the need for a dependency parser, we propose to meta learn a relation label generator that would be trained alongside the primary task to generate auxiliary labels optimal for enhancing the performance of ABSA. An overview of the Relational Constituent-based Transformer with the Relation Generator (RelConsTransLG) is shown in Figure 3. The relation label generator, trained in a self-supervised manner (Liu et al., 2019), would produce relation labels to guide the learning of the relation embedding.
107
+
108
+ As syntax information has been shown to be useful for ABSA in previous work (e.g., Bai et al., 2020), we design our relation label generator to encourage the generation of syntax related labels as relation labels with supervision from the ABSA task. Hewitt & Manning (2019) showed that the L2 distance of a linear projection of token embeddings obtained from BERT could recover the parse tree distances between the tokens. Therefore, we learn a linear transformation of the word representation space with the intention of learning syntactic relatedness. The learned syntactic relatedness would then be used as the ground truth for the L2 norm of the relation embedding. Different from Hewitt & Manning (2019), we do not use ground truth labels to train the relation label generator. Instead, we learn this linear projection in a meta learning manner.
109
+
110
+ For a pair of tokens $i$ and $j$ , we learn a linear projection for the BERT representation:
111
+
112
+ $$
113
+ l _ { i j } = W _ { 1 } ( h _ { i } ^ { b e r t , n } - h _ { j } ^ { b e r t , n } ) + b _ { 1 } ,
114
+ $$
115
+
116
+ where $l _ { i j }$ is a scalar relation label for token $i$ and $j$ , $W _ { 1 }$ and $b _ { 1 }$ are the weights and bias of the linear transformation layer. hbert,ni r epresents the embedding of token $i$ from the $n ^ { t h }$ layer of the BERT
117
+
118
+ <table><tr><td rowspan="2">Data Set</td><td colspan="3">Positive</td><td colspan="3">Neutral</td><td colspan="3">Negative</td></tr><tr><td>Train</td><td>Dev</td><td>Test</td><td>Train</td><td>Dev</td><td>Test</td><td>Train</td><td>Dev</td><td>Test</td></tr><tr><td>Restaurant</td><td>2164</td><td>-</td><td>728</td><td>637</td><td>-</td><td>196</td><td>807</td><td>-</td><td>196</td></tr><tr><td>Laptop</td><td>994</td><td>、</td><td>341</td><td>464</td><td>-</td><td>169</td><td>870</td><td>-</td><td>128</td></tr><tr><td>Twitter14</td><td>1561</td><td>-</td><td>173</td><td>3127</td><td>-</td><td>346</td><td>1560</td><td>1</td><td>173</td></tr><tr><td>Twitter15</td><td>928</td><td>303</td><td>317</td><td>1883</td><td>670</td><td>607</td><td>368</td><td>149</td><td>113</td></tr><tr><td>Twitter17</td><td>1508</td><td>515</td><td>493</td><td>1638</td><td>517</td><td>573</td><td>416</td><td>144</td><td>168</td></tr><tr><td>Twitter14 (AS)</td><td>1538</td><td>-</td><td>190</td><td>3300</td><td>-</td><td>173</td><td>1445</td><td>-</td><td>288</td></tr></table>
119
+
120
+ Table 1: Statistics of the 5 benchmark data sets. TS refers to splitting the data by aspect.
121
+
122
+ model. As different layers of BERT appear to represent different types of information as shown by Tenney et al. (2019), we could recover different information by selecting different BERT layers (different $n$ ). In our experiments, we fixed the value of $n$ to 6 for all data sets.
123
+
124
+ Meta Training Relation Label Generator To guide the training of the embedding, we minimize the mean square error (MSE) of the generated label and the L2 norm of the relation embedding:
125
+
126
+ $$
127
+ M S E ( l , r ) = \sum _ { i . j } ( \| r _ { i j } \| _ { 2 } - l _ { i j } ) ^ { 2 } .
128
+ $$
129
+
130
+ Drawing inspiration from recent work by Liu et al. (2019), we train our label generator using the loss from ABSA with the goal of generating relation labels $l _ { i j }$ to directly optimize for the performance of the main task.
131
+
132
+ Let $\theta _ { m a i n }$ be the parameters of our main model, RelConsTrans. To update the parameters of $\theta _ { m a i n }$ , we aim to minimize a multi-task loss – cross-entropy loss, $L$ from the ABSA prediction task and the MSE loss described in Equation 10:
133
+
134
+ $$
135
+ \operatorname * { a r g m i n } _ { \theta _ { m a i n } } ( L ( \hat { y } , y ) + M S E ( l , r ) ) .
136
+ $$
137
+
138
+ Let $\theta _ { m a i n } ^ { + }$ be the weights of the RelConsTrans after one gradient update step of gradient descent:
139
+
140
+ $$
141
+ \theta _ { m a i n } ^ { + } = \theta _ { m a i n } - \alpha _ { m a i n } \nabla _ { \theta _ { m a i n } } \underset { \theta _ { m a i n } } { \arg \operatorname* { m i n } } ( L ( \hat { y } , y ) + M S E ( l , r ) ) ,
142
+ $$
143
+
144
+ where $\alpha _ { m a i n }$ is the learning rate to train the RelConsTrans. Note that the MSE from the relation embedding would not be used to train the relation label generator. Therefore, the parameters of the relation label generator, $\theta _ { a u x }$ should be updated by solely the loss from ABSA:
145
+
146
+ $$
147
+ \underset { \theta _ { a u x } } { \arg \operatorname* { m i n } } ( L ( \hat { y } , y ) ) ,
148
+ $$
149
+
150
+ To update the weights of the generator, a second order derivative is computed. While this formulation was inspired by Liu et al. (2019), the second-order derivative trick used in our model was also used in a number of other meta-learning frameworks such as Finn et al. (2017).
151
+
152
+ We train the two models in tandem, over a few iterations. We found it useful to train $\theta _ { m a i n }$ and $\theta _ { a u x }$ with separate training sets. For each data set, we took a subset of the cases which contain two or more aspects (meta-train set) in the same sentence for training $\theta _ { a u x }$ . This subset is removed from the main training set (train set) used to train the main RelConsTrans. More details of the meta-train set would be provided in the appendix A.1.
153
+
154
+ # 3 RESULTS AND ANALYSIS
155
+
156
+ We conducted experiments on 5 benchmark data sets - restaurant reviews, laptop reviews from SemEval 2014 (Pontiki et al., 2014), ACL14 Twitter14 data set (Dong et al., 2014) and Twitter15 and Twitter17 from a multi-modal ABSA data set by (Yu & Jiang, 2019). For analysis, we ran additional experiments on a split of the Twitter14 data set by aspect. We summarize the statistics of the data in Table 1. For data sets with development sets, we perform model selection on the development sets.
157
+
158
+ For Restaurant, Laptop and Twitter14, we compare against published results from BERT-PT $\mathrm { { \Delta X u } }$ et al., 2019), BERT-SPC (Song et al., 2019), AEN-BERT (Song et al., 2019), SDGCN-BERT (Zhao et al., 2020), Transformer(B) (Bai et al., 2020), RGAT-Bai (Bai et al., 2020), RGAT-Wang (Wang et al., 2020), DGEDT-BERT (Tang et al., 2020) and LCFS-ASC-CDW (Phan & Ogunbona, 2020). The Transformer(B) is a baseline model used by Bai et al. (2020), and is the baseline vanilla Transformer on which ConsTrans is built upon. For Twitter 15 and Twitter17, we compare against published results in (Yu & Jiang, 2019): MemNet (Tang et al., 2016), RAM (Chen et al., 2017), MGAN (Fan et al., 2018), BERT, BERT $^ +$ BL (Yu & Jiang, 2019) and TomBERT (Yu & Jiang, 2019).
159
+
160
+ Table 2: Accuracy and F-score (F1) for 5 data sets: In the left (resp. right) table, systems marked \* are those that used dependency parses (resp. multi-modal information). The best Macro F1 for each data set is in bold. For significance tests, we compare against RGAT-Wang(re-run), TomBERT and BERT $\scriptstyle + \mathrm { B L }$ . Our results are significant against RGAT-Wang(re-run) and BERT $\scriptstyle \cdot + \mathbf { B } \mathbf { L }$ . Twitter17 was significant against TomBERT (which used image data in addition to text data) but not Twitter15.
161
+
162
+ <table><tr><td>Data Set</td><td colspan="2">Restaurant</td><td colspan="2">Laptop</td><td colspan="2">Twitter14</td></tr><tr><td>Model</td><td>Acc</td><td>F1</td><td>Acc</td><td>F1</td><td>Acc</td><td>F1</td></tr><tr><td>BERT-PT</td><td>85.0</td><td>77.0</td><td>78.1</td><td>75.1</td><td></td><td>-</td></tr><tr><td>BERT-SPC</td><td>84.5</td><td>77.0</td><td>79.0</td><td>75.0</td><td>73.6</td><td>72.1</td></tr><tr><td>AEN-BERT</td><td>83.1</td><td>73.8</td><td>79.9</td><td>76.3</td><td>74.7</td><td>73.1</td></tr><tr><td>SDGCN-BERT</td><td>83.6</td><td>76.5</td><td>81.4</td><td>78.3</td><td>=</td><td>-</td></tr><tr><td>Transformer(B)</td><td>84.9</td><td>77.9</td><td>79.3</td><td>76.1</td><td>-</td><td>-</td></tr><tr><td>RGAT-Bai*</td><td>86.6</td><td>80.5</td><td>81.3</td><td>78.6</td><td>75.8</td><td>74.7</td></tr><tr><td>RGAT-Wang*</td><td>86.6</td><td>81.4</td><td>78.2</td><td>74.1</td><td>76.2</td><td>74.9</td></tr><tr><td>RGAT-Wang (re-run)*</td><td>85.7</td><td>79.1</td><td>79.0</td><td>75.6</td><td>73.6</td><td>73.1</td></tr><tr><td>DGEDT-BERT*</td><td>86.3</td><td>80.0</td><td>79.8</td><td>75.6</td><td>77.9</td><td>75.4</td></tr><tr><td>LCFS-ASC-CDW*</td><td>86.7</td><td>80.3</td><td>80.5</td><td>77.1</td><td>-</td><td>-</td></tr><tr><td>ConsTrans</td><td>85.8</td><td>80.8</td><td>80.6</td><td>77.2</td><td>76.6</td><td>75.0</td></tr><tr><td>RelConsTrans</td><td>85.4</td><td>79.3</td><td>80.1</td><td>76.4</td><td>75.9</td><td>74.7</td></tr><tr><td>RelConsTransLG</td><td>86.7</td><td>81.4</td><td>81.0</td><td>78.1</td><td>76.9</td><td>75.5</td></tr></table>
163
+
164
+ <table><tr><td>Data Set Model</td><td>Twitter15 Acc</td><td>F1</td><td>Twitter17 Acc</td><td>F1</td></tr><tr><td>AE-LSTM</td><td>70.3</td><td>63.4</td><td>61.7</td><td>58.0</td></tr><tr><td>MemNet</td><td>70.1</td><td>61.8</td><td>64.2</td><td>60.9</td></tr><tr><td>RAM</td><td>70.7</td><td>63.1</td><td>64.4</td><td>61.0</td></tr><tr><td>MGAN</td><td>71.2</td><td>64.2</td><td>64.8</td><td>61.5</td></tr><tr><td>BERT</td><td>74.2</td><td>68.9</td><td>68.2</td><td>65.2</td></tr><tr><td>BERT+BL</td><td>74.3</td><td>70.0</td><td>68.9</td><td>66.1</td></tr><tr><td>TomBERT*</td><td>77.2</td><td>71.8</td><td>70.5</td><td>68.0</td></tr><tr><td>ConsTrans</td><td>76.5</td><td>72.5</td><td>69.3</td><td>68.2</td></tr><tr><td>RelConsTrans</td><td>76.9</td><td>71.6</td><td>69.0</td><td>67.7</td></tr><tr><td>RelConsTransLG</td><td>76.8</td><td>73.3</td><td>69.8</td><td>68.5</td></tr></table>
165
+
166
+ For the Restaurant and Twitter14 data sets, we outperform all previous work that did not require dependency parsers by competitive margins (4.8 F-score for Restaurant and $2 . 4 \mathrm { F } \cdot$ -score for Twitter14). Our results on the Laptop data (78.1) is also close to the state-of-the-art results (78.3) achieved by SDGCN-BERT. Furthermore, comparing results with models that require a dependency parser, we also outperform a number of models while closely matching the results of others. For Twitter15 and Twitter17, we see in Table 2 that our best model outperforms previous work that uses only textual content by a margin (3.3 F-score for Twitter15 and 2.4 F-Score for Twitter17). Our model also outperforms TomBERT, the multi-modal models for Twitter15 and Twitter17.
167
+
168
+ To conduct statistical significance tests, we attempt to reproduce the results published for RGATWang, TomBERT and BERT $\mathrm { + B L }$ . For RGAT-Wang, we could not reproduce their published results (with their recommended settings), and hence we can only conduct the test against the results we obtain with their open source code, shown as RGAT-Wang(re-run) in Table 2. We run the randomization test (Yeh, 2000) with 100,000 shuffles. We found that RelConsTransLG outperforms RGATWang(re-run) and BERT $\scriptstyle + \mathrm { B L }$ significantly $( p < 0 . 1 5 )$ . RelConsTransLG significantly outperforms TomBERT (which has additional access to image data) for Twitter17, but not Twitter15.
169
+
170
+ When comparing our proposed ConsTrans model to a vanilla Transformer, we observe that ConsTrans outperforms the vanilla Transformer model for both the Restaurant and Laptop data sets. This suggests that it is indeed useful to induce constituents for ABSA. Lastly, comparing ConsTrans and RelConsTransLG, we observe that RelConsTransLG consistently outperforms ConsTrans for all the data sets. This suggests that our meta-learnt label generator is able to generate useful auxiliary labels for ConsTrans for the ABSA task.
171
+
172
+ # 3.1 ANALYSIS
173
+
174
+ In this section, we provide findings from ablation studies and analysis of our proposed models.
175
+
176
+ Grammar Induction We derive constituent trees with the constituent probabilities to verify if the derived trees resemble ground truth constituent trees. In Figure 4, we show an example where our derived constituent tree shows a similar structure to the ground truth constituency tree. Notably, we are able to accurately recall the aspect term, “jessica alba” as a constituent. The algorithm to derive constituent trees and more examples are provided in Appendix A.4 and A.6 respectively.
177
+
178
+ ![](images/5ecf3c166cd5c2d8abe39f6a37ace0de288864f8232c85df256ec6823b6ab954.jpg)
179
+ Figure 4: Example of derived constituent Tree by ConsTrans (Left) and constituent Tree from Berkeley Neural Parser (Kitaev & Klein, 2018) (Right).
180
+
181
+ We postulate that the ability of ConsTrans to group aspect terms into noun phrases should improve its ABSA accuracy. To study our hypothesis, we looked at ConsTrans’s ability to recall the entire aspect term as a noun phrase. For simplicity, we only look at records where aspect terms were not broken down into sub-word tokens. For Twitter17, we found that ConsTrans achieves 67.8 recall rate for correctly predicted instances and 62.2 for incorrect instances. The Pearson correlation coefficient between prediction accuracy and recall rate was significant (with $\mathfrak { p } < 0 . 2 )$ ), indicating the usefulness of being able to induce good constituents for ABSA.
182
+
183
+ Generalibility of RelConsTransLG The key argument by Liu et al. (2019) for designing an additional label generator is to increase the generalizability of the main model. To test the generalizability of RelConsTransLG, we create a more challenging version of Twitter14 by splitting the data such that the train and test set comprises of different aspect terms. The statistics of the data after splitting by aspect (denoted by AS) is shown in Table 1. We further split the train set by aspect terms to create a meta-train set to train the label generator in RelConsTransLG. Therefore, the relation label generator is trained to generate relation labels that enhance the performance of data with foreign aspect terms. In this AS setting, RelConsTransLG achieves a F-score of 64.3 while ConsTrans achieved a F-score of 62.8. Our designed framework mimics the actual train and test setting and is therefore able to increase the generalizabillity of RelConsTransLG.
184
+
185
+ Different layers of BERT as input Tenney et al. (2019) found that different BERT layers encapsulate different information useful for various NLP tasks. Therefore, we experimented with using all 12 layers of BERT as input to the label generator to study the impact on the F-score. The graph for the F-score against BERT layer $( n )$ is provided in Appendix A.3. Using representation from the $6 ^ { t h }$ layer of BERT yields the best results for the restaurant data set and we are able to consistently outperform models that do not use dependency parses for all value of $n$ chosen. Furthermore, this is an indication that syntactic information is indeed useful for ABSA since lower layers of BERT were found to encapsulate syntactic information.
186
+
187
+ Interpreting learnt relation labels Our relation label generator is designed to encourage the generation of syntax related labels. To verify the hypothesis that generated relation label is related to syntax, we reconstruct the dependency parses using the learnt relation embedding. Interestingly, while Dozat & Manning (2017) have found that the L2 norm of relation embedding resembles syntactic distance (i.e., a lower norm means stronger dependency), we found that our learned relation embedding exhibits an opposite phenomenon: a higher L2 norm indicates a stronger dependency. We hypothesize that relation embedding with higher L2 norm would influence attention weights to a greater extent. Therefore, the L2 norm of our learnt relation embedding would represent syntactic relatedness rather than syntactic distance. We then construct parse trees by linking tokens with highest L2 norm of their relation embedding as detailed in Appendix A.5.
188
+
189
+ Manual inspection of these records suggest that while a full parse tree was not induced, we are able to recover most of adjective-noun relations. As seen in Figure 5, we are able to retrieve the relation of (“pleasant”, “staff”) and (“friendly”, “staff”). This is expected since understanding adjectivenoun relations would be most important to ABSA compared to other types of relations. Therefore, training RelConsTransLG with supervision from solely ABSA would yield this behaviour.
190
+
191
+ Furthermore, to look at the ability of RelConsTransLG to link relevant adjective terms, we engaged two annotators to annotate the adjective terms relevant to each aspect term for the test set for the
192
+
193
+ ![](images/7328ff57d88b6e8ff997330a5ea9422df27283b0d3b6d2dd1a058c0a675abd86.jpg)
194
+ Figure 5: Examples of induced dependency parses Tree by RelConsTransLG (Top arrows) and ground truth dependency parses (bottom arrows) from StanfordNLP https://corenlp.run/. Arrows in grey are for opinion terms accurately linked to the aspect term “staff”.
195
+
196
+ Restaurant data. The annotators reconciled their differing opinions and gave each record a final label. Records with no clear opinion terms was given a ”None” label. There were 1,120 records annotated and 811 had annotated adjective terms. We rank the relatedness of tokens with the aspect term by the L2 norm of the relation embedding and compare it with ground truth ranks. Ground truth ranks were obtained by ranking tokens with their syntactic distance obtained from StanfordNLP dependency parser (Chen & Manning, 2014) with tied rank taken into account. For records where the adjective term was more than 1 syntactic distance away, we obtain an equal or smaller rank than the syntactic distance in $6 3 . 5 \%$ of the cases. Compared against position offset ranks, we obtain an equal or small rank than the number of position offsets in $6 5 . 0 \%$ of the cases.
197
+
198
+ # 4 RELATED WORK
199
+
200
+ Sentiment analysis (Pang & Lee, 2008) is a well studied natural language processing problem. Early works applied sentiment analysis to product reviews as a text classification problem. However, a review or social media post could express different sentiments to different aspects, and the task of aspect-based sentiment analysis aims at a finer classification of sentiment towards specific aspects (Dong et al., 2014) or aspects (Pontiki et al., 2016).
201
+
202
+ Recent work on ABSA has shown that the use of dependency parses for ABSA helps to improve performance (Bai et al., 2020; Huang & Carley, 2019; Sun et al., 2019; Wang et al., 2020). However, supervised dependency parsers require a substantial amount of annotated data, and might perform badly for out-of-domain (e.g., social media) or low-resource languages. On the other hand, it has been shown that contextual embeddings such as BERT (Devlin et al., 2018) contain significant information that could be useful to parsers (Clark et al., 2019; Kim et al., 2020a). Previous work such as Hewitt & Manning (2019) have shown that a linear projection is sufficient to recover syntactic information from BERT embedding. In this paper, we show that we can achieve similar ABSA performance without supervised parsers, by leveraging on BERT which was trained with raw data.
203
+
204
+ Previous work on unsupervised grammar induction such as Shen et al. (2019); Kim et al. (2019) aims to induce grammar from raw data. Our primary objective is not to induce grammar, but to encourage the model to learn to perform the ABSA task by learning the causal edge dependencies between constituents. We show that our approach is able to achieve results that rivals those obtained by models that have access to supervised dependency parsers.
205
+
206
+ In this work, we applied meta auxiliary learning (Liu et al., 2019) which learns to generate auxiliary labels, supervised by the primary task. While Liu et al. (2019) failed to interpret the auxiliary labels for the computer vision tasks they worked on, we showed that in our case, the induced auxiliary labels can be interpreted as syntactic relatedness to a certain extent.
207
+
208
+ # 5 CONCLUSION
209
+
210
+ In this paper, we apply a meta auxiliary learning approach to the ABSA task, and we show that the induced relations between phrases are interpretable and supports the primary task of sentiment analysis. We show that learning the auxiliary labels improve results over our baselines on all five data sets. Without using dependency parsers, our approach performs competitively compared to previous work that used dependency parses as input.
211
+
212
+ # REFERENCES
213
+
214
+ Xuefeng Bai, Pengbo Liu, and Yue Zhang. Exploiting typed syntactic dependencies for targeted sentiment classification using graph attention neural network. CoRR, abs/2002.09685, 2020. URL https://arxiv.org/abs/2002.09685.
215
+
216
+ Danqi Chen and Christopher Manning. A fast and accurate dependency parser using neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 740–750, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1082. URL https://www.aclweb.org/anthology/ D14-1082.
217
+
218
+ Peng Chen, Zhongqian Sun, Lidong Bing, and Wei Yang. Recurrent attention network on memory for aspect sentiment analysis. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 452–461, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1047. URL https://www. aclweb.org/anthology/D17-1047.
219
+
220
+ Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of bert’s attention. CoRR, abs/1906.04341, 2019. URL http://arxiv.org/ abs/1906.04341.
221
+
222
+ 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.
223
+
224
+ Li Dong, Furu Wei, Chuanqi Tan, Duyu Tang, Ming Zhou, and Ke Xu. Adaptive recursive neural network for target-dependent twitter sentiment classification. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 49–54, Baltimore, Maryland, June 2014. Association for Computational Linguistics. doi: 10.3115/v1/ P14-2009. URL https://www.aclweb.org/anthology/P14-2009.
225
+
226
+ Timothy Dozat and Christopher D. Manning. Deep biaffine attention for neural dependency parsing. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https: //openreview.net/forum?id ${ . } = { }$ Hk95PK9le.
227
+
228
+ Feifan Fan, Yansong Feng, and Dongyan Zhao. Multi-grained attention network for aspect-level sentiment classification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3433–3442, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1380. URL https://www.aclweb. org/anthology/D18-1380.
229
+
230
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. CoRR, abs/1703.03400, 2017. URL http://arxiv.org/abs/1703. 03400.
231
+
232
+ John Hewitt and Christopher D. Manning. A structural probe for finding syntax in word representations. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4129–4138, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1419. URL https://www.aclweb.org/anthology/ N19-1419.
233
+
234
+ Binxuan Huang and Kathleen Carley. Syntax-aware aspect level sentiment classification with graph attention networks. 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. 5469–5477, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1549. URL https://www.aclweb.org/ anthology/D19-1549.
235
+
236
+ Taeuk Kim, Jihun Choi, Daniel Edmiston, and Sang goo Lee. Are pre-trained language models aware of phrases? simple but strong baselines for grammar induction. In International Conference on Learning Representations, 2020a. URL https://openreview.net/forum?id= H1xPR3NtPB.
237
+
238
+ Taeuk Kim, Jihun Choi, Daniel Edmiston, and Sang goo Lee. Are pre-trained language models aware of phrases? simple but strong baselines for grammar induction. In International Conference on Learning Representations, 2020b. URL https://openreview.net/forum?id $=$ H1xPR3NtPB.
239
+
240
+ Yoon Kim, Alexander Rush, Lei Yu, Adhiguna Kuncoro, Chris Dyer, and Gabor Melis. Unsu- ´ pervised recurrent neural network grammars. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 1105–1117, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1114. URL https://www.aclweb.org/anthology/N19-1114.
241
+
242
+ 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. URL http: //arxiv.org/abs/1412.6980.
243
+
244
+ Nikita Kitaev and Dan Klein. Constituency parsing with a self-attentive encoder. CoRR, abs/1805.01052, 2018. URL http://arxiv.org/abs/1805.01052.
245
+
246
+ Shikun Liu, Andrew J. Davison, and Edward Johns. Self-supervised generalisation with meta auxiliary learning. CoRR, abs/1901.08933, 2019. URL http://arxiv.org/abs/1901.08933.
247
+
248
+ Bo Pang and Lillian Lee. Opinion mining and sentiment analysis. Foundations and Trends in Information Retrieval, 2(1-2):1–135, 2008.
249
+
250
+ Minh Hieu Phan and Philip O. Ogunbona. Modelling context and syntactical features for aspectbased sentiment analysis. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 3211–3220, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.293. URL https://www.aclweb.org/ anthology/2020.acl-main.293.
251
+
252
+ Maria Pontiki, Dimitris Galanis, John Pavlopoulos, Harris Papageorgiou, Ion Androutsopoulos, and Suresh Manandhar. SemEval-2014 task 4: Aspect based sentiment analysis. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014), pp. 27–35, Dublin, Ireland, August 2014. Association for Computational Linguistics. doi: 10.3115/v1/S14-2004. URL https://www.aclweb.org/anthology/S14-2004.
253
+
254
+ Maria Pontiki, Dimitrios Galanis, Haris Papageorgiou, Ion Androutsopoulos, Suresh Manandhar, Mohammad Al-Smadi, Mahmoud Al-Ayyoub, Yanyan Zhao, Bing Qin, Orphee De Clercq, et al. ´ Semeval-2016 task 5: Aspect based sentiment analysis. In 10th International Workshop on Semantic Evaluation (SemEval 2016), 2016.
255
+
256
+ Yikang Shen, Shawn Tan, Alessandro Sordoni, and Aaron Courville. Ordered neurons: Integrating tree structures into recurrent neural networks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ B1l6qiR5F7.
257
+
258
+ Youwei Song, Jiahai Wang, Tao Jiang, Zhiyue Liu, and Yanghui Rao. Attentional encoder network for targeted sentiment classification. CoRR, abs/1902.09314, 2019. URL http://arxiv. org/abs/1902.09314.
259
+
260
+ Kai Sun, Richong Zhang, Samuel Mensah, Yongyi Mao, and Xudong Liu. Aspect-level sentiment analysis via convolution over dependency tree. 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. 5679–5688, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1569. URL https://www.aclweb.org/anthology/D19-1569.
261
+
262
+ Duyu Tang, Bing Qin, and Ting Liu. Aspect level sentiment classification with deep memory network. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 214–224, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1021. URL https://www.aclweb.org/anthology/ D16-1021.
263
+
264
+ Hao Tang, Donghong Ji, Chenliang Li, and Qiji Zhou. Dependency graph enhanced dualtransformer structure for aspect-based sentiment classification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 6578–6588, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.588. URL https://www.aclweb.org/anthology/2020.acl-main.588.
265
+
266
+ Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT rediscovers the classical NLP pipeline. CoRR, abs/1905.05950, 2019. URL http://arxiv.org/abs/1905.05950.
267
+
268
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL http://arxiv.org/abs/1706.03762.
269
+
270
+ Kai Wang, Weizhou Shen, Yunyi Yang, Xiaojun Quan, and Rui Wang. Relational graph attention network for aspect-based sentiment analysis. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 2020. doi: 10.18653/v1/2020.acl-main.295. URL http://dx.doi.org/10.18653/v1/2020.acl-main.295.
271
+
272
+ Hu Xu, Bing Liu, Lei Shu, and Philip Yu. BERT post-training for review reading comprehension and aspect-based sentiment analysis. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 2324–2335, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1242. URL https://www.aclweb.org/anthology/N19-1242.
273
+
274
+ Alexander Yeh. More accurate tests for the statistical significance of result differences. In Proceedings of the 18th Conference on Computational Linguistics - Volume 2, COLING ’00, pp. 947–953, USA, 2000. Association for Computational Linguistics. doi: 10.3115/992730.992783. URL https://doi.org/10.3115/992730.992783.
275
+
276
+ Jianfei Yu and Jing Jiang. Adapting BERT for target-oriented multimodal sentiment classification. In Sarit Kraus (ed.), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019, pp. 5408–5414. ijcai.org, 2019. doi: 10.24963/ijcai.2019/751. URL https://doi.org/10.24963/ijcai.2019/751.
277
+
278
+ Pinlong Zhao, Linlin Hou, and Ou Wu. Modeling sentiment dependencies with graph convolutional networks for aspect-level sentiment classification. Knowledge-Based Systems, 193:105443, 2020.
279
+
280
+ # A APPENDIX
281
+
282
+ # A.1 META-SPLITTING DATA SET
283
+
284
+ To generate the meta-train set, we first obtain a subset of samples with multiple aspects of differing sentiment from the full train set. $80 \%$ of this subset would then be used as the meta-train set. For Twitter2014 (AS), we sampled this meta-train set by aspects. The intention is to train the Relation Label Generator to generate labels that can encourage the model to accurately link relevant opinion terms to the aspect term through challenging samples. The statistics of the meta-train set is provided in Table 3.
285
+
286
+ <table><tr><td>Data set</td><td>Positive</td><td>Neutral</td><td>Negative</td><td>Total</td></tr><tr><td>Restaurant</td><td>195</td><td>163</td><td>162</td><td>520</td></tr><tr><td>Laptop</td><td>85</td><td>98</td><td>61</td><td>244</td></tr><tr><td>Twitter2014</td><td>265</td><td>567</td><td>301</td><td>1133</td></tr><tr><td>Twitter2015</td><td>123</td><td>161</td><td>56</td><td>340</td></tr><tr><td>Twitter2017</td><td>320</td><td>470</td><td>111</td><td>901</td></tr><tr><td>Twitter2014 (AS)</td><td>207</td><td>253</td><td>254</td><td>714</td></tr></table>
287
+
288
+ Table 3: Statistics of the meta-train sets. AS refers to splitting the data by aspect.
289
+
290
+ # A.2 IMPLEMENTATION DETAILS
291
+
292
+ In all experiments, we used the ADAM optimizer (Kingma & Ba, 2015) with a learning rate of $1 0 ^ { - 5 }$ to optimize the models (ConsTrans, RelConsTrans, RelConsTransLG and the relation label generator). The BERT model was fine-tuned together with the main model built on top of it. We used 6 multi-head attention heads and the size of the hidden layer was set to be 384. We stacked 4 encoder layers. Lower layers are defined to be the first 2 layers in the encoder stack while the last 2 layers are higher layers. Dropout was applied to all input embeddings. The L2 penalisation term for the model’s parameters was set to be 1e-5. The size of the learnt embedding for each relation label was set to be 786 and a batch size of 4 was used to train all the models.
293
+
294
+ # A.3 DIFFERENT LAYERS OF BERT
295
+
296
+ The graph for Macro F-score against BERT layer $( n )$ is shown in Figure 6. Using representation from the $6 ^ { t h }$ layer of BERT yields the best results for the restaurant data set and we used the $6 ^ { t h }$ layer of BERT as input to the relation label generator for all the other data sets.
297
+
298
+ ![](images/e1bd1ff89f8e6d3a3a9a7c30856f2dd66b56b661e81c6af25fe48d8257cf8886.jpg)
299
+ Figure 6: Macro F-score on Restaurant data set with different BERT layer as input to LG.
300
+
301
+ # A.4 ALGORITHM TO DERIVE CONSTITUENT TREES
302
+
303
+ To derive constituent trees, we iteratively split the input constituents into 2 parts till each constituent is only made up of only 1 token. The breaking point is defined to be the point where the probability of being in the same constituent for token $i$ and $i + 1$ is the lowest. We use the constituent probability from the second layer of our encoder stack to find the breaking point.
304
+
305
+ # Algorithm 1 Unsupervised constituent tree derivation
306
+
307
+ 1: $m \gets$ Constituent layer chosen
308
+ 2: $x \gets$ Input tokens
309
+ 3: $p $ Constituent probability from layer m for current constituent
310
+ 4: $s t a c k = [ x ]$
311
+ 5: constituents = []
312
+ 6:
313
+ 7: procedure GETCONSTTREE $( x , p )$
314
+ 8: while len(stack) $! = 0$ do
315
+ 9: current const ← stack[0]
316
+ 10: $p _ { 0 } $ constituent probabilities for current const
317
+ 11: $\mathbf { b } = \mathbf { a r g m i n } ( b _ { 0 } )$ . Find the breaking poin
318
+ 12: l $f t _ { - } c o n s t = \mathbf { x } [ : \mathbf { b } ]$
319
+ 13: right const = x[b:]
320
+ 14: if len(left const) $> 1$ then
321
+ 15: add lef t const to constituents
322
+ 16: end if
323
+ 17: if len(right const) $> 1$ then
324
+ 18: add right const to constituents
325
+ 19: end if
326
+ 20: add lef t const and right const to constituents
327
+ 21: end while
328
+ 22: Return constituents
329
+ 23: end procedure
330
+
331
+ # A.5 ALGORITHM TO INDUCE DEPENDENCY PARSES
332
+
333
+ To recover parse trees, we iteratively linked tokens to another token with the highest L2 norm for the learnt relation embedding. We do not allow tokens to be linked multiple times.
334
+
335
+ # Algorithm 2 Unsupervised dependency parse tree induction
336
+
337
+ 1: procedure GETDEPNTREE $( x , p )$
338
+ 2: depen labels $= [ ]$
339
+ 3: relation norm The L2 norm of learnt embedding
340
+ 4: for $j 1$ to lengthx do
341
+ 5: current max $=$ max(relation norm)
342
+ 6: $i$ , $j =$ position(current max);
343
+ 7: add $( i , j )$ to depen labels
344
+ 8: relation norm[:, $\mathrm { j } ] = - \infty$ ;
345
+ 9: relation norm[j, $\mathrm { i } ] = - \infty$ ;
346
+ 10: end for
347
+ 11: Return depen labels
348
+ 12: end procedure
349
+
350
+ # A.6 EXAMPLES OF DERIVED CONSTITUENT TREES
351
+
352
+ We provide more examples of constituent trees derived from ConsTrans. In general, while we were not able to fully replicate ground truth constituent trees, we noticed that the model was able to recall noun phrases reasonably.
353
+
354
+ ![](images/f508c6d8bad2ac83439dbadb799c15148146bd3f14900d021262fd26a1789537.jpg)
355
+ Figure 7: Example of derived constituent Tree by ConsTrans with aspect term “ $@$ Jullia webber”.
356
+
357
+ ![](images/d91a9f8c4c6023759ee09237d8542a38ea91a1b791b9efe30394a60d351a3715.jpg)
358
+ Figure 8: Example of derived constituent Tree by ConsTrans with aspect term “ $@$ golden state warriors”.
359
+
360
+ ![](images/d8eb1eac665e47afaef1db091c5d25c7e7873f21ea0a84675602b49194d5fc97.jpg)
361
+ Figure 9: Example of derived constituent Tree by ConsTrans with aspect term “sadiq Kahn’s”.
362
+
363
+ # A.7 EXAMPLES OF INDUCED DEPENDENCY PARSE TREES
364
+
365
+ We provide more examples of induced dependency parses from RelConsTransLG. While our induced parse trees were not identical to ground truth parse trees, we were able to link adjective terms to noun phrases reasonably.
366
+
367
+ ![](images/db1b0ccd5378fbb9f9e95ce4cdc5366f77e9740c16143acd41489a68060d9ff4.jpg)
368
+ Figure 10: Examples of induced dependency parses Tree by RelConsTransLG (Top arrows) and ground truth dependency parses (bottom arrows) from StanfordNLP https://corenlp.run/. Arrows in grey are for opinion terms accurately linked to the aspect term “place”.
369
+
370
+ ![](images/861a1d5ef8075da5b3ed4ce5f0670fdcb6492a01191918fda410beb344598307.jpg)
371
+ Figure 11: Examples of induced dependency parses Tree by RelConsTransLG (Top arrows) and ground truth dependency parses (bottom arrows) from StanfordNLP https://corenlp.run/. Arrows in grey are for opinion terms accurately linked to the aspect term “owner”.
372
+
373
+ ![](images/c4df5d9fcec537e1b26f6645ea0d5f6fc2dfbf8b30828d26cbcfb3fa4cc570ba.jpg)
374
+ Figure 12: Examples of induced dependency parses Tree by RelConsTransLG (Top arrows) and ground truth dependency parses (bottom arrows) from StanfordNLP https://corenlp.run/. Arrows in grey are for opinion terms accurately linked to the aspect term “calamari”.
md/train/6rEnMF1okeiBO/6rEnMF1okeiBO.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Low-Rank Approximations for Conditional Feedforward Computation in Deep Neural Networks
2
+
3
+ Andrew S. Davis Department of Electrical Engineering and Computer Science University of Tennessee andrew.davis@utk.edu
4
+
5
+ Itamar Arel Department of Electrical Engineering and Computer Science University of Tennessee itamar@ieee.org
6
+
7
+ # Abstract
8
+
9
+ Scalability properties of deep neural networks raise key research questions, particularly as the problems considered become larger and more challenging. This paper expands on the idea of conditional computation introduced in [2], where the nodes of a deep network are augmented by a set of gating units that determine when a node should be calculated. By factorizing the weight matrix into a low-rank approximation, an estimation of the sign of the pre-nonlinearity activation can be efficiently obtained. For networks using rectified-linear hidden units, this implies that the computation of a hidden unit with an estimated negative pre-nonlinearity can be omitted altogether, as its value will become zero when nonlinearity is applied. For sparse neural networks, this can result in considerable speed gains. Experimental results using the MNIST and SVHN data sets with a fully-connected deep neural network demonstrate the performance robustness of the proposed scheme with respect to the error introduced by the conditional computation process.
10
+
11
+ # 1 Introduction
12
+
13
+ In recent years, deep neural networks have redefined state-of-the-art in many application domains, notably in computer vision [11] and speech processing [14]. In order to scale to more challenging problems, however, neural networks must become larger, which implies an increase in computational resources. Shifting computation to highly parallel platforms such as GPUs has enabled the training of massive neural networks that would otherwise train too slowly on conventional CPUs. While the extremely high computational power used for the experiment performed in [12] (16,000 cores training for many days) was greatly reduced in [4] (3 servers training for many days), specialized high-performance platforms still require several machines and several days of processing time. However, there may exist more fundamental changes to the algorithms involved which can greatly assist in scaling neural networks.
14
+
15
+ Many of these state-of-the-art networks have several common properties: the use of rectified-linear activation functions in the hidden neurons, and a high level of sparsity induced by dropout regularization or a sparsity-inducing penalty term on the loss function. Given that many of the activations are effectively zero, due to the combination of sparsity and the hard thresholding of rectified linear units, a large amount of computation is wasted on calculating values that are eventually truncated to zero and provide no contribution to the network outputs or error components. Here we focus on this key observation in devising a scheme that can predict the zero-valued activations in a computationally cost-efficient manner.
16
+
17
+ ![](images/330c633a35bf86691190ce2c9e23656faa49e05ba728a5e0d3579d3dd77aadaa.jpg)
18
+ Figure 1: An illustration of an activation estimator. $U$ and $V$ represent the factorization of the lowrank matrix and $W$ denotes the full-rank matrix. In this case, the activation estimator recommends that only the $2 ^ { n d }$ and the $n ^ { t h }$ neuron be computed for layer $l + 1$ .
19
+
20
+ # 2 Conditional Computation in Deep Neural Networks
21
+
22
+ # 2.1 Exploiting Redundancy in Deep Architectures
23
+
24
+ In [5], the authors made the observation that deep models tend to have a high degree of redundancy in their weight parameterization. The authors exploit this redundancy in order to train as few as $5 \%$ of the weights in a neural network while estimating the other $9 5 \%$ with the use of carefully constructed low-rank decompositions of the weight matrices. Such a reduction in the number of active training parameters can render optimization easier by reducing the number of variables to optimize over. Moreover, it can help address the problem of scalability by greatly reducing the communication overhead in a distributed system.
25
+
26
+ Assuming there is a considerable amount of redundancy in the weight parameterization, a similar level of redundancy is likely found in the activation patterns of individual neurons. Therefore, given an input sample, the set of redundant activations in the network may be approximated. If a sufficiently accurate approximation can be obtained using low computational resources, activations for a subset of neurons in the network’s hidden layers need not be calculated.
27
+
28
+ In [2] and [3], the authors propose the idea of conditional computation in neural networks, where the network is augmented by a gating model that turns activations on or off depending on the state of the network. If this gating model is able to reliably estimate which neurons need to be calculated for a particular input, great improvements in computational efficiency may be obtainable if the network is sufficiently sparse. Figure 1 illustrates a conditional computation unit augmenting a layer of a neural net by using some function $f \left( U , V , a _ { l } \right)$ to determine which hidden unit activations $a _ { l + 1 }$ should be computed given the activations $a _ { l }$ of layer $l$ .
29
+
30
+ # 2.2 Sparse Representations, Activation Functions, and Prediction
31
+
32
+ In some situations, sparse representations may be superior to dense representations, particularly in the context of deep architectures [7]. However, sparse representations learned by neural networks with sigmoidal activations are not truly “sparse”, as activations only approach zero in the limit towards negative infinity. A conditional computation model estimating the sparsity of a sigmoidal network would thus have to impose some threshold, beyond which the neuron is considered inactive. So-called “hard-threshold” activation functions such as rectified-linear units, on the other hand, produce true zeros which can be used by conditional computation models without imposing additional hyperparameters.
33
+
34
+ ![](images/bb9a58a228619740cc5b690dffa4597c00b0675e72d7f0d8c1f1ae3f6187ad37.jpg)
35
+ Figure 2: The low-rank approximation $U V$ can be substituted in for $W$ , and can approximate the matrix $W$ with a relatively low rank. However, if we use the output of the activation estimator $S$ , as defined in Eq. (5), with the full-rank feedforward, $\sigma \left( a W \right) \cdot S$ , a lower-rank approximation can be utilized. The activations and weights are from the first layer of a neural network trained on MNIST, and the factorization $U V$ is obtained via SVD.
36
+
37
+ # 3 Problem Formulation
38
+
39
+ # 3.1 Estimating Activation Sign via Low-Rank Approximation
40
+
41
+ Given the activation $a _ { l }$ of layer $l$ of a neural network, the activation $a _ { l + 1 }$ of layer $l + 1$ is given by:
42
+
43
+ $$
44
+ a _ { l + 1 } = \sigma ( a _ { l } W _ { l } )
45
+ $$
46
+
47
+ where $\sigma ( \cdot )$ denotes the function defining the neuron’s non-linearity, $a _ { l } \in \mathbb { R } ^ { n \times h _ { 1 } }$ , $a _ { l + 1 } \in \mathbb { R } ^ { n \times h _ { 2 } }$ , $W _ { l } \in \mathbb { R } ^ { \dot { h _ { 1 } } \times h _ { 2 } }$ . If the weight matrix is highly redundant, as in [5], it can be well-approximated using a low-rank representation and we may rewrite (1) as
48
+
49
+ $$
50
+ a _ { l + 1 } = \sigma ( a _ { l } U _ { l } V _ { l } )
51
+ $$
52
+
53
+ where $U _ { l } V _ { l }$ is the low-rank approximation of $W _ { l }$ , $U _ { l } \in \mathbb { R } ^ { h _ { 1 } \times k }$ , $V _ { l } \in \mathbb { R } ^ { k \times h _ { 2 } }$ , $k \ll \operatorname* { m i n } ( h _ { 1 } , h _ { 2 } )$ . So long as $\begin{array} { r } { k < \frac { h _ { 1 } h _ { 2 } } { h _ { 1 } + h _ { 2 } } } \end{array}$ , the low-rank multiplication $a _ { l } U _ { l } V _ { l }$ requires fewer arithmetic operations than the full-rank multiplication $a _ { l } W _ { l }$ , assuming the multiplication $a _ { l } U _ { l }$ occurs first. When $\sigma ( \cdot )$ is the rectified-linear function,
54
+
55
+ $$
56
+ \sigma ( x ) = \operatorname* { m a x } ( 0 , x )
57
+ $$
58
+
59
+ such that all negative elements of the linear transform $a _ { l } W _ { l }$ become zero, one only needs to estimate the sign of the elements of the linear transform in order to predict the zero-valued elements. Assuming the weights in a deep neural network can be well-approximated using a low-rank estimation, the small error in the low-rank estimation is of marginal relevance in the context of recovering the sign of the operation.
60
+
61
+ Given a low-rank approximation $W _ { l } \approx U _ { l } V _ { l } = { \hat { W } } _ { l }$ , the estimated sign of $a _ { l + 1 }$ is given by
62
+
63
+ $$
64
+ s g n ( a _ { l + 1 } ) \approx s g n ( a _ { l } \hat { W } _ { l } )
65
+ $$
66
+
67
+ Each element $( a _ { l + 1 } ) _ { i , j }$ is given by a dot product between the row vector $a _ { l } ^ { ( i ) }$ and the column vector $W _ { l } ^ { ( j ) }$ . If $s g n ( a _ { l } \hat { W } _ { l } ^ { ( j ) } ) = - 1$ , then the true activation $( a _ { l + 1 } ) _ { i , j }$ is likely negative, and will likely become zero after the rectified-linear function is applied. Considerable speed gains are possible if we skip those dot products based on the prediction; such gains are especially substantial when the network is very sparse. The overall activation for a hidden layer $l$ augmented by the activation estimator is given by $\sigma \left( a _ { l } W _ { l } \right) \cdot S _ { l }$ , where $\cdot$ denotes the element-wise product and $S _ { l }$ denotes a matrix of zeros and ones, where
68
+
69
+ $$
70
+ \left( S _ { l } \right) _ { i , j = } \left\{ 0 , \quad s g n \left( \left( a _ { l } U _ { l } V _ { l } \right) _ { i , j } \right) = - 1 \right. \nonumber
71
+ $$
72
+
73
+ Figure 2 illustrates the error profile of a neural network using the low-rank estimation $U V$ in place of $W$ compared with a neural network augmented with an activation sign estimator as the rank is varied from one to full-rank. One can see that the error of the activation sign estimator diminishes far more quickly than the error of the low-rank activation, implying that the sign estimator can do well with a relatively low-rank approximation of $W$ .
74
+
75
+ # 3.2 SVD as a Low-Rank Approximation
76
+
77
+ The Singular Value Decomposition (SVD) is a common matrix decomposition technique that factorizes a matrix $A \in \mathbb { R } ^ { m \times n }$ into $A = U \Sigma V ^ { T }$ , $U \in \mathbb { R } ^ { m \times m } , \Sigma \in \mathbb { R } ^ { m \times n } , V \in \mathbb { R } ^ { n \times n }$ . By [6], the matrix $A$ can be approximated using a low rank matrix $\hat { A } _ { r }$ corresponding to the solution of the constrained optimization of
78
+
79
+ $$
80
+ \operatorname* { m i n } _ { \hat { A } _ { r } } \| A - \hat { A } _ { r } \| _ { F }
81
+ $$
82
+
83
+ where $\| \cdot \| _ { F }$ is the Frobenius norm, and $\hat { A } _ { r }$ is constrained to be of rank $r \ < \ r a n k ( A )$ . The minimizer $\hat { A } _ { r }$ is given by taking the first $r$ columns of $U$ , the first $r$ diagonal entries of $\Sigma$ , and the first $r$ columns of $V$ . The resulting matrices $U _ { r }$ , $\Sigma _ { r }$ , and $V _ { r }$ are multiplied, yielding $\hat { A } _ { r } = U _ { r } \Sigma _ { r } V _ { r } ^ { T }$ . The low-rank approximation $\hat { W } = U V$ is then defined such that $\hat { W } = U _ { r } ( \Sigma _ { r } V _ { r } ^ { T } )$ , where $U = U _ { r }$ and $\begin{array} { r } { V = \Sigma _ { r } V _ { r } ^ { \bar { T } } } \end{array}$ .
84
+
85
+ Unfortunately, calculating the SVD is an expensive operation, on the order of $O ( m n ^ { 2 } )$ , so recalculating the SVD upon the completion of every minibatch adds significant overhead to the training procedure. Given that we are uniquely interested in estimating in the sign of $a _ { l + 1 } = a _ { l } W _ { l }$ , we can opt to calculate the SVD less frequently than once per minibatch, assuming that the weights $W _ { l }$ do not change significantly over the course of a single epoch so as to corrupt the sign estimation.
86
+
87
+ # 3.3 Encouraging Neural Network Sparsity
88
+
89
+ To overcome the additional overhead imposed by the conditional computation architecture, the neural network must have sparse activations. Without encouragement to settle on weights that result in sparse activations, such as penalties on the loss function, a neural network will not necessarily become sparse enough to be useful in the context of conditional computation. Therefore, an $\ell _ { 1 }$ penalty for the activation vector of each layer is applied to the overall loss function, such that
90
+
91
+ $$
92
+ J ( W , \lambda ) = L ( W ) + \lambda \sum _ { l = 1 } ^ { L } \| a _ { l } \| _ { 1 }
93
+ $$
94
+
95
+ Such a penalty is commonly used in sparse dictionary learning algorithms and tends to push elements of $a _ { l }$ towards zero [13].
96
+
97
+ Dropout regularization [9] is another technique known to sparsify the hidden activations in a neural network. Dropout first sets the hidden activations $a _ { l }$ to zero with probability $p$ . During training, the number of active neurons is likely less than $p$ for each minibatch. When the regularized network is running in the inference mode, dropout has been observed to have a sparsifying effect on the hidden activations [17]. The adaptive dropout method [1] can further decrease the number of active neurons without degrading the performance of the network.
98
+
99
+ # 3.4 Theoretical Speed Gain
100
+
101
+ For every input example, a standard neural network computes $\sigma \left( a W \right)$ , where $a ~ \in ~ \mathbb { R } ^ { N \times d }$ and $W \in \mathbb { R } ^ { \mathsf { \bar { d } } \times h }$ , where $N = 1$ for a fully-connected network, or $N$ is the number of convolutions for a convolutional network. Assuming additions and multiplications are constant-time operations, the matrix multiplication requires $N \left( 2 d - 1 \right) h$ floating point operations (we need to compute $N h$ dot products, where each dot product consists of $d$ multiplications and $d - 1$ additions), and the activation function requires $N h$ floating point operations, yielding $N \left( 2 d - 1 \right) h + N h$ operations. The activation estimator $\sigma \left( a U V \right)$ , $U \in \mathbb { R } ^ { d \times k }$ , $V \in \mathbb { R } ^ { k \times \tilde { h } }$ requires $N \left( 2 d - 1 \right) k + N \left( 2 k - 1 \right) h$ floating point operations for the low-rank multiplication followed by $N h$ operations for the sgn (·) activation function, yielding $N \left( 2 d - 1 \right) k + \bar { N ( 2 k - 1 ) } h + N h$ . However, given a sparsity coefficient $\alpha \in [ 0 , 1 ]$ (where $\alpha = 0$ implies no activations are active, and $\alpha = 1$ implies all activations are active), a conditional matrix multiplication would require $\alpha N \left( 2 d - 1 \right) h + \alpha N h$ operations. The SVD calculation to obtain the activation estimation weights is $\beta O \left( n d \operatorname* { m i n } \left( n , d \right) \right)$ , where $\beta$ is the ratio of feed-forwards to SVD updates (eg., with a minibatch size of 250, a training set size of 50,000, and once-per-epoch SVD updates, $\begin{array} { r } { \dot { \beta } = \frac { 2 5 0 } { 5 0 0 0 0 } = 0 . 0 0 5 ) } \end{array}$ .
102
+
103
+ Altogether, the number of floating point operations for calculating the feed-forward in a layer in a standard neural network is
104
+
105
+ $$
106
+ F _ { n n } = N \left( 2 d - 1 \right) h + N h
107
+ $$
108
+
109
+ and the number of floating point operations for the activation estimation network with conditional computation is
110
+
111
+ $$
112
+ F _ { a e } = N \left( 2 d - 1 \right) k + N \left( 2 k - 1 \right) h + N h + \alpha h \left( N \left( 2 d - 1 \right) h + N h \right) + \beta O \left( n d \operatorname* { m i n } \left( n , d \right) \right) .
113
+ $$
114
+
115
+ The relative reduction of floating point operations for a layer can be represented as $\scriptstyle { \frac { F _ { n n } } { F _ { a e } } }$ , and is simplified as
116
+
117
+ $$
118
+ \frac { 2 d h } { k \left( 2 d + 2 h - 1 \right) + 2 \alpha d h + \beta O \left( n d \operatorname* { m i n } \left( n , d \right) \right) }
119
+ $$
120
+
121
+ For a neural network with many layers, the relative speedup is given by
122
+
123
+ $$
124
+ \begin{array} { l } { { \displaystyle \sum _ { i = 1 } ^ { L } F _ { n n } ^ { ( l ) } } } \\ { { \displaystyle \sum _ { i = 1 } ^ { L } F _ { a e } ^ { ( l ) } } } \end{array}
125
+ $$
126
+
127
+ where $F _ { n n } ^ { ( l ) }$ is the number of floating point operations for theth ${ { l } ^ { t h } }$ layer of the full network, and $F _ { a e } ^ { ( l ) }$ is the number of floating point operations for the layer of the network augmented by the activation estimation network. The overall speedup is greatly dependent on the sparsity of the network and the overhead of the activation estimator.
128
+
129
+ # 3.5 Implementation Details
130
+
131
+ The neural network is built using Rasmus Berg Palm’s Deep Learning Toolbox [16]. All hidden units are rectified-linear, and the output units are softmax trained with a negative log-likelihood loss function. The weights, $w$ , are initialized as $w \sim \mathcal { N } \left( 0 , \sigma ^ { 2 } \right)$ and biases $b$ are set to 1 in order to encourage the neurons to operate in their non-saturated region once training begins, as suggested in [11]. In all experiments, the dropout probability $p$ is fixed to 0.5 for the hidden layers.
132
+
133
+ The learning rate $\gamma$ is scheduled such that $\gamma _ { n } ~ = ~ \gamma _ { 0 } \lambda ^ { n }$ where $\gamma _ { n }$ is the learning rate for the $n ^ { t h }$ epoch, $\gamma _ { 0 }$ is the initial learning rate, and $\lambda$ is a decay term slightly less than 1, eg., 0.995. The momentum term $\nu$ is scheduled such that $\nu _ { n } = \operatorname* { m a x } \left( \nu _ { m a x } , \nu _ { 0 } \beta ^ { n } \right)$ where $\nu _ { n }$ is the momentum for the $n ^ { t h }$ epoch, $\nu _ { m a x }$ is the maximum allowed momentum, $\nu _ { 0 }$ is the initial momentum, and $\beta$ is an incremental term slightly greater than 1, eg., 1.05.
134
+
135
+ To simplify prototyping, the feed-forward is calculated for a layer, and the activation estimator is immediately applied before the next layer activations are used. This is equivalent to bypassing the calculations for activations that are likely to produce zeros. In practice, re-calculating the SVD once per epoch for the activation estimator seems to be a decent tradeoff between activation estimation accuracy and computational efficiency, but this may not necessarily be true for other datasets.
136
+
137
+ Table 1: Hyperparameters for SVHN and MNIST experiments.
138
+
139
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SVHN</td><td rowspan=1 colspan=1>MNIST</td></tr><tr><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1>1024-1500-700-400-200-10</td><td rowspan=1 colspan=1>784-1000-600-400-10</td></tr><tr><td rowspan=1 colspan=1>Weight Init</td><td rowspan=1 colspan=1>w ~N (0,0.01);b= 1</td><td rowspan=1 colspan=1>w ~N (0,0.05);b=1</td></tr><tr><td rowspan=1 colspan=1>InitLearningRate</td><td rowspan=1 colspan=1>0.15</td><td rowspan=1 colspan=1>0.25</td></tr><tr><td rowspan=1 colspan=1>LearningRateScaling</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.99</td></tr><tr><td rowspan=1 colspan=1>MaximumMomentum</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.8</td></tr><tr><td rowspan=1 colspan=1>MomentumIncrement</td><td rowspan=1 colspan=1>1.01</td><td rowspan=1 colspan=1>1.05</td></tr><tr><td rowspan=1 colspan=1>MaximumNorm</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>25</td></tr><tr><td rowspan=1 colspan=1>l1 Activation Penalty</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1×10-5</td></tr><tr><td rowspan=1 colspan=1>l2Weight Penalty</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>5×10-5</td></tr></table>
140
+
141
+ ![](images/0a8e79cdd733ed2d87a5767f2b4e2eadb0058f84435899642e7ff1ff63d5c876.jpg)
142
+ Figure 3: Classification error of the validation set for SVHN on seven configurations of the activation estimator for each hidden layer. The ’control’ network has no activation estimator and is used as a baseline of comparison for the other networks.
143
+
144
+ # 4 Experimental Results
145
+
146
+ # 4.1 SVHN
147
+
148
+ Street View House Numbers (SVHN) [15] is a large image dataset containing over 600,000 labeled examples of digits taken from street signs. Each example is an RGB $3 2 \times 3 2$ (3072-dimensional) image. To pre-process the dataset, each image is transformed into the YUV colorspace. Next, local contrast normalization [10] followed by a histogram equalization is applied to the Y channel. The U and V channels are discarded, resulting in a 1024-dimensional vector per example. The dataset is then normalized for the neural network by subtracting out the mean and dividing by the square root of the variance for each variable. To select the hyperparameters, the training data was split into 590,000 samples for the training set and 14,388 samples for the validation set. The architecture was held fixed while the other hyperparameters were chosen randomly over 30 runs using a network with no activation estimation. The hyperparameters of the neural network with the lowest resulting validation error were then used for all experiments.
149
+
150
+ To evaluate the sensitivity of the activation estimator, several parameterizations for the activation estimator are evaluated. Each network is trained with the hyperparameters in Table 1, and the results of seven parameterizations are shown in Figure 3. Each parameterization is described by the rank of each approximation, eg., ‘75-50-40-30’ describes a network with an activation estimator using a 75-rank approximation for $W _ { 1 }$ , a 50-rank approximation for $W _ { 2 }$ , a 40-rank approximation for $W _ { 3 }$ , and a 30-rank approximation for $W _ { 4 }$ . Note that a low-rank approximation is not necessary for $W _ { 5 }$ (the weights connecting the last hidden layer to the output layer), as we do not want to approximate the activations for the output layer.
151
+
152
+ Some runs, specifically 25-25-25-25 and 50-35-25-25 in Figure 3 exhibit an initial decrease in classification error, followed by a gradual increase in classification error as training progresses. In the initial epochs, the hidden layer activations are mostly positive because the weights are relatively small and the biases are very large. As a consequence, the activation estimation is a much simpler task for the initial epochs. However, as the pattern of the activation signs diversifies as the network continues to train, the lower-rank approximations begin to fail, as illustrated in Figure 4.
153
+
154
+ ![](images/f6b504d82bee33be549ba3ff3e2a25bf4b7bed420563eb806114dcca81b981b2.jpg)
155
+ Figure 4: A comparison of a low-rank activation estimator and a higher-rank activation estimator. In this instance, a 25-25-25-25 activation estimator is too coarse to adequately capture the structure of the weight matrices.
156
+
157
+ Table 2: SVHN test set error for seven networks.
158
+
159
+ <table><tr><td rowspan=1 colspan=1>Network</td><td rowspan=1 colspan=1>Error</td></tr><tr><td rowspan=1 colspan=1>Control</td><td rowspan=1 colspan=1>9.31%</td></tr><tr><td rowspan=1 colspan=1>200-100-75-15</td><td rowspan=1 colspan=1>9.67%</td></tr><tr><td rowspan=1 colspan=1>100-75-50-25</td><td rowspan=1 colspan=1>9.96%</td></tr><tr><td rowspan=1 colspan=1>100-75-50-15</td><td rowspan=1 colspan=1>10.01%</td></tr><tr><td rowspan=1 colspan=1>75-50-40-30</td><td rowspan=1 colspan=1>10.72%</td></tr><tr><td rowspan=1 colspan=1>50-40-40-35</td><td rowspan=1 colspan=1>12.16%</td></tr><tr><td rowspan=1 colspan=1>25-25-15-15</td><td rowspan=1 colspan=1>19.40%</td></tr></table>
160
+
161
+ Table 2 summarizes the test set error for the control and activation estimation networks. $W _ { 1 }$ appears to be most sensitive, quickly reducing the test set error from $1 0 . 7 2 \%$ to $1 2 . 1 6 \%$ when the rank of $\hat { W } _ { 1 }$ is lowered from 75 to 50. The rank of $\hat { W } _ { 4 }$ appears to be the least sensitive, reducing the test set error from $9 . 9 6 \%$ to $1 0 . 0 1 \%$ as the rank is lowered from 25 to 15.
162
+
163
+ # 4.2 MNIST
164
+
165
+ MNIST is a well-known dataset of hand-written digits containing $7 0 , 0 0 0 \ 2 8 \times 2 8$ labeled images, and is generally split into 60,000 training and 10,000 testing examples. Very little pre-processing is required to achieve good results - each feature is transformed by $\begin{array} { r } { x _ { t } = \frac { x } { \sqrt { \sigma _ { m a x } ^ { 2 } } } - 0 . 5 } \end{array}$ , where $x$ is the input feature, $\sigma _ { m a x } ^ { 2 }$ is the maximum variance of all features, and 0.5 is a constant term to roughly center each feature. To select the hyperparameters, the training data was split into 50,000 samples for the training set and 10,000 samples for the validation set. The architecture was held fixed while the other hyperparameters were chosen randomly over 30 runs using a network with no activation estimation. The hyperparameters of the neural network with the lowest resulting validation error were then used for all experiments. Several parameterizations for the activation estimator are evaluated for a neural network trained with the hyperparameters listed in Table 1 using the same approach as the SVHN experiment above. The results for the validation set plotted against the epoch number are shown in Figure 5, and the final test set accuracy is reported in Table 3.
166
+
167
+ A neural network with a very low-rank weight matrix in the activation estimation can train surprisingly well on MNIST. Lowering the rank from 784-600-400 to 50-35-25 impacts performance negligibly. Ranks as low as 25-25-25 does not lessen performance too greatly, and ranks as low as 10-10-5 yield a classifier capable of $2 . 2 8 \%$ error.
168
+
169
+ ![](images/11558a5ea2d37ebe91065c45e763c77ec3d8d21d94ebc2b0c090822029259d0a.jpg)
170
+ Figure 5: Classification error of the validation set for MNIST on five configurations of the activation estimator for each hidden layer.
171
+
172
+ Table 3: MNIST test set error for five networks.
173
+
174
+ <table><tr><td rowspan=1 colspan=1>Network</td><td rowspan=1 colspan=1>Error</td></tr><tr><td rowspan=1 colspan=1>Control</td><td rowspan=1 colspan=1>1.40%</td></tr><tr><td rowspan=1 colspan=1>50-35-25</td><td rowspan=1 colspan=1>1.43%</td></tr><tr><td rowspan=1 colspan=1>25-25-25</td><td rowspan=1 colspan=1>1.60%</td></tr><tr><td rowspan=1 colspan=1>15-10-5</td><td rowspan=1 colspan=1>1.85%</td></tr><tr><td rowspan=1 colspan=1>10-10-5</td><td rowspan=1 colspan=1>2.28%</td></tr></table>
175
+
176
+ # 5 Discussion and Further Work
177
+
178
+ Low-rank estimations of weight matrices of a neural network obtained via once-per-epoch SVD work very well as efficient estimators of the sign of the activation for the next hidden layer. In the context of rectified-linear hidden units, computation time can be reduced greatly if this estimation is reliable and the hidden activations are sufficiently sparse. This approach is applicable to any hardthresholding activation function, such as the functions investigated in [8], and can be easily extended to be used with convolutional neural networks.
179
+
180
+ While the activation estimation error does not tend to deviate too greatly inbetween minibatches over an epoch, as illustrated in Figure 6, this is not guaranteed. An online approach to the low-rank approximation would therefore be preferable to a once-per-epoch calculation. In addition, while the low-rank approximation given by SVD minimizes the objective function $\| A - { \hat { A } } _ { r } \| _ { F }$ , this is not necessarily the best objective function for an activation estimator, where we seek to minimize $\left\| \sigma \left( a W \right) - \sigma \left( a W \cdot S \right) \right\|$ , which is a much more difficult and non-convex objective function. Also, setting the hyperparameters for the activation estimator can be a tedious process involving expensive cross-validation when an adaptive algorithm could instead choose the rank based on the spectrum of the singular values. Therefore, developing a more suitable low-rank approximation algorithm could provide a promising future direction of research.
181
+
182
+ ![](images/6823918133299ef531225ca3d5ccbbe5d6a2cad03005d49d4dc4f9f3ac1334f3.jpg)
183
+ Figure 6: Because the SVD is calculated at the beginning of each epoch, each subsequent gradient update in each minibatch moves the weight matrix further from low-rank factorization, resulting in an increasing error until the SVD is recalculated at the beginning of the next epoch. Different layers are negatively impacted in differing degrees.
184
+
185
+ In [1], the authors propose a method called “adaptive dropout” by which the dropout probabilities are chosen by a function optimized by gradient descent instead of fixed to some value. This approach bears some resemblance to this paper, but with the key difference that the approach in [1] is motivated by improved regularization and this paper’s method is motivated by computational efficiency. However, the authors introduce a biasing term that allows for greater sparsity that could be introduced into this paper’s methodology. By modifying the conditional computation unit to compute $s g n \left( a U V - b \right)$ , where $b$ is some bias, we can introduce a parameter that can tune the sparsity of the network, allowing for a more powerful trade-off between accuracy and computational efficiency.
186
+
187
+ # Acknowledgments
188
+
189
+ This work was partially supported by the Defense Advanced Research Projects Agency (DARPA) under contract number HR0011-13-2-0016.
190
+
191
+ # References
192
+
193
+ [1] Jimmy Ba and Brendan Frey. Adaptive dropout for training deep neural networks. In Advances in Neural Information Processing Systems, pages 3084–3092, 2013. 3.3, 5
194
+ [2] Yoshua Bengio. Deep learning of representations: Looking forward. In Adrian-Horia Dediu, Carlos Martin-Vide, Ruslan Mitkov, and Bianca Truthe, editors, Statistical Language and Speech Processing, volume 7978 of Lecture Notes in Computer Science, pages 1–37. Springer Berlin Heidelberg, 2013. (document), 2.1
195
+ [3] Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. CoRR, abs/1308.3432, 2013. 2.1
196
+ [4] Adam Coates, Brody Huval, Tao Wang, David Wu, Bryan Catanzaro, and $\mathrm { N g }$ Andrew. Deep learning with cots hpc systems. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 1337–1345, 2013. 1
197
+ [5] Misha Denil, Babak Shakibi, Laurent Dinh, Marc’Aurelio Ranzato, and Nando de Freitas. Predicting parameters in deep learning. arXiv preprint arXiv:1306.0543, 2013. 2.1, 3.1
198
+ [6] Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211–218, 1936. 3.2
199
+ [7] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier networks. In Proceedings of the 14th International Conference on Artificial Intelligence and Statistics. JMLR W&CP Volume, volume 15, pages 315–323, 2011. 2.2
200
+ [8] Rostislav Goroshin and Yann LeCun. Saturating auto-encoder. arXiv preprint arXiv:1301.3577, 2013. 5
201
+ [9] Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. 3.3
202
+ [10] Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition? In Computer Vision, 2009 IEEE 12th International Conference on, pages 2146–2153. IEEE, 2009. 4.1
203
+ [11] Alex Krizhevsky, Ilya Sutskever, and Geoff Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25, pages 1106–1114, 2012. 1, 3.5
204
+ [12] Quoc Le, Marc’Aurelio Ranzato, Rajat Monga, Matthieu Devin, Kai Chen, Greg Corrado, Jeff Dean, and Andrew Ng. Building high-level features using large scale unsupervised learning. In International Conference in Machine Learning, 2012. 1
205
+ [13] Honglak Lee, Alexis Battle, Rajat Raina, and Andrew Ng. Efficient sparse coding algorithms. In Advances in neural information processing systems, pages 801–808, 2006. 3.3
206
+ [14] A Mohamed, Tara N Sainath, George Dahl, Bhuvana Ramabhadran, Geoffrey E Hinton, and Michael A Picheny. Deep belief networks using discriminative features for phone recognition. In Acoustics, Speech and Signal Processing (ICASSP), 2011 IEEE International Conference on, pages 5060–5063. IEEE, 2011. 1
207
+ [15] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 4.1
208
+ [16] R. B. Palm. Prediction as a candidate for learning deep hierarchical models of data, 2012. 3.5
209
+ [17] Nitish Srivastava. Improving neural networks with dropout. PhD thesis, University of Toronto, 2013. 3.3
md/train/7R7fAoUygoa/7R7fAoUygoa.md ADDED
@@ -0,0 +1,698 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OPTIMAL REGULARIZATION CAN MITIGATE DOUBLE DESCENT
2
+
3
+ Preetum Nakkiran
4
+ Harvard University
5
+ preetum@cs.harvard.edu
6
+ Prayaag Venkat
7
+ Harvard University
8
+ pvenkat@g.harvard.edu
9
+
10
+ # Sham Kakade
11
+
12
+ Microsoft Research & University of Washington sham@cs.washington.edu
13
+
14
+ Tengyu Ma
15
+ Stanford University
16
+ tengyuma@stanford.edu
17
+
18
+ # ABSTRACT
19
+
20
+ Recent empirical and theoretical studies have shown that many learning algorithms – from linear regression to neural networks – can have test performance that is non-monotonic in quantities such the sample size and model size. This striking phenomenon, often referred to as “double descent”, has raised questions of if we need to re-think our current understanding of generalization. In this work, we study whether the double-descent phenomenon can be avoided by using optimal regularization. Theoretically, we prove that for certain linear regression models with isotropic data distribution, optimally-tuned $\ell _ { 2 }$ regularization achieves monotonic test performance as we grow either the sample size or the model size. We also demonstrate empirically that optimally-tuned $\ell _ { 2 }$ regularization can mitigate double descent for more general models, including neural networks. Our results suggest that it may also be informative to study the test risk scalings of various algorithms in the context of appropriately tuned regularization.
21
+
22
+ # 1 INTRODUCTION
23
+
24
+ Recent works have demonstrated a ubiquitous “double descent” phenomenon present in a range of machine learning models, including decision trees, random features, linear regression, and deep neural networks (Opper, 1995; 2001; Advani & Saxe, 2017; Spigler et al., 2018; Belkin et al., 2018; Geiger et al., 2019b; Nakkiran et al., 2020; Belkin et al., 2019; Hastie et al., 2019; Bartlett et al., 2019; Muthukumar et al., 2019; Bibas et al., 2019; Mitra, 2019; Mei & Montanari, 2019; Liang & Rakhlin, 2018; Liang et al., 2019; Xu & Hsu, 2019; Derezinski et al., 2019; Lampinen & Ganguli, ´ 2018; Deng et al., 2019; Nakkiran, 2019). The phenomenon is that models exhibit a peak of high test risk when they are just barely able to fit the train set, that is, to interpolate. For example, as we increase the size of models, test risk first decreases, then increases to a peak around when effective model size is close to the training data size, and then decreases again in the overparameterized regime. Also surprising is that Nakkiran et al. (2020) observe a double descent as we increase sample size, i.e. for a fixed model, training the model with more data can hurt test performance.
25
+
26
+ These striking observations highlight a potential gap in our understanding of generalization and an opportunity for improved methods. Ideally, we seek to use learning algorithms which robustly improve performance as the data or model size grow and do not exhibit such unexpected nonmonotonic behaviors. In other words, we aim to improve the test performance in situations which would otherwise exhibit high test risk due to double descent. Here, a natural strategy would be to use a regularizer and tune its strength on a validation set. This motivates the central question of this work:
27
+
28
+ When does optimally tuned regularization mitigate or remove the double-descent phenomenon?
29
+
30
+ Another motivation is the fact that double descent is largely observed for unregularized or under regularized models in practice. As an example, Figure 1 shows a simple linear ridge regression setting in which the unregularized estimator exhibits double descent, but an optimally-tuned regularizer has monotonic test performance.
31
+
32
+ ![](images/b5edb5b47ed8f04264d90917cb098c4913b1a417a4d6db231609364ffb35c0c9.jpg)
33
+ Figure 1: Test Risk vs. Num. Samples for Isotropic Ridge Regression in $d \_ =$ 500 dimensions. Unregularized regression is non-monotonic in samples, but optimallyregularized regression $( \lambda = \lambda _ { o p t } )$ is monotonic. In this setting, the optimal regularizer $\lambda _ { o p t }$ does not depend on number of samples $n$ (Lemma 2), but this is not always true – see Figure 2.
34
+
35
+ Our Contributions: We study this question from both a theoretical and empirical perspective. Theoretically, we start with the setting of high-dimensional linear regression. Linear regression is a sensible starting point to study these questions, since it already exhibits many of the qualitative features of double descent in more complex models (e.g. Belkin et al. (2019); Hastie et al. (2019) and further related works in Section 1.1). Our work shows that optimally-tuned ridge regression can achieve both sample-wise monotonicity and model-size-wise monotonicity under certain assumptions. Concretely, we show
36
+
37
+ 1. Sample-wise monotonicity: In the setting of well-specified linear regression with isotropic features/covariates (Figure 1), we prove that optimally-tuned ridge regression yields monotonic test performance with increasing samples. That is, more data never hurts for optimally-tuned ridge regression. (See Theorem 1).
38
+
39
+ 2. Model-wise monotonicity: We consider a setting where the input/covariate lives in a highdimensional ambient space with isotropic covariance. Given a fixed model size $d$ (which might be much smaller than ambient dimension), we consider the family of models which first project the input to a random $d$ -dimensional subspace, and then compute a linear function in this projected “feature space.” (This is nearly identical to models of double-descent considered in Hastie et al. (2019, Section 5.1)). We prove that in this setting, as we grow the model-size, optimally-tuned ridge regression over the projected features has monotone test performance. That is, with optimal regularization, bigger models are always better or the same. (See Theorem 3).
40
+
41
+ 3. Monotonicity in the real-world: We also demonstrate several richer empirical settings where optimal $\ell _ { 2 }$ regularization induces monotonicity, including random feature classifiers and convolutional neural networks. This suggests that the mitigating effect of optimal regularization may hold more generally in broad machine learning contexts. (See Section 5).
42
+
43
+ A few remarks are in order:
44
+
45
+ Problem-specific vs Minimax and Bayesian. It is worth noting that our results hold for all linear ground-truths, rather than holding for only the worst-case ground-truth or a random ground-truth. Indeed, the minimax optimal estimator or the Bayes optimal estimator are both trivially sample-wise and model-wise monotonic with respect to the minimax risk or the Bayes risk. However, they do not guarantee monotonicity of the risk itself for a given fixed problem. In particular, there exist minimax optimal estimators which are not sample-monotonic in the sense we desire.
46
+
47
+ Universal vs Asymptotic. We also remark that our analysis is not only non-asymptotic but also works for all possible input dimensions, model sizes, and sample sizes. To our knowledge, the results herein are the first non-asymptotic sample-wise and model-wise monotonicity results for linear regression. (See discussion of related works Hastie et al. (2019); Mei & Montanari (2019) for related results in the asymptotic setting). Our work reveals aspects of the problem that were not present in prior asymptotic works. For example, we empirically show that optimal regularization can eliminate even “triple descent” in ridge regression (Figure 2). Moreover, we show that for nonGaussian covariates, optimally-tuned ridge regression is not always sample-monotonic: we give a counterexample in Section 4.
48
+
49
+ Towards a more general characterization. Our theoretical results crucially rely on the covariance of the data being isotropic. A natural next question is if and when the same results can hold more generally. A full answer to this question is beyond the scope of this paper, though we give the following results:
50
+
51
+ 1. Optimally-tuned ridge regression is not always sample-monotonic: we show a counterexample for a certain non-Gaussian data distribution and heteroscedastic noise. We are not aware of prior work pointing out this fact. (See Section 4 for the counterexample and intuitions.)
52
+ 2. For non-isotropic Gaussian covariates, we can achieve sample-wise monotonicity with a regularizer that depends on the population covariance matrix of data. This suggests unlabeled data might also help mitigate double descent in some settings, because the population covariance can be estimated from unlabeled data. (See Appendix B).
53
+ 3. For non-isotropic Gaussian covariates, we conjecture that optimally-tuned ridge regression is sample-monotonic even with a standard $\ell _ { 2 }$ regularizer (as in Figure 2). We derive a sufficient condition for this conjecture. Due to that current random matrix theory may be insufficient to verify this conjecture, we verify it numerically on a wide variety of cases. (See Appendix B for details).
54
+
55
+ The last two results above highlight the importance of the form of the regularizer, which leads to the open question: “How do we design good regularizers which mitigate or remove double descent?” We hope that our results can motivate future work on mitigating the double descent phenomenon, and allow us to train high performance models which do not exhibit nonmonotonic behaviors.
56
+
57
+ # 1.1 RELATED WORKS
58
+
59
+ The study of nonmonotonicity in learning algorithms existed prior to double descent and has a long history going back to (at least) Trunk (1979) and LeCun et al. (1991); Le Cun et al. (1991), where the former was largely empirical observations and the latter studied the sample non-nonmonotonicity of unregularized linear regression in terms of the eigenspectrum of the covariance matrix; the difference to our works is that we study this in the context of optimal regularization. In fact, Duin (1995; 2000); Opper (2001); Loog & Duin (2012). Loog et al. (2019) introduces the same notion of risk monotonicity which we consider, and studies several examples of monotonic and non-monotonic procedures.
60
+
61
+ Double descent of test risk as a function of model size was considered recently in more generality by Belkin et al. (2018). Similar behavior was observed empirically in earlier work in somewhat more restricted settings Trunk (1979); Opper (1995; 2001); Skurichina & Duin (2002); Le Cun et al. (1991); LeCun et al. (1991) and more recently in Advani & Saxe (2017); Geiger et al. (2019a); Spigler et al. (2018); Neal et al. (2018). Recently Nakkiran et al. (2020) demonstrated a generalized double descent phenomenon on modern deep networks, and highlighted “sample non-monotonicity” as an aspect of double descent.
62
+
63
+ A recent stream of theoretical works consider model-wise double descent in simplified settings— often via linear models for regression or classification. This also connects to works on highdimentional regression in the statistics literature. A partial list of works in these areas include Belkin et al. (2019); Hastie et al. (2019); Bartlett et al. (2019); Muthukumar et al. (2019); Bibas et al. (2019); Mitra (2019); Mei & Montanari (2019); Liang & Rakhlin (2018); Liang et al. (2019); Xu & Hsu (2019); Derezinski et al. (2019); Lampinen & Ganguli (2018); Deng et al. (2019); Nakki- ´ ran (2019); Mahdaviyeh & Naulet (2019); Dobriban et al. (2018); Dobriban & Sheng (2019); Kobak et al. (2018). Of these, most closely related to our work are Hastie et al. (2019); Dobriban et al. (2018); Mei & Montanari (2019). Specifically, Hastie et al. (2019) considers the risk of unregularized and regularized linear regression in an asymptotic regime, where dimension $d$ and number of samples $n$ scale to infinity together, at a constant ratio $d / n$ . In contrast, we show non-asymptotic results, and are able to consider increasing the number of samples for a fixed model, without scaling both together. Mei & Montanari (2019) derive similar results for unregularized and regularized random features, also in an asymptotic limit. The non-asymptotic versions of the settings considered in Hastie et al. (2019) are almost identical to ours— for example, our projection model in Section 3 is nearly identical to the model in Hastie et al. (2019, Section 5.1). Finally, subsequent to our work, d’Ascoli et al. (2020) identified triple descent in an asymptotic setting.
64
+
65
+ # 2 SAMPLE MONOTONICITY IN RIDGE RIDGRESSION
66
+
67
+ In this section, we prove that optimally-regularized ridge regression has test risk that is monotonic in samples, for isotropic gaussian covariates and linear response. This confirms the behavior empirically observed in Figure 1. We also show that this monotonicity is not “fragile”, and using larger than larger regularization is still sample-monotonic (consistent with Figure 1).
68
+
69
+ Formally, we consider the following linear regression problem in $d$ dimensions. The input/covariate $x \in \mathbb { R } ^ { d }$ is generated from $\mathcal { N } ( 0 , I _ { d } )$ , and the output/response is generated by $y = \langle x , \beta ^ { * } \rangle + \varepsilon$ with $\varepsilon \sim \mathcal { N } ( 0 , \bar { \sigma } ^ { 2 } )$ for some unknown parameter $\beta ^ { * } \in \mathbb { R } ^ { d }$ . We denote the joint distribution of $( x , y )$ by $\mathcal { D }$ . We are given $n$ training examples $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ i.i.d sampled from $\mathcal { D }$ . We aim to learn a linear model $f _ { \beta } ( x ) = \langle x , \beta \rangle$ with small population risk $\bar { R } ( \beta ) : = \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } [ ( \langle x , \beta \rangle - y ) ^ { 2 } ]$ . For simplicity, let $\ b { X } \in \mathbb { R } ^ { n \times d }$ be the data matrix that contains $x _ { i } ^ { \top }$ ’s as rows and let $\vec { y } \in \mathbb R ^ { n }$ be column vector that contains the responses $y _ { i }$ ’s as entries. For any estimator $\hat { \beta } _ { n } ( X , \vec { y } )$ as a function of $n$ samples, define the expected risk of the estimator as:
70
+
71
+ $$
72
+ { \overline { { R } } } ( { \hat { \beta } } _ { n } ) : = \operatorname * { \mathbb { E } } _ { X , y \sim { \mathcal { D } } ^ { n } } [ R ( { \hat { \beta } } _ { n } ( X , { \vec { y } } ) ) ]
73
+ $$
74
+
75
+ We consider the regularized least-squares estimator, also known as the ridge regression estimator. For a given $\lambda > 0$ , define
76
+
77
+ $$
78
+ \hat { \beta } _ { n , \lambda } : = \underset { \beta } { \operatorname { a r g m i n } } | | X \beta - \vec { y } | | _ { 2 } ^ { 2 } + \lambda | | \beta | | _ { 2 } ^ { 2 } = ( X ^ { T } X + \lambda I _ { d } ) ^ { - 1 } X ^ { T } \vec { y }
79
+ $$
80
+
81
+ Here $I _ { d }$ denotes the $d$ dimensional identity matrix. Let $\lambda _ { n } ^ { \mathrm { o p t } }$ be the optimal ridge parameter (that achieves the minimum expected risk) given $n$ samples: $\begin{array} { r } { \lambda _ { n } ^ { \mathrm { o p t } } : = \operatorname * { a r g m i n } _ { \lambda : \lambda \geq 0 } \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) ) } \end{array}$ . Let $\hat { \beta } _ { n } ^ { \mathrm { { o p t } } }$ be the estimator that corresponds to the $\lambda _ { n } ^ { \mathrm { o p t } }$ . That is, $\begin{array} { r } { \hat { \beta } _ { n } ^ { \mathrm { o p t } } : = \operatorname * { a r g m i n } _ { \beta } | | X \beta - \vec { y } | | _ { 2 } ^ { 2 } + \lambda _ { n } ^ { \mathrm { o p t } } | | \beta | | _ { 2 } ^ { 2 } } \end{array}$ . Our main theorem in this section shows that the expected risk of $\hat { \beta } _ { n } ^ { \mathrm { { o p t } } }$ monotonically decreases as $n$ increases.
82
+
83
+ Theorem 1. In the setting above, the expected test risk of optimally-regularized well-specified isotropic linear regression is monotonic in samples. That is, for all $\beta ^ { * } \in \mathbb { R } ^ { d }$ and all $d \in \mathbb { N } , n \in$ $\mathbb { N } , \sigma > 0$ ,
84
+
85
+ $$
86
+ \overline { { R } } ( \hat { \beta } _ { n + 1 } ^ { \mathrm { o p t } } ) \leq \overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { o p t } } )
87
+ $$
88
+
89
+ The above theorem shows a strong form of monotonicity, since it holds for every fixed groundtruth $\beta ^ { * }$ , and does not require averaging over any prior on ground-truths. Moreover, it holds nonasymptotically, for every fixed $n , d \in \mathbb { N }$ . Obtaining such non-asymptotic results is nontrivial, since we cannot rely on concentration properties of the involved random variables.
90
+
91
+ In particular, evaluating $\overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { { o p t } } } )$ as a function of the problem parameters $( n , \sigma , \beta ^ { * }$ , and $d$ ) is technically challenging. In fact, we suspect that a simple closed form expression does not exist. The key idea towards proving the theorem is to derive a “partial evaluation” — the following lemmas shows that we can write $\overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { { o p t } } } )$ in the form of $\mathbb { E } [ g ( \gamma , \sigma , n , d , \beta ^ { * } ) ]$ where $\gamma \in \mathbb { R } ^ { d }$ contains the singular values of $X$ . We will then couple the randomness of data matrices obtained by adding a single sample, and use singular value interlacing to compare their singular values.
92
+
93
+ Lemma 1. In the setting of Theorem $^ { l }$ , let $\gamma = ( \gamma _ { 1 } , \ldots , \gamma _ { d } )$ be the singular values of the data matrix $\ b { X } \in \mathbb { R } ^ { n \times d }$ . (If $n < d$ , we pad the $\gamma _ { i } = 0$ for $i > n .$ .) Let $\Gamma _ { n }$ be the distribution of $\gamma .$ . Then, the expected test risk is
94
+
95
+ $$
96
+ \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) = \operatorname * { \mathbb { E } } _ { ( \gamma _ { 1 } , \dots \gamma _ { d } ) \sim \Gamma _ { n } } \left[ \sum _ { i = 1 } ^ { d } \frac { | | \beta ^ { * } | | _ { 2 } ^ { 2 } \lambda ^ { 2 } / d + \sigma ^ { 2 } \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } \right] + \sigma ^ { 2 }
97
+ $$
98
+
99
+ From Lemma 1, the below lemma follows directly by taking derivatives to find the optimal $\lambda$ .
100
+
101
+ Lemma 2. In the setting of Theorem 1, the optimal ridge parameter is constant for all $n$ : $\lambda _ { n } ^ { \mathrm { o p t } } =$ $\frac { d \sigma ^ { 2 } } { | | \beta ^ { * } | | _ { 2 } ^ { 2 } }$ . Moreover, the optimal expected test risk can be written as
102
+
103
+ $$
104
+ \overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { o p t } } ) = \operatorname * { l } _ { ( \gamma _ { 1 } , \ldots \gamma _ { d } ) \sim \Gamma _ { n } } \left[ \sum _ { i = 1 } ^ { d } \frac { \sigma ^ { 2 } } { \gamma _ { i } ^ { 2 } + d \sigma ^ { 2 } / | | \beta ^ { * } | | _ { 2 } ^ { 2 } } \right] + \sigma ^ { 2 }
105
+ $$
106
+
107
+ Proofs of Lemma 1 and 2 are deferred to the Appendix, Section A.1. Now we are ready to prove Theorem 1.
108
+
109
+ Proof of Theorem $^ { l }$ . Let $\widetilde { X } \ \in \ \mathbb { R } ^ { ( n + 1 ) \times d }$ and $\boldsymbol { X } \in \mathbb { R } ^ { n \times d }$ be any two matrices which differ by only the last row of $\widetilde { X }$ . By the Cauchy interlacing theorem Theorem 4.3.4 of Horn et al. (1990) (c.f.,Lemma 3.4 of Marcus et al. (2014)), the singular values of $X$ and $\widetilde { X }$ are interlaced: $\forall i$ : $\gamma _ { i - 1 } ( X ) \geq \gamma _ { i } ( { \widetilde { X } } ) \geq \gamma _ { i } ( X )$ where $\gamma _ { i } ( \cdot )$ is the $i$ -th singular value.
110
+
111
+ If we couple $\widetilde { X }$ and $X$ , it will induce a coupling $\Pi$ between the distributions $\Gamma _ { n + 1 }$ and $\Gamma _ { n }$ , of the singular values of the data matrix for $n + 1$ and $n$ samples. This coupling satisfies that $\widetilde { \gamma } _ { i } \geq \gamma _ { i }$ with probability 1 for $( \{ \widetilde { \gamma } _ { i } \} , \{ \gamma _ { i } \} ) \sim \Pi$ e. Now, expand the test risk using Lemma 2, and observe that each eterm in the sum of Equation (4) below is monotone decreasing with $\gamma _ { i }$ . Thus:
112
+
113
+ $$
114
+ \begin{array} { r l } & { \overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { o p t } } ) = \underset { ( \gamma _ { 1 } , \ldots , \gamma _ { d } ) \sim \Gamma _ { n } } { \mathbb { E } } \left[ \displaystyle \sum _ { i = 1 } ^ { d } \frac { \sigma ^ { 2 } } { \gamma _ { i } ^ { 2 } + d \sigma ^ { 2 } / | | \beta ^ { * } | | _ { 2 } ^ { 2 } } \right] + \sigma ^ { 2 } } \\ & { \qquad \quad \overset { \mathbb { E } } { \ge } \underset { ( \widetilde { \gamma } _ { 1 } , \ldots , \widetilde { \gamma } _ { d } ) \sim \Gamma _ { n + 1 } } { \mathbb { E } } \left[ \displaystyle \sum _ { i = 1 } ^ { d } \frac { \sigma ^ { 2 } } { \widetilde { \gamma } _ { i } ^ { 2 } + d \sigma ^ { 2 } / | | \beta ^ { * } | | _ { 2 } ^ { 2 } } \right] + \sigma ^ { 2 } } \\ & { \qquad = \overline { { R } } ( \hat { \beta } _ { n + 1 } ^ { \mathrm { o p t } } ) } \end{array}
115
+ $$
116
+
117
+ By similar techniques, we can also prove that overregularization —that is, using ridge parameters $\lambda$ larger than the optimal value— is still monotonic. This proves the behavior empirically observed in Figure 1.
118
+
119
+ Theorem 2. In the same setting as Theorem $I$ , over-regularized regression is also monotonic in samples. That is, for all $d \in \mathbb { N } , n \in \mathbb { N } , \sigma > 0 , \beta ^ { * } \in \mathbb { R } ^ { d }$ , the following holds
120
+
121
+ $$
122
+ \forall \lambda \geq \lambda ^ { * } : \quad \overline { { { R } } } ( \widehat { \beta } _ { n + 1 , \lambda } ) \leq \overline { { { R } } } ( \widehat { \beta } _ { n , \lambda } )
123
+ $$
124
+
125
+ where $\begin{array} { r } { \lambda ^ { * } = \frac { d \sigma ^ { 2 } } { | | \beta ^ { * } | | _ { 2 } ^ { 2 } } } \end{array}$
126
+
127
+ Proof. In Section A.1.
128
+
129
+ # 3 MODEL-WISE MONOTONICITY IN RIDGE REGRESSION
130
+
131
+ In this section, we show that for a certain family of linear models, optimal regularization prevents model-wise double descent. That is, for a fixed number of samples, larger models are not worse than smaller models.
132
+
133
+ We consider the following learning problem. Informally, covariates live in a $p$ -dimensional ambient space, and we consider models which first linearly project down to a random $d$ -dimensional subspace, then perform ridge regression in that subspace for some $d \leq p$ . Formally, the covariate $x \in \mathbb { R } ^ { p }$ is generated from $\bar { \mathcal { N } } ( 0 , I _ { p } )$ , and the response is generated by $y = \langle x , \theta \rangle + \varepsilon$ with $\varepsilon \sim \mathcal { N } ( 0 , \sigma ^ { 2 } )$ and for some unknown parameter $\theta \in \mathbb { R } ^ { p }$ . Next, $n$ examples $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ are sampled i.i.d from this distribution. For a given model size $d \leq p$ , we first sample a random orthonormal matrix $P \in \mathbb { R } ^ { d \times p }$ which specifies our model. We then consider models which operate on $( \widetilde { x } _ { i } , y _ { i } ) \in \mathbb { R } ^ { d } \times \mathbb { R }$ , where $\widetilde { x _ { i } } = P x _ { i }$ . We denote the joint distribution of $( \widetilde { x } , y )$ by $\mathcal { D }$ . Here, we eemphasize that $p$ eis some large ambient dimension and $d \leq p$ eis the size of the model we learn.
134
+
135
+ For a fixed $P$ , we want to learn a linear model $f _ { \hat { \beta } } ( \tilde { x } ) = \langle \tilde { x } , \hat { \beta } \rangle$ for estimating $y$ , with small mean squared error on distribution: $R _ { P } ( \hat { \beta } ) : = \mathbb { E } _ { ( \tilde { x } , y ) \sim \mathcal { D } } [ ( \langle \tilde { x } , \hat { \beta } \rangle - y ) ^ { 2 } ]$ . For $n$ samples $( x _ { i } , y _ { i } )$ , let $X \in$ $\mathbb { R } ^ { n \times p }$ be the data matrix, $\widetilde { X } \ = X P ^ { T } \ \in \ \mathbb { R } ^ { n \times d }$ be the projected data matrix and $\vec { y } \in \mathbb R ^ { n }$ be the responses. For any estimator $\hat { \beta } ( \widetilde { X } , \vec { y } )$ as a function of the observed samples, define the expected risk of the estimator as:
136
+
137
+ $$
138
+ \overline { { R } } ( \hat { \beta } ) : = \operatorname * { \mathbb { E } } _ { P } \operatorname * { \mathbb { E } } _ { \tilde { X } , \vec { y } \sim \mathcal { D } ^ { n } } [ R _ { P } ( \hat { \beta } ( \tilde { X } , \vec { y } ) ]
139
+ $$
140
+
141
+ We consider the regularized least-squares estimator. For a given $\lambda > 0$ , define
142
+
143
+ $$
144
+ \hat { \beta } _ { d , \lambda } : = \underset { \beta } { \mathrm { a r g m i n } } | | \widetilde { X } \beta - \vec { y } | | _ { 2 } ^ { 2 } + \lambda | | \beta | | _ { 2 } ^ { 2 } = ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I _ { d } ) ^ { - 1 } \widetilde { X } ^ { T } \vec { y }
145
+ $$
146
+
147
+ Let $\lambda _ { d } ^ { \mathrm { o p t } }$ be the optimal ridge parameter (that achieves the minimum expected risk) for a model of size $d$ d, with $n$ samples: $\lambda _ { d } ^ { \mathrm { o p t } } : = \mathrm { a r g m i n } _ { \lambda \ge 0 } \overline { { R } } ( \hat { \beta } _ { d , \lambda } ) )$ . Let $\hat { \beta } _ { d } ^ { \mathrm { { o p t } } }$ be the estimator that corresponds to the $\lambda _ { d } ^ { \mathrm { o p t } }$ , that is $\begin{array} { r } { \hat { \beta } _ { d } ^ { \mathrm { o p t } } : = \operatorname * { a r g m i n } _ { \beta } | | \widetilde { X } \beta - \vec { y } | | _ { 2 } ^ { 2 } + \lambda _ { d } ^ { \mathrm { o p t } } | | \beta | | _ { 2 } ^ { 2 } } \end{array}$ . Now, our main theorem in this setting shows that with optimal $\ell _ { 2 }$ regularization, test performance is monotonic in model size.
148
+
149
+ Theorem 3. In the setting above, the expected test risk of the optimally-regularized model is monotonic in the model size $d .$ . That is, for all $p \in \mathbb { N } , \theta \in \mathbb { R } ^ { p } , d \leq p , n \in \mathbb { N } , \sigma > 0$ , we have
150
+
151
+ $$
152
+ \overline { { R } } ( \hat { \beta } _ { d + 1 } ^ { \mathrm { o p t } } ) \leq \overline { { R } } ( \hat { \beta } _ { d } ^ { \mathrm { o p t } } )
153
+ $$
154
+
155
+ The proof of Theorem 3 is in Appendix A.2, and follows closely the proof of Theorem 1.
156
+
157
+ # 4 COUNTEREXAMPLES TO MONOTONICITY
158
+
159
+ In this section, we show that optimally-regularized ridge regression is not always monotonic in samples. We give a numeric counterexample in $d = 2$ dimensions, with non-gaussian covariates and heteroscedastic noise. This does not contradict our main theorem in Section 2, since this distribution is not jointly Gaussian with isotropic marginals.
160
+
161
+ Counterexample. Here we give an example of a distribution $( x , y )$ for which the expected error of optimally-regularized ridge regression with $n = 2$ samples is worse than with $n = 1$ samples. This counterexample is most intuitive to understand when the ridge parameter $\lambda$ is allowed to depend on the specific sample instance $( X , { \vec { y } } )$ as well as $n ^ { 1 }$ . We sketch the intuition for this below. Consider the following distribution on $( x , y )$ in $d = 2$ dimensions. This distribution has one “clean” coordinate and one “noisy” coordinate. The distribution is: $( x , y ) = ( { \vec { e } } _ { 1 } , 1 )$ with probability $1 / 2$ , and $( x , y ) =$ $( \vec { e } _ { 2 } , \pm 1 0 )$ w.p. 1/2. Where $\pm 1 0$ is uniformly random independent noise. This distribution is “wellspecified” in that the optimal predictor is linear in $x$ $: \mathbb { E } [ y | x ] = \langle \beta ^ { * } , x \rangle$ for $\beta ^ { * } = [ 1 , 0 ]$ . However, the noise is heteroscedastic.
162
+
163
+ For $n = 1$ samples, the estimator can decide whether to use small $\lambda$ or large $\lambda$ depending on if the sampled coordinate is the “clean” or “noisy” one. Specifically, for the sample $( x , y )$ : If $x = \vec { e } _ { 1 }$ , then the optimal ridge parameter is $\lambda = 0$ . If $x = \vec { e } _ { 2 }$ , then the optimal parameter is $\lambda = \infty$ .
164
+
165
+ For $n = 2$ samples, with probability $1 / 2$ the two samples will hit both coordinates. In this case, the estimator must chose a single value of $\lambda$ uniformly for both coordinates. This yields to a suboptimal tradeoff, since the “noisy” coordinate demands large regularization, but this hurts estimation on the “clean” coordinate.
166
+
167
+ It turns out that a slight modification to the above also serves as a counterexample to monotonicity when the regularization parameter $\lambda$ is chosen only depending on $n$ (and not on the instance $X , y )$ . The distribution is: $( x , y ) = ( \vec { e } _ { 1 } , 1 )$ w.p. 0.98 and $( x , y ) = ( \vec { e } _ { 2 } , \pm 2 0 )$ w.p. 0.02. This distribution has the following property.
168
+
169
+ Theorem 4. There exists a distribution $\mathcal { D }$ over $( x , y )$ for $x \in \mathbb { R } ^ { 2 } , y \in \mathbb { R }$ with the following properties. Let $\hat { \beta } _ { n } ^ { \mathrm { { o p t } } }$ be the optimally-regularized ridge regression solution for $n$ samples $( X , { \vec { y } } )$ from $\mathcal { D }$ . Then:
170
+
171
+ 1. D is “well-specified” in that $\mathbb { E } p [ y | x ]$ is a linear function of $x$ ,
172
+
173
+ 2. The expected test risk increases as a function of $n _ { \ast }$ , between $n = 1$ and $n = 2$ . Specifically
174
+
175
+ $$
176
+ \overline { { R } } ( \hat { \beta } _ { n = 1 } ^ { \mathrm { o p t } } ) < \overline { { R } } ( \hat { \beta } _ { n = 2 } ^ { \mathrm { o p t } } )
177
+ $$
178
+
179
+ Proof. For $n = 1$ samples, it can be confirmed analytically that the expected risk $\overline { { { R } } } ( \hat { \beta } _ { n = 1 } ^ { \mathrm { o p t } } ) ~ <$ 8.157. This is achieved with $\lambda = 4 0 0 / 2 4 0 1 \approx 0 . 1 6 6 5 9 7 .$ For $n = 2$ samples, it can be confirmed numerically (via Mathematica) that the expected risk $\overline { { R } } ( \hat { \beta } _ { n = 2 } ^ { \mathrm { o p t } } ) ~ > ~ 8 . 1 7 9$ . This is achieved with $\lambda = 0 . 6 4 2 5 2 5$ . □
180
+
181
+ # 5 EXPERIMENTS
182
+
183
+ We now experimentally demonstrate that optimal $\ell _ { 2 }$ regularization can mitigate double descent, in more general settings than Theorems 1 and 3.
184
+
185
+ # 5.1 SAMPLE MONOTONICITY
186
+
187
+ Here we show various settings where optimal $\ell _ { 2 }$ regularization empirically induces samplemonotonic performance.
188
+
189
+ Nonisotropic Regression. We first consider the setting of Theorem 1, but with non-isotropic covariantes $x$ . That is, we perform ridge regression on samples $( x , y )$ , where the covariate $\boldsymbol { x } \in \mathbb { R } ^ { d }$ is generated from $\mathcal { N } ( 0 , \Sigma )$ for $\Sigma \neq I _ { d }$ . As before, the response is generated by $y = \langle x , \beta ^ { * } \rangle + \varepsilon$ with $\varepsilon \sim \mathcal { N } ( 0 , \sigma ^ { 2 } )$ for some unknown parameter $\beta ^ { * } \in \mathbb { R } ^ { d }$ . We consider the same ridge regression estimator, $\begin{array} { r } { \hat { \beta } _ { n , \lambda } : = \operatorname * { a r g m i n } _ { \boldsymbol { \beta } } \| X { \boldsymbol { \beta } } - \vec { y } \| _ { 2 } ^ { 2 } + \lambda \| { \boldsymbol { \beta } } \| _ { 2 } ^ { 2 } } \end{array}$ .
190
+
191
+ ![](images/6bbe45f3d0113a0cbb86e816d67e9834573c85c456540349b12e6e02c25001ba.jpg)
192
+ Figure 2: Test Risk vs. Num. Samples for Non-Isotropic Ridge Regression in $d = 3 0$ dimensions. Unregularized regression is non-monotonic in samples, but optimally-regularized regression is monotonic. Note the optimal regularization $\lambda$ depends on the number of samples $n$ .
193
+ Figure 2 shows one instance of this, for a particular choice of $\Sigma$ and $\beta ^ { * }$ . The covariance $\Sigma$ is diagonal, with $\Sigma _ { i , i } = 1 0$ for $i \leq 1 5$ and $\Sigma _ { i , i } = 1$ for $i > 1 5$ . That is, the covariance has one “large” eigenspace and one “small” eigenspace. The ground-truth $\beta ^ { * } = 0 . 1 \vec { e _ { 1 } } + e _ { 3 0 } ^ { }$ , which lies almost entirely within the “small” eigenspace of $\Sigma$ . The noise parameter is $\sigma = 0 . 5$ .
194
+
195
+ We see that unregularized regression $\lambda = 0$ ) actually undergoes “triple descent”2 in this setting, with the first peak around $n = 1 5$ samples due to the 15-dimensional large eigenspace, and the second peak at $n = d$ . In this setting, optimally-regularized ridge regression is empirically monotonic in samples (Figure 2). Unlike the isotropic setting of Section 2, the optimal ridge parameter $\lambda _ { n }$ is no longer a constant, but varies with number of samples $n$ .
196
+
197
+ Random ReLU Features. We consider random ReLU features, in the random features framework of Rahimi & Recht (2008). For a given number of features $D$ , and number of samples $n$ , the random feature classifier is obtained by performing regularized linear regression on the embedding√ $\tilde { x } : = \mathrm { R e L U } ( W x )$ , where $W \in \mathbb { R } ^ { D \times d }$ is a matrix with each entry sampled i.i.d $\mathcal { N } ( 0 , 1 / \sqrt { d } )$ and ReLU applies pointwise. This is equivalent to a 2-layer fully-connected neural network with a frozen (randomly-initialized) first layer, trained with $\ell _ { 2 }$ loss and weight decay. In Appendix A.4, we apply random features to Fashion-MNIST Xiao et al. (2017). From Appendix Figure 4a, we see that underregularized models are non-monotonic, but optimal $\ell _ { 2 }$ regularization is monotonic in samples. Moreover, the optimal ridge parameter $\lambda$ appears to be constant for all $n$ , similar to our results from the isotropic setting in Theorem 1.
198
+
199
+ # 5.2 MODEL-SIZE MONOTONICITY
200
+
201
+ Here we empirically show that optimal $\ell _ { 2 }$ regularization can mitigate model-wise double descent.
202
+
203
+ Random ReLU Features. We consider the same experimental setup as in Section 5.1, but now fix the number of samples $n$ , and vary the number of random features $D$ . This corresponds to varying the width of the corresponding 2-layer neural network. Figure 4b in Appendix A.4 shows the test error of the random features classifier, for $n = 5 0 0$ train samples and varying number of random features. We see that underregularized models undergo model-wise double descent, but optimal $\ell _ { 2 }$ regularization prevents double descent.
204
+
205
+ Convolutional Neural Networks. We follow the experimental setup of Nakkiran et al. (2020) for modelwise double descent, and add varying amounts of $\ell _ { 2 }$ regularization (weight decay). We chose the following setting from Nakkiran et al. (2020), because it exhibits double descent even with no added label noise. We consider the same family of 5-layer convolutional neural networks (CNNs) from Nakkiran et al. (2020), consisting of 4 convolutional layers of widths $[ k , 2 k , 4 k , 8 k ]$ for varying $k \in$ $\mathbb { N }$ . We train and test on CIFAR100 (Krizhevsky et al., 2009), an image classification problem with 100 classes. Inputs are normalized to
206
+
207
+ ![](images/b59ffa519889838486fdb1bea9435eca85527fcc4c5ff780a6f8610321941a4b.jpg)
208
+ Figure 3: Test Error vs. Model Size for 5-layer CNNs on CIFAR-100, with $\ell _ { 2 }$ regularization (weight decay). Note that the optimal regularization $\lambda$ varies with $n$ .
209
+
210
+ $[ - 1 , 1 ] ^ { d }$ , and we use standard data-augmentation of random horizontal flip and random crop with 4- pixel padding. All models are trained using Stochastic Gradient Descent (SGD) on the cross-entropy loss, with step size $0 . 1 / \sqrt { \lfloor { T / 5 1 2 } \rfloor + 1 }$ at step $T$ . We train for 1e6 gradient steps, and use weight decay $\lambda$ for varying $\lambda$ . Due to optimization instabilities for large $\lambda$ , we use the model with the minimum train loss among the last 5K gradient steps. Figure 3 shows the test error of these models on CIFAR-100. Although unregularized and under-reguarized models exhibit double descent, the test error of optimally-regularized models is largely monotonic. Note that the optimal regularization $\lambda$ varies with the model size — no single regularization value is optimal for all models.
211
+
212
+ # 6 DISCUSSION AND CONCLUSION
213
+
214
+ In this work, we study the double descent phenomenon in the context of optimal regularization. We show that, while unregularized or under-regularized models often have non-monotonic behavior, appropriate regularization can eliminate this effect.
215
+
216
+ Theoretically, we prove that for certain linear regression models with isotropic covariates, optimallytuned $\ell _ { 2 }$ regularization achieves monotonic test performance as we grow either the sample size or the model size. These are the first non-asymptotic monotonicity results we are aware of in linear regression. We also demonstrate empirically that optimally-tuned $\ell _ { 2 }$ regularization can mitigate double descent for more general models, including neural networks. We hope that our results can motivate future work on mitigating the double descent phenomenon, and allow us to train high performance models which do not exhibit unexpected nonmonotonic behaviors.
217
+
218
+ Open Questions. Our work suggests a number of natural open questions. First, it is open to prove (or disprove) that optimal ridge regression is sample-monotonic for non-isotropic Gaussian covariates. We conjecture that it is, and outline a potential route to proving this (via Conjectures 1 and 2 in the Appendix). Second, more broadly, it is open to prove sample-wise or model-wise monotonicity for more general (non-linear) models with appropriate regularizers. Finally, it is open to understand why large neural networks in practice are often sample-monotonic in realistic regimes of sample sizes, even without careful choice of regularization.
219
+
220
+ # REFERENCES
221
+
222
+ Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
223
+ Peter L Bartlett, Philip M Long, Gabor Lugosi, and Alexander Tsigler. Benign overfitting in linear ´ regression. arXiv preprint arXiv:1906.11300, 2019.
224
+ Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine learning and the bias-variance trade-off. arXiv preprint arXiv:1812.11118, 2018.
225
+ Mikhail Belkin, Daniel Hsu, and Ji Xu. Two models of double descent for weak features. arXiv preprint arXiv:1903.07571, 2019.
226
+ Koby Bibas, Yaniv Fogel, and Meir Feder. A new look at an old problem: A universal learning approach to linear regression. arXiv preprint arXiv:1905.04708, 2019.
227
+ Stephane d’Ascoli, Levent Sagun, and Giulio Biroli. Triple descent and the two kinds of overfitting: ´ Where & why do they appear? arXiv preprint arXiv:2006.03509, 2020.
228
+ Zeyu Deng, Abla Kammoun, and Christos Thrampoulidis. A model of double descent for highdimensional binary linear classification. arXiv preprint arXiv:1911.05822, 2019.
229
+ Michał Derezinski, Feynman Liang, and Michael W. Mahoney. Exact expressions for double descent ´ and implicit regularization via surrogate random design, 2019.
230
+ Edgar Dobriban and Yue Sheng. Wonder: Weighted one-shot distributed ridge regression in high dimensions. arXiv preprint arXiv:1903.09321, 2019.
231
+ Edgar Dobriban, Stefan Wager, et al. High-dimensional asymptotics of prediction: Ridge regression and classification. The Annals of Statistics, 46(1):247–279, 2018.
232
+ Robert PW Duin. Small sample size generalization. In Proceedings of the Scandinavian Conference on Image Analysis, volume 2, pp. 957–964. PROCEEDINGS PUBLISHED BY VARIOUS PUBLISHERS, 1995.
233
+ Robert PW Duin. Classifiers in almost empty spaces. In Proceedings 15th International Conference on Pattern Recognition. ICPR-2000, volume 2, pp. 1–7. IEEE, 2000.
234
+ Mario Geiger, Arthur Jacot, Stefano Spigler, Franck Gabriel, Levent Sagun, Stephane d’Ascoli, ´ Giulio Biroli, Clement Hongler, and Matthieu Wyart. Scaling description of generalization with ´ number of parameters in deep learning. arXiv preprint arXiv:1901.01608, 2019a.
235
+ Mario Geiger, Stefano Spigler, Stephane d’Ascoli, Levent Sagun, Marco Baity-Jesi, Giulio Biroli, ´ and Matthieu Wyart. Jamming transition as a paradigm to understand the loss landscape of deep neural networks. Physical Review E, 100(1):012115, 2019b.
236
+ Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J. Tibshirani. Surprises in high
237
+
238
+ dimensional ridgeless least squares interpolation, 2019.
239
+
240
+ Roger A Horn, Roger A Horn, and Charles R Johnson. Matrix Analysis. Cambridge University Press, 1990.
241
+
242
+ Dmitry Kobak, Jonathan Lomond, and Benoit Sanchez. Optimal ridge penalty for real-world highdimensional data can be zero or negative due to the implicit ridge regularization. arXiv preprint arXiv:1805.10939, 2018.
243
+
244
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
245
+
246
+ Andrew K Lampinen and Surya Ganguli. An analytic theory of generalization dynamics and transfer learning in deep linear networks. arXiv preprint arXiv:1809.10374, 2018.
247
+
248
+ Yann Le Cun, Ido Kanter, and Sara A Solla. Eigenvalues of covariance matrices: Application to neural-network learning. Physical Review Letters, 66(18):2396, 1991.
249
+
250
+ Yann LeCun, Ido Kanter, and Sara A Solla. Second order properties of error surfaces: Learning time and generalization. In Advances in neural information processing systems, pp. 918–924, 1991.
251
+
252
+ Tengyuan Liang and Alexander Rakhlin. Just interpolate: Kernel” ridgeless” regression can generalize. arXiv preprint arXiv:1808.00387, 2018.
253
+
254
+ Tengyuan Liang, Alexander Rakhlin, and Xiyu Zhai. On the risk of minimum-norm interpolants and restricted lower isometry of kernels. arXiv preprint arXiv:1908.10292, 2019.
255
+
256
+ Tengyuan Liang, Alexander Rakhlin, and Xiyu Zhai. On the multiple descent of minimum-norm interpolants and restricted lower isometry of kernels. 2020.
257
+
258
+ Marco Loog and Robert PW Duin. The dipping phenomenon. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pp. 310–317. Springer, 2012.
259
+
260
+ Marco Loog, Tom Viering, and Alexander Mey. Minimizers of the empirical risk and risk monotonicity. In Advances in Neural Information Processing Systems, pp. 7476–7485, 2019.
261
+
262
+ Yasaman Mahdaviyeh and Zacharie Naulet. Asymptotic risk of least squares minimum norm estimator under the spike covariance model. arXiv preprint arXiv:1912.13421, 2019.
263
+
264
+ Adam W Marcus, Daniel A Spielman, and Nikhil Srivastava. Ramanujan graphs and the solution of the kadison-singer problem. arXiv preprint arXiv:1408.4421, 2014.
265
+
266
+ Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve. arXiv preprint arXiv:1908.05355, 2019.
267
+
268
+ Partha P. Mitra. Understanding overfitting peaks in generalization error: Analytical risk curves for l2 and l1 penalized interpolation. ArXiv, abs/1906.03667, 2019.
269
+
270
+ Vidya Muthukumar, Kailas Vodrahalli, and Anant Sahai. Harmless interpolation of noisy data in regression. arXiv preprint arXiv:1903.09139, 2019.
271
+
272
+ Preetum Nakkiran. More data can hurt for linear regression: Sample-wise double descent. arXiv preprint arXiv:1912.07242, 2019.
273
+
274
+ Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ B1g5sA4twr.
275
+
276
+ Brady Neal, Sarthak Mittal, Aristide Baratin, Vinayak Tantia, Matthew Scicluna, Simon LacosteJulien, and Ioannis Mitliagkas. A modern take on the bias-variance tradeoff in neural networks. arXiv preprint arXiv:1810.08591, 2018.
277
+
278
+ Manfred Opper. Statistical mechanics of learning: Generalization. The Handbook of Brain Theory and Neural Networks, 922-925., 1995.
279
+
280
+ Manfred Opper. Learning to generalize. Frontiers of Life, 3(part 2), pp.763-775., 2001.
281
+
282
+ Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pp. 1177–1184, 2008.
283
+
284
+ Marina Skurichina and Robert PW Duin. Bagging, boosting and the random subspace method for linear classifiers. Pattern Analysis & Applications, 5(2):121–135, 2002.
285
+
286
+ Stefano Spigler, Mario Geiger, Stephane d’Ascoli, Levent Sagun, Giulio Biroli, and Matthieu Wyart.´ A jamming transition from under-to over-parametrization affects loss landscape and generalization. arXiv preprint arXiv:1810.09665, 2018.
287
+
288
+ Gerard V Trunk. A problem of dimensionality: A simple example. IEEE Transactions on pattern analysis and machine intelligence, (3):306–307, 1979.
289
+
290
+ Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
291
+
292
+ Ji Xu and Daniel J Hsu. On the number of variables to use in principal component regression. In Advances in Neural Information Processing Systems, pp. 5095–5104, 2019.
293
+
294
+ # A APPENDIX
295
+
296
+ In Section A.1 and A.2 we provide the proofs for sample-monotonicity and model-size monotonicity. In Section A.4 we include additional and omitted plots. In Section B we investigate whether monotonicity provably holds in more general models, and present a monotonicity conjecture for non-isotropic covariates.
297
+
298
+ # A.1 SAMPLE MONOTONICITY PROOFS
299
+
300
+ First we prove Lemma 1.
301
+
302
+ Proof of Lemma $^ { l }$ . For isotropic $x$ , the test risk is related to the parameter error as:
303
+
304
+ $$
305
+ \begin{array} { r l } & { R ( \hat { \beta } ) : = \underset { ( x , y ) \sim \mathcal { D } } { \mathbb { E } } [ ( \langle x , \hat { \beta } \rangle - y ) ^ { 2 } ] } \\ & { \quad \quad = \underset { x \sim \mathcal { N } ( 0 , I _ { d } ) , \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } ) } { \mathbb { E } } [ ( \langle x , \hat { \beta } - \beta ^ { * } \rangle + \eta ) ^ { 2 } ] } \\ & { \quad \quad = | | \hat { \beta } - \beta ^ { * } | | _ { 2 } ^ { 2 } + \sigma ^ { 2 } } \end{array}
306
+ $$
307
+
308
+ Plugging in the form of $\hat { \beta } _ { n , \lambda }$ and expanding:
309
+
310
+ $$
311
+ \begin{array} { r l } & { \bar { R } ( \hat { \beta } _ { n , \lambda } ) : = \underset { X , y \sim \mathcal { D } ^ { n } } { \mathbb { E } } [ R ( \hat { \beta } _ { n , \lambda } ) ] } \\ & { = \mathbb { E } [ \| \hat { \beta } _ { n , \lambda } - \beta ^ { * } \| _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { = \underset { X , y } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } y - \beta \| _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { = \underset { X , \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I _ { n } ) } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } ( X \beta ^ { * } + \eta ) - \beta ^ { * } \| _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { = \underset { X } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } X \beta ^ { * } - \beta ^ { * } \| _ { 2 } ^ { 2 } ] + \underset { X , \eta } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } \eta \| _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { = \underset { X } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } X \beta ^ { * } - \beta ^ { * } \| _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { X } { \mathbb { E } } [ \| ( X ^ { T } X + \lambda I ) ^ { - 1 } X ^ { T } \| _ { F } ^ { 2 } ] + \sigma ^ { 2 } } \end{array}
312
+ $$
313
+
314
+ Now let $X \ = \ U \Sigma V ^ { T }$ be the full singular value decomposition of $X$ , with $U \ \in \ \mathbb { R } ^ { n \times n } , \Sigma \ \in$ $\mathbb { R } ^ { n \times d } , V \in \mathbb { R } ^ { d \times d }$ . Let $( \gamma _ { 1 } , \ldots \gamma _ { d } )$ denote the singular values, defining $\gamma _ { i } = 0$ for $i > \operatorname* { m i n } ( n , d )$ . Then, continuing:
315
+
316
+ $$
317
+ \begin{array} { r l } & { \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) = \underset { V , \Sigma } { \mathbb { E } } [ | | \mathrm { d i a g } ( \{ \frac { - \lambda } { \gamma _ { i } ^ { 2 } + \lambda } \} ) V ^ { T } \beta ^ { * } | | _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { \Sigma } { \mathbb { E } } [ \sum _ { i } \frac { \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ] + \sigma ^ { 2 } } \\ & { \quad \quad = \underset { z \sim \mathrm { U n i f } ( 1 ) \frac { \mathbb { E } } { \delta } } { \underbrace { \mathrm { U } \mathrm { E } } } [ | | \mathrm { d i a g } ( \{ \frac { - \lambda } { \gamma _ { i } ^ { 2 } + \lambda } \} ) z | | _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { \Sigma } { \mathbb { E } } [ \sum _ { i } \frac { \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ] + \sigma ^ { 2 } } \\ & { \quad \quad = \frac { | | \beta ^ { * } | | _ { 2 } ^ { 2 } } { d } \underset { \Sigma } { \mathbb { E } } [ \sum _ { i } \frac { \lambda ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ] + \sigma ^ { 2 } \underset { \Sigma } { \mathbb { E } } [ \sum _ { i } \frac { \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ] + \sigma ^ { 2 } } \\ & { \quad \quad = \underset { \Sigma } { \mathbb { E } } [ \sum _ { i } \frac { | | \beta ^ { * } | | _ { 2 } ^ { 2 } \lambda ^ { 2 } / d + \sigma ^ { 2 } \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ] + \sigma ^ { 2 } } \end{array}
318
+ $$
319
+
320
+ In Line (10) follows because by symmetry, the distribution of $V$ is a uniformly random orthonormal matrix, and $\Sigma$ is independent of $V$ . Thus, $z : = V ^ { T } \beta ^ { * }$ is distributed as a uniformly random point on the unit sphere of radius $| | \beta ^ { * } | | _ { 2 }$ .
321
+
322
+ Next we prove Lemma 2.
323
+
324
+ Proof of Lemma 2. First, we determine the optimal ridge parameter. Using Lemma 1, we have
325
+
326
+ $$
327
+ \begin{array} { r l } & { \frac { \partial } { \partial \lambda } \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) = \frac { \partial } { \partial \lambda } _ { ( \gamma _ { 1 } , \dots \gamma _ { d } ) \sim \Gamma } \left[ \displaystyle \sum _ { i } \frac { | | \beta | | _ { 2 } ^ { 2 } \lambda ^ { 2 } / d + \sigma ^ { 2 } \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } \right] } \\ & { = 2 ( | | \beta ^ { * } | | _ { 2 } ^ { 2 } \lambda / d - \sigma ^ { 2 } ) _ { ( \underbrace { ( \gamma _ { 1 } , \dots \gamma _ { d } ) \sim \Gamma } _ { > 0 } } \left[ \displaystyle \sum _ { i } \frac { \gamma _ { i } ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 3 } } \right] } \end{array}
328
+ $$
329
+
330
+ Thus, $\begin{array} { r } { \frac { \partial } { \partial \lambda } \overline { { R } } ( \widehat { \beta } _ { n , \lambda } ) = 0 \implies \lambda = \frac { d \sigma ^ { 2 } } { | | \beta ^ { * } | | _ { 2 } ^ { 2 } } } \end{array}$ and we conclude that $\begin{array} { r } { \lambda _ { n } ^ { \mathrm { o p t } } = \frac { d \sigma ^ { 2 } } { | | \beta ^ { * } | | _ { 2 } ^ { 2 } } } \end{array}$
331
+
332
+ For this optimal parameter, the test risk follows from Lemma 1 as
333
+
334
+ $$
335
+ \begin{array} { l } { \displaystyle \overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { o p t } } ) = \overline { { R } } ( \hat { \beta } _ { n , \lambda _ { n } ^ { \mathrm { o p t } } } ) } \\ { \displaystyle = \frac { \mathbb { E } } { ( \gamma _ { 1 } , \dots \gamma _ { d } ) \sim \Gamma _ { n } } \left[ \sum _ { i = 1 } ^ { d } \frac { \sigma ^ { 2 } } { \gamma _ { i } ^ { 2 } + d \sigma ^ { 2 } / | | \beta ^ { * } | | _ { 2 } ^ { 2 } } \right] + \sigma ^ { 2 } } \end{array}
336
+ $$
337
+
338
+ Proof of Theorem 2. We follow a similar proof strategy as in Theorem 1: we invoke singular value interlacing $( \widetilde { \gamma } _ { i } \geq \gamma _ { i } )$ for the data matrix when adding a single sample. We then apply Lemma 1 to eargue that the test risk varies monotonically with the singular values.
339
+
340
+ We have
341
+
342
+ $$
343
+ { \overline { { R } } } ( \hat { \beta } _ { n , \lambda } ) = \operatorname * { \mathbb { E } } _ { ( \gamma _ { 1 } , \dots \gamma _ { d } ) \sim \Gamma } [ \sum _ { i } \underbrace { | | \beta ^ { * } | | _ { 2 } ^ { 2 } \lambda ^ { 2 } / d + \sigma ^ { 2 } \gamma _ { i } ^ { 2 } } _ { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } ]
344
+ $$
345
+
346
+ and we compute how each term in the sum varies with $\gamma _ { i }$ :
347
+
348
+ $$
349
+ \begin{array} { l } { \displaystyle { \frac { \partial } { \partial \gamma _ { i } } \sum _ { i } S ( \gamma _ { i } ) = \frac { \partial } { \partial \gamma _ { i } } S ( \gamma _ { i } ) } } \\ { \displaystyle { \quad = ( \frac { - 2 \gamma _ { i } } { d } ) \frac { 2 | | \beta ^ { * } | | _ { 2 } ^ { 2 } \lambda ^ { 2 } + d \sigma ^ { 2 } ( \gamma _ { i } ^ { 2 } - \lambda ) } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 3 } } } } \end{array}
350
+ $$
351
+
352
+ Thus we have
353
+
354
+ $$
355
+ \lambda \geq \frac { d \sigma ^ { 2 } } { 2 \vert \vert \beta ^ { * } \vert \vert ^ { 2 } } \implies \frac { \partial } { \partial \gamma _ { i } } S ( \gamma _ { i } ) \leq 0
356
+ $$
357
+
358
+ By the coupling argument in Theorem 1, this implies that the test risk is monotonic:
359
+
360
+ $$
361
+ \begin{array} { r l } & { \overline { { R } } ( \hat { \beta } _ { n + 1 , \lambda } ) - \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) } \\ & { \quad = \underset { ( \widetilde { \gamma } _ { 1 } , \dots , \widetilde { \gamma } _ { d } ) \sim \Gamma _ { n + 1 } } { \mathbb { E } } \left[ \displaystyle \sum _ { i = 1 } ^ { d } S ( \widetilde { \gamma } _ { i } ) \right] - \underset { ( \gamma _ { 1 } , \dots , \gamma _ { d } ) \sim \Gamma _ { n } } { \mathbb { E } } \left[ \displaystyle \sum _ { i = 1 } ^ { d } S ( \gamma _ { i } ) \right] } \\ & { \quad = \underset { ( \{ \widetilde { \gamma } _ { i } \} , \{ \gamma _ { i } \} ) \sim \Pi } { \mathbb { E } } \left[ \displaystyle \sum _ { i = 1 } ^ { d } S ( \widetilde { \gamma } _ { i } ) - S ( \gamma _ { i } ) \right] } \\ & { \quad \le 0 } \end{array}
362
+ $$
363
+
364
+ where $\Pi$ is the coupling. Line (17) follows from Equation (15), and the fact that the coupling obeys $\widetilde { \gamma } _ { i } \geq \gamma _ { i }$ . □
365
+
366
+ # A.2 PROJECTION MODEL PROOFS
367
+
368
+ Lemma 3. For all $\theta \in \mathbb { R } ^ { p }$ , $d , n \in \mathbb { N } ,$ , and $\lambda > 0 ;$ , let $\ b { X } \in \mathbb { R } ^ { n \times p }$ be a matrix with i.i.d. $\mathcal { N } ( 0 , 1 )$ entries. Let $P \in \mathbb { R } ^ { d \times p }$ be a random orthonormal matrix. Define $\widetilde { X } : = X P ^ { T }$ . Let $\left( \gamma _ { 1 } , \dots , \gamma _ { m } \right)$ be the singular values of the data matrix $\tilde { X } \in \mathbb { R } ^ { n \times d }$ , for $m : = \operatorname* { m a x } ( n , d )$ (with $\gamma _ { i } ~ = ~ 0$ for $i > \operatorname* { m i n } ( n , d ) )$ . Let $\Gamma _ { d }$ be the distribution of singular values $\left( \gamma _ { 1 } , \ldots , \gamma _ { m } \right)$ .
369
+
370
+ Then, the optimal ridge parameter is constant for all $d$ : $\begin{array} { r } { \lambda _ { d } ^ { \mathrm { o p t } } = \frac { p ^ { 2 } \widetilde \sigma ^ { 2 } } { d | | \theta | | _ { 2 } ^ { 2 } } } \end{array}$ . where we define $\widetilde { \sigma } ^ { 2 } : = \ :$ $\begin{array} { r } { \sigma ^ { 2 } + \frac { p - d } { p } | | \boldsymbol { \theta } | | _ { 2 } ^ { 2 } } \end{array}$ . Moreover, the optimal expected test risk can be written as
371
+
372
+ $$
373
+ \overline { { R } } ( \hat { \beta } _ { d } ^ { \mathrm { o p t } } ) = \widetilde { \sigma } ^ { 2 } + \underset { ( \gamma _ { 1 } , \ldots , \gamma _ { m } ) \sim \Gamma _ { d } } { \mathbb { E } } \left[ \sum _ { i = 1 } ^ { p } \frac { \widetilde { \sigma } ^ { 2 } } { \gamma _ { i } ^ { 2 } + \frac { \widetilde { \sigma } ^ { 2 } p ^ { 2 } } { d | | \theta | | _ { 2 } ^ { 2 } } } \right]
374
+ $$
375
+
376
+ Proof. This proof follows exactly analogously as the proof of Lemma 2 from Lemma 1, in Section A.1. □
377
+
378
+ Lemma 4. For all $\theta \in \mathbb { R } ^ { p }$ , $d , n \in \mathbb { N } ,$ , and $\lambda > 0$ , let $\ b { X } \in \mathbb { R } ^ { n \times p }$ be a matrix with i.i.d. $\mathcal { N } ( 0 , 1 )$
379
+ entries. Let $P \in \mathbb { R } ^ { d \times p }$ be a random orthonormal matrix. Define $\widetilde X : = X P ^ { T }$ and $\beta ^ { * } : = P \theta$ .
380
+
381
+ Let $\left( \gamma _ { 1 } , \dots , \gamma _ { m } \right)$ be the singular values of the data matrix $\tilde { X } \in \mathbb { R } ^ { n \times d }$ , for $m : = \operatorname* { m a x } ( n , d )$ (with $\gamma _ { i } = 0$ for $i > \operatorname* { m i n } ( n , d ) )$ . Let $\Gamma _ { d }$ be the distribution of singular values $\left( \gamma _ { 1 } , \dots , \gamma _ { m } \right)$ .
382
+
383
+ Then, the expected test risk is
384
+
385
+ $$
386
+ \begin{array} { r l } & { \overline { { R } } ( \hat { \beta } _ { d , \lambda } ) : = \underset { P } { \mathbb { E } } \underset { \widetilde { X } , \widetilde { y } \sim \mathcal { D } ^ { n } } { \mathbb { E } } [ R _ { P } ( \hat { \beta } _ { d , \lambda } ( \widetilde { X } , \overrightarrow { y } ) ] } \\ & { = \sigma ^ { 2 } + ( 1 - \frac { d } { p } ) | | \theta | | _ { 2 } ^ { 2 } } \\ & { + \underset { ( \gamma _ { 1 } , \dotsc , \gamma _ { m } ) \sim \Gamma _ { d } } { \mathbb { E } } \left[ \underset { i = 1 } { \overset { p } { \sum } } \frac { ( \sigma ^ { 2 } + \frac { p - d } { p } | | \theta | | _ { 2 } ^ { 2 } ) \gamma _ { i } ^ { 2 } + \frac { d } { p ^ { 2 } } | | \theta | | _ { 2 } ^ { 2 } \lambda ^ { 2 } } { ( \gamma _ { i } ^ { 2 } + \lambda ) ^ { 2 } } \right] } \end{array}
387
+ $$
388
+
389
+ Proof of Lemma 4. We first define the parameter that minimizes the population risk. It follows directly that:
390
+
391
+ $$
392
+ \beta _ { P } ^ { * } : = \underset { \beta \in \mathbb { R } ^ { d } } { \mathrm { a r g m i n } } R _ { P } ( \beta ) = P \theta
393
+ $$
394
+
395
+ First, we can expand the risk as
396
+
397
+ $$
398
+ \begin{array} { r l } & { R ( \hat { \beta } ) = \underset { ( \bar { x } , y ) \sim \mathcal { D } } { \mathbb { E } } [ ( \langle P x , \hat { \beta } \rangle - y ) ^ { 2 } ] } \\ & { \quad = \underset { ( \bar { x } , y ) \sim \mathcal { D } , \eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } ) } { \mathbb { E } } [ ( \langle x , P ^ { T } \hat { \beta } - \theta \rangle + \eta ) ^ { 2 } ] } \\ & { \quad = \sigma ^ { 2 } + \vert \vert \theta - P ^ { T } \hat { \beta } \vert \vert _ { 2 } ^ { 2 } } \\ & { \quad = \sigma ^ { 2 } + \vert \vert \theta - P ^ { T } \beta ^ { * } \vert \vert _ { 2 } ^ { 2 } + \vert \vert P ^ { T } \beta ^ { * } - P ^ { T } \hat { \beta } \vert \vert _ { 2 } ^ { 2 } } \\ & { \quad + 2 \langle ( \theta - P ^ { T } \beta ^ { * } ) , P ^ { T } \beta ^ { * } - P ^ { T } \hat { \beta } \rangle } \\ & { \quad = \sigma ^ { 2 } + \vert \vert \theta - P ^ { T } \beta ^ { * } \vert \vert _ { 2 } ^ { 2 } + \vert \vert P ^ { T } \beta ^ { * } - P ^ { T } \hat { \beta } \vert \vert _ { 2 } ^ { 2 } } \\ & { \quad = \sigma ^ { 2 } + \vert \vert \vert \theta - P ^ { T } P \theta \vert \vert _ { 2 } ^ { 2 } + \vert \vert \beta ^ { * } - \hat { \beta } \vert \vert _ { 2 } ^ { 2 } } \end{array}
399
+ $$
400
+
401
+ The cross terms in Line (22) vanish because the first-order optimality condition for $\beta ^ { * }$ implies that $\beta ^ { * }$ satisfies $P ( \theta ^ { * } - P ^ { T } \beta ^ { * } ) = 0$ . We now simplify each of the two remaining terms.
402
+
403
+ First, we have that:
404
+
405
+ $$
406
+ \underset { P } { \mathbb { E } } | | \theta - P ^ { T } P \theta | | _ { 2 } ^ { 2 } = ( 1 - \frac { d } { p } ) | | \theta | | _ { 2 } ^ { 2 }
407
+ $$
408
+
409
+ since $P ^ { T } P$ is an orthogonal projection onto a random $d$ -dimensional subspace.
410
+
411
+ Now, recall we have ${ \vec { y } } = X \theta + \eta$ where $\eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I _ { n } )$ . Expand this as:
412
+
413
+ $$
414
+ \begin{array} { l } { { \vec { y } = X \theta + \eta } } \\ { { \ = X P ^ { T } P \theta + X ( 1 - P ^ { T } P ) \theta + \eta } } \\ { { \ = \widetilde { X } \beta ^ { * } + \varepsilon + \eta } } \end{array}
415
+ $$
416
+
417
+ where $\varepsilon : = X ( 1 - P ^ { T } P ) \theta$ . Note that conditioned on $P$ , the three terms $\widetilde { X } , \varepsilon$ and $\eta$ are conditionally independent, since $P ^ { T } P$ and $( I - P ^ { T } P )$ project $X$ onto orthogonal subspaces. And further, $\varepsilon \sim$ $\mathcal { N } ( \dot { 0 _ { \cdot } } | | ( 1 - P ^ { T } P ) \theta | | ^ { 2 } I _ { n } )$ .
418
+
419
+ $$
420
+ \begin{array} { r l } & { \frac { \mathbb { E } } { P } \underset { \tilde { X } , y } { \mathbb { E } } | | \hat { \boldsymbol { \beta } } - \boldsymbol { \beta } ^ { * } | | _ { 2 } ^ { 2 } } \\ & { = \underset { P } { \mathbb { E } } \underset { \tilde { X } , y } { \mathbb { E } } | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \boldsymbol { y } - \boldsymbol { \beta } ^ { * } | | _ { 2 } ^ { 2 } } \\ & { = \underset { P } { \mathbb { E } } \underset { \tilde { X } , y , \varepsilon , \eta } { \mathbb { E } } | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } ( \widetilde { X } \boldsymbol { \beta } ^ { * } + \varepsilon + \eta ) - \boldsymbol { \beta } ^ { * } | | _ { 2 } ^ { 2 } } \\ & { = \underset { P } { \overset { \mathbb { E } } { \mathbb { X } } } \underset { y , \varepsilon , \eta } { \mathbb { E } } | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \widetilde { X } \boldsymbol { \beta } ^ { * } - \boldsymbol { \beta } ^ { * } | | _ { 2 } ^ { 2 } } \\ & { = \underset { P } { \overset { \mathbb { E } } { \mathbb { X } } } \underset { y , \varepsilon , \eta } { \mathbb { E } } | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \widetilde { X } \boldsymbol { \beta } ^ { * } - \boldsymbol { \beta } ^ { * } | | _ { 2 } ^ { 2 } } \\ & { + \| ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \varepsilon | | _ { 2 } ^ { 2 } + | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \eta | | _ { 2 } ^ { 2 } ] } \end{array}
421
+ $$
422
+
423
+ Now, since $\widetilde { X }$ is conditionally independent of $\varepsilon$ conditioned on $P$ ,
424
+
425
+ $$
426
+ \begin{array} { r l } & { \frac { \mathbb { E } } { F } \underset { \tilde { X } , y , \varepsilon | P } { \mathbb { E } } \ \lVert ( \tilde { X } ^ { T } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { T } \varepsilon \rVert _ { 2 } ^ { 2 } } \\ & { = \mathbb { E } \ \underset { \tilde { Y } } { \mathbb { E } } \ [ \lVert ( \tilde { X } ^ { T } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { T } \rVert _ { F } ^ { 2 } \ \underset { \varepsilon | P } { \mathbb { E } } [ \lVert \varepsilon \rVert _ { 2 } ^ { 2 } ] } \\ & { = \frac { \mathbb { E } } { \frac { \mathbb { E } } { \tilde { X } } } \lVert ( \tilde { X } ^ { T } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { T } \rVert _ { F } ^ { 2 } \ \underset { \varepsilon , \varepsilon } { \mathbb { E } } [ \lVert \varepsilon \rVert _ { 2 } ^ { 2 } ] } \\ & { = \underset { \tilde { X } } { \mathbb { E } } [ \lVert ( \tilde { X } ^ { T } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { T } \rVert _ { F } ^ { 2 } ] \cdot \underset { { P } , X } { \mathbb { E } } [ \lVert X ( 1 - P ^ { T } P ) \theta \rVert _ { 2 } ^ { 2 } ] } \\ & { = \underset { \tilde { X } } { \mathbb { E } } [ \lVert ( \tilde { X } ^ { T } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { T } \rVert _ { F } ^ { 2 } ] ( \frac { p - d } { p } | \theta \rVert _ { 2 } ^ { 2 } ) } \end{array}
427
+ $$
428
+
429
+ where Line (37) holds because the marginal distribution of $\widetilde { X }$ does not depend on $P$ .
430
+
431
+ Similarly,
432
+
433
+ $$
434
+ \begin{array} { r l } & { \frac { \mathbb { E } } { P } \underset { \widetilde { X } , y , \eta | P } { \mathbb { E } } | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } \eta | | _ { 2 } ^ { 2 } } \\ & { = \sigma ^ { 2 } \underset { \widetilde { X } } { \mathbb { E } } [ | | ( \widetilde { X } ^ { T } \widetilde { X } + \lambda I ) ^ { - 1 } \widetilde { X } ^ { T } | | _ { F } ^ { 2 } ] } \end{array}
435
+ $$
436
+
437
+ Now let $\tilde { \cal X } \ = \ { \cal U } \Sigma { \cal V } ^ { T }$ be the full singular value decomposition of $\widetilde { X }$ , with $U \ \in \ \mathbb { R } ^ { n \times n } , \Sigma \ \in$ $\mathbb { R } ^ { n \times d } , V \in \mathbb { R } ^ { d \times d }$ . Let $( \gamma _ { 1 } , \dots \gamma _ { m } )$ denote the singular values, where $m = \operatorname* { m a x } ( n , d )$ and defining $\gamma _ { i } = 0$ for $i > \operatorname* { m i n } ( n , d )$ .
438
+
439
+ Observe that by symmetry, $\widetilde { X } = X P ^ { T }$ and $P$ are independent, because the joint distribution $( \widetilde { X } , P )$ is equivalent to the distribution $( \widetilde { X } Q , P Q )$ for a random orthonormal $Q \in \mathbb { R } ^ { p \times p }$ . Thus $\widetilde { X }$ and
440
+
441
+ $\beta ^ { * } = P \theta$ are also independent, and we have:
442
+
443
+ $$
444
+ \begin{array} { r l } & { \mathbb { E } \mathbb { E } \| \{ \hat { X } ^ { \prime } \} \hat { X } + \lambda \mathcal { I } \} ^ { - 1 } \hat { X } ^ { \prime } \hat { X } ^ { \prime } - \delta ^ { * } \} \| _ { 2 } ^ { 2 } } \\ & { = \frac { 1 } { b } \mathbb { E } \hat { X } ^ { \prime } \| \mathrm { H i s s } ( \hat { \mathcal { Z } } _ { \frac { e } { 2 } } ^ { - 1 } \lambda ) b ^ { \mathcal { N } / 2 } \| _ { 2 } ^ { 2 } } \\ & { = \mathbb { E } \mathbb { E } \mathbb { E } \mathbb { E } \mathbb { E } \bigg [ \| \mathrm { H i s s } ( \hat { \mathcal { Z } } _ { \frac { e } { 2 } } ^ { - 1 } \lambda ) \| ^ { \mathcal { N } / 2 } b ^ { \mathcal { N } / 2 } \| _ { 2 } ^ { 2 } } \\ & { - \mathbb { E } \mathbb { E } \mathbb { E } \mathbb { E } \bigg [ \| \mathrm { H i s s } ( \hat { \mathcal { Z } } _ { \frac { e } { 2 } } ^ { - 1 } \lambda ) \| ^ { \mathcal { N } / 2 } \bigg ] \| _ { 2 } ^ { 2 } } \\ & { = \mathbb { E } _ { \hat { X } ^ { \prime } \sim \mathrm { N } \times \mathrm { W } ( \hat { \mathcal { Z } } ) } \mathbb { E } \| \mathrm { H i s s } ( \hat { \mathcal { Z } } _ { \frac { e } { 2 } } ^ { - 1 } \lambda ) \| ^ { \mathcal { N } / 2 } } \\ & { = \mathbb { E } \mathbb { E } \| \hat { X } ^ { \prime } \| ^ { 2 } \mathbb { E } \| \mathrm { H } ^ { 2 } \mathbb { E } \bigg [ \mathrm { H } _ { \frac { e } { 2 } } ^ { - 1 } \lambda \Big ] ^ { \| \mathcal { N } / 2 } } \\ & { = \frac { 1 } { b } \mathbb { E } \hat { X } ^ { \prime } \| ^ { 2 } \mathbb { E } \bigg [ \mathcal { P } _ { \frac { e } { 2 } } ^ { - 1 } \frac { \lambda ^ { 2 } } { b } \Big ] ^ { 2 } } \\ & = \frac { 1 } { b } \mathbb { E } \frac { \hat { X } ^ { \prime } } { \| \mathcal { P } \| \mathcal { P } \| ^ { 2 } \| _ { 2 } ^ { 2 } } \mathbb { E } \bigg [ \int _ { 0 } ^ { \mathcal { N } / 2 } \frac { \lambda ^ { 2 } } \| \mathcal { P } \| _ { 2 } ^ { 2 } \end{array}
445
+ $$
446
+
447
+ Finally, continuing from Line (33), we can use Lines (38), (40), and (47) to write:
448
+
449
+ $$
450
+ \begin{array} { r l } & { \frac { \mathbb { E } } { \rho } \frac { \| \tilde { \rho } - \tilde { \rho } ^ { - 1 } \| ^ { 2 } } { \mathcal { F } _ { x , y } } } \\ & { = ( \sigma ^ { 2 } + \frac { \rho - \tilde { \rho } - d } { p } \| \theta \| _ { 2 } ^ { 2 } \frac { \mathbb { E } \| ( \tilde { X } ^ { \mathcal { T } } \tilde { X } + \lambda I ) ^ { - 1 } \tilde { X } ^ { \mathcal { T } } \| _ { \mathcal { F } _ { x } ^ { 1 } } ^ { 2 } } { \mathcal { F } _ { x } ^ { 1 } } } \\ & { + \frac { d } { \gamma } \| \theta \| _ { 2 } ^ { 2 } \frac { \mathbb { E } } { \varepsilon } \| \sum _ { i } ^ { 2 } \frac { \lambda ^ { 2 } } { ( \sqrt { d } ^ { 2 } + \lambda I ) ^ { 2 } } | } \\ & { = ( \sigma ^ { 2 } + \frac { p - d } { p } \| \theta \| _ { 2 } ^ { 2 } ) \frac { \mathbb { E } } { \Sigma } \frac { \gamma ^ { 2 } } { \varepsilon } \langle \frac { \eta _ { i } ^ { 2 } } { ( \sqrt { d } ^ { 2 } + \lambda I ) ^ { 2 } } | } \\ & { + \frac { d } { \gamma ^ { 2 } } \| \theta \| _ { 2 } ^ { 2 } \frac { \mathbb { E } } { \Sigma } \frac { \lambda ^ { 2 } } { \langle \frac { \eta _ { i } ^ { 2 } + \lambda I \rangle ^ { 2 } } { \varepsilon } } | } \\ & = \frac { \mathbb { E } } { \nu } \langle \frac { ( \sigma ^ { 2 } + \frac { p - d - \tilde { \rho } - \tilde { \rho } - \tilde { \rho } - \tilde { \rho } } { i } ) | \theta \rangle _ { 2 } ^ { 2 } \sqrt { \frac { \lambda ^ { 2 } } { \varepsilon } + \frac { d } { \gamma ^ { 2 } } | \theta | _ { 2 } ^ { 2 } \lambda ^ { 2 } } } \end{array}
451
+ $$
452
+
453
+ Now, we can continue from Line (24), and apply lines (25), to conclude:
454
+
455
+ $$
456
+ \begin{array} { r l } & { \mathbb { E } \big [ R ( \hat { \beta } ) \big ] = \sigma ^ { 2 } + \mathbb { E } [ | | \theta - P ^ { T } P \theta | | _ { 2 } ^ { 2 } ] + \mathbb { E } [ | | \beta ^ { * } - \hat { \beta } | | _ { 2 } ^ { 2 } ] } \\ & { \qquad = \sigma ^ { 2 } + ( 1 - \frac { d } { p } ) | | \theta | | _ { 2 } ^ { 2 } } \\ & { \qquad + \mathbb { E } \left[ \displaystyle \sum _ { i = 1 } ^ { p } \frac { \big ( \sigma ^ { 2 } + \frac { p - d } { p } | | \theta | | _ { 2 } ^ { 2 } \big ) \gamma _ { i } ^ { 2 } + \frac { d } { p ^ { 2 } } | | \theta | | _ { 2 } ^ { 2 } \lambda ^ { 2 } } { \big ( \gamma _ { i } ^ { 2 } + \lambda \big ) ^ { 2 } } \right] } \end{array}
457
+ $$
458
+
459
+ Proof of Theorem 3. This follows analogously to the proof of Theorem 1, Let $\widetilde { X } _ { d }$ and $\widetilde { X } _ { d + 1 }$ be the observed data matrices for $d$ and $d + 1$ e emodel size. As in Theorem 1, there exists a coupling $\Pi$ between the distributions $\Gamma _ { d }$ and $\Gamma _ { d + 1 }$ of the singular values of $\widetilde { X } _ { d }$ and $\widetilde { X } _ { d + 1 }$ such that these singular values are interlaced.
460
+
461
+ Thus by Lemma 3,
462
+
463
+ $$
464
+ \begin{array} { l } { \overline { { R } } ( \hat { \beta } _ { d } ^ { \mathrm { o p t } } ) = \widetilde { \sigma } ^ { 2 } + \underset { ( \gamma _ { 1 } , \ldots , \gamma _ { m } ) \sim \Gamma _ { d + 1 } } { \mathbb { E } } \left[ \overset { p } { \underset { i = 1 } { \sum } } \frac { \widetilde { \sigma } ^ { 2 } } { \gamma _ { i } ^ { 2 } + \frac { \widetilde { \sigma } ^ { 2 } p ^ { 2 } } { d | \boldsymbol { \theta } | | _ { 2 } ^ { 2 } } } \right] } \\ { \geq \widetilde { \sigma } ^ { 2 } + \underset { ( \widetilde { \gamma } _ { 1 } , \ldots , \widetilde { \gamma } _ { m } ) \sim \Gamma _ { d + 1 } } { \mathbb { E } } \left[ \overset { p } { \underset { i = 1 } { \sum } } \frac { \widetilde { \sigma } ^ { 2 } } { \widetilde { \gamma } _ { i } ^ { 2 } + \frac { \widetilde { \sigma } ^ { 2 } p ^ { 2 } } { d | \boldsymbol { \theta } | | _ { 2 } ^ { 2 } } } \right] } \\ { = \overline { { R } } ( \hat { \beta } _ { d + 1 } ^ { \mathrm { o p t } } ) } \end{array}
465
+ $$
466
+
467
+ # A.3 NONISOTROPIC REDUCTION
468
+
469
+ Here we observe that results on isotropic regression in Section 2 also imply that ridge regression can be made sample-monotonic even for non-isotropic covariates, if an appropriate regularzier is applied. Specifically, the regularizer depends on the covariance on the inputs. This follows from a general equivalence between the non-isotropic and isotropic problems.
470
+
471
+ Lemma 5. For all $n \in \mathbb { N } , d \in \mathbb { N } , \lambda \in \mathbb { R } , \sigma \in \mathbb { R } ,$ covariance $\Sigma \in \mathbb { R } ^ { d \times d }$ , PSD matrix $M \in \mathbb { R } ^ { d \times d }$ and ground-truth $\beta ^ { * } \in \mathbb { R } ^ { d }$ , the following holds.
472
+
473
+ Consider the following two problems:
474
+
475
+ 1. Regularized regression on isotropic covariates, and an $M$ -regularizer. That is, suppose $n$ samples $( x , y )$ are drawn with covariates $x \sim \mathcal { N } ( 0 , I _ { d } )$ and response $y = \langle \beta ^ { * } , x \rangle +$ $\mathcal { N } ( 0 , \bar { \sigma } ^ { 2 } )$ . Let $\ b { \hat { X } } \in \mathbb { R } ^ { n \times d }$ be the matrix of covariates, and $\vec { y }$ the vector of responses. Consider
476
+
477
+ $$
478
+ { \hat { \beta } } _ { \lambda } : = \operatorname * { a r g m i n } _ { \beta } | | X \beta - { \vec { y } } | | _ { 2 } ^ { 2 } + \lambda | | \beta | | _ { M } ^ { 2 }
479
+ $$
480
+
481
+ Let $\overline { { R } } = \mathbb { E } _ { X , y } [ | | \hat { \beta } - \beta ^ { * } | | _ { 2 } ^ { 2 } ] + \sigma ^ { 2 }$ be the expected test risk of the above estimator.
482
+
483
+ 2. Regularized regression with covariance $\Sigma$ , and an $( \Sigma ^ { 1 / 2 } M \Sigma ^ { 1 / 2 } )$ -regularizer. That is, suppose $n$ samples $( \widetilde { x } , y )$ are drawn with covariates $\widetilde { x } \sim \mathcal { N } ( 0 , \Sigma )$ and response $y =$ $\langle z ^ { \ast } , \widetilde { x } \rangle + \mathcal { N } ( 0 , \widetilde { \sigma } ^ { 2 } )$ e, for
484
+
485
+ $$
486
+ z ^ { * } = \Sigma ^ { - 1 / 2 } \beta ^ { * }
487
+ $$
488
+
489
+ Let $\widetilde { X } \in \mathbb { R } ^ { n \times d }$ be the matrix of covariates, and $\vec { y }$ the vector of responses. Consider
490
+
491
+ $$
492
+ \hat { z } _ { \lambda } : = \operatorname * { a r g m i n } _ { z } | | \widetilde { X } z - \vec { y } | | _ { 2 } ^ { 2 } + \lambda | | z | | _ { \Sigma ^ { 1 / 2 } M \Sigma ^ { 1 / 2 } } ^ { 2 }
493
+ $$
494
+
495
+ Let $\widetilde { R } = \mathbb { E } _ { \widetilde { X } , y } [ | | \hat { z } - z ^ { * } | | _ { \Sigma } ^ { 2 } ] + \sigma ^ { 2 }$ be the expected test risk of the above estimator.
496
+
497
+ Then, the expected test risks of the above two problems are identical:
498
+
499
+ $$
500
+ \overline { { R } } = \widetilde { R }
501
+ $$
502
+
503
+ Proof of Lemma 5. The distribution of $\widetilde { X }$ in the Problem 2 is equivalent to $X \Sigma ^ { 1 / 2 }$ , where $X$ is as in Problem 1. Thus, the two settings are equivalent by the change-of-variable $\beta = \Sigma ^ { 1 / 2 } z$ . Specifically,
504
+
505
+ $$
506
+ \begin{array} { r l } & { \hat { z } _ { \lambda } : = \underset { z } { \mathrm { a r g m i n } } \left| \lvert \tilde { X } z - \bar { y } \rvert \right| _ { 2 } ^ { 2 } + \lambda \lvert | z \rvert | _ { \Sigma ^ { 1 / 2 } M \Sigma ^ { 1 / 2 } } ^ { 2 } } \\ & { = \underset { z } { \mathrm { a r g m i n } } \left| \lvert X \Sigma ^ { 1 / 2 } z - \bar { y } \rvert \right| _ { 2 } ^ { 2 } + \lambda z ^ { T } \Sigma ^ { 1 / 2 } M \Sigma ^ { 1 / 2 } z } \\ & { = \underset { z } { \mathrm { a r g m i n } } \left| \lvert X \Sigma ^ { 1 / 2 } z - \bar { y } \rvert \right| _ { 2 } ^ { 2 } + \lambda z ^ { T } \Sigma ^ { 1 / 2 } M \Sigma ^ { 1 / 2 } z } \\ & { = \Sigma ^ { - 1 / 2 } \underset { \beta = \Sigma ^ { 1 / 2 } z } { \mathrm { a r g m i n } } \left| \lvert X \beta - \bar { y } \rvert \right| _ { 2 } ^ { 2 } + \lambda \beta ^ { T } M \beta } \end{array}
507
+ $$
508
+
509
+ Further, the response $\langle z ^ { * } , { \widetilde { x } } \rangle = \langle \beta , x \rangle$ , and the test risk transforms identically:
510
+
511
+ $$
512
+ \begin{array} { r } { \widetilde { R } = \underset { \widetilde { X } , y } { \mathbb { E } } \left[ \vert \vert \hat { z } - z ^ { * } \vert \vert _ { \Sigma } ^ { 2 } \right] + \sigma ^ { 2 } } \\ { = \underset { X , y } { \mathbb { E } } \left[ \vert \vert \hat { \beta } - \beta ^ { * } \vert \vert _ { 2 } ^ { 2 } \right] + \sigma ^ { 2 } } \\ { = \overline { { R } } } \end{array}
513
+ $$
514
+
515
+ This implies that if the covariance $\Sigma$ is known, then ridge regression with a $\Sigma ^ { - 1 }$ regularizer is sample-monotonic.
516
+
517
+ Theorem 5. For all $n \in \mathbb { N } , d \in \mathbb { N } , \sigma \in \mathbb { R } ,$ , covariance $\Sigma \in \mathbb { R } ^ { d \times d }$ , and ground-truths $\beta ^ { * } \in \mathbb { R } ^ { d }$ , th e following holds.
518
+
519
+ Suppose $n$ samples $( x , y )$ are drawn with covariates $x \sim \mathcal { N } ( 0 , \Sigma )$ and response $y = \langle \beta ^ { * } , x \rangle +$ ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } )$ . Let $\ b { X } \in \mathbb { R } ^ { n \times d }$ be the matrix of covariates, and $\vec { y }$ the vector of responses. For $\lambda > 0$ , consider the ridge regression estimator with $\Sigma ^ { - 1 }$ -regularizer:
520
+
521
+ $$
522
+ \hat { \beta } _ { n , \lambda } : = \operatorname * { a r g m i n } _ { \boldsymbol { \beta } } \| X \boldsymbol { \beta } - \vec { y } \| _ { 2 } ^ { 2 } + \lambda \| \boldsymbol { \beta } \| _ { \Sigma ^ { - 1 } } ^ { 2 }
523
+ $$
524
+
525
+ Let $\overline { { R } } ( \hat { \beta } _ { n , \lambda } ) : = \mathbb { E } _ { \hat { \beta } } \| \hat { \beta } - \beta ^ { * } \| _ { \Sigma } + \sigma ^ { 2 }$ be the expected test risk of the above estimator. Let $\lambda _ { n } ^ { \mathrm { o p t } }$ be the optimal ridge parameter (that achieves the minimum expected risk) given $n$ samples:
526
+
527
+ $$
528
+ \lambda _ { n } ^ { \mathrm { o p t } } : = \operatorname * { a r g m i n } _ { \lambda } \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) )
529
+ $$
530
+
531
+ And let $\hat { \beta } _ { n } ^ { \mathrm { { o p t } } }$ be the estimator that corresponds to the $\lambda _ { n } ^ { \mathrm { o p t } }$ . Then, the expected test risk of optimallyregularized linear regression is monotonic in samples:
532
+
533
+ $$
534
+ \overline { { R } } ( \hat { \beta } _ { n + 1 } ^ { \mathrm { o p t } } ) \leq \overline { { R } } ( \hat { \beta } _ { n } ^ { \mathrm { o p t } } )
535
+ $$
536
+
537
+ Proof. This follows directly by applying the reduction in Lemma 5 for $M = I _ { d }$ to reduce to the isotropic case, and then applying the monotonicity of isotropic regression from Theorem 1. □
538
+
539
+ # A.4 ADDITIONAL PLOTS
540
+
541
+ We apply random features to Fashion-MNIST Xiao et al. (2017), an image classification problem with 10 classes. Input images $x \in \mathbb { R } ^ { d }$ are normalized and flattened to $[ - \bar { 1 } , 1 ] ^ { d }$ for $d = 7 8 4$ . Class labels are encoded as one-hot vectors $y \in \{ \vec { e _ { 1 } } , \dots e _ { 1 0 } ^ { } \} \subset \mathbb { R } ^ { 1 0 }$ .
542
+
543
+ # B TOWARDS MONOTONICITY WITH GENERAL COVARIATES
544
+
545
+ Here we investigate whether monotonicity provably holds in more general models, inspired by the experimental results. As a first step, we consider Gaussian (but not isotropic) covariances and homeostatic noise. That is, we consider ridge regression in the setting of Section 2, but with $x \sim \mathcal { N } ( 0 , \Sigma )$ , and $y \sim \langle x , \beta ^ { * } \rangle + N ( 0 , \sigma ^ { 2 } )$ . In this section, we observe that ridge regression can be made sample-monotonic with a modified regularizer. We also conjecture that ridge regression is sample-monotonic without modifying the regularizer, and we outline a potential proof strategy along with numerical evidence.
546
+
547
+ # B.1 ADAPTIVE REGULARIZATION
548
+
549
+ The results on isotropic regression in Section 2 imply that ridge regression can be made samplemonotonic even for non-isotropic covariates, if an appropriate regularizer is applied. Specifically, the appropriate regularizer depends on the covariance of the inputs. For $\boldsymbol { x } \sim \mathcal { N } ( 0 , \Sigma )$ , the following estimator is sample-monotonic for optimally-tuned $\lambda$ : $\begin{array} { r } { \hat { \beta } _ { n , \lambda } : = \operatorname * { a r g m i n } _ { \boldsymbol { \beta } } \| X \boldsymbol { \beta } - \vec { y } \| _ { 2 } ^ { 2 } + \lambda \| \boldsymbol { \beta } \| _ { \Sigma ^ { - 1 } } ^ { 2 } } \end{array}$ . This follows directly from Theorem 1 by applying a change-of-variable; full details of this equivalence are in Section A.3. Note that if the population covariance $\Sigma$ is not known, it can potentially be estimated from unlabeled data.
550
+
551
+ ![](images/6d706f197addd390fb2defce66fd1cd5af413a8242fbc58ab89186d03af9186f.jpg)
552
+ Test Error for Regularized Random Features
553
+
554
+ (a) Test Classification Error vs. Number of Training Samples.
555
+
556
+ ![](images/ce3f799d5bd5415e26ca617c4e47e654875a8b6c2557b5bf3b3c7007b6a14a4f.jpg)
557
+ Test Errorfor Regularized Random Features
558
+ (b) Test Classification Error vs. Model Size (Number of Random Features).
559
+
560
+ Figure 4: Double-descent for Random ReLU Features. Test classification error as a function of model size and sample size for Random ReLU Features on Fashion-MNIST. Left: with $D = 5 0 0$ features. Right: with $n = 5 0 0$ samples. See Figures 7, 8 for the corresponding test Mean Squared Error. See Appendix D of Nakkiran et al. (2020) for the performance of these unregularized models plotted across Num. Samples $\times$ Model Size simultaneously.
561
+
562
+ ![](images/05df2a46592e323dc1205edaa5fa11d2355d7bba6df96212a7b9f700cd4a121b.jpg)
563
+ Figure 5: Train Error vs. Model Size for 5-layer CNNs on CIFAR-100, with $\ell _ { 2 }$ regularization (weight decay).
564
+
565
+ # B.2 TOWARDS PROVING MONOTONICITY
566
+
567
+ We conjecture that optimally-regularized ridge regression is sample-monotonic for non-isotropic covariates, even without modifying the regularizer (as suggested by the experiment in Figure 2). We derive a sufficient condition for monotonicity, which we have numerically verified in a variety of instances. Specifically, we conjecture the following.
568
+
569
+ Conjecture 1. For all $d \in \mathbb { N }$ , and all PSD covariances $\Sigma \in \mathbb { R } ^ { d \times d }$ , consider the distribution on $( x , y )$ where $x \sim \mathcal { N } ( 0 , \Sigma )$ , and $y \sim \langle x , \beta ^ { * } \rangle + \mathcal { N } ( 0 , \sigma ^ { 2 } )$ . Then, we conjecture that the expected test risk of the ridge regression estimator: $\begin{array} { r } { \hat { \beta } _ { n , \lambda } : = \operatorname * { a r g m i n } _ { \boldsymbol { \beta } } \| X { \boldsymbol { \beta } } - \vec { y } \| _ { 2 } ^ { 2 } + \lambda \| { \boldsymbol { \beta } } \| _ { 2 } ^ { 2 } } \end{array}$ for optimally-tuned $\lambda \geq 0$ , is monotone non-increasing in number of samples $n$ . That is, for all $n \in \mathbb { N }$ ,
570
+
571
+ $$
572
+ \operatorname * { i n f } _ { \lambda \geq 0 } \overline { { { R } } } ( \hat { \beta } _ { n + 1 , \lambda } ) \leq \operatorname * { i n f } _ { \lambda \geq 0 } \overline { { { R } } } ( \hat { \beta } _ { n , \lambda } )
573
+ $$
574
+
575
+ where we define $\begin{array} { r } { \hat { \beta } _ { n , 0 } : = \operatorname* { l i m } _ { \lambda \to 0 + } \hat { \beta } _ { n , \lambda } = X ^ { \dagger } y } \end{array}$ .
576
+
577
+ ![](images/d4048491df9a41611fd80fea0aeac569328ee316a77886c71b4c9d4ba9170d40.jpg)
578
+ Figure 6: Train MSE vs. Num. Samples for Non-Isotropic Ridge Regression in $d = 3 0$ dimensions, in the setting of Figure 2. Plotting train MSE: $\begin{array} { r } { \frac { 1 } { n } | | X \hat { \boldsymbol { \beta } } - \vec { y } | | _ { 2 } ^ { 2 } } \end{array}$ .
579
+
580
+ ![](images/aa84a8ffbd2beefb1d745ab29a4ccc613c56c1dfa1eef8d51380a0483dcffecb.jpg)
581
+ Figure 7: Test Mean Squared Error vs. Num Train Samples for Random ReLU Features on FashionMNIST, with $D = 5 0 0$ features.
582
+
583
+ In Appendix B.3 we present a technical conjecture in random matrix theory (Conjecture 2) which suffices to prove Conjecture 1. Proving this Conjecture 2 presents a number of technical challenges, but we have numerically verified it in a variety of cases. It can also be shown that Conjecture 2 is true when $Q = I$ , corresponding to isotropic covariates. We prove the reduction between Conjecture 2 and 1 in Appendix B.3.
584
+
585
+ # B.3 MONOTONICITY CONJECTURE PROOFS
586
+
587
+ In order to establish Conjecture 1, it is sufficient to prove the following technical conjecture.
588
+
589
+ ![](images/8eda0db61a5bd63cb07df9565b6981c5a80a7fd865e013f9ce281e419515418e.jpg)
590
+ Figure 8: Test Mean Squared Error vs. Num Features for Random ReLU Features on FashionMNIST, with $n = 5 0 0$ samples.
591
+
592
+ Conjecture 2. For all $n \in \mathbb { N } , d \geq n , \lambda > 0$ , symmetric positive definite matrix $Q \in \mathbb { R } ^ { d \times d }$ , the following holds.
593
+
594
+ Define
595
+
596
+ $$
597
+ G _ { \lambda } ^ { n } : = \lambda ^ { 2 } \underset { X } { \mathbb { E } } [ ( X ^ { T } X + \lambda Q ) ^ { - 2 } ]
598
+ $$
599
+
600
+ where $\ b { X } \in \mathbb { R } ^ { n \times d }$ is sampled with each entry i.i.d. $\mathcal { N } ( 0 , 1 )$ . Similarly, define
601
+
602
+ $$
603
+ H _ { \lambda } ^ { n } : = \mathbb { E } [ | | X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } | | _ { F } ^ { 2 } ]
604
+ $$
605
+
606
+ The expected test risk for $n$ samples can be expressed as:
607
+
608
+ $$
609
+ \overline { { { R } } } ( \hat { \beta } _ { n , \lambda } ) = ( \beta ^ { * } ) ^ { T } G _ { \lambda } ^ { n } \beta ^ { * } + \sigma ^ { 2 } H _ { \lambda } ^ { n } + \sigma ^ { 2 }
610
+ $$
611
+
612
+ Then, we conjecture that the following two conditions hold.
613
+
614
+ 1.
615
+
616
+ $$
617
+ G _ { \lambda } ^ { n } \succeq G _ { \lambda } ^ { n + 1 }
618
+ $$
619
+
620
+ 2.
621
+
622
+ $$
623
+ ( G _ { \lambda } ^ { n } - G _ { \lambda } ^ { n + 1 } ) - ( H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } ) \frac { d G _ { \lambda } ^ { n } / d \lambda } { d H _ { \lambda } ^ { n } / d \lambda } \succeq 0
624
+ $$
625
+
626
+ Lemma 6. Conjecture 2 implies Conjecture $^ { l }$
627
+
628
+ Proof. By the reduction in Section A.3, showing monotonicity for non-isotropic regression with an isotropic regularizer is equivalent to showing monotonicity for isotropic regression with a nonisotropic regularizer. Thus, we consider the latter. Specifically, Conjecture 1 is equivalent to showing monotonicity for the estimator
629
+
630
+ $$
631
+ \begin{array} { r l } { { \hat { \beta } _ { n , \lambda } : = \operatorname * { a r g m i n } _ { \beta } \| X \beta - \vec { y } \| _ { 2 } ^ { 2 } + \lambda \| \beta \| _ { \Sigma ^ { - 1 } } ^ { 2 } } } \\ & { = ( X ^ { T } X + \lambda \Sigma ^ { - 1 } ) ^ { - 1 } X ^ { T } y } \end{array}
632
+ $$
633
+
634
+ where $x \sim \mathcal { N } ( 0 , I )$ is isotropic, and $y \sim \langle x , \beta ^ { * } \rangle + \mathcal { N } ( 0 , \sigma ^ { 2 } )$ .
635
+
636
+ Now, letting $\boldsymbol { Q } : = \boldsymbol { \Sigma } ^ { - 1 }$ , the expected test risk of this estimator for $n$ samples is:
637
+
638
+ $$
639
+ \begin{array} { r l } & { \mathbb { E } [ \left. \hat { \beta } _ { n , \lambda } \right. = \underset { X , y } { \mathbb { E } } [ \left. \hat { \beta } _ { n , \lambda } - \beta ^ { * } \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { \quad = \underset { X , y } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } y - \beta ^ { * } \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { \quad = \underset { X , \eta = N ; 0 } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } ( X \beta ^ { * } + \eta ) - \beta ^ { * } \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { \quad = \underset { X , \eta = N ; 0 } { \mathbb { E } } [ ( 0 , \lambda ^ { 2 } Y ^ { T } \eta _ { n } ^ { 2 } ) ] \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } ( X \beta ^ { * } + \eta ) - \beta ^ { * } \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { \quad = \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } X \beta ^ { * } - \beta ^ { * } ) \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } \right. _ { F } ^ { 2 } ] + \sigma ^ { 2 } } \\ & { \quad = \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } ( X ^ { T } X + \lambda Q - \lambda Q ) \beta ^ { * } - \beta ^ { * } ) \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } \right. _ { F } ^ { 2 } ] } \\ & \quad = \lambda ^ { 2 } \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } \right. _ { 2 } ^ { 2 } ] + \sigma ^ { 2 } \underset { X } { \mathbb { E } } [ \left. ( X ^ { T } X + \lambda Q ) ^ { - 1 } X ^ { T } \right. _ { F } ^ { 2 } ] + \sigma \end{array}
640
+ $$
641
+
642
+ Consider the infimum
643
+
644
+ $$
645
+ \operatorname* { i n f } _ { \lambda \geq 0 } { \overline { { R } } } ( { \hat { \beta } } _ { n , \lambda } )
646
+ $$
647
+
648
+ We consider several cases below.
649
+
650
+ Case (1). Suppose the infimum in Equation 71 is achieved in the limit $\lambda \to + \infty$ . In this case, monotonicity trivially holds, since
651
+
652
+ $$
653
+ \operatorname* { l i m } _ { \lambda \to \infty } \overline { { { R } } } ( \hat { \beta } _ { n , \lambda } ) = \overline { { { R } } } ( \vec { 0 } ) = \operatorname* { l i m } _ { \lambda \to \infty } \overline { { { R } } } ( \hat { \beta } _ { n + 1 , \lambda } )
654
+ $$
655
+
656
+ Case (2). Suppose the infimum in Equation 71 is achieved by some $\lambda = \lambda _ { n } ^ { \mathrm { o p t } }$ in the interior of the set $( 0 , \infty )$ .
657
+
658
+ Because $\overline { { R } } ( \hat { \beta } _ { n , \lambda } )$ is continuous and differentiable in $\lambda$ for all $\lambda \in ( 0 , \infty )$ , we have that $\lambda _ { n } ^ { \mathrm { o p t } }$ must satisfy the following first-order optimality condition:
659
+
660
+ $$
661
+ \begin{array} { r } { \frac { d \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) } { d \lambda } \Big | _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } } = 0 } \\ { \implies ( \beta ^ { * } ) ^ { T } \frac { d G _ { \lambda } ^ { n } } { d \lambda } \beta ^ { * } + \sigma ^ { 2 } \frac { d H _ { \lambda } ^ { n } } { d \lambda } \Big | _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } } = 0 } \end{array}
662
+ $$
663
+
664
+ We will later use this condition to show monotonicity.
665
+
666
+ Case (3). Suppose the infimum in Equation 71 is achieved at $\lambda _ { n } ^ { \mathrm { o p t } } = 0$ . Recall, we define $\hat { \beta } _ { n , 0 } : =$ $\mathrm { l i m } _ { \lambda \to 0 + } \hat { \beta } _ { n , \lambda }$ . This means that,
667
+
668
+ $$
669
+ \frac { d \overline { { R } } ( \hat { \beta } _ { n , \lambda } ) } { d \lambda } \Big | _ { \lambda = 0 } = ( \beta ^ { * } ) ^ { T } \frac { d G _ { \lambda } ^ { n } } { d \lambda } \beta ^ { * } + \sigma ^ { 2 } \frac { d H _ { \lambda } ^ { n } } { d \lambda } \Big | _ { \lambda = 0 } \geq 0
670
+ $$
671
+
672
+ Note that since $\begin{array} { r } { \frac { d H _ { \lambda } ^ { n } } { d \lambda } \leq 0 } \end{array}$ , both Equations (73) and (74) in Case (2) and Case (3) respectively imply that
673
+
674
+ $$
675
+ \sigma ^ { 2 } \leq - \frac { ( \beta ^ { * } ) ^ { T } ( \frac { d G _ { \lambda } ^ { n } } { d \lambda } ) \beta ^ { * } } { d H _ { \lambda } ^ { n } / d \lambda } \Big \vert _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } }
676
+ $$
677
+
678
+ Now, assuming Conjecture 2, we will show that the choice of $\lambda _ { n } ^ { \mathrm { o p t } }$ in Cases (2) and (3) has nonincreasing test risk for $( n + 1 )$ samples. That is,
679
+
680
+ $$
681
+ \overline { { R } } ( \widehat { \beta } _ { n , \lambda _ { n } ^ { \mathrm { o p t } } } ) \geq \overline { { R } } ( \widehat { \beta } _ { n + 1 , \lambda _ { n } ^ { \mathrm { o p t } } } )
682
+ $$
683
+
684
+ This implies the desired monotonicity, since R(βˆn+1,λoptn ) ≥ R(βˆn+1,λoptn+1 ).
685
+
686
+ We first consider the case when $H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } | _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } } \geq 0$ . In this case, because $G _ { \lambda } ^ { n } - G _ { \lambda } ^ { n + 1 } \succeq 0$ by assumption, we have
687
+
688
+ $$
689
+ \begin{array} { r l r } { { \overline { { R } } ( \widehat { \beta } _ { n , \lambda _ { n } ^ { \mathrm { o p t } } } ) - \overline { { R } } ( \widehat { \beta } _ { n + 1 , \lambda _ { n } ^ { \mathrm { o p t } } } ) = ( \beta ^ { * } ) ^ { T } ( G _ { \lambda } ^ { n } - G _ { \lambda } ^ { n + 1 } ) \beta ^ { * } + \sigma ^ { 2 } ( H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } ) \Big | _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } } } } \\ & { } & { \geq 0 \quad \quad } \end{array}
690
+ $$
691
+
692
+ Otherwise, assume. $H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } | _ { \lambda = \lambda _ { n } ^ { \mathrm { o p t } } } \leq 0$ . Then we have:
693
+
694
+ $$
695
+ \begin{array} { r l } { \overline { { R } } ( \hat { \beta } _ { n , \lambda _ { n } ^ { \smash { \mathrm { o u t } } } } ) - \overline { { R } } ( \hat { \beta } _ { n + 1 , \lambda _ { n } ^ { \smash { \mathrm { o u t } } } } ) = ( \beta ^ { * } ) ^ { T } ( G _ { \lambda } ^ { m } - G _ { \lambda } ^ { m + 1 } ) \beta ^ { * } + \sigma ^ { 2 } ( H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } ) \Big | _ { \lambda = \lambda _ { n } ^ { \smash { \mathrm { o u t } } } } } & { \qquad \mathrm { ( } } \\ & { \qquad \geq ( \beta ^ { * } ) ^ { T } ( G _ { \lambda } ^ { m } - G _ { \lambda } ^ { m + 1 } ) \beta ^ { * } - ( \beta ^ { * } ) ^ { T } ( \frac { d G _ { \lambda } ^ { n } } { d \lambda } ) \beta ^ { * } \frac { ( H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } ) } { d H _ { \lambda } ^ { \lambda } / d \lambda } \Big | _ { \lambda = \lambda _ { n } ^ { \smash { \mathrm { o u t } } } } } \\ & { \qquad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { = ( \beta ^ { * } ) ^ { T } \underbrace { \Bigg ( ( G _ { \lambda } ^ { m } - G _ { \lambda } ^ { n + 1 } ) - ( H _ { \lambda } ^ { n } - H _ { \lambda } ^ { n + 1 } ) \frac { d G _ { \lambda } ^ { m } / d \lambda } { d H _ { \lambda } ^ { n } / d \lambda } \Big ) \Big | _ { \lambda = \lambda _ { n } ^ { \mathrm { o u t } } } \beta ^ { * } } _ { \geq 0 \mathrm { b y c o n j e c u r e 2 } } } \\ & { \qquad \quad \quad \quad \quad \quad \quad \quad \quad \geq 0 } \end{array}
696
+ $$
697
+
698
+ as desired.
md/train/9sF3n8eAco/9sF3n8eAco.md ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ALL-YOU-CAN-FIT 8-BIT FLEXIBLE FLOATINGPOINT FORMAT FOR ACCURATE AND MEMORYEFFICIENT INFERENCE OF DEEP NEURAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Modern deep neural network (DNN) models generally require a huge amount of weight and activation values to achieve good inference outcomes. Those data inevitably demand a massive off-chip memory capacity/bandwidth, and the situation gets even worse if they are represented in high-precision floating-point formats. Effort has been made for representing those data in different 8-bit floating-point formats, nevertheless, a notable accuracy loss is still unavoidable. In this paper we introduce an extremely flexible 8-bit floating-point (FFP8) format whose defining factors – the bit width of exponent/fraction field, the exponent bias, and even the presence of the sign bit – are all configurable. We also present a methodology to properly determine those factors so that the accuracy of model inference can be maximized. The foundation of this methodology is based on a key observation – both the maximum magnitude and the value distribution are quite dissimilar between weights and activations in most DNN models. Experimental results demonstrate that the proposed FFP8 format achieves an extremely low accuracy loss of $0 . 1 \% \sim 0 . 3 \%$ for several representative image classification models even without the need of model retraining. Besides, it is easy to turn a classical floating-point processing unit into an FFP8-compliant one, and the extra hardware cost is minor.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ With the rapid progress of deep neural network (DNN) techniques, innovative applications of deep learning in various domains, such as computer vision and natural language processing (NLP), are getting more mature and powerful (Huang et al., 2017; Vaswani et al., 2017; Szegedy et al., 2015; Howard et al., 2017; He et al., 2017; Krizhevsky et al., 2012).
12
+
13
+ To improve the model accuracy, one of the most commonly used strategies is to add more layers into a network, which inevitably increases the number of weight parameters and activation values of a model. Today, it is typical to store weights and activations in the 32-bit IEEE single-precision floating-point format (FP32). Those 32-bit data accesses thus become an extremely heavy burden on the memory subsystem in a typical edge or AIoT device, which often has very limited memory capacity and bandwidth. Even for high-end GPU or dedicated network processing unit (NPU) based computing platforms, off-chip DRAM bandwidth is still a major performance bottleneck.
14
+
15
+ To relieve the issue of memory bandwidth bottleneck, several attempts of various aspects have been made including (but not limited to) weight pruning (Li et al., 2017; Han et al., 2016), weight/activation quantization (Courbariaux et al., 2015; Hubara et al., 2017), and probably the most straightforward way: storing weights and activations in a shorter format (Koster et al., 2017). ¨ One trivial way to do so is to adopt the 16-bit IEEE half-precision floating-point format (FP16). An FP16 number consists of 1 sign bit, 5 exponent bits, and 10 fraction bits. In addition, Google proposed another 16-bit format, named Brain Floating-Point Format (BFP16), simply by truncating the lower half of the FP32 format (Kalamkar et al., 2019). Compared with FP16, BFP16 allows a significantly wider dynamic value range at the cost of 3-bit precision loss. Note that the exponent bias in all of the above formats is not a free design parameter. Conventionally, the value is solely determined by the exponent size. For example, for FP16 with 5-bit exponent, the exponent bias is automatically fixed to 15 $^ { \prime } ( 2 ^ { 5 - 1 } - 1 )$ .
16
+
17
+ To make the data even shorter, 8-bit fixed-point signed/unsigned integer formats (INT8 and UINT8) are also broadly adopted. However, the 8-bit fixed-point format inherently has a narrower dynamic value range so that the model accuracy loss is usually not negligible even after extra symmetric or asymmetric quantization. As a consequence, there are a number of attempts concentrating on utilizing mixed-precision or pure 8-bit floating-point numbers in deep learning applications.
18
+
19
+ Various techniques have been developed for mixed-precision training (Banner et al., 2018; Micikevicius et al., 2018; Das et al., 2018; Zhou et al., 2016). Moreover, recent studies proposed several training frameworks that produces weights only in 8-bit floating-point formats (Wang & Choi, 2018; Cambier et al., 2020; Sun et al., 2019). In these studies, the underlying 8-bit floating-point numbers in training and inference are represented in the format of FP8(1, 5, 2) or FP8(1, 4, 3), where the enclosed three parameters indicate the bit length of sign, exponent, and fraction, respectively. Note that 4 or 5 bits are essential for the exponent in their frameworks, or the corresponding dynamic range may not cover both weight and activation values well. Consequently, only 2 or 3 bits are available for fraction, which inevitably leads to lower accuracy.
20
+
21
+ In this paper, we present an extremely flexible 8-bit floating-point (FFP8) number format. In FFP8, all parameters – the bit width of exponent/fraction, the exponent bias, and the presence of the sign bit – are configurable. Three major features of our inference methodology associated with the proposed FFP8 format are listed as follows. First, it is observed that both the maximum magnitude and the value distribution are quite dissimilar between weights and activations in most DNNs. It suggests the best exponent size and exponent bias for weights should be different from those for activations to achieve higher accuracy. Second, a large set of commonly-used activation functions always produce nonnegative outputs (e.g., ReLU). It implies that activations are actually unsigned if one of those activation functions is in use. Hence, it implies the sign bit is not required for those activations, which makes either exponent or fraction 1-bit longer. Note that even one bit can make a big impact since only 8 bits are available. Third, all aforementioned studies require their own sophisticated training frameworks to produce 8-bit floating-point models. Our flow does not. Our flow simply takes a model generated by any conventional FP32 training framework as the input. Then, it simply converts the given pre-trained FP32 model into an FFP8 model.
22
+
23
+ The rest of this paper is organized as follows. Section 2 briefly introduces related work. In Section 3, we elaborate more on the proposed FFP8 format and how to properly convert a pre-trained FP32 model into an FFP8 one. Section 4 demonstrates the experimental results on various DNN models. The system and hardware design issues for the support of FFP8 numbers are discussed in Section 5. Finally, the concluding remarks are given in Section 6.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ DNNs are becoming larger and more complicated, which means they require a bigger memory space and consume more energy during inference. As a result, it is getting harder to deploy them on systems with limited memory capacity and power budget (e.g., edge devices). (Han et al., 2016; Zhao et al., 2020; Horowitz, 2014) also demonstrated that off-chip DRAM access is responsible for a significantly big share of system power consumption. Hence, it remains an active research topic about how to reduce the memory usage for weights and activations. As mentioned in the previous section, one way to do so is to use short 8-bit floating-point number formats.
28
+
29
+ Wang & Choi (2018) introduced a DNN training methodology using 8-bit floating-point numbers in FP8(1, 5, 2) format. The methodology features chunk-based accumulation and stochastic rounding methods for accuracy loss minimization. Besides, to achieve a better trade-off between precision and dynamic range during model training, Sun et al. (2019) proposed an improved methodology that utilizes two different 8-bit floating-point formats $- \operatorname { F P 8 } ( 1 , 4 , 3 )$ for forward propagation and $\mathrm { F P } 8 ( 1 , 5 , 2 )$ for backward propagation. Nevertheless, both methodologies fail to make a DNN model entirely in 8-bit numbers: the first and the last layers of the given model are still in 16-bit floating-point numbers; otherwise, the model suffers about $2 \%$ accuracy degradation. Cambier et al. (2020) then proposed the S2FP8 format, which allows a DNN model represented in 8-bit floating point numbers completely. By adding a scaling factor and a shifting factor, data can thus be well represented in $\mathrm { F P } 8 ( 1 , 5 , 2 )$ after proper shifting and squeezing operations, which eliminates the need of 16-bit floating point numbers. However, the S2FP8 format still results in about $1 \%$ accuracy drop in ResNet-50 (He et al., 2018).
30
+
31
+ ![](images/a4ce14514a2f36bf632014b4a5f9b2fc8fa4038370d1f491a4f9b8da40b70b60.jpg)
32
+ Figure 1: Various floating-point formats: (a) conventional ones, and (b) the proposed FFP8 format
33
+
34
+ # 3 FLEXIBLE 8-BIT FLOATING-POINT (FFP8) FORMAT
35
+
36
+ # 3.1 DEFINITION OF THE FFP8 FORMAT
37
+
38
+ In this subsection, a flexible 8-bit floating-point (FFP8) format, which leads to more accurate inference outcomes of deep neural networks, is presented. A typical floating-point format consists of sign (s), exponent (e), and fraction $( f )$ fields, and the bit length of each field is specified as $x , y , z$ , respectively. Besides, one more parameter, exponent bias $( b )$ , is required to completely specify a floating-point number. Conventionally, $b$ is always implicitly set to $2 ^ { \overset { \cdot } { y } - 1 } - 1$ . In this paper, an $n$ -bit floating-point format is denoted as $( x , y , z , b )$ or $( x , y , z )$ , where $n = x + y + z$ . If $b$ is missing, the default value is implicitly used.
39
+
40
+ Figure 1(a) illustrates one 16-bit FP16 format and two commonly used 8-bit formats: (1, 5, 2, 15) and (1, 4, 3, 7). Note that there is actually only one parameter, the bit width of the exponent $( y )$ , that can be freely chosen when defining a new $n$ -bit conventional floating-point format since $x$ is always 1, $z$ is always $n - y - 1$ , and $b$ is always $2 ^ { y - 1 } - 1$ . The above fact motivated us to think out-of-the-box and thus develop a more flexible format, named flexible 8-bit floating-point (FFP8) format and shown in Figure 1(b). In addition to the size of exponent $( y )$ , the FFP8 format offers two more parameters. First, the exponent bias $( b )$ is not necessarily equal to $2 ^ { y - 1 } - 1$ and can be set to any integer, which helps cover the value distributions of both weights and activations well in a shorter exponent size $( y )$ . Second, the sign bit is present or not (i.e., $x$ can be 0 or 1). Without the sign bit $( x = 0$ ), unsigned activations can be better represented in higher precision. To be more precise, there are only two restrictions on an $n$ -bit FFP8 format: 1) $x + y + z = n ;$ 2) $x$ must be 0 or 1. Next, we are about to show how the proposed FFP8 format improves the inference accuracy.
41
+
42
+ # 3.2 WEIGHT DISTRIBUTION AND THE WAYS VARIOUS 8-BIT FORMATS COPE WITH IT
43
+
44
+ Overall speaking, the magnitudes of weights in most DNN models are usually small. Take a popular image classification model VGG-16 (Simonyan & Zisserman, 2015) as an example, the maximum magnitude of weights in the whole model is less than 2. Figure 2 gives the overall weight distribution (in log scale) of VGG-16 trained via a conventional FP32 framework. Figure 2(a) illustrates how the conventional FP8(1, 4, 3) copes with those weights. The rectangle in red is called the range window, which specifies the value range that $\mathrm { F P } 8 ( 1 , 4 , 3 )$ can represent. The purple vertical dash line further partitions the window into the norm region (right side) and the denorm region (left side). The star marks the position where the weight of the maximum magnitude locates. Note that virtually the entire right half of the range window in Figure 2(a) covers no weights, while $9 . 6 \%$ of leftmost weights cannot be included in the range window. In order to contain almost every weight in a range window, FP8(1, 5, 2) can be selected alternatively, as shown in Figure 2(b). A bigger exponent size (4 to 5) results in a larger range window. However, there are only 4 $( 2 ^ { 2 } )$ instead of 8 $( 2 ^ { 3 } )$ representative values available for each $x$ in the norm region since the fraction size decreases from 3 to 2, which potentially results in a lower accuracy. Note that $\mathrm { F P } 8 ( 1 , 4 , 3 )$ and $\mathrm { F P } 8 ( 1 , 5 , 2 )$ are two most commonly used 8-bit floating point formats in the previous studies.
45
+
46
+ With the help of the proposed FFP8 format, things can change a lot. Figure 2(c) shows what happens if FFP8(1, 4, 3, 15) is in use. The range window is of the same size as that in Figure 2(a) but is leftshifted by 8 positions due to the exponent bias is set to 15 instead of the default value 7. It is obvious that FFP8(1, 4, 3, 15) can better cope with weights in VGG-16 than $\mathrm { F P } 8 ( 1 , 4 , 3 )$ and FP(1, 5, 2). Furthermore, Figure 2(d) shows what if FFP8(1, 3, 4, 7) is in use. Comparing FFP8(1, 3, 4, 7) against FFP8(1, 4, 3, 15), weights in the norm region (over $3 5 \%$ ) are represented in 1-bit higher precision whereas $4 . 6 \%$ of leftmost weights are not included in the range window. However, those out-of-the-window weights can be regarded as some sort of pruned weights. That is, more investigation should be further conducted to determine whether FFP8(1, 3, 4, 7) or FFP8(1, 4, 3, 15) is better for the weights in VGG-16. One way or another, it is clear that the proposed FFP8 formats can achieve certain improvement that the conventional 8-bit formats cannot.
47
+
48
+ ![](images/7dd6076e42799f8a1b210cc7bfec813e0f774d3f5f676dc0da06c1295c39223b.jpg)
49
+ Figure 2: The range windows of various 8-bit floating-point formats versus the weight distribution of VGG-16; (a) in FP8(1, 4, 3), (b) in FP8(1, 5, 2), (c) in FFP8(1, 4, 3, 15), (d) in FFP8(1, 3, 4, 7)
50
+
51
+ # 3.3 FFP8-BASED INFERENCE FRAMEWORK AND BEST-FIT FORMAT SELECTION
52
+
53
+ In the proposed memory-efficient inference framework, weights and activations stored in off-chip memory are in FFP8 formats while operations inside the computing engine are still in FP32, which is a common strategy widely adopted in current state-of-the-art computing platforms (Intel, 2018; Nvidia, 2017). Hence, a systematic process, shown in Figure 3, is required to transform FP32 numbers into FFP8 ones in the following two scenarios: 1) quantizing pre-trained FP32 weights to FFP8 ones in advance, and 2) converting FP32 output activations into FFP8 ones before writing them back to off-chip memory. The process first prepares a list of 256 values that can be precisely represented by the specified FFP8 format. Then, the given FP32 inputs (weights or activations) are converted into FFP8 outputs using the round-to-nearest-even method.
54
+
55
+ In order to explore best-fit 8-bit formats for weights and activations in VGG-16, we have made a set of attempts, and the results are summarized in Table 1. First, it is unwise to represent weights in $\mathrm { F P } ( 1 , 5 , 2 )$ . Though Figure 2(b) shows FP(1, 5, 2) can cover virtually all weights, the accuracy loss is serious due to its 2-bit extremely low precision. Next, $\mathrm { F P } ( 1 , 4 , 3 )$ performs much better than $\mathrm { F P } ( 1 , 5 , 2 )$ , which suggests one extra precision bit does make a notable improvement here though $9 . 6 \%$ smallest weights are clear to 0 (i.e., pruned away), as depicted in Figure 2(a). Moreover, the proposed FFP8 format can surely do better. $\mathrm { F F P 8 } ( 1 , 4 , 3 , 1 5 )$ further outperforms FP(1, 4, 3) because weights are better covered by its left-shifted range window, as shown in Figure 2(c).
56
+
57
+ Inspired by the fact that $\mathrm { F P } ( 1 , 4 , 3 )$ outperforms $\mathrm { F P } ( 1 , 5 , 2 )$ , we further examine whether an even smaller exponent size can help or not. First, it is unwise to represent weights in $\mathrm { F P } 8 ( 1 , 3 , 4 )$ without modifying the default exponent bias $_ { ( = 3 ) }$ . Though the fraction size increases from 3 to 4, $6 4 . 1 \%$ leftmost weights are out of the range window, which is way too much. However, by setting the exponent bias to 7, which is equivalent to sliding the range window to the left by 4, the resultant FFP8(1, 3, 4, 7) successfully achieves a higher accuracy since it has a bigger 4-bit fraction size and only prunes away $4 . 6 \%$ smallest weights, as illustrated in Figure 2(d).
58
+
59
+ ![](images/ee11dd4faa248729c765769c1ef8aaf5238614624c00d21f44d0bc584667709b.jpg)
60
+ Figure 3: The process converting FP32 inputs into FFP8 outputs with the given format parameters
61
+
62
+ Table 1: Top-1 and Top-5 accuracy of VGG-16 on ImageNet dataset (Deng et al., 2009) in various number formats; delta $( \Delta )$ indicates the accuracy drop as compared to FP32
63
+
64
+ <table><tr><td>Weight</td><td>Activation</td><td>Top-1 (△)</td><td>Top-5 (△)</td></tr><tr><td>FP32</td><td>FP32</td><td>71.59%</td><td>90.38%</td></tr><tr><td>(1,5,2,15)</td><td>(1,4,3,7)</td><td>69.89% (-1.70%)</td><td>89.29% (-1.09%)</td></tr><tr><td>(1,4,3,7)</td><td>(1,4,3,7)</td><td>70.86% (-0.73%)</td><td>90.02% (-0.36%)</td></tr><tr><td>(1,4,3,15)</td><td>(1,4,3,7)</td><td>70.96% (-0.63%)</td><td>90.10% (-0.28%)</td></tr><tr><td>(1,3,4,3)</td><td>(1,4,3,7)</td><td>70.18% (-1.41%)</td><td>89.56% (-0.82%)</td></tr><tr><td>(1,3,4,7)</td><td>(1,4,3,7)</td><td>71.19% (-0.40%)</td><td>90.12% (-0.26%)</td></tr><tr><td>(1,3,4,7)</td><td>(1,4,3,7)+(0,4,4,7)</td><td>71.19% (-0.40%)</td><td>90.14% (-0.24%)</td></tr></table>
65
+
66
+ In addition to weights, it is certainly worth finding out best-fit formats for activations as well. For those attempts made above, activations are always in FFP8(1, 4, 3, 7) for two reasons: 1) the overall distribution of activations is wider than that of weights, and 2) the maximum magnitude of activations is much bigger than that of weights. The detailed distribution of activations will be given in Section 3.4 later. Meanwhile, it is also worth noting that a large set of commonly used activation functions always produce nonnegative outputs, e.g., ReLU, ReLU6, and sigmoid. That is, if those outputs are represented in any signed format, a half of the code space is actually wasted. It may not be a problem for 32-bit and 16-bit formats with long enough fraction bits; however, it is indeed a serious issue for any 8-bit format, which merely has 256 available codes in total. Since VGG-16 utilizes ReLU as its activation function, it is feasible to select signed FFP8(1, 4, 3, 7) for the first layer and unsigned FFP8(0, 4, 4, 7) for all succeeding layers. It implies that 256 instead of 128 codes are available to represent those unsigned activations in all layers except for the first one. With no surprise, the accuracy is further improved since the range window remains untouched while the fraction size gains one extra bit. In the last configuration, the Top-1 accuracy loss is only $0 . 4 \%$ when compared against the FP32 baseline, as indicated in Table 1.
67
+
68
+ # 3.4 LAYER-WISE OPTIMIZATION
69
+
70
+ Figure 4 and Figure 5 illustrate several distributions of weights and activations in VGG-16, respectively. Each figure includes the distributions of one whole model and three selected individual layers. In Section 3.3, the best-fit FFP8 format is determined by the overall distribution of the whole model. Here we have three key observations from those distributions: 1) the distributions of weights are quite dissimilar to those of activations, 2) even the distributions across different layers are dissimilar for both weights and activations, and 3) the distribution of an individual layer is narrower than that of the whole model. The above observations clearly suggest that applying layer-wise optimization (LWO) properly on number format selection is very likely to improve the accuracy further.
71
+
72
+ For instance, after comparing Figure $5 ( \mathrm { a } ) \& ( \mathrm { b } )$ , it is found that the distribution of the whole model is wider than that of the first layer, and the maximum log magnitudes of the whole model and the first layer are 8 and 1, respectively. As a consequence, selecting $\mathrm { F F P } 8 ( 1 , 3 , 4 , 6 )$ instead of FFP8(1, 4, 3, 7) for activations in the first layer can further increase the Top-1 accuracy by $0 . 1 9 \%$ (from $7 1 . 1 9 \%$ to $7 1 . 3 8 \%$ ), as indicated in Table 2. Next, we examine a new configuration that makes weights of all layers are in FFP8(1, 2, 5, 3). It is obvious an unwise attempt since $3 7 . 6 \%$ leftmost weights are out of the range window according to Figure 4(a). However, it may not be a bad idea to use FFP8(1, 2, 5, 5) in Layer 6 and FFP8(1, 2, 5, 6) in the last layer because only $6 . 9 \%$ and $5 . 3 \%$ smallest weights are out of the range window respectively according to Figure $4 ( \mathrm { c } ) \& ( \mathrm { d } )$ . Therefore, we examine another new configuration that makes weights of all layers in $\mathrm { F F P } 8 ( 1 , 2 , 5 , * )$ . Here the asterisk $( \ast )$ represents the largest possible exponent bias, which ensures that the maximum weight is still inside the range window. This LWO on weights successfully increases the Top-1 accuracy by $0 . 1 \%$ (from $7 1 . 3 8 \%$ to $7 1 . 4 8 \%$ ). Similarly, we can apply the LWO on activations, which again raises the Top-5 accuracy by $0 . 0 5 \%$ . The selected FFP8 format of each layer after LWO is reported in Table 3.
73
+
74
+ Previous studies usually choose $\mathrm { F P } 8 ( 1 , 4 , 3 )$ or $\mathrm { F P } 8 ( 1 , 5 , 2 )$ formats because the exponent size has to be large enough to cover most weights and activations at the cost of an even smaller fraction size. However, the exponent size for weights can be as small as 2 after LWO in our flow. Consequently, the larger 5-bit fraction size does help in accuracy improvement, as indicated in Table 2.
75
+
76
+ Note that the Top-1 accuracy achieved by the final configuration, which applies layer-wise optimization on both weights and activations, is merely $0 . 1 1 \%$ lower as compared to that of the FP32 baseline $( 7 1 . 4 8 \%$ vs. $7 1 . 5 9 \%$ ). More importantly, model retraining is not applied yet. In other words, all the accuracy improvements made so far are simply from properly re-expressing weights and activations of a pre-trained FP32 model in their best-fit FFP8 formats.
77
+
78
+ ![](images/21188150164f237a39626163cff2bf1d4af3aeae56669848881ed879c8bd5df6.jpg)
79
+ Figure 4: Weight distributions of (a) whole model, (b) first layer, (c) Layer 6, (d) last layer
80
+
81
+ ![](images/4db1795b0969e5913dd60342cf777d83c28f7e085bf9522442eca015a01afa91.jpg)
82
+ Figure 5: Activation distributions of (a) whole model, (b) first layer, (c) Layer 6, (d) last layer
83
+
84
+ Table 2: Top-1 and Top-5 accuracy of VGG-16 after layer-wise optimization
85
+
86
+ <table><tr><td>Weight</td><td>Activation</td><td>Top-1 (△)</td><td>Top-5 (△)</td></tr><tr><td>FP32</td><td>FP32</td><td>71.59%</td><td>90.38%</td></tr><tr><td>(1,3,4,7)</td><td>(1,4,3,7)+(0,4,4,7)</td><td>71.19% (-0.40%)</td><td>90.14% (-0.24%)</td></tr><tr><td>(1,3,4,7)</td><td>(1,3,4,6)+(0,4,4,7)</td><td>71.38% (-0.21%)</td><td>90.33% (-0.05%)</td></tr><tr><td>(1,2,5,3)</td><td>(1,3,4,6)+(0,4,4,7)</td><td>71.24% (-0.35%)</td><td>90.22% (-0.16%)</td></tr><tr><td>(1,2,5,*)</td><td>(1,3,4,6)+(0,4,4,7)</td><td>71.48% (-0.11%)</td><td>90.27% (-0.11%)</td></tr><tr><td>(1,2,5,*)</td><td>(1,3,4,6)+(0,4,4,*)</td><td>71.48% (-0.11%)</td><td>90.32% (-0.06%)</td></tr></table>
87
+
88
+ Table 3: The FFP8 format of each layer in VGG-16 after layer-wise optimization
89
+
90
+ <table><tr><td>Layer</td><td>Weight</td><td>Activation</td><td>Layer</td><td>Weight</td><td>Activation</td></tr><tr><td>1</td><td>(1,2,5,3)</td><td>(1,3,4,6)</td><td>8</td><td>(1,2,5,5)</td><td>(0,4,4,8)</td></tr><tr><td>2</td><td>(1,2,5,4)</td><td>(0,4,4,11)</td><td>9</td><td>(1,2,5,5)</td><td>(0,4,4,8)</td></tr><tr><td>3</td><td>(1,2,5,4)</td><td>(0,4,4,10)</td><td>10</td><td>(1,2,5,6)</td><td>(0,4,4,8)</td></tr><tr><td>4</td><td>(1,2,5,5)</td><td>(0,4,4,10)</td><td>11</td><td>(1,2,5,5)</td><td>(0,4,4,7)</td></tr><tr><td>5</td><td>(1,2,5,4)</td><td>(0,4,4,9)</td><td>12</td><td>(1,2,5,5)</td><td>(0,4,4,7)</td></tr><tr><td>6</td><td>(1,2,5,5)</td><td>(0,4,4,9)</td><td>13</td><td>(1,2,5,6)</td><td>(0,4,4,8)</td></tr><tr><td>7</td><td>(1,2,5,4)</td><td>(0,4,4,9)</td><td></td><td></td><td></td></tr></table>
91
+
92
+ # 3.5 ACCURACY IMPROVEMENT VIA MODEL RETRAINING
93
+
94
+ All FFP8 weights in our previous experiments are simply converted from pre-trained weights generated from a typical FP32 training framework. However, it is reported that quantization-aware model retraining can usually improve the accuracy (Jacob et al., 2017), which motivates us to check whether it can successfully apply to our work. We first train the ResNet-18 model in an FP32 framework and the corresponding Top-1 accuracy is $6 9 . 7 6 \%$ . Next, an FFP8-based inference is performed under the following settings: 1) all weights are in $\mathrm { F F P } 8 ( 1 , 3 , 4 , 7 ) , 2 )$ activations of the first layer are in FFP8(1, 3, 4, 6), and 3) activations of the other layers are in $\mathrm { F F P 8 } ( 0 , 4 , 4 , 7 )$ . The Top-1 accuracy for the above configuration is down to $6 9 . 4 4 \%$ . Then, a quantization-aware retraining process of 15 epochs is applied and the resultant Top-1 accuracy goes back to $6 9 . 7 6 \%$ . Note that the retraining is done simply in a typical FP32 framework without the need of special training skills.
95
+
96
+ # 4 EXPERIMENTAL RESULTS ON VARIOUS DNN MODELS
97
+
98
+ In this section, we intend to demonstrate that the proposed FFP8 format constantly performs well in various DNN models in addition to VGG-16. Table 4 reports the accuracy results of various models under different format configurations. Configuration A gives the results of the FP32 baseline. Configuration B utilizes a conventional FP8(1, 4, 3) format with a default exponent bias (7), which incurs a penalty of roughly $1 \%$ drop on Top-1 accuracy. With the help of the FFP8 format, Configuration C adopts the best-fit format for weights, which effectively reduces the Top-1 accuracy loss to $0 . 4 { \sim } 0 . 7 5 \%$ . Configuration D further selects two best-fit formats for activations (the signed one for the first layer and the unsigned one for the rest), which minimizes the Top-1 accuracy loss to $0 . 3 \%$ . Note that neither layer-wise optimization nor model retraining is even applied for this achievement.
99
+
100
+ Table 4: Accuracy results of various models under different format configurations
101
+
102
+ <table><tr><td rowspan="2">Cfg.</td><td rowspan="2">Weight</td><td rowspan="2">Activation</td><td>VGG-16</td><td>ResNet-50</td><td>ResNet-34</td><td>ResNet-18</td></tr><tr><td>Top-1/Top-5</td><td>Top-1/Top-5</td><td>Top-1/Top-5</td><td>Top-1/Top-5</td></tr><tr><td>A</td><td>FP32</td><td>FP32</td><td>71.59 /90.38</td><td>76.13/92.86</td><td>73.31/91.42</td><td>69.76/89.08</td></tr><tr><td>B</td><td>(1,4,3,7)</td><td>(1,4,3,7)</td><td>70.86 /90.02</td><td>75.24 /92.52</td><td>72.39 /90.97</td><td>68.70 / 88.50</td></tr><tr><td>C</td><td>(1,3,4,7)</td><td>(1,4,3,7)</td><td>71.19 /90.12</td><td>75.38 /92.68</td><td>72.81 /91.16</td><td>69.25 /88.80</td></tr><tr><td>D</td><td>(1,3,4,7)</td><td>(1,3,4,6)+(0,4,4,7)</td><td>71.38 / 90.33</td><td>75.85 /92.81</td><td>73.12 /91.33</td><td>69.44 / 88.93</td></tr></table>
103
+
104
+ ![](images/a47b50b7569e8f7830a2fdff1eda89b1c2a135c7cc9df8ab55b141b9c3e88e1a.jpg)
105
+ Figure 6: Memory-efficient system architectures: off-chip external data (a) in BFP16, (b) in FFP8; and (c) an FFP8 to FP32 hardware converter
106
+
107
+ In addition to image classification, we also want to know whether the proposed FFP8 format performs equally well in other application domains. Here, we examine two more applications: semantic segmentation and ECG check. First, FCN32s is a popular CNN model for semantic segmentation (Long et al., 2014). If FCN32s is in FP32, the mIOU is $6 3 . 6 3 \%$ using the VOC2011 dataset (Everingham et al.). Alternatively, if all the weights are in FFP8(1, 4, 3, 14) and all the activations are in FFP8(1, 4, 3, 2), the resultant mIOU would be $6 3 . 4 5 \%$ , a slight drop of $0 . 1 8 \%$ . Second, an LSTM model for ECG check (Physionet, 2017), has also been tested. If the LSTM model is in FP32, the check accuracy is $8 1 . 1 2 \%$ . If all the weights are in $\mathrm { F F P } 8 ( 1 , 3 , 4 , 6 )$ , the first-layer activations are in FFP8(1, 3, 4, 5), and activations in the other layer are in FFP8(1, 4, 3, 16), the resultant accuracy would be $8 1 . 5 3 \%$ , an accuracy gain of $0 . 4 1 \%$ . The experimental results once again demonstrate that FFP8 performs very well in these two categories as well.
108
+
109
+ # 5 ASPECTS OF SYSTEM AND HARDWARE
110
+
111
+ The target of this work is to develop a memory-efficient inference system, especially for those with limited memory capacity and bandwidth. A current state-of-the-art system, proposed by Nvidia and Intel, has successfully cut the required memory size and traffic through representing external data (weights or activations) in BFP16/INT8 instead of FP32, as illustrated in Figure 6(a) (Intel, 2018; 2019; Nvidia, 2017; 2020). It not only reduces the memory size, alleviates the performance bottleneck due to memory bandwidth limitation but also saves a significant amount of energy due to fewer power-consuming external memory access operations. To preserve the computation accuracy at the same time, external BFP16 data are converted to FP32 data right before entering the FP32 fused-multiply-add (FMA) unit. That is, internal computations can all be in FP32. Those FP32 data are converted back to BFP16 only if they are about to be written back to external memory.
112
+
113
+ In this work, we propose a system architecture that is very similar to the previous one, as shown in Figure 6(b). The key difference is that external data are in FFP8 instead of BFP16, which implies the proposed system merely demands a quarter of the memory size and throughput required by today’s FP32-based counterparts.
114
+
115
+ It is easy to convert a BFP16 number into its FP32 equivalent by concatenating a 16-bit pattern of all 0s at its least significant end. In fact, it is also easy to transform an FFP8 number to its FP32 equivalent via a converter, as depicted in Figure 6(c). Few register bits are allocated to store the current format settings of $x , y ,$ , and $b$ within the converter. Then, $x$ is used to recover the sign bit; the biased exponent and fraction can be extracted via $x$ and $y$ ; finally the exponent can be further corrected by the exponent bias $b$ . Hence, it is apparent that the required hardware logic for the converter is indeed minimal and the extra hardware cost is truly minor as well. Furthermore, updates of those format registers are extremely infrequent. Even the layer-wise optimization is applied, those registers are only modified at the start of each layer. In other words, virtually no runtime overhead is imposed due to those register updates.
116
+
117
+ # 6 CONCLUSION
118
+
119
+ In this work, we propose the flexible 8-bit floating-point (FFP8) format for accurate and memoryefficient inference of deep neural networks. Our FFP8 format offers three adjustable options: 1) the size of exponent/fraction field, 2) the value of exponent bias, and 3) the presence of the sign bit, whereas those rigid conventional formats simply leave nothing. In this paper, we explain how the exponent size and bias jointly define the representable value range of a given FFP8 format. We also demonstrate how to explore the best-fit signed/unsigned FFP8 formats for weights and activations to achieve more accurate inference outcomes. Besides, a layer-wise optimization flow, which discovers the best-fit formats for each individual layer, is presented to further improve the accuracy. A model retraining methodology that can be carried out in typical FP32 frameworks without the need of special training skills is also introduced. The experimental results on various DNN models show that the proposed FFP8-based inference flow achieves an extremely low accuracy loss of $0 . 1 \% \sim 0 . 3 \%$ as compared to the FP32 baseline even without model retraining. Moreover, we also show that the extra hardware for supporting the FFP8 format is minimal. Therefore, it is conclusive that the proposed FFP8-based inference framework should be a better solution for those computing systems with limited memory capacity and bandwidth, e.g., edge and AIoT devices.
120
+
121
+ # REFERENCES
122
+
123
+ Ron Banner, Itay Hubara, Elad Hoffer, and Daniel Soudry. Scalable methods for 8-bit training of neural networks. In Advances in Neural Information Processing Systems, 2018.
124
+
125
+ Leopold Cambier, Anahita Bhiwandiwalla, Ting Gong, Mehran Nekuii, Oguz HElibol, and Hanlin Tang. Shifted and squeezed 8-bit floating point format for low-precision training of deep neural networks. In International Conference on Learning Representations, 2020.
126
+
127
+ Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, 2015.
128
+
129
+ Dipankar Das, Naveen Mellempudi, Dheevatsa Mudigere, Dhiraj Kalamkar, Sasikanth Avancha, Kunal Banerjee, Srinivas Sridharan, and et al. Mixed precision training of convolutional neural networks using integer operations. In International Conference on Learning Representations, 2018.
130
+
131
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In Conference on Computer Vision and Pattern Recognition, 2009.
132
+
133
+ M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2011 (VOC2011) Results. http://www.pascal-network. org/challenges/VOC/voc2011/workshop/index.html.
134
+
135
+ Song Han, Mao Huizi, and Dally William J. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In International Conference on Learning Representations, 2016.
136
+
137
+ Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A. Horowitz, and William J. Dally. EIE: efficient inference engine on compressed deep neural network. arXiv e-prints, art. arXiv:1602.01528, February 2016.
138
+
139
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition, 2018.
140
+
141
+ Xiangnan He, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu, and Tat-Seng Chua. Neural collaborative filtering. arXiv e-prints, art. arXiv:1708.05031, August 2017.
142
+
143
+ M. Horowitz. Computing’s energy problem (and what we can do about it). In 2014 IEEE International Solid-State Circuits Conference Digest of Technical Papers (ISSCC), pp. 10–14, 2014. doi: 10.1109/ISSCC.2014.6757323.
144
+
145
+ Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. MobileNets: efficient convolutional neural networks for mobile vision applications. arXiv e-prints, art. arXiv:1704.04861, April 2017.
146
+
147
+ Gao Huang, Liu Zhuang, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In Conference on Computer Vision and Pattern Recognition, 2017.
148
+
149
+ Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. In The Journal of Machine Learning Research, 2017.
150
+
151
+ Intel. Bfloat16 – hardware numerics definition white paper. 2018.
152
+
153
+ Intel. Leadership performance with 2nd-generation intel xeon scalable processors, 2019.
154
+
155
+ Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv e-prints, art. arXiv:1712.05877, December 2017.
156
+
157
+ Dhiraj Kalamkar, Dheevatsa Mudigere, Naveen Mellempudi, Dipankar Das, Kunal Banerjee, Sasikanth Avancha, Dharma Teja Vooturi, Nataraj Jammalamadaka, Jianyu Huang, Hector Yuen, Jiyan Yang, Jongsoo Park, Alexander Heinecke, Evangelos Georganas, Sudarshan Srinivasan, Abhisek Kundu, Misha Smelyanskiy, Bharat Kaul, and Pradeep Dubey. A study of bfloat16 for deep learning training. arXiv e-prints, art. arXiv:1905.12322, May 2019.
158
+
159
+ Urs Koster, Tristan Webb, Xin Wang, Marcel Nassar, Arjun K Bansal, William Constable, Oguz ¨ Elibol, Scott Gray, Stewart Hall, and Luke et al Hornof. Flexpoint: An adaptive numerical format for efficient training of deep neural networks. In Advances in neural information processing systems, 2017.
160
+
161
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, 2012.
162
+
163
+ Hao Li, Asim Kadav, Igor Durdanovic, Graf. Samet, and Hans Pete. Pruning filters for effecient convnets. In International Conference on Learning Representations, 2017.
164
+
165
+ Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. arXiv e-prints, art. arXiv:1411.4038, November 2014.
166
+
167
+ Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, and Boris et al Ginsburg. Mixed precision training. In International Conference on Learning Representations, 2018.
168
+
169
+ Nvidia. Nvidia tesla v100 gpu architecture, 2017.
170
+
171
+ Nvidia. Nvidia a100 tensor core gpu architecture, 2020.
172
+
173
+ Physionet. Af classification from a short single lead ecg recording - the physionet computing in cardiology challenge. https://physionet.org/content/challenge-2017/1.0. 0/, 2017.
174
+
175
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015.
176
+
177
+ Xiao Sun, Jungwook Choi, Chia-Yu Chen, Naigang Wang, Swagath Venkataramani, Vijayalakshmi Srinivasan, Xiaodong Cui, Wei Zhang, and Kailash Gopalakrishnan. Hybrid 8-bit floating point (hfp8) training and inference for deep neural networks. In Neural Information Processing Systems, 2019.
178
+
179
+ Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition, 2015.
180
+
181
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Erhan, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
182
+
183
+ Naigang Wang and Jungw Choi. Training deep neural networks with 8-bit floating point numbers. In Advances in Neural Information Processing Systems, 2018.
184
+
185
+ Yang Zhao, Xiaohan Chen, Yue Wang, Chaojian Li, Haoran You, Yonggan Fu, Yuan Xie, Zhangyang Wang, and Yingyan Lin. Smartexchange: Trading higher-cost memory storage/access for lowercost computation. In International Symposium on Computer Architecture (ISCA), 2020.
186
+
187
+ Shuchang Zhou, Zekun Ni, He Wen, Yuxin Wu, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. In CoRR, abs/1606.06160, 2016.
md/train/B1lG42C9Km/B1lG42C9Km.md ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INTRINSIC SOCIAL MOTIVATION VIA CAUSAL INFLUENCE IN MULTI-AGENT RL
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We derive a new intrinsic social motivation for multi-agent reinforcement learning (MARL), in which agents are rewarded for having causal influence over another agent’s actions. Causal influence is assessed using counterfactual reasoning. The reward does not depend on observing another agent’s reward function, and is thus a more realistic approach to MARL than taken in previous work. We show that the causal influence reward is related to maximizing the mutual information between agents’ actions. We test the approach in challenging social dilemma environments, where it consistently leads to enhanced cooperation between agents and higher collective reward. Moreover, we find that rewarding influence can lead agents to develop emergent communication protocols. We therefore employ influence to train agents to use an explicit communication channel, and find that it leads to more effective communication and higher collective reward. Finally, we show that influence can be computed by equipping each agent with an internal model that predicts the actions of other agents. This allows the social influence reward to be computed without the use of a centralised controller, and as such represents a significantly more general and scalable inductive bias for MARL with independent agents.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep reinforcement learning (RL) has made impressive progress on specific tasks with well-defined reward functions, but is still difficult to learn intelligent behavior that generalizes across multiple domains. Intrinsic motivation is a technique for solving this problem by developing general reward functions that encourage an agent to learn across a variety of tasks (Singh et al., 2004). Previous approaches to intrinsic motivation have broadly fallen into two categories: (1) curiosity, or a drive for novelty (e.g. Pathak et al. (2017); Schmidhuber (2010)), and (2) empowerment, or a drive to be able to manipulate the environment (Klyubin et al., 2005).
12
+
13
+ We posit that this body of work has largely overlooked an important intrinsic motivation that is key to human learning: social interaction. Humans have remarkable social learning abilities; some authors suggest that it is social learning that has given rise to cultural evolution, and allowed us to achieve unprecedented progress and coordination on a massive scale (van Schaik & Burkart, 2011; Herrmann et al., 2007). Others emphasize that our impressive capacity to learn from others far surpasses that of other animals, apes, and even other proto-human species (Henrich, 2015; Harari, 2014; Laland, 2017).
14
+
15
+ Therefore, we propose an intrinsic reward function designed for multi-agent RL (MARL), which awards agents for having a causal influence on other agents’ actions. Causal influence is assessed using counterfactual reasoning; at each timestep, an agent simulates alternate, counterfactual actions that it could have taken, and assesses their effect on another agent’s behavior. Actions that lead to relatively higher change in the other agent are considered to be highly influential and are rewarded. We show how this reward is related to maximizing the mutual information between agents’ actions, and is thus a form of social empowerment. We hypothesize that rewarding influence may therefore encourage cooperation between agents. We also take inspiration from experiments in human cognition, showing that newborn infants are sensitive to correspondences between their own actions and the actions of other people, and use this to coordinate their behavior with others (Tomasello, 2009; Melis & Semmann, 2010).
16
+
17
+ To study our proposed social influence reward in the MARL setting, we adopt the Sequential Social Dilemmas (SSDs) of Leibo et al. (2017). These are challenging MA environments with a game-theoretic reward structure, similar to Prisoner’s Dilemma. For each individual agent, ‘defecting’ (non-cooperative behavior) has the highest payoff. However, the collective reward will be better if all agents choose to cooperate. The paradoxical payoff structure of these tasks make achieving cooperative social dynamics extremely challenging for typical RL agents. We show that social influence allows agents to learn to cooperate in these environments, and make the following contributions:
18
+
19
+ • We demonstrate that deep RL agents trained with the proposed social influence reward cooperate to attain higher collective reward than baseline deep RL agents (Mnih et al., 2016). In some cases, this cooperation is attained because influencer agents learn to use their actions as an emergent communication protocol, analogous to behavior seen in animals (von Frisch, 1969). Motivated by the previous point, we apply the influence reward to training deep RL agents to use an explicit communication channel, as in Foerster et al. (2016). We demonstrate that the communication protocols trained with the influence reward meaningfully relate to agents’ actions, and that once again, agents trained with the influence reward achieve better collective outcomes. We demonstrate that there is a significant correlation between being influenced through communication messages and obtaining higher individual return, suggesting that influential communication is beneficial to the agents that receive it. Finally, rather than computing social influence using a centralised training framework as in prior work (e.g. Foerster et al. (2017; 2016)), we extend the approach by attaching an internal Model of Other Agents (MOA) network to each agent and training it to predict the actions of every other agent. The agent can then simulate counterfactual actions and use its own internal MOA to predict how these will affect other agents, thus computing its own intrinsic influence reward.
20
+
21
+ Using a MOA to predict and reward influence allows us to compute an intrinsic social reward by observing other agents’ past actions, without a centralised controller, and without requiring access to another agent’s reward function. We believe this is an important innovation over prior work (e.g. (Hughes et al., 2018; Foerster et al., 2017; 2016)). When we consider likely future applications of MARL, such as autonomous driving, it becomes apparent that centralised training or the sharing of reward functions are unrealistic assumptions, since autonomous vehicles are likely to be produced by a wide variety of organizations and institutions with mixed motivations. Rather, a social reward function which only depends on observing the behavior of agents acting in the environment, and which can give rise to coordinated, cooperative behavior, represents a more promising approach.
22
+
23
+ # 2 METHODS
24
+
25
+ We consider a MARL Markov game defined by the tuple $\langle S , T , A , r \rangle$ , in which multiple agents which do not share weights are trained to independently maximize their own individual reward. The environment state is given by $s \in S$ . At each timestep $t$ , each agent $k$ chooses an action $a _ { t } ^ { k } \in A$ . The actions of all $N$ agents are combined to form a joint action $\pmb { a } _ { t } = [ a _ { t } ^ { 0 } , . . . a _ { t } ^ { N } ]$ , which produces a transition in the environment $T _ { \cdot } ( s _ { t + 1 } | \mathbf { a } _ { t } , s _ { t } )$ , according to the state transition function $T$ . Each agent then receives its own reward $r ^ { k } ( a _ { t } , s _ { t } )$ , which may depend on the actions of other agents. A history of these variables over time is termed a trajectory, ${ \boldsymbol { \tau } } = \left\{ { { s _ { t } } , { a _ { t } } , { r _ { t } } } \right\} _ { t = 0 } ^ { T }$ . We consider a partially observable setting in which each agent $k$ can only vieture reward, true sta, where , $s _ { t } ^ { k }$ . Each agent seeks to maximize its own total discount factor. A distributed asynchronous a ectedntage $\begin{array} { r } { R ^ { k } = \sum _ { i = 0 } ^ { \infty } \gamma ^ { i } r _ { t + i } ^ { k } } \end{array}$ $\gamma$
26
+ $\pi ^ { k }$ policy is learned via REINFORCE with baseline (Williams, 1992). Architecturally, our agents consist of a convolutional layer, fully connected layers, a Long Short Term Memory (LSTM) network (Gers et al., 1999), and linear layers which output $\pi ^ { \dot { k } }$ and the value function $V ^ { \pi _ { k } } ( s )$ . We will refer to the internal LSTM state of agent $k$ at timestep $t$ as $\dot { u } _ { t } ^ { k }$ .
27
+
28
+ # 2.1 INTRINSIC SOCIAL MOTIVATION VIA CAUSAL INFLUENCE
29
+
30
+ Social influence intrinsic motivation modifies an agent’s reward function so that it becomes $R ^ { k } = \alpha E ^ { k } + \beta I ^ { k }$ , where $E ^ { k }$ is the extrinsic or environmental reward, and $I ^ { k }$ is the causal influence reward. We compute $I ^ { k }$ by generating counterfactual actions that the agent could have taken at each timestep, and assessing how taking these would have affected other agents’ behavior. A counterfactual is the estimated probability that $^ { 6 6 } Y$ would be $y$ had $X$ been $x$ , in situation $Z = z ^ { \prime }$ , where $X , Y ,$ , and $Z$ are random variables, and $x , y$ and $z$ are their values (Pearl et al., 2016). Importantly, it is a counterfactual because we condition on a set of evidence $z$ , and because the assignment $X = x$ is counter to what we actually observed; in reality, $X$ took on some other value.
31
+
32
+ ![](images/d4c9d865d0914f582cec2f90cb9102528669a3d0feda5b6e015295234f191f06.jpg)
33
+ Figure 1: Causal diagram of agent $A$ ’s effect on $B$ ’s action. We condition on each agent’s view of the environment and LSTM state $u$ (shaded nodes), and intervene on $a _ { t } ^ { \dot { A } }$ (blue).
34
+
35
+ To see how we can compute the causal effect of one agent on another, suppose there are two agents, $A$ and $B$ , and that agent $B$ receives $A$ ’s action at time $t$ taction, know a , as input1. Agent $p \big ( a _ { t } ^ { B } | a _ { t } ^ { A } , \overline { { s _ { t } ^ { B } } } , u _ { t } ^ { B } \big )$ $B$ then uses this to compute a distribution over its own ecause we have built the model , and its own internal LSTM state, agent , as sh $B$ , wen in $\bar { a } _ { t } ^ { A } , s _ { t } ^ { B }$ $u _ { t } ^ { B }$ Figure 1. This allows us to exactly isolate the causal effect of $A$ ’s action on $B$ by conditioning on the values we observed for the other inputs at this timestep (note that by conditioning on these variables, including the LSTM state $u _ { t } ^ { B }$ , we remove any dependency on previous timesteps in the trajectory). We can then intervene on $a _ { t } ^ { A }$ by replacing it with a counterfactual action, $d o \dot { ( a _ { t } ^ { A } ) }$ . This counterfactual action is used to compute a new estimate of $p ( a _ { t } ^ { B } | d o ( \tilde { a } _ { t } ^ { A } ) , s _ { t } ^ { B } , u _ { t } ^ { B } )$ . Essentially, the agent asks a retrospective question: “How would $B$ ’s action change if I had acted differently in this situation?”.
36
+
37
+ To simplify notation, let $\boldsymbol { z } _ { t } = \langle \boldsymbol { u } _ { t } ^ { B } , \boldsymbol { s } _ { t } ^ { B } \rangle$ , so that conditioning on $z _ { t }$ is equivalent to conditioning on all relevant background variables (all shaded variables in Figure 1). We can also forego the $d o$ operator, noting that $p ( \dot { a } _ { t } ^ { B } | d o ( \tilde { a } _ { t } ^ { A } ) , z _ { t } ) \equiv p ( a _ { t } ^ { B } | \tilde { a } _ { t } ^ { \tilde { A } } , z _ { t } )$ in this case, because $z$ satisfies the back-door criterion (Pearl & Mackenzie, 2018). Now, consider averaging over several counterfactuals $\tilde { a } _ { t } ^ { A }$ . This gives us the marginal policy of $B$ , $\begin{array} { r } { p ( a _ { t } ^ { B } | \tilde { z _ { t } } ) = \sum _ { \tilde { a } _ { t } ^ { A } } p ( a _ { t } ^ { B } | \tilde { a } _ { t } ^ { A } , z _ { t } ) p ( \tilde { a } _ { t } ^ { A } | z _ { t } ) } \end{array}$ —in other words, $B$ ’s policy if $A$ were not considered. The discrepancy between the marginal policy of $B$ and the conditional policy of $B$ given $A$ ’s action is a measure of the causal influence of
38
+
39
+ $A$ on $B$ ; it gives the degree to which $B$ changes its planned action distribution because of $A$ ’s behavior. Thus, the causal influence intrinsic reward for agent $A$ is
40
+
41
+ $$
42
+ { I _ { t } ^ { A } } = D _ { K L } \left[ p ( a _ { t } ^ { B } \mid a _ { t } ^ { A } , z _ { t } ) \right| \left| \sum _ { \tilde { a } _ { t } ^ { A } } p ( a _ { t } ^ { B } \mid z _ { t } , \tilde { a } _ { t } ^ { A } ) p ( \tilde { a } _ { t } ^ { A } \mid z _ { t } ) \right] = D _ { K L } \left[ p ( a _ { t } ^ { B } \mid a _ { t } ^ { A } , z _ { t } ) \right| \left| p ( a _ { t } ^ { B } \mid z _ { t } ) \right] .
43
+ $$
44
+
45
+ # 2.2 RELATIONSHIP TO MUTUAL INFORMATION AND EMPOWERMENT
46
+
47
+ The causal influence reward in Eq. 1 is related to the mutual information (MI) between the actions of agents $A$ and $B$ , which is given by
48
+
49
+ $$
50
+ I ( A ^ { B } ; A ^ { A } | z ) = \sum _ { a ^ { A } , a ^ { B } } p ( a ^ { B } , a ^ { A } | z ) \mathrm { l o g } \frac { p ( a ^ { B } , a ^ { A } | z ) } { p ( a ^ { B } | z ) p ( a ^ { A } | z ) } { = \sum _ { a ^ { A } } p ( a ^ { A } | z ) D _ { \mathrm { K L } } \left[ p ( a ^ { B } | a ^ { A } , z ) \right] \left| p ( a ^ { B } | z ) \right] } ,
51
+ $$
52
+
53
+ where we see that the $D _ { K L }$ factor in Eq. 2 is the causal influence reward given in Eq. 1. The connection to mutual information is interesting, because a frequently used intrinsic motivation for single agent RL is empowerment, which rewards the agent for having high mutual information between its actions and the future state of the environment (e.g. Klyubin et al. (2005); Capdepuy et al. (2007)). To the extent that the social influence reward defined in Eq. 1 is an approximation of the MI, $A$ is rewarded for having empowerment over $B ^ { \prime } s$ actions.
54
+
55
+ By sampling $N$ independent trajectories $\tau _ { n }$ from the environment, where A’s actions $a _ { n } ^ { A }$ are drawn according to $\overset { \cdot } { p } ( a ^ { A } | z )$ , we perform a Monte-Carlo approximation of the MI (see e.g. Strouse et al. (2018)),
56
+
57
+ $$
58
+ I ( A ^ { A } ; A ^ { B } | z ) = \mathbb { E } _ { \tau } \Big [ D _ { \mathrm { K L } } \big [ p ( A ^ { B } | A ^ { A } , z ) \big \| p ( A ^ { B } | z ) \big ] \Big | z \Big ] \approx \frac { 1 } { N } \sum _ { n } D _ { \mathrm { K L } } \big [ p ( A ^ { B } | a _ { n } ^ { A } , z ) \big \| p ( A ^ { B } | z ) \big ] .
59
+ $$
60
+
61
+ Thus, in expectation, the social influence reward is the MI between agents’ actions.
62
+
63
+ Whether the policy trained with Eq. 1 actually learns to approximate the MI depends on the learning dynamics. We calculate the intrinsic social influence reward using Eq. 1, because unlike Eq. 2, which gives an estimate of the symmetric bandwidth between $A$ and $B$ , Eq. 1 gives the directed causal effect of the specific action taken by agent $A$ , $a _ { t } ^ { A }$ . We believe this will result in an easier reward to learn, since it allows for better credit assignment; agent $A$ can more easily learn which of its actions lead to high influence. We also experiment with replacing the KL-divergence with several other measures, including the Jensen-Shannon Divergence (JSD), and find that the influence reward is robust to the choice of measure.
64
+
65
+ # 2.3 INFLUENCE THROUGH COMMUNICATION
66
+
67
+ According to Melis & Semmann (2010), human children rapidly learn to use communication to influence the behavior of others when engaging in cooperative activities. They explain that “this ability to influence the partner via communication has been interpreted as evidence for a capacity to form shared goals with others”, and that this capacity may be “what allows humans to engage in a wide range of cooperative activities”. Therefore, we investigate a second use of the social influence reward: learning inter-agent communication protocols. Using a similar approach to Reinforced Inter-Agent Learning (RIAL) (Foerster et al., 2016), we equip the agents with an explicit communication channel. At each timestep, each agent $k$ chooses a discrete communication symbol $\Dot { m } _ { t } ^ { k }$ ; these symbols are concatenated into a combined message vector $\pmb { m } _ { t } = [ m _ { t } ^ { 0 } , m _ { t } ^ { 1 } . . . m _ { t } ^ { N } ] ,$ , for $N$ agents. This message vector $\mathbf { \nabla } m _ { t }$ is then shown to every other agent in the next timestep, as in Figure 2. To train the agents to communicate, we augment our initial network with an additional A3C output head, that learns a communication policy $\pi _ { c }$ over which symbol to emit, and a communication value function $V _ { c }$ (this is separate from the normal policy and value function used for acting in the environment, $\pi _ { e }$ and $V _ { e }$ , which are trained only with environmental reward $E$ ).
68
+
69
+ The influence reward is used, in addition to environmental reward, to train the communication policy $\pi _ { c }$ Counterfactuals are employed to assess how muon another agent’s action in the next timestep, luence an agent’s communication message, . Importantly, we hypothesize that comm $m _ { t } ^ { A }$ , hastion $a _ { t + 1 } ^ { B }$ can only be influential if it is useful to another agent. There is nothing that compels agent to act based on agent $A$ ’s communication message; if it does not contain valuable information, $B$ is free to ignore it. In fact, previous work has shown that selfish agents do not learn to use this type of ungrounded, cheap talk communication channel effectively (Cao et al., 2018). In contrast, for $A$ to gain influence via communication, $m _ { t } ^ { A }$ must contain valuable information that informs $B$ about how best to maximize its own reward, so much so that it actually causes $B$ to change its intended action.
70
+
71
+ ![](images/caa2b9dc3c9fe0bdc22237d63bfba2b09073071b89e2a88a719924f5aa8e5a38.jpg)
72
+ Figure 2: The communication model has two A2C heads, which learn a normal policy, $\pi _ { e }$ , and a policy for emitting communication symbols, $\pi _ { c }$ . Other agents’ communication messages $\mathbf { \nabla } m _ { t }$ are input to the LSTM.
73
+
74
+ ![](images/64e00c7a40f5d8bfca22499a480991f9780f7757dc5984363b283b0279a25fc0.jpg)
75
+ Figure 3: The Model of Other Agents (MOA) architecture learns both an RL policy $\pi _ { e }$ , and a supervised model that predicts the actions of other agents, $\mathbf { \pmb { a } } _ { t + 1 }$ The predictions of the supervised model are used for computing the influence reward.
76
+
77
+ # 2.4 INFLUENCE VIA MODELING OTHER AGENTS
78
+
79
+ Computing the causal influence reward as introduced in Section 2.1 requires knowing the probability of $B$ ’s next action given a counterfactual, $p ( a _ { t } ^ { B } | \tilde { a } _ { t } ^ { A } , s _ { t } ^ { B } )$ , which we previously solved by using a centralised controller that could access other agent’s policy networks. While using a centralised training framework is common in MARL (e.g. Foerster et al. (2017; 2016)), it is less realistic than a scenario in which each agent is trained independently. We can relax this assumption and achieve independent training by equipping each agent with its own internal Model of Other Agents (MOA). The MOA consists of a second set of fully-connected and LSTM layers connected to the agent’s convolutional layer (see Figure 3), and is trained to predict all other agents’ next actions given their current action, and the agent’s egocentric view of the state: $p ( { \pmb a } _ { t + 1 } | { \pmb a } _ { t } , { \pmb s } _ { t } ^ { A } )$ . The MOA is trained using cross-entropy loss over observed action trajectories.
80
+
81
+ A trained MOA can be used to compute the social influence reward in the following way. Each agent can “imagine” counterfactual actions that it could have taken at each timestep, and use its internal MOA to predict the effect on other agents. It can then give itself reward for taking actions that it estimates were the most influential. This has an intuitive appeal, because it resembles how humans reason about their effect on others (Ferguson et al., 2010). We may often find ourselves asking counterfactual questions of the form, “How would she have reacted if I had said or done something else in that situation?”, which we can only answer using our internal model of others.
82
+
83
+ Both the MOA and communication approaches are an important improvement over the original model shown in Figure 1, which computed influence within a given timestep and required that agent $A$ choose its action $a _ { t } ^ { A }$ first, and this action be transmitted to agent $B$ as input. This meant that only some agents (those acting first) could be influencers. In contrast, using influence for communication or with a MOA are general approaches that can be implemented in any agent, and allow all agents to mutually influence each other.
84
+
85
+ We now seek to estimate influence in the next timestep, meaning the influence of $a _ { t } ^ { A }$ on $a _ { t + 1 } ^ { B }$ , which requires modeling $p ( a _ { t + 1 } ^ { B } | \underline { { a } } _ { t } ^ { A } , s _ { t } ^ { A } )$ . The corresponding causal diagrof $a _ { t } ^ { A }$ is son $a _ { t + 1 } ^ { B }$ in Figure 4. We can infer the causal effectby conditioning on the shaded variables (so that there are no back-door paths) (Pearl et al., 2016). Learning a model of $p ( a _ { t + 1 } ^ { B } | a _ { t } ^ { \bar { A } } , s _ { t } ^ { A } )$ requires implicitly modeling both the environment transition function $T$ (to predict $s _ { t + 1 } )$ , as well as relevant aspects of the internal LSTM state of the other agent, $u _ { t + 1 } ^ { B ^ { * } }$ , as highlighted in Figure 4.
86
+
87
+ We enable agents to condition their policy on the actions of other agents in the previous timestep (actions are visible), and only give the social influence reward to an agent when the agent it is attempting to influence is within its field-of-view, because the estimates of $p ( a _ { t + 1 } ^ { B } | a _ { t } ^ { A } , s _ { t } ^ { A } )$ are likely to be more accurate when $B$ is visible to $A ^ { 2 }$ . The latter constraint could have the sideeffect of encouraging agents to stay in closer proximity.
88
+
89
+ ![](images/c636b44cc733a0638da4fbce914888df05874d72cc520f1bcf72e309b465e051.jpg)
90
+ Figure 4: Causal diagram in the MOA case. Shaded nodes are conditioned on, and we intervene on $a _ { t } ^ { A }$ (blue node) by replacing it with counterfactuals. Nodes with a green background must be modeled using the MOA module. Note that there is no backdoor path between $a _ { t } ^ { A }$ and $s _ { t }$ since it would require traversing a collider that is not in the conditioning set.
91
+
92
+ However, an intrinsic social reward based on proximity is also a reasonable approach to approximating human social motivation. Humans seek affiliation and to spend time near other people (Tomasello, 2009).
93
+
94
+ # 2.5 SEQUENTIAL SOCIAL DILEMMAS
95
+
96
+ First proposed by Leibo et al. (2017), Sequential Social Dilemmas (SSDs) are spatially and temporally extended multi-agent games that have a payoff structure similar to that of Prisoner’s Dilemma (PD). That is, an individual agent can obtain higher reward by engaging in defecting, non-cooperative behavior (and thus is rationally motivated to defect), but the average payoff per agent will be higher if all agents cooperate (see Figure 9 of the Appendix). The paradoxical reward structure makes it extremely difficult for traditional RL agents to learn to coordinate to solve the tasks (Hughes et al., 2018). We experiment with two SSDs in this work, a public goods game Cleanup, and a tragedy-of-the-commons game Harvest (see Figure 5). In both games apples (green tiles) provide the rewards, and agents also have the ability to punish each other with a fining beam. Further details are available in Appendix Section 6.1.
97
+
98
+ ![](images/20206990cd332b2c23f36bfab8c7c99fd397bf6323218026ab67daf49c621e5f.jpg)
99
+ Figure 5: The two SSD environments, Cleanup (left) and Harvest (right). Agents can exploit other agents for immediate payoff, but at the expense of the long-term collective reward of the group.
100
+
101
+ # 3 RELATED WORK
102
+
103
+ Several attempts have been made to develop intrinsic social motivation rewards3. Sequeira et al. (2011) developed hand-crafted rewards specific to a foraging environment, in which agents were punished for eating more than their fair share of food. Another approach gave agents an emotional intrinsic reward based on their perception of their neighbours’ cooperativeness in a networked version of the iterated prisoner’s dilemma (Yu et al., 2013). This approach is limited to scenarios in which it is possible to directly classify each action as cooperative or non-cooperative, which is untenable in complex settings with long-term strategies, such as the SSDs under investigation here. Hughes et al. (2018) introduced an inequity aversion motivation, which penalized agents if their rewards differed too much from those of the group. Another approach used prosocial reward shaping to show that if even a single agent is trained to optimize for the rewards of other agents, it can help the group obtain better collective outcomes (Peysakhovich & Lerer, 2018). However, these both require the ability to observe other agent’s rewards, which may be an unrealistic assumption, depending on the application.
104
+
105
+ Another body of work has focused on training agents to learn emergent communication protocols (Foerster et al., 2016; Cao et al., 2018; Choi et al., 2018; Lazaridou et al., 2018; Bogin et al., 2018), with many authors finding that selfish agents do not learn to use an ungrounded, cheap talk communication channel effectively. Crawford & Sobel (1982) find that in theory, the information revealed in communication (in equilibrium) is proportional to amount of common interest; thus, as agents’ interests diverge, no communication is to be expected. And while communication can emerge when agents are prosocial (Foerster et al., 2016; Lazaridou et al., 2018) or hand-crafted (Crandall et al., 2017), self-interested agents do not to learn to communicate (Cao et al., 2018). We test whether the social influence reward can encourage agents to learn to communicate more effectively in complex environments with challenging social dilemma dynamics.
106
+
107
+ Interestingly, Oudeyer & Kaplan (2006) show that a robot trained with a curiosity-based intrinsic motivation to maximize learning progress learns to prefer vocalizing sounds imitated by another robot over interaction with other objects in the environment. Follow-up papers suggest that curiosity may be a sufficient motivation to encourage agents, or even children, to learn to communicate with others (Oudeyer & Smith, 2016; Forestier & Oudeyer, 2017).
108
+
109
+ Our MOA network is related to work on machine theory of mind (Rabinowitz et al., 2018), which demonstrated that a model trained to predict agents’ actions is able to model false beliefs. With LOLA, Foerster et al. (2018) train agents that model the impact of their policy on the parameter updates of other agents, and directly incorporate this into the agent’s own learning rule.
110
+
111
+ Barton et al. (2018) propose causal influence as a way to measure coordination between agents, specifically using Convergence Cross Mapping (CCM) to analyze the degree of dependence between two agents’ policies. The limitation of this approach is that CCM estimates of causality are known to degrade in the presence of stochastic effects (Tajima et al., 2015). Counterfactual reasoning has also been used in a multi-agent setting, to marginalize out the effect of one agent on a predicted global value function estimating collective reward, and thus obtain an improved baseline for computing each agent’s advantage function (Foerster et al., 2017). A similar paper shows that counterfactuals can be used with potential-based reward shaping to improve credit assignment for training a joint policy in multi-agent RL Devlin et al. (2014). However, once again these approaches rely on a centralised controller.
112
+
113
+ Following in the tradition of the empowerment literature, authors have investigated mutual information (MI) as a powerful tool for designing social rewards. Strouse et al. (2018) train agents to maximize or minimize the MI between their actions and a categorical goal, and show how this can be used to signal or hide the agent’s intentions. However, this approach depends on agents pursuing a known, categorical goal. Guckelsberger et al. (2018), in pursuit of the ultimate video game adversary, develop an agent that maximizes its empowerment over its own states, minimizes the player’s empowerment over their states, and maximizes its empowerment over the player’s next state. This third goal, termed transfer empowerment, is obtained by maximizing the MI between the agent’s actions and the player’s future state. While similar to our approach, the authors find that agents trained with transfer empowerment simply tend to stay near the player. Further, the agents are not trained with RL, but rather analytically compute these measures in simple grid-world environments. As such, the agent cannot learn to model other agents or the environment.
114
+
115
+ # 4 EXPERIMENTS
116
+
117
+ The following sections present the results of training agents with the social influence reward in three settings: (1) using a centralised controller, (2) using an explicit communication channel, and (3) using a learned model of other agents (MOA). In each case we compare against a standard A3C agent, and an ablated version of the model which is architecturally identical, but does not receive the influence reward. We measure the total collective reward obtained using the best hyperparameter setting tested with 5 random seeds. It is worth noting that we use a curriculum learning approach which gradually increases the weight of the social influence reward over $C$ steps $( C \in [ 0 . 2 \mathrm { - } 3 . 5 ] \times \bar { 1 } 0 ^ { 8 } )$ ; this can lead to a slight delay before the influence models’ performance improves.
118
+
119
+ We also provide the results of an additional experiment Section 6.2 of the Appendix, which tests the social influence reward in a simplified environment where the effects of influence are clear. We encourage the reader to examine that section to gain a better intuition for how social influence can foster cooperative behavior in an otherwise selfish agent.
120
+
121
+ # 4.1 CENTRALISED CONTROLLER
122
+
123
+ Figures 6(a) and 6(d) show the results of training influence with a centralised controller as described in Section 2.1. With this method, the influencer agents transmit their intended action to the influenced agents at each timestep. Therefore, we benchmark against an ablated version of the influence model with visible actions but no influence reward. As is evident in Figures 6(a) and 6(d), introducing an awareness of other agents’ actions helps, but having the social influence reward eventually leads to significantly higher collective reward in both games.
124
+
125
+ ![](images/3b9225cc90c9a95e47d5cf85514dba567067d0da375c94be1d1955429ea1bdd4.jpg)
126
+ Figure 6: Total collective reward obtained in all experiments. Error bars show a $9 9 . 5 \%$ confidence interval (CI) over 5 random seeds, computed within a sliding window of 200 agent steps. The models trained with influence reward (red) significantly outperform the baseline and ablated models.
127
+
128
+ While these aggregated results demonstrate the success of our models, they are not sufficient to understand the mechanism through which social influence is helping the agents achieve cooperative behavior. Therefore, we investigated the trajectories produced by high scoring models in both Cleanup and Harvest; the analysis revealed interesting behavior. As an example, in the Cleanup video available here: https: //youtu.be/iH_V5WKQxmo a single agent (shown in purple) was trained with the social influence reward. We see that unlike the other agents, which continue to randomly move and explore while waiting for apples to spawn, the influencer has a strange economy of motion; it only moves on the map when it is pursuing an apple, then stops. Interestingly, examining the trajectory reveals that the influencer uses only two moves to explore the map: turn left, which turns the agent in place without traversing the map, and move right, which moves the agent one square to the right on the map.
129
+
130
+ ![](images/15faf4dfa88bd78c4d0e9ddf505f7cecc97572565601a0318358c9465b4a4695.jpg)
131
+ Figure 7: A moment of high influence when the purple influencer signals the presence of an apple outside the yellow influencee’s field-of-view (yellow outlined box).
132
+
133
+ Why did the influencer learn to use only these two moves? We can see that the influencer agent only chooses to move right (i.e. traverse the map) when it is pursuing an apple which is present. The rest of the time it simply turns left on the spot. At $t = 4 9$ , there is a moment of high influence between the influencer and the yellow influencee, which is shown in Figure 7. The influencer has chosen to move right towards an apple that is outside of the ego-centric field-of-view of the yellow agent. Because the purple agent only moves when apples are available, this signals to the yellow agent that an apple must be present above it which it cannot see. This changes the yellow agent’s distribution over its planned action, $p ( a _ { t } ^ { B } | a _ { t } ^ { A } , s _ { t } ^ { B } )$ and allows the purple agent to gain influence. A similar moment occurs when the influencer signals to an agent that has been cleaning the river that no apples have appeared by continuing to turn left (see Figure 12 in the Appendix).
134
+
135
+ In this example, the influencer agent learned to use its own actions as a sort of binary code, which signals the presence or absence of apples in the environment. We also observe this effect in the influence agents in the Harvest task. This type of action-based communication could be likened to the bee waggle dance discovered by von Frisch (1969). Thus, rewarding agents for increasing the mutual information between their actions gave rise not only to cooperative behavior, but in this case, to emergent communication. These results further support the idea of using influence as a reward for training agents to communicate.
136
+
137
+ # 4.2 INFLUENCE THROUGH COMMUNICATION
138
+
139
+ Figures 6(b) and 6(e) show the results of training the agents to use an explicit communication channel, and its effect on their collective reward. In this case, the ablated baseline is a model that has the same structure as in Figure 2, but in which the communication policy $\pi _ { c }$ is trained only with environmental reward. We observe that the agents which are trained to use the communication channel with additional social influence reward achieve significantly higher collective reward in both games. In fact, in the case of Cleanup, we found that $\alpha = 0$ in the optimal hyperparameter settings, meaning that it was most effective to train the communication head with zero extrinsic or environmental reward (see Table 2 in the Appendix). This suggests that influence alone can be a sufficient mechanism for training an effective communication policy.
140
+
141
+ To analyze the communication behaviour learned by the agents, we introduce three metrics. Speaker consistency, is a normalized score $\in [ 0 , 1 ]$ which assesses the entropy of $p ( a ^ { k } | m ^ { k } )$ and $p ( m ^ { k } | a ^ { k } )$ to determine how consistently a speaker agent emits a particular symbol when it takes a particular action, and vice versa (the formula is given in Appendix Section 6.3.4). We expect this measure to be high if, for example, the speaker always emits the same symbol when it is cleaning the river. We also introduce two measures of i(1) symbol/action $\mathbf { I C } = I ( m _ { t } ^ { A } ; a _ { t + 1 } ^ { B } )$ dination (IC), which are both measures of mutual information (MI): measures the MI between the influencer/speaker’s symbol and the influencee/listener’s next action, and (2) action/action $\begin{array} { r } { \mathbf { I C } = I ( a _ { t } ^ { A } ; a _ { t + 1 } ^ { B } ) } \end{array}$ measures the MI between the influencer’s action and the influencee’s action in the next timestep. To compute these measures we first average over all trajectory steps, then take the maximum value between any two agents, to determine if any pair of agents are coordinating. Note that these measures are all instantaneous, as they consider only short-term dependencies across two consecutive timesteps, and cannot capture if an agent communicates influential compositional messages, i.e. information that requires several consecutive symbols to transmit and only then affects the other agents behavior.
142
+
143
+ ![](images/cfabcddf1dd58ea122c746b3e02eae517a3782b403a73cf07bb8bc425f0202f7.jpg)
144
+ Figure 8 presents the results. The speaker consistencies metric reveals that agents trained with the influence reward communicate less ambiguously about their own actions, indicating that the emergent communication is more meaningful. The instantaneous coordination metrics demonstrate
145
+ Figure 8: Metrics describing the quality of learned communication protocols. The models trained with influence reward exhibit more consistent communication and more coordination, especially in moments where influence is high.
146
+
147
+ that the baseline agents trained without influence reward show almost no signs of co-ordinating behavior with communication, i.e. speakers saying A and listeners doing B consistently. This result is aligned with both theoretical results in cheap-talk literature (Crawford & Sobel, 1982), and recent empirical results in MARL (e.g. (Foerster et al., 2016; Lazaridou et al., 2018; Cao et al., 2018)).
148
+
149
+ In contrast, we do see highly coordinated behavior between influence agents, but only when we limit the analysis to timesteps on which influence was high (cf. influential moments in Figure 8). If we inspect the results for agents trained with influence on the two tasks, a common pattern emerges: influence is sparse in time. An agent’s influence is only greater than its mean influence in less than $10 \%$ of timesteps. Because the listener agent is not compelled to listen to any given speaker, listeners selectively listen to a speaker only when it is beneficial, and influence cannot occur all the time. Only when the listener decides to change its action based on the speaker’s message does influence occur, and in these moments we observe high $I ( m _ { t } ^ { A } ; a _ { t + 1 } ^ { B } )$ ; an effect that is lost when averaging over the entire trajectory. It appears the influencers have learned a strategy of communicating meaningful information about their own actions, and gaining influence when this becomes relevant enough for the listener to act upon it.
150
+
151
+ Examining the relationship between the reward obtained by individual agents and the degree to which they were influenced by other agents gives a compelling result: agents that are the most influenced also achieve higher individual environmental reward, $\dot { E } ^ { k }$ . We sampled 100 different experimental conditions (i.e., hyper-parameters and random seeds) for both games, collected the influence and individual rewards, normalized them across the 5 agents in each condition, and correlated the resulting list of values. We found that agents who are more often influenced tend to achieve higher task reward in both Cleanup, $\rho = . 6 7$ , $p { < } 0 . 0 0 1$ , and Harvest, $\rho = . 3 4$ , $p { < } 0 . 0 0 1$ . This supports the hypothesis stated in Section 2.3: in order to gain influence from another agent by communicating with it, the communication message should contain information that helps the listener maximize its own environmental reward. Since better listeners/influencees are more successful in terms of task reward, we have evidence that useful information was transmitted to them.
152
+
153
+ # 4.3 INFLUENCE VIA MODELING OTHER AGENTS
154
+
155
+ Finally, we investigate whether the influence reward is still effective when computed without a centralised controller, but rather through each agent’s own internal Model of Other Agents (MOA) network. In this case, we extend the training period from $3 \cdot 1 0 ^ { 8 }$ steps to $5 \cdot 1 0 ^ { 8 }$ , in order to give the MOA model time to train. We also allow the policy LSTM to condition on the actions of other agents in the last timestep. We compare against an ablated version of this architecture (shown in Figure 3), which does not use the output of the MOA module to compute a reward; rather, the MOA module can be thought of as an unsupervised auxiliary task that may help the model to learn a better shared embedding layer, encouraging it to encode information relevant to predicting other agents’ behavior.
156
+
157
+ Figures 6(c) and 6(f) show the collective reward obtained for agents trained with a MOA module. While we see that the auxiliary task does help to improve reward over the A3C baseline, the influence agent gets consistently higher collective reward. Impressively, for Cleanup, the MOA model scores higher than the original influence agents computed using the centralised controller (CC). As shown in Figure 6(c), the MOA baseline also achieves high collective reward, suggesting that the auxiliary task of modeling other agents helps the MOA agents cooperate more effectively in Cleanup. Further, the independent design of the MOA method allows each agent to influence every other agent, thus generating more reward signal and a greater chance to develop two-way cooperative behavior.
158
+
159
+ Table 4 of the Appendix gives the final collective reward obtained by each model for all three experiments. Interestingly, several influence models are able to achieve higher collective reward than the previous state-of-the-art scores for these environments (275 for Cleanup and 750 for Harvest) (Hughes et al., 2018). This is compelling, given that previous work relied on the assumption that agents could view one another’s rewards; we make no such assumption, instead relying only on agents viewing each other’s actions.
160
+
161
+ # 5 DISCUSSION AND CONCLUSIONS
162
+
163
+ The experiments above have demonstrated that an intrinsic social reward based on having causal influence on the actions of other agents consistently improves cooperation and leads to higher collective return in the MA social dilemmas under investigation. In some cases, the influence reward drove agents to learn an emergent communication protocol via their actions. This is compelling, and confirms the connection between maximizing influence and maximizing the mutual information between agents’ actions.
164
+
165
+ However, it is important to consider the limitations of the influence reward. Whether it will always give rise to cooperative behavior may depend on the specifics of the environment, task, and the trade-off between environmental and influence reward. Although influence is arguably necessary for cooperation (e.g. two agents cooperating to lift a box would have a high degree of influence between their actions), it may not be sufficient, in that it may be possible to influence another agent without helping it. For example, it is possible that agents could have gained influence in the tasks studied here by threatening to attack other agents with their fining beam. We believe this type of behavior did not emerge because communicating information represents the cheapest and most effective way to gain influence. Influencers do not have to sacrifice much in terms of their own environmental reward in order to communicate to other agents.
166
+
167
+ Rewarding influence over an explicit communication channel may not be subject to this limitation, because influential communication may be inherently beneficial to the listener (at least in the case where listeners and speakers interact repeatedly). Since listeners can easily ignore communication messages if they do not help to obtain environmental reward, a speaker must transmit valuable information in order to gain influence through communication. There is no advantage to the speaker for communicating unreliably, because it would lose influence with the listener over time (although this is no longer guaranteed in one-shot interactions). Indeed, our results reveal that agents benefit from being influenced by (listening to) communication messages by obtaining higher individual reward, suggesting that the messages contain valuable information. Further, we found that the communication protocols learned via influence reward were more meaningful, and that the influence reward allowed agents to obtain higher collective return. Therefore, we suggest that influence could be a promising way to train emergent communication protocols in various settings.
168
+
169
+ Finally, we have shown that influence can be computed by augmenting agents with an internal model that predicts the actions of other agents, and using this MOA model to simulate the effect of an agent’s actions on others. This represents an important step forward in multi-agent intrinsic social motivation, because it implies that the influence reward can be computed without having access to another agent’s reward function, or requiring a centralised controller.
170
+
171
+ # 5.1 FUTURE WORK
172
+
173
+ Using counterfactuals to allow agents to understand the effects of their actions on other agents could be a promising approach with a number of extensions. Perhaps agents could use counterfactuals to develop a form of ‘empathy‘, by simulating how their actions affect another agent’s value function. Or, social influence could be used to drive coordinated behavior in robots attempting to do cooperative manipulation and control tasks. Finally, if we view multi-agent networks as a single agent, influence could be used as a regularizer to encourage different modules of the network to integrate information from other networks; for example, perhaps it could prevent collapse in hierarchical RL.
174
+
175
+ # REFERENCES
176
+
177
+ Sean L Barton, Nicholas R Waytowich, Erin Zaroukian, and Derrik E Asher. Measuring collaborative emergent behavior in multi-agent reinforcement learning. arXiv preprint arXiv:1807.08663, 2018.
178
+
179
+ Ben Bogin, Mor Geva, and Jonathan Berant. Emergence of communication in an interactive world with consistent speakers. arXiv preprint arXiv:1809.00549, 2018.
180
+
181
+ Kris Cao, Angeliki Lazaridou, Marc Lanctot, Joel Z Leibo, Karl Tuyls, and Stephen Clark. Emergent communication through negotiation. arXiv preprint arXiv:1804.03980, 2018.
182
+
183
+ Philippe Capdepuy, Daniel Polani, and Chrystopher L Nehaniv. Maximization of potential information flow as a universal utility for collective behaviour. In Artificial Life, 2007. ALIFE’07. IEEE Symposium on, pp. 207–213. Ieee, 2007.
184
+
185
+ Edward Choi, Angeliki Lazaridou, and Nando de Freitas. Compositional obverter communication learning from raw visual input. arXiv preprint arXiv:1804.02341, 2018.
186
+
187
+ Jacob W. Crandall, Mayada Oudah, Tennom Chenlinangjia, Fatimah Ishowo-Oloko, Sherief Abdallah, Jean-Franc¸ois Bonnefon, Manuel Cebrian, Azim Shariff, Michael A. Goodrich, and Iyad Rahwan. ´ Cooperating with machines. CoRR, abs/1703.06207, 2017. URL http://arxiv.org/abs/ 1703.06207.
188
+
189
+ Vincent P Crawford and Joel Sobel. Strategic information transmission. Econometrica: Journal of the Econometric Society, pp. 1431–1451, 1982.
190
+
191
+ Sam Devlin, Logan Yliniemi, Daniel Kudenko, and Kagan Tumer. Potential-based difference rewards for multiagent reinforcement learning. In Proceedings of the 2014 international conference on Autonomous agents and multi-agent systems, pp. 165–172. International Foundation for Autonomous Agents and Multiagent Systems, 2014.
192
+
193
+ Heather J. Ferguson, Christoph Scheepers, and Anthony J. Sanford. Expectations in counterfactual and theory of mind reasoning. Language and Cognitive Processes, 25(3):297–346, 2010. doi: 10.1080/ 01690960903041174. URL https://doi.org/10.1080/01690960903041174.
194
+
195
+ Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2137–2145, 2016.
196
+
197
+ Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. arXiv preprint arXiv:1705.08926, 2017.
198
+
199
+ Jakob Foerster, Richard Y Chen, Maruan Al-Shedivat, Shimon Whiteson, Pieter Abbeel, and Igor Mordatch. Learning with opponent-learning awareness. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 122–130. International Foundation for Autonomous Agents and Multiagent Systems, 2018.
200
+
201
+ Sebastien Forestier and Pierre-Yves Oudeyer. A unified model of speech and tool use early development.´ In 39th Annual Conference of the Cognitive Science Society (CogSci 2017), 2017.
202
+
203
+ Felix A Gers, Jurgen Schmidhuber, and Fred Cummins. Learning to forget: Continual prediction with lstm. ¨ 1999.
204
+
205
+ Christian Guckelsberger, Christoph Salge, and Julian Togelius. New and surprising ways to be mean. adversarial npcs with coupled empowerment minimisation. arXiv preprint arXiv:1806.01387, 2018.
206
+
207
+ Yuval Noah Harari. Sapiens: A brief history of humankind. Random House, 2014.
208
+
209
+ Joseph Henrich. The Secret of Our Success: How culture is driving human evolution, domesticating our species, and making us smart. Princeton University Press, Princeton, NJ, 2015. URL http: //press.princeton.edu/titles/10543.html.
210
+
211
+ Esther Herrmann, Josep Call, Mar´ıa Victoria Hernandez-Lloreda, Brian Hare, and Michael Tomasello. \` Humans have evolved specialized skills of social cognition: The cultural intelligence hypothesis. Science, 317(5843):1360–1366, 2007. ISSN 0036-8075. doi: 10.1126/science.1146282. URL http: //science.sciencemag.org/content/317/5843/1360.
212
+
213
+ Edward Hughes, Joel Z Leibo, Matthew G Phillips, Karl Tuyls, Edgar A Due´nez-Guzm ˜ an, Antonio Garc ´ ´ıa Castaneda, Iain Dunning, Tina Zhu, Kevin R McKee, Raphael Koster, et al. Inequity aversion improves ˜ cooperation in intertemporal social dilemmas. In Advances in neural information processing systems (NIPS), Montreal, Canada, 2018.
214
+
215
+ Alexander S Klyubin, Daniel Polani, and Chrystopher L Nehaniv. Empowerment: A universal agent-centric measure of control. In Evolutionary Computation, 2005. The 2005 IEEE Congress on, volume 1, pp. 128–135. IEEE, 2005.
216
+
217
+ Kevin N. Laland. Darwin’s unfinished symphony $\therefore$ how culture made the human mind / Kevin N. Laland. Princeton University Press Princeton, 2017. ISBN 9781400884872 140088487.
218
+
219
+ Angeliki Lazaridou, Karl Moritz Hermann, Karl Tuyls, and Stephen Clark. Emergence of linguistic communication from referential games with symbolic and pixel input. arXiv preprint arXiv:1804.03984, 2018.
220
+
221
+ Joel Z Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. In Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems, pp. 464–473. International Foundation for Autonomous Agents and Multiagent Systems, 2017.
222
+
223
+ Joseph T Lizier and Mikhail Prokopenko. Differentiating information transfer and causal effect. The European Physical Journal B, 73(4):605–615, 2010.
224
+
225
+ Alicia P Melis and Dirk Semmann. How is human cooperation different? Philosophical Transactions of the Royal Society of London B: Biological Sciences, 365(1553):2663–2674, 2010.
226
+
227
+ 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.
228
+
229
+ Pierre-Yves Oudeyer and Fred´ eric Kaplan. Discovering communication. ´ Connection Science, 18(2): 189–206, 2006.
230
+
231
+ Pierre-Yves Oudeyer and Linda B Smith. How evolution may work through curiosity-driven developmental process. Topics in Cognitive Science, 8(2):492–502, 2016.
232
+
233
+ Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017.
234
+
235
+ Judea Pearl and Dana Mackenzie. The Book of Why: The New Science of Cause and Effect. Basic Books, 2018.
236
+
237
+ Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. Causal inference in statistics: a primer. John Wiley & Sons, 2016.
238
+
239
+ Julien Perolat, Joel Z Leibo, Vinicius Zambaldi, Charles Beattie, Karl Tuyls, and Thore Graepel. A multi-agent reinforcement learning model of common-pool resource appropriation. In Advances in Neural Information Processing Systems, pp. 3643–3652, 2017.
240
+
241
+ Alexander Peysakhovich and Adam Lerer. Prosocial learning agents solve generalized stag hunts better than selfish ones. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2043–2044. International Foundation for Autonomous Agents and Multiagent Systems, 2018.
242
+
243
+ Neil C Rabinowitz, Frank Perbet, H Francis Song, Chiyuan Zhang, SM Eslami, and Matthew Botvinick. Machine theory of mind. arXiv preprint arXiv:1802.07740, 2018.
244
+
245
+ Thomas C Schelling. Hockey helmets, concealed weapons, and daylight saving: A study of binary choices with externalities. Journal of Conflict resolution, 17(3):381–428, 1973.
246
+
247
+ Jurgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). ¨ IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
248
+
249
+ Pedro Sequeira, Francisco S Melo, Rui Prada, and Ana Paiva. Emerging social awareness: Exploring intrinsic motivation in multiagent learning. In Development and Learning (ICDL), 2011 IEEE International Conference on, volume 2, pp. 1–6. IEEE, 2011.
250
+
251
+ Satinder P. Singh, Andrew G. Barto, and Nuttapong Chentanez. Intrinsically motivated reinforcement learning. In Advances in Neural Information Processing Systems 17 [Neural Information Processing Systems, NIPS 2004, December 13-18, 2004, Vancouver, British Columbia, Canada], pp. 1281–1288, 2004. URL http://papers.nips.cc/paper/ 2552-intrinsically-motivated-reinforcement-learning.
252
+
253
+ Katherine KM Stavropoulos and Leslie J Carver. Research review: social motivation and oxytocin in autism–implications for joint attention development and intervention. Journal of Child Psychology and Psychiatry, 54(6):603–618, 2013.
254
+
255
+ DJ Strouse, Max Kleiman-Weiner, Josh Tenenbaum, Matt Botvinick, and David Schwab. Learning to share and hide intentions using information regularization. arXiv preprint arXiv:1808.02093, 2018.
256
+
257
+ Satohiro Tajima, Toru Yanagawa, Naotaka Fujii, and Taro Toyoizumi. Untangling brain-wide dynamics in consciousness by cross-embedding. PLoS computational biology, 11(11):e1004537, 2015.
258
+
259
+ Michael Tomasello. Why we cooperate. MIT press, 2009.
260
+
261
+ Carel P van Schaik and Judith M Burkart. Social learning and evolution: the cultural intelligence hypothesis. Philosophical Transactions of the Royal Society B: Biological Sciences, 366(1567):1008–1016, 2011.
262
+
263
+ Karl von Frisch. The dance language and orientation of bees. 5, 06 1969.
264
+
265
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
266
+
267
+ Chao Yu, Minjie Zhang, and Fenghui Ren. Emotional multiagent reinforcement learning in social dilemmas. In International Conference on Principles and Practice of Multi-Agent Systems, pp. 372–387. Springer, 2013.
268
+
269
+ # 6 APPENDIX
270
+
271
+ # 6.1 SEQUENTIAL SOCIAL DILEMMAS
272
+
273
+ In each of the sequential social dilemma (SSD) games studied above, an agent is rewarded $+ 1$ for every apple it collects, but the apples are a limited resource. In Harvest (a tragedy of the commons game), apples regenerate more slowly the faster they are harvested, and if an exploiting agent consumes all of the apples, they will not grow back; agents must cooperate to harvest sustainably. In Cleanup (a public goods game), apples are generated based on the amount of waste in a nearby river. Agents can use a cleaning beam action to clean the river when they are positioned in it; or they can simply consume the apples the other agent produces. Agents also have a fining beam action which they can use to fine nearby agents $- 5 0$ reward.
274
+
275
+ Figure 9 gives the Schelling diagram for both SSD tasks under investigation. A Schelling diagram (Schelling, 1973; Perolat et al., 2017) shows the relative payoffs for a single agent’s strategy given a fixed number of other agents who are cooperative. Schelling diagrams generalize payoff matrices to multi-agent settings, and make it easy to visually recognize game-theoretic properties like Nash equilibria (see Schelling (1973) for more details).
276
+
277
+ ![](images/cd8620142473269dee9b7be7e5b1fb98864ebd4ee20a85b56ccae63f16b46cc2.jpg)
278
+ Figure 9: Schelling diagrams for the two social dilemma tasks show that an individual is almost always motivated to defect, even though the group will get higher reward if there are more cooperators.
279
+
280
+ # 6.2 ADDITIONAL EXPERIMENT - BOX TRAPPED
281
+
282
+ As a proof-of-concept experiment to test whether the influence reward works as expected, we constructed a special environment, shown in Figure 10. In this environment, one agent (teal) is trapped in a box. The other agent (purple) has a special action it can use to open the box... or it can simply choose to consume apples, which exist outside the box and are inexhaustible in this environment.
283
+
284
+ As expected, a vanilla A3C agent learns to act selfishly; the purple agent will simply consume apples, and chooses the open box action in $0 \%$ of trajectories once the policy has converged. A video of A3C agents trained in this environment is available at: https://youtu.be/C8SE9_ $\Upsilon \mathrm { K z x I }$ , which shows that the purple agent leaves its compatriot trapped in the box throughout the trajectory.
285
+
286
+ ![](images/3f18791740d5f30d7f41c7fce3b78ff4b93cfac39e1f81dcfeb16188b74db18f.jpg)
287
+ Figure 10: The Box trapped environment in which the teal agent is trapped, and the purple agent can release it with a special open box action.
288
+
289
+ In contrast, an agent trained with the social influ
290
+ ence reward chooses the open box action in $88 \%$ of trajectories, releasing its fellow agent so that they are both able to consume apples. A video of this behavior is shown at: https://youtu.be/Gfo248-qt3c. Further, as Figure 11(a) reveals, the purple influencer agent usually chooses to open the box within the first few steps of the trajetory, giving its fellow agent more time to collect reward.
291
+
292
+ Most importantly though, Figure 11(b) shows the influence reward over the course of a trajectory in the Box trapped environment. The agent chooses the open box action in the second timestep; at this point, we see a corresponding spike in the influence reward. This reveals that the influence reward works as expected, incentivizing an action which has a strong — and in this case, prosocial — effect on the other agent’s behavior.
293
+
294
+ ![](images/87f2f4c8939684aaa1a065bb1bd2a40dcabf6619e1b311cd76ab190958323091.jpg)
295
+
296
+ (a) Number of times the open box action occurs at each trajectory step over 100 trajectories.
297
+
298
+ ![](images/aa590ebca444f816660ca98874365417e4da0912c85a637d878b313133db889b.jpg)
299
+ (b) Influence reward over a trajectory in Box trapped
300
+ Figure 11: The Box trapped proof-of-concept experiment reveals that an agent gets high influence for letting another agent out of a box in which it is trapped.
301
+
302
+ # 6.3 IMPLEMENTATION DETAILS
303
+
304
+ All models are trained with a single convolutional layer with a kernel of size 3, stride of size 1, and 6 output channels. This is connected to two fully connected layers of size 32 each, and an LSTM with 128 cells. We use a discount factor $\gamma = . 9 9$ . The number of agents $N$ is fixed to 5.
305
+
306
+ As mentioned in Section 2.2, the social influence reward can be computed using a number of divergence measures, including JSD. We also experiment with training the agents using the pointwise mutual information (the innermost term of Eq. 3), which is given by:
307
+
308
+ $$
309
+ p m i ( a ^ { A } ; a ^ { B } | Z { = } z ) { = } \log \frac { p ( a ^ { B } | a ^ { A } , z ) } { p ( a ^ { B } | z ) } { = } \mathrm { l o g } \frac { p ( a ^ { A } , a ^ { B } | z ) } { p ( a ^ { A } | z ) p ( a ^ { B } | z ) } .
310
+ $$
311
+
312
+ This PMI term is precisely the local information flow proposed by Lizier & Prokopenko (2010) as a measure of direct causal effect; the expectation of the PMI over $p \dot { ( } a ^ { B } , a ^ { A } | z )$ is the MI. and gives us a measure of influence of a single action of $A$ on the single action taken by $B$ .
313
+
314
+ In addition to the comparison function used to compute influence, there are many other hyperparameters that can be tuned for each model. We use a random search over hyperparameters, ensuring a fair comparison with the search size over the baseline parameters that are shared with the influence models. For all models we search for the optimal entropy reward and learning rate, where we anneal the learning rate from an initial value lr init to lr final. The below sections give the parameters found to be most effective for each of the three experiments.
315
+
316
+ # 6.3.1 CENTRALISED CONTROLLER HYPERPARAMETERS
317
+
318
+ In this setting we vary the number of influencers from 1−4, the influence reward weight $\beta$ , and the number of curriculum steps over which the weight of the influence reward is linearly increased $C$ . In this setting, since we have a centralised controller, we also experiment with giving the influence reward to the agent being influenced as well, and find that this sometimes helps. This ‘influencee’ reward is not used in the other two experiments, since it precludes independent training. The hyperparameters found to give the best performance for each model are shown in Table 1.
319
+
320
+ # 6.3.2 COMMUNICATION HYPERPARAMETERS
321
+
322
+ Because the communication models have an extra A2C output head for the communication policy, we use an additional entropy regularization term just for this head, and apply a weight to the communication loss in the loss function. We also vary the number of communication symbols that the agents can emit, and the size of the linear layer that connects the LSTM to the communication policy layer, which we term the communication embedding size. Finally, in the communication regime, we experiment to setting the weight on the extrinsic reward E, $\alpha$ , to zero. The best hyperparameters for each of the communication models are shown in Table 2.
323
+
324
+ Table 1: Optimal hyperparameter settings for the models in the centralised controller experiment.
325
+
326
+ <table><tr><td rowspan="2">Hyperparameter</td><td colspan="3">Cleanup</td><td colspan="3">Harvest</td></tr><tr><td>A3C</td><td>Visibleactions</td><td>Influence</td><td>A3C baseline</td><td>Visibleactions</td><td>Influence</td></tr><tr><td>Entropy reg.</td><td>baseline .00176</td><td>baseline .00176</td><td>.000248</td><td>.000687</td><td>baseline .00184</td><td>.00025</td></tr><tr><td>lr_init</td><td>.00126</td><td>.00126</td><td>.00107</td><td>.00136</td><td>.00215</td><td>.00107</td></tr><tr><td>lr_end</td><td>.000012</td><td>.000012</td><td>.000042</td><td>.000028</td><td>.000013</td><td>.000042</td></tr><tr><td>Number of influencers</td><td></td><td>3</td><td>1</td><td></td><td>3</td><td>3</td></tr><tr><td>Influence weight β</td><td></td><td>0</td><td>.146</td><td></td><td>0</td><td>.224</td></tr><tr><td>Curriculum C</td><td></td><td>1</td><td>140</td><td></td><td>1</td><td>140</td></tr><tr><td>Policy comparison</td><td></td><td></td><td>JSD</td><td></td><td></td><td>PMI</td></tr><tr><td>Influencee reward</td><td></td><td></td><td>1</td><td></td><td></td><td>0</td></tr></table>
327
+
328
+ Table 2: Optimal hyperparameter settings for the models in the communication experiment.
329
+
330
+ <table><tr><td rowspan="2">Hyperparameter</td><td colspan="3">Cleanup</td><td colspan="2">Harvest</td></tr><tr><td>A3C baseline</td><td>Comm. baseline</td><td>Influence comm.</td><td>A3C Comm. baseline baseline</td><td></td><td>Influence comm.</td></tr><tr><td>Entropy reg.</td><td>.00176</td><td>.000249</td><td>.00305</td><td>.000687</td><td>.000174</td><td>.00220</td></tr><tr><td>lr_init</td><td>.00126</td><td>.00223</td><td>.00249</td><td>.00136</td><td>.00137</td><td>.000413</td></tr><tr><td>lr_end</td><td>.000012</td><td>.000022</td><td>.0000127</td><td>.000028</td><td>.0000127</td><td>.000049</td></tr><tr><td>Influence weight β</td><td>=</td><td>0</td><td>2.752</td><td>=</td><td>0</td><td>4.825</td></tr><tr><td>Extrinsic reward</td><td></td><td></td><td>0</td><td></td><td></td><td>1.0</td></tr><tr><td>weight α</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Curriculum C</td><td></td><td></td><td>1 KL</td><td></td><td></td><td>8</td></tr><tr><td>Policy comparison</td><td></td><td></td><td>.000789</td><td></td><td></td><td>KL</td></tr><tr><td>Comm. entropy reg.</td><td></td><td></td><td>.0758</td><td></td><td></td><td>.00208</td></tr><tr><td>Comm. loss weight</td><td></td><td></td><td>9</td><td></td><td></td><td>.0709</td></tr><tr><td>Symbol vocab size</td><td></td><td></td><td>32</td><td></td><td></td><td>7</td></tr><tr><td>Comm. embedding</td><td></td><td></td><td></td><td></td><td></td><td>16</td></tr></table>
331
+
332
+ Table 3: Optimal hyperparameter settings for the models in the model of other agents (MOA) experiment.
333
+
334
+ <table><tr><td rowspan="2">Hyperparameter</td><td colspan="3">Cleanup</td><td colspan="3">Harvest</td></tr><tr><td>A3C baseline</td><td>MOA baseline</td><td>Influence MOA</td><td>A3C baseline</td><td>MOA baseline</td><td>Influence MOA</td></tr><tr><td>Entropy reg.</td><td>.00176</td><td>.00176</td><td>.00176</td><td>.000687</td><td>.00495</td><td>.00223</td></tr><tr><td>lr_init</td><td>.00126</td><td>.00123</td><td>.00123</td><td>.00136</td><td>.00206</td><td>.00120</td></tr><tr><td>lr_end</td><td>.000012</td><td>.000012</td><td>.000012</td><td>.000028</td><td>.000022</td><td>.000044</td></tr><tr><td>Influence weight β</td><td></td><td>0</td><td>.620</td><td>=</td><td>0</td><td>2.521</td></tr><tr><td>MOA loss weight</td><td></td><td>1.312</td><td>15.007</td><td>=</td><td>1.711</td><td>10.911</td></tr><tr><td>Curriculum C</td><td></td><td>-</td><td>40</td><td>=</td><td>1</td><td>226</td></tr><tr><td>Policy comparison</td><td></td><td>=</td><td>KL</td><td>=</td><td>=</td><td>KL</td></tr><tr><td>Train MOA only</td><td></td><td>False</td><td>True</td><td></td><td>False</td><td>True</td></tr><tr><td>when visible</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
335
+
336
+ # 6.3.3 MODEL OF OTHER AGENTS (MOA) HYPERPARAMETERS
337
+
338
+ The MOA hyperparameters include whether to only train the MOA with cross-entropy loss on the actions of agents that are visible, and how much to weight the supervised loss in the overall loss of the model. The best hyperparameters are shown in Table 3.
339
+
340
+ <table><tr><td></td><td>Cleanup</td><td>Harvest</td></tr><tr><td>A3Cbaseline</td><td>89</td><td>485</td></tr><tr><td>Inequity aversion (Hughes et al., 2018)</td><td>275</td><td>750</td></tr><tr><td>Influence - Basic</td><td>190</td><td>1073</td></tr><tr><td>Influence - Communication</td><td>166</td><td>951</td></tr><tr><td>Influence -Model of other agents</td><td>392</td><td>588</td></tr></table>
341
+
342
+ Table 4: Final collective reward over the last 50 agent steps for each of the models considered. Bolded entries represent experiments in which the influence models significantly outperformed the scores reported in previous work on inequity aversion(Hughes et al., 2018). This is impressive, considering the inequity averse agents are able to view all other agents’ rewards. We make no such assumption, and yet are able to achieve similar or superior performance.
343
+
344
+ # 6.3.4 COMMUNICATION ANALYSIS
345
+
346
+ The speaker consistency metric is calculated as:
347
+
348
+ $$
349
+ \sum _ { k = 1 } ^ { N } 0 . 5 [ \sum _ { c } 1 - \frac { H ( p ( a ^ { k } | m ^ { k } = c ) ) } { H _ { m a x } } + \sum _ { a } 1 - \frac { H ( p ( m ^ { k } | a ^ { k } = a ) ) } { H _ { m a x } } ] ,
350
+ $$
351
+
352
+ where $H$ is the entropy function and $H _ { m a x }$ is the maximum entropy based on the number of discrete symbols or actions. The goal of the metric is to measure how much of a 1:1 correspondence exists between a speaker’s action and the speaker’s communication message.
353
+
354
+ # 6.4 ADDITIONAL RESULTS
355
+
356
+ Figure 12 shows an additional moment of high influence in the Cleanup game. The purple influencer agent can see the area within the white box, and therefore all of the apple patch. The field-of-view of the magenta influencee is outlined with the magenta box; it cannot see if apples have appeared, even though it has been cleaning the river, which is the action required to cause apples to appear. When the purple influencer turns left and does not move towards the apple patch, this signals to the magenta agent that no apples have appeared, since otherwise the influence would move right.
357
+
358
+ ![](images/fda9989ec537ce17189a8d0151565ce65db1893467693e2932bcd54bd93d57e3.jpg)
359
+ Figure 12: A moment of high influence between the purple influencer and magenta influencee.
360
+
361
+ Table 4 presents the final collective reward obtained by each of the models tested in the experiments presented in Section 4. We see that in several cases, the influence agents are even able to out-perform the state-of-the-art results on these tasks reported by Hughes et al. (2018), despite the fact that the solution proposed by Hughes et al. (2018) requires that agents can view other agents’ rewards, whereas we do not make this assumption, and instead only require that agents can view each others’ actions.
362
+
363
+ It is important to note that collective reward is not always the perfect metric of cooperative behavior, a finding that was also discovered by Barton et al. (2018) and emphasized by Leibo et al. (2017). In the case, we find that there is a spurious solution to the Harvest game, in which one agent fails to learn and fails to collect any apples. This leads to very high collective reward, since it means there is one fewer agent that can exploit the others, and makes sustainable harvesting easier to achieve. Therefore, for the results shown in the paper, we eliminate any random seed in Harvest for which one of the agents has failed to learn to collect apples, as in previous work (Hughes et al., 2018).
364
+
365
+ However, here we also present an alternative strategy for assessing the overall collective outcomes: weighting the total collective reward by an index of equality of the individual returns. Specifically, we compute the Gini coefficient over the $N$ agents’ individual returns:
366
+
367
+ $$
368
+ G = \frac { \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \left| { r ^ { i } - r ^ { j } } \right| } { 2 N \sum _ { i = 1 } ^ { N } r ^ { i } } ,
369
+ $$
370
+
371
+ which gives us a measure of the inequality of the returns, where $G \in [ 0 , 1 ]$ , with $G = 0$ indicating perfect equality. Thus, $1 - G$ is a measure of equality; we use this to weight the collective reward for each experiment, and plot the results in Figure 13. Once again, we see that the influence models give the highest final performance, even with this new metric.
372
+
373
+ ![](images/c923ae01cca519ebc26562fb33c66fec40b0011ec5f33643088a3be15814576d.jpg)
374
+ Figure 13: Total collective reward times equality, $R * ( 1 - G )$ , obtained in all experiments. Error bars show a $9 9 . 5 \%$ confidence interval (CI) over 5 random seeds, computed within a sliding window of 200 agent steps. Once again, the models trained with influence reward (red) significantly outperform the baseline and ablated models.
375
+
376
+ Finally, we would like to show that the influence reward is robust to the choice of hyperparameter settings. Therefore, in Figure 14, we plot the collective reward of the top 5 best hyperparameter settings for each experiment, over 5 random seeds each. Once again, the influence models result in higher collective reward, which provides evidence that the model is robust to the choice of hyperparameters.
377
+
378
+ ![](images/1408fa6f4ede73df1fdda59c904bd76d77d6315c5152307ac31700974d00769d.jpg)
379
+ Figure 14: Total collective reward over the top 5 hyperparameter settings, with 5 random seeds each, for all experiments. Error bars show a $9 9 . 5 \%$ confidence interval (CI) computed within a sliding window of 200 agent steps. The influence models still maintain an advantage over the baselines and ablated models, suggesting the technique is robust to the hyperparameter settings.
380
+
381
+ # 6.4.1 OPTIMIZING FOR COLLECTIVE REWARD
382
+
383
+ In this section we include the results of training explicitly prosocial agents, which directly optimize for the collective reward of all agents. Previous work (e.g. Peysakhovich & Lerer (2018)) has shown that training agents to optimize for the rewards of other agents can help the group to obtain better collective outcomes. Following a similar prown individual reward $E ^ { k }$ ple, we implemented agents that optimize foand the collective reward of all other agents, $\textstyle \sum _ { i = 1 , i \neq k } ^ { N } E ^ { i }$ mbination of their. Thus, the reward function for agent $k$ is $\begin{array} { r } { { R ^ { k } } = E ^ { k } + \eta \sum _ { i = 1 , i \neq k } ^ { N } E ^ { i } } \end{array}$ . We conducted the same hyperparameter search over the parameters mentioned in Section 6.3.1 varying the weight placed on the collective reward, $\eta \in [ 0 , 2 ]$ .
384
+
385
+ As expected, we find that agents trained to optimize for collective reward attain higher collective reward in both Cleanup and Harvest, as is shown in Figure 15. In both games, the optimal value for $\eta = 0 . 8 5$ .
386
+
387
+ ![](images/fe3d4f89e8a19d1b5fe2a4f19403d717b5760772f2debd3fb1d1b879cb6bc09c.jpg)
388
+ Figure 15: Total collective reward obtained by agents trained to optimize for the collective reward, for the 5 best hyperparameter settings with 5 random seeds each. Error bars show a $9 9 . 5 \%$ confidence interval (CI) computed within a sliding window of 200 agent steps.
389
+
390
+ Interestingly, however, the equality in the individual returns for these agents is extremely low. Across the hyperparameter sweep, no solution to the Cleanup game which scored more than 20 points in terms of collective return was found in which all agents scored an individual return above 0. It seems that in Cleanup, when agents are trained to optimize for collective return, they converge on a solution in which some agents never receive any reward.
391
+
392
+ Note that training agents to optimize for collective reward requires that each agent can view the rewards obtained by other agents. As discussed previously, the social influence reward is a novel way to obtain cooperative behavior, that does not require making this assumption.
md/train/BJg15lrKvS/BJg15lrKvS.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/BJxLH2AcYX/BJxLH2AcYX.md ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UNSUPERVISED MULTI-TARGET DOMAIN ADAPTATION:AN INFORMATION THEORETIC APPROACH
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Unsupervised domain adaptation (uDA) models focus on pairwise adaptation settings where there is a single, labeled, source and a single target domain. However, in many real-world settings one seeks to adapt to multiple, but somewhat similar, target domains. Applying pairwise adaptation approaches to this setting may be suboptimal, as they fail to leverage shared information among multiple domains. In this work, we propose an information theoretic approach for domain adaptation in the novel context of multiple target domains with unlabeled instances and one source domain with labeled instances. Our model aims to find a shared latent space common to all domains, while simultaneously accounting for the remaining private, domain-specific factors. Disentanglement of shared and private information is accomplished using a unified information-theoretic approach, which also serves to establish a stronger link between the latent representations and the observed data. The resulting model, accompanied by an efficient optimization algorithm, allows simultaneous adaptation from a single source to multiple target domains. We test our approach on three challenging publicly-available datasets, showing that it outperforms several popular domain adaptation methods.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ In real-world data, the training and test instances often do not come from the same underlying distribution (Sun et al. (2016)). For example, in the task of object recognition/classification from image data, this may be due to the image noise, changes in the object view, etc., which induce different biases in the observed data sampled during the training and test stage. Consequently, assumptions made by traditional learning algorithms are often violated, resulting in degradation of the algorithms’ performance during inference of test data. Domain Adaptation (DA) approaches (Fernando et al. (2013); Gong et al. (2012); Kodirov et al. (2015); Yoo et al. (2016)) aim to tackle this by transferring knowledge from a source domain (training data) to an unlabeled target domain (test data) to reduce the discrepancy between the source and target data distributions, typically by exploring domain-invariant data structures.
12
+
13
+ Existing DA methods tackle the adaptation problems in one of the two settings: (semi)supervised DA and unsupervised DA (Csurka (2017)). The former assume that in addition to the labeled data of the source domain, some labeled data from the target domain are also available for training/adapting the classifiers. In contrast, the latter does not require any labels from the target domain but rather explores the similarity in the data distributions of the two domains. In this work, we focus on the unsupervised DA (uDA) scenario, which is more challenging due to the lack of correspondences in source and target labels.
14
+
15
+ Most works on uDA today focus on a single-source-single-target-domain scenario. However, in many real-world applications, unlabeled data may come from different domains, thus, with different statistical properties but with common task-related content. For instance, we may have access to images of the same class of objects (e.g., cars) recorded by various types of cameras, and/or under different camera views and at different times, rendering multiple different domains (e.g., datasets). Likewise, facial expressions of emotions, such as joy and surprise, shown by different people and recorded under different views, result in multiple domains with varying data distributions. In most cases, these domains have similar underlying data distributions, which can be leveraged to build more effective and robust classifiers for tasks such as the object or emotion recognition across multiple datasets/domains. To this end, traditional uDA methods focus on the single-source-single-target DA scenario. However, in the presence of multiple domains, as typically encountered in real-world settings, this pair-wise adaptation approach may be suboptimal as it fails to leverage simultaneously the knowledge shared across multiple task-related domains. Recently, Zhao et al. (2017) showed that by having access to multiple source domains can facilitate better adaptation to a single target domain, when compared to the pair-wise DA approach. While this is intuitive due to the access to multiple labelled source domains, offering more adaptation flexibility for the target domain (i.e., by efficiently exploring the data labels across multiple source domains that are most related to the target domain), it comes at the expense of the data labelling in multiple source domains, which can be costly and time-consuming. In either case, a single source domain or readily available multiple source domains, to the best of our knowledge, a simultaneous adaptation to multiple and unlabelled target domains remains an unexplored DA scenario. However, this DA scenario is important as we usually have access to multiple unlabeled domains; yet, the adaptation process is also more challenging due to the lack of supervision in the target domains. Still, multi-target DA can have advantages over a single-target DA when: (i) there is direct knowledge sharing between the source and multiple target domains (fig. 1a), and (ii) the source and a target domain are related through another target domain (fig. 1b). While this seems intuitive, it is critical how the data from multiple unlabelled target domains are leveraged within the multi-target DA approach, in order to improve its performance over the single target DA approaches and naive fusion of multiple target domains.
16
+
17
+ ![](images/36886e0179e0304a2140f74c7b598abbe23c7d9c3021a983addc10b904e84af3.jpg)
18
+ Figure 1: Illustration of domains with common (a) and pairwise-shared spaces (b). We tackle the domain adaptation task when all domains share a common task/space, which is then leveraged to transfer knowledge across multiple target domains.
19
+
20
+ To this end, we propose a Multi-Target DA-Information-Theoretic-Approach (MTDA-ITA) for single-sourcemulti-target DA. We exploit a single source domain and focus on multiple target domains to investigate the effects of multi-target DA; however, the proposed approach can easily be extended to multiple source domains. This approach leverages the data from multiple target domains to improve performance compared to individually learning from pair-wise source-target domains. Specifically, we simultaneously factorize the information from each available target domain and learn separate subspaces for modeling the shared (i.e., correlated across the domains) and private (i.e., independent between the domains) subspaces of the data (Salzmann et al. (2010)). To this end, we employ deep learning to derive an information theoretic approach where we jointly maximize the mutual information between the domain labels and private (domain-specific) features, while minimizing the mutual information between the the domain labels and the shared (domaininvariant) features. Consequently, the more robust feature representations are learned for each target domain by exploiting dependencies between multiple target domains. We show on benchmark datasets for DA that this approach leads to overall improved performance on each target domain, compared to independent DA for each pair of source-target domains, or the naive combination of multiple target domains, and state-of-the-art models applicable to the target task.
21
+
22
+ # 2 THE PROPOSED METHOD
23
+
24
+ Without loss of generality, we consider a multi-class ( $K$ -class) classification problem as the running example. Furthermore, let $( \mathbf { X } , \mathbf { Y } , \mathbf { D } ) = \{ ( \pmb { x } _ { i } , \pmb { y } _ { i } , \pmb { d } _ { i } ) \} _ { i = 0 } ^ { N }$ be a collection of $M$ domains (a labeled source domain, and $M - 1$ unlabeled target domains), where $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ denotes the $i$ -th sample, and $\pmb { y } _ { i } = [ y _ { i } ^ { 1 } , y _ { i } ^ { 2 } , . . . , y _ { i } ^ { K } ]$ and $d _ { i } = [ d _ { i } ^ { 1 } , d _ { i } ^ { 2 } , . . . , d _ { i } ^ { M } ]$ are the $K$ -D and $M$ -D encoding of the class and domain labels for $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , respectively. Note that the class labels are only available for the source samples.
25
+
26
+ The latent space representation of the data point $_ { \textbf { \em x } }$ is denoted as $\boldsymbol { z } = [ z _ { s } , z _ { p } ]$ , where $z _ { s }$ and $z _ { p }$ are the (latent) shared and private features of the data point $_ { \textbf { \em x } }$ , respectively. By factorizing the joint distribution $p ( { \pmb x } , { \pmb y } , d , z _ { s } , z _ { p } )$ as
27
+
28
+ $$
29
+ \begin{array} { r } { p ( { \pmb x } , { \pmb y } , { \pmb d } , z _ { s } , z _ { p } ) = p ( { \pmb x } ) p ( { \pmb d } ) p ( z _ { s } | { \pmb x } ) p ( z _ { p } | { \pmb x } ) p ( { \pmb y } | z _ { s } ) , } \end{array}
30
+ $$
31
+
32
+ we propose to maximize the following objective function:
33
+
34
+ $$
35
+ \begin{array} { r } { \boldsymbol { \mathcal { L } } ( \boldsymbol { \theta } _ { s } , \boldsymbol { \theta } _ { p } , \boldsymbol { \theta } _ { c } ; \boldsymbol { x } , \boldsymbol { y } , \boldsymbol { d } ) = \lambda _ { r } \boldsymbol { I } ( \boldsymbol { x } ; \boldsymbol { z } ) + \lambda _ { c } \boldsymbol { I } ( \boldsymbol { y } ; \boldsymbol { z } _ { s } ) + \lambda _ { d } \big ( \boldsymbol { I } ( \boldsymbol { d } ; \boldsymbol { z } _ { p } ) - \boldsymbol { I } ( \boldsymbol { d } ; \boldsymbol { z } _ { s } ) \big ) , } \end{array}
36
+ $$
37
+
38
+ where $p ( { \pmb x } )$ and $p ( d )$ denote the underlying (true) data distribution and domain label distribution, respectively, $I ( { \pmb x } ; { \pmb y } )$ denotes the Mutual Information between the random variables $_ { \textbf { \em x } }$ and $\textbf { { y } }$ . $\lambda _ { r } , \lambda _ { c }$ and $\lambda _ { d }$ denote the hyper-parameters controlling the weights of the objective terms. The proposed objective function (2) maximizes the three terms described below:
39
+
40
+ • $I ( { \pmb x } ; z )$ : encourages the latent features (both shared and private) to preserve information about the data samples (that can be used to reconstruct $_ { \textbf { \em x } }$ from $_ { z }$ ).
41
+ • $I ( \pmb { y } ; \pmb { z } _ { s } )$ : enables to correctly predict the true class label of the samples out of their common shared features.
42
+ • $I ( d ; z _ { p } ) - I ( d ; z _ { s } )$ : encourages the latent private features to preserve the information about the domain label and penalizes the latent shared features to be domain informative. This not only reduces the redundancy in the shared and private features, but also, penalizes the redundancy of different private spaces, while preserving the shared information.
43
+
44
+ An additional term could be used to minimize the mutual information between the shared $( z _ { s } )$ and private $( z _ { p } )$ features. However, computing the mutual information (even approximating it) is intractable due to the highly complex joint distribution $p ( z _ { s } , z _ { p } )$ . Since we want $z _ { s }$ and $z _ { p }$ features to encode different aspects of $_ { \textbf { \em x } }$ , we enforce such constraint by jointly maximizing the term: $I ( d ; \dot { z } _ { p } ) - I ( d ; z _ { s } )$ .
45
+
46
+ # 2.1 OPTIMIZATION
47
+
48
+ The following lower bound for mutual information is derived using the non-negativity of KL-divergence (Barber & Agakov (2003)); i.e., $\begin{array} { r } { \Sigma _ { { \pmb x } } p ( { \pmb x } | z ) \ln \frac { p ( { \pmb x } | z ) } { q ( { \pmb x } | z ) } \ge 0 } \end{array}$ gives:
49
+
50
+ $$
51
+ I ( \pmb { x } ; z ) \geq H ( \pmb { x } ) + \mathbb { E } _ { p ( \pmb { x } , z ) } [ \ln q ( \pmb { x } | z ; \phi ) ]
52
+ $$
53
+
54
+ where $H ( { \pmb x } )$ denotes the Shanon Entropy (Lin (1991)) of the random variable $_ { \textbf { \em x } }$ . $q ( { \pmb x } | { \pmb z } ; { \pmb \phi } )$ is any arbitrary distribution parameterized by $\phi$ . We need a variational distribution $q ( { \pmb x } | { \pmb z } ; \phi )$ because the posterior distribution $p ( \pmb { x } | \pmb { z } ) = p ( \pmb { z } | \pmb { x } ) p ( \pmb { x } ) / p ( \pmb { z } )$ is intractable since the true data distribution $p ( { \pmb x } )$ is assumed to be unknown. Similarly, we can derive lower bounds for $I ( d ; z _ { p } ) \geq H ( d ) + \mathbb { E } _ { p ( d , z _ { p } ) } [ \ln q ( d | z _ { p } ; \psi ) ]$ and $I ( d ; z _ { s } ) \geq$
55
+
56
+ ![](images/8e3477bd318324bc4827d471de794c2c830ef3f1de87446abdf6c005292de940.jpg)
57
+ Figure 2: MDTA-ITA: The encoder $E _ { s } ( { \pmb x } )$ captures the feature representations $( z _ { s } )$ for a given input sample $_ { \pmb { x } }$ that are shared among domains. $E _ { p } ( { \pmb x } )$ captures domain–specific private features $( z _ { p } )$ using the shared private encoder. The shared decoder $F \big ( z _ { p } , z _ { s } \big )$ learns to reconstruct the input sample by using both the private and shared features. The domain classifier $D$ learns to correctly predict the domain labels of the actual samples from both their shared and private features while the classifier $C$ learns to correctly predict the class labels from the shared features.
58
+
59
+ $H ( d ) + \mathbb { E } _ { p ( d , z _ { s } ) } [ \ln q ( d | z _ { s } ; \psi ) ]$ , where $q ( d | z _ { p } ; \psi )$ is any arbitrary distribution parameterized by $\psi$ . 1 We further drive lower bound for $I ( \pmb { y } ; \pmb { z } _ { s } )$ as $I ( \pmb { y } ; \pmb { z _ { s } } ) \geq H ( \pmb { y } ) + \mathbb { E } _ { p ( \pmb { y } , \pmb { z _ { s } } ) } [ \ln q ( \pmb { y } | \pmb { z _ { s } } ; \pmb { \theta _ { c } } ) ]$ , where $q ( \pmb { y } | \pmb { z } _ { s } ; \theta _ { c } )$ is a variational distribution parameterized by $\theta _ { c }$ approximating $p ( \pmb { y } | \boldsymbol { z } _ { s } )$ .
60
+
61
+ Let next $E _ { s } ( \pmb { x } ; \theta _ { s } )$ be a function parameterized by $\theta _ { s }$ that maps a sample $_ { \textbf { \em x } }$ to its corresponding shared feature $z _ { s }$ , and $E _ { p } ( \pmb { x } ; \theta _ { p } )$ be an analogous function which maps $_ { \textbf { \em x } }$ to $z _ { p }$ , the feature that is private to each domain (fig. 2). We also define $F ( z _ { s } , z _ { p } ; \phi )$ as a decoding function mapping the concatenation of the latent features $z _ { s }$ and $z _ { p }$ to a sample reconstruction $\hat { \pmb x }$ , and $D ( z ; \psi )$ as a decoding function mapping $z _ { s }$ and $z _ { p }$ to a $M$ -dimensional vector: the predictions of the domain label $\hat { d }$ . Finally, $C ( z _ { s } ; \theta _ { c } )$ is a task-specific function mapping $z _ { s }$ to a $K$ -dimensional probability vector of the class label $\hat { y }$ .
62
+
63
+ We represent $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { \bar { N } } \delta ( { \bf d } - { \bf d } _ { i } ) ) } \end{array}$ $p ( { \pmb d } ) , p ( { \pmb x } ) , p ( { \pmb y } )$ as in the case of variational autoencoders (VAE) (Abbasnejad et al. (2017); as the empirical distribution of a finite training set (e.g. $\begin{array} { r l } { p ( d ) } & { { } = } \end{array}$ $\mathrm { P u }$ et al. (2017)), $p ( \pmb { z } _ { s } | \pmb { x } ) , p ( \pmb { z } _ { p } | \pmb { x } )$ as deterministic functions of $_ { \textbf { \em x } }$ as $p ( z _ { s } | \pmb { x } ) = \delta \big ( z _ { s } - E _ { s } ( \pmb { x } ; \theta _ { s } ) \big )$ and $p ( z _ { p } | \pmb { x } ) = \delta \big ( z _ { p } - E _ { p } ( \pmb { x } ; \theta _ { p } ) \big )$ , and the variational distributions $q ( \pmb { y } | \pmb { z } _ { s } )$ , $q ( { \pmb x } | z )$ and , $q ( d | z )$ as
64
+
65
+ $$
66
+ q ( \boldsymbol { y } | \boldsymbol { z } _ { s } ) = \mathrm { S o f t M a x } ( C ( \boldsymbol { z } _ { s } ; \boldsymbol { \theta } _ { c } ) ) , q ( d | \boldsymbol { z } ) = \mathrm { S o f t M a x } ( D ( \boldsymbol { z } ; \boldsymbol { \psi } ) ) , q ( \boldsymbol { x } | \boldsymbol { z } ; \boldsymbol { \phi } ) \propto \exp ( \| \boldsymbol { x } - \boldsymbol { F } ( \boldsymbol { z } ; \boldsymbol { \phi } ) \| _ { 1 } )
67
+ $$
68
+
69
+ where Softmax $( \cdot )$ denotes the softmax or normalized exponential function (Bridle (1990)), and $\left. . \right. _ { 1 }$ denotes the $L _ { 1 }$ norm. Then, the optimization task can be posed as a minimax saddle point problem, where we use adversarial training to maximize (2) w.r.t. the parameters $( \theta _ { s } , \theta _ { p } , \theta _ { c } )$ , and to minimize (2) w.r.t. the parameters $( \phi , \psi )$ , using Stochastic Gradient Descent (SGD).
70
+
71
+ # Optimizing the parameters $\phi$ of the decoder $F$
72
+
73
+ $$
74
+ \hat { \phi } = \underset { \phi } { \arg \operatorname* { m i n } } \ : \mathcal { L } _ { F } = \frac { \lambda _ { r } } { N } \sum _ { i = 1 } ^ { N } \| \pmb { x } _ { i } - F \big ( E _ { s } ( \pmb { x } _ { i } ) , E _ { p } ( \pmb { x } _ { i } ) \big ) \| _ { 1 } .
75
+ $$
76
+
77
+ The decoder $F ( z _ { s } , z _ { p } ; \phi )$ is trained in such a way so as to minimize the difference between original input $_ { \textbf { \em x } }$ and its decoding from corresponding shared and private features via the decoder $F$ .
78
+
79
+ # Optimizing the parameters $\psi$ of the domain classifier $D$
80
+
81
+ $$
82
+ \hat { \psi } = \underset { \psi } { \arg \operatorname* { m i n } } \ : \mathcal { L } _ { D } = - \frac { \lambda _ { d } } { N } \sum _ { i = 1 } ^ { N } d _ { i } ^ { \top } \ln D \big ( E _ { s } ( \pmb { x } _ { i } ) \big ) - \frac { \lambda _ { d } } { N } \sum _ { i = 1 } ^ { N } d _ { i } ^ { \top } \ln D \big ( E _ { p } ( \pmb { x } _ { i } ) \big ) .
83
+ $$
84
+
85
+ $D ( z ; \psi )$ can be considered as a classifier whose task is to distinguish between the shared/private features of the different domains. More precisely, the two terms in Eq. 6 encourage $D$ to correctly predict the domain labels from the shared and private features, respectively.
86
+
87
+ # Optimizing the parameters $\theta _ { c }$ of the label classifier $C$
88
+
89
+ $$
90
+ \hat { \theta } _ { c } = \underset { \theta _ { c } } { \arg \operatorname* { m i n } } \big \{ - H ( \pmb { y } ) - \mathbb { E } _ { p ( \pmb { y } , z _ { s } ) } \big [ \ln q ( \pmb { y } | z _ { s } ) \big ] \big \} .
91
+ $$
92
+
93
+ Since we have access to the source labels, $H ( \pmb { y } )$ is a constant for source samples. we can approximate $H [ \pmb { y } ]$ for the target samples using the output of the classifier $C$ , leading to the following optimization problem:
94
+
95
+ $$
96
+ \begin{array} { r l } & { \hat { \theta } _ { c } = \underset { \theta _ { c } } { \arg \operatorname* { m i n } } \ \mathcal { L } _ { C } = - \ \frac { 1 } { N } \displaystyle \sum _ { i = 1 } ^ { N _ { s } } y _ { i } ^ { T } \ln C \big ( E _ { s } ( x _ { i } ) \big ) - \frac { \lambda _ { c } } { N - N _ { s } } \displaystyle \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( x _ { i } ) \big ) ^ { \top } \ln C \big ( E _ { s } ( x _ { i } ) \big ) } \\ & { \qquad + \ \frac { \lambda _ { c } } { N - N _ { s } } \displaystyle \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( x _ { i } ) \big ) ^ { \top } \ln \bigg ( \displaystyle \frac { 1 } { N - N _ { s } } \displaystyle \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( x _ { i } ) \big ) \bigg ) , } \end{array}
97
+ $$
98
+
99
+ where $N _ { s }$ denotes the number of source samples. Intuitively, we enforce the classifier $C$ to correctly predict the class labels of the source samples by the first term in Eq. 8. We use the second term to minimize the entropy of $q ( \pmb { y } | \pmb { z } _ { s } )$ for the target samples; effectively, reducing the effects of "confusing" labels of target samples, as given by $p ( \pmb { y } | \pmb { z } _ { s } )$ that leads to decision boundaries occur far away from target data-dense regions in the feature space. The intuition behind the last term is that by minimizing only the entropy (second term), we may arrive at a degenerate solution where every target point $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ is assigned to the same class. Hence, the last term encourages the classifier $C$ to have balanced labeling for the target samples where it reaches its minimum, $\ln K$ , when each class is selected with uniform probability.
100
+
101
+ # Optimizing the parameter $\theta _ { p }$ of the private encoder $E _ { p }$
102
+
103
+ $$
104
+ \hat { \theta _ { p } } = \underset { \theta _ { p } } { \operatorname { a r g m i n } } \ \mathcal { L } _ { P } = \frac { \lambda _ { r } } { N } \sum _ { i = 1 } ^ { N } \| \boldsymbol { x } _ { i } - F \big ( E _ { s } ( \boldsymbol { x } _ { i } ) , E _ { p } ( \boldsymbol { x } _ { i } ) \big ) \| _ { 1 } - \frac { \lambda _ { d } } { N } \sum _ { i = 1 } ^ { N } d _ { i } ^ { \top } D \big ( E _ { p } ( \boldsymbol { x } _ { i } ) \big ) .
105
+ $$
106
+
107
+ The first term in Eq. 9 encourages the private encoder $E _ { p }$ to preserve the recovery ability of the private features. The second term enforces distinct private features be produced for each domain by penalizing the representation redundancy in different private spaces. This, in turn, encourages moving this common information from multiple domains to their shared space.
108
+
109
+ # Optimizing the parameter $\theta _ { s }$ of the shared encoder $E _ { s }$
110
+
111
+ $$
112
+ \begin{array} { c } { \displaystyle \hat { \theta _ { s } } = \arg \operatorname* { m i n } _ { \theta _ { s } } \mathcal { L } _ { S } = \frac { \lambda _ { r } } { N } \sum _ { i = 1 } ^ { N } \| \boldsymbol { x } - F \big ( E _ { s } ( \boldsymbol { x } _ { i } ) , E _ { p } ( \boldsymbol { x } _ { i } ) \big ) \| _ { 1 } - \frac { \lambda _ { c } } { N } \sum _ { i = 1 } ^ { N _ { s } } y _ { i } ^ { T } \ln C \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) } \\ { \displaystyle - \frac { \lambda _ { d } } { N } \sum _ { i = 1 } ^ { N } d _ { i } ^ { \top } \ln D \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) - \frac { \lambda _ { c } } { N - N _ { s } } \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) ^ { \top } \ln C \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) } \\ { \displaystyle + \frac { \lambda _ { c } } { N - N _ { s } } \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) ^ { \top } \ln \bigg ( \frac { 1 } { N - N _ { s } } \sum _ { i = N _ { s } + 1 } ^ { N } C \big ( E _ { s } ( \boldsymbol { x } _ { i } ) \big ) \bigg ) . } \end{array}
113
+ $$
114
+
115
+ The first term in Eq. 10 encourages the shared encoder $E _ { s }$ to preserve the recovery ability of the shared features. The second term is the source domain classification loss penalty that encourages $E _ { s }$ to produce discriminative features for the labeled source samples. The third term simulates the adversarial training by trying to fool the domain classifier $D$ when predicting the domain labels $^ d$ , given the shared features $z _ { s }$ . The effect of this is two-fold: (i) the rendered shared features are more distinct from the corresponding private features, (ii) the shared features of different domains are encouraged to be similar to each other. The last two terms encourage $E _ { s }$ to produce the shared features for target samples so that the classifier is confident on the unlabeled target data, driving the shared features away from the decision boundaries. To train our model, we alternate between updating the shared encoder $E _ { s }$ , the private encoder $E _ { p }$ , the decoder $F$ , the classifier $C$ and the domain classifier $D$ using the SGD algorithm (see Algorithm 1 in Appendix E for more details).
116
+
117
+ # 3 RELATED WORK
118
+
119
+ There has been extensive prior work on domain adaptation (Csurka (2017)). Recent papers have focused on transferring deep neural network representations from a labeled source dataset to an unlabeled target domain, where the main strategy is to find a feature space such that the confusion between source and target distributions in that space is maximized ( Rebuffi et al. (2017); Benaim & Wolf (2017); Courty et al. (2017); Motiian et al. (2017); Saito et al. (2017); Zhang et al. (2017); Yan et al. (2017); Bousmalis et al. (2017)). For this, it is critical to first define a measure of divergence between source and target distributions. For instance, several methods have used the Maximum Mean Discrepancy (MMD) loss for this purpose (Bousmalis et al. (2017); Zellinger et al. (2017); Long et al. (2014)). MMD computes the norm of the difference between two domain means in the reproducing Kernel Hilbert Space (RKHS) induced by a pre-specified kernel. The Deep Adaptation Network (DAN) (Long et al. (2015)) applied MMD to layers embedded in a RKHS, effectively matching higher order statistics of the two distributions. The deep Correlation Alignment (CORAL) method (Sun & Saenko (2016)) attempts to match the mean and covariance of the two distributions. Deep Transfer Network (DTN) (Zhang et al. (2015)) achieved source/target distribution alignment via two types of network layers based on MMD distance: the shared feature extraction layer, which learns a subspace that matches the marginal distributions of the source and the target samples, and the discrimination layer, which matches the conditional distributions by classifier transduction.
120
+
121
+ Recently proposed unsupervised DA methods (Rebuffi et al. (2017); Benaim & Wolf (2017); Courty et al. (2017); Motiian et al. (2017); Saito et al. (2017); Zhang et al. (2017)) operate by training deep neural networks using adversarial training, which allows the learning of feature representations that are simultaneously discriminative of source labels, and indistinguishable between the source and target domain. For instance, Ganin & Lempitsky (2015) proposed a DA mechanism called Domain-Adversarial Training of Neural Networks (DANN), which enables the network to learn domain invariant representations in an adversarial way by adding a domain classifier and back-propagating inverse gradients. Adversarial Discriminative Domain Adaptation (ADDA) (Tzeng et al. (2017)) learns a discriminative feature subspace using the source labels, followed by a separate encoding of the target data to this subspace using an asymmetric mapping learned through a domain-adversarial loss. Liu et al. (2017) makes a shared-latent space assumption and proposes an unsupervised image-to-image translation (UNIT) framework based on Coupled GANs (Liu & Tuzel (2016)). Another example is the pixel-level domain adaptation models that perform the distribution alignment not in the feature space but directly in raw pixel space. PixelDA (Bousmalis et al. (2017)) uses adversarial approaches to adapt source-domain images as if drawn from the target domain while maintaining the original content.
122
+
123
+ While these approaches have shown success in DA tasks with single source-target domains, they are not designed to leverage information from multiple domains simultaneously. More recently, Zhao et al. (2017) introduced an adversarial framework called MDAN for multiple source single target domain adaptation where a domain classifier, induced by minimizing the H-divergence between multiple source and a target domain, is used to align their feature distributions in a shared space. Instead, in our approach we focus on multi-target DA where we perform adaptation of multiple unlabelled target domains. Although both our model and MDAN use the similar notion of the domain classifier to minimize the domain mismatch in shared space, the domain classifier induced by our information-theoretic (IT) loss also acts to separate domains in the private space (see Eqs. $6 \& 9$ for more details), improving the essential reconstruction ability, similar to (Bousmalis et al. (2016)). We provided how our model is related to IT representation learning approaches, and multiple domain transfer networks in Appendices A and B respectively. In Appendix C, we also clearly contrasted our model with DSN model which also uses the notion of auto-encoders to explicitly separate the feature representations private to each source/target domain from those that are shared between the domains.
124
+
125
+ # 4 EXPERIMENTAL RESULTS
126
+
127
+ We compare the proposed method with state-of-the-art methods on standard benchmark datasets: a digit classification task that includes 4 datasets: MNIST (LeCun et al. (1998)), MNIST-M (Ganin et al. (2016)), SVHN (Netzer et al. (2011)), USPS (Tzeng et al. (2017)), Multi-PIE expression recognition dataset2, and PACS multi-domain image recognition benchmark (Li et al. (2017)), a new dataset designed for the crossdomain recognition problems (the details for this experiment is available in Appendix G). Fig. 3 illustrates image samples from different datasets and domains. We evaluate the performance of all methods with classification accuracy metric. We repeated each experiment 5 times and report the average and the standard deviation of the accuracy.
128
+
129
+ We used ADAM (Kingma & Ba (2015)) for training; the learning rate was set to 0.0002 and momentum parameters to 0.5 and 0.999. We used batches of size 16 from each domain, and the input images were meancentered/rescaled to $[ - 1 , 1 ]$ . The hyper-parameters are empirically set as $\lambda _ { r } = 1 . 0 , \lambda _ { c } = 0 . 0 1$ , $\lambda _ { d } = 0 . 2 0$ . For the network architecture, our private/shared encoders consisted of three convolutional layers as the front-end and four basic residual blocks as the back-end. The decoder consisted of four basic residual blocks as the front-end and four transposed convolutional layers as the back-end. The discriminator and the classifier consisted of stacks of convolutional layers. We used ReLU for nonlinearity. Tanh function is used as the activation function of the last layer in the decoder $F$ for scaling the output pixels to $[ - 1 , 1 ]$ . The details of the networks are given in Appendix D.
130
+
131
+ The quantitative evaluation involves a comparison of the performance of our model to previous work and to Source Only and 1-NN baselines that do not use any domain adaptation. For Source Only baseline, we train our model only on the unaltered source training data and evaluate on the target test data. We compare the proposed method MTDA-ITA with several related methods designed for pair-wise source-target adaptation: CORAL (Sun & Saenko (2016)), DANN (Ganin & Lempitsky (2015)), ADDA (Tzeng et al. (2017)), DTN (Zhang et al. (2015)), UNIT (Liu et al. (2017)), PixelDA (Bousmalis et al. (2017)), and DSN (Bousmalis et al. (2016)). We reported the results of two following baselines: (i) one is to combine all the target domains into a single one and train it using MTDA-ITA, which we denote as (c-MTDA-ITA). (ii) the other one is to train multiple MTDA-ITA separately, where each one corresponds to a source-target pair which we denote as (s-MTDA-ITA). For completeness, we reported the results of the competing methods by combining all the target domains into a single one (denoted by c-DTN, c-ADDA, and c-DSN) as well. We also extend DSN to multiple domains by (i) having one private encoder for all domains denoted by (1p-DSN), (ii) adding multiple private encoders to it denoted by (mp-DSN) and contrast them with our model.
132
+
133
+ # 4.1 DIGITS DATASETS
134
+
135
+ We combine four popular digits datasets (MNIST, MNIST-M, SVHN, and USPS) to build the multitarget domain dataset. All images were uniformly rescaled to $3 2 \times 3 2$ . We take each of MNIST-M,
136
+
137
+ ![](images/c17f5da419bdc0deb50b99f30b19766556f98c280148111ece40ad50497e48c6.jpg)
138
+ Figure 3: Exemplary images from different datasets. a) Digits datasets, b) PACS datatset (first row: Art-painting, second row: Cartoon, Third row: Photo, last row: Sketch), c) Multi-PIE dataset (each row corresponds to a different camera angle and each subject depicts an expression(normal, smile, surprise, squint, disgust, scream) at every camera position).
139
+
140
+ SVHN, USPS, and MNIST as source domain in turn, and the rest as targets. We use all labeled source images and all unlabeled target images, following the standard evaluation protocol for unsupervised domain adaptation (Ganin et al. (2016); Long et al. (2016). We show the accuracy of different methods in Table 1. Additional results are available in Appendix F. The results show that first of all cMTDA-ITA has worse performance than sMTDA-ITA and MTDA-ITA. We have similar observations for ADDA, DTN, and DSN that demonstrates a naive combination of different target datasets can sometimes even decrease the performance of the competing methods. Furthermore, MTDA-ITA outperforms the state-of-the-art methods in most of domain transformations. The higher performance of MTDA-ITA compared to other methods is mainly attributed to the joint adaptation of related domains where each domain could benefit of other related domains. Furthermore, from the results obtained, we see that it is beneficial to use information coming from unlabeled target data (see Eq. 8 for updating the classifier $C$ ) during the learning process, compared to when no data from target domain is used (See the ablation study section for more information). Indeed, using our scheme, we find a representation space in which embeds the knowledge from the target domain into the learned classifier. By contrast, the competing methods do not provide a principled way of sharing information across all domains, leading to overall lower performance. The results also verify the superiority of MTDA-ITA over both mp-DSN, and 1p-DSN. This can be due to (i) having multiple private encoders increase the number of parameters that may lead to mp-DSN overfitting, (ii) superiority of the MTDA-ITA’s domain adversarial loss over the DSN’s MMD loss to separate the shared and private features, (iii) utilization of the unlabeled target data to regularize the classifier in MTDA-ITA.
141
+
142
+ # 4.2 MULTI-PIE DATASET
143
+
144
+ The Multi-PIE dataset includes face images of 337 individuals captured from different expressions, views, and illumination conditions (fig. 3(c)). For this experiment, we use 5 different camera views (positions) $C 0 5$ , $C 0 8$ , $C 0 9$ , $C 1 3$ , and $C 1 4$ as different domains (Fig. 3(c)) and the face expressions (normal, smile, surprise, squint, disgust, scream) as labels. Each domain contains 27120 images of size $6 4 \times 6 4 \times 3$ . We used each view as the source domain, in turn, and the rest as targets. We expect the face inclination angle to reflect the complexity of transfer learning. Tab. 2 shows the classification accuracy for $C 1 3$ and $C 1 4$ as source domain (the results for views $C 0 5$ , $C 0 8$ and $C 0 9$ as source domain are available in Appendix F). As can be seen, MTDA-ITA achieves the best performances as well as the best scores in most settings that verifies the effectiveness of MTDA-ITA for multi-target domain adaptation. Clearly, with the increasing camera angle, the image structure changes up to a certain extent (the views become heterogeneous). However, our method produces better results even under such very challenging conditions.
145
+
146
+ Table 1: Classification results on digit datasets. M: MNIST; MM: MNIST-M, S: SVHN, U: USPS. The best is shown in red. c-X: combining all target domains into a single one and train it using X. s-MTDA-ITA: training multiple MTDAITA where each one correspond to a source-target pair. 1p-DSN: extended DSN with single private encoder.mp-DSN: extended DSN with multiple private encoder. Last column shows the average rank of each method over all adaptation pairs. $\bf \Pi ^ { * } U N I T$ trains with the extended SVHN $> 5 0 0 \mathrm { K }$ images vs ours 72K). \*PixelDA uses $( \approx 1 , 0 0 0 )$ of labeled target domain data as a validation set for tuning the hyper-parameters.
147
+
148
+ <table><tr><td>method</td><td>S→M</td><td>S→MM</td><td>S→U</td><td>M→S</td><td>M→MM</td><td>M→U</td><td>Ave.ranking</td></tr><tr><td>Source Only</td><td>62.10±0.60</td><td>40.43±0.70</td><td>39.90± 0.60</td><td>30.29± 0.59</td><td>55.98 ± 0.48</td><td>78.30±0.38</td><td>14.00</td></tr><tr><td>1-NN</td><td>35.86</td><td>18.21</td><td>29.31</td><td>28.01</td><td>12.58</td><td>41.22</td><td>15.00</td></tr><tr><td>CORAL (Sun &amp; Saenko (2016))</td><td>63.10 ± 0.61</td><td>54.37 ± 0.53</td><td>50.15 ± 0.63</td><td>33.40 ±0.74</td><td>57.70 ± 0.69</td><td>81.05 ± 0.80</td><td>11.33</td></tr><tr><td>DANN (Ganin et al. (2016))</td><td>73.80 ±0.49</td><td>61.05±0.80</td><td>62.54 ± 0.91</td><td>35.50 ± 0.65</td><td>77.40±0.73</td><td>81.60 ± 0.60</td><td>8.75</td></tr><tr><td>ADDA(Tzeng et al. (2017))</td><td>77.68 ± 0.92</td><td>64.23±0.70</td><td>64.10±0.79</td><td>30.04± 0.98</td><td>91.47 ±1.0</td><td>90.51 ± 0.80</td><td>6.43</td></tr><tr><td>C-ADDA</td><td>80.10 ± 0.69</td><td>56.80 ± 0.79</td><td>64.80±0.88</td><td>27.50 ± 0.86</td><td>83.30 ±0.90</td><td>84.10 ±0.98</td><td>8.95</td></tr><tr><td>DTN (Zhang et al. (2015))</td><td>81.40± 0.42</td><td>63.70±0.39</td><td>60.12 ± 0.52</td><td>40.40±0.50</td><td>85.70±0.39</td><td>85.80 ± 0.46</td><td>6.04</td></tr><tr><td>c-DTN PixelDA (Bousmalis et al. (2017))</td><td>82.10 ±0.62</td><td>59.30 ± 0.59</td><td>56.87 ± 0.65</td><td>38.32 ± 0.50</td><td>80.90±0.80</td><td>79.31 ±0.78</td><td>7.96</td></tr><tr><td>UNIT (Liu et al. (2017))</td><td></td><td></td><td></td><td></td><td>98.10*</td><td>94.10*</td><td>1</td></tr><tr><td>DSN (Bousmalis et al. (2016))</td><td>90.6*</td><td></td><td></td><td></td><td></td><td>92.90</td><td>1</td></tr><tr><td>c-DSN</td><td>82.70±0.37 83.10 ±0.20</td><td>64.80± 0.40</td><td>65.30± 0.28</td><td>49.30±0.30</td><td>83.20±0.30</td><td>91.65 ± 0.40</td><td>2.85</td></tr><tr><td>1p-DSN</td><td>81.00 ± 0.47</td><td>60.56 ± 0.36 58.22 ± 0.68</td><td>60.35 ± 0.59</td><td>46.80 ± 0.45</td><td>80.49±0.40</td><td>88.21 ±0.38</td><td>4.84</td></tr><tr><td>mp-DSN</td><td>83.40±0.30</td><td>61.00±0.50</td><td>58.06 ±0.48 58.10 ±0.64</td><td>45.11 ± 0.33</td><td>77.33 ± 0.52 79.30±0.59</td><td>85.16 ± 0.63</td><td>4.90</td></tr><tr><td>s-MTDA-ITA</td><td>82.90±0.13</td><td>63.10±0.28</td><td>63.54±0.30</td><td>47.35 ± 0.40</td><td>82.42± 0.19</td><td>86.45 ± 0.71</td><td>5.33</td></tr><tr><td>c-MTDA-ITA</td><td>79.20±0.28</td><td>59.90 ± 0.30</td><td>63.70±0.26</td><td>49.60± 0.25 45.30 ±0.30</td><td>77.12 ± 0.22</td><td>89.21±0.28</td><td>2.88</td></tr><tr><td>MTDA-ITA</td><td>84.60±0.24</td><td>65.30 ± 0.15</td><td>70.03 ±0.20</td><td>52.01 ± 0.21</td><td>85.50 ±0.18</td><td>87.47 ± 0.25 94.20±0.20</td><td>4.25</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.16</td></tr></table>
149
+
150
+ <table><tr><td>method</td><td>C13→C05</td><td>C13→C08</td><td>C13→C09</td><td>C13→C14</td><td>C14→C05</td><td>C14→C08</td><td>C14→C09</td><td>C14→C13</td><td>Ave.ranking</td></tr><tr><td>Source Only</td><td>50.79± 0.33</td><td>45.90± 0.50</td><td>40.04±0.40</td><td>59.68± 0.29</td><td>60.03±0.55</td><td>36.80± 0.61</td><td>40.11 ±0.50</td><td>60.57± 0.36</td><td>16.08</td></tr><tr><td>1-NN CORAL</td><td>33.21 54.89 ± 0.52</td><td>37.01</td><td>34.45</td><td>48.79 68.90± 0.35</td><td>47.44</td><td>28.24</td><td>30.86</td><td>44.86</td><td>17.00</td></tr><tr><td>DANN</td><td>57.86± 0.41</td><td>48.90±0.48 50.30 ± 0.43</td><td>40.30±0.53 45.30± 0.50</td><td>70.68 ± 0.35</td><td>59.98 ± 0.45 57.20± 0.45</td><td>40.63±0.55 40.22±0.55</td><td>40.80 ±0.53 40.77 ± 0.45</td><td>65.11 ± 0.45 70.50± 0.55</td><td>11.95 9.92</td></tr><tr><td>ADDA</td><td>64.83±0.69</td><td>63.20±0.45</td><td>55.48 ±0.65</td><td>74.25±0.55</td><td>73.62 ± 0.75</td><td>43.56±0.95</td><td>38.68 ±0.95</td><td>72.84±0.75</td><td>9.33</td></tr><tr><td>C-ADDA</td><td>59.20±0.25</td><td>30.70±0.63</td><td>53.20±0.40</td><td>68.33±0.35</td><td>65.88±0.38</td><td>30.60±0.61</td><td>45.34±0.48</td><td>64.30±0.40</td><td>11.50</td></tr><tr><td>DTN</td><td>63.78±0.29</td><td>60.45±0.35</td><td>60.55±0.35</td><td>72.60±0.25</td><td>70.67±0.30</td><td>41.55±0.65</td><td>41.45 ± 0.45</td><td>70.67±0.45</td><td></td></tr><tr><td>c-DTN</td><td>57.53 ± 0.42</td><td>55.24 ± 0.45</td><td>57.14 ± 0.39</td><td>65.16 ± 0.35</td><td>63.80 ±0.42</td><td>38.97 ± 0.71</td><td>39.80 ± 0.65</td><td>62.10 ± 0.45</td><td>8.75 10.92</td></tr><tr><td>PixelDA</td><td>45.68± 0.52</td><td>44.95± 0.42</td><td>44.45±0.55</td><td>90.50± 0.25</td><td>46.28±0.60</td><td>45.89±0.61</td><td>44.45± 0.51</td><td>69.15 ± 0.45</td><td>9.95</td></tr><tr><td>UNIT</td><td>44.14±0.10</td><td>44.47 ± 0.11</td><td>44.21 ±0.12</td><td>44.47 ± 0.11</td><td>43.03 ±0.1</td><td>44.44 ±0.15</td><td>44.47 ± 0.15</td><td>44.47 ± 0.05</td><td>11.07</td></tr><tr><td>DSN</td><td>64.15± 0.30</td><td>57.70±0.38</td><td>49.15± 0.45</td><td>80.75±0.27</td><td>82.20±0.28</td><td>38.75±0.53</td><td>45.00± 0.25</td><td>80.50± 0.35</td><td></td></tr><tr><td>c-DSN</td><td>57.34±0.45</td><td>31.63 ±0.60</td><td>51.17 ±0.40</td><td>74.52 ±0.37</td><td>82.01 ± 0.35</td><td>34.25±0.58</td><td>42.63 ± 0.55</td><td>79.42 ±0.35</td><td>5.15 8.20</td></tr><tr><td>1p-DSN</td><td>55.84± 0.50</td><td>30.03 ± 0.50</td><td>49.06 ± 0.38</td><td>72.11 ± 0.50</td><td>81.22 ±0.45</td><td>33.33 ± 0.58</td><td>42.03 ±0.24</td><td>78.78±0.57</td><td>8.63</td></tr><tr><td>mp-DSN</td><td>55.20±0.46</td><td>30.40±0.50</td><td>47.80±0.35</td><td>75.30 ± 0.25</td><td>80.75±0.20</td><td>30.20 ±0.55</td><td>43.00±0.35</td><td>79.02±0.40</td><td>8.88</td></tr><tr><td>s-MTDA-ITA</td><td>70.10± 0.27</td><td>58.90±0.25</td><td>58.10±0.27</td><td>80.12±0.15</td><td>82.05±0.18</td><td>45.90±0.30</td><td>52.67±0.30</td><td>81.60±0.24</td><td></td></tr><tr><td>c-MTDA-ITA</td><td>60.34 ± 0.17</td><td>55.67 ± 0.21</td><td>57.10 ± 0.23</td><td>73.50 ± 0.20</td><td>76.80 ±0.10</td><td>43.10 ±0.12</td><td>48.10 ± 0.14</td><td>80.90 ± 0.11</td><td>3.65</td></tr><tr><td>MTDA-ITA</td><td>78.40 ± 0.2</td><td>66.70 ± 0.17</td><td>70.30± 0.14</td><td>85.49 ± 0.11</td><td>87.20±0.10</td><td>61.40±0.14</td><td>60.05 ±0.13</td><td>86.70 ± 0.10</td><td>5.01 1.20</td></tr></table>
151
+
152
+ Table 2: Classification results on Multi-PIE dataset. Last column shows the average rank of each method over all adaptation pairs. The best is shown in red.
153
+
154
+ # 4.3 ABLATION STUDIES
155
+
156
+ We performed an ablation study on the proposed model measuring impact of various terms on the model’s performance. To this end, we conducted additional experiments for the digit datasets with different components ablation, i.e., training without the reconstruction loss (denoted as MTDA-woR) by setting $\lambda _ { r } = 0$ , training without the classifier entropy loss (denoted as MTDA-woE) by setting $\lambda _ { c } = 0$ , training without the multidomain separation loss (denoted as MTDA-woD) by setting $\lambda _ { d } = 0$ .
157
+
158
+ As can be seen from fig. 4, disabling each of the above components leads to degraded performance. More precisely, the average drop by disabling the classifier entropy loss is $\approx 3 . 5 \%$ . Similarly, by disabling the reconstruction loss and the multi-domain separation loss, we have $\approx 4 . 5 \%$ and $\approx 2 2 \%$ average drop in performance, respectively. Clearly, by disabling the multi-domain separation loss, the accuracy drops significantly due to the severe data distribution mismatch between different domains. The figure also demonstrates that leveraging the unlabeled data from multiple target domains during training enhances the generalization ability of the model that leads to higher performance. In addition, the performance drop caused by removing the reconstruction loss , i.e., without the private encoder/decoder, indicates (i) the benefit of modeling the latent features as the combination of shared and private features, (ii) the ability of the model’s domain adversarial loss to effectively learn those features.
159
+
160
+ In order to examine the effect of the private features on the model’s classification performance, we took the MTDA-ITA and trained it without the private encoder (denoted as MTDA-woP). As fig. 4 shows, without the private features, the model performed consistently worse $\approx 2 \%$ average drop in performance) in all scenarios. This demonstrates explicitly modeling what is unique to each domain can improve the model’s ability to extract domain–invariant features. In summary, this ablation study showed that the individual components bring complimentary information to achieve the best classification results.
161
+
162
+ # 4.4 FEATURE VISUALIZATION
163
+
164
+ We use t-SNE (Maaten & Hinton (2008)) on Digit dataset to visualize shared and private feature representations from different domains. Fig. 6 shows shared and private features from source (SVHN) and target domains before (a),(b) and after adaptation (c),(d). MTDA-ITA significantly reduces the domain mismatch for the shared features (circle markers in fig. 6d, strong mixing of domain labels in this cluster, fig. 6c) and increases it for the private features (triangle markers, pure and well-separated domain clusters in fig. 6c). This is partially due to the proposed multi-domain separation loss through the use of the domain classifier $D$ , which penalizes the domain mismatch for the shared features and rewards the mismatch for the private features. Moreover, as supported by the quantitative results in tab. 1, joint adaptation of related domains and the classifier, accomplished through the model, leads to superior class separability, compared to original features. This is depicted in fig. 6d, where the points in the shared space (large cluster) are grouped into class-specific subgroups (color indicates class label), while they are mixed in private spaces (smaller clusters). This is in contrast to fig. 6b, where original features show no class-specificity.
165
+
166
+ We also show the learned shared and private features for the models MTDA-woE, MTDA-woP, MTDAwoR, and MTDA-woD, in figs. 6e to 6l. Note that since the private encoder $E _ { p }$ is disabled for MTDA-woR, and MTDA-woP, no private features are depicted in figs. $6 \mathrm { g }$ to 6j. The class label separation in the shared space for MTDA-woE, MTDA-woP, and MTDA-woR, figs. 6f, 6h and 6j, is still evident but not as strong as in the full model, fig. 6d, corroborating the small loss in classification accuracy observed in fig. 4a. On the other hand, MTDA-woD has significant mixing of class labels in the shared space, fig. 6l, more so than MTDA-woE, MTDA-woR, and MTDA-woP, implying worse classification prediction in fig. 4a due to the severe mismatch between different domains. Since our model uses one private encoder for all target domains, we also contrasted the visualization of DSN model with one private encoder 1p-DSN in Appendix H.
167
+
168
+ # 5 CONCLUSION
169
+
170
+ This paper presented an information theoretic end-to-end approach to uDA in the context of a single source and multiple target domains that share a common task or properties. The proposed method learns feature representations invariant under multiple domain shifts and simultaneously discriminative for the learning task. This is accomplished by explicitly separating representations private to each domain and shared between source and target domains using a novel discrimination strategy. Our use of a single private domain encoder results in a highly scalable model, easily optimized using established back-propagation approaches. Results on three benchmark datasets for image classification show superiority of the proposed method compared to the state-of-the-art methods for unsupervised domain adaptation of visual domain categories.
171
+
172
+ # REFERENCES
173
+
174
+ M Ehsan Abbasnejad, Anthony Dick, and Anton van den Hengel. Infinite variational autoencoder for semi-supervised learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 781–790. IEEE, 2017.
175
+
176
+ Alessandro Achille and Stefano Soatto. Information dropout: Learning optimal representations through noisy computation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018.
177
+
178
+ Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken elbo. In International Conference on Machine Learning, pp. 159–168, 2018a.
179
+
180
+ Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. International Conference on Learning Representation (ICLR), 2016.
181
+
182
+ Alexander A Alemi, Ian Fischer, and Joshua V Dillon. Uncertainty in the variational information bottleneck. arXiv preprint arXiv:1807.00906, 2018b.
183
+
184
+ Asha Anoosheh, Eirikur Agustsson, Radu Timofte, and Luc Van Gool. Combogan: Unrestrained scalability for image domain translation. ICLR Workshops, 2017.
185
+
186
+ David Barber and Felix Agakov. The im algorithm: a variational approach to information maximization. In Advances in Neural Information Processing Systems (NIPS), pp. 201–208. MIT Press, 2003.
187
+
188
+ Sagie Benaim and Lior Wolf. One-sided unsupervised domain mapping. In Advances in Neural Information Processing Systems (NIPS), pp. 752–762, 2017.
189
+
190
+ Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Advances in Neural Information Processing Systems (NIPS), pp. 343–351, 2016.
191
+
192
+ Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pp. 7, 2017.
193
+
194
+ Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
195
+
196
+ John S Bridle. Probabilistic interpretation of feedforward classification network outputs, with relationships to statistical pattern recognition. In Neurocomputing, pp. 227–236. Springer, 1990.
197
+
198
+ Matthew Chalk, Olivier Marre, and Gasper Tkacik. Relevant sparse codes with variational information bottleneck. In Advances in Neural Information Processing Systems (NIPS), pp. 1957–1965, 2016.
199
+
200
+ Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 1711, 2017.
201
+
202
+ Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In Advances in Neural Information Processing Systems (NIPS), pp. 3733–3742, 2017.
203
+
204
+ Gabriela Csurka. A comprehensive survey on domain adaptation for visual applications. pp. 1–35. Springer, 2017.
205
+
206
+ Basura Fernando, Amaury Habrard, Marc Sebban, and Tinne Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In IEEE International Conference on Computer Vision (ICCV), pp. 2960–2967, 2013.
207
+
208
+ Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. International Conference on Machine Learning (ICML), 2015.
209
+
210
+ Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
211
+
212
+ Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2066–2073, 2012.
213
+
214
+ Guang-Yuan Hao, Hong-Xing Yu, and Wei-Shi Zheng. Mixgan: Learning concepts from different domains for mixture generation. arXiv preprint arXiv:1807.01659, 2018.
215
+
216
+ Hirokazu Kameoka, Takuhiro Kaneko, Kou Tanaka, and Nobukatsu Hojo. Stargan-vc: Non-parallel manyto-many voice conversion with star generative adversarial networks. arXiv preprint arXiv:1806.02169, 2018.
217
+
218
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representation (ICLR), 2015.
219
+
220
+ Elyor Kodirov, Tao Xiang, Zhenyong Fu, and Shaogang Gong. Unsupervised domain adaptation for zero-shot learning. In IEEE International Conference on Computer Vision (ICCV), pp. 2452–2460, 2015.
221
+
222
+ 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.
223
+
224
+ Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In IEEE International Conference on Computer Vision (ICCV), pp. 5543–5551. IEEE, 2017.
225
+
226
+ Jianhua Lin. Divergence measures based on the shannon entropy. IEEE Transactions on Information theory, 37(1):145–151, 1991.
227
+
228
+ Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems (NIPS), pp. 469–477. Curran Associates, Inc., 2016.
229
+
230
+ Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in Neural Information Processing Systems (NIPS), pp. 700–708, 2017.
231
+
232
+ Mingsheng Long, Jianmin Wang, Guiguang Ding, Jiaguang Sun, and Philip S Yu. Transfer joint matching for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1410–1417, 2014.
233
+
234
+ Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I Jordan. Learning transferable features with deep adaptation networks. International Conference on Machine Learning (ICML), 2015.
235
+
236
+ Mingsheng Long, Jianmin Wang, Yue Cao, Jiaguang Sun, and S Yu Philip. Deep learning of transferable representation for scalable domain adaptation. IEEE Transactions on Knowledge and Data Engineering, 28(8):2027–2040, 2016.
237
+
238
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
239
+
240
+ Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Advances in neural information processing systems (NIPS), pp. 2125–2133, 2015.
241
+
242
+ Saeid Motiian, Quinn Jones, Seyed Iranmanesh, and Gianfranco Doretto. Few-shot adversarial domain adaptation. In Advances in Neural Information Processing Systems (NIPS), pp. 6673–6683, 2017.
243
+
244
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 5, 2011.
245
+
246
+ Yuchen Pu, Weiyao Wang, Ricardo Henao, Liqun Chen, Zhe Gan, Chunyuan Li, and Lawrence Carin. Adversarial symmetric variational autoencoder. In Advances in Neural Information Processing Systems (NIPS), pp. 4330–4339, 2017.
247
+
248
+ Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems (NIPS), pp. 506–516, 2017.
249
+
250
+ Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. International Conference on Machine Learning (ICML), 2017.
251
+
252
+ Mathieu Salzmann, Carl Henrik Ek, Raquel Urtasun, and Trevor Darrell. Factorized orthogonal latent spaces. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 701–708, 2010.
253
+
254
+ Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European Conference on Computer Vision (ECCV), pp. 443–450. Springer, 2016.
255
+
256
+ Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. Thirtieth AAAI Conference on Artificial Intelligence, 2016.
257
+
258
+ Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In IEEE Information Theory Workshop (ITW), pp. 1–5. IEEE, 2015.
259
+
260
+ Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pp. 4, 2017.
261
+
262
+ Hongliang Yan, Yukang Ding, Peihua Li, Qilong Wang, Yong Xu, and Wangmeng Zuo. Mind the class weight bias: Weighted maximum mean discrepancy for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
263
+
264
+ Donggeun Yoo, Namil Kim, Sunggyun Park, Anthony S Paek, and In So Kweon. Pixel-level domain transfer. In European Conference on Computer Vision (ECCV), pp. 517–532, 2016.
265
+
266
+ Werner Zellinger, Thomas Grubinger, Edwin Lughofer, Thomas Natschläger, and Susanne Saminger-Platz. Central moment discrepancy (cmd) for domain-invariant representation learning. International Conference on Learning Representation (ICLR), 2017.
267
+
268
+ Jing Zhang, Wanqing Li, and Philip Ogunbona. Joint geometrical and statistical alignment for visual domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
269
+
270
+ Xu Zhang, Felix Xinnan Yu, Shih-Fu Chang, and Shengjin Wang. Deep transfer network: Unsupervised domain adaptation. arXiv preprint arXiv:1503.00591, 2015.
271
+
272
+ Han Zhao, Shanghang Zhang, Guanhang Wu, João P. Costeira, Jose Moura, and Geoffrey J. Gordon. Multiple source domain adaptation with adversarial training of neural networks. International Conference on Learning Representation (ICLR) workshops, 05 2017.
273
+
274
+ # A CONNECTION TO INFORMATION THEORETIC REPRESENTATION LEARNING
275
+
276
+ The idea of using information theoretic (IT) objectives for representation learning was originally introduced in (Tishby & Zaslavsky (2015)). Since their approach for optimizing the IT objective functions relied on the iterative Blahut Arimoto algorithm (Tishby & Zaslavsky (2015)), it is not feasible to apply to deep neural network (DNN) frameworks. Similar to our approach, there have been some recent works (Mohamed & Rezende (2015); Chalk et al. (2016); Alemi et al. (2018b; 2016; 2018a)) to approximate the MI by applying variational bounds on MI, though not in the context of domain adaptation.
277
+
278
+ Mohamed & Rezende (2015) utilized the variational bounds on MI, and apply it to DNNs in the context of reinforcement learning. Chalk et al. (2016) and Alemi et al. (2016), developed the same variational lower bound In the context of Information Bottleneck (IB) principle (Tishby & Zaslavsky (2015)), where the former applied it to sparse coding problems, and used the kernel trick to achieve nonlinear mappings, whereas the latter applied it to DNNs to handle large datasets thanks to the SGD algorithm. Achille & Soatto (2018) proposed a variational bound on the MI in the context of IB, from the perspective of variational dropout and demonstrated its utility in learning disentangled representations for variational autoencoders.
279
+
280
+ The main difference between our method and the above methods is that these methods throw away the information in the data not related to the task by minimizing the mutual information between the data points and the latent representations that may lead to ignoring the individual characteristics (private features) of the datasets in a multiple dataset regime, whereas our method explicitly models what is unique to each domain (dataset) that improves the model’s ability to extract domain–invariant features.
281
+
282
+ In the unsupervised representation learning literature, our work is also related to the VAE-based models (Bowman et al. (2015)). However, we propose to tackle the task using our IT approach using deterministic mappings instead of the traditional evidence lower bound (ELBO) optimization with stochastic mappings. In contrast to the unsupervised representation learning approaches, our setting also allows us to further improve the latent representation using the labeled data in the source domain while leveraging the sharing of dependencies across different target domains.
283
+
284
+ # B CONNECTION TO MULTIPLE DOMAIN TRANSFER NETWORKS
285
+
286
+ Recent studies have shown remarkable success in multiple domain transfer (MDT) (Choi et al. (2017); Anoosheh et al. (2017); Kameoka et al. (2018); Hao et al. (2018)) though not in the context of the image classification, rather in the context of image generation. Choi et al. (2017) proposed StarGAN, a generative adversarial network capable of learning mappings among multiple domains in the contest of image to image translation framework. The goal of StarGAN is to train a single generator $G$ though this requires passing in a vector along with each input to the generator specifying the output domain desired, that learns mappings among multiple domains. To achieve this, $G$ is trained to translate an input image $_ { \textbf { \em x } }$ into an output image $\mathbf { x } ^ { \prime }$ conditioned on the target domain label $^ d$ , $G ( \pmb { x } , \pmb { d } ) \pmb { x } ^ { \prime }$ . Similar to our domain classifier module $D$ , they introduce an auxiliary classifier that allows a single discriminator to control multiple domains.
287
+
288
+ Anoosheh et al. (2017) introduced ComboGAN, which decouples the domains and networks from each other. Similar to our encoder/decoder modules, ComboGAN’s generator networks contain encoder/decoders assigning each encoder and decoder to a domain. They combine the encoders and decoders of the trained model like building blocks, taking as input any domain and outputting any other. For example during inference, to transform an image $_ { \textbf { \em x } }$ from an arbitrary domain $\mathbf { X }$ to $\mathbf { x } ^ { \prime }$ from domain $\mathbf { X } ^ { \prime }$ , they simply perform $\pmb { x } ^ { \prime } = G _ { \mathbf { X } ^ { \prime } , \mathbf { X } } ( \pmb { x } ) = D e c o d e r _ { X ^ { \prime } } ( E n c o d e r _ { X } ( \pmb { x } ) )$ . The result of $E n c o d e r _ { X } ( { \pmb x } )$ can even be cached when translating to other domains as not to repeat computation.
289
+
290
+ The main differences between the MDT methods and ours is that, unlike our method which does domain alignment in feature space, MDT methods adapt representations not in feature space but rather in raw pixel space; translating samples from one domain to the “style” of a other domains. This works well for limited domain shifts where the domains are similar in pixel-space, but can be too limiting for settings with larger domain shifts that results in poor performance in significant structural change of the samples in different domains.
291
+
292
+ # C CONNECTION TO DOMAIN SEPARATION NETWORKS
293
+
294
+ The method closest to our work is Domain Separation Networks (DSN) (Bousmalis et al. (2016)), which use the notion of auto-encoders to explicitly separate the feature representations private to each source/target domain from those that are shared between the domains. Although extending DSN to multiple domains might seem trivial, DSN requires an autoencoder per domain, making the model impractical in the case of more than a couple of domains.
295
+
296
+ The overall loss of DSN consists of a reconstruction loss for each domain modeled by a shared decoder, a similarity loss such as MMD, which encourages domain invariance modeled by a shared encoder, and a dissimilarity loss modeled by two private encoders: one for the source domain and one for the target domain. While one could attempt to generalize DSN to multiple target domains by having individual per-target domain private encoders, doing so would prove problematic when the number of target domains is large — each private encoder would require a large "private" dataset to learn the private parameters. Precisely, for multiple $\bar { ( \cal M ) }$ target domains, we could train a DSN model with one shared encoder, $M + 1$ private encoder (one for each domain), and one shared decoder. This leads to $M + 3$ models to train that implies the number of models increases linearly with the number of domains, as does the required training time. Second, DSN uses an orthogonality constraint among the shared and the private representations which may not be strong enough to remove redundancy and enforce disentangling among different private spaces. Precisely, DSN defines the loss via a soft subspace orthogonality constraint between the private and shared representation of each domain. However, it does not enforce the private representation of different domains to be different that may result in redundancy of different private spaces.
297
+
298
+ In addition, DSN enforces separation of spaces using the notion of Euclidean orthogonality, e.g., $\| z _ { s } - z _ { p } \| ^ { 2 }$ . In case of multiple target domains, this would result in learning of all pairs of private spaces independently. To address those deficiencies, we first explicitly couple different private encoders into a single private encoder model, $E _ { \theta _ { p } }$ of fig. 2 , which allows us to generalize to an arbitrary number of target domains. To assure that the information among the private and shared spaces is not shared (i.e., "orthogonal"), we define an informationtheoretic criteria enforced by a domain classifier, $\mathcal { D } _ { \psi }$ of fig. 2, which aims to segment the private space into clusters that correspond to individual target domains. By using $D _ { \psi }$ within the adversarial framework, MTDA-ITA learns simultaneously the shared and private features from different domains (see fig. 6). We showed in Sec. 4 that our model performs better than the trivial extension of DSNs to the multi-domain case.
299
+
300
+ # D NETWORK ARCHITECTURE
301
+
302
+ The network architecture used for the experiments is given in tab. 3. We use the following abbreviation for ease of presentation: ${ \bf N } =$ Neurons, $\mathbf { K } { = }$ Kernel size, ${ \mathrm { S } } { = } { }$ Stride size, $\begin{array} { r } { \boldsymbol { \mathrm { D } } \boldsymbol { = } } \end{array}$ Number of Domains, $\mathbf { C } =$ number of Classes. The transposed convolutional layer is denoted by DCONV. The residual basic block is denoted as RESBLK.
303
+
304
+ Table 3: Network architecture for the experiments.
305
+
306
+ <table><tr><td>Layer</td><td>Encoders (shared,private)</td></tr><tr><td>1</td><td>CONV-(N16,K7,S1), ReLU</td></tr><tr><td>2</td><td>CONV-(N32,K3,S2), ReLU</td></tr><tr><td>3</td><td>CONV-(N64,K3,S2), ReLU</td></tr><tr><td>4</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>5</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>6</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>7</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>Layer</td><td>Decoder</td></tr><tr><td>1</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>2</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>3</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>4</td><td>RESBLK-(N64,K3,S1)</td></tr><tr><td>5</td><td>DCONV-(N32,K3,S2), ReLU</td></tr><tr><td>6</td><td>DCONV-(N16,K3,S2), ReLU</td></tr><tr><td>7</td><td>DCONV-(N1,K1,S1), Tanh</td></tr><tr><td>Layer</td><td>Discriminator</td></tr><tr><td>1</td><td>CONV-(N4,K3,S1),ReLU</td></tr><tr><td>2</td><td>CONV-(N8,K3,S1),ReLU</td></tr><tr><td>3</td><td>CONV-(N16,K3,S1),ReLU</td></tr><tr><td>4</td><td>CONV-(N32,K3,S1),ReLU</td></tr><tr><td>5</td><td>CONV-(N1,K3,S1),ReLU</td></tr><tr><td>6</td><td>DENSE-(ND), Softmax</td></tr><tr><td>Layer</td><td>Classifier</td></tr><tr><td>1</td><td>CONV-(N4,K3,S1),ReLU</td></tr><tr><td>2</td><td>CONV-(N8,K3,S1), ReLU</td></tr><tr><td>3</td><td>CONV-(N16,K3,S1), ReLU</td></tr><tr><td>4</td><td>CONV-(N32,K3,S1),ReLU</td></tr><tr><td>5</td><td>CONV-(N1,K3,S1),ReLU</td></tr><tr><td>6</td><td>DENSE-(NC), Softmax</td></tr></table>
307
+
308
+ # E PROPOSED MODEL’S ALGORITHM
309
+
310
+ The detailed optimization process of the proposed model is shown in Algorithm 1.
311
+
312
+ # F ADDITIONAL EXPERIMENTS FOR DIGIT AND MULTI-PIE DATASETS
313
+
314
+ The additional experiments for Digit dataset where we set MNIST-M and USPS as source domain is available in tab. 4. The additional experiments for Multi-PIE dataset where we set $C 0 5$ , $C 0 8$ and $C 0 9$ as source domain is available in tabs. $5 \& 6$ .
315
+
316
+ # G PACS DATASET
317
+
318
+ This dataset contains 9991 images $2 2 7 \times 2 2 7 \times 3$ dimension) across 7 categories (‘dog’, ‘elephant’, ‘giraffe’,‘guitar’, ‘house’, ‘horse’ and ‘person’) and 4 domains of different stylistic depictions (‘Photo’, ‘Art painting’, ‘Cartoon’ and ‘Sketch’). The very diverse depiction styles provide a significant gap between domains, coupled with the small number of data samples, making it extremely challenging for domain adaptation. Consequently, the dataset was originally used for multi-source to single target domain adaptation (Li et al. (2017)). Instead, we tackle a significantly more challenging problem of single-source to multiple target adaptation. Tab. 7 shows the classification accuracy of various methods. MTDA-ITA consistently
319
+
320
+ ![](images/18facd59a83865bc6e26c98e1f1fdea84883eb0fbbf03a8444befb1f847d7fe4.jpg)
321
+ Figure 4: Ablation of MTDA-ITA on Digit dataset. We show that each component of our method, Reconstruction loss, Classifier entropy loss with separating shared/private features, contributes to the overall performance.
322
+
323
+ Table 4: Classification results on digit datasets. M: MNIST; MM: MNIST-M, S: SVHN, U: USPS. The best is shown in red. c-X: combining all target domains into a single one and train it using X. s-MTDA-ITA: training multiple MTDA-ITA where each one correspond to a source-target pair. mp-DSN: extended DSN with multiple private encoder. $\bf \Pi ^ { * } U N I T$ trains with the extended SVHN $> 5 0 0 \mathrm { K }$ images vs ours 72K). $^ *$ PixelDA uses $( \approx 1 , 0 0 0 )$ of labeled target domain data as a validation set for tuning the hyper-parameters.
324
+
325
+ <table><tr><td>method</td><td>MM→S</td><td>MM→M</td><td>MM→U</td><td>U→S</td><td>U→M</td><td>U→MM</td></tr><tr><td>Source Only</td><td>40.00±0.61</td><td>84.46 ± 0.29</td><td>80.43± 0.50</td><td>23.41± 0.52</td><td>50.64 ± 0.37</td><td>41.45±0.38</td></tr><tr><td>1-NN</td><td>21.45</td><td>82.13</td><td>36.90</td><td>15.34</td><td>38.45</td><td>18.54</td></tr><tr><td>CORAL (Sun &amp; Saenko (2016))</td><td>40.20 ±0.60</td><td>84.90 ± 0.70</td><td>87.54 ± 0.44</td><td>38.90 ± 0.96</td><td>85.01 ± 0.61</td><td>60.45 ± 0.70</td></tr><tr><td>DANN (Ganin et al. (2016))</td><td>51.80 ± 0.91</td><td>61.05 ± 0.71</td><td>85.34 ± 0.64</td><td>35.50± 0.84</td><td>77.40 ± 0.64</td><td>61.60 ± 0.64</td></tr><tr><td>ADDA (Tzeng et al. (2017))</td><td>40.64 ± 0.86</td><td>92.82 ± 0.48</td><td>80.70±0.48</td><td>41.23 ± 0.78</td><td>90.10± 0.58</td><td>56.21 ± 0.79</td></tr><tr><td>c-ADDA</td><td>35.43 ± 0.94</td><td>88.47 ± 0.61</td><td>74.19 ± 0.58</td><td>39.36 ± 0.99</td><td>84.67 ± 0.94</td><td>52.54 ± 0.88</td></tr><tr><td>DTN (Zhang et al. (2015)) c-DTN</td><td>48.80± 0.66</td><td>88.80±0.38</td><td>90.68 ± 0.35</td><td>42.43 ± 0.61</td><td>89.04 ± 0.36</td><td>55.78 ± 0.40</td></tr><tr><td>UNIT (Liu et al. (2017))</td><td>44.21 ± 0.61</td><td>83.60 ± 0.54</td><td>84.98 ± 0.41</td><td>39.75 ± 0.64</td><td>85.04 ± 0.45</td><td>48.86 ± 0.54</td></tr><tr><td>DSN (Bousmalis et al. (2016))</td><td>1 51.50 ± 0.64</td><td></td><td>/</td><td></td><td>90.60</td><td></td></tr><tr><td>c-DSN</td><td>47.10 ± 0.50</td><td>90.20± 0.31</td><td>89.95± 0.29</td><td>48.20 ± 0.59</td><td>91.40 ± 0.30</td><td>60.45 ± 0.35</td></tr><tr><td>1p-DSN</td><td>45.00 ± 0.60</td><td>84.60 ± 0.40</td><td>84.80 ±0.39</td><td>40.50 ± 0.61</td><td>86.05 ± 0.46</td><td>56.25 ± 0.50</td></tr><tr><td>mp-DSN</td><td>47.15 ± 0.64</td><td>81.96 ± 0.60</td><td>83.03 ±0.49</td><td>39.30 ± 0.51</td><td>84.55 ± 0.56</td><td>55.03 ± 0.60</td></tr><tr><td>s-MTDA-ITA</td><td></td><td>85.51 ± 0.54</td><td>83.24± 0.24</td><td>38.30 ± 0.74</td><td>87.40 ± 0.35</td><td>55.47 ± 0.44</td></tr><tr><td>c-MTDA-ITA</td><td>50.55± 0.18 47.32±0.19</td><td>94.82±0.21</td><td>89.05 ±0.28</td><td>40.13±0.30</td><td>87.10 ± 0.25</td><td>61.01 ± 0.24</td></tr><tr><td>MTDA-ITA</td><td>53.50 ± 0.22</td><td>90.20 ±0.30 98.20 ± 0.10</td><td>90.01 ± 0.24 94.10 ± 0.11</td><td>41.10 ± 0.35 46.00 ± 0.48</td><td>85.35 ± 0.28 91.50 ± 0.23</td><td>60.31± 0.34 67.30 ± 0.15</td></tr></table>
326
+
327
+ Table 5: Classification results on Multi-PIE dataset. The best is shown in red.
328
+
329
+ <table><tr><td>method</td><td>C05 →C08</td><td>C05→C09</td><td>C05→C13</td><td>C05→C14</td></tr><tr><td>Source Only</td><td>31.56 ± 0.40</td><td>40.67 ± 0.36</td><td>39.89 ± 0.22</td><td>54.70± 0.25</td></tr><tr><td>1-NN CORAL (Sun &amp; Saenko (2016))</td><td>27.28 36.55 ± 0.66</td><td>31.22 38.60 ± 0.67</td><td>33.66</td><td>47.04 55.29 ± 0.47</td></tr><tr><td></td><td></td><td></td><td>40.60 ± 0.58</td><td></td></tr><tr><td>DANN (citeganin2016domain)</td><td>40.30 ± 0.60</td><td>41.20 ± 0.65</td><td>40.12 ± 0.60</td><td>58.90 ± 0.38</td></tr><tr><td>ADDA (Tzeng et al. (2017)) C-ADDA</td><td>33.21 ± 0.81</td><td>30.86 ± 0.90</td><td>52.44± 0.80</td><td>70.18 ± 0.60</td></tr><tr><td></td><td>46.88 ± 0.65</td><td>36.38 ± 0.88</td><td>39.14 ± 0.85</td><td>65.41 ± 0.69</td></tr><tr><td>DTN (Zhang et al. (2015))</td><td>38.50 ± 0.51</td><td>30.56 ± 0.46</td><td>55.78 ± 0.36</td><td>68.90 ± 0.31</td></tr><tr><td>c-DTN</td><td>41.70 ± 0.42</td><td>31.10 ± 0.48</td><td>50.19 ± 0.45</td><td>60.34 ± 0.35</td></tr><tr><td>PixelDA (Bousmalis et al. (2017))</td><td>44.93 ±0.42</td><td>44.75 ± 0.45</td><td>45.18 ± 0.45</td><td>46.88 ± 0.49</td></tr><tr><td>UNIT (Liu et al. (2017))</td><td>44.47 ± 0.21</td><td>44.47 ± 0.21</td><td>44.47 ± 0.20</td><td>44.51 ± 0.28</td></tr><tr><td>DSN (Bousmalis et al. (2016))</td><td>45.12 ± 0.46</td><td>44.35± 0.49</td><td>48.12 ± 0.53</td><td>75.00 ± 0.39</td></tr><tr><td>c-DSN</td><td>42.52 ± 0.48</td><td>38.54 ± 0.64</td><td>34.15 ± 0.64</td><td>69.45 ± 0.55</td></tr><tr><td>1p-DSN</td><td>41.64 ± 0.58</td><td>37.84 ± 0.63</td><td>34.65 ± 0.44</td><td>68.75 ± 0.85</td></tr><tr><td>mp-DSN</td><td>41.30 ± 0.28</td><td>35.14 ± 0.35</td><td>34.40 ± 0.35</td><td>65.70 ± 0.27</td></tr><tr><td>s-MTDA-ITA</td><td>44.40 ± 0.23</td><td>44.60 ± 0.25</td><td>47.65 ± 0.27</td><td>80.20 ± 0.13</td></tr><tr><td>c-MTDA-ITA</td><td>40.49 ± 0.25</td><td>40.70 ± 0.25</td><td>42.80 ± 0.25</td><td>71.60 ± 0.10</td></tr><tr><td>MTDA-ITA</td><td>49.01 ± 0.20</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>48.20± 0.27</td><td>53.13 ±0.22</td><td>84.29 9±0.10</td></tr></table>
330
+
331
+ # Algorithm 1 MDTA-ITA Algorithm
332
+
333
+ Require: $\{ \mathbf { X } , \mathbf { Y } , \mathbf { D } \} { : \mathrm { M } }$ domain datasets.
334
+ $\lambda _ { r } , \lambda _ { c } , \lambda _ { d }$ : Model hyper-parameters.
335
+ Ensure: $\theta _ { s } , \theta _ { p } , \theta _ { c } , \phi , \psi$ : Model parameters.
336
+ 1: Initialize $\bar { \theta } _ { s } , \theta _ { p } , \theta _ { c } , \phi , \psi$ ;
337
+ 2: repeat 3: Sample a mini-batch from each of source/target domain datasets.
338
+ 4: Update $\{ \theta _ { s } \}$ by minimizing $\mathcal { L } _ { s }$ in Eq.(10) through the gradient descent: $\begin{array} { r } { \theta _ { s } = \theta _ { s } - \eta \frac { \partial \mathcal { L } _ { s } } { \partial \theta _ { s } } } \end{array}$ .
339
+ 5: Update {θp} by minimizing Lp in Eq.(9) through the gradient descent:θp = θp − η ∂Lp∂θp .
340
+ 6: Update $\{ \theta _ { c } \}$ by minimizing $\mathcal { L } _ { c }$ in Eq.(8) through the gradient descent: $\begin{array} { r } { \theta _ { c } = \theta _ { c } - \eta \frac { \partial \mathcal { L } _ { c } } { \partial \theta _ { c } } } \end{array}$ 7: Update $\{ \phi \}$ by minimizing $\mathcal { L } _ { \phi }$ in Eq.(6) through the gradient descent: $\phi = \phi - \eta \frac { \partial \mathcal { L } _ { \phi } } { \partial \phi }$ .
341
+ 8: Update $\{ \psi \}$ by minimizing $\mathcal { L } _ { \psi }$ in Eq.(5) through the gradient descent: $\begin{array} { r } { \psi = \psi - \eta \frac { \partial \mathcal { L } _ { s } } { \partial \psi } } \end{array}$ .
342
+ 9: until Convergence;
343
+ 10: return $\{ \theta _ { s } , \theta _ { p } , \theta _ { c } , \phi , \psi \}$ .
344
+
345
+ achieves the best performance for all transfer tasks. Evaluations were obtained by training all models (ADDA, DSN, and ours) from scratch on the PACS dataset. Note that the overall performance figures are low due to the extreme difficulty of the transfer task, induced by large differences among domains.
346
+
347
+ # H ANALYSIS OF SHARED/PRIVATE SPACE EMBEDDING
348
+
349
+ In the experiments conducted, we showed that our approach is able to achieve better performance than the competing methods including the extended DSN with one private encoder (1p-DSN) which is the most similar method to ours.
350
+
351
+ ![](images/07d4618a501cd10a00bd625bd5df1054e718feb2cb44cd9581d0cca9092af8f0.jpg)
352
+ Figure 5: Feature visualization for embedding of digit datasets using t-SNE algorithm. The first and the second columns show the domains and classes, respectively, with color indicating domain and class membership. (a),(b) Original features. (c),(d) learned features for MTDA-ITA (triangle marker: private features, circle marker: shared features). Large clusters in the right column represent points from the shared space, while the smaller ones are from the private spaces. (e),(f) learned features for 1p-DSN.
353
+
354
+ Indeed, fig. 5 depicts the embedding of the MTDA-ITA learned private/shared features, those of 1p-DSN and the original features from different domains for Digit datasets (SVHN is the source).
355
+
356
+ Notice that both MTDA-ITA and 1p-DSN reduces the domain mismatch for the shared features (circle markers in fig. 5) and separate the shared features from private features. On the other hand, MTDA-ITA increases the domain separation for the private features (triangle markers, pure and well-separated domain clusters in fig. 5c) while 1p-DSN is unable to enforce the private representation of different domains to be different (fig. 5e) that may result in redundancy of different private spaces. This is partially due to the proposed multi-domain separation loss through the use of the domain classifier $D$ , which penalizes the domain mismatch for the shared features and rewards the mismatch for the private features, something the 1p-DSN fails to account for. Moreover, as supported by the quantitative results in tab. 1, the class label separation in
357
+
358
+ <table><tr><td>method</td><td>C08→C05</td><td>C08→C09</td><td>C08→C13</td><td>C08→C14</td><td>C09→C05</td><td>C09→C08</td><td>C09→C13</td><td>C09→C14</td></tr><tr><td>Source Only</td><td>33.70±0.33</td><td>50.10±0.28</td><td>50.80±0.32</td><td>40.13±0.26</td><td>33.32±0.44</td><td>48.24±0.32</td><td>49.24±0.30</td><td>36.19±0.27</td></tr><tr><td>1-NN</td><td>28.75</td><td>35.39</td><td>39.79</td><td>32.13</td><td>26.82</td><td>35.30</td><td>34.26</td><td>28.41</td></tr><tr><td>CORAL (Sun &amp; Saenko (2016))</td><td>35.89 ± 0.44</td><td>55.79±0.50</td><td>60.00 ±0.29</td><td>40.67 ± 0.48</td><td>35.89 ± 0.40</td><td>51.56±0.43</td><td>50.45 ± 0.41</td><td>40.67± 0.35</td></tr><tr><td>DANN (Ganin et al. (2016))</td><td>40.20±0.50</td><td>56.89 ± 0.39</td><td>55.83 ±0.40</td><td>43.25±0.41</td><td>50.63±0.38</td><td>58.40 ± 0.51</td><td>55.81 ± 0.53</td><td>48.90 ±0.43</td></tr><tr><td>ADDA(Tzeng et al. (2017))</td><td>37.40±0.68</td><td>58.40±0.73</td><td>60.40±0.83</td><td>42.10±0.48</td><td>29.40±0.70</td><td>53.30±0.49</td><td>45.30± 0.53</td><td>38.30±0.63</td></tr><tr><td>c-ADDA</td><td>41.60±0.64</td><td>39.65 ±0.70</td><td>50.00 ±0.52</td><td>46.25±0.52</td><td>45.01±0.63</td><td>52.14 ± 0.53</td><td>37.43 ± 0.60</td><td>43.26±0.58</td></tr><tr><td>DTN (Zhang et al. (2015))</td><td>44.13 ± 0.41</td><td>57.42 ± 0.42</td><td>55.89±0.48</td><td>45.76± 0.39</td><td>44.53± 0.49</td><td>57.34±0.35</td><td>52.43±0.38</td><td>51.55 ± 0.40</td></tr><tr><td>c-DTN</td><td>45.10 ±0.44</td><td>49.78±0.50</td><td>47.43 ±0.46</td><td>45.79 ±0.48</td><td>49.80±0.40</td><td>55.69 ± 0.35</td><td>50.10 ± 0.38</td><td>52.31 ±0.29</td></tr><tr><td>PixelDA (Bousmalis et al. (2017))</td><td>46.45 ± 0.45</td><td>44.33±0.38</td><td>44.87 ± 0.41</td><td>46.83±0.29</td><td>45.63±0.34</td><td>16.37 ± 0.27</td><td>45.43 ± 0.35</td><td>47.00± 0.49</td></tr><tr><td>UNIT (Liu et al. (2017))</td><td>43.88±0.18</td><td>43.99±0.23</td><td>44.47±0.19</td><td>44.47 ± 0.24</td><td>44.47 ± 0.17</td><td>43.95± 0.21</td><td>44.64±0.22</td><td>44.47 ±0.19</td></tr><tr><td>DSN (Bousmalis et al. (2016)) c-DSN</td><td>46.25± 0.53</td><td>47.50±0.60</td><td>62.15 ± 0.58</td><td>39.72± 0.55</td><td>45.85±0.48</td><td>56.65±0.50</td><td>56.5±0.38</td><td>42.87±0.43</td></tr><tr><td></td><td>45.82 ± 0.53</td><td>44.64± 0.42</td><td>45.60 ± 0.48</td><td>46.32±0.52</td><td>45.18 ± 0.47</td><td>45.52 ± 0.55</td><td>44.79 ± 0.53</td><td>47.37 ± 0.48</td></tr><tr><td>1p-DSN</td><td>44.12 ± 0.73</td><td>44.14 ± 0.20</td><td>45.00 ±0.38</td><td>45.62 ± 0.42</td><td>44.78 ±0.47</td><td>45.02 ±0.65</td><td>44.21 ± 0.48</td><td>46.97 ± 0.38</td></tr><tr><td>mp-DSN</td><td>42.19±0.46</td><td>44.70±0.53</td><td>42.47 ± 0.48</td><td>40.50±0.39</td><td>45.00±0.51</td><td>43.80±0.50</td><td>45.79±0.48</td><td>42.39 ±0.49</td></tr><tr><td>s-MTDA-ITA</td><td>44.77±0.19</td><td>45.61±0.18</td><td>60.00±0.27</td><td>46.70±0.28</td><td>49.06±0.24</td><td>55.33±0.22</td><td>59.90±0.30</td><td>50.64± 0.26</td></tr><tr><td>c-MTDA-ITA MTDA-ITA</td><td>44.35± 0.27</td><td>42.67 ± 0.24</td><td>58.90 ±0.26</td><td>44.32 ± 0.26</td><td>46.74 ±0.22</td><td>54.11 ± 0.21</td><td>56.89 ± 0.23</td><td>49.64 ± 0.19</td></tr><tr><td></td><td>46.30 ± 0.25</td><td>60.60 ± 0.18</td><td>60.50±0.19</td><td>50.40±0.20</td><td>55.59± 0.25</td><td>57.80±0.21</td><td>64.20 ±0.18</td><td>56.34 ± 0.20</td></tr></table>
359
+
360
+ Table 6: Classification results on Multi-PIE dataset. The best (red).
361
+
362
+ <table><tr><td>method</td><td>P→A</td><td>P→C</td><td>P→S</td><td>A→P</td><td>A→C</td><td>A→S</td></tr><tr><td>1-NN</td><td>15.28</td><td>18.16</td><td>25.60</td><td>22.70</td><td>19.75</td><td>22.70</td></tr><tr><td>ADDA(Tzeng et al. (2017))</td><td>24.35 ± 2.37</td><td>20.12 ± 2.50</td><td>22.45 ± 2.11</td><td>32.57 ± 2.70</td><td>17.68 ± 2.04</td><td>18.90 ± 2.48</td></tr><tr><td>DSN (Bousmalis et al. (2016))</td><td>28.42 ±2.12</td><td>21.14 ± 2.08</td><td>2.04 ± 1.90</td><td>29.54 ± 1.95</td><td>25.89 ± 1.88</td><td>24.69 ± 2.08</td></tr><tr><td>s-MTDA-ITA</td><td>28.02 ± 1.59</td><td>21.64±1.24</td><td>26.24 ± 1.60</td><td>31.06 ± 1.50</td><td>25.09±1.40</td><td>25.89±1.03</td></tr><tr><td>c-MTDA-ITA</td><td>25.35 ± 1.80</td><td>20.24 ± 1.39</td><td>23.64 ± 1.60</td><td>26.54 ± 1.33</td><td>20.30 ± 1.29</td><td>22.38 ± 1.45</td></tr><tr><td>MTDA-ITA</td><td>31.40 ±1.55</td><td>23.05 ±1.04</td><td>28.24 ±1.78</td><td>35.74 ± 1.50</td><td>27.00 ±1.25</td><td>28.90 ±1.60</td></tr></table>
363
+
364
+ Table 7: Classification results on PACS dataset classification. A:Art-painting, C:Cartoon, S:Sketch, P:Photo. The best (red).
365
+
366
+ the shared space for 1p-DSN, fig. 5f, is still evident but not as strong as in the MTDA-ITA, fig. 5d. This can be attributed to the lack of redundancy in the private space that helps MTDA-ITA to learn more disentangled shared features and usage of the target samples during training, something the 1p-DSN fails to account for.
367
+
368
+ ![](images/f7a643eee7751386eefa467035b5bfae216f67ec9df6317cb9b21d6dd8832516.jpg)
369
+ Figure 6: Feature visualization for embedding of digit datasets using t-SNE algorithm. The first and the second columns show the domains and classes, respectively, with color indicating domain and class membership. (a),(b) Original features. (c),(d) learned features for MTDA-ITA (triangle marker: private features, circle marker: shared features). Large clusters21 in the right column represent points from the shared space, while the smaller ones are from the private spaces. The remaining figures depict the learned features without: (e),(f) the classifier entropy loss, MTDA-woE; (g),(h) the private encoder, MTDA-woP; (i),(j) the reconstruction loss/decoder, MTDA-woR; and (k),(l) the multi-domain separation loss, MTDA-woD.
md/train/Bk6qQGWRb/Bk6qQGWRb.md ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EFFICIENT EXPLORATION THROUGH BAYESIAN DEEPQ-NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We propose Bayesian Deep Q-Network (BDQN), a practical Thompson sampling based Reinforcement Learning (RL) Algorithm. Thompson sampling allows for targeted exploration in high dimensions through posterior sampling, but is usually computationally expensive. We address this limitation by introducing uncertainty only at the output layer of the network through a Bayesian Linear Regression (BLR) model, which can be trained with fast closed-form updates and its samples can be drawn efficiently through the Gaussian distribution. We apply our method to a wide range of Atari Arcade Learning Environments. Since BDQN carries out more efficient exploration, it is able to reach higher rewards substantially faster than a key baseline, DDQN.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Designing algorithms that achieve an optimal trade-off between exploration and exploitation is one of the primary goal of reinforcement learning (RL). However, targeted exploration in high dimensional spaces is a challenging problem in RL. Recent advances in deep RL mostly deploy simple exploration strategies such as $\varepsilon$ -greedy, where the agent chooses the optimistic action, the action with highest promising return, with probability $( 1 - \varepsilon )$ , otherwise, uniformly at random picks one of the available actions. Due to this uniform sampling, the $\varepsilon$ -greedy method scales poorly with the dimensionality of state and action spaces. Recent work has considered scaling exploration strategies to large domains (Bellemare et al., 2016; Tang et al., 2016). Several of these papers have focused on employing optimism-under-uncertainty approaches, which essentially rely on computing confidence bounds over different actions, and acting optimistically with respect to that uncertainty.
12
+
13
+ An alternative to optimism-under-uncertainty (Brafman & Tennenholtz, 2003) is Thompson Sampling (TS) (Thompson, 1933), one of the oldest heuristics for multi arm bandits. TS is a Bayesian approach where one starts with a prior distribution over the belief and compute the posterior beliefs based on the collected data through the interaction with the environment and then maximizes the expected return under the sampled belief. The TS based posterior sampling can provide more targeted exploration since it can trade off uncertainty with the expected return of actions. In contrast, the $\varepsilon$ -greedy strategy is indifferent to uncertainty of the actions and the expected rewards of sub-optimistic ones (set of actions excluding the optimistic action).
14
+
15
+ There has been relatively little work on scaling Thompson Sampling to large state spaces. The primary difficulty in implementing Thompson sampling is the difficulty of sampling from general posterior distributions. Prior efforts in this space have generally required extremely expensive computations (e.g. (Ghavamzadeh et al., 2015; Strens, 2000))
16
+
17
+ We derive a practical Thompson sampling framework, termed as Bayesian deep Q-networks (BDQN), where we approximate the posterior distribution on the set of Q-functions and sample from this approximated posterior. BDQN is computationally efficient since it incorporates uncertainty only at the output layer, in the form of a Bayesian linear regression model. Due to linearity and by choosing a Gaussian prior, we derive a closed-form analytical update to the approximated posterior distribution over Q functions. We can also draw samples efficiently from the Gaussian distribution. As addressed in Mnih et al. (2015), one of the major benefits of function approximation methods in deep RL is that the estimation of the Q-value, given a state-action pair, can generalize well to other state-action pairs, even if they are visited rarely. We expect this to hold in BDQN as well, but additionally, we also expect the uncertainty of state-action pairs to generalize well.
18
+
19
+ We test BDQN on a wide range of Arcade Learning Environment Atari games (Bellemare et al., 2013; Brockman et al., 2016) against a strong baseline DDQN (Van Hasselt et al., 2016). Aside from simplicity and popularity of DDQN, BDQN and DDQN share the same architecture, and follow same target objective. These are the main reasons we choose DDQN for our comparisons.
20
+
21
+ In table. 1 we see significant gains for BDQN over DDQN. BDQN is able to learn significantly faster and reach higher returns due to more efficient exploration. The evidence of this is further seen from the fact that we are able to train BDQN with much higher learning rates compared to DDQN. This suggests that BDQN is able to learn faster and reach better scores.
22
+
23
+ These promising results suggest that BDQN can further benefit from additional modifications that were done to DQN, e.g. Prioritized Experience Replay (Schaul et al., 2015), Dueling approach (Wang et al., 2015), A3C (Mnih et al., 2016), safe exploration (Lipton et al., 2016a), and etc. This is because BDQN only changes that exploration strategy of DQN, and can easily accommodate additional improvements to DQN.
24
+
25
+ <table><tr><td rowspan=1 colspan=1>Game</td><td rowspan=1 colspan=1>BDQNDDQN</td><td rowspan=1 colspan=1>BDQNDDQNt</td><td rowspan=1 colspan=1>BDQNHUMAN</td><td rowspan=1 colspan=1>Step</td></tr><tr><td rowspan=1 colspan=1>Amidar</td><td rowspan=1 colspan=1>558%</td><td rowspan=1 colspan=1>788%</td><td rowspan=1 colspan=1>325%</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Alien</td><td rowspan=1 colspan=1>103%</td><td rowspan=1 colspan=1>103%</td><td rowspan=1 colspan=1>43%</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Assault</td><td rowspan=1 colspan=1>396%</td><td rowspan=1 colspan=1>176%</td><td rowspan=1 colspan=1>589%</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Asteroids</td><td rowspan=1 colspan=1>2517%</td><td rowspan=1 colspan=1>1516%</td><td rowspan=1 colspan=1>108%</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Asterix</td><td rowspan=1 colspan=1>531%</td><td rowspan=1 colspan=1>385%</td><td rowspan=1 colspan=1>687%</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>BeamRider</td><td rowspan=1 colspan=1>207%</td><td rowspan=1 colspan=1>114%</td><td rowspan=1 colspan=1>150%</td><td rowspan=1 colspan=1>70M</td></tr><tr><td rowspan=1 colspan=1>BattleZone</td><td rowspan=1 colspan=1>281%</td><td rowspan=1 colspan=1>253%</td><td rowspan=1 colspan=1>172%</td><td rowspan=1 colspan=1>50M</td></tr><tr><td rowspan=1 colspan=1>Atlantis</td><td rowspan=1 colspan=1>80604%</td><td rowspan=1 colspan=1>49413%</td><td rowspan=1 colspan=1>11172%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>DemonAttack</td><td rowspan=1 colspan=1>292%</td><td rowspan=1 colspan=1>114%</td><td rowspan=1 colspan=1>326%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>Centipede</td><td rowspan=1 colspan=1>114%</td><td rowspan=1 colspan=1>178%</td><td rowspan=1 colspan=1>61%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>BankHeist</td><td rowspan=1 colspan=1>211%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>CrazyClimber</td><td rowspan=1 colspan=1>148%k</td><td rowspan=1 colspan=1>122%</td><td rowspan=1 colspan=1>350%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>ChopperCommand</td><td rowspan=1 colspan=1>14500%</td><td rowspan=1 colspan=1>1576%</td><td rowspan=1 colspan=1>732%</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>Enduro</td><td rowspan=1 colspan=1>295%</td><td rowspan=1 colspan=1>350%</td><td rowspan=1 colspan=1>361%</td><td rowspan=1 colspan=1>30M</td></tr><tr><td rowspan=1 colspan=1>Pong</td><td rowspan=1 colspan=1>112%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>226%</td><td rowspan=1 colspan=1>5M</td></tr></table>
26
+
27
+ Table 1: The first column presents the score ratio after last column steps. The second column is the score ratio of BDQN after the number of steps in the last column compared to the score of $\mathrm { D D Q N } ^ { \dagger }$ , the reported scores of DDQN in Van Hasselt et al. (2016) after running for 200M samples during evaluation time, and the third column is with respect to Human score reported at Mnih et al. (2015).
28
+
29
+ # 2 RELATED WORK
30
+
31
+ The complexity of the exploration-exploitation trade-off has been vastly investigated in RL literature (Kearns & Singh, 2002; Brafman & Tennenholtz, 2003; Strehl et al., 2009; Bartlett & Tewari, 2009; Azar et al., 2017; Dann et al., 2017). Auer (2002) addresses this question for multi-armed bandit problems where regret guarantees are provided. Jaksch et al. (2010) investigates the regret analyses in MDPs where exploration happens through the optimal policy of optimistic model, a well-known Optimism in Face of Uncertainty (OFU) principle where a high probability regret upper bound is guaranteed. Azizzadenesheli et al. (2016a) deploys OFU in order to propose the high probability regret upper bound for Partially Observable MDPs (POMDPs) and finally, Bartók et al. (2014) tackles a general case of partial monitoring games and provides minimax regret guarantee which is polynomial in certain dimensions of the problem.
32
+
33
+ In multi arm bandit, there is compelling empirical evidence that Thompson Sampling can provide better results than optimism-under-uncertainty approaches (Chapelle & Li, 2011), while the state of the art performance bounds are preserved (Russo & Van Roy, 2014; Agrawal & Goyal, 2012; Gopalan & Mannor, 2015; Abeille & Lazaric, 2017). A natural adaptation of this algorithm to RL, posterior sampling RL (PSRL), first proposed by Strens (2000) also shown to have good frequentist and Bayesian performance guarantees (Osband et al., 2013; Gopalan & Mannor, 2015; Agrawal & Jia, 2017; Abbasi-Yadkori & Szepesvári, 2015; Ouyang et al., 2017; Theocharous et al., 2017; Russo et al., 2017). Even though the theoretical RL addresses the exploration and exploitation trade-offs, these problems are still prominent in empirical reinforcement learning research (Mnih et al., 2015; Jiang et al., 2016; Abel et al., 2016; Azizzadenesheli et al., 2016b). On the empirical side, the recent success in the video games has sparked a flurry of research interest. Following the success of Deep RL on Atari games (Mnih et al., 2015) and the board game Go (Silver et al., 2017), many researchers have begun exploring practical applications of deep reinforcement learning (DRL). Some investigated applications include, robotics (Levine et al., 2016), energy management (Night, 2016), and self-driving cars (Shalev-Shwartz et al., 2016). Among the mentioned literature, the prominent exploration strategy for Deep RL agent has been $\varepsilon$ -greedy.
34
+
35
+ Inevitably for PSRL, the act of posterior sampling for policy or value is computationally intractable with large systems, so PSRL can not be easily leveraged to high dimensional problems. To remedy these failings Osband et al. (2017) consider the use of randomized value functions to approximate posterior samples for the value function in a computationally efficient manner. They show that with a suitable linear value function approximation, using the approximated Bayesian linear regression for randomized least-squares value iteration method can remain statistically efficient (Osband et al., 2014) but still is not scalable to large scale RL with deep neural networks.
36
+
37
+ To combat these shortcomings, Osband et al. (2016) suggests a bootstrapped-ensemble approach that trains several models in parallel to approximate uncertainty. Other works suggest using a variational approximation to the Q-networks (Lipton et al., 2016b) or noisy network (Fortunato et al., 2017). However, most of these approaches significantly increase the computational cost of DQN and neither approaches produced much beyond modest gains on Atari games. Applying Bayesian regression in last layer of neural network was investigated in Snoek et al. (2015) for object recognition, image caption generation, and etc. where a significant advantage has been provided.
38
+
39
+ In this work we present another alternative approach that extends randomized least-squares value iteration method (Osband et al., 2014) to deep neural networks: we approximate the posterior by a Bayesian linear regression only on the last layer of the neural network. This approach has several benefits, e.g. simplicity, robustness, targeted exploration, and most importantly, we find that this method is much more effective than any of these predecessors in terms of sample complexity and final performance.
40
+
41
+ Concurrently, O’Donoghue et al. (2017) studies how to construct the frequentist confidence of the regression on the feature space of the neural network for RL problems by learning the uncertainties through a shallow network while Levine et al. (2017), similar to BDQN, suggests running linear regression on the representation layer of the deep network in order to learn the state-action value. Drop-out, as another randomized exploration method is proposed by Gal & Ghahramani (2016) but Osband et al. (2016) argues about its estimated uncertainty and hardness in driving a suitable exploitation of it. It is worth noting that most of proposed methods are based on $\varepsilon$ -exploration.
42
+
43
+ # 3 THOMPSON SAMPLING VS ε−GREEDY
44
+
45
+ In this section, we enumerate a few benefits of TS over $\varepsilon$ -greedy strategies. We show how TS strategies exploit the uncertainties and expected returns to design a randomized exploration while $\varepsilon -$ greedy strategies disregard all these useful information for the exploration.
46
+
47
+ Fig. 1(a) expresses the agent’s estimated values and uncertainties for the available actions at a given state $x$ . While $\varepsilon -$ greedy strategy mostly focus on the action 1, the optimistic action, the TS based strategy randomizes, mostly, over actions 1 through 4, utilizing their approximated returns and uncertainties, and with low frequency tries actions 5, 6. Not only the $\varepsilon -$ greedy strategy explores actions 5 and 6, where the RL agent is almost sure about low return of these actions, as frequent as other sub-optimistic actions, but also spends the network capacity to accurately estimate their values.
48
+
49
+ ![](images/44bda5713030c894fc2cad5c544c21705f3a46c15c61d88172fcc2dd85e2db1b.jpg)
50
+ Figure 1: A cartoon representation of TS vs $\varepsilon$ -greedy. The red crosses are the true Q-values, the diamonds are the mean of estimated Q-values with blue intervals as uncertainties (e.g. $c \cdot$ variance)
51
+
52
+ A commonly used technique in deep RL is a moving window of replay buffer to store the recent experiences. The TS based agent, after a few tries of actions 5 and 6 builds a belief in low return of these actions given the current target values. Since the replay buffer is bounded moving window, lack of samples of these actions pushes the posterior belief of these actions to the prior, over time, and the agent tries them again in order to update its belief Fig. $1 ( b )$ . In general, TS based strategy advances the exploration-exploitation trade-off by making trade-off between the expected returns and the uncertainties, while $\varepsilon -$ greedy strategy ignores all of this information.
53
+
54
+ Another superiority of TS over $\varepsilon$ -greedy can be described using Fig. $1 ( c )$ . Consider an episodic maze-inspired deterministic game, with episode length $H$ of shortest pass from the start to the destination. The agent is placed to the start point at the beginning of each episode where the goal state is to reach the destination and receive a reward of 1 otherwise reward is 0. Consider an agent, which is given a hypothesis set of Q-functions where the true Q-function is within the set and is the most optimistic function in the set. In this situation, TS randomizes over the Q-functions with high promising returns and relatively high uncertainty, including the true Q-function. When it picks the true Q-function, it increases the posterior probability of this Q-function because it matches the likelihood. When TS chooses other functions, they predict deterministically wrong values and the posterior update of those functions set to zero, therefore, the agent will not choose them again, i.e. TS finds the true Q-function very fast. For $\varepsilon$ -greedy agent, even though it chooses the true function at the beginning (it is the optimistic one), at each time step, it randomizes its action with the probability $\varepsilon$ . Therefore, it takes exponentially many trials in order to get to the target in this game.
55
+
56
+ # 4 PRELIMINARIES
57
+
58
+ An infinite horizon $\gamma$ -discounted MDP $M$ is a tuple $\langle \mathcal { X } , \mathcal { A } , T , R \rangle$ , with state space $\mathcal { X }$ , action space $\mathcal { A }$ , and the transition kernel $T$ , accompanied with reward function of $R$ where $0 < \gamma \leq 1$ . At each time step $t$ , the environment is at a state $x _ { t }$ , called current state, where the agent needs to make a decision $a _ { t }$ under its policy. Given the current state and action, the environment stochastically proceed to a successor state $x _ { t + 1 }$ under probability distribution $T ( X _ { t + 1 } | x _ { t } , a _ { t } ) : = \mathbb { P } ( X _ { t + 1 } | x _ { t } , a _ { t } )$ and provides a stochastic reward $r _ { t }$ with mean of $\mathbb { E } [ r | x = x _ { t } , a = a _ { t } ] = R ( x _ { t } , a _ { t } )$ . The agent objective is to optimize the overall expected discounted reward over its policy $\pi : = \mathcal { X } \mathcal { A }$ , a stochastic mapping from states to actions, ${ \bar { \pi } } ( a | x ) : = \mathbb { P } ( a | x )$ .
59
+
60
+ $$
61
+ \eta ^ { * } = \eta ( \pi ^ { * } ) = \operatorname* { m a x } _ { \pi } \eta ( \pi ) = \operatorname* { m a x } _ { \pi } \operatorname* { l i m } _ { N \infty } \mathbb { E } _ { \pi } [ \sum _ { t = 0 } ^ { N } \gamma ^ { t } r _ { t } ]
62
+ $$
63
+
64
+ The expectation in Eq. 1 is with respect to the randomness in the distribution of initial state, transition probabilities, stochastic rewards, and policy, under stationary distribution, where $\eta ^ { * } , \pi ^ { * }$ are optimal return and optimal policy, respectively. Let $Q _ { \pi } ( x , a )$ denote the average discounted reward under policy $\pi$ starting off from state $x$ and taking action $a$ in the first place.
65
+
66
+ $$
67
+ Q _ { \pi } ( x , a ) : = \operatorname* { l i m } _ { N \to \infty } \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { N } \gamma ^ { t } r _ { t } | x _ { 0 } = x , a _ { 0 } = a \right]
68
+ $$
69
+
70
+ For a given policy $\pi$ and Markovian assumption of the model, we can rewrite the equation for the Q functions as follows:
71
+
72
+ $$
73
+ Q _ { \pi } ( x , a ) = R ( x , a ) + \gamma \sum _ { x ^ { \prime } , a ^ { \prime } } T ( x ^ { \prime } | x , a ) \pi ( a ^ { \prime } | x ^ { \prime } ) Q _ { \pi } ( x ^ { \prime } , a ^ { \prime } )
74
+ $$
75
+
76
+ To find the optimal policy, one can solve the Linear Programing problem in Eq. 1 or follow the corresponding Bellman equation Eq. 2 where both of optimization methods turn to
77
+
78
+ $$
79
+ Q ^ { * } ( x , a ) = R ( x , a ) + \gamma \sum _ { x ^ { \prime } } T ( x ^ { \prime } | x , a ) \operatorname* { m a x } _ { a ^ { \prime } } Q ^ { * } ( x ^ { \prime } , a ^ { \prime } )
80
+ $$
81
+
82
+ where $Q ^ { * } ( x , a ) = Q _ { \pi ^ { * } } ( x , a )$ and the optimal policy is a deterministic mapping from state to actions in $\mathcal { A }$ , i.e. $x \to a r g \operatorname* { m a x } _ { a } Q ^ { * } ( x , a )$ . In RL, we do not know the transition kernel and the reward function in advance, therefore, we can not solve the posed Bellman equation directly. In order to tackle this problem, (Lagoudakis & Parr, 2003; Antos et al., 2008) studies the property of minimizing the Bellman residual of a given Q-function
83
+
84
+ $$
85
+ \mathcal { L } ( Q ) = \mathbb { E } _ { \pi } \left[ \left( Q ( x , a ) - r - \gamma Q ( x ^ { \prime } , a ^ { \prime } ) \right) ^ { 2 } \right]
86
+ $$
87
+
88
+ Where the tuple $( x , a , r , x ^ { \prime } , a ^ { \prime } )$ consists of consecutive samples under behavioral policy $\pi$ . Furthermore, (Mnih et al., 2015) carries the same idea, and introduce Deep Q-Network (DQN) where the Q-functions are parameterized by a DNN. To improve the quality of Q function, they use back propagation on loss $\mathcal { L } ( Q )$ using TD update (Sutton $\&$ Barto, 1998). In the following we describe the setting used in DDQN. In order to reduce the bias of the estimator, they introduce target network ${ Q } ^ { t a r g e t }$ and target value $y = r + \gamma Q ^ { t a r g e t } ( x ^ { \prime } , \hat { a } )$ where $\hat { a } = \arg \operatorname* { m a x } _ { a ^ { \prime } } Q ( x ^ { \prime } , a ^ { \prime } )$ with a new loss $\mathcal { L } ( Q , Q ^ { t a r g e t } )$
89
+
90
+ $$
91
+ \mathcal { L } ( Q , Q ^ { t a r g e t } ) = \mathbb { E } _ { \boldsymbol \pi } \left[ \left( Q ( \boldsymbol x , a ) - y \right) ^ { 2 } \right]
92
+ $$
93
+
94
+ Minimizing this regression loss, and respectably its estimation $\widehat { \mathcal { L } } ( Q , Q ^ { t a r g e t } )$ , matches the $Q$ to the target $y$ . Once in a while, the algorithm sets ${ Q } ^ { t a r g e t }$ network to $Q$ network, peruses the regression with the new target value, and provides an biased estimator of the target.
95
+
96
+ # 5 BAYESIAN DEEP Q-NETWORKS
97
+
98
+ We propose a Bayesian method to approximate the $Q$ -function and match it to the target value. We utilize the DQN architecture, remove its last layer, and build a Bayesian linear regression (BLR) (Rasmussen & Williams, 2006) on the feature representation layer, $\dot { \phi } _ { \theta } ( x ) \in \mathbb { R } ^ { d }$ , parametrized by $\theta$ . We deploy BLR to efficiently approximate the distribution over the Q-values where the uncertainty over the values is captured. A common assumption in DNN is that the feature representation is suitable for linear classification or regression (same assumption in DQN).
99
+
100
+ The Q-functions can be approximated as a linear combination of features, i.e. for a given pair of state-action, $Q ( x , a ) = \phi _ { \boldsymbol { \theta } } ( \bar { x } ) ^ { \top } w _ { a }$ . Therefore, by deploying BLR, we can approximate the generative model of the Q-function using its corresponding target value: $y = r + \stackrel { } { \gamma } \phi ^ { t a r g e t } w ^ { t a r g e \acute { t } } \hat { a }$ , where φtargetθ (x) ∈ Rd denotes the feature representation of target network, for any (x, a) as follows
101
+
102
+ $$
103
+ \boldsymbol { y } = \boldsymbol { Q } ( \boldsymbol { x } , \boldsymbol { a } ) + \epsilon = \boldsymbol { w } _ { \boldsymbol { a } } ^ { \top } \phi ( \boldsymbol { x } ) + \epsilon , \quad \forall \boldsymbol { x } \in \mathcal { X } , \boldsymbol { a } \in \mathcal { A }
104
+ $$
105
+
106
+ where $\epsilon \sim \mathcal { N } ( 0 , \sigma _ { \epsilon } ^ { 2 } )$ is an iid noise. Furthermore, we consider $w _ { a } \in \mathbb { R } ^ { d }$ for $a \in { \mathcal { A } }$ are drawn approximately from a Gaussian prior ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } )$ . Therefore, $y | x , a , w _ { a } \sim \mathcal { N } ( \phi ( x ) ^ { \top } w _ { a } , \sigma _ { \epsilon } ^ { 2 } )$ . Moreover, the distribution of the target value $y$ is $\begin{array} { r } { \mathbb { P } \left( y \vert a \right) = \int _ { w _ { a } } \mathbb { P } \left( y \vert w _ { a } \right) \mathbb { P } \left( w _ { a } \right) d w _ { a } } \end{array}$ . Given a dataset $\mathcal { D } = \{ x _ { \tau } , a _ { \tau } , y _ { \tau } \} _ { \tau = 1 } ^ { D }$ , we construct $| { \cal A } |$ disjoint datasets for each action, $\mathcal { D } _ { a }$ , where $\mathcal { D } = \cup _ { a \in \mathcal { A } } \mathcal { D } _ { a }$ and $\mathcal { D } _ { a }$ is a set of tuples $x _ { \tau } , a _ { \tau } , y _ { \tau }$ with the action $a _ { \tau } = a$ and size $D _ { a }$ . We are interested in $\mathbb { P } ( w _ { a } | \mathcal { D } _ { a } )$ and $\mathbb { P } ( Q ( x , a ) | \mathcal { D } _ { a } ) , \forall x \in \mathcal { X }$ . We construct a matrix $\Phi _ { a } \in \mathbb { R } ^ { d \times D _ { a } }$ , a concatenation of feature column vectors distribu $\{ \phi ( x _ { i } ) \} _ { i = 1 } ^ { D _ { a } }$ , and llow $\mathbf { y } _ { a } \in \mathbb { R } ^ { D _ { a } }$ , a concatenation of target values in set $\mathcal { D } _ { a }$ . Therefore the posterior
107
+
108
+ $$
109
+ w _ { a } \sim { \mathcal { N } } \left( { \frac { 1 } { \sigma _ { \epsilon } ^ { 2 } } } \Xi _ { a } \Phi _ { a } \mathbf { y } _ { a } , \Xi _ { a } \right) , w h e r e \Xi _ { a } = \left( { \frac { 1 } { \sigma _ { \epsilon } ^ { 2 } } } \Phi _ { a } \Phi _ { a } ^ { \top } + { \frac { 1 } { \sigma ^ { 2 } } } \mathbb { 1 } \right) ^ { - 1 }
110
+ $$
111
+
112
+ # Algorithm 1 BDQN
113
+
114
+ 1: Initialize parameter sets $\theta$ , $\theta ^ { t a r g e t }$ , $W$ , $W ^ { t a r g e t }$ , and $C o v$ using a normal distribution.
115
+ 2: Initialize replay buffer and set counter $= ~ 0$
116
+ 3: for episode $= 1$ to inf do
117
+ 4: Initialize $x _ { 1 }$ to the initial state of the environment
118
+ 5: for $t = \mathrm { t o }$ the end of episode do
119
+ 6: if count mod $T ^ { s a m p l e } = 0$ then
120
+ 7: sample $W \sim \mathcal { N } \left( W ^ { t a r g e t } , C o v \right)$
121
+ 8: end if
122
+ 9: Select action $a _ { t } = a r g m a x _ { a ^ { \prime } }$ $\big [ W ^ { \top } \phi _ { \theta } ( x _ { t } ) \big ] _ { a ^ { \prime } }$
123
+ 10: Execute action $a _ { t }$ a in environment, observing reward $r _ { t }$ and successor state $x _ { t + 1 }$
124
+ 11: Store transition $( x _ { t } , a _ { t } , r _ { t } , x _ { t + 1 } )$ in replay buffer
125
+ 12: Sample a random minibatch of transitions $( x _ { \tau } , a _ { \tau } , r _ { \tau } , x _ { \tau + 1 } )$ from replay buffer
126
+ 13: $\begin{array} { l } { { y _ { \tau } \gets \left\{ \begin{array} { l l } { { r _ { \tau } , } } \\ { { r _ { \tau } + \left[ W ^ { t a r g e t } { } ^ { \top } \phi _ { \theta ^ { t a r g e t } } ( x _ { \tau + 1 } ) \right] _ { \hat { a } } ; \hat { a } = a r g m a x _ { a ^ { \prime } } \left[ W ^ { \top } \phi _ { \theta } ( x _ { \tau + 1 } ) \right] _ { a ^ { \prime } } } } \end{array} \right. } } \\ { { \theta \gets \theta - \eta \cdot \nabla _ { \theta } ( y _ { \tau } - \left[ W ^ { \top } \phi _ { \theta } ( x _ { \tau } ) \right] _ { a _ { \tau } } ) ^ { 2 } } } \end{array}$ for non-terminal xτ+1 for terminal xτ+1
127
+ 14:
128
+ 15: if count mod $T ^ { t a r g e t } = 0$ then
129
+ 16: set $\theta ^ { t a r g e t } \theta$
130
+ 17: end if
131
+ 18: if count mod $T ^ { B a y e s ~ t a r g e t } = 0$ then
132
+ 19: Update $W ^ { t a r g e t }$ and $C o v$
133
+ 20: end if
134
+ 21: count $=$ count + 1
135
+ 22: end for
136
+ 23: end for
137
+
138
+ $\mathbb { 1 } \in \mathbb { R } ^ { d }$ is a identity matrix, and $Q ( x , a ) | \mathcal { D } _ { a } = w _ { a } ^ { \top } \phi ( x )$ . Since the prior and likelihood are conjugate of each other we have the posterior distribution over the discounted return approximated as
139
+
140
+ $$
141
+ \sum _ { t = 0 } ^ { N } \gamma ^ { t } r _ { t } | x _ { 0 } = x , a _ { 0 } = a , \mathcal { D } _ { a } \sim \mathcal { N } \left( \frac { 1 } { \sigma _ { \epsilon } ^ { 2 } } \phi ( x ) ^ { \top } \Xi _ { a } \Phi _ { a } \mathbf { y } _ { a } , \phi ( x ) ^ { \top } \Xi _ { a } \phi ( x ) \right)
142
+ $$
143
+
144
+ The expression in Eqs. 5 gives the posterior distribution over weights $w _ { a }$ and the function $Q$ . As TS suggests, for the exploration, we exploit the expression in Eq. 5. For all the actions, we set $w _ { a } ^ { t a r g e t }$ as the mean of posterior distribution over $w _ { a }$ . For each action, we sample a wight vector $w _ { a }$ in order to have samples of mean $\mathrm { Q }$ -value. Then we act optimally with respect to the sampled means
145
+
146
+ $$
147
+ a _ { \mathrm { T S } } = \arg \operatorname* { m a x } _ { a } w _ { a } ^ { \top } \phi _ { \theta } ( x ) .
148
+ $$
149
+
150
+ Let $W = \{ w _ { a } \} _ { a = 1 } ^ { | \mathcal { A } | }$ , respectively $W ^ { t a r g e t } = \{ w _ { a } ^ { t a r g e t } \} _ { a = 1 } ^ { | { \cal A } | }$ , and $C o v = \{ \Xi _ { a } \} _ { a = 1 } ^ { | { \cal A } | }$ . In BDQN, the agent interacts with the environment through applying the actions proposed by TS, i.e. utilize a notion of experience replay buffer where the agent stores its recent experiences. The agent draws $W \sim \mathcal N \left( W ^ { t { \bar { a } } r g e t } , C o v \right)$ (abbreviation for sampling of vector $w$ for each action separately) every $T ^ { s a m p l e }$ steps and act optimally with respect to the drawn weights. During the inner loop of the algorithm, we draw a minibatch of data from replay buffer and use loss
151
+
152
+ $$
153
+ \left( \boldsymbol { y } _ { \tau } - \left[ \boldsymbol { W } ^ { \top } \phi _ { \boldsymbol { \theta } } ( \boldsymbol { x } _ { \tau } ) \right] _ { a _ { \tau } } \right) ^ { 2 }
154
+ $$
155
+
156
+ $$
157
+ y _ { \tau } : = r _ { \tau } + \left[ { \cal W } ^ { t a r g e t ^ { \top } } \phi _ { \theta ^ { t a r g e t } } ( x _ { \tau + 1 } ) \right] _ { \hat { a } } ; \hat { a } = a r g m a x _ { a ^ { \prime } } \left[ { \cal W } ^ { \top } \phi _ { \theta } ( x _ { \tau + 1 } ) \right] _ { a ^ { \prime } }
158
+ $$
159
+
160
+ and update the weights of network: $\theta \theta - \eta \cdot \nabla _ { \theta } ( y _ { \tau } - [ W ^ { \top } \phi _ { \theta } ( x _ { \tau } ) ] _ { a _ { \tau } } ) ^ { 2 } .$
161
+
162
+ We update the target network every $T ^ { t a r g e t }$ steps and set $\theta ^ { t a r g e t }$ to $\theta$ . With the period of $T ^ { B a y e s }$ target the agent updates its posterior distribution using larger minibatch of data drawn from replay buffer and sample $W$ with respect to the updated posterior. Algorithm 1 gives the full description of BDQN.
163
+
164
+ # 6 EXPERIMENTS
165
+
166
+ We apply BDQN on a variety of games in the OpenAiGym 1(Brockman et al., 2016). As a baseline2, we run DDQN algorithm and evaluate BDQN on the measures of sample complexity and score.
167
+
168
+ ![](images/3e28849de6a30dd5651b659aeecf1240468e80b8a948672f5d16fc64e046559e.jpg)
169
+ Figure 2: The fast targeted exploration of BDQN
170
+
171
+ Network architecture: The input to the network part of BDQN is $4 \times 8 4 \times 8 4$ tensor with a rescaled and averaged over channels of the last four observations. The first convolution layer has 32 filters of size 8 with a stride of 4. The second convolution layer has 64 filters of size 4 with stride 2. The last convolution layer has 64 filters of size 3 followed by a fully connected layers with size 512. We add a BLR layer on top of this.
172
+
173
+ Choice of hyper-parameters: For BDQN, we set the values of $W ^ { t a r g e t }$ to the mean of the posterior distribution over the weights of BLR with covariances $C o v$ and draw $W$ from this posterior. For the fixed $W$ and $W ^ { t a r g e t }$ , we randomly initialize the parameters of network part of BDQN, $\theta$ , and train it using RMSProp, with learning rate of 0.0025, and a momentum of 0.95, inspired by (Mnih et al., 2015) where the discount factor is $\gamma = 0 . 9 9$ , the number of steps between target updates $T ^ { t a r g e t } = 1 0 k$ steps, and weights $W$ are re-sampled from their posterior distribution every $\hat { T } ^ { s a m p l e }$ step. We update the network part of BDQN every 4 steps by uniformly at random sampling a mini-batch of size 32 samples from the replay buffer. We update the posterior distribution of the weight set $W$ every $T ^ { B a y e s }$ target using mini-batch of size $B$ (if size of replay buffer is less than $B$ at the current step, we choose the minimum of these two ), with entries sampled uniformly form replay buffer. The experience replay contains the $1 M$ most recent transitions. Further hyper-parameters, are equivalent to ones in DQN setting.
174
+
175
+ Hyper-parameters tunning: For the BLR, we have noise variance $\sigma _ { \epsilon }$ , variance of prior over weights $\sigma$ , sample size $B$ , posterior update period $T ^ { B a y e s ~ t a r g e t }$ , and the posterior sampling period $T ^ { s a \overline { { m } } p l e }$ . To optimize for this set of hyper-parameters we set up a very simple, fast, and cheap hyper-parameter tunning procedure which proves the robustness of BDQN. To fine the first three, we set up a simple hyper-parameter search. We used a pretrained DQN model for the game of Assault, and removed the last fully connected layer in order to have access to its already trained feature representation. Then we tried combination of $B = \{ T ^ { t a r g e t } , 1 0 \cdot T ^ { t a r g e t } \}$ , $\sigma \overset { \cdot } { = } \{ 1 , 0 . 1 , 0 . 0 0 1 \}$ and $\sigma _ { \epsilon } = \{ 1 , 1 0 \}$ and test for 1000 episode of the game. We set these parameters to their best $B = 1 0 \cdot T ^ { t a r g e t }$ , $\sigma = 0 . 0 0 1 , \sigma = 1$ .
176
+
177
+ The above hyper-parameter tuning is cheap and fast since it requires only a few times $B$ number of forward passes. For the remaining parameter, we ran BDQN ( with weights randomly initialized) on the same game, Assault, for $5 M$ time steps, with a set of $T ^ { B a y e s t a r g e t } = \{ T ^ { t a r g \bar { e } t } , 1 0 \cdot T ^ { t a r g e t } \}$ and $\begin{array} { r } { T ^ { s a m p l e } = \{ \frac { T ^ { t a r g e t } } { 1 0 } , \frac { T ^ { t a r g e t } } { 1 0 0 } \} } \end{array}$ where BDQN performed better with choice of $T ^ { B a y e s ~ t a r g e t } =$ $1 0 \cdot T ^ { t a r g e t }$ . For both choices of $T ^ { s a m p l e }$ , it performed almost equal where we choose the higher one. We started off with the learning rate of 0.0025 and did not tune for that. Thanks to the efficient TS exploration and closed form BLR, BDQN can learn a better policy in even shorter period of time. In contrast, it is well known for DQN based methods that changing the learning rate causes a major degradation in the performance, Apx. A. The proposed hyper-parameter search is very simple where the exhaustive hyper-parameter search is likely to provide even better performance. In order to compare the fairness in sample usage, we argue in Apx. A, that the network part of BDQN and its corresponding part in DDQN observe the same number of samples but the BLR part of BDQN uses 16 times less samples compared to its corresponding last layer in DDQN, Apx. A. All the implementations are coded in MXNet framework (Chen et al., 2015) and are available at ..... .
178
+
179
+ Results: The results are provided in Fig. 2 and Table. 2. Mostly the focus of the experiments are on sample complexity in Deep-RL, even though, BDQN provides much larger scores compared to base line. For example, for the game Atlantis, DDQN† gives score of $6 4 . 6 7 k$ after $2 0 0 M$ samples during evaluation time, while BDQN reaches $3 . 2 4 M$ after $4 0 M$ samples. As it is been shown in Fig. 2, BDQN saturates for Atlantis after 20M samples. We realized that BDQN reaches the internal OpenAIGym limit of max_episode, where relaxing it improves score after $1 5 M$ steps to $6 2 M$ .
180
+
181
+ We can observe that BDQN can immediately learn significantly better policies due to its targeted exploration in much shorter period of time. Since BDQN on game Atlantis promise a big jump around time step $2 0 M$ , we ran it five more times in order to make sure it was not just a coincidence. We did the same additional five experiments for the game Amidar as well. We observed that the improvements are consistent among the different runs. For the game Pong, we ran the experiment for a longer period but just plotted the beginning of it in order to observe the difference. For some games we did not run the experiment to $1 0 0 M$ samples since the reached their plateau.
182
+
183
+ <table><tr><td rowspan=1 colspan=1>Game</td><td rowspan=1 colspan=1>BDQN</td><td rowspan=1 colspan=1>DDQN</td><td rowspan=1 colspan=1>DDQNt</td><td rowspan=1 colspan=1>Human</td><td rowspan=1 colspan=1>SC</td><td rowspan=1 colspan=1>SCt</td><td rowspan=1 colspan=1>Step</td></tr><tr><td rowspan=1 colspan=1>Amidar</td><td rowspan=1 colspan=1>5.52k</td><td rowspan=1 colspan=1>0.99k</td><td rowspan=1 colspan=1>0.7k</td><td rowspan=1 colspan=1>1.7k</td><td rowspan=1 colspan=1>22.9M</td><td rowspan=1 colspan=1>4.4M</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Alien</td><td rowspan=1 colspan=1>3k</td><td rowspan=1 colspan=1>2.9k</td><td rowspan=1 colspan=1>2.9k</td><td rowspan=1 colspan=1>6.9k</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>36.27M</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Assault</td><td rowspan=1 colspan=1>8.84k</td><td rowspan=1 colspan=1>2.23k</td><td rowspan=1 colspan=1>5.02k</td><td rowspan=1 colspan=1>1.5k</td><td rowspan=1 colspan=1>1.6M</td><td rowspan=1 colspan=1>24.3M</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Asteroids</td><td rowspan=1 colspan=1>14.1k</td><td rowspan=1 colspan=1>0.56k</td><td rowspan=1 colspan=1>0.93k</td><td rowspan=1 colspan=1>13.1k</td><td rowspan=1 colspan=1>58.2M</td><td rowspan=1 colspan=1>9.7M</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>Asterix</td><td rowspan=1 colspan=1>58.4k</td><td rowspan=1 colspan=1>11k</td><td rowspan=1 colspan=1>15.15k</td><td rowspan=1 colspan=1>8.5k</td><td rowspan=1 colspan=1>3.6M</td><td rowspan=1 colspan=1>5.7M</td><td rowspan=1 colspan=1>100M</td></tr><tr><td rowspan=1 colspan=1>BeamRider</td><td rowspan=1 colspan=1>8.7k</td><td rowspan=1 colspan=1>4.2k</td><td rowspan=1 colspan=1>7.6k</td><td rowspan=1 colspan=1>5.8k</td><td rowspan=1 colspan=1>4.0M</td><td rowspan=1 colspan=1>8.1M</td><td rowspan=1 colspan=1>70M</td></tr><tr><td rowspan=1 colspan=1>BattleZone</td><td rowspan=1 colspan=1>65.2k</td><td rowspan=1 colspan=1>23.2k</td><td rowspan=1 colspan=1>24.7k</td><td rowspan=1 colspan=1>38k</td><td rowspan=1 colspan=1>25.1M</td><td rowspan=1 colspan=1>14.9M</td><td rowspan=1 colspan=1>50M</td></tr><tr><td rowspan=1 colspan=1>Atlantis</td><td rowspan=1 colspan=1>3.24M</td><td rowspan=1 colspan=1>39.7k</td><td rowspan=1 colspan=1>64.76k</td><td rowspan=1 colspan=1>29.0k</td><td rowspan=1 colspan=1>3.3M</td><td rowspan=1 colspan=1>5.1M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>DemonAttack</td><td rowspan=1 colspan=1>11.1k</td><td rowspan=1 colspan=1>3.8k</td><td rowspan=1 colspan=1>9.7k</td><td rowspan=1 colspan=1>3.4k</td><td rowspan=1 colspan=1>2.0M</td><td rowspan=1 colspan=1>19.9M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>Centipede</td><td rowspan=1 colspan=1>7.3k</td><td rowspan=1 colspan=1>6.4k</td><td rowspan=1 colspan=1>4.1k</td><td rowspan=1 colspan=1>12.0k</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>4.2M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>BankHeist</td><td rowspan=1 colspan=1>0.72k</td><td rowspan=1 colspan=1>0.34k</td><td rowspan=1 colspan=1>0.72k</td><td rowspan=1 colspan=1>0.72k</td><td rowspan=1 colspan=1>2.1M</td><td rowspan=1 colspan=1>10.1M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>CrazyClimber</td><td rowspan=1 colspan=1>124k</td><td rowspan=1 colspan=1>84k</td><td rowspan=1 colspan=1>102k</td><td rowspan=1 colspan=1>35.4k</td><td rowspan=1 colspan=1>0.12M</td><td rowspan=1 colspan=1>2.1M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>ChopperCommand</td><td rowspan=1 colspan=1>72.5k</td><td rowspan=1 colspan=1>0.5k</td><td rowspan=1 colspan=1>4.6 k</td><td rowspan=1 colspan=1>9.9k</td><td rowspan=1 colspan=1>4.4M</td><td rowspan=1 colspan=1>2.2M</td><td rowspan=1 colspan=1>40M</td></tr><tr><td rowspan=1 colspan=1>Enduro</td><td rowspan=1 colspan=1>1.12k</td><td rowspan=1 colspan=1>0.38k</td><td rowspan=1 colspan=1>0.32k</td><td rowspan=1 colspan=1>0.31</td><td rowspan=1 colspan=1>0.82M</td><td rowspan=1 colspan=1>0.8M</td><td rowspan=1 colspan=1>30M</td></tr><tr><td rowspan=1 colspan=1>Pong</td><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>18.82</td><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>9.3</td><td rowspan=1 colspan=1>1.2M</td><td rowspan=1 colspan=1>2.4M</td><td rowspan=1 colspan=1>5M</td></tr></table>
184
+
185
+ Table 2: Comparison of scores and sample complexities(scores in the first two columns are average of 100 consecutive episodes). $S C$ represents the number of samples the BDQN requires to bit the human score (Mnih et al., 2015)(“ − ” means BDQN could not bit) and $S C ^ { \dagger }$ is the number number of samples the BDQN requires to bit the score of DDQN †.
186
+
187
+ # 7 CONCLUSION
188
+
189
+ In this work we proposed BDQN, a practical TS based RL algorithm which provides targeted exploration in a computationally efficient manner. It involved making simple modifications to the DDQN architecture by replacing the last layer with a Bayesian linear regression. Under the Gaussian prior, we obtained fast closed-form updates for the posterior distribution. We demonstrated significantly faster training and enormously better rewards over a strong baseline DDQN.
190
+
191
+ This suggests that BDQN can benefit even more from further modifications to DQN such as e.g. Prioritized Experience Replay (Schaul et al., 2015), Dueling approach (Wang et al., 2015), A3C (Mnih et al., 2016), safe exploration (Lipton et al., 2016a), and etc. We plan to explore the benefit of these modifications up to small changes in the future. We also plan to combine strategies that incorporate uncertainty over model parameters with BDQN. In RL, policy gradient (Sutton et al., 2000; Kakade, 2002; Schulman et al., 2015) is another approach which directly learn the policy. In practical policy gradient, even though the optimal policy, given Markovian assumption, needs to be deterministic, the policy regularization is a dominant approach to make the policy stochastic and preserve the exploration thorough the stochasticity of the policy (Neu et al., 2017; Schulman et al., 2017). We plan to explore the advantage of TS based exploration instead of regularizing the policy and make it stochastic.
192
+
193
+ # REFERENCES
194
+
195
+ Yasin Abbasi-Yadkori and Csaba Szepesvári. Bayesian optimal control of smoothly parameterized systems. In UAI, pp. 1–11, 2015.
196
+
197
+ Marc Abeille and Alessandro Lazaric. Linear thompson sampling revisited. In AISTATS 2017-20th International Conference on Artificial Intelligence and Statistics, 2017.
198
+
199
+ David Abel, Alekh Agarwal, Fernando Diaz, Akshay Krishnamurthy, and Robert E Schapire. Exploratory gradient boosting for reinforcement learning in complex domains. arXiv, 2016.
200
+
201
+ Shipra Agrawal and Navin Goyal. Analysis of thompson sampling for the multi-armed bandit problem. In COLT, 2012.
202
+
203
+ Shipra Agrawal and Randy Jia. Posterior sampling for reinforcement learning: worst-case regret bounds. arXiv, 2017.
204
+
205
+ András Antos, Csaba Szepesvári, and Rémi Munos. Learning near-optimal policies with bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 2008.
206
+
207
+ Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 2002.
208
+
209
+ Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for reinforcement learning. arXiv preprint arXiv:1703.05449, 2017.
210
+
211
+ Kamyar Azizzadenesheli, Alessandro Lazaric, and Animashree Anandkumar. Reinforcement learning of pomdps using spectral methods. In Proceedings of the 29th Annual Conference on Learning Theory (COLT), 2016a.
212
+
213
+ Kamyar Azizzadenesheli, Alessandro Lazaric, and Animashree Anandkumar. Reinforcement learning in rich-observation mdps using spectral methods. arXiv preprint arXiv:1611.03907, 2016b.
214
+
215
+ Peter L. Bartlett and Ambuj Tewari. REGAL: A regularization based algorithm for reinforcement learning in weakly communicating MDPs. In Proceedings of the 25th Annual Conference on Uncertainty in Artificial Intelligence, 2009.
216
+
217
+ Gábor Bartók, Dean P Foster, Dávid Pál, Alexander Rakhlin, and Csaba Szepesvári. Partial monitoring—classification, regret bounds, and algorithms. Mathematics of Operations Research, 2014.
218
+
219
+ Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
220
+
221
+ Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res.(JAIR), 2013.
222
+
223
+ Ronen I Brafman and Moshe Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. The Journal of Machine Learning Research, 3:213–231, 2003.
224
+
225
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
226
+
227
+ Olivier Chapelle and Lihong Li. An empirical evaluation of thompson sampling. In Advances in neural information processing systems, pp. 2249–2257, 2011.
228
+
229
+ Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv, 2015.
230
+
231
+ Christoph Dann, Tor Lattimore, and Emma Brunskill. Ubev-a more practical algorithm for episodic rl with near-optimal pac and regret guarantees. arXiv preprint arXiv:1703.07710, 2017.
232
+
233
+ Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017.
234
+
235
+ Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, 2016.
236
+
237
+ Mohammad Ghavamzadeh, Shie Mannor, Joelle Pineau, Aviv Tamar, et al. Bayesian reinforcement learning: A survey. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 2015.
238
+
239
+ Aditya Gopalan and Shie Mannor. Thompson sampling for learning parameterized markov decision processes. In COLT, 2015.
240
+
241
+ Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 2010.
242
+
243
+ Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. arXiv, 2016.
244
+
245
+ Sham M Kakade. A natural policy gradient. In Advances in neural information processing systems, 2002.
246
+
247
+ Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209–232, 2002.
248
+
249
+ Michail G Lagoudakis and Ronald Parr. Least-squares policy iteration. Journal of machine learning research, 4 (Dec):1107–1149, 2003.
250
+
251
+ Nir Levine, Tom Zahavy, Daniel J Mankowitz, Aviv Tamar, and Shie Mannor. Shallow updates for deep reinforcement learning. arXiv preprint arXiv:1705.07461, 2017.
252
+
253
+ Sergey Levine et al. End-to-end training of deep visuomotor policies. JMLR, 2016.
254
+
255
+ Zachary C Lipton, Jianfeng Gao, Lihong Li, Jianshu Chen, and Li Deng. Combating reinforcement learning’s sisyphean curse with intrinsic fear. arXiv preprint arXiv:1611.01211, 2016a.
256
+
257
+ Zachary C Lipton, Jianfeng Gao, Lihong Li, Xiujun Li, Faisal Ahmed, and Li Deng. Efficient exploration for dialogue policy learning with bbq networks & replay buffer spiking. arXiv preprint arXiv:1608.05081, 2016b.
258
+
259
+ 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, 2015.
260
+
261
+ 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, 2016.
262
+
263
+ Gergely Neu, Anders Jonsson, and Vicenç Gómez. A unified view of entropy-regularized markov decision processes. arXiv, 2017.
264
+
265
+ Will Night. The AI that cut google’s energy bill could soon help you. MIT Tech Review, 2016.
266
+
267
+ Brendan O’Donoghue, Ian Osband, Remi Munos, and Volodymyr Mnih. The uncertainty bellman equation and exploration. arXiv preprint arXiv:1709.05380, 2017.
268
+
269
+ Ian Osband, Dan Russo, and Benjamin Van Roy. (more) efficient reinforcement learning via posterior sampling. In Advances in Neural Information Processing Systems, 2013.
270
+
271
+ Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. arXiv, 2014.
272
+
273
+ Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In Advances in Neural Information Processing Systems, 2016.
274
+
275
+ Ian Osband, Daniel Russo, Zheng Wen, and Benjamin Van Roy. Deep exploration via randomized value functions. arXiv preprint arXiv:1703.07608, 2017.
276
+
277
+ Yi Ouyang, Mukul Gagrani, Ashutosh Nayyar, and Rahul Jain. Learning unknown markov decision processes: A thompson sampling approach. In Advances in Neural Information Processing Systems, pp. 1333–1342, 2017.
278
+
279
+ Carl Edward Rasmussen and Christopher KI Williams. Gaussian processes for machine learning, volume 1. MIT press Cambridge, 2006.
280
+
281
+ Daniel Russo and Benjamin Van Roy. Learning to optimize via posterior sampling. Mathematics of Operations Research, 39(4):1221–1243, 2014.
282
+
283
+ Daniel Russo, Benjamin Van Roy, Abbas Kazerouni, and Ian Osband. A tutorial on thompson sampling. arXiv preprint arXiv:1707.02038, 2017.
284
+
285
+ Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv, 2015.
286
+
287
+ 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), 2015.
288
+
289
+ John Schulman, Pieter Abbeel, and Xi Chen. Equivalence between policy gradients and soft q-learning. arXiv, 2017.
290
+
291
+ Shai Shalev-Shwartz, Shaked Shammah, and Amnon Shashua. Safe, multi-agent, reinforcement learning for autonomous driving. arXiv, 2016.
292
+
293
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
294
+
295
+ Jasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Mostofa Patwary, Mr Prabhat, and Ryan Adams. Scalable bayesian optimization using deep neural networks. In International Conference on Machine Learning, pp. 2171–2180, 2015.
296
+
297
+ Alexander L. Strehl, Lihong Li, and Michael L. Littman. Reinforcement learning in finite mdps: Pac analysis. J. Mach. Learn. Res., 2009.
298
+
299
+ Malcolm Strens. A bayesian framework for reinforcement learning. In ICML, pp. 943–950, 2000.
300
+
301
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
302
+
303
+ Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, 2000.
304
+
305
+ Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. arXiv, 2016.
306
+
307
+ Georgios Theocharous, Zheng Wen, Yasin Abbasi-Yadkori, and Nikos Vlassis. Posterior sampling for large scale reinforcement learning. arXiv preprint arXiv:1711.07979, 2017.
308
+
309
+ William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 1933.
310
+
311
+ Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. In AAAI, 2016.
312
+
313
+ Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Van Hasselt, Marc Lanctot, and Nando De Freitas. Dueling network architectures for deep reinforcement learning. arXiv, 2015.
314
+
315
+ # A APPENDIX
316
+
317
+ Learning rate: It is well known that DQN and DDQN are sensitive to the learning rate and change of learning rate can degrade the performance to even worse than random policy. We tried the same learning rate as BDQN, 0.0025, for DDQN and observed that its performance drops. Fig. 3 shows that the DDQN with higher learning rates learns as good as BDQN at the very beginning but it can not maintain the rate of improvement and degrade even worse than the original DDQN.
318
+
319
+ ![](images/31dc42fcfa19a93b955e649f0216400882de7b1e6a3e4dafd097d7be7e5ed169.jpg)
320
+ Figure 3: Effect of learning rate on DDQN
321
+
322
+ Computational and sample cost comparison: For a given period of game time, the number of the backward pass in both BDQN and DQN are the same where for BDQN it is cheaper since it has one layer (the last layer) less than DQN. In the sense of fairness in sample usage, for example in duration of $1 0 \cdot T ^ { B a \dot { y } e s \ t a r g e t } = 1 0 0 k$ , all the layers of both BDQN and DQN, except the last layer, see the same number of samples, but the last layer of BDQN sees 16 times fewer samples compared to the last layer of DQN. The last layer of DQN for a duration of $1 0 0 k$ , observes $2 5 k = 1 0 0 k / 4$ (4 is back prob period) mini batches of size 32, which is $1 6 \cdot 1 0 0 k$ , where the last layer of BDQN just observes samples size of $B = 1 0 0 k$ . As it is mentioned in Alg. 1, to update the posterior distribution, BDQN draws $B$ samples from the replay buffer and needs to compute the feature vector of them. This step of BDQN gives a superiority to DQN in the sense of speed which is almost $7 0 \%$ faster than BDQN (DQN, on average, for the update does full forward and backward passes while BDQN does not do backward path on the last layer but needs an extra forward pass in order to compute the feature representation). One can easily relax this limitation by parallelizing this step with the main body of BDQN or deploying on-line posterior update methods.
323
+
324
+ Thompson sampling frequency: The choice of TS update frequency can be crucial from domain to domain. If one chooses $T ^ { s a \dot { m } p l e }$ too short, then computed gradient for backpropagation of the feature representation is not going to be useful since the gradient get noisier and the loss function is changing too frequently. On the other hand, the network tries to find a feature representation which is suitable for a wide range of different weights of the last layer, results in improper use of model capacity. If the TS update frequency is too low, then it is far from being TS and losses randomized exploration property. The current choice of $T ^ { s a m p l e }$ is suitable for a variety of Atari games since the length of each episode is in range of $\mathcal { O } ( T ^ { s a m p l e } )$ and is infrequent enough to make the feature representation robust to big changes.
325
+
326
+ For the RL problems with shorter horizon we suggest to introduce two more parameters, T˜sample and $\tilde { W }$ where $\tilde { T } ^ { s a m p l e }$ , the period that of $\tilde { W }$ is sampled our of posterior, is much smaller than $T ^ { s a m p l e }$ and $\tilde { W }$ is being used just for making TS actions while $W$ is used for backpropagation of feature representation. For game Assault, we tried using $\tilde { T } ^ { s a m p l e }$ and $\tilde { W }$ but did not observe much a difference, and set them to $\mathbf { \chi } _ { T } s a m p l e$ and $W$ . But for RL setting with a shorter horizon, we suggest using them.
327
+
328
+ Further investigation in Atlantis: After removing the maximum episode length limit for the game Atlantis, BDQN gets the score of 62M. This episode is long enough to fill half of the replay buffer and make the model perfect for the later part of the game but losing the crafted skill for the beginning of the game. We observe in Fig. 4 that after losing the game in a long episode, the agent forgets a bit of its skill and loses few games but wraps up immediately and gets to score of $3 0 M$ . To overcome this issue, one can expand the replay buffer size, stochastically store samples in the reply buffer where the later samples get stored with lowers chance, or train new models for the later parts of the episode. There are many possible cures for this interesting observation and while we are comparing against DDQN, we do not want to advance BDQN structure-wise.
329
+
330
+ ![](images/d1bf647dc60e92f579a32a018f48a8523c1e357a548289efbfc73d61e5ed61ac.jpg)
331
+ Figure 4: BDQN on Atlantis after removing the limit on max of episode length
md/train/BkSmc8qll/BkSmc8qll.md ADDED
@@ -0,0 +1,451 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DYNAMIC NEURAL TURING MACHINE WITH CONTINUOUS AND DISCRETE ADDRESSING SCHEMES
2
+
3
+ Caglar Gulcehre∗, Sarath Chandar∗, Kyunghyun Cho†, Yoshua Bengio∗
4
+
5
+ ∗ University of Montreal, name.lastname@umontreal.ca † New York University, name.lastname@nyu.edu
6
+
7
+ # ABSTRACT
8
+
9
+ In this paper, we extend neural Turing machine (NTM) into a dynamic neural Turing machine (D-NTM) by introducing a trainable memory addressing scheme. This addressing scheme maintains for each memory cell two separate vectors, content and address vectors. This allows the D-NTM to learn a wide variety of location-based addressing strategies including both linear and nonlinear ones. We implement the D-NTM with both continuous, differentiable and discrete, non-differentiable read/write mechanisms. We investigate the mechanisms and effects for learning to read and write to a memory through experiments on Facebook bAbI tasks using both a feedforward and GRU-controller. The D-NTM is evaluated on a set of Facebook bAbI tasks and shown to outperform NTM and LSTM baselines. We also provide further experimental results on sequential MNIST, associative recall and copy tasks.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Designing general-purpose learning algorithms is one of the long-standing goals of artificial intelligence. Despite the success of deep learning in this area (see, e.g., (Goodfellow et al., 2016)) there are still a set of complex tasks that are not well addressed by conventional neural networks. Those tasks often require a neural network to be equipped with an explicit, external memory in which a larger, potentially unbounded, set of facts need to be stored. They include, but are not limited to, episodic question-answering (Weston et al., 2015b; Hermann et al., 2015; Hill et al., 2015), compact algorithms (Zaremba et al., 2015), dialogue (Serban et al., 2016; Vinyals & Le, 2015) and video caption generation (Yao et al., 2015).
14
+
15
+ Recently two promising approaches based on neural networks to this type of tasks have been proposed. Memory networks (Weston et al., 2015b) explicitly store all the facts, or information, available for each episode in an external memory (as continuous vectors) and use the attention-based mechanism to index them when returning an output. On the other hand, neural Turing machines (NTM, (Graves et al., 2014)) read each fact in an episode and decides whether to read, write the fact or do both to the external, differentiable memory.
16
+
17
+ A crucial difference between these two models is that the memory network does not have a mechanism to modify the content of the external memory, while the NTM does. In practice, this leads to easier learning in the memory network, which in turn resulted in it being used more in real tasks (Bordes et al., 2015; Dodge et al., 2015). On the contrary, the NTM has mainly been tested on a series of small-scale, carefully-crafted tasks such as copy and associative recall. The NTM, however is more expressive, precisely because it can store and modify the internal state of the network as it processes an episode.
18
+
19
+ The original NTM supports two modes of addressing (which can be used simultaneously.) They are content-based and location-based addressing. We notice that the location-based strategy is based on linear addressing. The distance between each pair of consecutive memory cells is fixed to a constant. We address this limitation, in this paper, by introducing a learnable address vector for each memory cell of the NTM with least recently used memory addressing mechanism, and we call this variant a dynamic neural Turing machine (D-NTM).
20
+
21
+ We evaluate the proposed D-NTM on the full set of Facebook bAbI task (Weston et al., 2015b) using either continuous, differentiable attention or discrete, non-differentiable attention (Zaremba & Sutskever, 2015) as an addressing strategy. Our experiments reveal that it is possible to use the discrete, non-differentiable attention mechanism, and in fact, the D-NTM with the discrete attention and GRU controller outperforms the one with the continuous attention. After we published our paper on arXiv, a new extension of NTM called DNC (Graves et al., 2016) has also provided results on bAbI task as well.
22
+
23
+ We also provide results on sequential-MNIST and algorithmic tasks proposed by (Graves et al., 2014) in order to investigate the ability of our model when dealing with long-term dependencies.
24
+
25
+ # Our Contributions
26
+
27
+ 1. We propose a generalization of Neural Turing Machine called a dynamic neural Turing machine (D-NTM) which employs a learnable and location-based addressing.
28
+ 2. We demonstrate the application of neural Turing machines on a more natural and less toyish task: episodic question-answering besides the toy tasks. We provide detailed analysis of our model on this task.
29
+ 3. We propose to use the discrete attention mechanism and empirically show that, it can outperform the continuous attention based addressing for episodic QA task.
30
+ 4. We propose a curriculum strategy for our model with the feedforward controller and discrete attention that improves our results significantly.
31
+
32
+ # 2 DYNAMIC NEURAL TURING MACHINE
33
+
34
+ The proposed dynamic neural Turing machine (D-NTM) extends the neural Turing machine (NTM, (Graves et al., 2014)) which has a modular design. The NTM consists of two main modules, a controller and, a memory. The controller, which is often implemented as a recurrent neural network, issues a command to the memory so as to read, write to and erase a subset of memory cells. Although the memory was originally envisioned as an integrated module, it is not necessary, and the memory may be an external, black box (Zaremba & Sutskever, 2015).
35
+
36
+ # 2.1 CONTROLLER
37
+
38
+ At each time step $t$ , the controller (1) receives an input value $\mathbf { x } ^ { t }$ , (2) addresses and reads the memory and creates the content vector $\phi ^ { t }$ , (3) erases/writes a portion of the memory, (4) updates its own hidden state $\mathbf { h } _ { t }$ , and (5) outputs a value $\mathbf { y } ^ { t }$ (if needed.) In this paper, we use both a gated recurrent unit (GRU, (Cho et al., 2014)) and a feedforward-controller to implement the controller such that for a GRU controller
39
+
40
+ $$
41
+ \mathbf { h } ^ { t } = \mathbf { G } \mathbf { R } \mathbf { U } ( \mathbf { x } ^ { t } , \mathbf { h } ^ { t - 1 } , \boldsymbol { \phi } ^ { t } )
42
+ $$
43
+
44
+ or for a feedforward-controller
45
+
46
+ $$
47
+ \mathbf { h } ^ { t } = \sigma ( \mathbf { x } ^ { t } , \phi ^ { t } ) .
48
+ $$
49
+
50
+ # 2.2 MEMORY
51
+
52
+ We use a rectangular matrix $\mathbf { M } \in \mathbb { R } ^ { N \times ( d _ { c } + d _ { a } ) }$ to denote $N$ memory cells. Unlike the original NTM, we partition each memory cell vector into two parts:
53
+
54
+ $$
55
+ \mathbf { M } = \left[ \mathbf { A } ; \mathbf { C } \right] .
56
+ $$
57
+
58
+ The first part $\mathbf { A } \in \mathbb { R } ^ { N \times d _ { a } }$ is a learnable address matrix, and the second $\mathbf { C } \in \mathbb { R } ^ { N \times d _ { c } }$ a content matrix. In other words, each memory cell $\mathbf { m } _ { i }$ is now
59
+
60
+ $$
61
+ \mathbf { m } _ { i } = \left[ \mathbf { a } _ { i } ; \mathbf { c } _ { i } \right] .
62
+ $$
63
+
64
+ The address part ${ \bf a } _ { i }$ is considered a model parameter that is updated during training. During inference, the address part is not overwritten by the controller and remains constant. On the other hand, the content part $\mathbf { c } _ { i }$ is both read and written by the controller both during training and inference. At the beginning of each episode, the content part of the memory is refreshed to be an all-zero matrix, $\mathbf { C } ^ { 0 } = \mathbf { 0 }$ . This introduction of the learnable address portion for each memory cell allows the model to learn sophisticated location-based addressing strategies. A similar addressing mechanism is also explored in (Reed & de Freitas, 2015) in the context of learning program traces.
65
+
66
+ # 2.3 MEMORY ADDRESSING
67
+
68
+ Memory addressing in the D-NTM is equivalent to computing an $N$ -dimensional address vector. The DNTM computes three such vectors for respectively reading $\mathbf { w } ^ { t } \in \mathbb { R } ^ { N }$ , erasing $\mathbf { e } ^ { t } \in \mathbb { R } ^ { d _ { c } }$ and writing $\mathbf { u } ^ { t } \in$ $\mathbb { R } ^ { N }$ . Specifically for writing, the controller further computes a candidate memory content vector $\bar { \mathbf { c } } ^ { t } \in$
69
+
70
+ ![](images/e74c8fe56f94d776f121ec40a19574de3775bfc3a8c2b406e74e9fa626fad5ca.jpg)
71
+ Figure 1: A graphical illustration of the proposed dynamic neural Turing machine with the recurrent-controller. The controller receives the fact as a continuous vector encoded by a recurrent neural network, computes the read and write weights for addressing the memory. If the D-NTM automatically detects that a query has been received, it returns an answer and terminates.
72
+
73
+ $\mathbb { R } ^ { d _ { c } }$ based on its current hidden state of the controller $\mathbf { h } ^ { t } \in \mathbb { R } ^ { d _ { h } }$ and the input of the controller scaled with a scalar gate $\alpha ^ { t }$ which is a function of the hidden state and the input of the controller as well, see Eqn 4.
74
+
75
+ $$
76
+ \begin{array} { l } { { \boldsymbol { \alpha } } ^ { t } = \mathbf { f } ( \mathbf { h } ^ { t } , \mathbf { x } ^ { t } ) , } \\ { { \bar { \mathbf { c } } } ^ { t } = \mathrm { R e L U } ( \mathbf { W } _ { m } \mathbf { h } ^ { t } + { \boldsymbol { \alpha } } ^ { t } \mathbf { W } _ { x } \mathbf { x } ^ { t } + \mathbf { b _ { m } } ) . } \end{array}
77
+ $$
78
+
79
+ Reading With the read vector $\mathbf { w } ^ { t }$ , the content vector read from the memory $\phi ^ { t } \in \mathbb { R } ^ { d _ { a } + d _ { c } }$ is retrieved by
80
+
81
+ $$
82
+ \begin{array} { r } { \phi ^ { t } = ( \mathbf { w } ^ { t } ) ^ { \top } \mathbf { M } ^ { t - 1 } , } \end{array}
83
+ $$
84
+
85
+ where $\mathbf { w } ^ { t }$ is a row vector.
86
+
87
+ Erasing and Writing Given the erase, write and candidate memory content vectors $( \mathbf { e } ^ { t } , u _ { j } ^ { t }$ , and $\bar { \mathbf { c } } ^ { t }$ respectively) generated by a simple MLP conditioned on the hidden state of the controller $\mathbf { h } ^ { t }$ , the memory matrix is updated by,
88
+
89
+ $$
90
+ \mathbf { C } ^ { t } [ j ] = ( 1 - \mathbf { e } ^ { t } u _ { j } ^ { t } ) \odot \mathbf { C } ^ { t - 1 } [ j ] + u _ { j } ^ { t } \bar { \mathbf { c } } ^ { t } .
91
+ $$
92
+
93
+ where the subscript $j$ in $\mathbf { C } ^ { t } [ j ]$ denotes the $j$ -th row of the content part $\mathbf { C } ^ { t }$ of the memory matrix $\mathbf { M } ^ { t }$ .
94
+
95
+ No Operation (NOP) As found in (Joulin & Mikolov, 2015), an additional NOP action might be beneficial for the controller not to access the memory once in a while. We model this situation by designating one memory cell as a NOP cell. Reading or writing from this memory cell is ignored.
96
+
97
+ # 2.4 LEARNING
98
+
99
+ Once the proposed D-NTM is executed, it returns the output distribution $p ( \mathbf { y } | \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { T } )$ . As a result, we define a cost function as the negative log-likelihood:
100
+
101
+ $$
102
+ C ( \boldsymbol { \theta } ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } - \log p ( \mathbf { y } ^ { n } | \mathbf { x } _ { 1 } ^ { n } , \ldots , \mathbf { x } _ { T } ^ { n } ) ,
103
+ $$
104
+
105
+ where $\theta$ is a set of all the parameters. As the proposed D-NTM, just like the original NTM, is fully end-to-end differentiable, we can compute the gradient of this cost function by using backpropagation and learn the parameters of the model with a gradient-based optimization algorithm, such as stochastic gradient descent, to train it end-to-end.
106
+
107
+ # 3 ADDRESSING MECHANISM
108
+
109
+ # 3.1 ADDRESS VECTORS
110
+
111
+ Each of the address vectors (both read and write) is computed in the same way. The way they are computed are very similar to the content based addressing in (Graves et al., 2014). First, the controller computes a key vector:
112
+
113
+ $$
114
+ \mathbf { k } ^ { t } = \mathbf { W } _ { k } ^ { \top } \mathbf { h } ^ { t } + \mathbf { b } _ { k } ,
115
+ $$
116
+
117
+ where $\mathbf { W } _ { k } \ \in \ \mathbb { R } ^ { N \times ( d _ { a } + d _ { c } ) }$ and $\mathbf { b } _ { k } \ \in \ \mathbb { R } ^ { d _ { a } + d _ { c } }$ if the read head is being computed, otherwise $\mathbf { W } _ { k } \in \mathbb { R } ^ { N \times d _ { c } }$ and $\mathbf { b } _ { k } \in \mathbb { R } ^ { d _ { c } }$ if the write head weights are being computed. They can be the parameters for a specific head (either read or write.) Also, the sharpening factor $\beta _ { t } \in \mathbb { R } ^ { \ge 1 }$ is computed as:
118
+
119
+ $$
120
+ \begin{array} { c } { { \mathrm { s o f t p l u s } ( x ) = \log ( \exp ( x ) + 1 ) } } \\ { { \beta _ { t } = \mathrm { s o f t p l u s } ( \mathbf { u } _ { \beta } ^ { \top } \mathbf { h } ^ { t } + b _ { \beta } ) + 1 . } } \end{array}
121
+ $$
122
+
123
+ $\mathbf { u } _ { \beta }$ and $b _ { \beta }$ are the parameters of the sharpening $\beta _ { t }$ .
124
+
125
+ The address vector is then computed by,
126
+
127
+ $$
128
+ \begin{array} { c } { { z _ { i } ^ { t } = \beta ^ { t } S \left( \mathbf { k } ^ { t } , \mathbf { m } _ { i } ^ { t } \right) } } \\ { { w _ { i } ^ { t } = \displaystyle \frac { \exp ( z _ { i } ^ { t } ) } { \sum _ { j } \exp ( z _ { j } ^ { t } ) } , } } \end{array}
129
+ $$
130
+
131
+ where the similarity function $S \in \mathbb { R } ^ { \geq 0 }$ is defined as
132
+
133
+ $$
134
+ S ( \mathbf { x } , \mathbf { y } ) = \frac { \mathbf { x } \cdot \mathbf { y } } { ( | | \mathbf { x } | | | \mathbf { y } | | + \epsilon ) } .
135
+ $$
136
+
137
+ # 3.2 MULTI-STEP ADDRESSING
138
+
139
+ At each time-step, controller may require more than one-step for accessing to the memory. The original NTM addresses this by implementing multiple sets of read, erase and write heads. In this paper, we explore an option of allowing each head to operate more than once at each time step, similar to the multi-hop mechanism from the end-to-end memory network (Sukhbaatar et al., 2015).
140
+
141
+ # 3.3 DYNAMIC LEAST RECENTLY USED ADDRESSING
142
+
143
+ We introduce a memory addressing schema that can learn to put more emphasis on the least recently used (LRU) memory locations. As observed in (Santoro et al., 2016; Rae et al., 2016), we find it easier to learn the write operations with the use of LRU addressing.
144
+
145
+ To learn a LRU based addressing, first we compute the exponentially moving averages of the logits $\left( \mathbf { z } _ { t } \right)$ as $\mathbf { v } _ { t }$ , $\mathbf { v } _ { t } ~ = ~ 0 . 1 \mathbf { v } _ { t - 1 } + 0 . 9 \mathbf { z } _ { t }$ . We rescale the accumulated $\mathbf { v } _ { t }$ with $\gamma _ { t }$ , such that the controller adjusts the influence of how much previously written memory locations should effect the attention weights of a particular time-step. Next, we subtract $\mathbf { v } _ { t }$ from $\mathbf { z } _ { t }$ in order to reduce the weights of previously read or written memory locations. $\gamma _ { t }$ is a shallow MLP with a scalar output and it is conditioned on the hidden state of the controller. $\gamma _ { t }$ is parametrized with the parameters $\mathbf { u } _ { \gamma }$ and ${ \bf { b } } _ { \gamma }$ ,
146
+
147
+ $$
148
+ \begin{array} { r } { \gamma _ { t } = \operatorname { s i g m o i d } ( \mathbf { u } _ { \gamma } ^ { \top } \mathbf { h } _ { t } + \mathbf { b } _ { \gamma } ) , } \\ { \mathbf { w } _ { t } = \operatorname { s o f t m a x } \bigl ( \mathbf { z } _ { t } - \gamma _ { t } \mathbf { v } _ { t - 1 } \bigr ) . } \end{array}
149
+ $$
150
+
151
+ This addressing method increases the weights of the least recently used rows of the memory. The magnitude of the influence of the least-recently used memory locations is being learned and adjusted with $\gamma _ { t }$ . Our LRU addressing is dynamic due to the model’s ability to switch between pure content-based addressing and LRU. During the training, we do not backpropagate through $\mathbf { v } _ { t }$ . Due to the dynamic nature of this addressing mechanism, it can be used for both read and write operations. If needed, the model will automatically learn to disable LRU while reading from the memory.
152
+
153
+ # 4 GENERATING DISCRETE ADDRESS VECTORS
154
+
155
+ In this section, we describe the discrete attention based addressing strategy.
156
+
157
+ Discrete Addressing Let us use w to denote an address vector (either read, write or erase) at time $t$ . By definition in Eq. (10), every element in this address vector is positive and sums up to one. In other words, we can treat this vector as the probabilities of a categorical distribution $\mathcal C ( \mathbf w )$ with $\dim ( \mathbf { w } )$ choices:
158
+
159
+ $$
160
+ p ( j ) = w _ { j } ,
161
+ $$
162
+
163
+ where $w _ { j }$ is the $j$ -th element of w. We can readily sample from this categorical distribution and form an one-hot vector w˜ such that
164
+
165
+ $$
166
+ \tilde { w } _ { k } = I ( k = j ) ,
167
+ $$
168
+
169
+ where $j \sim \mathcal { C } ( \mathbf { w } )$ , and $I$ is an indicator function.
170
+
171
+ Training We use this sampling-based strategy for all the heads during training. This clearly makes the use of backpropagation infeasible to compute the gradient, as the sampling procedure is not differentiable. Thus, we use REINFORCE (Williams, 1992) together with the three variance reduction techniques–global baseline, input-dependent baseline and variance normalization– suggested in (Mnih & Gregor, 2014).
172
+
173
+ Let us define $R ( { \bf x } ) = \log p ( { \bf y } | { \bf x } _ { 1 } , \ldots , { \bf x } _ { T } )$ as a reward. We first center and re-scale the reward by
174
+
175
+ $$
176
+ \tilde { R } ( { \bf x } ) = \frac { R ( { \bf x } ) - b } { \sqrt { \sigma ^ { 2 } + \epsilon } } ,
177
+ $$
178
+
179
+ where $b$ and $\sigma$ is running average and standard deviation of $R$ . We can further center it for each input $\mathbf { x }$ separately, i.e.,
180
+
181
+ $$
182
+ \tilde { R } ( \mathbf { x } ) \gets \tilde { R } ( \mathbf { x } ) - b ( \mathbf { x } ) ,
183
+ $$
184
+
185
+ where $b ( \mathbf x )$ is computed by a baseline network which takes as input $\mathbf { x }$ and predicts its estimated reward. The baseline network is trained to minimize the Huber loss (Huber, 1964) between the true reward $\tilde { R } ( { \bf x } ) ^ { * }$ and the predicted reward $b ( \mathbf { x } )$ . We use the Huber loss, which is defined by
186
+
187
+ $$
188
+ H _ { \delta } ( x ) = { \left\{ \begin{array} { l l } { x ^ { 2 } } & { { \mathrm { f o r ~ } } | x | \leq \delta , } \\ { \delta ( 2 | x | - \delta ) , } & { { \mathrm { o t h e r w i s e } } , } \end{array} \right. }
189
+ $$
190
+
191
+ due to its robustness. As a further measure to reduce the variance, we regularize the negative entropy of all those category distributions to facilitate a better exploration during training (Xu et al., 2015).
192
+
193
+ Then, the cost function for each training example is approximated as
194
+
195
+ $$
196
+ \begin{array} { r l } & { C ^ { n } ( \boldsymbol { \theta } ) = - \log p ( \mathbf { y } | \mathbf { x } _ { 1 : T } , \tilde { w } _ { 1 : J } , \tilde { u } _ { 1 : J } , \tilde { e } _ { 1 : J } ) } \\ & { \qquad - \displaystyle \sum _ { j = 1 } ^ { J } \tilde { R } ( \mathbf { x } ^ { n } ) ( \log p ( \tilde { w } _ { j } | \mathbf { x } _ { 1 : T } ) + \log p ( \tilde { u } _ { j } | \mathbf { x } _ { 1 : T } ) + \log p ( \tilde { e } _ { j } | \mathbf { x } _ { 1 : T } ) ) } \\ & { \qquad - \lambda _ { H } \displaystyle \sum _ { j = 1 } ^ { J } ( \mathcal { H } ( w _ { j } | \mathbf { x } _ { 1 : T } ) + \mathcal { H } ( u _ { j } | \mathbf { x } _ { 1 : T } ) + \mathcal { H } ( e _ { j } | \mathbf { x } _ { 1 : T } ) ) . } \end{array}
197
+ $$
198
+
199
+ where $J$ is the number of addressing steps, $\lambda _ { H }$ is the entropy regularization coefficient, and $\mathcal { H }$ denotes the entropy.
200
+
201
+ Inference Once training is over, we switch to a deterministic strategy. We simply choose an element of w with the largest value to be the index of the target memory cell, such that
202
+
203
+ $$
204
+ \tilde { w } _ { k } = \mathbf { I } ( k = \operatorname { a r g m a x } ( \mathbf { w } ) ) .
205
+ $$
206
+
207
+ Curriculum Learning for the Discrete Attention Training discrete attention with feed-forward controller and REINFORCE is challenging. We propose to use a curriculum strategy for training with the discrete attention in order to tackle this problem. For each minibatch, we sample $\pi$ from a binomial distribution with the probability $p ^ { t }$ , $\pi ^ { t } \sim \mathrm { B i n } ( p ^ { t } )$ . The model will either use the discrete or the continuous-attention based on the $\pi ^ { t }$ . We start the training procedure with $p ^ { 0 } = 1$ and during the training $p ^ { t }$ is annealed to 0 by setting $\begin{array} { r } { p ^ { t } = \frac { p ^ { 0 } } { \sqrt { 1 + t } } } \end{array}$ .
208
+
209
+ We can rewrite the weights $\mathbf { w } _ { t }$ as in Equation 14, where it is expressed as the combination of continuous attention weights $\hat { \mathbf { w } } ^ { t }$ and discrete attention weights $\tilde { \mathbf { w } } ^ { t }$ with $\mathit { \Pi } _ { \pi ^ { t } }$ being a binary variable that chooses to use one of them,
210
+
211
+ $$
212
+ \mathbf { w } ^ { t } \pi ^ { t } \bar { \mathbf { w } } ^ { t } + ( 1 - \pi ^ { t } ) \tilde { \mathbf { w } } ^ { t } .
213
+ $$
214
+
215
+ By using this curriculum learning strategy, at the beginning of the training, the model learns to use the memory mainly with the continuous attention. As we anneal the $p ^ { t }$ , the model will rely more on the discrete attention.
216
+
217
+ # 5 REGULARIZING DYNAMIC NEURAL TURING MACHINES
218
+
219
+ When the controller of D-NTM is a powerful recurrent neural network, it is important to regularize training of the D-NTM so as to avoid suboptimal solutions in which the D-NTM ignores the memory and works as a simple recurrent neural network.
220
+
221
+ Read-Write Consistency Regularizer One such suboptimal solution we have observed in our preliminary experiments with the proposed D-NTM is that the D-NTM uses the address part A of the memory matrix simply as an additional weight matrix, rather than as a means to accessing the content part C. We found that this pathological case can be effectively avoided by encouraging the read head to point to a memory cell which has also been pointed by the write head. This can be implemented as the following regularization term:
222
+
223
+ $$
224
+ R _ { \mathrm { r w } } ( \mathbf { w } , \mathbf { u } ) = \lambda \sum _ { t ^ { \prime } = 1 } ^ { T } | | 1 - ( \frac { 1 } { t ^ { \prime } } \sum _ { t = 1 } ^ { t ^ { \prime } } \mathbf { u } _ { t } ) ^ { \top } \mathbf { w } _ { t ^ { \prime } } | | _ { 2 } ^ { 2 }
225
+ $$
226
+
227
+ In the equations above, $\mathbf { u } _ { t }$ is the write and $\mathbf { w } _ { t }$ is the read weights.
228
+
229
+ Next Input Prediction as Regularization Temporal structure is a strong signal that should be exploited by the controller based on a recurrent neural network. We exploit this structure by letting the controller predict the input in the future. We maximize the predictability of the next input by the controller during training. This is equivalent to minimizing the following regularizer:
230
+
231
+ $$
232
+ R _ { \mathrm { p r e d } } ( \mathbf { W } ) = - \log p ( \mathbf { f } _ { t + 1 } | \mathbf { f } _ { t } , \mathbf { w } _ { t } , \mathbf { u } _ { t } , \mathbf { M } _ { t } ; \mathbf { W } ) )
233
+ $$
234
+
235
+ where $f _ { t }$ is the current input and $f _ { t + 1 }$ is the input at next timestep. We found this regularizer to be effective in our preliminary experiments and use it for bAbI tasks.
236
+
237
+ # 6 RELATED WORK
238
+
239
+ A recurrent neural network (RNN), which is used as a controller in the proposed D-NTM, has an implicit memory in the form of recurring hidden states. Even with this implicit memory, a vanilla RNN is however known to have difficulties in storing information for long time-spans (Bengio et al., 1994; Hochreiter, 1991). Long short-term memory (LSTM, (Hochreiter & Schmidhuber, 1997)) and gated recurrent units (GRU, (Cho et al., 2014)) have been found to address this issue. However all these models based solely on RNNs have been found to be limited when they are used to solve, e.g., algorithmic tasks and episodic question-answering.
240
+
241
+ In addition to the finite random access memory of the neural Turing machine, based on which the D-NTM is designed, other data structures have been proposed as external memory for neural networks. In (Sun et al., 1997; Grefenstette et al., 2015; Joulin & Mikolov, 2015), a continuous, differentiable stack was proposed. In (Zaremba et al., 2015; Zaremba & Sutskever, 2015), grid and tape storages are used. These approaches differ from the NTM in that their memory is unbounded and can grow indefinitely. On the other hand, they are often not randomly accessible.
242
+
243
+ Memory networks (Weston et al., 2015b) form another family of neural networks with external memory. In this class of neural networks, information is stored explicitly as it is (in the form of its continuous representation) in the memory, without being erased or modified during an episode. Memory networks and their variants have been applied to various tasks successfully (Sukhbaatar et al., 2015; Bordes et al., 2015; Dodge et al., 2015; Xiong et al., 2016). Miller et al. (2016) have also independently proposed the idea of having separate key and value vectors for memory networks.
244
+
245
+ Another related family of models is the attention-based neural networks. Neural networks with continuous or discrete attention over an input have shown promising results on a variety of challenging tasks, including machine translation (Bahdanau et al., 2015; Luong et al., 2015), speech recognition (Chorowski et al., 2015), machine reading comprehension (Hermann et al., 2015) and image caption generation (Xu et al., 2015).
246
+
247
+ The latter two, the memory network and attention-based networks, are however clearly distinguishable from the D-NTM by the fact that they do not modify the content of the memory.
248
+
249
+ # 7 EXPERIMENTS
250
+
251
+ We provide experimental results to demonstrate the abilities of our model, first on Facebook bAbI task (Weston et al., 2015a). We give detailed analysis and experimental results on this task. We also compare different variations of NTM on bAbI tasks. We have performed experiments on sequential permuted MNIST (Le et al., 2015) and on toy tasks to compare other published models on these tasks with a recurrent controller. The details of our experiments are provided in the supplementary material.
252
+
253
+ # 7.1 EPISODIC QUESTION-ANSWERING: BABI TASKS
254
+
255
+ In this section, we evaluate the proposed D-NTM on the recently proposed episodic question-answering task called Facebook bAbI. We use the dataset with 10k training examples per sub-task provided by Facebook.1 For each episode, the D-NTM reads a sequence of factual sentences followed by a question, all of which are given as natural language sentences. The D-NTM is expected to store and retrieve relevant information in the memory in order to answer the question based on the presented facts. Exact implementation details and hyper-parameter settings are provided in the appendix.
256
+
257
+ # 7.1.1 GOALS
258
+
259
+ The goal of this experiment is three-fold. First, we present for the first time the performance of a memory-based network that can both read and write dynamically on the Facebook bAbI tasks2. We aim to understand whether a model that has to learn to write an incoming fact to the memory, rather than storing it as it is, is able to work well, and to do so, we compare both the original NTM and proposed D-NTM against an LSTM-RNN.
260
+
261
+ Second, we investigate the effect of having to learn how to write. The fact that the NTM needs to learn to write likely has adverse effect on the overall performance, when compared to, for instance, end-to-end memory networks (MemN2N, (Sukhbaatar et al., 2015)) and dynamic memory network $\mathrm { ( D M N + }$ , (Xiong et al., 2016)) both of which simply store the incoming facts as they are. We quantify this effect in this experiment. Lastly, we show the effect of the proposed learnable addressing scheme.
262
+
263
+ We further explore the effect of using a feedforward controller instead of the GRU controller. In addition to the explicit memory, the GRU controller can use its own internal hidden state as the memory. On the other hand, the feedforward controller must solely rely on the explicit memory, as it is the only memory available.
264
+
265
+ # 7.1.2 RESULTS AND ANALYSIS
266
+
267
+ In Table 1, we first observe that the NTMs are indeed capable of solving this type of episodic question-answering better than the vanilla LSTM-RNN. Although the availability of explicit memory in the NTM has already suggested this result, we note that this is the first time neural Turing machines have been used in this specific task.
268
+
269
+ All the variants of NTM with the GRU controller outperform the vanilla LSTM-RNN. However, not all of them perform equally well. First, it is clear that the proposed dynamic NTM (D-NTM) using the GRU controller outperforms the original NTM with the GRU controller (NTM, CBA only NTM vs. continuous D-NTM, Discrete D-NTM). As discussed earlier, the learnable addressing scheme of the D-NTM allows the controller to access the memory slots by location in a potentially nonlinear way. We expect it to help with tasks that have non-trivial access patterns, and as anticipated, we see a large gain with the D-NTM over the original NTM in the tasks of, for instance, 12 - Conjunction and 17 - Positional Reasoning.
270
+
271
+ Among the recurrent variants of the proposed D-NTM, we notice significant improvements by using discrete addressing over using continuous addressing. We conjecture that this is due to certain types of tasks that require precise/sharp retrieval of a stored fact, in which case continuous addressing is in disadvantage over discrete addressing. This is evident from the observation that the D-NTM with discrete addressing significantly outperforms that with continuous addressing in the tasks of 8 -
272
+
273
+ <table><tr><td rowspan="2"></td><td rowspan="2"></td><td rowspan="2"></td><td rowspan="2">DMN+</td><td rowspan="2">L</td><td rowspan="2">1-step CBA</td><td rowspan="2">1-step Soft D-NTM</td><td rowspan="2">1-step Discrete D-NTM</td><td rowspan="2">3-steps LBA* NTM</td><td rowspan="2">3-steps CBA NTM</td><td rowspan="2">3-steps Soft D-NTM</td><td rowspan="2">3-steps Discrete D-NTM</td></tr><tr><td></td></tr><tr><td>Task 1</td><td>LSTM 0.00</td><td>MemN2N 0.00</td><td>0.00</td><td>NTM 16.30</td><td>NTM 16.88</td><td>5.41</td><td>6.66</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>2</td><td>81.90</td><td>0.30</td><td>0.30</td><td>57.08</td><td>55.70</td><td>58.54</td><td>56.04</td><td>61.67</td><td>59.38</td><td>46.66</td><td>62.29</td></tr><tr><td>3</td><td>83.10</td><td>2.10</td><td>1.10</td><td>74.16</td><td>55.00</td><td>74.58</td><td>72.08</td><td>83.54</td><td>65.21</td><td>47.08</td><td>41.45</td></tr><tr><td>4</td><td>0.20</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>5</td><td>1.20</td><td>0.80</td><td>0.50</td><td>1.46</td><td>20.41</td><td>1.66</td><td>1.04</td><td>0.83</td><td>1.46</td><td>1.25</td><td>1.45</td></tr><tr><td>6</td><td>51.80</td><td>0.10</td><td>0.00</td><td>23.33</td><td>21.04</td><td>40.20</td><td>44.79</td><td>48.13</td><td>54.80</td><td>20.62</td><td>11.04</td></tr><tr><td>7</td><td>24.90</td><td>2.00</td><td>2.40</td><td>21.67</td><td>21.67</td><td>19.16</td><td>19.58</td><td>7.92</td><td>37.70</td><td>7.29</td><td>5.62</td></tr><tr><td>8</td><td>34.10</td><td>0.90</td><td>0.00</td><td>25.76</td><td>21.05</td><td>12.58</td><td>18.46</td><td>25.38</td><td>8.82</td><td>11.02</td><td>0.74</td></tr><tr><td>9</td><td>20.20</td><td>0.30</td><td>0.00</td><td>24.79</td><td>24.17</td><td>36.66</td><td>34.37</td><td>37.80</td><td>0.00</td><td>39.37</td><td>32.50</td></tr><tr><td>10</td><td>30.10</td><td>0.00</td><td>0.00</td><td>41.46</td><td>33.13</td><td>52.29</td><td>50.83</td><td>56.25</td><td>23.75</td><td>20.00</td><td>20.83</td></tr><tr><td>11</td><td>10.30</td><td>0.10</td><td>0.00</td><td>18.96</td><td>31.88</td><td>31.45</td><td>4.16</td><td>3.96</td><td>0.28</td><td>30.62</td><td>16.87</td></tr><tr><td>12</td><td>23.40</td><td>0.00</td><td>0.00</td><td>25.83</td><td>30.00</td><td>7.70</td><td>6.66</td><td>28.75</td><td>23.75</td><td>5.41</td><td>4.58</td></tr><tr><td>13</td><td>6.10</td><td>0.00</td><td>0.00</td><td>6.67</td><td>5.63</td><td>5.62</td><td>2.29</td><td>5.83</td><td>83.13</td><td>7.91</td><td>5.00</td></tr><tr><td>14</td><td>81.00</td><td>0.10</td><td>0.20</td><td>58.54</td><td>59.17</td><td>60.00</td><td>63.75</td><td>61.88</td><td>57.71</td><td>58.12</td><td>60.20</td></tr><tr><td>15</td><td>78.70</td><td>0.00</td><td>0.00</td><td>36.46</td><td>42.30</td><td>36.87</td><td>39.27</td><td>35.62</td><td>21.88</td><td>36.04</td><td>40.26</td></tr><tr><td>16</td><td>51.90</td><td>51.80</td><td>45.30</td><td>71.15</td><td>71.15</td><td>49.16</td><td>51.35</td><td>46.15</td><td>50.00</td><td>46.04</td><td>45.41</td></tr><tr><td>17</td><td>50.10</td><td>18.60</td><td>4.20</td><td>43.75</td><td>43.75</td><td>17.91</td><td>16.04</td><td>43.75</td><td>56.25</td><td>21.25</td><td>9.16</td></tr><tr><td>18</td><td>6.80</td><td>5.30</td><td>2.10</td><td>3.96</td><td>47.50</td><td>3.95</td><td>3.54</td><td>47.50</td><td>47.50</td><td>6.87</td><td>1.66</td></tr><tr><td>19</td><td>90.30</td><td>2.30</td><td>0.00</td><td>75.89</td><td>71.51</td><td>73.74</td><td>64.63</td><td>61.56</td><td>63.65</td><td>75.88</td><td>76.66</td></tr><tr><td>20</td><td>2.10</td><td>0.00</td><td>0.00</td><td>1.25</td><td>0.00</td><td>2.70</td><td>3.12</td><td>0.40</td><td>0.00</td><td>3.33</td><td>0.00</td></tr><tr><td>Avg.Err.</td><td>36.41</td><td>4.24</td><td>2.81</td><td>31.42</td><td>33.60</td><td>29.51</td><td>27.93</td><td>32.85</td><td>32.76</td><td>24.24</td><td>21.79</td></tr></table>
274
+
275
+ Table 1: Test error rates $( \% )$ on the 20 bAbI QA tasks for models using 10k training examples with the GRU and feedforward controller. FF stands for the experiments that are conducted with feedforward controller. Let us, note that $\mathrm { L B A ^ { * } }$ refers to NTM that uses both LBA and CBA. In this table, we compare multi-step vs single-step addressing, original NTM with location based+content based addressing vs only content based addressing, and discrete vs continuous addressing on bAbI.
276
+
277
+ Lists/Sets and 11 - Basic Coreference. Furthermore, this is in line with an earlier observation in (Xu et al., 2015), where discrete addressing was found to generalize better in the task of image caption generation.
278
+
279
+ In Table 2, we also observe that the D-NTM with the feedforward controller and discrete attention performs worse than LSTM and D-NTM with continuous-attention. However, when the proposed curriculum strategy from Sec. 4 is used, the average test error drops from 68.30 to 37.79.
280
+
281
+ We empirically found training of the feedforward controller more difficult than that of the recurrent controller. We train our feedforward controller based models four times longer (in terms of the number of updates) than the recurrent controller based ones in order to ensure that they are converged for most of the tasks. On the other hand, the models trained with the GRU controller overfit on bAbI tasks very quickly. For example, on tasks 3 and 16 the feedforward controller based model underfits (i.e., high training loss) at the end of the training, whereas with the same number of units the model with the GRU controller can overfit on those tasks after 3,000 updates only.
282
+
283
+ When our results are compared to the variants of the memory network Weston et al. (2015b) (MemN2N and $\mathrm { D M N + }$ ), we notice a significant performance gap. We attribute this gap to the difficulty in learning to manipulate and store a complex input.
284
+
285
+ Table 2: Test error rates $( \% )$ on the 20 bAbI QA tasks for models using 10k training examples with feedforward controller.
286
+
287
+ <table><tr><td>Task</td><td>FF Soft D-NTM</td><td>FF Discrete D-NTM</td><td>FF Discrete* D-NTM</td></tr><tr><td>1</td><td>4.38</td><td>81.67</td><td>14.79</td></tr><tr><td>2</td><td>27.5</td><td>76.67</td><td>76.67</td></tr><tr><td>3</td><td>71.25</td><td>79.38</td><td>70.83</td></tr><tr><td>4</td><td>0.00</td><td>78.65</td><td>44.06</td></tr><tr><td>5</td><td>1.67</td><td>83.13</td><td>17.71</td></tr><tr><td>6</td><td>1.46</td><td>48.76</td><td>48.13</td></tr><tr><td>7</td><td>6.04</td><td>54.79</td><td>23.54</td></tr><tr><td>8</td><td>1.70</td><td>69.75</td><td>35.62</td></tr><tr><td>9</td><td>0.63</td><td>39.17</td><td>14.38</td></tr><tr><td>10</td><td>19.80</td><td>56.25</td><td>56.25</td></tr><tr><td>11</td><td>0.00</td><td>78.96</td><td>39.58</td></tr><tr><td>12</td><td>6.25</td><td>82.5</td><td>32.08</td></tr><tr><td>13</td><td>7.5</td><td>75.0</td><td>18.54</td></tr><tr><td>14</td><td>17.5</td><td>78.75</td><td>24.79</td></tr><tr><td>15</td><td>0.0</td><td>71.42</td><td>39.73</td></tr><tr><td>16</td><td>49.65</td><td>71.46</td><td>71.15</td></tr><tr><td>17</td><td>1.25</td><td>43.75</td><td>43.75</td></tr><tr><td>18</td><td>0.24</td><td>48.13</td><td>2.92</td></tr><tr><td>19</td><td>39.47</td><td>71.46</td><td>71.56</td></tr><tr><td>20</td><td>0.0</td><td>76.56</td><td>9.79</td></tr><tr><td>Avg.Err.</td><td>12.81</td><td>68.30</td><td>37.79</td></tr></table>
288
+
289
+ We also provide further experiments investigating different extensions on D-NTM in the appendix.
290
+
291
+ # 7.2 SEQUENTIAL pMNIST
292
+
293
+ In sequential MNIST task, the pixels of the MNIST digits are provided to the model in scan line order, left to right and top to bottom (Le et al., 2015). At the end of sequence of pixels, the model predicts the label of the digit in the sequence of pixels. We experiment D-NTM on the variation of sequential MNIST where the order of the pixels is randomly shuffled, we call this task as permuted MNIST $( p \mathrm { M N I S T } )$ . An important contribution of this task to our paper, in particular, is to measure the model’s ability to perform well when dealing with long-term dependencies. We report our results in Table $3 ^ { 3 }$ , we observe improvements over other models that we compare against. In Table 3, ”discrete addressing with MAB” refers to D-NTM model using REINFORCE with baseline computed from moving averages of the reward. Discrete addressing with IB refers to D-NTM using REINFORCE with input-based baseline.
294
+
295
+ # 7.3 NTM TOY TASKS
296
+
297
+ We explore the possibility of using D-NTM to solve algorithmic tasks such as copy and associative recall tasks. We train our model on the same lengths of sequences that is experimented in (Graves et al., 2014). We report our results in Table 4. We find out that D-NTM using continuous-attention can successfully learn the ”Copy” and ”Associative Recall” tasks.
298
+
299
+ In Table 4, we train our model on sequences of the same length as the experiments in (Graves et al., 2014) and test the model on the sequences of the maximum length seen during the training. We consider model to be successful on copy or associative recall if its validation cost (binary cross-entropy) is lower than 0.02 over the sequences of maximum length seen during the training. We set the threshold to 0.02 to determine whether a model is successful on a task. Because empirically we observe that the models have higher validation costs perform badly in terms of generalization over the longer sequences. ”D-NTM discrete” model in this table is trained with REINFORCE using moving averages to estimate the baseline.
300
+
301
+ Table 3: Sequential $p { \mathrm { M N I S T } } .$ .
302
+
303
+ <table><tr><td></td><td>Test Acc</td></tr><tr><td>D-NTMdiscrete MAB</td><td>89.6</td></tr><tr><td>D-NTMdiscrete IB</td><td>92.3</td></tr><tr><td>Soft D-NTM</td><td>93.4</td></tr><tr><td>NTM</td><td>90.9</td></tr><tr><td>I-RNN (Le et al., 2015)</td><td>82.0</td></tr><tr><td>Zoneout (Krueger et al.,2016)</td><td>93.1</td></tr><tr><td>LSTM (Krueger et al., 2016)</td><td>89.8</td></tr><tr><td>Unitary-RNN (Arjovsky et al., 2015)</td><td>91.4</td></tr><tr><td>Recurrent Dropout (Krueger et al., 2016)</td><td>92.5</td></tr></table>
304
+
305
+ Table 4: NTM Toy Tasks.
306
+
307
+ <table><tr><td></td><td>Copy Tasks</td><td>Associative Recall</td></tr><tr><td>Soft D-NTM</td><td>Success</td><td>Success</td></tr><tr><td>D-NTMdiscrete</td><td>Success</td><td>Failure</td></tr><tr><td>NTM</td><td>Success</td><td>Success</td></tr></table>
308
+
309
+ # 8 CONCLUSION AND FUTURE WORK
310
+
311
+ In this paper we extend neural Turing machines (NTM) by introducing a learnable addressing scheme which allows the NTM to be capable of performing highly nonlinear location-based addressing. This extension, to which we refer by dynamic NTM (D-NTM), is extensively tested with various configurations, including different addressing mechanisms (continuous vs. discrete) and different number of addressing steps, on the Facebook bAbI tasks. This is the first time an NTM-type model was tested on this task, and we observe that the NTM, especially the proposed D-NTM, performs better than vanilla LSTM-RNN. Furthermore, the experiments revealed that the discrete, discrete addressing works better than the continuous addressing with the GRU controller, and our analysis reveals that this is the case when the task requires precise retrieval of memory content.
312
+
313
+ Our experiments show that the NTM-based models can be weaker than other variants of memory networks which do not learn but have an explicit mechanism of storing incoming facts as they are. We conjecture that this is due to the difficulty in learning how to write, manipulate and delete the content of memory. Despite this difficulty, we find the NTM-based approach, such as the proposed D-NTM, to be a better, future-proof approach, because it can scale to a much longer horizon (where it becomes impossible to explicitly store all the experiences.)
314
+
315
+ On $p \mathrm { M N I S T }$ task, we show that our model can outperform other similar type of approaches proposed to deal with the long-term dependencies. On copy and associative recall tasks, we show that our model can solve the algorithmic problems that are proposed to solve with NTM type of models.
316
+
317
+ The success of both the learnable address and the discrete addressing scheme suggests two future research directions. First, we should try both of these schemes in a wider array of memory-based models, as they are not specific to the neural Turing machines. Second, the proposed D-NTM needs to be evaluated on a diverse set of applications, such as text summarization (Rush et al., 2015), visual questionanswering (Antol et al., 2015) and machine translation, in order to make a more concrete conclusion.
318
+
319
+ # REFERENCES
320
+
321
+ Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: visual question answering. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pp. 2425–2433, 2015.
322
+ Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. arXiv preprint arXiv:1511.06464, 2015.
323
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings Of The International Conference on Representation Learning (ICLR 2015), 2015.
324
+ Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. Neural Networks, IEEE Transactions on, 5(2):157–166, 1994.
325
+ Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075, 2015.
326
+ Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
327
+ Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. arXiv preprint arXiv:1506.07503, 2015.
328
+ Tim Cooijmans, Nicolas Ballas, Cesar Laurent, and Aaron Courville. Recurrent batch normalization. ´ arXiv preprint arXiv:1603.09025, 2016.
329
+ Jesse Dodge, Andreea Gane, Xiang Zhang, Antoine Bordes, Sumit Chopra, Alexander Miller, Arthur Szlam, and Jason Weston. Evaluating prerequisite qualities for learning end-to-end dialog systems. CoRR, abs/1511.06931, 2015.
330
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. Book in preparation for MIT Press, 2016. URL http://www.deeplearningbook.org.
331
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
332
+ Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. ´ Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626): 471–476, 2016.
333
+ Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Advances in Neural Information Processing Systems, pp. 1819–1827, 2015.
334
+ Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. Noisy activation functions. arXiv preprint arXiv:1603.00391, 2016.
335
+ Karl Moritz Hermann, Toma´s Ko ˇ cisk ˇ y, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa \` Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. arXiv preprint arXiv:1506.03340, 2015.
336
+
337
+ Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. arXiv preprint arXiv:1511.02301, 2015.
338
+
339
+ Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. Diploma, Technische Universitat¨ Munchen ¨ , pp. 91, 1991.
340
+
341
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
342
+
343
+ Peter J. Huber. Robust estimation of a location parameter. Ann. Math. Statist., 35(1):73–101, 03 1964.
344
+
345
+ Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Advances in Neural Information Processing Systems, pp. 190–198, 2015.
346
+
347
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
348
+
349
+ David Krueger, Tegan Maharaj, Janos Kram ´ ar, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary ´ Ke, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, Aaron Courville, et al. Zoneout: Regularizing rnns by randomly preserving hidden activations. arXiv preprint arXiv:1606.01305, 2016.
350
+
351
+ Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
352
+
353
+ Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-based neural machine translation. In Proceedings Of The Conference on Empirical Methods for Natural Language Processing (EMNLP 2015), 2015.
354
+
355
+ Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. CoRR, abs/1606.03126, 2016. URL http://arxiv.org/abs/1606.03126.
356
+
357
+ Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. arXiv preprint arXiv:1402.0030, 2014.
358
+
359
+ 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 NIPS. 2016.
360
+
361
+ Scott Reed and Nando de Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
362
+
363
+ Alexander M. Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, pp. 379–389, 2015.
364
+
365
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. One-shot learning with memory-augmented neural networks. arXiv preprint arXiv:1605.06065, 2016.
366
+
367
+ Iulian V Serban, Alessandro Sordoni, Yoshua Bengio, Aaron Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In Proceedings of the 30th AAAI Conference on Artificial Intelligence (AAAI-16), 2016.
368
+
369
+ Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. arXiv preprint arXiv:1503.08895, 2015.
370
+
371
+ Guo-Zheng Sun, C. Lee Giles, and Hsing-Hen Chen. The neural network pushdown automaton: Architecture, dynamics and training. In Adaptive Processing of Sequences and Data Structures, International Summer School on Neural Networks, pp. 296–345, 1997.
372
+
373
+ Oriol Vinyals and Quoc Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015.
374
+
375
+ Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. Towards ai-complete question answering: a set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015a.
376
+
377
+ Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In Proceedings Of The International Conference on Representation Learning (ICLR 2015), 2015b. In Press.
378
+
379
+ Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992.
380
+ Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic memory networks for visual and textual question answering. CoRR, abs/1603.01417, 2016.
381
+ Kelvin Xu, Jimmy Ba, Ryan Kiros, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Proceedings Of The International Conference on Representation Learning (ICLR 2015), 2015.
382
+ Li Yao, Atousa Torabi, Kyunghyun Cho, Nicolas Ballas, Christopher Pal, Hugo Larochelle, and Aaron Courville. Describing videos by exploiting temporal structure. In Computer Vision (ICCV), 2015 IEEE International Conference on. IEEE, 2015.
383
+ Wojciech Zaremba and Ilya Sutskever. Reinforcement learning neural turing machines. CoRR, abs/1505.00521, 2015.
384
+ Wojciech Zaremba, Tomas Mikolov, Armand Joulin, and Rob Fergus. Learning simple algorithms from examples. arXiv preprint arXiv:1511.07275, 2015.
385
+
386
+ # A EXPERIMENTAL DETAILS
387
+
388
+ A.1 MODEL AND TRAINING DETAILS FOR BABI
389
+
390
+ We use the same hyperparameters for all the tasks for a given model.
391
+
392
+ # A.1.1 FACT REPRESENTATION
393
+
394
+ We use a recurrent neural network with GRU units to encode a variable-length fact into a fixed-size vector representation. This allows the D-NTM to exploit the word ordering in each fact, unlike when facts are encoded as bag-of-words vectors.
395
+
396
+ # A.1.2 CONTROLLER
397
+
398
+ We experiment with both a recurrent and feedforward neural network as the controller that generates the read and write weights. The controller has 180 units. We train our feed-forward controller using noisy-tanh activation function (Gulcehre et al., 2016) since we were experiencing training difficulties with sigmoid and tanh activation functions. We use both single-step and three-steps addressing with our GRU controller.
399
+
400
+ # A.1.3 MEMORY
401
+
402
+ The memory contains 120 memory cells. Each memory cell consists of a 16-dimensional address part and 28-dimensional content part.
403
+
404
+ # A.1.4 TRAINING DETAILS
405
+
406
+ We set aside a random $1 0 \%$ of the training examples as a validation set for each sub-task and use it for early-stopping and hyperparameter search. We train one D-NTM for each sub-task, using Adam (Kingma & Ba, 2014) with its learning rate set to 0.003 and 0.007 respectively for GRU and Feedforward controller. The size of each minibatch is 160, and each minibatch is constructed uniform-randomly from the training set.
407
+
408
+ # A.2 MODEL AND TRAINING DETAILS FOR SEQUENTIAL MNIST
409
+
410
+ On sequential MNIST task we try to keep the capacity of our model to be close to our baselines. We use 100 GRU units in the controller and each content vector of size 8 and with address vectors of size 8. We use a learning rate of $1 e - 3$ and trained the model with adam optimizer. We did not use the read and write consistency regularization in any of our models.
411
+
412
+ # A.3 MODEL AND TRAINING DETAILS FOR TOY TASKS
413
+
414
+ On both copy and associative recall tasks, we try to keep the capacity of our model to be close to our baselines. We use 100 GRU units in the controller and each content vector of has a size of 8 and using address vector of size 8. We use a learning rate of $1 e - 3$ and trained the model with adam optimizer. We did not use the read and write consistency regularization in any of our models. For the model with the discrete attention we use REINFORCE with baseline computed using moving averages.
415
+
416
+ # B VISUALIZATION OF DISCRETE ATTENTION
417
+
418
+ We visualize the attention of D-NTM with GRU controller with discrete attention in Figure 2. From this example, we can see that D-NTM has learned to find the correct supporting fact even without any supervision for the particular story in the visualization.
419
+
420
+ # C LEARNING CURVES FOR THE RECURRENT CONTROLLER
421
+
422
+ In Figure 3, we compare the learning curves of the continuous and discrete attention D-NTM model with recurrent controller on Task 1. Surprisingly, the discrete attention D-NTM converges faster than the continuous-attention model. The main difficulty of learning continuous-attention is due to the fact that learning to write with continuous-attention can be challenging.
423
+
424
+ ![](images/13f6be6816a8ab4ad76006098fb07e79c29ffd5f83dd209f067809e9e7421ce0.jpg)
425
+ Figure 2: An example view of the discrete attention over the memory slots for both read (left) and write heads(right). $\mathbf { X }$ -axis the denotes the memory locations that are being accessed and y-axis corresponds to the content in the particular memory location. In this figure, we visualize the discrete-attention model with 3-reading steps and on task-20. It is easy to see that the NTM with discrete-attention accesses to the relevant part of the memory. We only visualize the last-step of the 3-steps writing. Because with discrete attention usually the model just reads the empty slots of the memory.
426
+
427
+ ![](images/750ba06aa86f2fcf7b1b8477065761e178ba6d5f4dd1a6aa03704d44c0632dbd.jpg)
428
+ Figure 3: A visualization for the learning curves of continuous and discrete D-NTM models trained on Task 1 using 3 steps. In most tasks, we observe that the discrete attention model with GRU controller does converge faster than the continuous-attention model.
429
+
430
+ # D A COMPARISON BETWEEN THE LEARNINGCURVES OF INPUT BASED BASELINE AND REGULAR BASELINE ON $p$ MNIST
431
+
432
+ In Figure 4, we show the learning curves of input-based-baseline (ibb) and regular REINFORCE with moving averages baseline (mab) on the $p \mathrm { M N I S T }$ task. We observe that input-based-baseline in general is much easier to optimize and converges faster as well. But it can quickly overfit to the task as well.
433
+
434
+ # E TRAINING WITH CONTINUOUS-ATTENTION AND TESTING WITH DISCRETE-ATTENTION
435
+
436
+ In Table 5, we provide results investigating the effects of using discrete attention model at the test-time for a model trained with feed-forward controller and continuous attention. Discrete∗ D-NTM model bootstraps the discrete attention with the continuous attention, using the curriculum method that we have introduced in Section ”Curriculum Learning for the Discrete Attention”. Discrete† D-NTM model is the continuous-attention model which uses discrete-attention at the test time. We observe that the Discrete† D-NTM model which is trained with continuous-attention outperforms Discrete D-NTM model.
437
+
438
+ ![](images/858347b800db4692b6c99c985fab4630eac6e5ffb7ee526a7c12130eaa865972.jpg)
439
+ Figure 4: We compare the learning curves of our D-NTM model using discrete attention on $p \mathrm { M N I S T }$ task with input-based baseline and regular REINFORCE baseline. The $\mathbf { X }$ -axis is the loss and y-axis is the number of epochs.
440
+
441
+ <table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>continuousD-NTM</td><td rowspan=1 colspan=1>DiscreteD-NTM</td><td rowspan=1 colspan=1>Discrete*D-NTM</td><td rowspan=1 colspan=1>Discrete†D-NTM</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>4.38</td><td rowspan=1 colspan=1>81.67</td><td rowspan=1 colspan=1>14.79</td><td rowspan=6 colspan=1>72.2881.6778.9579.6968.5431.6749.17</td></tr><tr><td rowspan=2 colspan=1>234</td><td rowspan=1 colspan=1>27.571.25</td><td rowspan=2 colspan=1>76.6779.3878.65</td><td rowspan=2 colspan=1>76.6770.8344.06</td></tr><tr><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>1.67</td><td rowspan=1 colspan=1>83.13</td><td rowspan=1 colspan=1>17.71</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>1.46</td><td rowspan=1 colspan=1>48.76</td><td rowspan=1 colspan=1>48.13</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>6.04</td><td rowspan=1 colspan=1>54.79</td><td rowspan=1 colspan=1>23.54</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>1.70</td><td rowspan=1 colspan=1>69.75</td><td rowspan=1 colspan=1>35.62</td><td rowspan=13 colspan=1>79.3237.7125.6382.0874.3847.0877.0873.9653.0230.4211.4676.0513.96</td></tr><tr><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>39.17</td><td rowspan=1 colspan=1>14.38</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>19.80</td><td rowspan=1 colspan=1>56.25</td><td rowspan=1 colspan=1>56.25</td></tr><tr><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>78.96</td><td rowspan=1 colspan=1>39.58</td></tr><tr><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>6.25</td><td rowspan=1 colspan=1>82.5</td><td rowspan=1 colspan=1>32.08</td></tr><tr><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>7.5</td><td rowspan=1 colspan=1>75.0</td><td rowspan=1 colspan=1>18.54</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>17.5</td><td rowspan=1 colspan=1>78.75</td><td rowspan=1 colspan=1>24.79</td></tr><tr><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>71.42</td><td rowspan=1 colspan=1>39.73</td></tr><tr><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>49.65</td><td rowspan=1 colspan=1>71.46</td><td rowspan=1 colspan=1>71.15</td></tr><tr><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>1.25</td><td rowspan=1 colspan=1>43.75</td><td rowspan=1 colspan=1>43.75</td></tr><tr><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>0.24</td><td rowspan=1 colspan=1>48.13</td><td rowspan=3 colspan=1>2.9271.569.79</td></tr><tr><td rowspan=2 colspan=1>1920</td><td rowspan=1 colspan=1>39.47</td><td rowspan=2 colspan=1>71.4676.56</td></tr><tr><td rowspan=1 colspan=1>0.0</td></tr><tr><td rowspan=1 colspan=1>Avg</td><td rowspan=1 colspan=1>12.81</td><td rowspan=1 colspan=1>68.30</td><td rowspan=1 colspan=1>37.79</td><td rowspan=1 colspan=1>57.21</td></tr></table>
442
+
443
+ Table 5: Test error rates $( \% )$ on the 20 bAbI QA tasks for models using 10k training examples with the feedforward controller. Discrete∗ D-NTM model bootstraps the discrete attention with the continuous attention, using the curriculum method that we have introduced in Section 4. Discrete† D-NTM model is the continuous-attention model which uses discrete-attention at the test time.
444
+
445
+ # F D-NTM WITH BOW FACT REPRESENTATION
446
+
447
+ In Table 6, we provide results for D-NTM using BoW with positional encoding (PE) Sukhbaatar et al. (2015) as the representation of the input facts. The facts representations are provided as an input to the GRU controller. In agreement to our results with the GRU fact representation, with the BoW fact representation we observe improvements with multi-step of addressing over single-step and discrete addressing over continuous addressing.
448
+
449
+ Table 6: Test error rates $( \% )$ on the 20 bAbI QA tasks for models using 10k training examples with the GRU controller and representations of facts are obtained with $\mathrm { B o W }$ using positional encoding.
450
+
451
+ <table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>SoftD-NTM(1-step)</td><td rowspan=1 colspan=1>DiscreteD-NTM(1-step)</td><td rowspan=1 colspan=1>SoftD-NTM(3-steps)</td><td rowspan=1 colspan=1>DiscreteD-NTM(3-steps)</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=3 colspan=1>234</td><td rowspan=1 colspan=1>61.04</td><td rowspan=1 colspan=1>59.37</td><td rowspan=1 colspan=1>56.87</td><td rowspan=1 colspan=1>55.62</td></tr><tr><td rowspan=1 colspan=1>55.62</td><td rowspan=1 colspan=1>57.5</td><td rowspan=1 colspan=1>62.5</td><td rowspan=1 colspan=1>57.5</td></tr><tr><td rowspan=1 colspan=1>27.29</td><td rowspan=1 colspan=1>24.89</td><td rowspan=1 colspan=1>26.45</td><td rowspan=1 colspan=1>27.08</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>13.55</td><td rowspan=1 colspan=1>12.08</td><td rowspan=1 colspan=1>15.83</td><td rowspan=1 colspan=1>14.78</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>13.54</td><td rowspan=1 colspan=1>14.37</td><td rowspan=1 colspan=1>21.87</td><td rowspan=1 colspan=1>13.33</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8.54</td><td rowspan=1 colspan=1>6.25</td><td rowspan=1 colspan=1>8.75</td><td rowspan=1 colspan=1>14.58</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>1.69</td><td rowspan=1 colspan=1>1.36</td><td rowspan=1 colspan=1>3.01</td><td rowspan=1 colspan=1>3.02</td></tr><tr><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>17.7</td><td rowspan=1 colspan=1>16.66</td><td rowspan=1 colspan=1>37.70</td><td rowspan=1 colspan=1>17.08</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>26.04</td><td rowspan=1 colspan=1>27.08</td><td rowspan=1 colspan=1>26.87</td><td rowspan=3 colspan=1>23.952.294.16</td></tr><tr><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>20.41</td><td rowspan=1 colspan=1>3.95</td><td rowspan=1 colspan=1>2.5</td></tr><tr><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>0.41</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.20</td></tr><tr><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>3.12</td><td rowspan=1 colspan=1>1.04</td><td rowspan=1 colspan=1>4.79</td><td rowspan=1 colspan=1>5.83</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>62.08</td><td rowspan=1 colspan=1>58.33</td><td rowspan=1 colspan=1>61.25</td><td rowspan=2 colspan=1>60.620.05</td></tr><tr><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>31.66</td><td rowspan=1 colspan=1>26.25</td><td rowspan=1 colspan=1>0.62</td></tr><tr><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>54.47</td><td rowspan=1 colspan=1>48.54</td><td rowspan=1 colspan=1>48.95</td><td rowspan=3 colspan=1>48.9530.6236.04</td></tr><tr><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>43.75</td><td rowspan=1 colspan=1>31.87</td><td rowspan=1 colspan=1>43.75</td></tr><tr><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>33.75</td><td rowspan=1 colspan=1>39.37</td><td rowspan=1 colspan=1>36.66</td></tr><tr><td rowspan=2 colspan=1>1920</td><td rowspan=1 colspan=1>64.63</td><td rowspan=1 colspan=1>69.21</td><td rowspan=1 colspan=1>67.23</td><td rowspan=1 colspan=1>65.46</td></tr><tr><td rowspan=1 colspan=1>1.25</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>1.45</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>Avg</td><td rowspan=1 colspan=1>27.02</td><td rowspan=1 colspan=1>24.98</td><td rowspan=1 colspan=1>26.36</td><td rowspan=1 colspan=1>24.05</td></tr></table>
md/train/ByRWCqvT-/ByRWCqvT-.md ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO CLUSTER IN ORDER TO TRANSFER ACROSS DOMAINS AND TASKS
2
+
3
+ Yen-Chang Hsu, Zhaoyang Lv
4
+ Georgia Institute of Technology
5
+ Atlanta, GA 30332, USA
6
+ {yenchang.hsu, zhaoyang.lv}@gatech.edu
7
+
8
+ Zsolt Kira Georgia Tech Research Institute Atlanta, GA 30318, USA zkira@gatech.edu
9
+
10
+ # ABSTRACT
11
+
12
+ This paper introduces a novel method to perform transfer learning across domains and tasks, formulating it as a problem of learning to cluster. The key insight is that, in addition to features, we can transfer similarity information and this is sufficient to learn a similarity function and clustering network to perform both domain adaptation and cross-task transfer learning. We begin by reducing categorical information to pairwise constraints, which only considers whether two instances belong to the same class or not (pairwise semantic similarity). This similarity is category-agnostic and can be learned from data in the source domain using a similarity network. We then present two novel approaches for performing transfer learning using this similarity function. First, for unsupervised domain adaptation, we design a new loss function to regularize classification with a constrained clustering loss, hence learning a clustering network with the transferred similarity metric generating the training inputs. Second, for cross-task learning (i.e., unsupervised clustering with unseen categories), we propose a framework to reconstruct and estimate the number of semantic clusters, again using the clustering network. Since the similarity network is noisy, the key is to use a robust clustering algorithm, and we show that our formulation is more robust than the alternative constrained and unconstrained clustering approaches. Using this method, we first show state of the art results for the challenging cross-task problem, applied on Omniglot and ImageNet. Our results show that we can reconstruct semantic clusters with high accuracy. We then evaluate the performance of cross-domain transfer using images from the Office-31 and SVHN-MNIST tasks and present top accuracy on both datasets. Our approach doesn’t explicitly deal with domain discrepancy. If we combine with a domain adaptation loss, it shows further improvement.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ Supervised learning has made significant strides in the past decade, with substantial advancements arising from the use of deep neural networks. However, a large part of this success has come from the existence of extensive labeled datasets. In many situations, it is not practical to obtain such data due to the amount of effort required or when the task or data distributions change dynamically. To deal with these situations, the fields of transfer learning and domain adaptation have explored how to transfer learned knowledge across tasks or domains. Many approaches have focused on cases where the distributions of the features and labels have changed, but the task is the same (e.g., classification across datasets with the same categories). Cross-task transfer learning strategies, on the other hand, have been widely adopted especially in the computer vision community where features learned by a deep neural network on a large classification task have been applied to a wide variety of other tasks (Donahue et al., 2014).
17
+
18
+ Most of the prior cross-task transfer learning works, however, require labeled target data to learn classifiers for the new task. If labels of the target data are absent, there is little choice other than to apply unsupervised approaches such as clustering on the target data with pre-trained feature representations. In this paper, we focus on the question of what can be transferred (besides features) to support both cross-domain and cross-task transfer learning. We address it with a learned similarity function as the fundamental component of clustering. Clustering can then be realized using a neural network trained using the output of the similarity function, which can be successfully used to achieve both cross-task and cross-domain transfer.
19
+
20
+ The key idea is to formulate the clustering objective to use a learnable (and transferable) term, which in our proposed work is a similarity prediction function. Our proposed objective function can be easily combined with deep neural networks and optimized end-to-end. The features and clustering are optimized jointly, hence taking advantage of such side information in a robust way. Using this method, we show that unsupervised learning can benefit from learning performed on a distinct task, and demonstrate the flexibility of further combining it with a classification loss and domain discrepancy loss.
21
+
22
+ In summary, we make several contributions. First, we propose to use predictive pairwise similarity as the knowledge that is transferred and formulate a learnable objective function to utilize the pairwise information in a fashion similar to constrained clustering. We then provide the methodologies to deploy the objective function in both cross-task and cross-domain scenarios with deep neural networks. The experimental results for cross-task learning on Omniglot and ImageNet show that we can achieve state of the art clustering results with predicted similarities. On the standard domain adaptation benchmark Office-31 dataset, we demonstrate improvements over state-of-art even when not performing any explicit domain adaptation, and further improvements if we do. Finally, on another domain adaptation task, SVHN-to-MNIST, our approach using Omniglot as the auxiliary dataset achieves top performance with a large margin.
23
+
24
+ # 2 RELATED WORK
25
+
26
+ Transfer Learning: Transfer learning aims to leverage knowledge from the source domain to help learn in the target domain, while only focusing on the performance on the target domain. The type of transferred knowledge includes training instances, features, model parameters and relational knowledge (Pan & Yang, 2010). Pairwise similarity is the meta-knowledge we propose to transfer, which falls in between the last two types. The similarity prediction function is a neural network with learned parameters, while the output is the most simplified form of relational knowledge, i.e., only considering pairwise semantic similarity.
27
+
28
+ Cross-task Transfer Learning: Features learned when trained for ImageNet classification (Russakovsky et al., 2015) have boosted the performance of a variety of vision tasks in a supervised setting. For example, new classification tasks (Donahue et al., 2014; Yosinski et al., 2014), object detection (Girshick et al., 2014), semantic segmentation (Long et al., 2015a), and image captioning (Vinyals et al., 2015). Translated Learning (Dai et al., 2009) has an unsupervised setting similar to ours, but it again focuses only on transferring features across tasks. Our work explores how learning could benefit from transferring pairwise similarity in an unsupervised setting.
29
+
30
+ Cross-domain Transfer Learning: Also known as domain adaptation (Pan & Yang, 2010), there has recently been a large body of work dealing with domain shift between image datasets by minimizing domain discrepancy (Tzeng et al., 2014; Long et al., 2015b; Ganin et al., 2016; Sun et al., 2016; Long et al., 2016; Sener et al., 2016; Carlucci et al., 2017; Long et al., 2017; Zellinger et al., 2017; Bousmalis et al., 2017). We address the problem in a complementary way that transfers extra information from the auxiliary dataset and show a larger performance boost with further gains using an additional domain discrepancy loss.
31
+
32
+ Constrained Clustering: Constrained clustering algorithms can be categorized by how they utilize constraints (e.g. pairwise information). The first set of work use the constraints to learn a distance metric. For example, DML (Xing et al., 2003), ITML (Davis et al., 2007), SKMS (Anand et al., 2014), SKKm (Anand et al., 2014; Amid et al., 2016), and SKLR (Amid et al., 2016). This group of approaches closely relates to metric learning and needs a clustering algorithm such as K-means in a separate stage to obtain cluster assignments. The second group of work use constraints to formulate the clustering loss. For example, CSP (Wang et al., 2014) and COSC (Rangapuram & Hein, 2012). The third group uses constraints for both metric learning and the clustering objective, such as MPCKMeans (Bilenko et al., 2004) and CECM (Antoine et al., 2012). The fourth group does not use constraints at all. A generic clustering algorithms such as K-means (MacQueen et al., 1967), LSC (Chen & Cai, 2011), and LPNMF (Cai et al., 2009) all belong to this category. There is a long list of associated works and they are summarized in survey papers, e.g. Davidson & Basu (2007) and Dinler & Tural (2016). Our proposed clustering strategy belongs to the third group. The constrained clustering methods above are applied to the semi-supervised setting where the groundtruth constraints are sparsely available. In our unsupervised setting, the ground-truth is unavailable but predicted constraints are densely available. We include all four groups of algorithms in our comparison and show the advantages of the third group.
33
+
34
+ ![](images/e45febb1495b4ec74c335fc4134b2e9707a9552a0aad1ab6b240e7e63479843e.jpg)
35
+ Figure 1: Overview of the transfer scheme with a learnable clustering objective (LCO). The LCO and pairwise similarity are the two key components of our approach and are described in section 4. The dashed rectangles and light gray arrows are only available in cross-domain transfer. Details are described in section 3.
36
+
37
+ # 3 THE TRANSFER LEARNING TASKS
38
+
39
+ To define the transfer learning problem addressed in this work, we follow the notations used by Pan & Yang (2010). The goal is to transfer knowledge from source data $\boldsymbol { S } = ( X _ { S } , Y _ { S } )$ , where $X _ { S }$ is the set of data instances and $Y _ { S }$ is the corresponding categorical labels, to a target data noted as $T = \left( X _ { T } , Y _ { T } \right)$ . The learning is unsupervised since $Y _ { T }$ is unknown. The scenario is divided into two cases. One is $\{ Y _ { T } \} \ne \{ { \bar { Y } } _ { S } \}$ , which means the set of categories are not the same and hence the transfer is across tasks. The second case is $\{ Y _ { T } \} = \{ Y _ { S } \}$ , but with a domain shift. In other words, the marginal probability distributions of the input data are different, i.e., $P ( X _ { T } ) \neq P ( X _ { S } )$ . The latter is a cross-domain learning problem also called transductive learning. The domain adaptation approaches which have gained significant attention recently belong to the second scenario.
40
+
41
+ To align with common benchmarks for evaluating transfer learning performance, we further use the notion of an auxiliary dataset and split the source data into $S = { \bar { S } } ^ { \prime } \cup A$ . $S ^ { \prime } = ( X _ { S } ^ { \prime } , Y _ { S } ^ { \prime } )$ which is only present in the cross-domain transfer scheme and has $\{ Y _ { S } ^ { \prime } \} = \{ Y _ { T } \}$ . $A = ( X _ { A } , Y _ { A } )$ is the auxiliary dataset which has a large amount of labeled data and potentially categories as well, and may or may not contain the categories of $Y _ { T }$ . For the cross task scenario, only $A$ and unlabeled $T$ are included, while cross-domain transfer involves $A$ , $S ^ { \prime }$ , and $T$ . In the following sections we use the above notations and describe the two transfer learning tasks in detail. Figure 1 illustrates how our approach relates to both tasks.
42
+
43
+ Transfer across tasks: If the target task has different categories, we cannot directly transfer the classifier from source to target, and there is no labeled target data to use for fine-tuning transferred features. Here we propose to first reduce the categorization problem to a surrogate same-task problem. We can directly apply transductive transfer learning (Pan & Yang, 2010) to the transformed task. The cluster structure in the target data is then reconstructed using the predictions in the transformed task. See figure 2 for an illustration.
44
+
45
+ The source involves a labeled auxiliary dataset $A$ and an unlabeled target dataset $T$ . $Y _ { T }$ is the target that must be inferred. In this scenario the set of categories $\{ Y _ { A } \} \ne \{ Y _ { T } \}$ , and $Y _ { T }$ is unknown. We first transform the problem of categorization into a pairwise similarity prediction problem. In other words, we specify a transformation function $R$ such that $R ( A ) = ( X _ { A } ^ { R ^ { \prime } } , \bar { Y } ^ { R } )$ , and $\dot { X } _ { A } ^ { R } = \{ ( x _ { A , i } , x _ { A , j } ) \} _ { \forall i , j }$ contains all pairs of data, where $\{ Y ^ { R } \} = \{ d i s s i m i l a r , s i m i l a r \}$ . The transformation on the labeled auxiliary data is straightforward. It will be similar if two data instances are from the same category, and vice versa. We then use it to learn a pairwise similarity prediction function $G ( x _ { i } , x _ { j } ) = \mathbf { \bar { \Gamma } } y _ { i , j }$
46
+
47
+ ![](images/2b04f9cd1aa8b76244e957c10c6c523af984b0b1e4ea8542e4f1f432440b0e65.jpg)
48
+ Figure 2: The concept for reconstructing clusters of unseen categories. The proposed approach follows the arrows in the counter-clockwise direction, which converts cross-task transfer learning to cross-domain transfer learning. The colors of dots represent data of different categories. The hollow circle and cross symbol represent similar and dissimilar data pairs. The $G$ function and the cluster reconstruction (via constrained clustering) are the two key components in the diagram.
49
+
50
+ By applying $G$ on $T$ , we can obtain $G ( x _ { T , i } , x _ { T , j } ) = y _ { T , i , j }$ . The last step is to infer $Y _ { T }$ from $Y _ { T } ^ { R } = \{ y _ { T , i , j } \} _ { \forall i , j }$ , which can be solved using constrained clustering algorithms. Note that since the actual $Y _ { T }$ is unknown, the algorithm only infers the indices of categories, which could be in arbitrary order. The resulting clusters are expected to contain coherent semantic categories.
51
+
52
+ Transfer across domains: The problem setting we consider here is the same as unsupervised domain adaptation. Following the standard evaluation procedure (Long et al., 2017; Ganin et al., 2016), the labeled datasets $A$ is ImageNet and $S ^ { \prime }$ is one domain in the Office-31 dataset. The unlabeled $T$ is another domain in Office-31. The goal is to enhance classification performance on $T$ by utilizing $A$ , $S ^ { \prime }$ , and $T$ together.
53
+
54
+ # 4 THE LEARNABLE CLUSTERING OBJECTIVE (LCO)
55
+
56
+ The key to our approach is the design of a learning objective that can use (noisy) predicted pairwise similarities, and is inspired from constrained clustering which involves using pairwise information in the loss function. The pairwise information is called must-link/cannot-link constraints or similar/dissimilar pairs (we use the latter). Note that the information is binarized to one and zero for similar and dissimilar pairs, accordingly.
57
+
58
+ Although many constrained clustering algorithms have been developed, few of them are scalable with respect to the number of pairwise relationships. Further, none of them can be easily integrated into deep neural networks. Inspired by the work of Hsu & Kira (2016), we construct a contrastive loss for clustering on the probability outputs of a softmax classifier. However, each output node does not have to map to a fixed category but instead each output node represents a probabilistic assignment of a data point to a cluster. The assignment between output nodes and clusters are formed stochastically during the optimization and is guided by the pairwise similarity. If there is a similar pair, their output distribution should be similar, and vice-versa.
59
+
60
+ Specifically, we use the pair-wise KL-divergence to evaluate the distance between $k$ cluster assignment distributions of two data instances, and use predicted similarity to construct the contrastive loss. Given a pair of data $x _ { p } , x _ { q }$ , their corresponding output distributions are defined as $\mathcal { P } = f ( x _ { p } )$ and $\mathcal { Q } = f ( x _ { q } )$ , while $f$ is the neural network. The cost of a similar pair is described as :
61
+
62
+ $$
63
+ \mathcal { L } ( \boldsymbol { x } _ { p } , \boldsymbol { x } _ { q } ) ^ { + } = \mathcal { D } _ { K L } ( \mathcal { P } ^ { \star } | | \boldsymbol { \mathcal { Q } } ) + \mathcal { D } _ { K L } ( \mathcal { Q } ^ { \star } | | \mathcal { P } )
64
+ $$
65
+
66
+ $$
67
+ \mathcal { D } _ { K L } ( \mathcal { P } ^ { \star } | | \mathcal { Q } ) = \sum _ { c = 1 } ^ { k } p _ { c } l o g ( \frac { p _ { c } } { q _ { c } } )
68
+ $$
69
+
70
+ ![](images/b7321399ab1bca7f870eb89cd648d445662c407854095766daa46df0319beb58.jpg)
71
+ Figure 3: The similarity prediction network (the $G$ function).
72
+
73
+ The cost $\mathcal { L } ( x _ { p } , x _ { q } ) ^ { + }$ is symmetric w.r.t. $x _ { p } , x _ { q }$ , in which ${ \mathcal { P } } ^ { \star }$ and $\mathcal { Q } ^ { \star }$ are alternatively assumed to be constant. Each KL-divergence factor $\hat { \mathcal { D } } _ { K L } ^ { \star } ( \hat { \mathcal { P } } ^ { \star } | | \mathcal { Q } )$ becomes a unary function whose gradient is simply $\partial { \cal D } _ { K L } ( { \mathcal { P } } ^ { \star } | | { \mathcal { Q } } ) / \partial { \mathcal { Q } }$ .
74
+
75
+ If $x _ { p } , x _ { q }$ comes from a pair which is dissimilar, their output distributions are expected to be different, which can be defined as a hinge-loss function:
76
+
77
+ $$
78
+ \mathcal { L } ( \boldsymbol { x } _ { p } , \boldsymbol { x } _ { q } ) ^ { - } = L _ { h } ( \mathcal { D } _ { K L } ( \mathcal { P } ^ { \star } | | \boldsymbol { \mathcal { Q } } ) , \boldsymbol { \sigma } ) + L _ { h } ( \mathcal { D } _ { K L } ( \mathcal { Q } ^ { \star } | | \mathcal { P } ) , \boldsymbol { \sigma } )
79
+ $$
80
+
81
+ $$
82
+ L _ { h } ( e , \sigma ) = m a x ( 0 , \sigma - e )
83
+ $$
84
+
85
+ Given a pair of data with similarity prediction function $G ( x _ { p } , x _ { q } ) \in \{ 0 , 1 \}$ , which is introduced in section 3, the total loss can be defined as a contrastive loss (where we use integer 1 to represent a similar pair):
86
+
87
+ $$
88
+ \mathcal { L } ( x _ { p } , x _ { q } ) = G ( x _ { p } , x _ { q } ) \mathcal { L } ( x _ { p } , x _ { q } ) ^ { + } + ( 1 - G ( x _ { p } , x _ { q } ) ) \mathcal { L } ( x _ { p } , x _ { q } ) ^ { - }
89
+ $$
90
+
91
+ We refer to equation 5 as LCO. Function $G$ is the learnable part that utilizes prior knowledge and is trained with auxiliary dataset $A$ before optimizing LCO. Two particular characteristics of the clustering criterion are worth mentioning: (1) There is no need to define cluster centers. (2) There is no predefined metric applied on the feature representation. Instead, the divergence is calculated directly on the cluster assignment; therefore, both feature representation and clustering are jointly optimized using back-propagation through the deep neural networks.
92
+
93
+ # 4.1 THE PAIRWISE SIMILARITY PREDICTION NETWORK
94
+
95
+ Although there is no restriction of how $G$ should be constructed, we choose deep convolution neural networks due to their efficiency in vision tasks. We design a network architecture inspired from Zagoruyko & Komodakis (2015). While they use it to predict image patch similarity, we use it to predict image-level semantic similarity. However, the Siamese architecture used in Zagoruyko & Komodakis (2015) is not efficient in both training and inference, especially when pairwise information is dense. Therefore, instead of using Siamese architecture, we keep the single column backbone but add a pair-enumeration layer on top of the feature extraction network. The pair-enumeration layer enumerates all pairs of feature vectors within a mini-batch and concatenates the features. Suppose the input of the layer is $1 0 \times 5 1 2$ with the mini-batch size 10 and the feature dimension 512; then the output of the pair-enumeration layer will be $1 0 0 \times 1 0 2 4$ (self-pairs included).
96
+
97
+ The architecture is illustrated in figure 3. We add one hidden fully connected layer on top of the enumeration layer and a binary classifier at the end. We use the standard cross-entropy loss and train it end-to-end. The supervision for training was obtained by converting the ground-truth category labels into binary similarity, i.e., if two samples are from the same class then their label will be similar, otherwise dissimilar. The inference is also end-to-end, and it outputs predictions among all similarity pairs in a mini-batch. The output probability $g \in [ 0 , 1 ]$ with 1 means more similar. We binarize $g$ at 0.5 to obtain discrete similarity predictions. In the following sections, we simplified the notation of the pairwise similarity prediction network as $G$ . Once $G$ is learned, it then works as a static function in our experiments.
98
+
99
+ # 4.2 THE OBJECTIVE FUNCTION WITH DENSE SIMILARITY PREDICTION
100
+
101
+ Since the pairwise prediction of a mini-batch can be densely obtained from $G$ , to efficiently utilize the pair-wise information without forwarding each data multiple times we also combine the pairenumeration layer described in section 4.1 with equation 5. In this case, the outputs of softmax are
102
+
103
+ ![](images/6ee14a32f3d38107f344e558ad27ba8aa4c6dd2a6632d85ddac1a4bb2284c5fa.jpg)
104
+ Figure 4: The constrained clustering network (CCN) for transfer learning across tasks. The input is unlabeled target data $T$ . The cluster assignment block contains two fully connected layers and has the number of output nodes equal to $k$ . The $f$ described in section 4 is the backbone network plus the cluster assignment block. To optimize LCO, the full pipeline in the diagram is used. After the optimization, it uses another forward propagation with only $f$ to obtain the final cluster assignment.
105
+
106
+ ![](images/480735bbbbbc31b0524612dd6b214d318a05c8bfdb6bc3ec5a4e395d164bbae6.jpg)
107
+ Figure 5: The network for transfer learning across domains. The input is the mix of $S ^ { \prime }$ and $T$ . The architecture is a direct extension of CCN. We use $\mathrm { C C N ^ { + } }$ to represent the mandatory parts (upper branch) which implements eq. (7). $\mathrm { C C N ^ { + + } }$ includes the domain adaptation method (optional branch).
108
+
109
+ enumerated in pairs. Let $D$ be the set of all tuples $( p , q )$ , while $p$ and $q$ are the indices of a sample in a mini-batch. The dense clustering loss $\mathcal { L } _ { d }$ for a mini-batch is calculated by:
110
+
111
+ $$
112
+ \mathcal { L } _ { d } = \sum _ { \forall ( p , q ) \in D } \mathcal { L } ( x _ { p } , x _ { q } ) .
113
+ $$
114
+
115
+ We use $\mathcal { L } _ { d }$ standalone with deep neural networks to reconstruct semantic clusters and for transfer learning across tasks (figure 4). We call the architecture the constrained clustering network (CCN).
116
+
117
+ # 4.3 COMBINING WITH OTHER OBJECTIVES
118
+
119
+ In the cross-domain case, we additionally have labeled source data. This enables us to use LCO for $T$ while using classification loss for $S ^ { \prime }$ . The overall training procedure is similar to previous domain adaptation approaches in that both source and target data are mixed in a mini-batch, but different losses are applied. We denote the source domain images in a mini-batch $b$ as $X _ { b ^ { S } }$ and the target domain images $X _ { b ^ { T } }$ with its set of dense pairs $D _ { b ^ { T } }$ . The loss function $\mathcal { L } _ { c d }$ for cross-domain transfer in a mini-batch can then be formulated as:
120
+
121
+ $$
122
+ \mathcal { L } _ { c d } = \mathcal { L } _ { c l s } + \mathcal { L } _ { c l u s t e r }
123
+ $$
124
+
125
+ $$
126
+ \mathcal { L } _ { c l s } = \frac { 1 } { | b ^ { S } | } \sum _ { \forall x _ { i } \in X _ { b } s } C r o s s E n t r o p y L o s s ( f ( x _ { i } ) ) .
127
+ $$
128
+
129
+ $$
130
+ \mathcal { L } _ { c l u s t e r } = \frac { 1 } { | b ^ { T } | ^ { 2 } } \sum _ { \forall ( i , j ) \in D _ { b ^ { T } } } \mathcal { L } ( x _ { i } , x _ { j } ) .
131
+ $$
132
+
133
+ The $\mathcal { L } _ { c l u s t e r }$ and $\mathcal { L } _ { c l s }$ share the same outputs from network $f$ . Although $\mathcal { L } _ { c l u s t e r }$ does not force the mapping between clusters and categories, $\mathcal { L } _ { c l s }$ does. Therefore the learned classifier can be applied on target data directly and picks the maximum probability for the predicted class. Note that in our loss function, there is no term to explicitly match the feature distribution between source and target; it merely transfers more knowledge in the form of constraints to regularize the learning of the classifier. There is also no requirement for the architecture to utilize hidden layers. Therefore our approach has the large flexibility to be combined with other domain adaptation strategies. Figure 5 illustrates the architectures $\mathrm { C C N ^ { + } }$ and $\mathrm { C C N ^ { + + } }$ used in our cross-domain experiments.
134
+
135
+ # 5 EXPERIMENTS
136
+
137
+ This section contains evaluations with four image datasets and covers both cross-task and crossdomain schemes. The details are described below, and the differences between experimental settings are illustrated in appendix A.
138
+
139
+ # 5.1 UNSUPERVISED CROSS-TASK TRANSFER LEARNING
140
+
141
+ # 5.1.1 SETUP
142
+
143
+ The Omniglot dataset (Lake et al., 2015) contains 1623 different handwritten characters and each of them has 20 images drawn by different people. The characters are from 50 different alphabets and were separated to 30 background sets $O m n i g l o t _ { b g }$ and 20 evaluation sets $O m n i g l o t _ { e v a l }$ by the author. We use the $O m n i g l o t _ { b g }$ as the auxiliary dataset $( A )$ and the $O m n i g l o t _ { e v a l }$ as the target data $( T )$ . The total number of characters in $O m n g l o t _ { b g }$ is 964, which can be regarded as the number of categories available to learn the semantic similarity. The goal is to cluster Omniglot $_ { e v a l }$ to reconstruct its semantic categories, without ever having any labels.
144
+
145
+ The $G$ function has a backbone neural network with four $3 \mathrm { x } 3$ convolution layers followed by $2 \mathbf { x } 2$ max-pooling with stride 2. All hidden layers are followed by batch normalization (Ioffe & Szegedy, 2015) and rectified linear unit. To prepare the inputs for training, the images from $O m n i g l o t _ { b g }$ were resized to $3 2 \mathrm { x } 3 2$ and normalized to zero mean with unit standard deviation. Each mini-batch has a size of 100 and is sampled from a random 20 characters to make sure the amount of similar pairs is reasonable. After pair enumeration, there are 10000 pairs subject to the loss function, which is a two-class cross entropy loss. The ground-truth similarity is obtained by converting the categorical labels. The loss of $G$ is optimized by stochastic gradient descent and is the only part trained in a supervised manner in this section.
146
+
147
+ The Constrained Clustering Network (CCN) is used to reconstruct the semantic clusters in the target dataset using outputs from $G$ . The network has four 3x3 convolution layers followed by $2 \mathbf { x } 2$ max-pooling with stride 2, one hidden fully-connected layer, and one cluster assignment layer which is also fully connected. The number of output nodes in the last layer is equal to the number of potential clusters in the target data. The output distribution is enumerated in pairs before sending to LCO. The network is randomly initialized, trained end-to-end, and optimized by stochastic gradient descent with randomly sampled 100 images per mini-batch. Note the $G$ function used by LCO is fixed during the optimization. The input data preparation is the same as above, except now the data is from $O m n i g l o t _ { e v a l }$ . Specifically, during the training, the same mini-batch is given to both $G$ and CCN. The dense pairwise similarity predictions from $G$ are sent to LCO and are then fully utilized. The only hyper-parameter in LCO is $\sigma$ , and we set it to 2 for all our experiments.
148
+
149
+ Omniglot $e v a l$ contains 20 alphabets and each one can be used as a standalone dataset. The 20 target datasets contain a varied number (20 to 47) of characters. Therefore we can evaluate the reconstruction performance under a varied number of ground-truth clusters. We tested the situations when the number of character $( K )$ in an alphabet is known and unknown. When $K$ is known, we set the target number of clusters in the clustering algorithm equal to the true number of characters. If $K$ is unknown, the common practice is to set it to a large number so that the data from different categories will not be forced to be in the same cluster. In the experiment, we merely set $K$ to 100, which is much larger than the largest dataset (47).
150
+
151
+ All constrained clustering algorithms can be used to reconstruct the semantic clusters for our problem. Since there are mis-predictions in $G$ , robustness to noise is the most important factor. Here we include all four types of constrained clustering algorithms introduced in section 2 as the baselines. We provide the full set of pairwise constraints to all algorithms including ours. In other words, given an alphabet of 20 characters, it contains 400 images and 160000 predicted similarities from $G$ (note that $G$ makes predictions for both orders of a pair and for self-pairs). The full pairwise similarities were presented to all algorithms in random order, while we empirically found it has no noticeable effect on results. We pick the baseline approaches based on code availability and scalability concerning the number of pairwise constraints. Therefore we have shown results for K-means (MacQueen et al., 1967), LPNMF (Cai et al., 2009), LSC (Chen & Cai, 2011), ITML (Davis et al., 2007), SKKm (Anand et al., 2014), SKLR (Amid et al., 2016), SKMS (Anand et al., 2014), CSP (Wang et al., 2014) , and MPCK-means (Bilenko et al., 2004) as our baselines. We use the default parameters for each algorithm provided by the original author except for $K$ , the number of clusters. We use the same normalized images used in CCN for all algorithms.
152
+
153
+ Table 1: Unsupervised cross-task transfer from Omniglot $b g$ to $O m n i g l o t _ { e v a l }$ . The performance is averaged across 20 alphabets which have 20 to 47 letters. The ACC and NMI without brackets have the number of clusters equal to ground-truth. The "(100)" means the algorithms use $K = 1 0 0$ . The characteristics of how each algorithm utilizes the pairwise constraints are marked in the "Constraints in" column, where metric stands for the metric learning of feature representation.
154
+
155
+ <table><tr><td rowspan="2">Method</td><td colspan="2">Constraints in</td><td rowspan="2">ACC</td><td rowspan="2">ACC (100)</td><td rowspan="2">NMI</td><td rowspan="2">NMI (100)</td></tr><tr><td>Metric</td><td>Clustering</td></tr><tr><td>K-means</td><td></td><td></td><td>21.7%</td><td>18.9%</td><td>0.353</td><td>0.464</td></tr><tr><td>LPNMF</td><td></td><td></td><td>22.2%</td><td>16.3%</td><td>0.372</td><td>0.498</td></tr><tr><td>LSC</td><td></td><td></td><td>23.6%</td><td>18.0%</td><td>0.376</td><td>0.500</td></tr><tr><td>ITML</td><td>0</td><td></td><td>56.7%</td><td>47.2%</td><td>0.674</td><td>0.727</td></tr><tr><td>SKMS</td><td>0</td><td></td><td>=</td><td>45.5%</td><td>1</td><td>0.693</td></tr><tr><td>SKKm</td><td>0</td><td></td><td>62.4%</td><td>46.9%</td><td>0.770</td><td>0.781</td></tr><tr><td>SKLR</td><td>0</td><td></td><td>66.9%</td><td>46.8%</td><td>0.791</td><td>0.760</td></tr><tr><td>CSP</td><td></td><td>0</td><td>62.5%</td><td>65.4%</td><td>0.812</td><td>0.812</td></tr><tr><td>MPCK-means</td><td>0</td><td>0</td><td>81.9%</td><td>53.9%</td><td>0.871</td><td>0.816</td></tr><tr><td>CCN (Ours)</td><td>0</td><td>0</td><td>82.4%</td><td>78.1%</td><td>0.889</td><td>0.874</td></tr></table>
156
+
157
+ The evaluation uses two clustering metrics. The first is normalized-mutual information (NMI) (Strehl & Ghosh, 2002) which is widely used for clustering. The second one is the clustering accuracy (ACC) (Yang et al., 2010). The ACC metric first finds the one-to-one matching between predicted clusters and ground-truth labels, and then calculates the classification accuracy based on the mapping. All data outside the matched clusters will be regarded as mis-predictions. To get high ACC, the algorithm has to generate coherent clusters where each cluster includes most of the data in a category; otherwise the score drops quickly. Therefore ACC provides better discrimination to evaluate whether the semantic clusters have been reconstructed well.
158
+
159
+ # 5.1.2 RESULTS AND DISCUSSIONS
160
+
161
+ We report the average performance over the 20 alphabets in table 1. Our approach achieved the top performance on both metrics. The CCN demonstrates strong robustness on the challenging scenario of unknown $K$ . It achieved $7 8 . 1 \%$ average accuracy. Compared with $8 2 . 4 \%$ when $K$ is known, CCN has a relatively small drop. Compared to the second best algorithm, CSP, which is $6 5 . 4 \%$ , CCN outperforms it with a large gap. The classical approach MPCK-means works surprisingly well when the number of clusters is known, but its performance dropped dramatically from $8 1 . 9 \%$ to $5 3 . 9 \%$ when $K = 1 0 0$ . In the performance breakdown for the 20 individual alphabets, CCN achieved $94 \%$ clustering accuracy on Old Church Slavonic Cyrillic, which has 45 characters (appendix table 5). Therefore the results show the feasibility of reconstructing semantic clusters using only noisy similarity predictions.
162
+
163
+ When to use the semantic similarity? The experiments in table 1 show a clear trend that utilizing the pairwise constraints jointly for both metric learning and minimizing the clustering loss achieves the best performance, including both MPCK-means and CCN. In the case of unknown number of clusters, where we set $K = 1 0 0$ , the algorithms that use constraints to optimize clustering loss have better robustness, for example, CSP and CCN. The group that only use constraints for metric learning (ITML, SKMS, SKKm, and SKLR) significantly outperform the group that does not use it (K-means, LPNMF, LSC). However, their performance are still far behind CCN. Our results confirm the importance of jointly optimizing the metric and clustering.
164
+
165
+ The robustness against noisy similarity prediction is the key factor to enable the cross-task transfer framework. To the best of our knowledge, table 1 is the first comprehensive robustness comparisons using predicted constraints learned from real data instead of converting from ground-truth labels. The accuracy of $G$ in our experiment is shown in appendix table 7 and demonstrates the reasonable performance of $G$ which is on par with Matching-Net (Vinyals et al., 2016). After binarizing the prediction at 0.5 probability, the similar pair precision, similar pair recall, dissimilar pair precision, and dissimilar pair recall among the 659 characters are (0.392, 0.927, 0.999, 0.995), accordingly. The binarized predictions are better than uniform random guess (0.002, 0.500, 0.998, 0.500), but are still noisy. Therefore it is very challenging for constrained clustering. The visualization of the robustness range of CCN are provided in appendix D, and shows that the robustness is related to the density of pairs involved in a mini-batch. We hypothesize that during the optimization, the gradients from wrongly predicted pairs are canceled out by each other or by the correctly predicted pairs. Therefore the overall gradient still moves the solution towards a better clustering result.
166
+
167
+ How to predict $K ?$ Inferring the number of clusters $( N C )$ is a hard problem, but with the pairwise similarity information, it becomes feasible. For evaluation, we compute the difference between the number of dominant clusters $( N D C )$ and the true number of categories $( N C ^ { g t } )$ in a dataset. We use a naive definition for $N D C$ , which is the number of clusters that have a size larger than expected size when data is sampled uniformly. In other words, $\begin{array} { r } { N D C = \sum _ { i = 1 } ^ { K } \left[ C _ { i } > = \bar { E } [ C _ { i } ] \right] } \end{array}$ where $[ \cdot ]$ is an Iverson Bracket and $C _ { i }$ is the size of cluster $i$ . For example, $\bar { E } [ \bar { C } _ { i } ]$ will be 10 if the alphabet has 1000 images and $K = 1 0 0$ . Then the average difference $( A D i f )$ is calculated by $\begin{array} { r } { A D i f = \frac { 1 } { | D | } \sum _ { d \in D } { | N D C _ { d } - N C _ { d } ^ { g t } | } } \end{array}$ , where $d$ (i.e., alphabet) is a dataset in $D$ . A smaller $A D i f$ indicates a better estimate of $K$ . CCN achieves a score of 6.35 (appendix table 6). We compare this with the baseline approach SKMS (Anand et al., 2014), which does not require a given $K$ and supports a pipeline to estimate $K$ automatically (therefore we only put it into the column $K = 1 0 0$ in table 1.). SKMS gets 16.3. Furthermore, 10 out of 20 datasets from CCN’s prediction have a difference between $N D C _ { d }$ and $N C _ { d } ^ { g t }$ smaller or equal to 3, which shows the feasibility of estimating $K$ with predicted similarity.
168
+
169
+ # 5.1.3 EXPERIMENTS USING THE IMAGENET DATASET
170
+
171
+ To demonstrate the scalability of our approach, we applied the same scheme on the ImageNet dataset. The 1000-class dataset is separated into 882-class (ImageNet882) and 118-class (ImageNet118) subsets as the random split in Vinyals et al. (2016). We use ImageN et882 for $A$ and 30 classes $\mathrm { \sim } 3 9 \mathrm { k }$ images) are randomly sampled from $I m a g e N e t _ { 1 1 8 }$ for $T$ . The difference from section 5.1.1 is that here we use Resnet-18 for both $G$ and CCN, and the weights of the backbone are pre-trained with ImageN et882. Since the number of pairs is high and it is not feasible to feed them into other constrained clustering algorithms, we compare CCN with K-means, LSC(Chen & Cai, 2011), and LPNMF (Cai et al., 2009). We use the output from the average pooling layer of Resnet-18 as the input to these clustering algorithms. CCN gives the top performance with average ACC $7 3 . 8 \%$ when $K$ is known, and $6 5 . 2 \%$ when the number of clusters is unknown, which outperforms the second $( 3 4 . 5 \%$ by K-means) with a large margin. The full comparison is in appendix table 8. And the performance of $G$ is provided in appendix table 9.
172
+
173
+ # 5.2 UNSUPERVISED CROSS-DOMAIN TRANSFER LEARNING
174
+
175
+ # 5.2.1 SETUP
176
+
177
+ Office-31 (Saenko et al., 2010) has images from 31 categories of office objects. The 4652 images are obtained from three domains: Amazon $( a )$ , DSLR $( d )$ , and Webcam $( w )$ . The dataset is the standard benchmark for evaluating domain adaptation performance in computer vision. We experiment with all six combinations (source $S ^ { \prime } \to \mathrm { t a r g e t } T$ ): $a w$ , $a \to d$ , $d \to a$ , $d \to w$ , $w a$ , $w \to d$ , and report the average accuracy based on five random experiments for each setting.
178
+
179
+ The $G$ function learns the semantic similarity function from the auxiliary dataset $A$ , which is ImageNet with all 1000 categories. The backbone network of $G$ is Resnet-18 and has the weights initialized by ImageNet classification. The training process is the same as section 5.1.1 except the images are resized to 224.
180
+
181
+ We follow the standard protocols using deep neural networks (Long et al., 2017; Ganin et al., 2016) for unsupervised domain adaptation. The backbone network of $\mathrm { C C N ^ { + } }$ is pre-trained with ImageNet. Appendix figure 7 illustrates the scheme. During the training, all source data and target data are used. Each mini-batch is constructed by 32 labeled samples from source and 96 unlabeled samples from target. Since the target dataset has no labels and could only be randomly sampled, it is crucial to have sufficient mini-batch size to ensure that similar pairs are sampled. The loss function used in our approach is equation (7) and is optimized by stochastic gradient descent. The $\mathrm { C C N ^ { + / + + } }$ and DANN (RevGrad) with ResNet backbone are implemented with Torch. We use the code from original author for JAN. Both DANN and JAN use a 256-dimension bottleneck feature layer.
182
+
183
+ Table 2: Unsupervised cross-domain transfer (domain adaptation) on the Office-31 dataset. The backbone network used here is Resnet-18 (He et al., 2016) pre-trained with ImageNet.
184
+
185
+ <table><tr><td></td><td>A→W</td><td>D→W</td><td>W→D</td><td>A→D</td><td>D→A</td><td>W→A</td><td>Avg</td></tr><tr><td>Source-Only</td><td>66.8</td><td>92.8</td><td>96.8</td><td>67.1</td><td>51.4</td><td>53.0</td><td>71.3</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td>73.2</td><td>97.0</td><td>99.0</td><td>69.3</td><td>58.0</td><td>57.8</td><td>75.7</td></tr><tr><td>JAN (Long et al., 2017)</td><td>74.5</td><td>94.1</td><td>99.6</td><td>75.9</td><td>58.7</td><td>59.0</td><td>76.9</td></tr><tr><td>CCN+ (ours)</td><td>76.7</td><td>97.3</td><td>98.2</td><td>71.2</td><td>61.0</td><td>60.5</td><td>77.5</td></tr><tr><td>CCN++ (with DANN)</td><td>78.2</td><td>97.4</td><td>98.6</td><td>73.5</td><td>62.8</td><td>60.6</td><td>78.5</td></tr></table>
186
+
187
+ # 5.2.2 RESULTS AND DISCUSSIONS
188
+
189
+ The results are summarized in table 2. Our approach $\mathrm { ( C C N ^ { + } ) }$ demonstrates a strong performance boost for the unsupervised cross-domain transfer problem. It reaches $7 7 . 5 \%$ average accuracy which gained 6.2 points from the $7 1 . 3 \%$ source-only baseline. Although our approach merely transfers more information from the auxiliary dataset, it outperforms the strong approach DANN $( 7 5 . 7 \% )$ , and state-of-the-art JAN $( 7 6 . 9 \% )$ . When combining ours with DANN $\mathrm { ( C C N ^ { + + } ) }$ , the performance is further boosted. This indicates that LCO helps mitigate the transfer problem in a certain way that is orthogonal to minimizing the domain discrepancy. We observe the same trend when using a deeper backbone network, i.e., ResNet-34. In such a case the average accuracy achieved is $7 7 . 9 \%$ , $8 1 . 1 \%$ and $82 \%$ for source-only, $\mathrm { C C N ^ { + } }$ and $\mathrm { C C N ^ { + + } }$ , respectively, though we used exactly the same $G$ as before (with ResNet-18 backbone for $G$ ). This indicates that the information carried in the similarity predictions is not equivalent to transferring features with deeper networks. More discussions are in appendix C and the performance of $G$ is provided in appendix table 11 to show that although the prediction has low precision for similar pairs $( \sim 0 . 2 )$ , our approach still benefits from the dense similarity predictions.
190
+
191
+ # 5.2.3 EXPERIMENTS USING SVHN-TO-MNIST
192
+
193
+ We also evaluated the $\mathrm { C C N ^ { + } }$ on another widely compared scenario, which uses color Street View House Numbers images (SVHN) (Netzer et al., 2011) as $S ^ { \prime }$ , the gray-scale hand-written digits (MNIST) (LeCun, 1998) as $T$ . To learn $G$ , we use the $O m n g l o t _ { b g }$ as $A$ . We train all the networks in this section from scratch. Our experimental setting is similar to Sener et al. (2016). We achieve the top performance with $8 9 . 1 \%$ accuracy. The performance gain from source-only in our approach is $+ 3 7 . 1 \%$ , which wins by a large margin compared to the $+ 2 3 . 9 \%$ of LTR (Sener et al., 2016). The full comparison is presented in appendix table 12.
194
+
195
+ # 6 CONCLUSION AND OUTLOOK
196
+
197
+ In this paper, we demonstrated the usefulness of transferring information in the form of pairwise similarity predictions. Such information can be transferred as a function and utilized by a loss formulation inspired from constrained clustering, but implemented more robustly within a neural network that can jointly optimize both features and clustering outputs based on these noisy predictions. The experiments for both cross-task and cross-domain transfer learning show strong benefits of using the semantic similarity predictions resulting in new state of the art results across several datasets. This is true even without explicit domain adaptation for the cross-domain task, and if we add a domain discrepancy loss the benefits increase further.
198
+
199
+ There are two key factors that determine the performance of the proposed framework. The first is the robustness of the constrained clustering and second is the performance of the similarity prediction function. We show robustness of CCN empirically, but we do not explore situations where learning the similarity function is harder. For example, such cases arise when there are a small number of categories in source or a large domain discrepancy between source and target. One idea to deal with such a situation is learning G with domain adaptation strategies. We leave these aspects for future work.
200
+
201
+ # ACKNOWLEDGMENTS
202
+
203
+ This work was supported by the National Science Foundation and National Robotics Initiative (grant # IIS-1426998).
204
+
205
+ # REFERENCES
206
+
207
+ Ehsan Amid, Aristides Gionis, and Antti Ukkonen. Semi-supervised kernel metric learning using relative comparisons. arXiv preprint arXiv:1612.00086, 2016.
208
+
209
+ Saket Anand, Sushil Mittal, Oncel Tuzel, and Peter Meer. Semi-supervised kernel mean shift clustering. IEEE transactions on pattern analysis and machine intelligence, 36(6):1201–1215, 2014.
210
+
211
+ Violaine Antoine, Benjamin Quost, M-H Masson, and Thierry Denoeux. Cecm: Constrained evidential c-means algorithm. Computational Statistics & Data Analysis, 56(4):894–914, 2012.
212
+
213
+ Mikhail Bilenko, Sugato Basu, and Raymond J Mooney. Integrating constraints and metric learning in semi-supervised clustering. In Proceedings of the twenty-first international conference on Machine learning, pp. 11. ACM, 2004.
214
+
215
+ Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
216
+
217
+ Deng Cai, Xiaofei He, Xuanhui Wang, Hujun Bao, and Jiawei Han. Locality preserving nonnegative matrix factorization. In IJCAI, volume 9, pp. 1010–1015, 2009.
218
+
219
+ Fabio Maria Carlucci, Lorenzo Porzi, Barbara Caputo, Elisa Ricci, and Samuel Rota Bulò. Autodial: Automatic domain alignment layers. In International Conference on Computer Vision, 2017.
220
+
221
+ Xinlei Chen and Deng Cai. Large scale spectral clustering with landmark-based representation. In AAAI, volume 5, pp. 14, 2011.
222
+
223
+ Wenyuan Dai, Yuqiang Chen, Gui rong Xue, Qiang Yang, and Yong Yu. Translated learning: Transfer learning across different feature spaces. In Advances in Neural Information Processing Systems 21. 2009.
224
+
225
+ Ian Davidson and Sugato Basu. A survey of clustering with instance level. Constraints, 1:2, 2007.
226
+
227
+ Jason V Davis, Brian Kulis, Prateek Jain, Suvrit Sra, and Inderjit S Dhillon. Information-theoretic metric learning. In Proceedings of the 24th international conference on Machine learning, pp. 209–216. ACM, 2007.
228
+
229
+ Derya Dinler and Mustafa Kemal Tural. A survey of constrained clustering. In Unsupervised Learning Algorithms, pp. 207–235. Springer, 2016.
230
+
231
+ Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In Icml, volume 32, pp. 647–655, 2014.
232
+
233
+ Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(59):1–35, 2016.
234
+
235
+ Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Computer Vision and Pattern Recognition, 2014.
236
+
237
+ 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.
238
+
239
+ Yen-Chang Hsu and Zsolt Kira. Neural network-based clustering using pairwise constraints. ICLR workshop, 2016.
240
+
241
+ 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.
242
+
243
+ Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, 2015.
244
+
245
+ Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
246
+
247
+ Yann LeCun. The mnist database of handwritten digits. 1998.
248
+
249
+ 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, 2015a.
250
+
251
+ Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 97–105, 2015b.
252
+
253
+ Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. In Advances in Neural Information Processing Systems, 2016.
254
+
255
+ Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I. Jordan. Deep transfer learning with joint adaptation networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 2208–2217, 2017.
256
+
257
+ James MacQueen et al. Some methods for classification and analysis of multivariate observations. In Proceedings of the fifth Berkeley symposium on mathematical statistics and probability, volume 1, pp. 281–297. Oakland, CA, USA., 1967.
258
+
259
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
260
+
261
+ Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Trans. on Knowl. and Data Eng., 22(10):1345–1359, October 2010. ISSN 1041-4347. doi: 10.1109/TKDE.2009.191. URL http://dx.doi.org/10.1109/TKDE.2009.191.
262
+
263
+ Syama Sundar Rangapuram and Matthias Hein. Constrained 1-spectral clustering. In AISTATS, volume 30, pp. 90, 2012.
264
+
265
+ 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.
266
+
267
+ Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting Visual Category Models to New Domains, pp. 213–226. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010.
268
+
269
+ Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 2988–2997, 2017.
270
+
271
+ Ozan Sener, Hyun Oh Song, Ashutosh Saxena, and Silvio Savarese. Learning transferrable representations for unsupervised domain adaptation. In Advances in Neural Information Processing Systems, pp. 2110–2118, 2016.
272
+
273
+ Alexander Strehl and Joydeep Ghosh. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. Journal of machine learning research, 3(Dec):583–617, 2002.
274
+
275
+ Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. In AAAI, 2016.
276
+
277
+ Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014.
278
+
279
+ Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Adversarial discriminative domain adaptation. In Computer Vision and Pattern Recognition (CVPR), 2017.
280
+
281
+ Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3156–3164, 2015.
282
+
283
+ Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. 2016.
284
+
285
+ Xiang Wang, Buyue Qian, and Ian Davidson. On constrained spectral clustering and its applications. Data Mining and Knowledge Discovery, pp. 1–30, 2014.
286
+
287
+ Eric P Xing, Michael I Jordan, Stuart J Russell, and Andrew Y Ng. Distance metric learning with application to clustering with side-information. In Advances in neural information processing systems, pp. 521–528, 2003.
288
+
289
+ Yi Yang, Dong Xu, Feiping Nie, Shuicheng Yan, and Yueting Zhuang. Image clustering using local discriminant models and global integration. IEEE Transactions on Image Processing, 19(10): 2761–2773, 2010.
290
+
291
+ Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? 2014.
292
+
293
+ Sergey Zagoruyko and Nikos Komodakis. Learning to compare image patches via convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4353–4361, 2015.
294
+
295
+ Werner Zellinger, Thomas Grubinger, Edwin Lughofer, Thomas Natschläger, and Susanne SamingerPlatz. Central moment discrepancy (cmd) for domain-invariant representation learning. ICLR, 2017.
296
+
297
+ # APPENDICES
298
+
299
+ # A COMPARISON OF EXPERIMENTAL SETTINGS
300
+
301
+ Table 3: The list of datasets involved in each experiment. $G$ learns the similarity function from dataset A. The $\mathbf { C C N } ^ { * }$ is optimized with dataset T or T∪S’, while $\mathbf { C C N } ^ { * }$ means CCN for cross-task transfer and $\mathrm { C C N ^ { + / + + } }$ for cross-domain transfer. The rows for network initialization indicate whether the network has weights initialized by training a classification task with the specified dataset. The weights are randomly initialized if not specified.
302
+
303
+ <table><tr><td colspan="2">Scheme</td><td colspan="2">Cross-Task Transfer</td><td colspan="2">Cross-Domain Transfer</td></tr><tr><td colspan="2">Experiment Section</td><td>Omniglot 5.1.1</td><td>ImageNet 5.1.3</td><td>Office-31 5.2.1</td><td>SVHN-MNIST 5.2.3</td></tr><tr><td rowspan="3">Datasets</td><td>A</td><td>Omniglotbg</td><td>ImageNet882</td><td>ImageNet1000</td><td>Omniglotbg</td></tr><tr><td>S’</td><td></td><td></td><td>Office-31 {a,d,w}</td><td>SVHN</td></tr><tr><td>T</td><td>Omnigloteval</td><td>ImageNet118</td><td>Office-31 {a,d,w)</td><td>MNIST</td></tr><tr><td rowspan="2">Network Initialization</td><td>G</td><td></td><td>ImageNet882</td><td>ImageNet1000</td><td>1</td></tr><tr><td>CCN*</td><td></td><td>ImageNet882</td><td>ImageNet1000</td><td>1</td></tr></table>
304
+
305
+ Table 4: The list of loss functions used for training networks. The similarity prediction function (network) $G$ uses the cross-entropy (CE) loss with two classes (similar/dissimilar). The training of constrained clustering network $( \mathbf { C C N } ^ { * } )$ involves the combinations of the learnable clustering objective (LCO), cross-entropy, and domain adaptation loss (DA).
306
+
307
+ <table><tr><td></td><td>LCO</td><td>CE</td><td>DA</td></tr><tr><td>G</td><td></td><td>√</td><td></td></tr><tr><td>CCN</td><td></td><td></td><td></td></tr><tr><td>CCN+</td><td>广</td><td>√</td><td></td></tr><tr><td>CCN++</td><td>√</td><td></td><td>√</td></tr></table>
308
+
309
+ ![](images/6077c2618b017816b79d4cf6b62b30b24d7ebf9ecfe529286747a494f9f155c8.jpg)
310
+ Figure 6: A diagram depicting the cross-task transfer experiment. Two experiments follow this flow: Omniglot $b g$ to $O m n i g l o t _ { e v a l }$ , and $I m a g e N e t _ { 8 8 2 }$ to ImageNet118. Both have exclusive classes between source and target domain. In the ImageNet experiment, the backbone network is initialized with the weights pre-trained with ImageN et882.
311
+
312
+ ![](images/62fef6aa1814051042be0542b4068cc2863de90390604a41a4bf68f744e5059c.jpg)
313
+ Figure 7: Comparison between domain adaptation approaches (a) Transferring semantic similarity from auxiliary data (our method), and (b) Minimizing the domain discrepancy. The diagram uses office-31 benchmark as the scenario of transferring.
314
+
315
+ # B SUPPLEMENTARY FOR UNSUPERVISED CROSS TASK TRANSFER LEARNING
316
+
317
+ Table 5: A breakdown of the results for each alphabet in Omnigloteval. The unsupervised cross task transfer experiment is described in section 5.1. This table shows the clustering accuracy with $K = 1 0 0$ to simulate the situation of unknown number of clusters.
318
+
319
+ <table><tr><td>Alphabet</td><td>K-means</td><td>LPNMF</td><td>LSC</td><td>ITML</td><td>SKMS</td><td>SKKm</td><td>SKLR</td><td>CSP</td><td>MPCK-means</td><td>CCN</td></tr><tr><td>Angelic</td><td>24%</td><td>26%</td><td>27%</td><td>48%</td><td>78%</td><td>40%</td><td>38%</td><td>72%</td><td>50%</td><td>82%</td></tr><tr><td>Atemayar_Qelisayer</td><td>19%</td><td>14%</td><td>17%</td><td>51%</td><td>61%</td><td>51%</td><td>44%</td><td>61%</td><td>50%</td><td>82%</td></tr><tr><td>Atlantean</td><td>19%</td><td>15%</td><td>19%</td><td>57%</td><td>72%</td><td>55%</td><td>51%</td><td>77%</td><td>47%</td><td>72%</td></tr><tr><td>Aurek_Besh</td><td>23%</td><td>18%</td><td>21%</td><td>45%</td><td>49%</td><td>44%</td><td>45%</td><td>76%</td><td>71%</td><td>90%</td></tr><tr><td>Avesta</td><td>22%</td><td>18%</td><td>19%</td><td>47%</td><td>29%</td><td>39%</td><td>38%</td><td>65%</td><td>52%</td><td>76%</td></tr><tr><td>Ge_ez</td><td>19%</td><td>17%</td><td>17%</td><td>56%</td><td>58%</td><td>47%</td><td>42%</td><td>72%</td><td>55%</td><td>82%</td></tr><tr><td>Glagolitic</td><td>22%</td><td>19%</td><td>21%</td><td>42%</td><td>38%</td><td>58%</td><td>62%</td><td>66%</td><td>61%</td><td>85%</td></tr><tr><td>Gurmukhi</td><td>15%</td><td>13%</td><td>15%</td><td>44%</td><td>26%</td><td>54%</td><td>48%</td><td>60%</td><td>56%</td><td>80%</td></tr><tr><td>Kannada</td><td>18%</td><td>14%</td><td>16%</td><td>48%</td><td>37%</td><td>46%</td><td>53%</td><td>60%</td><td>48%</td><td>62%</td></tr><tr><td>Keble</td><td>20%</td><td>14%</td><td>18%</td><td>44%</td><td>60%</td><td>46%</td><td>44%</td><td>75%</td><td>68%</td><td>90%</td></tr><tr><td>Malayalam</td><td>18%</td><td>15%</td><td>16%</td><td>36%</td><td>24%</td><td>49%</td><td>52%</td><td>50%</td><td>54%</td><td>72%</td></tr><tr><td>Manipuri</td><td>17%</td><td>15%</td><td>16%</td><td>49%</td><td>40%</td><td>53%</td><td>54%</td><td>66%</td><td>62%</td><td>85%</td></tr><tr><td>Mongolian</td><td>18%</td><td>18%</td><td>19%</td><td>50%</td><td>40%</td><td>37%</td><td>48%</td><td>75%</td><td>57%</td><td>86%</td></tr><tr><td>Old_Church_Slavonic_Cyrilic</td><td>19%</td><td>16%</td><td>19%</td><td>42%</td><td>41%</td><td>52%</td><td>67%</td><td>71%</td><td>67%</td><td>94%</td></tr><tr><td>Oriya</td><td>15%</td><td>13%</td><td>14%</td><td>46%</td><td>40%</td><td>54%</td><td>45%</td><td>57%</td><td>52%</td><td>67%</td></tr><tr><td>Sylheti</td><td>14%</td><td>13%</td><td>14%</td><td>49%</td><td>32%</td><td>35%</td><td>37%</td><td>59%</td><td>43%</td><td>64%</td></tr><tr><td>Syriac_Serto</td><td>20%</td><td>18%</td><td>19%</td><td>55%</td><td>70%</td><td>42%</td><td>35%</td><td>70%</td><td>47%</td><td>73%</td></tr><tr><td>Tengwar</td><td>18%</td><td>18%</td><td>18%</td><td>51%</td><td>44%</td><td>49%</td><td>40%</td><td>61%</td><td>44%</td><td>66%</td></tr><tr><td>Tibetan</td><td>18%</td><td>14%</td><td>16%</td><td>44%</td><td>31%</td><td>47%</td><td>54%</td><td>59%</td><td>55%</td><td>84%</td></tr><tr><td>ULOG</td><td>20%</td><td>18%</td><td>18%</td><td>41%</td><td>41%</td><td>40%</td><td>41%</td><td>56%</td><td>38%</td><td>70%</td></tr><tr><td>Average</td><td>19%</td><td>16%</td><td>18%</td><td>47%</td><td>46%</td><td>47%</td><td>47%</td><td>65%</td><td>54%</td><td>78%</td></tr></table>
320
+
321
+ Table 6: Estimates for the number of characters across the 20 datasets in Omniglot $e v a l$ . The bold number means the prediction has error smaller or equal to 3. The $A D i f$ is defined in section 5.1.2.
322
+
323
+ <table><tr><td>Alphabet</td><td>True #class</td><td>SKMS</td><td>CCN (K=100)</td></tr><tr><td>Angelic</td><td>20</td><td>16</td><td>26</td></tr><tr><td>Atemayar_Qelisayer</td><td>26</td><td>17</td><td>34</td></tr><tr><td>Atlantean</td><td>26</td><td>21</td><td>41</td></tr><tr><td>Aurek_Besh</td><td>26</td><td>14</td><td>28</td></tr><tr><td>Avesta</td><td>26</td><td>8</td><td>32</td></tr><tr><td>Ge_ez</td><td>26</td><td>18</td><td>32</td></tr><tr><td>Glagolitic</td><td>45</td><td>18</td><td>45</td></tr><tr><td>Gurmukhi</td><td>45</td><td>12</td><td>43</td></tr><tr><td>Kannada</td><td>41</td><td>19</td><td>44</td></tr><tr><td>Keble</td><td>26</td><td>16</td><td>28</td></tr><tr><td>Malayalam</td><td>47</td><td>12</td><td>47</td></tr><tr><td>Manipuri</td><td>40</td><td>17</td><td>41</td></tr><tr><td>Mongolian</td><td>30</td><td>28</td><td>36</td></tr><tr><td>Old_Church_Slavonic_Cyrillic</td><td>45</td><td>23</td><td>45</td></tr><tr><td>Oriya</td><td>46</td><td>22</td><td>49</td></tr><tr><td>Sylheti</td><td>28</td><td>11</td><td>50</td></tr><tr><td>Syriac_Serto</td><td>23</td><td>19</td><td>38</td></tr><tr><td>Tengwar</td><td>25</td><td>12</td><td>41</td></tr><tr><td>Tibetan</td><td>42</td><td>15</td><td>42</td></tr><tr><td>ULOG</td><td>26</td><td>15</td><td>40</td></tr><tr><td>ADif</td><td></td><td>16.3</td><td>6.35</td></tr></table>
324
+
325
+ Table 7: The performance of the similarity prediction function used in section 5.1. We leverage the N-way test which is commonly used in one-shot learning evaluation. The similarity is learned with Omniglot $b g$ and has N-way test with $O m n i g l o t _ { e v a l }$ and MNIST. The experimental settings follow Vinyals et al. (2016). The raw probability output (without binarization) from our $G$ is used to find the nearest exemplar in the N-way test.
326
+
327
+ <table><tr><td>Method</td><td colspan="2">Omniglot-eval 5-way</td><td>MNIST 10-way</td></tr><tr><td>Siamese-Nets (Koch et al., 2015)</td><td>0.967</td><td>20-way 0.880</td><td>0.703</td></tr><tr><td>Match-Net (Vinyals et al., 2016)</td><td>0.981</td><td>0.938</td><td>0.720</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Ours</td><td>0.979</td><td>0.935</td><td>0.720</td></tr></table>
328
+
329
+ Table 8: Unsupervised cross-task transfer learning on ImageNet. The values are the average of three random subsets in $I m a g e N e t _ { 1 1 8 }$ . Each subset has 30 classes. The "ACC" has $K = 3 0$ while the "ACC (100)" sets $K = 1 0 0$ . All methods use the features (outputs of average pooling) from Resnet-18 pre-trained with ImageNet882 classification.
330
+
331
+ <table><tr><td>Method</td><td>ACC</td><td>ACC(100)</td><td>NMI</td><td>NMI(100)</td></tr><tr><td>K-means</td><td>71.9%</td><td>34.5%</td><td>0.713</td><td>0.671</td></tr><tr><td>LSC</td><td>73.3%</td><td>33.5%</td><td>0.733</td><td>0.655</td></tr><tr><td>LPNMF</td><td>43.0%</td><td>21.8%</td><td>0.526</td><td>0.500</td></tr><tr><td>CCN (ours)</td><td>73.8%</td><td>65.2%</td><td>0.750</td><td>0.715</td></tr></table>
332
+
333
+ Table 9: Performance of the similarity prediction function ( $G$ , trained with ImageN et882) applied to three subsets of $I m a g e N e t _ { 1 1 8 }$ . Each subset contains 30 random classes of $I m a g e N e t _ { 1 1 8 }$ . The predictions are binarized at 0.5 to calculate the precision and recall. Random\*: The expected performance when classes are uniformly distributed and make uniform random guess for similarity. It is an approximation since the number of images in each class is only roughly equal in ImageNet. We sampled 12M pairs for each set to collect the statistics. Sampling more pairs has no noticeable change to the values.
334
+
335
+ <table><tr><td>Set</td><td>Similar Precision</td><td> Similar Recall</td><td>Dissimilar Precision</td><td>Dissimilar Recall</td></tr><tr><td>Random*</td><td>0.033</td><td>0.500</td><td>0.967</td><td>0.500</td></tr><tr><td>Set A</td><td>0.840</td><td>0.664</td><td>0.983</td><td>0.994</td></tr><tr><td>SetB</td><td>0.825</td><td>0.631</td><td>0.981</td><td>0.993</td></tr><tr><td>Set C</td><td>0.771</td><td>0.671</td><td>0.983</td><td>0.990</td></tr><tr><td>Average</td><td>0.812</td><td>0.655</td><td>0.982</td><td>0.992</td></tr></table>
336
+
337
+ # C SUPPLEMENTARY FOR UNSUPERVISED CROSS DOMAIN TRANSFER LEARNING
338
+
339
+ # C.1 MORE DISCUSSION FOR THE OFFICE-31 EXPERIMENTS
340
+
341
+ Our experiment (table 10) shows that simply using deeper pre-trained networks produces a significant performance boost. Specifically, using Resnet-50 increases the performance 8.4 points from Alexnet, which surpasses the 6.2 points gained by using one of the state-of-the-art domain adaptation algorithms (JAN (Long et al., 2017)). If we regard pre-training with deeper networks as transferring more information, our approach is similar in this aspect since both transfer more information from the auxiliary dataset. In this case, memory limitations precluded the application of LCO to such models, and multi-GPU implementations for this problem is an area of future work.
342
+
343
+ Table 10: The performance of unsupervised transfer across domains on Office-31 dataset. The backbone networks in the comparison have different numbers of convolutional layers. AlexNet has 5 layers and the ResNets have $1 8 { \sim } 5 0$ layers. SO is the abbreviation for source-only, which simply trains on $S ^ { \prime }$ and directly applies the classifier on $T$ . The first two rows are directly copied from Long et al. (2017). The features learned with deeper networks generalize better across domains.
344
+
345
+ <table><tr><td colspan="8">A→W D→W W→D A→D D→A W→A</td></tr><tr><td>AlexNet SO</td><td>61.6</td><td>95.4</td><td>99.0</td><td>63.8</td><td>51.1</td><td>49.8</td><td>Avg 70.1</td><td>1</td></tr><tr><td>AlexNet (JAN-A)</td><td>75.2</td><td>96.6</td><td>99.6</td><td>72.8</td><td>57.5</td><td>56.3</td><td>76.3</td><td>+6.2</td></tr><tr><td>Resnet-18 SO</td><td>66.8</td><td>92.8</td><td>96.8</td><td>67.1</td><td>51.4</td><td>53.0</td><td>71.3</td><td>+1.2</td></tr><tr><td>Resnet-34 SO</td><td>73.1</td><td>96.4</td><td>98.8</td><td>73.8</td><td>63.2</td><td>62.1</td><td>77.9</td><td>+7.8</td></tr><tr><td>Resnet-50 SO</td><td>74.3</td><td>96.8</td><td>98.8</td><td>79.5</td><td>61.2</td><td>60.6</td><td>78.5</td><td>+8.4</td></tr></table>
346
+
347
+ Table 11: Performance of the similarity prediction function ( $G$ , trained with ImageNet882) applied on three domains of the Office-31 dataset. In total, 1.4M pairs are examined to calculate the table.
348
+
349
+ <table><tr><td>Domain</td><td>Similar Precision</td><td>Similar Recall</td><td>Dissimilar Precision</td><td>Dissimilar Recall</td></tr><tr><td>Amazon</td><td>0.194</td><td>0.696</td><td>0.988</td><td>0.894</td></tr><tr><td>DSLR</td><td>0.196</td><td>0.882</td><td>0.995</td><td>0.858</td></tr><tr><td>Webcam</td><td>0.213</td><td>0.865</td><td>0.994</td><td>0.876</td></tr></table>
350
+
351
+ Table 12: Unsupervised transferring across domains (S’: SVHN, T: MNIST A: Omniglotbg) without pre-trained backbone network weights. Our setup is similar to Sener et al. (2016) and Ganin et al. (2016) which therefore has a similar source-only performance.
352
+
353
+ <table><tr><td colspan="2">Method</td><td>SVHN-&gt;MNIST</td><td>Gain</td></tr><tr><td>Ganin et al. (2016)</td><td>Source-Only DANN</td><td>54.9 73.9</td><td>1 +19.0</td></tr><tr><td>Sener et al. (2016)</td><td>Source-Only LTR</td><td>54.9 78.8</td><td>1 +23.9</td></tr><tr><td>Saito et al. (2017)</td><td>Source-Only ATDA</td><td>70.1 86.2</td><td>- +16.1</td></tr><tr><td>Tzeng et al. (2017)</td><td>Source-Only ADDA</td><td>60.1 76.0</td><td>- +15.9</td></tr><tr><td>Ours</td><td>Source-Only CCN+</td><td>52.0 89.1</td><td>1 +37.1</td></tr></table>
354
+
355
+ Table 13: Performance of the similarity prediction function ( $G$ , trained with Omniglotbg) applied on the MNIST dataset. In total, 5M pairs are sampled to calculate the table.
356
+
357
+ <table><tr><td></td><td>Similar Precision</td><td>Similar Recall</td><td>Dissimilar Precision</td><td>Dissimilar Recall</td></tr><tr><td>Random</td><td>0.100</td><td>0.500</td><td>0.900</td><td>0.500</td></tr><tr><td>MNIST</td><td>0.782</td><td>0.509</td><td>0.946</td><td>0.984</td></tr></table>
358
+
359
+ # D ROBUSTNESS ANALYSIS OF CONSTRAINED CLUSTERING NETWORK
360
+
361
+ # D.1 SETUP
362
+
363
+ To quickly explore the large combination of factors that may affect the clustering, we use a small dataset (MNIST) and a small network which has two convolution layers followed by two fully connected layers. The MNIST dataset is a dataset of handwritten digits that contains 60k training and 10k testing images with size $2 8 \mathbf { x } 2 8$ . Only the training set is used in this section and the raw pixels, which were normalized to zero mean and unit standard deviation, were fed into networks directly.
364
+
365
+ The networks were randomly initialized and the clustering training was run five times under each combination of factors; we show the best final results, as is usual in the random restart regime. The mini-batch size was set to 256, thus up to 65536 pairs were presented to the LCO per mini-batch if using full density $\mathrm { ( D } { = } 1 \mathrm { ) }$ ). There were 235 mini-batches in an epoch and the optimization proceeded for 15 epochs. The clustering loss was minimized by stochastic gradient descent with learning rate 0.1 and momentum 0.9. The predicted cluster was assigned at the end by forwarding samples through the clustering networks. The best result in the five runs was reported.
366
+
367
+ To simulate different performance of the similarity prediction, the label of pairs were flipped according to the designated recall. For example, to simulate a $90 \%$ recall of similar pair, $10 \%$ of the ground truth similar pair in a mini-batch were flipped. The precision of similar/dissimilar pairs is a function of the recall of both type of pairs, thus controlling the recall is sufficient for the evaluation. The recalls for both similar and dissimilar pairs were gradually reduced from one to zero at intervals of 0.1.
368
+
369
+ # D.2 DISCUSSION
370
+
371
+ The resulting performance w.r.t different values of recall, density, and number of clusters is visualized in Figure 8. A bright color means high NMI score and is desired. The larger the bright region, the more robust the clustering is against the noise of similarity prediction. The ACC score shows almost the same trend and is thus not shown here.
372
+
373
+ How does similarity prediction affect clustering? Looking at the top-left heat map in figure 8, which has $D = 1$ and 10 clusters, it can be observed that the NMI score is very robust to low similar pair recall, even lower than 0.5. For recall of dissimilar pairs, the effect of recall is divided at the 0.5 value: the clustering performance can be very robust to noise in dissimilar pairs if the recall is greater than 0.5; however, it can completely fail if recall is below 0.5. For similar pairs, the clustering works on a wide range of recalls when the recall of dissimilar pairs is high.
374
+
375
+ In practical terms, robustness to the recall of similar pairs is desirable because it is much easier to predict dissimilar pairs than similar pairs in real scenarios. In a dataset with 10 categories e.g. Cifar-10, we can easily get $90 \%$ recall for dissimilar pairs with purely random guess if the number of classes is known, while the recall for similar pairs will be $10 \%$ .
376
+
377
+ How does the density of the constraints affect clustering? We argue that the density of pairwise relationships is the key factor to improving the robustness of clustering. The density $D = 1$ means that every pair in a mini-batch is utilized by the clustering loss. For density $D = 0 . 1$ , it means only 1 out of 10 possible constraints is used. We could regard the higher density as better utilization of the pairwise information in a mini-batch, thus more learning instances contribute to the gradients at once. Consider a scenario where there is one sample associated with 5 true similar pairs and 3 false similar pairs. In such a case, the gradients introduced by the false similar pairs have a higher chance to be overridden by true similar pairs within the mini-batch, thus the loss can converge faster and is less affected by errors. In Figure 8, we could see when density decreases, the size of the bright region shrinks significantly.
378
+
379
+ ![](images/12cec765ecdee0ae03b658c3f3798b3d511e16695116130fd85ecccd06d459c9.jpg)
380
+ Figure 8: The clustering performance with different pairwise density and number of clusters. A bright color means that the NMI score is close to 1 while black corresponds to 0. The density is defined as a ratio compared to the total number of pair-wise combinations in a mini-batch. The number of clusters defines the final softmax output dimensionality. In each sub-figure, we show how the scores change w.r.t. the similar pair recall and dissimiliar pair recall.
381
+
382
+ In our implementation, enumerating the full pairwise relationships introduces negligible overhead in computation time using GPU. Although there is overhead for memory consumption, it is limited because only the vector of predicted distributions has to be enumerated for calculating the clustering loss.
383
+
384
+ The effect of varying the number of Clusters In the MNIST experiments, the number of categories is 10. We augment the softmax output number up to 100. The rows of figure 8 show that even when the number of output categories is significant larger than the number of true object categories, e.g. $1 0 0 > 1 0$ , the clustering performance NMI score only degrades slightly.
md/train/BygzbyHFvB/BygzbyHFvB.md ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FREELB: ENHANCED ADVERSARIAL TRAINING FOR NATURAL LANGUAGE UNDERSTANDING
2
+
3
+ Chen $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { \mathbf { 1 } }$ , Yu Cheng2, Zhe $\mathbf { G a n } ^ { 2 }$ , Siqi $\mathbf { S u n } ^ { 2 }$ , Tom Goldstein1, Jingjing Liu2 1University of Maryland, College Park 2Microsoft Dynamics 365 AI Research {chenzhu,tomg}@cs.umd.edu, {yu.cheng,zhe.gan,siqi.sun,jingjl}@microsoft.com
4
+
5
+ # ABSTRACT
6
+
7
+ Adversarial training, which minimizes the maximal risk for label-preserving input perturbations, has proved to be effective for improving the generalization of language models. In this work, we propose a novel adversarial training algorithm, FreeLB, that promotes higher invariance in the embedding space, by adding adversarial perturbations to word embeddings and minimizing the resultant adversarial risk inside different regions around input samples. To validate the effectiveness of the proposed approach, we apply it to Transformer-based models for natural language understanding and commonsense reasoning tasks. Experiments on the GLUE benchmark show that when applied only to the finetuning stage, it is able to improve the overall test scores of BERT-base model from 78.3 to 79.4, and RoBERTa-large model from 88.5 to 88.8. In addition, the proposed approach achieves state-of-the-art single-model test accuracies of $8 5 . 4 4 \%$ and $6 7 . 7 5 \%$ on ARC-Easy and ARC-Challenge. Experiments on CommonsenseQA benchmark further demonstrate that FreeLB can be generalized and boost the performance of RoBERTa-large model on other tasks as well. 1
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Adversarial training is a method for creating robust neural networks. During adversarial training, mini-batches of training samples are contaminated with adversarial perturbations (alterations that are small and yet cause misclassification), and then used to update network parameters until the resulting model learns to resist such attacks. Adversarial training was originally proposed as a means to enhance the security of machine learning systems (Goodfellow et al., 2015), especially for safety-critical systems like self-driving cars (Xiao et al., 2018) and copyright detection (Saadatpanah et al., 2019).
12
+
13
+ In this paper, we turn our focus away from the security benefits of adversarial training, and instead study its effects on generalization. While adversarial training boosts the robustness, it is widely accepted by computer vision researchers that it is at odds with generalization, with classification accuracy on non-corrupted images dropping as much as $1 0 \%$ on CIFAR-10, and $1 5 \%$ on Imagenet (Madry et al., 2018; Xie et al., 2019). Surprisingly, people observe the opposite result for language models (Miyato et al., 2017; Cheng et al., 2019), showing that adversarial training can improve both generalization and robustness.
14
+
15
+ We will show that adversarial training significantly improves performance of state-of-the-art models for many language understanding tasks. In particular, we propose a novel adversarial training algorithm, called FreeLB (Free Large-Batch), which adds adversarial perturbations to word embeddings and minimizes the resultant adversarial loss around input samples. The method leverages recently proposed “free” training strategies (Shafahi et al., 2019; Zhang et al., 2019) to enrich the training data with diversified adversarial samples under different norm constraints at no extra cost than PGD-based (Projected Gradient Descent) adversarial training (Madry et al., 2018), which enables us to perform such diversified adversarial training on large-scale state-of-the-art models. We observe improved invariance in the embedding space for models trained with FreeLB, which is positively correlated with generalization.
16
+
17
+ We perform comprehensive experiments to evaluate the performance of a variety of adversarial training algorithms on state-of-the-art language understanding models and tasks. In the comparisons with standard PGD (Madry et al., 2018), FreeAT (Shafahi et al., 2019) and YOPO (Zhang et al., 2019), FreeLB stands out to be the best for the datasets and models we evaluated. With FreeLB, we achieve state-of-the-art results on several important language understanding benchmarks. On the GLUE benchmark, FreeLB pushes the performance of the BERT-base model from 78.3 to 79.4. The overall score of the RoBERTa-large models on the GLUE benchmark is also lifted from 88.5 to 88.8, achieving best results on most of its sub-tasks. Experiments also show that FreeLB can boost the performance of RoBERTa-large on question answering tasks, such as the ARC and CommonsenseQA benchmarks. We also provide a comprehensive ablation study and analysis to demonstrate the effectiveness of our training process.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ # 2.1 ADVERSARIAL TRAINING
22
+
23
+ To improve the robustness of neural networks against adversarial examples, many defense strategies and models have been proposed, in which PGD-based adversarial training (Madry et al., 2018) is widely considered to be the most effective, since it largely avoids the the obfuscated gradient problem (Athalye et al., 2018). It formulates a class of adversarial training algorithms (Kurakin et al., 2017) into solving a minimax problem on the cross-entropy loss, which can be achieved reliably through multiple projected gradient ascent steps followed by a SGD (Stochastic Gradient Descent) step.
24
+
25
+ Despite being verified by Athalye et al. (2018) to avoid obfuscated gradients, Qin et al. (2019) shows that PGD-based adversarial training still leads to highly convolved and non-linear loss surfaces when $K$ is small, which could be readily broken under stronger adversaries. Thus, to be effective, the cost of PGD-based adversarial training is much higher than conventional training. To mitigate this cost, Shafahi et al. (2019) proposed a “free” adversarial training algorithm that simultaneously updates both model parameters and adversarial perturbations on a single backward pass. Using a similar formulation, Zhang et al. (2019) effectively reduce the total number of full forward and backward propagations for obtaining adversarial examples by restricting most of its adversarial updates in the first layer.
26
+
27
+ # 2.2 ADVERSARIAL EXAMPLES IN NATURAL LANGUAGES
28
+
29
+ Adversarial examples have been explored primarily in the image domain, and received many attention in text domain recently. Previous works on text adversaries have focused on heuristics for creating adversarial examples in the black-box setting, or on specific tasks. Jia & Liang (2017) propose to add distracting sentences to the input document in order to induce mis-classification. Zhao et al. (2018) generate text adversaries by projecting the input data to a latent space using GANs, and searching for adversaries close to the original instance. Belinkov & Bisk (2018) manipulate every word in a sentence with synthetic or natural noise in machine translation systems. Iyyer et al. (2018) propose a neural paraphrase model based on back-translated data to produce paraphrases that have different sentence structures. Different from previous work, ours is not to produce actual adversarial examples, but only take the benefit of adversarial training for natural language understanding.
30
+
31
+ We are not the first to observe that robust language models may perform better on clean test data. Miyato et al. (2017) extend adversarial and virtual adversarial training (Miyato et al., 2019) to the text domain to improve the performance on semi-supervised classification tasks. Ebrahimi et al. (2018) propose a character/word replacement for crafting attacks, and show employing adversarial examples in training renders the models more robust. Ribeiro et al. (2018) show that adversarial attacks can be used as a valuable tool for debugging NLP models. Cheng et al. (2019) also find that crafting adversarial examples can help neural machine translation significantly. Notably, these studies have focused on simple models or text generation tasks. Our work explores how to efficiently use the gradients obtained in adversarial training to boost the performance of state-of-the-art transformer-based models.
32
+
33
+ # 3 ADVERSARIAL TRAINING FOR LANGUAGE UNDERSTANDING
34
+
35
+ Pre-trained large-scale language models, such as BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019b), ALBERT (Lan et al., 2020) and T5 (Raffel et al., 2019), have proven to be highly effective for downstream tasks. We aim to further improve the generalization of these pre-trained language models on the downstream language understanding tasks by enhancing their robustness in the embedding space during finetuning on these tasks. We achieve this goal by creating “virtual” adversarial examples in the embedding space, and then perform parameter updates on these adversarial embeddings. Creating actual adversarial examples for language is difficult; even with state-of-theart language models as guidance (e.g., (Cheng et al., 2019)), it remains unclear how to construct label-preserving adversarial examples via word/character replacement without human evaluations, because the meaning of each word/character depends on the context (Ribeiro et al., 2018). Since we are only interested in the effects of adversarial training, rather than producing actual adversarial examples, we add norm-bounded adversarial perturbations to the embeddings of the input sentences using a gradient-based method. Note that our embedding-based adversary is strictly stronger than a more conventional text-based adversary, as our adversary can make manipulations on word embeddings that are not possible in the text domain.
36
+
37
+ For models that incorporate various input representations, including word or subword embeddings, segment embeddings and position embeddings, our adversaries only modify the concatenated word or sub-word embeddings, leaving other components of the sentence representation unchanged. 2 Denote the sequence of one-hot representations of the input subwords as $\pmb { Z } = [ z _ { 1 } , z _ { 2 } , . . . , z _ { n } ]$ , the embedding matrix as $V$ , and the language model (encoder) as a function ${ \pmb y } = f _ { \pmb \theta } ( { \pmb X } )$ , where $\dot { \boldsymbol { X } } = \boldsymbol { V } \boldsymbol { Z }$ is the subword embeddings, $\textbf { { y } }$ is the output of the model (e.g., class probabilities for classification models), and $\pmb \theta$ denotes all the learnable parameters including the embedding matrix $V$ . We add adversarial perturbations $\delta$ to the embeddings such that the prediction becomes $\pmb { y } ^ { \prime } = f _ { \pmb { \theta } } ( \pmb { X } + \pmb { \delta } )$ . To preserve the semantics, we constrain the norm of $\pmb { \delta }$ to be small, and assume the model’s prediction should not change after the perturbation. This formulation is analogous to Miyato et al. (2017), with the difference that we do not require $\boldsymbol { X }$ to be normalized.
38
+
39
+ # 3.1 PGD FOR ADVERSARIAL TRAINING
40
+
41
+ Standard adversarial training seeks to find optimal parameters $\pmb { \theta } ^ { * }$ to minimize the maximum risk for any $\pmb { \delta }$ within a norm ball as:
42
+
43
+ $$
44
+ \operatorname* { m i n } _ { \theta } \mathbb { E } _ { ( Z , y ) \sim \mathcal { D } } \left[ \operatorname* { m a x } _ { \| \delta \| \leq \epsilon } L ( f _ { \theta } ( X + \delta ) , y ) \right] ,
45
+ $$
46
+
47
+ where $\mathcal { D }$ is the data distribution, $y$ is the label, and $L$ is some loss function. We use the Frobenius norm to constrain $\delta$ . For neural networks, the outer “min” is non-convex, and the inner “max” is non-concave. Nonetheless, Madry et al. (2018) demonstrated that this saddle-point problem can be solved reliably with SGD for the outer minimization and PGD (a standard method for large-scale constrained optimization, see (Combettes & Pesquet, 2011) and (Goldstein et al., 2014)), for the inner maximization. In particular, for the constraint $\| \delta \| _ { F } \le \epsilon$ , with an additional assumption that the loss function is locally linear, PGD takes the following step (with step size $\alpha$ ) in each iteration:
48
+
49
+ $$
50
+ \delta _ { t + 1 } = \Pi _ { \| \pmb { \delta } \| _ { F } \leq \epsilon } \left( \pmb { \delta } _ { t } + \alpha g ( \pmb { \delta } _ { t } ) / \| g ( \pmb { \delta } _ { t } ) \| _ { F } \right) ,
51
+ $$
52
+
53
+ where $g ( \delta _ { t } ) = \nabla _ { \delta } L ( f _ { \theta } ( X + \delta _ { t } ) , y )$ is the gradient of the loss with respect to $\delta$ , and $\Pi _ { \| \delta \| _ { F } \leq \epsilon }$ performs a projection onto the $\epsilon$ -ball. To achieve high-level robustness, multi-step adversarial examples are needed during training, which is computationally expensive. The $K$ -step PGD ( $K$ -PGD) requires $K$ forward-backward passes through the network, while the standard SGD update requires only one. As a result, the adversary generation step in adversarial training increases run-time by an order of magnitude—a catastrophic amount when training large state-of-the-art language models.
54
+
55
+ # 3.2 LARGE-BATCH ADVERSARIAL TRAINING FOR FREE
56
+
57
+ In the inner ascent steps of PGD, the gradients of the parameters can be obtained with almost no overhead when computing the gradients of the inputs. From this observation, FreeAT (Shafahi et al.,
58
+
59
+ # Algorithm 1 “Free” Large-Batch Adversarial Training (FreeLB- $K$ )
60
+
61
+ <table><tr><td>ascent step size α</td><td>Require: Training samples X = {(Z,y)}, perturbation bound ε, learning rate T, ascent steps K,</td></tr><tr><td>1:Initialize 0</td><td></td></tr><tr><td>2: for epoch =1... Nep do</td><td></td></tr><tr><td>3:</td><td>for minibatchB ℃Xdo</td></tr><tr><td>4:</td><td>U(-∈,∈)</td></tr><tr><td>5:</td><td>90↑0</td></tr><tr><td>6:</td><td></td></tr><tr><td>7:</td><td>fort=1...K do</td></tr><tr><td>8:</td><td>Accumulate gradient of parameters θ</td></tr><tr><td>9:</td><td>gt←gt-1+kE(z,y)∈B[VθL(fe(X+δt-1),y)]</td></tr><tr><td>10:</td><td>Update the perturbation δ via gradient ascend</td></tr><tr><td>11:</td><td>gadu ←VsL(fθ(X+δt-1),y) δt ←II|δ|lr≤e(δt-1+α:gadu/llgadullF)</td></tr><tr><td>12:</td><td></td></tr><tr><td>13:</td><td>end for</td></tr><tr><td>14:</td><td>0←0-TgK</td></tr><tr><td>end for 15: end for</td><td></td></tr></table>
62
+
63
+ 2019) and YOPO (Zhang et al., 2019) have been proposed to accelerate adversarial training. They achieve comparable robustness and generalization as standard PGD-trained models using only the same or a slightly larger number of forward-backward passes as natural training (i.e., SGD on clean samples). FreeAT takes one descent step on the parameters together with each of the $K$ ascent steps on the perturbation. As a result, FreeAT may suffer from the “stale gradient” problem (Dutta et al., 2018), where in every step $t$ , $\delta _ { t }$ does not necessarily maximize the model with parameter $\theta _ { t }$ since its update is based on $\nabla _ { \delta } L \big ( f _ { \pmb { \theta } _ { t - 1 } } ( \pmb { X } + \delta _ { t - 1 } ) , y \big )$ , and vice versa, $\theta _ { t }$ does not necessarily minimize the adversarial risk with adversary $\delta _ { t }$ since its update is based on $\nabla _ { \pmb { \theta } } L \big ( f _ { \pmb { \theta } _ { t - 1 } } ( \pmb { X } + \delta _ { t - 1 } ) , y \big )$ . Such a problem may be more significant when the step size is large.
64
+
65
+ Different from FreeAT, YOPO accumulates the gradient of the parameters from each of the ascent steps, and updates the parameters only once after the $K$ inner ascent steps. YOPO also advocates that after each back-propagation, one should take the gradient of the first hidden layer as a constant and perform several additional updates on the adversary using the product of this constant and the Jacobian of the first layer of the network to obtain strong adversaries. However, when the first hidden layer is a linear layer as in their implementation, such an operation is equivalent to taking a larger step size on the adversary. The analysis backing the extra update steps also assumes a twice continuously differentiable loss, which does not hold for ReLU-based neural networks they experimented with, and thus the reasons for the success of such an algorithm remains obscure. We give empirical comparisons between YOPO and our approach in Sec. 4.3.
66
+
67
+ To obtain better solutions for the inner max and avoid fundamental limitations on the function class, we propose FreeLB, which performs multiple PGD iterations to craft adversarial examples, and simultaneously accumulates the “free” parameter gradients $\nabla _ { \boldsymbol { \theta } } L$ in each iteration. After that, it updates the model parameter $\pmb \theta$ all at once with the accumulated gradients. The overall procedure is shown in Algorithm 1, in which $X + \delta _ { t }$ is an approximation to the local maximum within the intersection of two balls $\mathcal { T } _ { t } = \mathcal { B } _ { X + \delta _ { 0 } } ( \alpha t ) \cap \mathcal { B } _ { X } ( \epsilon )$ . By taking a descent step along the averaged gradients at $X + \delta _ { 0 } , . . . , X + \delta _ { K - 1 }$ , we approximately optimize the following objective:
68
+
69
+ $$
70
+ \underset { \pmb { \theta } } { \operatorname* { m i n } } \mathbb { E } _ { ( Z , y ) \sim \mathcal { D } } \left[ \frac { 1 } { K } \sum _ { t = 0 } ^ { K - 1 } \underset { \delta _ { t } \in \mathcal { Z } _ { t } } { \operatorname* { m a x } } L \big ( f _ { \pmb { \theta } } \big ( \pmb { X } + \delta _ { t } \big ) , y \big ) \right] ,
71
+ $$
72
+
73
+ which is equivalent to replacing the original batch $\boldsymbol { X }$ with a $K$ -times larger virtual batch, consisting of samples whose embeddings are $X + \delta _ { 0 } , . . . , X + \delta _ { K - 1 }$ . Compared with PGD-based adversarial training (Eq. 1), which minimizes the maximum risk at a single estimated point in the vicinity of each training sample, FreeLB minimizes the maximum risk at each ascent step at almost no overhead.
74
+
75
+ Intuitively, FreeLB could be a learning method with lower generalization error than PGD. Sokolic et al. (2017) have proved that the generalization error of a learning method invariant to a set of√ $T$ transformations may be up to $\sqrt { T }$ smaller than a non-invariant learning method. According to their theory, FreeLB could have a more significant improvement over natural training, since FreeLB enforces the invariance to $K$ adversaries from a set of up to $K$ different norm constraints,3 while PGD only enforces invariance to a single norm constraint $\epsilon$ .
76
+
77
+ Empirically, FreeLB does lead to higher robustness and invariance than PGD in the embedding space, in the sense that the maximum increase of loss in the vicinity of $\boldsymbol { X }$ for models trained with FreeLB is smaller than that with PGD. See Sec. 4.3 for details. In theory, such improved robustness can lead to better generalization (Xu & Mannor, 2012), which is consistent with our experiments. Qin et al. (2019) also demonstrated that PGD-based method leads to highly convolved and non-linear loss surfaces in the vicinity of input samples when $K$ is small, indicating a lack of robustness.
78
+
79
+ # 3.3 WHEN ADVERSARIAL TRAINING MEETS DROPOUT
80
+
81
+ Usually, adversarial training is not used together with dropout (Srivastava et al., 2014). However, for some language models like RoBERTa (Liu et al., 2019b), dropout is used during the finetuning stage. In practice, when dropout is turned on, each ascent step of Algorithm 1 is optimizing $\delta$ for a different network. Specifically, denote the dropout mask as $_ { m }$ with each entry $m _ { i } \sim \mathrm { B e r n o u l l i } ( p )$ . Similar to our analysis for FreeAT, the ascent step from $\delta _ { t - 1 }$ to $\delta _ { t }$ is based on $\nabla _ { \delta } L \big ( f _ { \theta ( m _ { t - 1 } ) } \big ( \boldsymbol { X } + \delta _ { t - 1 } \big ) , \boldsymbol { y } \big )$ , so $\delta _ { t }$ is sub-optimal for $L ( f _ { \theta ( m _ { t } ) } ( \boldsymbol { X } + \delta ) , y )$ . Here $\theta ( m )$ is the effective parameters under dropout mask $_ { m }$ .
82
+
83
+ The more plausible solution is to use the same $_ { \mathbf { \nabla } } \mathbf { m }$ in each step. When applying dropout to any network, the objective for $\pmb \theta$ is to minimize the expectation of loss under different networks determined by the dropout masks, which is achieved by minimizing the Monte Carlo estimation of the expected loss. In our case, the objective becomes:
84
+
85
+ $$
86
+ \operatorname* { m i n } _ { \theta } \mathbb { E } _ { ( Z , y ) \sim \mathcal { D } , m \sim \mathcal { M } } \left[ \frac { 1 } { K } \sum _ { t = 0 } ^ { K - 1 } \operatorname* { m a x } _ { \delta _ { t } \in \mathcal { T } _ { t } } L \big ( f _ { \theta ( m ) } ( X + \delta _ { t } ) , y \big ) \right] ,
87
+ $$
88
+
89
+ where the 1-sample Monte Carlo estimation should be $\begin{array} { r } { \frac { 1 } { K } \sum _ { t = 0 } ^ { K - 1 } \operatorname* { m a x } _ { \delta _ { t } \in \mathcal { T } _ { t } } L ( f _ { \theta ( m _ { 0 } ) } ( X + \delta _ { t } ) , y ) } \end{array}$ and can be minimized by using FreeLB with dropout mask $m _ { 0 }$ in each ascent step. This is similar to applying Variational Dropout to RNNs as used in Gal & Ghahramani (2016).
90
+
91
+ # 4 EXPERIMENTS
92
+
93
+ In this section, we provide comprehensive analysis on FreeLB through extensive experiments on three Natural Language Understanding benchmarks: GLUE (Wang et al., 2019), ARC (Clark et al., 2018) and CommonsenseQA (Talmor et al., 2019). We also compare the robustness and generalization of FreeLB with other adversarial training algorithms to demonstrate its strength. Additional experimental details are provided in the Appendix.
94
+
95
+ # 4.1 DATASETS
96
+
97
+ GLUE Benchmark. The GLUE benchmark is a collection of 9 natural language understanding tasks, namely Corpus of Linguistic Acceptability (CoLA; Warstadt et al. (2018)), Stanford Sentiment Treebank (SST; Socher et al. (2013)), Microsoft Research Paraphrase Corpus (MRPC; Dolan & Brockett (2005)), Semantic Textual Similarity Benchmark (STS; Agirre et al. (2007)), Quora Question Pairs (QQP; Iyer et al. (2017)), Multi-Genre NLI (MNLI; Williams et al. (2018)), Question NLI (QNLI; Rajpurkar et al. (2016)), Recognizing Textual Entailment (RTE; Dagan et al. (2006); Bar Haim et al. (2006); Giampiccolo et al. (2007); Bentivogli et al. (2009)) and Winograd NLI (WNLI; Levesque et al. (2011)). 8 of the tasks are formulated as classification problems and only STS-B is formulated as regression, but FreeLB applies to all of them. For BERT-base, we use the HuggingFace implementation4, and follow the single-task finetuning procedure as in Devlin et al. (2019). For RoBERTa, we use the fairseq implementation5. Same as Liu et al. (2019b), we also use single-task finetuning for all dev set results, and start with MNLI-finetuned models on RTE, MRPC and STS-B for the test submissions.
98
+
99
+ Table 1: Results (median and variance) on the dev sets of GLUE based on the RoBERTa-large model, from 5 runs with the same hyperparameter but different random seeds. ReImp is our reimplementation of RoBERTalarge. The training process can be very unstable even with the vanilla version. Here, both PGD on STS-B and FreeAT on RTE demonstrates such instability, with one unconverged instance out of five.
100
+
101
+ <table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>MNLI(Acc)</td><td rowspan=1 colspan=1>QNLI(Acc)</td><td rowspan=1 colspan=1>QQP(Acc)</td><td rowspan=1 colspan=1>RTE(Acc)</td><td rowspan=1 colspan=1>SST-2(Acc)</td><td rowspan=1 colspan=1>MRPC(Acc)</td><td rowspan=1 colspan=1>CoLA(Mcc)</td><td rowspan=1 colspan=1>STS-B(Pearson)</td></tr><tr><td rowspan=1 colspan=1>Reported</td><td rowspan=1 colspan=1>90.2</td><td rowspan=1 colspan=1>94.7</td><td rowspan=1 colspan=1>92.2</td><td rowspan=1 colspan=1>86.6</td><td rowspan=1 colspan=1>96.4</td><td rowspan=1 colspan=1>90.9</td><td rowspan=1 colspan=1>68.0</td><td rowspan=1 colspan=1>92.4</td></tr><tr><td rowspan=1 colspan=1>ReImp</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>85.61 (1.7)</td><td rowspan=1 colspan=1>96.56 (.3)</td><td rowspan=1 colspan=1>90.69(.5)</td><td rowspan=1 colspan=1>67.57 (1.3)</td><td rowspan=1 colspan=1>92.20 (.2)</td></tr><tr><td rowspan=1 colspan=1>PGD</td><td rowspan=1 colspan=1>90.53 (.2)</td><td rowspan=1 colspan=1>94.87 (.2)</td><td rowspan=1 colspan=1>92.49 (.07)</td><td rowspan=1 colspan=1>87.41 (.9)</td><td rowspan=1 colspan=1>96.44 (.1)</td><td rowspan=1 colspan=1>90.93 (.2)</td><td rowspan=1 colspan=1>69.67 (1.2)</td><td rowspan=1 colspan=1>92.43 (7.)</td></tr><tr><td rowspan=1 colspan=1>FreeAT</td><td rowspan=1 colspan=1>90.02 (.2)</td><td rowspan=1 colspan=1>94.66 (.2)</td><td rowspan=1 colspan=1>92.48(.08)</td><td rowspan=1 colspan=1>86.69 (15.)</td><td rowspan=1 colspan=1>96.10 (.2)</td><td rowspan=1 colspan=1>90.69 (.4)</td><td rowspan=1 colspan=1>68.80 (1.3)</td><td rowspan=1 colspan=1>92.40 (.3)</td></tr><tr><td rowspan=1 colspan=1>FreeLB</td><td rowspan=1 colspan=1>90.61 (.1)</td><td rowspan=1 colspan=1>94.98 (.2)</td><td rowspan=1 colspan=1>92.60 (.03)</td><td rowspan=1 colspan=1>88.13 (1.2)</td><td rowspan=1 colspan=1>96.79 (.2)</td><td rowspan=1 colspan=1>91.42 (.7)</td><td rowspan=1 colspan=1>71.12 (.9)</td><td rowspan=1 colspan=1>92.67 (.08)</td></tr></table>
102
+
103
+ Table 2: Results on GLUE from the evaluation server, as of Sep 25, 2019. Metrics are the same as the leaderboard. Number under each task’s name is the size of the training set. FreeLB-BERT is the single-model results of BERT-base finetuned with FreeLB, and FreeLB-RoB is the ensemble of 7 RoBERTa-Large models for each task. References: 1: (Devlin et al., 2019); 2: (Liu et al., 2019a); 3: (Yang et al., 2019); 4: (Liu et al., 2019b).
104
+
105
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Score</td><td rowspan=1 colspan=1>CoLA8.5k</td><td rowspan=1 colspan=1>SST-267k</td><td rowspan=1 colspan=1>MRPC3.7k</td><td rowspan=1 colspan=1>STS-B7k</td><td rowspan=1 colspan=1>QQP364k</td><td rowspan=1 colspan=1>MNLI-m/mm393k</td><td rowspan=1 colspan=1>QNLI108k</td><td rowspan=1 colspan=1>RTE2.5k</td><td rowspan=1 colspan=1>WNLI634</td><td rowspan=1 colspan=1>AX</td></tr><tr><td rowspan=1 colspan=1>BERT-base1</td><td rowspan=1 colspan=1>78.3</td><td rowspan=1 colspan=1>52.1</td><td rowspan=1 colspan=1>93.5</td><td rowspan=1 colspan=1>88.9/84.8</td><td rowspan=1 colspan=1>87.1/85.8</td><td rowspan=1 colspan=1>71.2/89.2</td><td rowspan=1 colspan=1>84.6/83.4</td><td rowspan=1 colspan=1>90.5</td><td rowspan=1 colspan=1>66.4</td><td rowspan=1 colspan=1>65.1</td><td rowspan=1 colspan=1>34.2</td></tr><tr><td rowspan=1 colspan=1>FreeLB-BERT</td><td rowspan=1 colspan=1>79.4</td><td rowspan=1 colspan=1>54.5</td><td rowspan=1 colspan=1>93.6</td><td rowspan=1 colspan=1>88.1/83.5</td><td rowspan=1 colspan=1>87.7/86.7</td><td rowspan=1 colspan=1>72.7/89.6</td><td rowspan=1 colspan=1>85.7/84.6</td><td rowspan=1 colspan=1>91.8</td><td rowspan=1 colspan=1>70.1</td><td rowspan=1 colspan=1>65.1</td><td rowspan=1 colspan=1>36.9</td></tr><tr><td rowspan=1 colspan=1>MT-DNN2</td><td rowspan=1 colspan=1>87.6</td><td rowspan=1 colspan=1>68.4</td><td rowspan=1 colspan=1>96.5</td><td rowspan=1 colspan=1>92.7/90.3</td><td rowspan=1 colspan=1>91.1/90.7</td><td rowspan=1 colspan=1>73.7789.9</td><td rowspan=1 colspan=1>87.9/87.4</td><td rowspan=1 colspan=1>96.0</td><td rowspan=1 colspan=1>86.3</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>42.8</td></tr><tr><td rowspan=1 colspan=1>XLNet-Large</td><td rowspan=1 colspan=1>88.4</td><td rowspan=1 colspan=1>67.8</td><td rowspan=1 colspan=1>96.8</td><td rowspan=1 colspan=1>93.0/90.7</td><td rowspan=1 colspan=1>91.6/91.1</td><td rowspan=1 colspan=1>74.2/90.3</td><td rowspan=1 colspan=1>90.2/89.8</td><td rowspan=1 colspan=1>98.6</td><td rowspan=1 colspan=1>86.3</td><td rowspan=1 colspan=1>90.4</td><td rowspan=1 colspan=1>47.5</td></tr><tr><td rowspan=1 colspan=1>RoBERTa4</td><td rowspan=1 colspan=1>88.5</td><td rowspan=1 colspan=1>67.8</td><td rowspan=1 colspan=1>96.7</td><td rowspan=1 colspan=1>92.3/89.8</td><td rowspan=1 colspan=1>92.2/91.9</td><td rowspan=1 colspan=1>74.3/90.2</td><td rowspan=1 colspan=1>90.8/90.2</td><td rowspan=1 colspan=1>98.9</td><td rowspan=1 colspan=1>88.2</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>48.7</td></tr><tr><td rowspan=1 colspan=1>FreeLB-RoB</td><td rowspan=1 colspan=1>88.8</td><td rowspan=1 colspan=1>68.0</td><td rowspan=1 colspan=1>96.8</td><td rowspan=1 colspan=1>93.1/90.8</td><td rowspan=1 colspan=1>92.4/92.2</td><td rowspan=1 colspan=1>74.8/90.3</td><td rowspan=1 colspan=1>91.1/90.7</td><td rowspan=1 colspan=1>98.8</td><td rowspan=1 colspan=1>88.7</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>50.1</td></tr><tr><td rowspan=1 colspan=1>Human</td><td rowspan=1 colspan=1>87.1</td><td rowspan=1 colspan=1>66.4</td><td rowspan=1 colspan=1>97.8</td><td rowspan=1 colspan=1>86.3/80.8</td><td rowspan=1 colspan=1>92.7/92.6</td><td rowspan=1 colspan=1>59.5/80.4</td><td rowspan=1 colspan=1>92.0/92.8</td><td rowspan=1 colspan=1>91.2</td><td rowspan=1 colspan=1>93.6</td><td rowspan=1 colspan=1>95.9</td><td rowspan=1 colspan=1>1</td></tr></table>
106
+
107
+ ARC Benchmark. The ARC dataset (Clark et al., 2018) is a collection of multi-choice science questions from grade-school level exams. It is further divided into ARC-Challenge set with 2,590 question answer (QA) pairs and ARC-Easy set with 5,197 QA pairs. Questions in ARC-Challenge are more difficult and cannot be handled by simply using a retrieval and co-occurence based algorithm (Clark et al., 2018). A typical question is:
108
+
109
+ Which property of a mineral can be determined just by looking at it?
110
+
111
+ (A) luster [correct] $( B )$ mass $( C )$ weight $( D )$ hardness.
112
+
113
+ CommonsenseQA Benchmark. The CommonsenseQA dataset (Talmor et al., 2019) consists of 12,102 natural language questions that require human commonsense reasoning ability to answer. A typical question is :
114
+
115
+ Where can I stand on a river to see water falling without getting wet?
116
+
117
+ (A) waterfall, (B) bridge [correct], (C) valley, $( D )$ stream, (E) bottom.
118
+
119
+ Each question has five candidate answers from ConceptNet (Speer et al., 2017). To make the question more difficult to solve, most answers have the same relation in ConceptNet to the key concept in the question. As shown in the above example, most answers can be connected to “river” by “AtLocation” relation in ConceptNet. For a fair comparison with the reported results in papers and leaderboard6, we use the official random split 1.11.
120
+
121
+ # 4.2 EXPERIMENTAL RESULTS
122
+
123
+ GLUE We summarize results on the dev sets of GLUE in Table 1, comparing the proposed FreeLB against other adversatial training algorithms (PGD (Madry et al., 2018) and FreeAT (Shafahi et al., 2019)). We use the same step size $\alpha$ and number of steps $m$ for PGD, FreeAT and FreeLB. FreeLB is consistently better than the two baselines. Comparisons and detailed discussions about
124
+
125
+ Table 3: Results on ARC and CommonsenseQA (CQA). ARC-Merge is the combination of ARC-Easy and ARC-Challenge, “MTL” stands for multi-task learning and “Ens” stands for ensemble. Results of XLNet $^ +$ RoBERTa $\left( \mathbf { M } \mathbf { T } \mathbf { L } { + } \mathbf { E } \mathbf { n } \mathbf { s } \right)$ and AristoRoBERTaV7 (MTL) are from the ARC leaderboards. Test (E) denotes the test set results with ensembles. For CQA, we report the highest dev and test accuracies among all models. The models with 78.81/72.19 dev/test accuracy (as in the table) have 71.84/78.64 test/dev accuracies respectively.
126
+
127
+ <table><tr><td rowspan=2 colspan=1></td><td rowspan=2 colspan=9>ARC-Easy ARC-Challenge ARC-Merge CQADev Test Dev Test Dev Test Dev Test Test (E)</td></tr><tr><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>Dev</td><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>Dev</td><td rowspan=1 colspan=2>Test Dev</td><td rowspan=1 colspan=1>Test</td></tr><tr><td rowspan=1 colspan=1>RoBERTa(Reported)</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>78.43</td><td rowspan=1 colspan=1>72.1</td><td rowspan=1 colspan=1>72.5</td></tr><tr><td rowspan=1 colspan=1>RoBERTa (ReImp)</td><td rowspan=1 colspan=1>84.39</td><td rowspan=1 colspan=1>84.13</td><td rowspan=1 colspan=1>64.54</td><td rowspan=1 colspan=1>64.44</td><td rowspan=1 colspan=1>77.83</td><td rowspan=1 colspan=1>77.62</td><td rowspan=1 colspan=1>77.56</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>FreeLB-RoBERTa</td><td rowspan=1 colspan=1>84.91</td><td rowspan=1 colspan=1>84.81</td><td rowspan=1 colspan=1>65.89</td><td rowspan=1 colspan=1>65.36</td><td rowspan=1 colspan=1>78.37</td><td rowspan=1 colspan=1>78.39</td><td rowspan=1 colspan=1>78.81</td><td rowspan=1 colspan=1>72.2</td><td rowspan=1 colspan=1>73.1</td></tr><tr><td rowspan=1 colspan=1>AristoRoBERTaV7(MTL)</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>85.02</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>66.47</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>78.89</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>XLNet +RoBERTa (MTL+Ens)</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>67.06</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>FreeLB-RoBERTa(MTL)</td><td rowspan=1 colspan=1>84.91</td><td rowspan=1 colspan=1>85.44</td><td rowspan=1 colspan=1>70.23</td><td rowspan=1 colspan=1>67.75</td><td rowspan=1 colspan=1>79.86</td><td rowspan=1 colspan=1>79.60</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr></table>
128
+
129
+ YOPO (Zhang et al., 2019) are provided in Sec. 4.3. We have also submitted our results to the evaluation server, results provided in Table 2. FreeLB lifts the performance of the BERT-base model from 78.3 to 79.4, and RoBERTa-large model from 88.5 to 88.8 on overall scores.
130
+
131
+ ARC For ARC, a corpus of 14 million related science documents (from ARC Corpus, Wikipedia and other sources) is provided. For each QA pair, we first use a retrieval model to select top 10 related documents. Then, given these retrieved documents7, we use RoBERTa-large model to encode $\langle s \rangle$ Retrieved Documents $\langle / s \rangle$ Question $^ +$ Answer $\langle / s \rangle$ , where $\langle \mathbf { s } \rangle$ and $\langle / \mathrm { s } \rangle$ are special tokens for RoBERTa model8. We then apply a fully-connected layer to the representation of the [CLS] token to compute the final logit, and use standard cross-entropy loss for model training.
132
+
133
+ Results are summarized in Table 3. Following Sun et al. (2018), we first finetune the RoBERTa model on the RACE dataset (Lai et al., 2017). The finetuned RoBERTa model achieves $8 5 . 7 0 \%$ and $8 5 . 2 4 \%$ accuracy on the development and test set of RACE, respectively. Based on this, we further finetune the model on both ARC-Easy and ARC-Challenge datasets with the same hyper-parameter searching strategy (for 5 epochs), which achieves $8 4 . 1 3 \% / 6 4 . 4 4 \%$ test accuracy on ARC-Easy/ARCChallenge. And by adding FreeLB finetuning, we can reach $8 4 . 8 1 \% / 6 5 . 3 6 \%$ , a significant boost on ARC benchmark, demonstrating the effectiveness of FreeLB.
134
+
135
+ To further improve the results, we apply a multi-task learning (MTL) strategy using additional datasets. We first finetune the model on RACE (Lai et al., 2017), and then finetune on a joint dataset of ARC-Easy, ARC-Challenge, OpenbookQA (Mihaylov et al., 2018) and Regents Living Environment9. Based on this, we further finetune our model on ARC-Easy and ARC-Challenge with FreeLB. After finetuning, our single model achieves $6 7 . 7 5 \%$ test accuracy on ARC-Challenge and $8 5 . 4 4 \%$ on ARC-Easy, both outperforming the best submission on the official leaderboard10.
136
+
137
+ CommonsenseQA Similar to the training strategy in Liu et al. (2019b), we construct five inputs for each question by concatenating the question and each answer separately, then encode each input with the representation of the [CLS] token. A final score is calculated by applying the representation of [CLS] to a fully-connected layer. Following the fairseq repository11, the input is formatted as: ${ \mathfrak { n } } ( s ) Q$ : Where can I stand on a river to see water falling without getting wet? $\langle / s \rangle A$ : waterfall $\langle \langle s \rangle ^ { \ast } \cdot \mathbf { \vec { \mathbf { \mu } } }$ , where $\cdot _ { Q }$ :’ and $^ { , } A$ :’ are the prefix for question and answer, respectively.
138
+
139
+ Results are summarized in Table 3. We obtained a dev-set accuracy of $7 7 . 5 6 \%$ with the RoBERTalarge model. When using FreeLB finetuning, we achieved $7 8 . 8 1 \%$ , a $1 . 2 5 \%$ absolute gain. Compared with the results reported from fairseq repository, which obtains $7 8 . 4 3 \%$ accuracy on the devset, FreeLB still achieves better performance. Our submission to the CommonsenseQA leaderboard achieves $7 2 . 2 \%$ single-model test set accuracy, and the result of a 20-model ensemble is $7 3 . 1 \%$ , which achieves No.1 among all the submissions without making use of ConceptNet.
140
+
141
+ Table 4: The median and standard deviation of the scores on the dev sets of RTE, CoLA and MRPC from the GLUE benchmark, computed from 5 runs with the same hyper-parameters except for the random seeds. We use FreeLB- $\mathbf { \nabla } m$ to denote FreeLB with $m$ ascent steps, and FreeLB- ${ . 3 ^ { * } }$ to denote the version without reusing the dropout mask.
142
+
143
+ <table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>FreeLB-3*</td><td rowspan=1 colspan=1>FreeLB-3</td><td rowspan=1 colspan=1>YOPO-3-2</td><td rowspan=1 colspan=1>YOPO-3-3</td></tr><tr><td rowspan=1 colspan=1>RTE</td><td rowspan=1 colspan=1>85.61 (1.67)</td><td rowspan=1 colspan=1>87.14 (1.29)</td><td rowspan=1 colspan=1>88.13 (1.21)</td><td rowspan=1 colspan=1>87.05 (1.36)</td><td rowspan=1 colspan=1>87.05 (0.20)</td></tr><tr><td rowspan=1 colspan=1>CoLA</td><td rowspan=1 colspan=1>67.57 (1.30)</td><td rowspan=1 colspan=1>69.31 (1.16)</td><td rowspan=1 colspan=1>71.12 (0.90)</td><td rowspan=1 colspan=1>70.40 (0.91)</td><td rowspan=1 colspan=1>69.91 (1.16)</td></tr><tr><td rowspan=1 colspan=1>MRPC</td><td rowspan=1 colspan=1>90.69 (0.54)</td><td rowspan=1 colspan=1>90.93 (0.66)</td><td rowspan=1 colspan=1>91.42 (0.72)</td><td rowspan=1 colspan=1>90.44 (0.62)</td><td rowspan=1 colspan=1>90.69 (0.37)</td></tr></table>
144
+
145
+ <table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=3>RTE</td><td rowspan=1 colspan=3>CoLA</td><td rowspan=1 colspan=3>MRPC</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>M-Inc(10-4)</td><td rowspan=1 colspan=1>M-Inc (R)(10-4)</td><td rowspan=1 colspan=1>N-Loss(10-4)</td><td rowspan=1 colspan=1>M-Inc(10-4)</td><td rowspan=1 colspan=1>M-Inc (R)(10-4)</td><td rowspan=1 colspan=1>N-Loss(10-4)</td><td rowspan=1 colspan=1>M-Inc(10-3)</td><td rowspan=1 colspan=1>M-Inc (R)(10-3)</td><td rowspan=1 colspan=1>N-Loss(10-3)</td></tr><tr><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>5.1</td><td rowspan=1 colspan=1>5.3</td><td rowspan=1 colspan=1>4.5</td><td rowspan=1 colspan=1>6.1</td><td rowspan=1 colspan=1>5.7</td><td rowspan=1 colspan=1>5.2</td><td rowspan=1 colspan=1>10.2</td><td rowspan=1 colspan=1>10.2</td><td rowspan=1 colspan=1>1.9</td></tr><tr><td rowspan=1 colspan=1>PGD</td><td rowspan=1 colspan=1>4.7</td><td rowspan=1 colspan=1>4.9</td><td rowspan=1 colspan=1>6.2</td><td rowspan=1 colspan=1>128.2</td><td rowspan=1 colspan=1>130.1</td><td rowspan=1 colspan=1>436.1</td><td rowspan=1 colspan=1>5.7</td><td rowspan=1 colspan=1>5.7</td><td rowspan=1 colspan=1>5.4</td></tr><tr><td rowspan=1 colspan=1>FreeLB</td><td rowspan=1 colspan=1>3.0</td><td rowspan=1 colspan=1>2.6</td><td rowspan=1 colspan=1>4.1</td><td rowspan=1 colspan=1>1.4</td><td rowspan=1 colspan=1>1.3</td><td rowspan=1 colspan=1>7.2</td><td rowspan=1 colspan=1>3.6</td><td rowspan=1 colspan=1>3.6</td><td rowspan=1 colspan=1>2.7</td></tr></table>
146
+
147
+ Table 5: Median of the maximum increase in loss in the vicinity of the dev set samples for RoBERTa-Large model finetuned with different methods. Vanilla models are naturally trained RoBERTa’s. M-Inc: Max Inc, MInc (R): Max Inc (R). Nat Loss (N-Loss) is the loss value on clean samples. Notice we require all clean samples here to be correctly classified by all models, which results in 227, 850 and 355 samples for RTE, CoLA and MRPC, respectively. We also give the variance in the Appendix.
148
+
149
+ # 4.3 ABLATION STUDY AND ANALYSIS
150
+
151
+ In this sub-section, we first show the importance of reusing dropout mask, then conduct a thorough ablation study on FreeLB over the GLUE benchmark to analyze the robustness and generalization strength of different approaches. We observe that it is unnecessary to perform shallow-layer updates on the adversary as YOPO for our case, and FreeLB results in improved robustness and generalization compared with PGD.
152
+
153
+ Importance of Reusing Mask Table 4 (columns 2 to 4) compares the results of FreeLB with and without reusing the same dropout mask in each ascent step, as proposed in Sec. 3.3. With reusing, FreeLB can achieve a larger improvement over the naturally trained models. Thus, we enable mask reusing for all experiments involving RoBERTa.
154
+
155
+ Comparing the Robustness Table 5 provides the comparisons of the maximum increment of loss in the vicinity of each sample, defined as:
156
+
157
+ $$
158
+ \displaystyle \Delta L _ { \mathrm { m a x } } ( \boldsymbol { X } , \epsilon ) = \operatorname* { m a x } _ { \| \delta \| \leq \epsilon } L ( f _ { \boldsymbol { \theta } } ( \boldsymbol { X } + \delta ) , \boldsymbol { y } ) - L ( f _ { \boldsymbol { \theta } } ( \boldsymbol { X } ) , \boldsymbol { y } ) ,
159
+ $$
160
+
161
+ which reflects the robustness and invariance of the model in the embedding space. In practice, we use PGD steps as in Eq. 2 to find the value of ${ \Delta } L _ { \mathrm { m a x } } ( \boldsymbol { X } , \boldsymbol { \epsilon } )$ . We found that when using a step size of $5 { \cdot } 1 0 ^ { - 3 }$ and $\epsilon = 0 . 0 1 \| X \| _ { F }$ , the PGD iterations converge to almost the same value, starting from 100 different random initializations of $\pmb { \delta }$ for the RoBERTa models, trained with or without FreeLB. This indicates that PGD reliably finds $\Delta L _ { \mathrm { m a x } }$ for these models. Therefore, we compute ${ \Delta } L _ { \mathrm { m a x } } ( X , \epsilon )$ for each $\boldsymbol { X }$ via a 2000-step PGD.
162
+
163
+ Samples with small margins exist even for models with perfect accuracy, which could give a false sense of vulnerability of the model. To rule out the outlier effect and make ${ \Delta } L _ { \mathrm { m a x } } ( \boldsymbol { X } , \epsilon )$ comparable across different samples, we only consider samples that all the evaluated models can correctly classify, and search for an $\epsilon$ for each sample such that the reference model can correctly classify all samples within the $\epsilon$ ball.12 However, such choice of per-sample $\epsilon$ favors the reference model by design. To make fair comparisons, Table 5 provides the median of ${ \Delta } L _ { \mathrm { m a x } } ( \boldsymbol { X } , \epsilon )$ with per-sample $\epsilon$ from models trained by FreeLB (Max Inc) and PGD (Mac Inc (R)), respectively.
164
+
165
+ Across all three datasets and different reference models, FreeLB has the smallest median increment even when starting from a larger natural loss than vanilla models. This demonstrates that FreeLB is more robust and invariant in most cases. Such results are also consistent with the models’ dev set performance (the performances for Vanilla/PGD/FreeLB models on RTE, CoLA and MRPC are 86.69/87.41/89.21, 69.91/70.84/71.40, 91.67/91.17/91.17, respectively).
166
+
167
+ Comparing with YOPO The original implementation of YOPO (Zhang et al., 2019) chooses the first convolutional layer of the ResNets as $f _ { 0 }$ for updating the adversary in the “s-loop”. As a result, each step of the “s-loop” should be using exactly the same value to update the adversary,and YOPO$m { - } n$ degenerates into FreeLB with a $n$ -times large step size. To avoid that, we choose the layers up to the output of the first Transformer block as $f _ { 0 }$ when implementing YOPO. To make the total amount of update on the adversary equal, we take the hyper-parameters for FreeLB- $m$ and only change the step size $\alpha$ into $\alpha / n$ for YOPO- $m { \cdot } n$ . Table 4 shows that FreeLB performs consistently better than YOPO on all three datasets. Accidentally, we also give the results comparing with YOPO- $\mathbf { \nabla } m - n$ without changing the step size $\alpha$ for YOPO in Table 8. The gap between two approaches seem to shrink, which may be caused by using a larger total step size for the YOPO adversaries. We leave exhaustive hyperparameter search for both models as our future work.
168
+
169
+ # 5 CONCLUSION
170
+
171
+ In this work, we have developed an adversarial training approach, FreeLB, to improve natural language understanding. The proposed approach adds perturbations to continuous word embeddings using a gradient method, and minimizes the resultant adversarial risk in an efficient way. FreeLB is able to boost Transformer-based model (BERT and RoBERTa) on several datasets and achieve new state of the art on GLUE and ARC benchmarks. Empirical study demonstrates that our method results in both higher robustness in the embedding space than natural training and better generalization ability. Such observation is also consistent with recent findings in Computer Vision. However, adversarial training still takes significant overhead compared with vanilla SGD. How to accelerate this process while improving generalization is an interesting future direction.
172
+
173
+ Acknowledgements: Goldstein and Zhu were supported in part by the DARPA GARD, DARPA QED for RML, and AFOSR MURI programs.
174
+
175
+ # REFERENCES
176
+
177
+ Eneko Agirre, Llu’is M‘arquez, and Richard Wicentowski (eds.). Proceedings of the Fourth International Workshop on Semantic Evaluations (SemEval-2007). Association for Computational Linguistics, 2007.
178
+
179
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018.
180
+
181
+ Roy Bar Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. 2006.
182
+
183
+ Yonatan Belinkov and Yonatan Bisk. Synthetic and natural noise both break neural machine translation. In ICLR, 2018.
184
+
185
+ Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. The fifth PASCAL recognizing textual entailment challenge. 2009.
186
+
187
+ Yong Cheng, Lu Jiang, and Wolfgang Macherey. Robust neural machine translation with doubly adversarial inputs. In ACL, 2019.
188
+
189
+ Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
190
+
191
+ Patrick L Combettes and Jean-Christophe Pesquet. Proximal splitting methods in signal processing. In Fixed-point algorithms for inverse problems in science and engineering. 2011.
192
+
193
+ Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment. Springer, 2006.
194
+
195
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
196
+
197
+ William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
198
+
199
+ Sanghamitra Dutta, Gauri Joshi, Soumyadip Ghosh, Parijat Dube, and Priya Nagpurkar. Slow and stale gradients can win the race: Error-runtime trade-offs in distributed sgd. In AISTATS, pp. 803–812, 2018.
200
+
201
+ Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. HotFlip: White-box adversarial examples for text classification. In ACL, 2018.
202
+
203
+ Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. In NeurIPS, 2016.
204
+
205
+ Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, 2007.
206
+
207
+ Tom Goldstein, Christoph Studer, and Richard Baraniuk. A field guide to forward-backward splitting with a fasta implementation. arXiv preprint 1411.3406, 2014.
208
+
209
+ Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
210
+
211
+ Shankar Iyer, Nikhil Dandekar, and Kornl Csernai. First quora dataset release: Question pairs, 2017. URL https://www.quora.com/q/quoradata/ First-Quora-Dataset-Release-Question-Pairs.
212
+
213
+ Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. Adversarial example generation with syntactically controlled paraphrase networks. In NAACL, 2018.
214
+
215
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In EMNLP, 2017.
216
+
217
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In ICLR, 2017.
218
+
219
+ Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. Race: Large-scale reading comprehension dataset from examinations. arXiv preprint arXiv:1704.04683, 2017.
220
+
221
+ Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. ICLR, 2020.
222
+
223
+ Hector J Levesque, Ernest Davis, and Leora Morgenstern. The Winograd schema challenge. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 2011.
224
+
225
+ Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. In ACL, 2019a.
226
+
227
+ 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, 2019b.
228
+
229
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
230
+
231
+ Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018.
232
+
233
+ Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Adversarial training methods for semisupervised text classification. In ICLR, 2017.
234
+
235
+ Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: A regularization method for supervised and semi-supervised learning. TPAMI, 2019.
236
+
237
+ Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Alhussein Fawzi, Soham De, Robert Stanforth, Pushmeet Kohli, et al. Adversarial robustness through local linearization. In NeurIPS, 2019.
238
+
239
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint 1910.10683, 2019.
240
+
241
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. In EMNLP, 2016.
242
+
243
+ Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Semantically equivalent adversarial rules for debugging NLP models. In ACL, 2018.
244
+
245
+ Parsa Saadatpanah, Ali Shafahi, and Tom Goldstein. Adversarial attacks on copyright detection systems. arXiv preprint 1906.07153, 2019.
246
+
247
+ Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, 2016.
248
+
249
+ A. Shafahi, M. Najibi, A. Ghiasi, Z. Xu, J. Dickerson, C. Studer, L. Davis, G. Taylor, and T. Goldstein. Adversarial Training for Free! In NeurIPS, 2019.
250
+
251
+ Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013.
252
+
253
+ Jure Sokolic, Raja Giryes, Guillermo Sapiro, and Miguel Rodrigues. Generalization error of invariant classifiers. In AISTATS, 2017.
254
+
255
+ Robert Speer, Joshua Chin, and Catherine Havasi. Conceptnet 5.5: An open multilingual graph of general knowledge. In AAAI, 2017.
256
+
257
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 2014.
258
+
259
+ Kai Sun, Dian Yu, Dong Yu, and Claire Cardie. Improving machine reading comprehension with general reading strategies. arXiv preprint arXiv:1810.13441, 2018.
260
+
261
+ Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. Commonsenseqa: A question answering challenge targeting commonsense knowledge. In NAACL, 2019.
262
+
263
+ Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In ICLR, 2019.
264
+
265
+ Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint 1805.12471, 2018.
266
+
267
+ Adina Williams, Nikita Nangia, and Samuel R. Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL, 2018.
268
+
269
+ Chaowei Xiao, Ruizhi Deng, Bo Li, Fisher Yu, Mingyan Liu, and Dawn Song. Characterizing adversarial examples based on spatial consistency information for semantic segmentation. In ECCV, 2018.
270
+
271
+ Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L. Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In CVPR, 2019.
272
+
273
+ Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 2012.
274
+
275
+ Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In NeurIPS, 2019.
276
+
277
+ Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Painless adversarial training using maximal principle. In NeurIPS, 2019.
278
+
279
+ Zhengli Zhao, Dheeru Dua, and Sameer Singh. Generating natural adversarial examples. In ICLR, 2018.
280
+
281
+ # A ADDITIONAL EXPERIMENTAL DETAILS
282
+
283
+ # A.1 PROBLEM FORMULATIONS
284
+
285
+ For tasks with ranking loss like ARC, CommonsenseQA, WNLI and QNLI, add the perturbation to the concatenation of the embeddings of all question/answer pairs.
286
+
287
+ Additional tricks are required to achieve high performance on WNLI and QNLI for the GLUE benchmark. We use the same tricks as Liu et al. (2019b). For WNLI, we use the same WSC data provided by Liu et al. (2019b) for training. For testing, Liu et al. (2019b) also provided the test set with span annotations, but the order is different form the GLUE dataset. We re-order their test set by matching. For the QNLI, we follow Liu et al. (2019b) and formulate the problem as pairwise ranking problem, which is the same for CommonsenseQA. We find the matching pairs for both training set and testing set by matching the queries in the dev set. We predict “entailment” if the candidate has the higher score, and “not entailment” otherwise.
288
+
289
+ # A.2 HYPER-PARAMETERS
290
+
291
+ Table 6: Additional hyper-parameters on GLUE tasks.
292
+
293
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MNLI</td><td rowspan=1 colspan=1>QNLI</td><td rowspan=1 colspan=1>QQP</td><td rowspan=1 colspan=1>RTE</td><td rowspan=1 colspan=1>SST-2</td><td rowspan=1 colspan=1>MRPC</td><td rowspan=1 colspan=1>CoLA</td><td rowspan=1 colspan=1>STS-B</td></tr><tr><td rowspan=1 colspan=1>E</td><td rowspan=1 colspan=1>2E-1</td><td rowspan=1 colspan=1>1.5E-1</td><td rowspan=1 colspan=1>4.5E-1</td><td rowspan=1 colspan=1>1.5E-1</td><td rowspan=1 colspan=1>6E-1</td><td rowspan=1 colspan=1>4E-1</td><td rowspan=1 colspan=1>2E-1</td><td rowspan=1 colspan=1>3E-1</td></tr><tr><td rowspan=1 colspan=1>a</td><td rowspan=1 colspan=1>1E-1</td><td rowspan=1 colspan=1>1E-1</td><td rowspan=1 colspan=1>1.5E-1</td><td rowspan=1 colspan=1>3E-2</td><td rowspan=1 colspan=1>1E-1</td><td rowspan=1 colspan=1>4E-2</td><td rowspan=1 colspan=1>2.5E-2</td><td rowspan=1 colspan=1>1E-1</td></tr><tr><td rowspan=1 colspan=1>m</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td></tr></table>
294
+
295
+ As other adversarial training methods, introduces three additional hyper-parameters: step size $\alpha$ , maximum perturbation $\epsilon$ , number of steps $m$ . For all other hyper-parameters such as learning rate and number of iterations, we either search in the same interval as RoBERTa (on CommonsenseQA, ARC, and WNLI), or use exactly the same setting as RoBERTa (except for MRPC, where we find using a learning rate of $5 \times 1 0 ^ { - 6 }$ gives better results).13. We list the best combinations for $\alpha , \epsilon$ and $m$ for each of the GLUE tasks in Table 6. For WSC/WNLI, the best combination is $\epsilon = 1 e - 2 , \alpha =$ $5 e - 3 , m = 2$ . Notice even when $m \alpha < \epsilon$ , the maximum perturbation could still reach $\epsilon$ due to the random initialization.
296
+
297
+ # B VARIANCE OF MAXIMUM INCREMENT OF LOSS
298
+
299
+ <table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=3>RTE</td><td rowspan=1 colspan=3>CoLA</td><td rowspan=1 colspan=3>MRPC</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>M-Inc(10-4)</td><td rowspan=1 colspan=1>M-Inc (R)(10-4)</td><td rowspan=1 colspan=1>N-Loss(10-4)</td><td rowspan=1 colspan=1>M-Inc(10-4)</td><td rowspan=1 colspan=1>M-Inc (R)(10-4)</td><td rowspan=1 colspan=1>N-Loss(10-4)</td><td rowspan=1 colspan=1>M-Inc(10-3)</td><td rowspan=1 colspan=1>M-Inc (R)(10-3)</td><td rowspan=1 colspan=1>N-Loss(10-3)</td></tr><tr><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>5.1(15087)</td><td rowspan=1 colspan=1>5.3(14346)</td><td rowspan=1 colspan=1>4.5(920)</td><td rowspan=1 colspan=1>6.1(13118)</td><td rowspan=1 colspan=1>5.7(14122)</td><td rowspan=1 colspan=1>5.2(447)</td><td rowspan=1 colspan=1>10.2(929)</td><td rowspan=1 colspan=1>10.2(955)</td><td rowspan=1 colspan=1>1.9(76)</td></tr><tr><td rowspan=1 colspan=1>PGD</td><td rowspan=1 colspan=1>4.7(10138)</td><td rowspan=1 colspan=1>4.9(1828)</td><td rowspan=1 colspan=1>6.2(752)</td><td rowspan=1 colspan=1>128.2(1300)</td><td rowspan=1 colspan=1>130.1(893)</td><td rowspan=1 colspan=1>436.1(1276)</td><td rowspan=1 colspan=1>5.7(321)</td><td rowspan=1 colspan=1>5.7(155)</td><td rowspan=1 colspan=1>5.4(54)</td></tr><tr><td rowspan=1 colspan=1>FreeLB</td><td rowspan=1 colspan=1>3.0(1614)</td><td rowspan=1 colspan=1>2.6(11114)</td><td rowspan=1 colspan=1>4.1(595)</td><td rowspan=1 colspan=1>1.4(1392)</td><td rowspan=1 colspan=1>1.3(6231)</td><td rowspan=1 colspan=1>7.2(615)</td><td rowspan=1 colspan=1>3.6(167)</td><td rowspan=1 colspan=1>3.6(601)</td><td rowspan=1 colspan=1>2.7(54)</td></tr></table>
300
+
301
+ Table 7: Median and Standard Deviation of the maximum increase in loss in the vicinity of the dev set samples for RoBERTa-Large model finetuned with different methods. Vanilla models are naturally trained RoBERTa’s. Nat Loss is the loss value on clean samples. Notice we require all clean samples here to be correctly classified by all models, which results in 227, 850 and 355 samples for RTE, CoLA and MRPC.
302
+
303
+ Table 7 provides the complete results for the increment of loss in the interval, with median and standard deviation.
304
+
305
+ # C ADDITIONAL RESULTS FOR ABLATION STUDIES
306
+
307
+ Here we provide some additional results for comparison with YOPO as complementary results to Table 4. We will release the complete results for comparing with YOPO and without variational dropout on each of the GLUE tasks in our next revision. From the current results, there is no need
308
+
309
+ <table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>FreeLB-3</td><td rowspan=1 colspan=1>YOPO-3-2</td><td rowspan=1 colspan=1>YOPO-3-3</td></tr><tr><td rowspan=1 colspan=1>STS-B</td><td rowspan=1 colspan=1>92.20 (.2)</td><td rowspan=1 colspan=1>92.67 (.08)</td><td rowspan=1 colspan=1>92.60 (.17)</td><td rowspan=1 colspan=1>92.60 (0.20)</td></tr><tr><td rowspan=1 colspan=1>SST-2</td><td rowspan=1 colspan=1>96.56 (.3)</td><td rowspan=1 colspan=1>96.79 (.2)</td><td rowspan=1 colspan=1>96.44 (.2)</td><td rowspan=1 colspan=1>96.33 (.1)</td></tr><tr><td rowspan=1 colspan=1>QNLI</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>94.98 (.2)</td><td rowspan=1 colspan=1>94.96 (.1)</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>QQP</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>92.60 (.03)</td><td rowspan=1 colspan=1>92.55 (.05)*</td><td rowspan=1 colspan=1>92.50 (.02)*</td></tr><tr><td rowspan=1 colspan=1>MNLI</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>90.61 (.1)</td><td rowspan=1 colspan=1>90.59 (.2)</td><td rowspan=1 colspan=1>90.45 (.2)</td></tr></table>
310
+
311
+ Table 8: The median and standard deviation of the scores on the dev sets of STS-B, SST-2, QNLI, QQP and MNLI from the GLUE benchmark, each computed from 5 runs with the same hyper-parameters except for the random seeds (except for the results with YOPO on QQP, which are from 4 runs). Also note here we use a step size of $\alpha$ for the adversary of YOPO-m-n, so YOPO effectively uses a step size of $_ { n \alpha }$ . We use FreeLB- $\mathbf { \nabla } m$ to denote FreeLB with $m$ ascent steps, and YOPO-3- $\mathbf { \nabla } \cdot \mathbf { n }$ to denote YOPO with $_ n$ shallow-layer ascents.
312
+
313
+ in using extra shallow-layer updates that YOPO advocates, since this consistently deteriorates the performance while introducing extra computations.
md/train/ByldLrqlx/ByldLrqlx.md ADDED
@@ -0,0 +1,496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEEPCODER: LEARNING TO WRITE PROGRAMS
2
+
3
+ Matej Balog∗ Department of Engineering University of Cambridge
4
+
5
+ Alexander L. Gaunt, Marc Brockschmidt, Sebastian Nowozin, Daniel Tarlow Microsoft Research
6
+
7
+ # ABSTRACT
8
+
9
+ We develop a first line of attack for solving programming competition-style problems from input-output examples using deep learning. The approach is to train a neural network to predict properties of the program that generated the outputs from the inputs. We use the neural network’s predictions to augment search techniques from the programming languages community, including enumerative search and an SMT-based solver. Empirically, we show that our approach leads to an order of magnitude speedup over the strong non-augmented baselines and a Recurrent Neural Network approach, and that we are able to solve problems of difficulty comparable to the simplest problems on programming competition websites.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ A dream of artificial intelligence is to build systems that can write computer programs. Recently, there has been much interest in program-like neural network models (Graves et al., 2014; Weston et al., 2015; Kurach et al., 2015; Joulin & Mikolov, 2015; Grefenstette et al., 2015; Sukhbaatar et al., 2015; Neelakantan et al., 2016; Kaiser & Sutskever, 2016; Reed & de Freitas, 2016; Zaremba et al., 2016; Graves et al., 2016), but none of these can write programs; that is, they do not generate human-readable source code. Only very recently, Riedel et al. (2016); Bunel et al. (2016); Gaunt et al. (2016) explored the use of gradient descent to induce source code from input-output examples via differentiable interpreters, and Ling et al. (2016) explored the generation of source code from unstructured text descriptions. However, Gaunt et al. (2016) showed that differentiable interpreterbased program induction is inferior to discrete search-based techniques used by the programming languages community. We are then left with the question of how to make progress on program induction using machine learning techniques.
14
+
15
+ In this work, we propose two main ideas: (1) learn to induce programs; that is, use a corpus of program induction problems to learn strategies that generalize across problems, and (2) integrate neural network architectures with search-based techniques rather than replace them.
16
+
17
+ In more detail, we can contrast our approach to existing work on differentiable interpreters. In differentiable interpreters, the idea is to define a differentiable mapping from source code and inputs to outputs. After observing inputs and outputs, gradient descent can be used to search for a program that matches the input-output examples. This approach leverages gradient-based optimization, which has proven powerful for training neural networks, but each synthesis problem is still solved independently—solving many synthesis problems does not help to solve the next problem.
18
+
19
+ We argue that machine learning can provide significant value towards solving Inductive Program Synthesis (IPS) by re-casting the problem as a big data problem. We show that training a neural network on a large number of generated IPS problems to predict cues from the problem description can help a search-based technique. In this work, we focus on predicting an order on the program space and show how to use it to guide search-based techniques that are common in the programming languages community. This approach has three desirable properties: first, we transform a difficult search problem into a supervised learning problem; second, we soften the effect of failures of the neural network by searching over program space rather than relying on a single prediction; and third, the neural network’s predictions are used to guide existing program synthesis systems, allowing us to use and improve on the best solvers from the programming languages community. Empirically, we show orders-of-magnitude improvements over optimized standard search techniques and a Recurrent Neural Network-based approach to the problem.
20
+
21
+ In summary, we define and instantiate a framework for using deep learning for program synthesis problems like ones appearing on programming competition websites. Our concrete contributions are:
22
+
23
+ 1. defining a programming language that is expressive enough to include real-world programming problems while being high-level enough to be predictable from input-output examples; 2. models for mapping sets of input-output examples to program properties; and 3. experiments that show an order of magnitude speedup over standard program synthesis techniques, which makes this approach feasible for solving problems of similar difficulty as the simplest problems that appear on programming competition websites.
24
+
25
+ # 2 BACKGROUND ON INDUCTIVE PROGRAM SYNTHESIS
26
+
27
+ We begin by providing background on Inductive Program Synthesis, including a brief overview of how it is typically formulated and solved in the programming languages community.
28
+
29
+ The Inductive Program Synthesis (IPS) problem is the following: given input-output examples, produce a program that has behavior consistent with the examples.
30
+
31
+ Building an IPS system requires solving two problems. First, the search problem: to find consistent programs we need to search over a suitable set of possible programs. We need to define the set (i.e., the program space) and search procedure. Second, the ranking problem: if there are multiple programs consistent with the input-output examples, which one do we return? Both of these problems are dependent on the specifics of the problem formulation. Thus, the first important decision in formulating an approach to program synthesis is the choice of a Domain Specific Language.
32
+
33
+ Domain Specific Languages (DSLs). DSLs are programming languages that are suitable for a specialized domain but are more restrictive than full-featured programming languages. For example, one might disallow loops or other control flow, and only allow string data types and a small number of primitive operations like concatenation. Most of program synthesis research focuses on synthesizing programs in DSLs, because full-featured languages like $\mathrm { C } { + + }$ enlarge the search space and complicate synthesis. Restricted DSLs can also enable more efficient special-purpose search algorithms. For example, if a DSL only allows concatenations of substrings of an input string, a dynamic programming algorithm can efficiently search over all possible programs (Polozov & Gulwani, 2015). The choice of DSL also affects the difficulty of the ranking problem. For example, in a DSL without if statements, the same algorithm is applied to all inputs, reducing the number of programs consistent with any set of input-output examples, and thus the ranking problem becomes easier. Of course, the restrictiveness of the chosen DSL also determines which problems the system can solve at all.
34
+
35
+ Search Techniques. There are many techniques for searching for programs consistent with inputoutput examples. Perhaps the simplest approach is to define a grammar and then enumerate all derivations of the grammar, checking each one for consistency with the examples. This approach can be combined with pruning based on types and other logical reasoning (Feser et al., 2015). While simple, these approaches can be implemented efficiently, and they can be surprisingly effective.
36
+
37
+ In restricted domains such as the concatenation example discussed above, special-purpose algorithms can be used. FlashMeta (Polozov & Gulwani, 2015) describes a framework for DSLs which allow decomposition of the search problem, e.g., where the production of an output string from an input string can be reduced to finding a program for producing the first part of the output and concatenating it with a program for producing the latter part of the output string.
38
+
39
+ Another class of systems is based on Satisfiability Modulo Theories (SMT) solving. SMT combines SAT-style search with theories like arithmetic and inequalities, with the benefit that theory-dependent subproblems can be handled by special-purpose solvers. For example, a special-purpose solver can easily find integers $x , y$ such that $x < y$ and $y < - 1 0 0$ hold, whereas an enumeration strategy may need to consider many values before satisfying the constraints. Many program synthesis engines based on SMT solvers exist, e.g., Sketch (Solar-Lezama, 2008) and Brahma (Gulwani et al., 2011). They convert the semantics of a DSL into a set of constraints between variables representing the program and the input-output values, and then call an SMT solver to find a satisfying setting of the program variables. This approach shines when special-purpose reasoning can be leveraged, but complex DSLs can lead to very large constraint problems where constructing and manipulating the constraints can be a lot slower than an enumerative approach.
40
+
41
+ Finally, stochastic local search can be employed to search over program space, and there is a long history of applying genetic algorithms to this problem. One of the most successful recent examples is the STOKE super-optimization system (Schkufza et al., 2016), which uses stochastic local search to find assembly programs that have the same semantics as an input program but execute faster.
42
+
43
+ Ranking. While we focus on the search problem in this work, we briefly mention the ranking problem here. A popular choice for ranking is to choose the shortest program consistent with inputoutput examples (Gulwani, 2016). A more sophisticated approach is employed by FlashFill (Singh & Gulwani, 2015). It works in a manner similar to max-margin structured prediction, where known ground truth programs are given, and the learning task is to assign scores to programs such that the ground truth programs score higher than other programs that satisfy the input-output specification.
44
+
45
+ # 3 LEARNING INDUCTIVE PROGRAM SYNTHESIS (LIPS)
46
+
47
+ In this section we outline the general approach that we follow in this work, which we call Learning Inductive Program Synthesis (LIPS). The details of our instantiation of LIPS appear in Sect. 4. The components of LIPS are (1) a DSL specification, (2) a data-generation procedure, (3) a machine learning model that maps from input-output examples to program attributes, and (4) a search procedure that searches program space in an order guided by the model from (3). The framework is related to the formulation of Menon et al. (2013); the relationship and key differences are discussed in Sect. 6.
48
+
49
+ (1) DSL and Attributes. The choice of DSL is important in LIPS, just as it is in any program synthesis system. It should be expressive enough to capture the problems that we wish to solve, but restricted as much as possible to limit the difficulty of the search. In LIPS we additionally specify an attribute function $\mathcal { A }$ that maps programs $P$ of the DSL to finite attribute vectors $\mathbf { \boldsymbol { a } } \overset { \cdot } { = } \mathbf { \bar { A } } ( \mathbf { \boldsymbol { P } } )$ . (Attribute vectors of different programs need not have equal length.) Attributes serve as the link between the machine learning and the search component of LIPS: the machine learning model predicts a distribution $q ( \pmb { a } \mid \mathcal { E } )$ , where $\mathcal { E }$ is the set of input-output examples, and the search procedure aims to search over programs $P$ as ordered by $q ( { \bar { \mathcal { A } } } ( { \bar { P } } ) \mid \varepsilon )$ . Thus an attribute is useful if it is both predictable from input-output examples, and if conditioning on its value significantly reduces the effective size of the search space.
50
+
51
+ Possible attributes are the (perhaps position-dependent) presence or absence of high-level functions (e.g., does the program contain or end in a call to SORT). Other possible attributes include control flow templates (e.g., the number of loops and conditionals). In the extreme case, one may set $\mathcal { A }$ to the identity function, in which case the attribute is equivalent to the program; however, in our experiments we find that performance is improved by choosing a more abstract attribute function.
52
+
53
+ (2) Data Generation. Step 2 is to generate a dataset $( ( P ^ { ( n ) } , \pmb { a } ^ { ( n ) } , \pmb { \mathcal { E } } ^ { ( n ) } ) ) _ { n = 1 } ^ { N }$ of programs $P ^ { ( n ) }$ in the chosen DSL, their attributes $\mathbf { \pmb { a } } ^ { ( n ) }$ , and accompanying input-output examples ${ \mathcal { E } } ^ { ( n ) }$ . Different approaches are possible, ranging from enumerating valid programs in the DSL and pruning, to training a more sophisticated generative model of programs in the DSL. The key in the LIPS formulation is to ensure that it is feasible to generate a large dataset (ideally millions of programs).
54
+
55
+ (3) Machine Learning Model. The machine learning problem is to learn a distribution of attributes given input-output examples, $q ( \pmb { a } \mid \mathcal { E } )$ . There is freedom to explore a large space of models, so long as the input component can encode $\mathcal { E }$ , and the output is a proper distribution over attributes (e.g., if attributes are a fixed-size binary vector, then a neural network with independent sigmoid outputs is appropriate; if attributes are variable size, then a recurrent neural network output could be used). Attributes are observed at training time, so training can use a maximum likelihood objective.
56
+
57
+ (4) Search. The aim of the search component is to interface with an existing solver, using the predicted $q ( \pmb { a } \mid \mathcal { E } )$ to guide the search. We describe specific approaches in the next section.
58
+
59
+ # 4 DEEPCODER
60
+
61
+ Here we describe DeepCoder, our instantiation of LIPS including a choice of DSL, a data generation strategy, models for encoding input-output sets, and algorithms for searching over program space.
62
+
63
+ # 4.1 DOMAIN SPECIFIC LANGUAGE AND ATTRIBUTES
64
+
65
+ We consider binary attributes indicating the presence or absence of high-level functions in the target program. To make this effective, the chosen DSL needs to contain constructs that are not so low-level that they all appear in the vast majority of programs, but at the same time should be common enough so that predicting their occurrence from input-output examples can be learned successfully.
66
+
67
+ Following this observation, our DSL is loosely inspired by query languages such as SQL or LINQ, where high-level functions are used in sequence to manipulate data. A program in our DSL is a sequence of function calls, where the result of each call initializes a fresh variable that is either a singleton integer or an integer array. Functions can be applied to any of the inputs or previously computed (intermediate) variables. The output of the program is the return value of the last function call, i.e., the last variable. See Fig. 1 for an example program of length $T = 4$ in our DSL.
68
+
69
+ ![](images/95255e32da9df33db9a517e94978033a462b93ebbbe24b571c4b80d5e2c7f8e6.jpg)
70
+ Figure 1: An example program in our DSL that takes a single integer array as its input.
71
+
72
+ Overall, our DSL contains the first-order functions HEAD, LAST, TAKE, DROP, ACCESS, MINIMUM, MAXIMUM, REVERSE, SORT, SUM, and the higher-order functions MAP, FILTER, COUNT, ZIPWITH, SCANL1. Higher-order functions require suitable lambda functions for their behavior to be fully specified: for MAP our DSL provides lambdas $( + 1 )$ , $( - 1 )$ , $( \star 2 )$ , $( / 2 )$ ), $( \star \ ( - 1 ) \ )$ ), $( \star \star 2 )$ , $( \star 3 )$ , $( / 3 )$ , $( \star 4 )$ , $( / 4 )$ ; for FILTER and COUNT there are predicates $( > 0 )$ ), $( < 0 )$ , ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 0$ ), ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 1$ ) and for ZIPWITH and SCANL1 the DSL provides lambdas $( + ) , ( - ) , ( \star ) ,$ MIN, MAX. A description of the semantics of all functions is provided in Appendix F.
73
+
74
+ Note that while the language only allows linear control flow, many of its functions do perform branching and looping internally (e.g., SORT, COUNT, ...). Examples of more sophisticated programs expressible in our DSL, which were inspired by the simplest problems appearing on programming competition websites, are shown in Appendix A.
75
+
76
+ # 4.2 DATA GENERATION
77
+
78
+ To generate a dataset, we enumerate programs in the DSL, heuristically pruning away those with easily detectable issues such as a redundant variable whose value does not affect the program output, or, more generally, existence of a shorter equivalent program (equivalence can be overapproximated by identical behavior on randomly or carefully chosen inputs). To generate valid inputs for a program, we enforce a constraint on the output value bounding integers to some predetermined range, and then propagate these constraints backward through the program to obtain a range of valid values for each input. If one of these ranges is empty, we discard the program. Otherwise, input-output pairs can be generated by picking inputs from the pre-computed valid ranges and executing the program to obtain the output values. The binary attribute vectors are easily computed from the program source codes.
79
+
80
+ # 4.3 MACHINE LEARNING MODEL
81
+
82
+ Observe how the input-output data in Fig. 1 is informative of the functions appearing in the program: the values in the output are all negative, divisible by 4, they are sorted in decreasing order, and they happen to be multiples of numbers appearing in the input. Our aim is to learn to recognize such patterns in the input-output examples, and to leverage them to predict the presence or absence of individual functions. We employ neural networks to model and learn the mapping from input-output examples to attributes. We can think of these networks as consisting of two parts:
83
+
84
+ 1. an encoder: a differentiable mapping from a set of $M$ input-output examples generated by a single program to a latent real-valued vector, and 2. a decoder: a differentiable mapping from the latent vector representing a set of $M$ inputoutput examples to predictions of the ground truth program’s attributes.
85
+
86
+ For the encoder we use a simple feed-forward architecture. First, we represent the input and output types (singleton or array) by a one-hot-encoding, and we pad the inputs and outputs to a maximum length $L$ with a special NULL value. Second, each integer in the inputs and in the output is mapped to a learned embedding vector of size $E = 2 0$ . (The range of integers is restricted to a finite range and each embedding is parametrized individually.) Third, for each input-output example separately, we concatenate the embeddings of the input types, the inputs, the output type, and the output into a single (fixed-length) vector, and pass this vector through $H = 3$ hidden layers containing $K = 2 5 6$ sigmoid units each. The third hidden layer thus provides an encoding of each individual input-output example. Finally, for input-output examples in a set generated from the same program, we pool these representations together by simple arithmetic averaging. See Appendix C for more details.
87
+
88
+ The advantage of this encoder lies in its simplicity, and we found it reasonably easy to train. A disadvantage is that it requires an upper bound $L$ on the length of arrays appearing in the input and output. We confirmed that the chosen encoder architecture is sensible in that it performs empirically at least as well as an RNN encoder, a natural baseline, which may however be more difficult to train.
89
+
90
+ DeepCoder learns to predict presence or absence of individual functions of the DSL. We shall see this can already be exploited by various search techniques to large computational gains. We use a decoder that pre-multiplies the encoding of input-output examples by a learned $C \times K$ matrix, where $C = 3 4$ is the number of functions in our DSL (higher-order functions and lambdas are predicted independently), and treats the resulting $C$ numbers as log-unnormalized probabilities (logits) of each function appearing in the source code. Fig. 2 shows the predictions a trained neural network made from 5 input-output examples for the program shown in Fig. 1.
91
+
92
+ ![](images/c3c080b2a8813d24f061fe69fe44372e58ba574c230d52185f026a848a7215ca.jpg)
93
+ Figure 2: Neural network predicts the probability of each function appearing in the source code.
94
+
95
+ # 4.4 SEARCH
96
+
97
+ One of the central ideas of this work is to use a neural network to guide the search for a program consistent with a set of input-output examples instead of directly predicting the entire source code. This section briefly describes the search techniques and how they integrate the predicted attributes.
98
+
99
+ Depth-first search (DFS). We use an optimized version of DFS to search over programs with a given maximum length $T$ (see Appendix D for details). When the search procedure extends a partial program by a new function, it has to try the functions in the DSL in some order. At this point DFS can opt to consider the functions as ordered by their predicted probabilities from the neural network.
100
+
101
+ “Sort and add” enumeration. A stronger way of utilizing the predicted probabilities of functions in an enumerative search procedure is to use a Sort and add scheme, which maintains a set of active functions and performs DFS with the active function set only. Whenever the search fails, the next most probable function (or several) are added to the active set and the search restarts with this larger active set. Note that this scheme has the deficiency of potentially re-exploring some parts of the search space several times, which could be avoided by a more sophisticated search procedure.
102
+
103
+ Sketch. Sketch (Solar-Lezama, 2008) is a successful SMT-based program synthesis tool from the programming languages research community. While its main use case is to synthesize programs by filling in “holes” in incomplete source code so as to match specified requirements, it is flexible enough for our use case as well. The function in each step and its arguments can be treated as the “holes”, and the requirement to be satisfied is consistency with the provided set of input-output examples. Sketch can utilize the neural network predictions in a Sort and add scheme as described above, as the possibilities for each function hole can be restricted to the current active set.
104
+
105
+ $\lambda ^ { 2 }$ . $\lambda ^ { 2 }$ (Feser et al., 2015) is a program synthesis tool from the programming languages community that combines enumerative search with deduction to prune the search space. It is designed to infer small functional programs for data structure manipulation from input-output examples, by combining functions from a provided library. $\lambda ^ { 2 }$ can be used in our framework using a Sort and add scheme as described above by choosing the library of functions according to the neural network predictions.
106
+
107
+ # 4.5 TRAINING LOSS FUNCTION
108
+
109
+ We use the negative cross entropy loss to train the neural network described in Sect. 4.3, so that its predictions about each function can be interpreted as marginal probabilities. The LIPS framework dictates learning $q ( \pmb { a } \mid \mathcal { E } )$ , the joint distribution of all attributes $\textbf { \em a }$ given the input-output examples, and it is not clear a priori how much DeepCoder loses by ignoring correlations between functions. However, under the simplifying assumption that the runtime of searching for a program of length $T$ with $C$ functions made available to a search routine is proportional to $\check { C } ^ { T }$ , the following result for Sort and add procedures shows that their runtime can be optimized using marginal probabilities.
110
+
111
+ Lemma 1. For any fixed program length $T$ , the expected total runtime of a Sort and add search scheme can be upper bounded by a quantity that is minimized by adding the functions in the order of decreasing true marginal probabilities.
112
+
113
+ Proof. Predicting source code functions from input-output examples can be seen as a multi-label classification problem, where each set of input-output examples is associated with a set of relevant labels (functions appearing in the ground truth source code). Dembczynski et al. (2010) showed that in multi-label classification under a so-called Rank loss, it is Bayes optimal to rank the labels according to their marginal probabilities. If the runtime of search with $C$ functions is proportional to $C ^ { T }$ , the total runtime of a Sort and add procedure can be monotonically transformed so that it is upper bounded by this Rank loss. See Appendix E for more details. □
114
+
115
+ # 5 EXPERIMENTS
116
+
117
+ In this section we report results from two categories of experiments. Our main experiments (Sect. 5.1) show that the LIPS framework can lead to significant performance gains in solving IPS by demonstrating such gains with DeepCoder. In Sect. 5.2 we illustrate the robustness of the method by demonstrating a strong kind of generalization ability across programs of different lengths.
118
+
119
+ # 5.1 DEEPCODER COMPARED TO BASELINES
120
+
121
+ We trained a neural network as described in Sect. 4.3 to predict used functions from input-output examples and constructed a test set of $P = 5 0 0$ programs, guaranteed to be semantically disjoint from all programs on which the neural network was trained (similarly to the equivalence check described in Sect. 4.2, we have ensured that all test programs behave differently from all programs used during training on at least one input). For each test program we generated $M = 5$ input-output examples involving integers of magnitudes up to 256, passed the examples to the trained neural network, and fed the obtained predictions to the search procedures from Sect. 4.4. We also considered a RNN-based decoder generating programs using beam search (see Sect. 5.3 for details). To evaluate DeepCoder, we then recorded the time the search procedures needed to find a program consistent with the $M$ input-output examples. As a baseline, we also ran all search procedures using a simple prior as function probabilities, computed from their global incidence in the program corpus.
122
+
123
+ In the first, smaller-scale experiment (program search space size $\sim 2 \times 1 0 ^ { 6 }$ ) we trained the neural network on programs of length $T = 3$ , and the test programs were of the same length. Table 1 shows the per-task timeout required such that a solution could be found for given proportions of the test tasks (in time less than or equal to the timeout). For example, in a hypothetical test set with 4 tasks and runtimes of 3s, 2s, 1s, 4s, the timeout required to solve $50 \%$ of tasks would be 2s. More detailed experimental results are discussed in Appendix B.
124
+
125
+ Table 1: Search speedups on programs of length $T = 3$ due to using neural network predictions.
126
+
127
+ <table><tr><td rowspan="2">Timeout needed to solve</td><td colspan="3">DFS</td><td colspan="3">Enumeration</td><td colspan="3">12</td><td colspan="2">Sketch</td><td>Beam</td></tr><tr><td>20%</td><td>40%</td><td>60%</td><td>20%</td><td>40%</td><td>60%</td><td>20%</td><td>40%</td><td>60%</td><td>20%</td><td>40%</td><td>20%</td></tr><tr><td>Baseline</td><td>41ms</td><td>126ms</td><td>314ms</td><td>80ms</td><td>:335ms861ms</td><td></td><td>18.9s</td><td>49.6s 84.2s</td><td></td><td>&gt;103s</td><td>&gt;103s</td><td>&gt;103s</td></tr><tr><td>DeepCoder</td><td>2.7ms</td><td>33ms</td><td>110ms</td><td>1.3ms</td><td>6.1ms</td><td>27ms</td><td>0.23s</td><td>0.52s 13.5s</td><td></td><td>2.13s</td><td>455s</td><td>292s</td></tr><tr><td>Speedup</td><td>15.2×</td><td>3.9×</td><td>2.9×</td><td>62.2×</td><td>54.6×</td><td>31.5×</td><td>80.4×</td><td>94.6×</td><td>6.2×</td><td>&gt;467×</td><td>&gt;2.2×</td><td>&gt;3.4×</td></tr></table>
128
+
129
+ In the main experiment, we tackled a large-scale problem of searching for programs consistent with input-output examples generated from programs of length $T = 5$ (search space size on the order of $1 0 ^ { \overline { { 1 0 } } }$ ), supported by a neural network trained with programs of shorter length $T = 4$ . Here, we only consider $P = 1 0 0$ programs for reasons of computational efficiency, after having verified that this does not significantly affect the results in Table 1. The table in Fig. 3a shows significant speedups for DFS, Sort and add enumeration, and $\lambda ^ { 2 }$ with Sort and add enumeration, the search techniques capable of solving the search problem in reasonable time frames. Note that Sort and add enumeration without the neural network (using prior probabilities of functions) exceeded the $1 0 ^ { 4 }$ second timeout in two cases, so the relative speedups shown are crude lower bounds.
130
+
131
+ ![](images/a7cd9438bdca3d6b3e822af385015998ac105636d940628b2f68f443f81b05e3.jpg)
132
+ Figure 3: Search speedups on programs of length $T = 5$ and influence of length of training programs.
133
+
134
+ We hypothesize that the substantially larger performance gains on Sort and add schemes as compared to gains on DFS can be explained by the fact that the choice of attribute function (predicting presence of functions anywhere in the program) and learning objective of the neural network are better matched to the Sort and add schemes. Indeed, a more appropriate attribute function for DFS would be one that is more informative of the functions appearing early in the program, since exploring an incorrect first function is costly with DFS. On the other hand, the discussion in Sect. 4.5 provides theoretical indication that ignoring the correlations between functions is not cataclysmic for Sort and add enumeration, since a Rank loss that upper bounds the Sort and add runtime can still be minimized.
135
+
136
+ In Appendix G we analyse the performance of the neural networks used in these experiments, by investigating which attributes (program instructions) tend to be difficult to distinguish from each other.
137
+
138
+ # 5.2 GENERALIZATION ACROSS PROGRAM LENGTHS
139
+
140
+ To investigate the encoder’s generalization ability across programs of different lengths, we trained a network to predict used functions from input-output examples that were generated from programs of length $T _ { \mathrm { t r a i n } } \in \{ 1 , . . . , 4 \}$ . We then used each of these networks to predict functions on 5 test sets containing input-output examples generated from programs of lengths $T _ { \mathrm { t e s t } } \in \{ 1 , . . . , 5 \}$ , respectively. The test programs of a given length $T$ were semantically disjoint from all training programs of the same length $T$ and also from all training and test programs of shorter lengths $T ^ { \prime } < T$ .
141
+
142
+ For each of the combinations of $T _ { \mathrm { t r a i n } }$ and $T _ { \mathrm { t e s t } }$ , Sort and add enumerative search was run both with and without using the neural network’s predictions (in the latter case using prior probabilities) until it solved $2 0 \%$ of the test set tasks. Fig. 3b shows the relative speedup of the solver having access to predictions from the trained neural networks. These results indicate that the neural networks are able to generalize beyond programs of the same length that they were trained on. This is partly due to the search procedure on top of their predictions, which has the opportunity to correct for the presence of functions that the neural network failed to predict. Note that a sequence-to-sequence model trained on programs of a fixed length could not be expected to exhibit this kind of generalization ability.
143
+
144
+ # 5.3 ALTERNATIVE MODELS
145
+
146
+ Encoder We evaluated replacing the feed-forward architecture encoder (Sect. 4.3) with an RNN, a natural baseline. Using a GRU-based RNN we were able to achieve results almost as good as using the feed-forward architecture, but found the RNN encoder more difficult to train.
147
+
148
+ Decoder We also considered a purely neural network-based approach, where an RNN decoder is trained to predict the entire program token-by-token. We combined this with our feed-forward encoder by initializing the RNN using the pooled final layer of the encoder. We found it substantially more difficult to train an RNN decoder as compared to the independent binary classifiers employed above. Beam search was used to explore likely programs predicted by the RNN, but it only lead to a solution comparable with the other techniques when searching for programs of lengths $T \le 2$ , where the search space size is very small (on the order of $1 0 ^ { 3 }$ ). Note that using an RNN for both the encoder and decoder corresponds to a standard sequence-to-sequence model. However, we do do not rule out that a more sophisticated RNN decoder or training procedure could be possibly more successful.
149
+
150
+ # 6 RELATED WORK
151
+
152
+ Machine Learning for Inductive Program Synthesis. There is relatively little work on using machine learning for programming by example. The most closely related work is that of Menon et al. (2013), in which a hand-coded set of features of input-output examples are used as “clues.” When a clue appears in the input-output examples (e.g., the output is a permutation of the input), it reweights the probabilities of productions in a probabilistic context free grammar by a learned amount. This work shares the idea of learning to guide the search over program space conditional on input-output examples. One difference is in the domains. Menon et al. (2013) operate on short string manipulation programs, where it is arguably easier to hand-code features to recognize patterns in the input-output examples (e.g., if the outputs are always permutations or substrings of the input). Our work shows that there are strong cues in patterns in input-output examples in the domain of numbers and lists. However, the main difference is the scale. Menon et al. (2013) learns from a small (280 examples), manually-constructed dataset, which limits the capacity of the machine learning model that can be trained. Thus, it forces the machine learning component to be relatively simple. Indeed, Menon et al. (2013) use a log-linear model and rely on hand-constructed features. LIPS automatically generates training data, which yields datasets with millions of programs and enables high-capacity deep learning models to be brought to bear on the problem.
153
+
154
+ Learning Representations of Program State. Piech et al. (2015) propose to learn joint embeddings of program states and programs to automatically extend teacher feedback to many similar programs in the MOOC setting. This work is similar in that it considers embedding program states, but the domain is different, and it otherwise specifically focuses on syntactic differences between semantically equivalent programs to provide stylistic feedback. Li et al. (2016) use graph neural networks (GNNs) to predict logical descriptions from program states, focusing on data structure shapes instead of numerical and list data. Such GNNs may be a suitable architecture to encode states appearing when extending our DSL to handle more complex data structures.
155
+
156
+ Learning to Infer. Very recently, Alemi et al. (2016) used neural sequence models in tandem with an automated theorem prover. Similar to our Sort and Add strategy, a neural network component is trained to select premises that the theorem prover can use to prove a theorem. A recent extension (Loos et al., 2017) is similar to our DFS enumeration strategy and uses a neural network to guide the proof search at intermediate steps. The main differences are in the domains, and that they train on an existing corpus of theorems. More broadly, if we view a DSL as defining a model and search as a form of inference algorithm, then there is a large body of work on using discriminatively-trained models to aid inference in generative models. Examples include Dayan et al. (1995); Kingma & Welling (2014); Shotton et al. (2013); Stuhlmuller et al. (2013); Heess et al. (2013); Jampani et al. ¨ (2015).
157
+
158
+ # 7 DISCUSSION AND FUTURE WORK
159
+
160
+ We have presented a framework for improving IPS systems by using neural networks to translate cues in input-output examples to guidance over where to search in program space. Our empirical results show that for many programs, this technique improves the runtime of a wide range of IPS baselines by 1-3 orders. We have found several problems in real online programming challenges that can be solved with a program in our language, which validates the relevance of the class of problems that we have studied in this work. In sum, this suggests that we have made significant progress towards being able to solve programming competition problems, and the machine learning component plays an important role in making it tractable.
161
+
162
+ There remain some limitations, however. First, the programs we can synthesize are only the simplest problems on programming competition websites and are simpler than most competition problems. Many problems require more complex algorithmic solutions like dynamic programming and search, which are currently beyond our reach. Our chosen DSL currently cannot express solutions to many problems. To do so, it would need to be extended by adding more primitives and allow for more flexibility in program constructs (such as allowing loops). Second, we currently use five input-output examples with relatively large integer values (up to 256 in magnitude), which are probably more informative than typical (smaller) examples. While we remain optimistic about LIPS’s applicability as the DSL becomes more complex and the input-output examples become less informative, it remains to be seen what the magnitude of these effects are as we move towards solving large subsets of programming competition problems.
163
+
164
+ We foresee many extensions of DeepCoder. We are most interested in better data generation procedures by using generative models of source code, and to incorporate natural language problem descriptions to lessen the information burden required from input-output examples. In sum, DeepCoder represents a promising direction forward, and we are optimistic about the future prospects of using machine learning to synthesize programs.
165
+
166
+ # ACKNOWLEDGMENTS
167
+
168
+ The authors would like to express their gratitude to Rishabh Singh and Jack Feser for their valuable guidance and help on using the Sketch and $\lambda ^ { 2 }$ program synthesis systems.
169
+
170
+ # REFERENCES
171
+
172
+ Alex A. Alemi, Franc¸ois Chollet, Geoffrey Irving, Christian Szegedy, and Josef Urban. DeepMath - deep sequence models for premise selection. In Proocedings of the 29th Conference on Advances in Neural Information Processing Systems (NIPS), 2016.
173
+ Rudy R Bunel, Alban Desmaison, Pawan K Mudigonda, Pushmeet Kohli, and Philip Torr. Adaptive neural compilation. In Proceedings of the 29th Conference on Advances in Neural Information Processing Systems (NIPS), 2016.
174
+ Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The Helmholtz machine. Neural computation, 7(5):889–904, 1995.
175
+ Krzysztof Dembczynski, Willem Waegeman, Weiwei Cheng, and Eyke H ´ ullermeier. On label de- ¨ pendence and loss minimization in multi-label classification. Machine Learning, 88(1):5–45, 2012.
176
+ Krzysztof J. Dembczynski, Weiwei Cheng, and Eyke Hllermeier. Bayes optimal multilabel classification via probabilistic classifier chains. In Proceedings of the 27th International Conference on Machine Learning (ICML), 2010.
177
+ John K. Feser, Swarat Chaudhuri, and Isil Dillig. Synthesizing data structure transformations from input-output examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2015.
178
+ Alexander L. Gaunt, Marc Brockschmidt, Rishabh Singh, Nate Kushman, Pushmeet Kohli, Jonathan Taylor, and Daniel Tarlow. Terpret: A probabilistic programming language for program induction. CoRR, abs/1608.04428, 2016. URL http://arxiv.org/abs/1608.04428.
179
+
180
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural Turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
181
+
182
+ Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 2016.
183
+
184
+ Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Proceedings of the 28th Conference on Advances in Neural Information Processing Systems (NIPS), 2015.
185
+
186
+ Sumit Gulwani. Programming by examples: Applications, algorithms, and ambiguity resolution. In Proceedings of the 8th International Joint Conference on Automated Reasoning (IJCAR), 2016.
187
+
188
+ Sumit Gulwani, Susmit Jha, Ashish Tiwari, and Ramarathnam Venkatesan. Synthesis of loop-free programs. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2011.
189
+
190
+ Nicolas Heess, Daniel Tarlow, and John Winn. Learning to pass expectation propagation messages. In Proceedings of the 26th Conference on Advances in Neural Information Processing Systems (NIPS), 2013.
191
+
192
+ Varun Jampani, Sebastian Nowozin, Matthew Loper, and Peter V Gehler. The informed sampler: A discriminative approach to Bayesian inference in generative computer vision models. Computer Vision and Image Understanding, 136:32–44, 2015.
193
+
194
+ Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Proceedings of the 28th Conference on Advances in Neural Information Processing Systems (NIPS), 2015.
195
+
196
+ Łukasz Kaiser and Ilya Sutskever. Neural GPUs learn algorithms. In Proceedings of the 4th International Conference on Learning Representations, 2016.
197
+
198
+ Diederik P Kingma and Max Welling. Stochastic gradient VB and the variational auto-encoder. In Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2014.
199
+
200
+ Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random-access machines. In Proceedings of the 4th International Conference on Learning Representations 2016, 2015.
201
+
202
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard S. Zemel. Gated graph sequence neural networks. In Proceedings of the 4th International Conference on Learning Representations (ICLR), 2016.
203
+
204
+ Wang Ling, Edward Grefenstette, Karl Moritz Hermann, Toma´s Ko ˇ cisk ˇ y, Andrew Senior, Fumin ´ Wang, and Phil Blunsom. Latent predictor networks for code generation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, 2016.
205
+
206
+ Sarah M. Loos, Geoffrey Irving, Christian Szegedy, and Cezary Kaliszyk. Deep network guided proof search. CoRR, abs/1701.06972, 2017. URL http://arxiv.org/abs/1701.06972.
207
+
208
+ Aditya Krishna Menon, Omer Tamuz, Sumit Gulwani, Butler W Lampson, and Adam Kalai. A machine learning framework for programming by example. In Proceedings of the International Conference on Machine Learning (ICML), 2013.
209
+
210
+ Arvind Neelakantan, Quoc V. Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. In Proceedings of the 4th International Conference on Learning Representations (ICLR), 2016.
211
+
212
+ Chris Piech, Jonathan Huang, Andy Nguyen, Mike Phulsuksombati, Mehran Sahami, and Leonidas J. Guibas. Learning program embeddings to propagate feedback on student code. In Proceedings of the 32nd International Conference on Machine Learning (ICML), 2015.
213
+
214
+ Oleksandr Polozov and Sumit Gulwani. FlashMeta: a framework for inductive program synthesis. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2015.
215
+
216
+ Scott E. Reed and Nando de Freitas. Neural programmer-interpreters. In Proceedings of the 4th International Conference on Learning Representations (ICLR), 2016.
217
+
218
+ Sebastian Riedel, Matko Bosnjak, and Tim Rocktaschel. Programming with a differentiable forth ¨ interpreter. CoRR, abs/1605.06640, 2016. URL http://arxiv.org/abs/1605.06640.
219
+
220
+ Eric Schkufza, Rahul Sharma, and Alex Aiken. Stochastic program optimization. Commununications of the ACM, 59(2):114–122, 2016.
221
+
222
+ Jamie Shotton, Toby Sharp, Alex Kipman, Andrew Fitzgibbon, Mark Finocchio, Andrew Blake, Mat Cook, and Richard Moore. Real-time human pose recognition in parts from single depth images. Communications of the ACM, 56(1):116–124, 2013.
223
+
224
+ Rishabh Singh and Sumit Gulwani. Predicting a correct program in programming by example. In Proceedings of the 27th Conference on Computer Aided Verification (CAV), 2015.
225
+
226
+ Armando Solar-Lezama. Program Synthesis By Sketching. PhD thesis, EECS Dept., UC Berkeley, 2008.
227
+
228
+ Andreas Stuhlmuller, Jessica Taylor, and Noah D. Goodman. Learning stochastic inverses. In ¨ Proceedings of the 26th Conference on Advances in Neural Information Processing Systems (NIPS), 2013.
229
+
230
+ Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Proceedings of the 28th Conference on Advances in Neural Information Processing Systems (NIPS), 2015.
231
+
232
+ Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In Proceedings of the 3rd International Conference on Learning Representations (ICLR), 2015.
233
+
234
+ Wojciech Zaremba, Tomas Mikolov, Armand Joulin, and Rob Fergus. Learning simple algorithms from examples. In Proceedings of the 33nd International Conference on Machine Learning (ICML), 2016.
235
+
236
+ # A EXAMPLE PROGRAMS
237
+
238
+ This section shows example programs in our Domain Specific Language (DSL), together with inputoutput examples and short descriptions. These programs have been inspired by simple tasks appearing on real programming competition websites, and are meant to illustrate the expressive power of our DSL.
239
+
240
+ # Program 0:
241
+
242
+ $\mathrm { k } $ int b ← [int] c ← SORT b d ← TAKE k c e ← SUM d
243
+
244
+ Input-output example:
245
+ Input:
246
+ 2, [3 5 4 7 5]
247
+ Output:
248
+ [7]
249
+
250
+ Description:
251
+
252
+ A new shop near you is selling $n$ paintings. You have $k \ < \ n$ friends and you would like to buy each of your friends a painting from the shop. Return the minimal amount of money you will need to spend.
253
+
254
+ # Program 1:
255
+
256
+ $\bar { w } $ [int]
257
+ t ← [int]
258
+ c ← MAP (\*3) w
259
+ d ← ZIPWITH (+) c t
260
+ e ← MAXIMUM d
261
+ Input-output example:
262
+ Input:
263
+ [6 2 4 7 9],
264
+ [5 3 6 1 0]
265
+ Output:
266
+ 27
267
+
268
+ Description:
269
+
270
+ In soccer leagues, match winners are awarded 3 points, losers 0 points, and both teams get 1 point in the case of a tie. Compute the number of points awarded to the winner of a league given two arrays $w , t$ of the same length, where $w [ i ]$ (resp. $t [ i ] ,$ ) is the number of times team $i$ won (resp. tied).
271
+
272
+ # Program 2:
273
+
274
+ a ← [int]
275
+ b ← [int]
276
+ c ← ZIPWITH (-) b a $\mathsf { d } \gets \mathbf { C o u v r } \mathsf { T }$ $( > 0 )$ ) c
277
+
278
+ # Input-output example:
279
+
280
+ Input:
281
+ [6 2 4 7 9],
282
+ [5 3 2 1 0]
283
+ Output:
284
+ 4
285
+
286
+ Description:
287
+
288
+ Alice and Bob are comparing their results in a recent exam. Given their marks per question as two arrays $a$ and $b$ , count on how many questions Alice got more points than Bob.
289
+
290
+ # Program 3:
291
+
292
+ h ← [int]
293
+ b ← SCANL1 MIN h
294
+ c ← ZIPWITH (-) h b $\mathrm { ~ d ~ } $ FILTER $( > 0 )$ ) c
295
+ $\mathrm { ~ e ~ } { \gets } \mathbf { S } \mathbf { U } \mathbf { M } \mathrm { ~ d ~ }$
296
+ Input-output example:
297
+ Input:
298
+ [8 5 7 2 5]
299
+ Output:
300
+ 5
301
+
302
+ Description:
303
+
304
+ Perditia is very peculiar about her garden and wants that the trees standing in a row are all of non-increasing heights. Given the tree heights in centimeters in order of the row as an array h, compute how many centimeters she needs to trim the trees in total.
305
+
306
+ # Program 4:
307
+
308
+ x ← [int]
309
+ y ← [int]
310
+ $\mathbf { \boldsymbol { \mathrm { c } } } \gets \mathbf { \boldsymbol { S } } \mathbf { \boldsymbol { O } } \mathbf { R } \mathbf { \boldsymbol { T } } \ \mathbf { \boldsymbol { x } }$
311
+ d ← SORT y
312
+ e ← REVERSE d
313
+ f ← ZIPWITH (\*) d e
314
+ $\mathsf { g } \gets \mathsf { S U M } \mathrm { ~ f ~ }$
315
+ Input-output example:
316
+ Input:
317
+ [7 3 8 2 5],
318
+ [2 8 9 1 3]
319
+ Output:
320
+ 79
321
+
322
+ Description:
323
+
324
+ Xavier and Yasmine are laying sticks to form non-overlapping rectangles on the ground. They both have fixed sets of pairs of sticks of certain lengths (represented as arrays x and y of numbers). Xavier only lays sticks parallel to the x axis, and Yasmine lays sticks only parallel to y axis. Compute the area their rectangles will cover at least.
325
+
326
+ Program 5:
327
+ $\ a \gets$ [int]
328
+ $\ u \text b \gets$ REVERSE a
329
+ $\subset $ ZIPWITH MIN a b
330
+ Input-output example:
331
+ Input:
332
+ [3 7 5 2 8]
333
+ Output:
334
+ [3 2 5 2 3]
335
+
336
+ # Description:
337
+
338
+ A sequence called Billy is looking into the mirror, wondering how much weight it could lose by replacing any of its elements by their mirror images. Given a description of Billy as an array $b$ of length $n$ , return an array $c$ of minimal sum where each element $c [ i ]$ is either $b [ i ]$ or its mirror image $b [ n - i - 1 ]$ .
339
+
340
+ <table><tr><td colspan="2"></td></tr><tr><td>Program 6: IO example: t←[int] Input: p←[int] [4 8 11 2], C←MAP(-1)t [2341] d←MAP(-1)p Output: e ←ZIPWITH(+)c d 1 f←MINIMUMe</td><td>Description: Umberto has a large collection of ties and match- ing pocket squares—too large, his wife says—and he needs to sell one pair. Given their values as arrays t and p,assuming that he sells the cheapest pair, and selling costs 2,how much will he lose from the sale?</td></tr><tr><td>Program 7: IO example: s←[int] Input: p←[int] [4723], C ← SCANL1(+)p [2131] d ←ZIPWITH(*)S C Output: e←SUMd 62</td><td>Description: Zack always promised his n friends to buy them candy, but never did. Now he won the lottery and counts how often and how much candy he promised to his friends,obtaining arrays p (num- ber of promises) and s (number of promised sweets). He announces that to repay them,he will buy s[1]+s[2]+...+s[n] pieces of candy for the firstp[1]days,thens[2]+s[3]+...+s[n]for p[2] days,and so on,until he has fulfilled all promises. How much candy will he buy in total?</td></tr><tr><td>Program 8: IO example: s←[int] Input: b ←REVERSE S [12457] C ←ZIPWITH(-)b s Output: d ←FILTER(&gt;O)C 9 e←SuMd</td><td>Description: Vivian loves rearranging things.Most of all,when she sees a row of heaps, she wants to make sure that each heap has more items than the one to its left. She is also obsessed with efficiency, so always moves the least possible number of items.Her dad really dislikes if she changes the size of heaps,so she only moves single items between them,making sure that the set of sizes of the heaps is the same as at the start; they are only in a different order. When you come in, you see heaps of sizes (of course,sizes strictly monotonically increasing)s[O],s[1],... s[n].What is the maximal number of items that Vivian could have moved?</td></tr></table>
341
+
342
+ ![](images/6d29878119ef08e20bad2e228bb9a4b1140e7a88251e4c13cbe46fb4f2478484.jpg)
343
+ Fig. 4 shows the predictions made by a neural network trained on programs of length $T = 4$ that were ensured to be semantically disjoint from all 9 example programs shown in this section. For each task, the neural network was provided with 5 input-output examples.
344
+ Figure 4: Predictions of a neural network on the 9 example programs described in this section. Numbers in squares would ideally be close to 1 (function is present in the ground truth source code), whereas all other numbers should ideally be close to 0 (function is not needed).
345
+
346
+ # B EXPERIMENTAL RESULTS
347
+
348
+ Results presented in Sect. 5.1 showcased the computational speedups obtained from the LIPS framework (using DeepCoder), as opposed to solving each program synthesis problem with only the information about global incidence of functions in source code available. For completeness, here we show plots of raw computation times of each search procedure to solve a given number of problems.
349
+
350
+ Fig. 5 shows the computation times of DFS, of Enumerative search with a Sort and add scheme, of the $\lambda ^ { 2 }$ and Sketch solvers with a Sort and add scheme, and of Beam search, when searching for a program consistent with input-output examples generated from $P = 5 0 0$ different test programs of length $T = 3$ . As discussed in Sect. 5.1, these test programs were ensured to be semantically disjoint from all programs used to train the neural networks, as well as from all programs of shorter length (as discussed in Sect. 4.2).
351
+
352
+ ![](images/69617f5d9c5e8b7b5a7be3c5b88b0456a2865590e84e41413e9067abe2f41f17.jpg)
353
+ Figure 5: Number of test problems solved versus computation time.
354
+
355
+ The “steps” in the results for Beam search are due to our search strategy, which doubles the size of the considered beam until reaching the timeout (of 1000 seconds) and thus steps occur whenever the search for a beam of size $2 ^ { k }$ is finished. For $\dot { \lambda ^ { 2 } }$ , we observed that no solution for a given set of allowed functions was ever found after about 5 seconds (on the benchmark machines), but that $\lambda ^ { 2 }$ continued to search. Hence, we introduced a hard timeout after 6 seconds for all but the last iterations of our Sort and add scheme.
356
+
357
+ Fig. 6 shows the computation times of DFS, Enumerative search with a Sort and add scheme, and $\lambda ^ { 2 }$ with a Sort and add scheme when searching for programs consistent with input-output examples generated from $P = 1 0 0$ different test programs of length $T = 5$ . The neural network was trained on programs of length $T = 4$ .
358
+
359
+ ![](images/8d83b6177f99db604465ccbe078168c96645752256eb9f14da14c4754aa158fd.jpg)
360
+ Figure 6: Number of test problems solved versus computation time.
361
+
362
+ # C THE NEURAL NETWORK
363
+
364
+ As briefly described in Sect. 4.3, we used the following simple feed-forward architecture encoder:
365
+
366
+ • For each input-output example in the set generated from a single ground truth program:
367
+
368
+ – Pad arrays appearing in the inputs and in the output to a maximum length $L = 2 0$ with a special NULL value.
369
+ – Represent the type (singleton integer or integer array) of each input and of the output using a one-hot-encoding vector. Embed each integer in the valid integer range $( - 2 5 6$ to 255) using a learned embedding into $E = 2 0$ dimensional space. Also learn an embedding for the padding NULL value.
370
+
371
+ – Concatenate the representations of the input types, the embeddings of integers in the inputs, the representation of the output type, and the embeddings of integers in the output into a single (fixed-length) vector. – Pass this vector through $H = 3$ hidden layers containing $K = 2 5 6$ sigmoid units each.
372
+
373
+ • Pool the last hidden layer encodings of each input-output example together by simple arithmetic averaging.
374
+
375
+ Fig. 7 shows a schematic drawing of this encoder architecture, together with the decoder that performs independent binary classification for each function in the DSL, indicating whether or not it appears in the ground truth source code.
376
+
377
+ ![](images/1b4ae4043ae84d4ac119b02713a27cb85173d4a2d0a85116dc32199039ab2623.jpg)
378
+ Figure 7: Schematic representation of our feed-forward encoder, and the decoder.
379
+
380
+ While DeepCoder learns to embed integers into a $E = 2 0$ dimensional space, we built the system up gradually, starting with a $E = 2$ dimensional space and only training on programs of length $T = 1$ . Such a small scale setting allowed easier investigation of the workings of the neural network, and indeed Fig. 8 below shows a learned embedding of integers in $\mathbb { R } ^ { 2 }$ . The figure demonstrates that the network has learnt the concepts of number magnitude, sign (positive or negative) and evenness, presumably due to FILTER $( > 0 )$ , FILTER $( < 0 )$ , FILTER ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 0$ ) and FILTER ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 1$ ) all being among the programs on which the network was trained.
381
+
382
+ # D DEPTH-FIRST SEARCH
383
+
384
+ We use an optimized $\mathrm { C } { + } { + }$ implementation of depth-first search (DFS) to search over programs with a given maximum length $T$ . In depth-first search, we start by choosing the first function (and its arguments) of a potential solution program, and then recursively consider all ways of filling in the rest of the program (up to length $T$ ), before moving on to a next choice of first instruction (if a solution has not yet been found).
385
+
386
+ A program is considered a solution if it is consistent with all $M = 5$ provided input-output examples. Note that this requires evaluating all candidate programs on the $M$ inputs and checking the results for equality with the provided $M$ respective outputs. Our implementation of DFS exploits the sequential structure of programs in our DSL by caching the results of evaluating all prefixes of the currently considered program on the example inputs, thus allowing efficient reuse of computation between candidate programs with common prefixes.
387
+
388
+ This allows us to explore the search space at roughly the speed of $\sim 3 \times 1 0 ^ { 6 }$ programs per second.
389
+
390
+ ![](images/94148f752106bd924a4f80c9c825128a3efe588caf08184e8765377bb5e169db.jpg)
391
+ Figure 8: A learned embedding of integers $\{ - 2 5 6 , - 2 5 5 , \ldots , - 1 , 0 , 1 , \ldots , 2 5 5 \}$ in $\mathbb { R } ^ { 2 }$ . The color intensity corresponds to the magnitude of the embedded integer.
392
+
393
+ When the search procedure extends a partial program by a new function, it has to try the functions in the DSL in some order. At this point DFS can opt to consider the functions as ordered by their predicted probabilities from the neural network. The probability of a function consisting of a higherorder function and a lambda is taken to be the minimum of the probabilities of the two constituent functions.
394
+
395
+ # E TRAINING LOSS FUNCTION
396
+
397
+ In Sect. 4.5 we outlined a justification for using marginal probabilities of individual functions as a sensible intermediate representation to provide a solver employing a Sort and add scheme (we considered Enumerative search and the Sketch solver with this scheme). Here we provide a more detailed discussion.
398
+
399
+ Predicting program components from input-output examples can be cast as a multilabel classification problem, where each instance (set of input-output examples) is associated with a set of relevant labels (functions appearing in the code that generated the examples). We denote the number of labels (functions) by $C$ , and note that throughout this work $C = 3 4$ .
400
+
401
+ When the task is to predict a subset of labels $\mathbf { y } \in \{ 0 , 1 \} ^ { C }$ , different loss functions can be employed to measure the prediction error of a classifier $\mathbf { h } ( \mathbf { x } )$ or ranking function $\mathbf { f } \left( \mathbf { x } \right)$ . Dembczynski et al. (2010) discuss the following three loss functions:
402
+
403
+ • Hamming loss counts the number of labels that are predicted incorrectly by a classifier h:
404
+
405
+ $$
406
+ L _ { H } ( \mathbf { y } , \mathbf { h } ( \mathbf { x } ) ) = \sum _ { c = 1 } ^ { C } \mathbb { 1 } _ { \{ y _ { c } \neq h _ { c } ( \mathbf { x } ) \} }
407
+ $$
408
+
409
+ • Rank loss counts the number of label pairs violating the condition that relevant labels are ranked higher than irrelevant ones by a scoring function f:
410
+
411
+ $$
412
+ L _ { r } ( \mathbf { y } , \mathbf { f } ( \mathbf { x } ) ) = \sum _ { ( i , j ) : y _ { i } = 1 , y _ { j } = 0 } ^ { C } \mathbb { 1 } _ { \{ f _ { i } < f _ { j } \} }
413
+ $$
414
+
415
+ • Subset Zero-One loss indicates whether all labels have been correctly predicted by $\mathbf { h }$ :
416
+
417
+ $$
418
+ L _ { s } ( \mathbf { y } , \mathbf { h } ( \mathbf { x } ) ) = \mathbb { 1 } _ { \{ \mathbf { y } \neq \mathbf { h } ( \mathbf { x } ) \} }
419
+ $$
420
+
421
+ Dembczynski et al. (2010) proved that Bayes optimal decisions under the Hamming and Rank loss functions, i.e., decisions minimizing the expected loss under these loss functions, can be computed from marginal probabilities $p _ { c } ( y _ { c } | \mathbf { x } )$ . This suggests that:
422
+
423
+ • Multilabel classification under these two loss functions may not benefit from considering dependencies between the labels.
424
+ • ”Instead of minimizing the Rank loss directly, one can simply use any approach for single label prediction that properly estimates the marginal probabilities.” (Dembczynski et al., ´ 2012)
425
+
426
+ Training the neural network with the negative cross entropy loss function as the training objective is precisely a method for properly estimating the marginal probabilities of labels (functions appearing in source code). It is thus a sensible step in preparation for making predictions under a Rank loss.
427
+
428
+ It remains to discuss the relationship between the Rank loss and the actual quantity we care about, which is the total runtime of a Sort and add search procedure. Recall the simplifying assumption that the runtime of searching for a program of length $T$ with $C$ functions made available to the search is proportional to $C ^ { T }$ , and consider a Sort and add search for a program of length $T$ , where the size of the active set is increased by 1 whenever the search fails. Starting with an active set of size 1, the total time until a solution is found can be upper bounded by
429
+
430
+ $$
431
+ 1 ^ { T } + 2 ^ { T } + \cdot \cdot \cdot + C _ { A } ^ { T } \leq C _ { A } ^ { T + 1 } \leq C C _ { A } ^ { T }
432
+ $$
433
+
434
+ where $C _ { A }$ is the size of the active set when the search finally succeeds (i.e., when the active set finally contains all necessary functions for a solution to exist). Hence the total runtime of a Sort and add search can be upper bounded by a quantity that is proportional to $C _ { A } ^ { T }$ .
435
+
436
+ Now fix a valid program solution $P$ that requires $C _ { P }$ functions, and let $\mathbf { y } _ { P } \in \{ 0 , 1 \} ^ { C }$ be the indicator vector of functions used by $P$ . Let $D : = C _ { A } - C _ { P }$ be the number of redundant operations added into the active set until all operations from $P$ have been added.
437
+
438
+ Example 1. Suppose the labels, as sorted by decreasing predicted marginal probabilities $\mathbf { f } \left( \mathbf { x } \right)$ , are as follows:
439
+
440
+ $$
441
+ \begin{array} { r l r l r } { 1 \mathrm { ~ 1 ~ 1 ~ 1 ~ } } & { { } } & { 1 } & \qquad 1 \mathrm ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 0 ~ 0 ~ 0 ~ 0 ~ 0 0 \end{array}
442
+ $$
443
+
444
+ Then the solution $P$ contains $C _ { P } = 6$ functions, but the active set needs to grow to size $C _ { A } = 1 1$ to include all of them, adding $D = 5$ redundant functions along the way. Note that the rank loss of the predictions $\mathbf { f } \left( \mathbf { x } \right)$ is $L _ { r } ( \mathbf { y } _ { P } , \mathbf { f } ( \mathbf { x } ) ) = 2 + 5 = 7$ , as it double counts the two redundant functions which are scored higher than two relevant labels.
445
+
446
+ Noting that in general $L _ { r } ( \mathbf { y } _ { P } , \mathbf { f } ( \mathbf { x } ) ) \ge D$ , the previous upper bound on the runtime of Sort and add can be further upper bounded as follows:
447
+
448
+ $$
449
+ C _ { A } ^ { T } = ( C _ { P } + D ) ^ { T } \leq \mathrm { c o n s t } + \mathrm { c o n s t } \times D ^ { T } \leq \mathrm { c o n s t } + \mathrm { c o n s t } \times L _ { r } ( \mathbf { y } _ { P } , \mathbf { f } ( \mathbf { x } ) ) ^ { T }
450
+ $$
451
+
452
+ Hence we see that for a constant value of $T$ , this upper bound can be minimized by optimizing the Rank loss of the predictions $\mathbf { f } \left( \mathbf { x } \right)$ . Note also that $\bar { L _ { r } } ( { \bf y } _ { P } , { \bf f } ( { \bf x } ) ) = 0$ would imply $D = 0$ , in which case $C _ { A } = C _ { P }$ .
453
+
454
+ # F DOMAIN SPECIFIC LANGUAGE OF DEEPCODER
455
+
456
+ Here we provide a description of the semantics of our DSL from Sect. 4.1, both in English and as a Python implementation. Throughout, NULL is a special value that can be set e.g. to an integer outside the working integer range.
457
+
458
+ First-order functions:
459
+
460
+ • HEAD :: [int] -> int lambda xs: xs[0] if len $( \mathbf { \nabla } _ { \mathbf { X } } \mathbf { S } \mathbf { \nabla } ) > 0$ else Null Given an array, returns its first element (or NULL if the array is empty).
461
+ • LAST :: [int] $- >$ int lambda xs: xs[-1] if len $( \mathbf { \nabla } _ { \mathbf { X } } \mathbf { s } ) > 0$ else Null Given an array, returns its last element (or NULL if the array is empty).
462
+ • TAKE :: int $- >$ [int] -> int lambda n, xs: xs[:n] Given an integer n and array xs, returns the array truncated after the $\boldsymbol { \mathrm { n } }$ -th element. (If the length of xs was no larger than n in the first place, it is returned without modification.)
463
+ • DROP :: int $- >$ [int] $- >$ int lambda n, xs: xs[n:] Given an integer n and array $_ { \textrm { x S } }$ , returns the array with the first n elements dropped. (If the length of xs was no larger than n in the first place, an empty array is returned.)
464
+ • ACCESS :: int $- >$ [int] $- >$ int lambda n, xs: xs[n] if $\mathrm { n } > = 0$ and len $( \mathsf { x s } ) > \mathsf { n }$ else Null Given an integer n and array $_ { \textrm { x S } }$ , returns the $( \mathrm { n } { + } 1 )$ -st element of $_ { \textrm { x S } }$ . (If the length of xs was less than or equal to $\boldsymbol { \mathrm { n } }$ , the value NULL is returned instead.)
465
+ • MINIMUM :: [int] $- >$ int lambda xs: min(xs) if len $( \mathbf { \nabla } _ { \mathbf { X } } \mathbf { S } ) > 0$ else Null Given an array, returns its minimum (or NULL if the array is empty).
466
+ • MAXIMUM :: [int] $- >$ int lambda xs: max(xs) if len $( \mathbf { \nabla } _ { \mathbf { X } } \mathbf { S } ) > 0$ else Null Given an array, returns its maximum (or NULL if the array is empty). REVERSE :: [int] $- >$ [int] lambda xs: list(reversed(xs)) Given an array, returns its elements in reversed order.
467
+ • SORT :: [int] -> [int] lambda xs: sorted(xs) Given an array, return its elements in non-decreasing order. SUM :: [int] $- >$ int lambda xs: sum(xs) Given an array, returns the sum of its elements. (The sum of an empty array is 0.)
468
+
469
+ Higher-order functions:
470
+
471
+ • MAP :: (int -> int) -> [int] -> [int] lambda f, xs: [f(x) for x in xs] Given a lambda function f mapping from integers to integers, and an array xs, returns the array resulting from applying f to each element of xs.
472
+ • FILTER :: (int $- >$ bool) $- >$ [int] -> [int] lambda f, xs: [x for x in xs if f(x)] Given a predicate f mapping from integers to truth values, and an array xs, returns the elements of xs satisfying the predicate in their original order.
473
+ • COUNT :: (int $- >$ bool) $- >$ [int] $- >$ int lambda f, xs: len([x for x in xs if f(x)]) Given a predicate f mapping from integers to truth values, and an array xs, returns the number of elements in xs satisfying the predicate.
474
+ • ZIPWITH :: (int $- >$ int $- >$ int) $- >$ [int] -> [int] -> [int] lambda f, xs, ys: [f(x, y) for (x, y) in zip(xs, ys)] Given a lambda function f mapping integer pairs to integers, and two arrays xs and ys, returns the array resulting from applying f to corresponding elements of xs and ys. The length of the returned array is the minimum of the lengths of $_ { \textrm { x S } }$ and ys. SCANL1 :: (int $- >$ int $- >$ int) $- >$ [int] -> [int] Given a lambda function f mapping integer pairs to integers, and an array $_ { \textrm { x S } }$ , returns an array ys of the same length as xs and with its content defined by the recurrence $\begin{array} { r l } { \mathrm { y s } \left[ 0 \right] } & { { } = } \end{array}$ $\mathbf { x } \mathbf { s } \left[ 0 \right] , \mathbf { y } \mathbf { s } \left[ \mathrm { n } \right] \mathbf { \Psi } = \mathbf { \Psi } \mathbf { f } \left( \mathbf { y } \mathbf { s } \left[ \mathrm { n - 1 } \right] \right.$ , $\mathtt { x s } [ \mathtt { n } ]$ ) for $n \geq 1$ .
475
+
476
+ The INT INT lambdas $\left( + 1 \right) , \left( - 1 \right) , \left( \star 2 \right) , \left( / 2 \right) , \left( \star \left( - 1 \right) \right) , \left( \star \star 2 \right) , \left( \star 3 \right) , \left( / 3 \right) , \left( \star 4 \right) , \left( / 4 \right) , \left( \star 3 \right) , \left( \star 4 \right) .$ ) provided by our DSL map integers to integers in a self-explanatory manner. The $\mathrm { I N T } { } \mathrm { B O O L }$ lambdas $( > 0 )$ , $( < 0 )$ , ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 0$ ), ( $\scriptstyle { \frac { 0 } { 0 } } 2 = = 1$ ) respectively test positivity, negativity, evenness and oddness of the input integer value. Finally, the $\mathrm { I N T } { } \mathrm { I N T } { } \mathrm { I N T }$ lambdas $( + ) , ( - ) , ( \star )$ , MIN, MAX apply a function to a pair of integers and produce a single integer.
477
+
478
+ As an example, consider the function SCANL1 MAX, consisting of the higher-order function SCANL1 and the $\mathrm { I N T } { } \mathrm { I N T } { } \mathrm { I N T }$ lambda MAX. Given an integer array a of length $L$ , this function computes the running maximum of the array a. Specifically, it returns an array $\mathrm { b }$ of the same length $L$ whose $i$ -th element is the maximum of the first $i$ elements in $\exists$ .
479
+
480
+ ![](images/da5620eb6e4f0a76e4439147498cbeb617797fc9a1d092bb07c51b51e15fdcb8.jpg)
481
+ Figure 9: Conditional confusion matrix for the neural network and test set of $P = 5 0 0$ programs of length $T = 3$ that were used to obtain the results presented in Table 1. Each cell contains the average false positive probability (in larger font) and the number of test programs from which this average was computed (smaller font, in brackets). The color intensity of each cell’s shading coresponds to the magnitude of the average false positive probability.
482
+
483
+ # G ANALYSIS OF TRAINED NEURAL NETWORKS
484
+
485
+ We analyzed the performance of trained neural networks by investigating which program instructions tend to get confused by the networks. To this end, we looked at a generalization of confusion matrices to the multilabel classification setting: for each attribute in a ground truth program (rows) measure how likely each other attribute (columns) is predicted as a false positive. More formally, in this matrix the $( i , j )$ -entry is the average predicted probability of attribute $j$ among test programs that do possess attribute $i$ and do not possess attribute $j$ . Intuitively, the $i$ -th row of this matrix shows how the presence of attribute $i$ confuses the network into incorrectly predicting each other attribute $j$ .
486
+
487
+ Figure 9 shows this conditional confusion matrix for the neural network and $P = 5 0 0$ program test set configuration used to obtain Table 1. We re-ordered the confusion matrix to try to expose block structure in the false positive probabilities, revealing groups of instructions that tend to be difficult to distinguish. Figure 10 show the conditional confusion matrix for the neural network used to obtain the table in Fig. 3a. While the results are somewhat noisy, we observe a few general tendencies:
488
+
489
+ • There is increased confusion amongst instructions that select out a single element from an array: HEAD, LAST, ACCESS, MINIMUM, MAXIMUM.
490
+ • Some common attributes get predicted more often regardless of the ground truth program: FILTER, $( > 0 )$ ), $( < 0 )$ , ( $\scriptstyle { \frac { \circ } { \circ } } 2 = = 1$ ), ( $\scriptstyle { \frac { 0 } { \circ } } 2 = = 0$ ), MIN, MAX, (+), (-), ZIPWITH.
491
+ There are some groups of lambdas that are more difficult for the network to distinguish within: $( + )$ vs $( - ) ~ ; ~ ( + 1 )$ vs $( - 1 ) \ ; \ ( \ / 2 )$ vs (/3) vs (/4).
492
+ • When a program uses $( \star \star 2 )$ , the network often thinks it’s using $( \star )$ , presumably because both can lead to large values in the output.
493
+
494
+ ![](images/a2f6e1ddd3c6cc3aed7aca84775a0568e1abe730347297f96f96da4cfd262c8d.jpg)
495
+
496
+ Figure 10: Conditional confusion matrix for the neural network and test set of $P = 5 0 0$ programs of length $T = 5$ . The presentation is the same as in Figure 9.
md/train/ByxXZpVtPB/ByxXZpVtPB.md ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HOMOGENEOUS LINEAR INEQUALITY CONSTRAINTS FOR NEURAL NETWORK ACTIVATIONS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We propose a method to impose homogeneous linear inequality constraints of the form $A x \le 0$ on neural network activations. The proposed method allows a datadriven training approach to be combined with modeling prior knowledge about the task. One way to achieve this task is by means of a projection step at test time after unconstrained training. However, this is an expensive operation. By directly incorporating the constraints into the architecture, we can significantly speed-up inference at test time; for instance, our experiments show a speed-up of up to two orders of magnitude over a projection method. Our algorithm computes a suitable parameterization of the feasible set at initialization and uses standard variants of stochastic gradient descent to find solutions to the constrained network. Thus, the modeling constraints are always satisfied during training. Crucially, our approach avoids to solve an optimization problem at each training step or to manually trade-off data and constraint fidelity with additional hyperparameters. We consider constrained generative modeling as an important application domain and experimentally demonstrate the proposed method by constraining a variational autoencoder.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep learning models (LeCun et al., 2015) have demonstrated remarkable success in tasks that require exploitation of subtle correlations, such as computer vision (Krizhevsky et al., 2012) and sequence learning (Sutskever et al., 2014). Typically, humans have strong prior knowledge about a task, e.g., based on symmetry, geometry, or physics. Learning such a priori assumptions in a purely data-driven manner is inefficient and, in some situations, may not be feasible at all. While certain prior knowledge was successfully imposed – for example translational symmetry through convolutional architectures (LeCun et al., 1998) – incorporating more general modeling assumptions in the training of deep networks remains an open challenge. Recently, generative neural networks have advanced significantly (Goodfellow et al., 2014; Kingma & Welling, 2014). With such models, controlling the generative process beyond a data-driven, black-box approach is particularly important.
12
+
13
+ In this paper, we present a method to impose prior knowledge through homogeneous linear inequality constraints of the form $A x \le 0$ on the activations of deep learning models. We directly impose these constraints through a suitable parameterization of the feasible set. This has several advantages:
14
+
15
+ • The constraints are hard-constraints in the sense that they are satisfied at any point during training and inference.
16
+ • Inference on the constrained network incurs no overhead compared to unconstrained inference.
17
+ • There is no manual trade-off between constraint satisfaction and data representation.
18
+
19
+ In summary, the main contribution of our method is a reparameterization that incorporates homogeneous linear inequality hard-constraints on neural network activations and allows for efficient test time predictions, i.e., our method is faster up to two orders of magnitude. The model can be optimized by standard variants of stochastic gradient descent. As an application in generative modeling, we demonstrate that our method is able to produce authentic samples from a variational autoencoder while satisfying the imposed constraints.
20
+
21
+ ![](images/6ff2de8059afd1546259716b3fa3bcc6f284f19dca82e98544dec5426da694f1.jpg)
22
+ Figure 1: Samples drawn from a variational autoencoder trained on MNIST without constraints (left) and with a checkerboard constraint on the output domain (right). For a pixel intensity domain $[ - 1 , 1 ]$ , the checkerboard constraint forces the image tiles to have average positive or negative brightness.
23
+
24
+ # 2 RELATED WORK
25
+
26
+ Various works have introduced methods to impose some type of hard constraint on neural network activations. This differs from a classical constrained optimization problem (Nocedal & Wright, 2006) in that the constraints are on the image of a parameterized function rather than on the neural network parameters.
27
+
28
+ Marquez-Neila et al. (2017) formulated generic differentiable equality constraints as soft constraints ´ and employed a Lagrangian approach to train their model. While this is a principled approach to constrained optimization, it does not scale well to practical deep neural network models with their vast number of parameters. To make their method computationally tractable, a subset of the constraints is selected at each training step. In addition, these constraints are locally linearized; thus, there is no guarantee that this subset will be satisfied after a parameter update.
29
+
30
+ For the specific problem of weakly supervised segmentation, Pathak et al. (2015) proposed an optimization scheme that alternates between optimizing the deep learning model and fitting a constrained distribution to these intermediate models. However, this method involves solving a (convex) optimization problem at each training step. Furthermore, the overall convergence path depends on how the alternating optimization steps are combined, which introduces an additional hyperparameter that must be tuned. Briq et al. (2018) approached the weakly supervised segmentation problem with a layer that implements the orthogonal projection onto a simplex, thereby directly constraining the activations to a probability distribution. This optimization problem can be solved efficiently, but does not generalize to other types of inequality constraints.
31
+
32
+ OptNet, an approach to solve a generic quadratic program as a differentiable network layer, was proposed by Amos & Kolter (2017). OptNet backpropagates through the first-order optimality conditions of the quadratic program, and linear inequality constraints can be enforced as a special case. The formulation is flexible; however, it scales cubically with the number of variables and constraints. Thus, it becomes prohibitively expensive to train large-scale deep learning models.
33
+
34
+ Finally, several works have proposed handcrafted solutions for specific applications, such as skeleton prediction (Zhou et al., 2016) and prediction of rigid body motion (Byravan & Fox, 2017). In contrast, to avoid laborious architecture design, we argue for the value of generically modeling constraint classes. In practice, this makes constraint methods more accessible for a broader class of problems.
35
+
36
+ Contribution In this work, we tackle the problem of imposing homogeneous linear inequality constraints on neural network activations. Rather than solving an optimization problem during training, we split this task into a feasibility step at initialization and an optimality step during training. At initialization, we compute a suitable parameterization of the constraint set (a polyhedral cone) and use the neural network training algorithm to find a good solution within this feasible set. Conceptually, we are trading-off computational cost during initialization to obtain a model that has no overhead at test time. The proposed method is implemented as a neural network layer that is specified by a set of homogeneous linear inequalities and whose output parameterizes the feasible set.
37
+
38
+ We consider a generic $L$ layer neural network $F _ { \theta }$ with model parameters $\theta$ for inputs $x$ as follows:
39
+
40
+ $$
41
+ F _ { \theta } ( x ) = f _ { \theta _ { L } } ^ { ( L ) } ( \sigma ( f _ { \theta _ { L - 1 } } ^ { ( L - 1 ) } ( \sigma ( \dots f _ { \theta _ { 1 } } ^ { ( 1 ) } ( x ) \dots ) ) ) ) ,
42
+ $$
43
+
44
+ where $f _ { \theta _ { l } } ^ { ( l ) }$ are affine functions, e.g., a fully-connected or convolutional layer, and $\sigma$ is an elementwise non-linearity1, e.g., a sigmoid or rectified linear unit (ReLU). In supervised learning, training targets $y$ are known and a loss $\mathcal { L } _ { y } ( F _ { \theta } ( x ) )$ is minimized as a function of the network parameters $\theta$ . A typical loss for a classification task is the cross entropy between the network output and the empirical target distribution, while the mean-squared error is commonly used for a regression task. The proposed method can be applied to constrain any linear activations $z ^ { ( l ) } = f _ { \theta _ { l } } ^ { ( l ) } ( a ^ { ( l - 1 ) } )$ or non-linear activations $a ^ { ( l ) } = \sigma ( z ^ { ( l ) } )$ . In most cases, one would like to constrain the output $F _ { \theta } ( x )$ .
45
+
46
+ The feasible set for $m$ linear inequality constraints in $d$ dimensions is the convex polyhedron
47
+
48
+ $$
49
+ \mathcal { C } : = \left\{ z \bigg | A z \leq b , A \in \mathbb { R } ^ { m \times d } , b \in \mathbb { R } ^ { m } \right\} \subseteq \mathbb { R } ^ { d } .
50
+ $$
51
+
52
+ A suitable description of the convex polyhedron $\mathcal { C }$ is obtained by the decomposition theorem for polyhedra.
53
+
54
+ Theorem 1 (Decomposition of polyhedra, Minkowski-Weyl). $A$ set $\mathcal { C } \subset \mathbb { R } ^ { d }$ is a convex polyhedron of the form (2) if and only $i f$
55
+
56
+ $$
57
+ \begin{array} { l } { { \displaystyle { \mathcal C } = \mathrm { c o n v } \big ( \upsilon _ { 1 } , \ldots , \upsilon _ { n } \big ) + \mathrm { c o n e } \big ( r _ { 1 } , \ldots , r _ { s } \big ) } \ ~ } \\ { { \displaystyle ~ = \left\{ \sum _ { i = 1 } ^ { n } \lambda _ { i } \upsilon _ { i } + \sum _ { j = 1 } ^ { s } \mu _ { j } r _ { j } \bigg | \lambda _ { i } , \mu _ { j } \geq 0 , \sum _ { i = 1 } ^ { n } \lambda _ { i } = 1 \right\} } \ } \end{array}
58
+ $$
59
+
60
+ for finitely many vertices $\{ v _ { 1 } , \ldots , v _ { n } \}$ and rays $\{ r _ { 1 } , \ldots , r _ { s } \}$
61
+
62
+ Furthermore, $\mathcal { C } = \left\{ z | A z \leq 0 , A \in \mathbb { R } ^ { m \times d } \right\}$ if and only if
63
+
64
+ $$
65
+ \mathcal { C } = \mathrm { c o n e } ( r _ { 1 } , . . . , r _ { s } )
66
+ $$
67
+
68
+ for finitely many rays $\{ r _ { 1 } , \ldots , r _ { s } \}$
69
+
70
+ The theorem states that an intersection of half-spaces (half-space or $\mathrm { H } \cdot$ -representation) can be written as the Minkowski sum of a convex combination of the polyhedron’s vertices and a conical combination of some rays (vertex or $\mathrm { V } .$ -representation). One can switch algorithmically between these two viewpoints via the double description method (Motzkin et al., 1953; Fukuda & Prodon, 1996), which we discuss in the following. Thus, the $\mathrm { H }$ -representation, which is natural when modeling inequality constraints, can be transformed into the V-representation, which can be incorporated into gradient-based neural network training.
71
+
72
+ In this paper, we focus on homogeneous constraints of the form (4), for which the feasible set is a polyhedral cone. Due to the special structure of this set, we can avoid to work with the convex combination parameters in (3), which is numerically advantageous (Section 3.5), and we can efficiently combine modeling constraints and domain constraints, such as a $[ - 1 , 1 ]$ -pixel domain for images (Section 3.3). Such a polyhedral cone is shown in Figure 2.
73
+
74
+ # 3.1 DOUBLE DESCRIPTION METHOD
75
+
76
+ The double description method converts between the half-space and vertex representation of a system of linear inequalities. It was originally proposed by Motzkin et al. (1953) and further refined by Fukuda & Prodon (1996).2 Here, we are only interested in the conversion from $\mathrm { H } \cdot$ -representation to V-representation for homogeneous constraints (4),
77
+
78
+ $$
79
+ \mathcal { H } \to \mathrm { c o n e } ( r _ { 1 } , \dots , r _ { s } ) \ .
80
+ $$
81
+
82
+ ![](images/e34f7d5efaaf63be07414ce913edd9a6616ef7e1dcd0ac505ab2653737bf016f.jpg)
83
+ Figure 2: Diagram illustrating an iteration of the double description method. Adding a constraint to the $k$ -constraint set $A ^ { k }$ at iteration $k + 1$ introduces a hyperplane $H$ . The intersection points of $H$ with the boundary of the current polyhedron $R ^ { k }$ (marked by $\circ ^ { \prime }$ ) are added as rays $r _ { 6 }$ and $r _ { 7 }$ to the polyhedral cone. The ray $r _ { 2 }$ is cut-off by the hyperplane $H$ and is removed from $R ^ { k }$ . The result is the next iterate Rk+1.
84
+
85
+ The core algorithm proceeds as follows. Let the rows of $A$ define a set of homogeneous inequalities and let $R = [ r _ { 1 } , \ldots , r _ { s } ]$ be the matrix whose columns are the rays of the corresponding cone. Here, $( A , R )$ form a double description pair. The algorithm iteratively builds a double description pair $( A ^ { k + 1 } , R ^ { k + 1 } )$ from $( A ^ { k } , R ^ { k } )$ in the following manner. The rows in $A ^ { k }$ represent a $k$ -subset of the rows of $A$ and thus define a convex polyhedron associated with $R ^ { k }$ . Adding a single row to $A ^ { k }$ introduces an additional half-space constraint, which corresponds to a hyperplane. If the vector $r _ { i } - r _ { j }$ for two columns $r _ { i } , r _ { j }$ of $\bar { \boldsymbol { R } } ^ { k }$ intersects with this hyperplane then this intersection point is added to $R ^ { k }$ . Existing rays that are cut-off by the additional hyperplane are removed from $R ^ { k }$ . The result is the double description pair $( A ^ { k + 1 } , \dot { R } ^ { k + 1 } )$ . This procedure is shown in Figure 2.
86
+
87
+ Adding a hyperplane might drastically increase the number of rays in intermediate representations, which, in turn, contribute combinatorically in the subsequent iteration. In fact, there exist worst case polyhedra for which the algorithm has exponential run time as a function of the number of inequalities and the input dimension, as well as the number of rays (Dyer, 1983; Bremner, 1999). Overall, one can expect the algorithm to be efficient only for problems with a reasonably small number $m$ of inequalities and dimension $d$ .
88
+
89
+ # 3.2 INTEGRATION IN NEURAL NETWORK ARCHITECTURES
90
+
91
+ We parameterize the homogeneous form (4) via a neural network layer. This layer takes as input some (latent) representation of the data, which is mapped to activations satisfying the desired hard constraints. The algorithm is provided with the $_ \mathrm { H }$ -representation of linear inequality constraints, i.e., a matrix $A \in \breve { \mathbb { R } } ^ { m \times d }$ for $m$ constraints in $d$ dimensions to specify the feasible set (4). At initialization, we convert this to the $\mathrm { V } .$ -representation via the double description method (Section 3.1). This corresponds to computing the set of rays $\{ r _ { 1 } , \ldots , r _ { s } \}$ to represent the polyhedral cone. During training, the neural network training algorithm is used to optimize within in the feasible set. There are two critical aspects in this procedure. First, as outlined in Section 3.1, the run-time complexity of the double description method may be prohibitive. Conceptually, the proposed approach allows for significant compute time at initialization to obtain an algorithm that is very efficient at training and test time. Second, we must ensure that the mapping from the latent representation to the parameters integrates well with the training algorithm. We assume that the model is trained with gradient-based backpropagation, as is common for current deep learning applications. The constraint layer comprises a batch normalization layer and an affine mapping (fully-connected layer with biases) followed by the element-wise absolute value function that ensures the non-negativity required by the conical combination parameters. In theory, any function $f : \mathbb { R } \to \mathbb { R } _ { \geq 0 }$ would fulfill this requirement; however, care must be taken to not interfere with backpropagated gradients.
92
+
93
+ # 3.3 COMBINING MODELING AND DOMAIN CONSTRAINTS
94
+
95
+ Domain constraints are often formulated as unit box constraints, $B : = \{ x \in \mathbb { R } ^ { d } | - 1 \leq x _ { i } \leq 1 \}$ , such as a pixel domain for images. Box constraints are particularly unfit to be converted using the double description method because the number of vertices is exponential in the dimension. Therefore, we distinguish modeling constraints and domain constraints and only convert the former into $\mathrm { V } .$ - representation. Based on this representation, we obtain a point in the modeling constraint set, $x \in { \mathcal { C } }$ . However, this point may not be in the unit box $\boldsymbol { B }$ . To arrive at a point in the intersection $\mathcal { C } \cap \mathcal { B }$ , we normalize $x$ by its infinity norm if $x \notin B$ , $\hat { x } = x / \operatorname* { m a x } \{ \| x \| _ { \infty } , 1 \bar \}$ . Indeed, $\hat { x } \in \mathcal { C } \cap B$ since scaling by a positive constant remains in the cone, i.e., if $x \in { \mathcal { C } }$ , then $\alpha x \in \mathcal { C } \forall \alpha \geq 0$ .
96
+
97
+ # 3.4 APPLICATIONS OF HOMOGENEOUS LINEAR INEQUALITY CONSTRAINTS
98
+
99
+ A natural application of constraints of the form $A x \le 0$ is a parameterization of a set of binary classifiers. If each row $a _ { i }$ of $A$ is such a binary classifier, then the method presented in this paper parameterizes the set $\{ x | a _ { i } ^ { T } x \le 0 \ \forall i \}$ . Consequently, it can be guaranteed that neural network activations satisfy a set of binary criteria. Another domain is to express certain direct relations between neural network activations. Notably, one can guarantee mathematical properties such as monotonicity via $x _ { i + 1 } \geq x _ { i }$ and convexity via $x _ { i + 1 } - 2 x _ { i } + x _ { i - 1 } \geq 0$ .
100
+
101
+ # 3.5 EXTENSION TO GENERAL LINEAR INEQUALITY CONSTRAINTS
102
+
103
+ The proposed method takes advantage of the special structure of a polyhedral cone to efficiently combine modeling and domain constraints (Section 3.3). General linear inequality constraints of the form $A x \leq b$ without restrictions on $A$ and $b$ possibly require the conic and convex component of (3) for their $\mathrm { v } .$ -representation. The main approach of this paper may be used in this case, i.e., our layer additionally needs to predict convex combination parameters. However, we observed slow convergence, which we ascribe to the simplex parameterization for the convex combination parameters. We used a softmax function $f ( x ) _ { i } = { \mathrm { { \bar { e x p } } } ( x _ { i } ) } / { \sum _ { j = 1 } ^ { m } \exp ( x _ { j } ) }$ to enforce the constraints $\begin{array} { r } { \lambda _ { i } \ge 0 , \sum _ { i = 1 } ^ { m } \lambda _ { i } = 1 } \end{array}$ of the convex combination parameters in (3). This function has vanishing gradients when one $x _ { i }$ is significantly greater than the other vector entries. Furthermore, this most general setting does not allow for efficient incorporation of domain constraints, as this would require an efficient parameterization of the intersection of a general convex polyhedron and the unit box.
104
+
105
+ # 4 NUMERICAL RESULTS
106
+
107
+ We compare the proposed constraint parameterization algorithm with an algorithm that trains without constraints, but requires a projection step at test time. We call this latter algorithm test time projection. We analyze these algorithms in two different settings. In an initial experiment, we learn the orthogonal projection onto a constraint set to demonstrate properties of these algorithms. Here, the result can be compared to the optimal solution of the convex optimization problem. In a second experiment, consistent with our motivation to constrain the output of generative models, we apply these algorithms to a variational autoencoder. Finally, we evaluate the running time of inference for these problems and show that the proposed algorithm is significantly more efficient compared to the test time projection method.
108
+
109
+ We used the MNIST dataset (LeCun et al.) for both experiments (59000 training, 1000 validation, and 10000 test samples). We chose PyTorch (Paszke et al., 2017) for our implementation3 and all experiments were performed on a single Nvidia Titan X GPU. All networks were optimized with the Adam optimizer and we evaluated learning rates in the range $[ 1 0 ^ { - 5 } , 1 0 ^ { - 3 } ]$ . The initial learning rate was annealed by a factor of $1 / 2$ if progress on the validation loss stagnated for more than 5 epochs. We used OSQP (Stellato et al., 2017) as an efficient solver to compute orthogonal projections.
110
+
111
+ Both experiments were performed with a checkerboard constraint with 16 tiles, where neighboring tiles are constrained to be on average either below or above pixel domain midpoint. For a $[ - 1 , 1 ]$ -pixel domain, the tiles’ average intensity is positive or negative, respectively. The initial computational cost of converting these constraints into $\mathrm { v } .$ -representation via the double description method is negligible (less than 1s). We observed that it is numerically advantageous to activate unit box scaling after the constraint parameterization model was initially optimized only with modeling constraints for a specified number of epochs.
112
+
113
+ One might consider OptNet (Amos & Kolter, 2017) and an analogous version of the method introduced by Pathak et al. (2015) as baselines. However, these approaches incur a significant drawback for the setup presented in this paper as they are are computationally expensive at training time. An OptNet layer solves a generic quadratic program as a differentiable network layer, which scales cubically with the number of variables and constraints. The method by Pathak et al. (2015) for the regression problems in this paper alternates between optimization steps in the network parameters via a variant of stochastic gradient descent and projecting the network output onto the constraints, which is computationally expensive.
114
+
115
+ # 4.1 ORTHOGONAL PROJECTION ONTO A CONSTRAINT SET
116
+
117
+ We learn an orthogonal projection to demonstrate general properties of both algorithms. For given linear inequalities specified in H-representation, we solve the following problem:
118
+
119
+ $$
120
+ \operatorname* { m i n } _ { z \in \mathbb { R } ^ { d } } \left\| z - y \right\| _ { 2 } \quad \mathrm { s . t . } A z \leq 0 \qquad ,
121
+ $$
122
+
123
+ where $y$ is an MNIST image. Here, the problem is convex; therefore, the global optimum can be readily computed and compared to the performance of the learning algorithms. In this setting, we can expect that training an unconstrained network with subsequent projection onto the constraint set at test time yields good results, which can be seen as follows. Let $\begin{array} { r } { \mathcal { P } c ( y ) : = \arg \operatorname* { m i n } _ { z \in \mathcal { C } } \| z - y \| _ { 2 } } \end{array}$ be the orthogonal projection onto the constraint set $\mathcal { C }$ and denote the mean-squared error as $\mathcal { L } _ { y } ( x ) : =$ $\| x - y \| _ { 2 }$ . Both mappings are Lipschitz continuous with Lipschitz constant $L = 1$ . Consequently, for an output $\hat { y }$ of an unconstrained model,
124
+
125
+ $$
126
+ \begin{array} { r } { \displaystyle \Big | \mathcal { L } _ { y } ( \mathcal { P } _ { \mathcal { C } } ( \hat { y } ) ) - \mathcal { L } _ { y } ( \mathcal { P } _ { \mathcal { C } } ( y ) ) \Big | \le \left\| \mathcal { P } _ { \mathcal { C } } ( \hat { y } ) - \mathcal { P } _ { \mathcal { C } } ( y ) \right\| _ { 2 } \le \left\| \hat { y } - y \right\| _ { 2 } , } \end{array}
127
+ $$
128
+
129
+ where, by definition, the term $\mathcal { L } _ { y } ( \mathcal { P } c ( y ) )$ is the optimal value of problem (6). The training algorithm fits $\hat { y }$ to $y$ ; therefore, projecting the unconstrained output $\hat { y }$ onto the constraint set will yield an objective value that is close to the optimal value of the constrained optimization problem.
130
+
131
+ To have a comparable number of parameters for both methods, we use a single fully-connected layer in both cases. For the unconstrained model, we employ an $F C ( 7 8 4 , 7 8 4 )$ layer, and for the constrained model we employ an $F C ( 7 8 4 , n _ { r } )$ layer with $n _ { r } = 1 5 5 2$ many rays to represent the constraint set in V-representation. Additionally, the constraint layer first applies a batch normalization operation (Ioffe & Szegedy, 2015). Both models were optimized with an initial learning rate of $1 0 ^ { - 4 }$ , which was annealed by a factor of 0.1 if progress on the validation loss stagnated for more than 5 epochs. The batch size was chosen to be 256. The unit box constraints were activated after 25 epochs. Additionally, the data for training the model with all constraints being active is shown. This mode eventually results in worse generalization. Figure 3 shows that the mean-squared validation objective for both algorithms converges close to the average optimum. The constraint parameterization method has a larger variance and optimality gap, which hints at the numerical difficulty of training the constrained network. To be precise, the best average validation error during training is within $9 \%$ of the optimum for the constraint parameterization method and within $1 \%$ of the optimum for the test time projection method. Figure 4 shows a test set sample and the respective output of the learned models.
132
+
133
+ ![](images/ccb26edf90e7c914ec8c93ff4de1521e67d3e69261ccf2961a943d7f3e77649f.jpg)
134
+ Figure 3: Mean-squared validation loss averaged over all pixels for 10 runs; shaded area denotes standard deviation. The objective function (6) is computed on a held-out validation set for the proposed constraint parameterization method and unconstrained optimization with subsequent test time projection. The average optimum over the validation set is obtained as a solution to a convex optimization problem. For the box delay curve, the box constraints are activated after 25 epochs (after $\sim \mathrm { 3 0 s }$ ), which results in better generalization. The best average validation error during training is within $9 \%$ of the optimum for the constraint parameterization method with box constraint delay and within $1 \%$ of the optimum for the test time projection method.
135
+
136
+ ![](images/49fc0106d7c90222b808e52dcf5a411c2b40977fc67fcc1408d6bbddb9492dbf.jpg)
137
+ Figure 4: Learning to solve the orthogonal projection onto a constraint set as defined in (6). From left to right: MNIST sample from a test set, optimal projection by solving a quadratic program, constraint parameterization model inference, and test time projection model inference.
138
+
139
+ # 4.2 CONSTRAINED GENERATIVE MODELING WITH VARIATIONAL AUTOENCODERS
140
+
141
+ Variational autoencoders (VAE) are a class of generative models that are jointly trained to encode observations into latent variables via an encoder or inference network and decode observations from latent variables using a decoder or generative network (Kingma & Welling, 2014). We base our implementation on (Baumgartner, 2018). The model has a fully-connected architecture: ¨
142
+
143
+ Here, $\mathrm { R e L U } ( x ) = \operatorname* { m a x } ( 0 , x )$ and the sigmoid non-linearity takes the form $\sigma ( x ) = 1 / ( 1 { + } \mathrm { e x p } ( - x ) )$ . In contrast to a standard VAE, we constrain the samples generated by the model to obey a checkerboard constraint. The model was optimized with an initial learning rate of $1 0 ^ { - 4 }$ , which was annealed by a factor of 0.1 if progress on the validation loss stagnated for more than 5 epochs. The batch size was chosen to be 64. The model was trained for 200 epochs while the unit box constraints were activated after 100 epochs. To generate images, we sample the latent space prior $z \sim \mathcal { N } ( 0 , I )$ and evaluate the decoding neural network (Figure 5). The model is able to sample authentic digits while obeying the checkerboard constraint.
144
+
145
+ # 4.3 FAST INFERENCE WITH CONSTRAINED NEURAL NETWORKS
146
+
147
+ The main advantage of the proposed method over a simple projection method is a vast speed-up at test time. Since the constraint is incorporated into the neural network architecture, a forward pass has almost no overhead compared to an unconstrained network. On the other hand, for a network that was trained without constraints, a final projection step is necessary; this requires solving a convex optimization problem, which is relatively costly. Table 1 shows inference times for both models for the above numerical experiments. The constraint parameterization approach is up to two orders of magnitude faster at test time compared to the test time projection algorithm.
148
+
149
+ ![](images/02f0cfe4745a3f1d0401396a1e80304dc0a37a9588d7f9d2d50cf658cde58b72.jpg)
150
+ Figure 5: Samples from a constrained variational autoencoder trained with the test time projection method and our constraint parameterization method. The images represent authentic digits while satisfying the imposed checkerboard constraint. Inference is significantly faster using our method.
151
+
152
+ Table 1: Inference time for test time projection and constraint parameterization methods. Mean and standard deviation of running times are computed over 100 runs of 59000 samples with a batch size of 256.
153
+
154
+ <table><tr><td>METHOD</td><td>PROJECTION</td><td>VAE</td></tr><tr><td>Test time projection</td><td>82±1 s</td><td>40±1s</td></tr><tr><td>Constraint parameterization (ours)</td><td>0.46 ± 0.02 s</td><td>0.75 ± 0.04 s</td></tr></table>
155
+
156
+ # 5 CONCLUSION
157
+
158
+ To combine a data-driven task with modeling constraints, we have developed a method to impose homogeneous linear inequality constraints on neural network activations. At initialization, a suitable parameterization is computed and subsequently a standard variant of stochastic gradient descent is used to train the reparameterized network. In this way, we can efficiently guarantee that network activations – in the final or any intermediate layer – satisfy the constraints at any point during training. The main advantage of our method over simply projecting onto the feasible set after unconstrained training is a significant speed-up at test time of up to two orders of magnitude. An important application of the proposed method is generative modeling with prior assumptions. Therefore, we demonstrated experimentally that the proposed method can be used successfully to constrain the output of a variational autoencoder. Our method is implemented as a layer, which is simple to combine with existing and novel neural network architectures in modern deep learning frameworks and is therefore readily available in practice.
159
+
160
+ # REFERENCES
161
+
162
+ Brandon Amos and J. Zico Kolter. OptNet: Differentiable optimization as a layer in neural networks. In Proceedings of the 34th International Conference on Machine Learning (ICML 2017), pp. 136– 145, 2017.
163
+
164
+ Tim Baumgartner.¨ VAE-CVAE-MNIST. https://github.com/timbmg/ VAE-CVAE-MNIST, 2018. commit: e4ba231.
165
+
166
+ David Bremner. Incremental convex hull algorithms are not output sensitive. Discrete & Computational Geometry, 21(1):57–68, 1999.
167
+
168
+ Rania Briq, Michael Moeller, and Juergen Gall. Convolutional Simplex Projection Network (CSPN) for Weakly Supervised Semantic Segmentation. BMVC 2018, 2018.
169
+
170
+ Arunkumar Byravan and Dieter Fox. SE3-nets: Learning rigid body motion using deep neural networks. In 2017 IEEE International Conference on Robotics and Automation (ICRA), 2017.
171
+
172
+ Martin E. Dyer. The complexity of vertex enumeration methods. Mathematics of Operations Research, 8(3):381–402, 1983.
173
+
174
+ Komei Fukuda and Alain Prodon. Double description method revisited, pp. 91–111. Combinatorics and Computer Science: 8th Franco-Japanese and 4th Franco-Chinese Conference Brest, France, July 3–5, 1995 Selected Papers. Springer Berlin Heidelberg, 1996.
175
+
176
+ 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 27 (NIPS 2014), pp. 2672–2680. 2014.
177
+
178
+ 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, volume 37, pp. 448–456. PMLR, 07–09 Jul 2015.
179
+
180
+ Diederik Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR 2014), 2014.
181
+
182
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton. ImageNet classification with deep convolutional neural networks. In Proceedings of the 25th International Conference of Neural Information Processing Systems (NIPS 2012), 2012.
183
+
184
+ Yann LeCun, Corinna Cortes, and Christopher Burges. The MNIST database of handwritten digits. URL http://yann.lecun.com/exdb/mnist/.
185
+
186
+ 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.
187
+
188
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
189
+
190
+ Pablo Marquez-Neila, Mathieu Salzmann, and Pascal Fua. Imposing hard constraints on deep net- ´ works: Promises and limitations. First Workshop on Negative Results in Computer Vision, CVPR 2017, 2017.
191
+
192
+ T. S. Motzkin, H. Raiffa, G. L. Thompson, and R. M. Thrall. The double description method. In Contributions to the Theory of Games II, volume 8 of Ann. of Math. Stud., pp. 51–73. Princeton University Press, 1953.
193
+
194
+ Jorge Nocedal and Stephen Wright. Numerical Optimization. Springer Series in Operations Research and Financial Engineering. Springer, 2006.
195
+
196
+ Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. Autodiff Workshop, NIPS 2017, 2017.
197
+
198
+ Deepak Pathak, Philipp Krahenb ¨ uhl, and Trevor Darrell. Constrained Convolutional Neural Net- ¨ works for Weakly Supervised Segmentation. In International Conference on Computer Vision (ICCV 2015), 2015.
199
+
200
+ Bartolomeo Stellato, Goran Banjac, Paul Goulart, Alberto Bemporad, and Stephen Boyd. OSQP: An Operator Splitting Solver for Quadratic Programs. ArXiv e-prints, 2017.
201
+
202
+ Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to Sequence Learning with Neural Networks. In Proceedings of the 27th International Conference of Neural Information Processing Systems (NIPS 2014), 2014.
203
+
204
+ Xingyi Zhou, Xiao Sun, Wei Zhang, Shuang Liang, and Yichen Wei. Deep Kinematic Pose Regression. Workshop on Geometry Meets Deep Learning, ECCV 2016, 2016.
md/train/ByxpMd9lx/ByxpMd9lx.md ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRANSFER LEARNING FOR SEQUENCE TAGGING WITHHIERARCHICAL RECURRENT NETWORKS
2
+
3
+ Zhilin Yang, Ruslan Salakhutdinov & William W. Cohen
4
+
5
+ School of Computer Science
6
+ Carnegie Mellon University
7
+ {zhiliny,rsalakhu,wcohen}@cs.cmu.edu
8
+
9
+ # ABSTRACT
10
+
11
+ Recent papers have shown that neural networks obtain state-of-the-art performance on several different sequence tagging tasks. One appealing property of such systems is their generality, as excellent performance can be achieved with a unified architecture and without task-specific feature engineering. However, it is unclear if such systems can be used for tasks without large amounts of training data. In this paper we explore the problem of transfer learning for neural sequence taggers, where a source task with plentiful annotations (e.g., POS tagging on Penn Treebank) is used to improve performance on a target task with fewer available annotations (e.g., POS tagging for microblogs). We examine the effects of transfer learning for deep hierarchical recurrent networks across domains, applications, and languages, and show that significant improvement can often be obtained. These improvements lead to improvements over the current state-ofthe-art on several well-studied tasks.1
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Sequence tagging is an important problem in natural language processing, which has wide applications including part-of-speech (POS) tagging, text chunking, and named entity recognition (NER). Given a sequence of words, sequence tagging aims to predict a linguistic tag for each word such as the POS tag.
16
+
17
+ An important challenge for sequence tagging is how to transfer knowledge from one task to another, which is often referred to as transfer learning (Pan & Yang, 2010). Transfer learning can be used in several settings, notably for low-resource languages (Zirikly & Hagiwara, 2015; Wang & Manning, 2014) and low-resource domains such as biomedical corpora (Kim et al., 2003) and Twitter corpora (Ritter et al., 2011)). In these cases, transfer learning can improve performance by taking advantage of more plentiful labels from related tasks. Even on datasets with relatively abundant labels, multi-task transfer can sometimes achieve improvement over state-of-the-art results (Collobert et al., 2011).
18
+
19
+ Recently, a number of approaches based on deep neural networks have addressed the problem of sequence tagging in an end-to-end manner (Collobert et al., 2011; Lample et al., 2016; Ling et al., 2015; Ma & Hovy, 2016). These neural networks consist of multiple layers of neurons organized in a hierarchy and can transform the input tokens to the output labels without explicit hand-engineered feature extraction. The aforementioned neural networks require minimal assumptions about the task at hand and thus demonstrate significant generality—one single model can be applied to multiple applications in multiple languages without changing the architecture. A natural question is whether the representation learned from one task can be useful for another task. In other words, is there a way we can exploit the generality of neural networks to improve task performance by sharing model parameters and feature representations with another task?
20
+
21
+ To address the above question, we study the transfer learning setting, which aims to improve the performance on a target task by joint training with a source task. We present a transfer learning approach based on a deep hierarchical recurrent neural network, which shares the hidden feature representation and part of the model parameters between the source task and the target task. Our approach combines the objectives of the two tasks and uses gradient-based methods for efficient training. We study cross-domain, cross-application, and cross-lingual transfer, and present a parameter-sharing architecture for each case. Experimental results show that our approach can significantly improve the performance of the target task when the the target task has few labels and is more related to the source task. Furthermore, we show that transfer learning can improve performance over state-ofthe-art results even if the amount of labels is relatively abundant.
22
+
23
+ We have novel contributions in two folds. First, our work is, to the best of our knowledge, the first that focuses on studying the transferability of different layers of representations for hierarchical RNNs. Second, different from previous transfer learning methods that usually focus on one specific transfer setting, our framework exploits different levels of representation sharing and provides a unified framework to handle cross-application, cross-lingual, and cross-domain transfer.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ There are two common paradigms for transfer learning for natural language processing (NLP) tasks, resource-based transfer and model-based transfer. Resource-based transfer utilizes additional linguistic annotations as weak supervision for transfer learning, such as cross-lingual dictionaries (Zirikly & Hagiwara, 2015), corpora (Wang & Manning, 2014), and word alignments (Yarowsky et al., 2001). Resource-based methods demonstrate considerable success in cross-lingual transfer, but are quite sensitive to the scale and quality of the additional resources. Resource-based transfer is mostly limited to cross-lingual transfer in previous works, and there is not extensive research on extending resource-based methods to cross-domain and cross-application settings.
28
+
29
+ Model-based transfer, on the other hand, does not require additional resources. Model-based transfer exploits the similarity and relatedness between the source task and the target task by adaptively modifying the model architectures, training algorithms, or feature representation. For example, Ando & Zhang (2005) proposed a transfer learning framework that shares structural parameters across multiple tasks, and improve the performance on various tasks including NER; Collobert et al. (2011) presented a task-independent convolutional neural network and employed joint training to transfer knowledge from NER and POS tagging to chunking; Peng & Dredze (2016) studied transfer learning between named entity recognition and word segmentation in Chinese based on recurrent neural networks. Cross-domain transfer, or domain adaptation, is also a well-studied branch of model-based transfer in NLP. Techniques in cross-domain transfer include the design of robust feature representations (Schnabel & Schutze, 2014), co-training (Chen et al., 2011), hierarchical Bayesian prior ¨ (Finkel & Manning, 2009), and canonical component analysis (Kim et al., 2015).
30
+
31
+ While our approach falls into the paradigm of model-based transfer, in contrast to the above methods, our method focuses on exploiting the generality of deep recurrent neural networks and is applicable to transfer between domains, applications, and languages.
32
+
33
+ Our work builds on previous work on sequence tagging based on deep neural networks. Collobert et al. (2011) develop end-to-end neural networks for sequence tagging without hand-engineered features. Later architectures based on different combinations of convolutional networks and recurrent networks have achieved state-of-the-art results on many tasks (Collobert et al., 2011; Huang et al., 2015; Chiu & Nichols, 2015; Lample et al., 2016; Ma & Hovy, 2016). These models demonstrate significant generality since they can be applied to multiple applications in multiple languages with a unified network architecture and without task-specific feature extraction.
34
+
35
+ # 3 APPROACH
36
+
37
+ In this section, we introduce our transfer learning approach. We first introduce an abstract framework for neural sequence tagging, summarizing previous work, and then discuss three different transfer learning architectures.
38
+
39
+ ![](images/4ffd056ce60bebeb9fb8ae4c45c66059d80d14346add42dac34469b19b218208.jpg)
40
+ (a) Base model: both of Char NN and Word NN can be implemented as CNNs or RNNs.
41
+
42
+ ![](images/8cb4309f629e7e38064998bb0dceb26d0130af745ef0aaa6acd72caab4e4e6af.jpg)
43
+ (b) Transfer model T-A: used for cross-domain transfer where label mapping is possible.
44
+
45
+ ![](images/ee417680cae4729dc9886c7bd24287bbd46970890ad665a1fbc8b4cca0c534db.jpg)
46
+
47
+ (c) Transfer model T-B: used for cross-domain transfer with disparate label sets, and crossapplication transfer.
48
+
49
+ ![](images/00bfff1e5331b614ab0846f321caf2ba75b20066966274be5d36e4b90d7ab01f.jpg)
50
+ (d) Transfer model T-C: used for cross-lingual transfer.
51
+ Figure 1: Model architectures: “Char NN” denotes character-level neural networks, “Word NN” denotes word-level neural networks, “Char Emb” and “Word Emb” refer to character embeddings and word embeddings respectively.
52
+
53
+ # 3.1 BASE MODEL
54
+
55
+ Though many different variants of neural networks have been proposed for the problem of sequence tagging, we find that most of the models can be described with the hierarchical framework illustrated in Figure 1(a). A character-level layer takes a sequence of characters (represented as embeddings) as input, and outputs a representation that encodes the morphological information at the character level. A word-level layer subsequently combines the character-level feature representation and a word embedding, and further incorporates the contextual information to output a new feature representation. After two levels of feature extraction (encoding), the feature representation output by the word-level layer is fed to a conditional random field (CRF) layer that outputs the label sequence.
56
+
57
+ Both of the word-level layer and the character-level layer can be implemented as convolutional neural networks (CNNs) or recurrent neural networks (RNNs) (Collobert et al., 2011; Chiu & Nichols, 2015; Lample et al., 2016; Ma & Hovy, 2016). We discuss the details of the model we use in this work in Section 3.4.
58
+
59
+ # 3.2 TRANSFER LEARNING ARCHITECTURES
60
+
61
+ We develop three architectures for transfer learning, T-A, T-B, and T-C, are illustrated in Figures 1(b), 1(c), and 1(d) respectively. The three architectures are all extensions of the base model discussed in the previous section with different parameter sharing schemes. We now discuss the use cases for the different architectures.
62
+
63
+ # 3.2.1 CROSS-DOMAIN TRANSFER
64
+
65
+ Since different domains are “sub-languages” that have domain-specific regularities, sequence taggers trained on one domain might not have optimal performance on another domain. The goal of cross-domain transfer is to learn a sequence tagger that transfers knowledge from a source domain to a target domain. We assume that few labels are available in the target domain.
66
+
67
+ There are two cases of cross-domain transfer. The two domains can have label sets that can be mapped to each other, or disparate label sets. For example, POS tags in the Genia biomedical corpus can be mapped to Penn Treebank tags (Barrett & Weber-Jahnke, 2014), while some POS tags in Twitter (e.g., “URL”) cannot be mapped to Penn Treebank tags (Ritter et al., 2011).
68
+
69
+ If the two domains have mappable label sets, we share all the model parameters and feature representation in the neural networks, including the word and character embedding, the word-level layer, the character-level layer, and the CRF layer. We perform a label mapping step on top of the CRF layer. This becomes the model T-A as shown in Figure 1(b).
70
+
71
+ If the two domains have disparate label sets, we untie the parameter sharing in the CRF layer—i.e., each task learns a separate CRF layer. This parameter sharing scheme reduces to model T-B as shown in Figure 1(c).
72
+
73
+ # 3.2.2 CROSS-APPLICATION TRANSFER
74
+
75
+ Sequence tagging has a couple of applications including POS tagging, chunking, and named entity recognition. Similar to the motivation in (Collobert et al., 2011), it is usually desirable to exploit the underlying similarities and regularities of different applications, and improve the performance of one application via joint training with another. Moreover, transfer between multiple applications can be helpful when the labels are limited.
76
+
77
+ In the cross-application setting, we assume that multiple applications are in the same language. Since different applications share the same alphabet, the case is similar to cross-domain transfer with disparate label sets. We adopt the architecture of model T-B for cross-application transfer learning where only the CRF layers are disjoint for different applications.
78
+
79
+ # 3.2.3 CROSS-LINGUAL TRANSFER
80
+
81
+ Though cross-lingual transfer is usually accomplished with additional multi-lingual resources, these methods are sensitive to the size and quality of the additional resources (Yarowsky et al., 2001; Wang & Manning, 2014). In this work, instead, we explore a complementary method that exploits the cross-lingual regularities purely on the model level.
82
+
83
+ Our approach focuses on transfer learning between languages with similar alphabets, such as English and Spanish, since it is very difficult for transfer learning between languages with disparate alphabets (e.g., English and Chinese) to work without additional resources (Zirikly & Hagiwara, 2015).
84
+
85
+ Model-level transfer learning is achieved through exploiting the morphologies shared by the two languages. For example, “Canada” in English and “Canada” in Spanish refer to the same named ´ entity, and the morphological similarities can be leveraged for NER and also POS tagging with nouns. Thus we share the character embeddings and the character-level layer between different languages for transfer learning, which is illustrated as the model T-C in Figure 1(d).
86
+
87
+ # 3.3 TRAINING
88
+
89
+ In the above sections, we introduced three neural architectures with different parameter sharing schemes, designed for different transfer learning settings. Now we describe how we train the neural networks jointly for two tasks.
90
+
91
+ Suppose we are transferring from a source task $s$ to a target task $t$ , with the training instances being $X _ { s }$ and $X _ { t }$ . Let $W _ { s }$ and $W _ { t }$ denote the set of model parameters for the source and target tasks respectively. The model parameters are divided into two sets, task specific parameters and shared parameters, i.e.,
92
+
93
+ $$
94
+ W _ { s } = W _ { s , \mathrm { s p e c } } \cup W _ { \mathrm { s h a r e d } } , W _ { t } = W _ { t , \mathrm { s p e c } } \cup W _ { \mathrm { s h a r e d } } ,
95
+ $$
96
+
97
+ where shared parameters $W _ { \mathrm { s h a r e d } }$ are jointly optimized by the two tasks, while task specific parameters $W _ { s , \mathrm { s p e c } }$ and $W _ { t }$ ,spec are trained for each task separately.
98
+
99
+ The training procedure is as follows. At each iteration, we sample a task (i.e., either $s$ or $t$ ) from $\{ s , t \}$ based on a binomial distribution (the binomial probability is set as a hyperparameter). Given the sampled task, we sample a batch of training instances from the given task, and then perform a gradient update according to the loss function of the given task. We update both the shared parameters and the task specific parameters. We repeat the above iterations until stopping. We adopt AdaGrad (Duchi et al., 2011) to dynamically compute the learning rates for each iteration. Since the source and target tasks might have different convergence rates, we do early stopping on the target task performance.
100
+
101
+ # 3.4 MODEL IMPLEMENTATION
102
+
103
+ In this section, we describe our implementation of the base model. Both the character-level and word-level neural networks are implemented as RNNs. More specifically, we employ gated recurrent units (GRUs) (Cho et al., 2014). Let $( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \cdots , \mathbf { x } _ { T } )$ be a sequence of inputs that can be embeddings or hidden states of other layers. Let $\mathbf { h } _ { t }$ be the GRU hidden state at time step $t$ . Formally, a GRU unit at time step $t$ can be expressed as
104
+
105
+ $$
106
+ \begin{array} { r c l } { \mathbf { r } _ { t } } & { = } & { \sigma ( W _ { r x } \mathbf { x } _ { t } + W _ { r h } \mathbf { h } _ { t - 1 } ) } \\ { \mathbf { z } _ { t } } & { = } & { \sigma ( W _ { z x } \mathbf { x } _ { t } + W _ { z h } \mathbf { h } _ { t - 1 } ) } \\ { \tilde { \mathbf { h } } _ { t } } & { = } & { \operatorname { t a n h } ( W _ { h x } \mathbf { x } _ { t } + W _ { h h } ( \mathbf { r } _ { t } \odot \mathbf { h } _ { t - 1 } ) ) } \\ { \mathbf { h } _ { t } } & { = } & { \mathbf { z } _ { t } \odot \mathbf { h } _ { t - 1 } + ( 1 - \mathbf { z } _ { t } ) \odot \tilde { \mathbf { h } } _ { t } , } \end{array}
107
+ $$
108
+
109
+ where $W$ ’s are model parameters of each unit, $\tilde { \mathbf { h } } _ { t }$ is a candidate hidden state that is used to compute $\mathbf { h } _ { t }$ , $\sigma$ is an element-wise sigmoid logistic function defined as $\sigma ( { \bf x } ) = 1 / ( 1 + e ^ { - { \bf x } } )$ , and $\odot$ denotes element-wise multiplication of two vectors. Intuitively, the update gate $\mathbf { z } _ { t }$ controls how much the unit updates its hidden state, and the reset gate $\mathbf { r } _ { t }$ determines how much information from the previous hidden state needs to be reset. The input to the character-level GRUs is character embeddings, while the input to the word-level GRUs is the concatenation of character-level GRU hidden states and word embeddings. Both GRUs are bi-directional and have two layers.
110
+
111
+ Given an input sequence of words, the word-level GRUs and the character-level GRUs together learn a feature representation $\mathbf { h } _ { t }$ for the $t$ -th word in the sequence, which forms a sequence ${ \bf h } = ( { \bf h } _ { 1 } , { \bf h } _ { 2 } , \cdot \cdot \cdot , \bar { { \bf h } } _ { T } )$ . Let $y = ( y _ { 1 } , y _ { 2 } , \cdot \cdot \cdot , y _ { T } )$ denote the tag sequence. Given the feature representation $\mathbf { h }$ and the tag sequence $\mathbf { y }$ for each training instance, the CRF layer defines the objective function to maximize based on a max-margin principle (Gimpel & Smith, 2010) as:
112
+
113
+ $$
114
+ f ( \mathbf { h } , \mathbf { y } ) - \log \sum _ { \mathbf { y } ^ { \prime } \in \mathcal { Y } ( \mathbf { h } ) } \exp ( f ( \mathbf { h } , \mathbf { y } ^ { \prime } ) + \mathrm { c o s t } ( \mathbf { y } , \mathbf { y } ^ { \prime } ) ) ,
115
+ $$
116
+
117
+ where $f$ is a function that assigns a score for each pair of $\mathbf { h }$ and $\mathbf { y }$ , and $\mathcal { V } ( \mathbf { h } )$ denotes the space of tag sequences for $\mathbf { h }$ . The cost function $\cos \mathbf { t } ( \mathbf { y } , \mathbf { y } ^ { \prime } )$ is added based on the max-margin principle (Gimpel & Smith, 2010) that high-cost tags $\mathbf { y } ^ { \prime }$ should be penalized more heavily.
118
+
119
+ Our base model is similar to Lample et al. (2016), but in contrast to their model, we employ GRUs for the character-level and word-level networks instead of Long Short-Term Memory (LSTM) units, and define the objective function based on the max-margin principle. We note that our transfer learning framework does not make assumptions about specific model implementation, and could be applied to other neural architectures (Collobert et al., 2011; Chiu & Nichols, 2015; Lample et al., 2016; Ma & Hovy, 2016) as well.
120
+
121
+ # 4 EXPERIMENTS
122
+
123
+ # 4.1 DATASETS
124
+
125
+ We use the following benchmark datasets in our experiments: Penn Treebank (PTB) POS tagging, CoNLL 2000 chunking, CoNLL 2003 English NER, CoNLL 2002 Dutch NER, CoNLL 2002 Spanish NER, the Genia biomedical corpus (Kim et al., 2003), and a Twitter corpus (Ritter et al., 2011).
126
+
127
+ ![](images/be19930616ffb99acdb74a801c96dce362d24d1694c02ca4082a9777d5866149.jpg)
128
+ (a) Transfer from PTB to Genia.
129
+
130
+ ![](images/e54e3f9a25ecbea23a4887e9a7d2258f8a612c967c10421c1bf75747824fe1ef.jpg)
131
+ (b) Transfer from CoNLL 2003 NER to Genia.
132
+
133
+ ![](images/600a30b3e801e142a0d82ad933c2f3e5d36c3d5a2ac707e8b33f3225079060cb.jpg)
134
+ (c) Transfer from Spanish NER to Genia.
135
+
136
+ ![](images/bcda3d9a97b5d6026a72cee8c924f6fcfc18a574bceada26eba20b21d617b7b7.jpg)
137
+ (d) Transfer from PTB to Twitter POS tagging.
138
+
139
+ ![](images/1790b1dc86bbd4e81b36bcc933eb8b504aedbdcd154f8e3779715a2873ce4a00.jpg)
140
+ (e) Transfer from CoNLL 2003 to Twitter NER.
141
+
142
+ ![](images/8b50d66208e8431657f08ffb9f794ea8b98c00f8ad075186d2dfb52cfb88708e.jpg)
143
+ (f) Transfer from CoNLL 2003 NER to PTB POS tagging.
144
+
145
+ ![](images/5b9afa5387f847426cd509c4546f442cc3f4dbf98c9c10f2144e694df8bf4511.jpg)
146
+ (g) Transfer from PTB POS tagging to CoNLL 2000 chunking.
147
+
148
+ ![](images/65c780fb1f02a75aa6249fa59332b016af5f1464ee20903c59c05362918238af.jpg)
149
+ (h) Transfer from PTB POS tagging to CoNLL 2003 NER.
150
+
151
+ ![](images/6032705e3ba397ea1d33ba7ab1a5f7f0fe86760bd6e0918dc42a72ffd4bbe322.jpg)
152
+ (i) Transfer from CoNLL 2003 English NER to Spanish NER.
153
+ Figure 2: Results on transfer learning. Cross-domain transfer: Figures 2(a), 2(d), and 2(e). Cross-application transfer: Figures 2(f), $2 ( \mathbf { g } )$ , and 2(h). Cross-lingual transfer: Figures 2(i) and 2(j). Transfer across domains and applications: Figure 2(b). Transfer across domains, applications, and languages: Figure 2(c).
154
+
155
+ ![](images/017be96bd4dfa0e69c062e645b45c21a382fbe68d6c0176fafaefda5b7a27761.jpg)
156
+ (j) Transfer from Spanish NER to CoNLL 2003 English NER.
157
+
158
+ The statistics of the datasets are described in Table 1. We construct the POS tagging dataset with the instructions described in Toutanova et al. (2003). Note that as a standard practice, the POS tags are extracted from the parsed trees. For the CoNLL 2003 English NER dataset, we follow previous works (Collobert et al., 2011) to append one-hot gazetteer features to the input of the CRF layer for fair comparison. Since there is no standard training/dev/test data split for the Genia and Twitter corpora, we randomly sample $10 \%$ for test, $10 \%$ for development, and $80 \%$ for training. We follow previous work (Barrett & Weber-Jahnke, 2014) to map Genia POS tags to PTB POS tags.
159
+
160
+ Table 1: Dataset statistics.
161
+
162
+ <table><tr><td>Benchmark</td><td>Task</td><td>Language</td><td>#Training Tokens</td><td>#Dev Tokens</td><td># Test Tokens</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PTB 2003</td><td>POS Tagging</td><td>English</td><td>912.344</td><td>131,768</td><td>129,654</td></tr><tr><td>CoNLL 2000</td><td>Chunking</td><td>English</td><td>211,727</td><td></td><td>47,377</td></tr><tr><td>CoNLL 2003</td><td>NER</td><td>English</td><td>204,567</td><td>51,578</td><td>46,666</td></tr><tr><td>CoNLL 2002</td><td>NER</td><td>Dutch</td><td>202,931</td><td>37,761</td><td>68,994</td></tr><tr><td>CoNLL 2002</td><td>NER</td><td>Spanish</td><td>207,484</td><td>51,645</td><td>52,098</td></tr><tr><td>Genia</td><td>POS Tagging</td><td>English</td><td>400,658</td><td>50,525</td><td>49,761</td></tr><tr><td>Twitter</td><td>POS Tagging</td><td>English</td><td>12,196</td><td>1,362</td><td>1,627</td></tr><tr><td>Twitter</td><td>NER</td><td>English</td><td>36,936</td><td>4,612</td><td>4,921</td></tr></table>
163
+
164
+ Table 2: Improvements with transfer learning under multiple low-resource settings $( \% )$ . “Dom”, “app”, and “ling” denote cross-domain, cross-application, and cross-lingual transfer settings respectively. The numbers following the slashes are labeling rates (chosen such that the number of labeled examples are of the same scale).
165
+
166
+ <table><tr><td>Source</td><td>Target</td><td>Model</td><td>Setting</td><td>Transfer</td><td>No Transfer</td><td>Delta</td></tr><tr><td>PTB</td><td>Twitter/0.1</td><td>T-A</td><td>dom</td><td>83.65</td><td>74.80</td><td>8.85</td></tr><tr><td>CoNLL03</td><td>Twitter/0.1</td><td>T-A</td><td>dom</td><td>43.24</td><td>34.65</td><td>8.59</td></tr><tr><td>PTB</td><td>CoNLL03/0.01</td><td>T-B</td><td></td><td>74.92</td><td>68.64</td><td>6.28</td></tr><tr><td>PTB</td><td></td><td>T-B</td><td>app</td><td></td><td></td><td></td></tr><tr><td>CoNLL03</td><td>CoNLL00/0.01</td><td>T-B</td><td>app</td><td>86.73</td><td>83.49</td><td>3.24</td></tr><tr><td>Spanish</td><td>PTB/0.001 CoNLL03/0.01</td><td>T-C</td><td>app</td><td>87.47</td><td>84.16</td><td>3.31</td></tr><tr><td>CoNLL03</td><td></td><td></td><td>ling</td><td>72.61</td><td>68.64</td><td>3.97</td></tr><tr><td></td><td>Spanish/0.01</td><td>T-C</td><td>ling</td><td>60.43</td><td>59.84</td><td>0.59</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PTB</td><td>Genia/0.001</td><td>T-A</td><td>dom</td><td>92.62</td><td>83.26</td><td>9.36</td></tr><tr><td>CoNLL03</td><td>Genia/0.001</td><td>T-B</td><td>dom&amp;app</td><td>87.47</td><td>83.26</td><td>4.21</td></tr><tr><td>Spanish</td><td>Genia/0.001</td><td>T-C</td><td>dom&amp;app&amp;ling</td><td>84.39</td><td>83.26</td><td>1.13</td></tr><tr><td>PTB</td><td>Genia/0.001</td><td>T-B</td><td>dom</td><td>89.77</td><td>83.26</td><td>6.51</td></tr><tr><td>PTB</td><td>Genia/0.001</td><td>T-C</td><td>dom</td><td>84.65</td><td>83.26</td><td>1.39</td></tr></table>
167
+
168
+ # 4.2 TRANSFER LEARNING PERFORMANCE
169
+
170
+ We evaluate our transfer learning approach on the above datasets. We fix the hyperparameters for all the results reported in this section: we set the character embedding dimension at 25, the word embedding dimension at 50 for English and 64 for Spanish, the dimension of hidden states of the character-level GRUs at 80, the dimension of hidden states of the word-level GRUs at 300, and the initial learning rate at 0.01. Except for the Twitter datasets, these datasets are fairly large. To simulate a low-resource setting, we also use random subsets of the data. We vary the labeling rate of the target task at 0.001, 0.01, 0.1 and 1.0. Given a labeling rate $r$ , we randomly sample a ratio $r$ of the sentences from the training set and discard the rest of the training data—e.g., a labeling rate of 0.001 results in around 900 training tokens on PTB POS tagging (Cf. Table 1).
171
+
172
+ The results on transfer learning are plotted in Figure 2, where we compare the results with and without transfer learning under various labeling rates. The numbers in the y-axes are accuracies for POS tagging, and chunk-level F1 scores for chunking and NER. The numbers are shown in Table 2. We can see that our transfer learning approach consistently improved over the non-transfer results. We also observe that the improvement by transfer learning is more substantial when the labeling rate is lower. For cross-domain transfer, we obtained substantial improvement on the Genia and Twitter corpora by transferring the knowledge from PTB POS tagging and CoNLL 2003 NER. For example, as shown in Figure 2(a), we can obtain an tagging accuracy of $8 3 \% +$ with zero labels and $9 \mathrm { { 2 \% } }$ with only 0.001 labels when transferring from PTB to Genia. As shown in Figures 2(d) and 2(e), our transfer learning approach can improve the performance on Twitter POS tagging and NER for all labeling rates, and the improvements with 0.1 labels are more than $8 \%$ for both datasets. Cross-application transfer also leads to substantial improvement under low-resource conditions. For example, as shown in Figures 2(g) and 2(h), the improvements with 0.1 labels are $6 \%$ and $3 \%$ on CoNLL 2000 chunking and CoNLL 2003 NER respectively when transferring from PTB POS tagging. Figures 2(j) and 2(i) show that cross-lingual transfer can improve the performance when few labels are available.
173
+
174
+ Table 3: Comparison with state-of-the-art results $( \% )$ .
175
+
176
+ <table><tr><td>Model</td><td>CoNLL 2000</td><td>CoNLL 2003</td><td>Spanish</td><td>Dutch</td><td>PTB 2003</td></tr><tr><td>Collobert et al. (2011)</td><td>94.32</td><td>89.59</td><td></td><td></td><td>97.29</td></tr><tr><td>Passos et al. (2014)</td><td>1</td><td>90.90</td><td></td><td></td><td>1</td></tr><tr><td>Luo et al. (2015)</td><td></td><td>91.2</td><td>1</td><td>1</td><td>一</td></tr><tr><td>Huang et al. (2015)</td><td>94.46</td><td>90.10</td><td>1</td><td>1</td><td>97.55</td></tr><tr><td>Gillick et al. (2015)</td><td>/</td><td>86.50</td><td>82.95</td><td>82.84</td><td></td></tr><tr><td>Ling et al. (2015)</td><td></td><td>一</td><td>一</td><td>1</td><td>97.78</td></tr><tr><td>Lample et al. (2016)</td><td></td><td>90.94</td><td>85.75</td><td>81.74</td><td>一</td></tr><tr><td>Ma&amp; Hovy (2016)</td><td>1</td><td>91.21</td><td>1</td><td>1</td><td>97.55</td></tr><tr><td>Ours w/o transfer</td><td>94.66</td><td>91.20</td><td>84.69</td><td>85.00</td><td>97.55</td></tr><tr><td>Ours w/ transfer</td><td>95.41</td><td>91.26</td><td>85.77</td><td>85.19</td><td>97.55</td></tr></table>
177
+
178
+ Figure 2 further shows that the improvements by different architectures are in the following order: $\mathrm { T } { \cdot } \mathrm { A } > \mathrm { T } { \cdot } \mathrm { B } > \mathrm { T } { \cdot } \mathrm { C }$ . This phenomenon can be explained by the fact that T-A shares the most model parameters while T-C shares the least. Transfer settings like cross-lingual transfer can only use T-C because the underlying similarities between the source task and the target task are less prominent (i.e., less transferable), and in those cases the improvement by transfer learning is less substantial.
179
+
180
+ Another interesting comparison is among Figures 2(a), 2(b), and 2(c). Figure 2(a) is cross-domain transfer, Figure 2(b) is transfer across domains and applications at the same time, and Figure 2(c) combines all the three transfer settings (i.e., from Spanish NER in the general domain to English POS tagging in the biomedical domain). The results show that the improvement by transfer learning diminishes when the transfer becomes “indirect” (i.e., the source task and the target task are more loosely related).
181
+
182
+ We also study using different transfer learning models for the same task. We study the effects of using T-A, T-B, and T-C when transferring from PTB to Genia, and the results are included in the lower part of Table 2. We observe that the performance gain decreases when less parameters are shared (i.e., $\mathrm { T } { \cdot } \mathrm { A } > \mathrm { T } { \cdot } \mathrm { B } > \mathrm { T } { \cdot } \mathrm { C } )$ ).
183
+
184
+ # 4.3 COMPARISON WITH STATE-OF-THE-ART RESULTS
185
+
186
+ In the above section, we examine the effects of different transfer learning architectures. Now we compare our approach with state-of-the-art systems on these datasets.
187
+
188
+ We use publicly available pretrained word embeddings as initialization. On the English datasets, following previous works that are based on neural networks (Collobert et al., 2011; Huang et al., 2015; Chiu & Nichols, 2015; Ma & Hovy, 2016), we experiment with both the 50-dimensional SENNA embeddings (Collobert et al., 2011) and the 100-dimensional GloVe embeddings (Pennington et al., 2014) and use the development set to choose the embeddings for different tasks and settings. For Spanish and Dutch, we use the 64-dimensional Polyglot embeddings (Al-Rfou et al., 2013). We set the hidden state dimensions to be 300 for the word-level GRU. The initial learning rate for AdaGrad is fixed at 0.01. We use the development set to tune the other hyperparameters of our model.
189
+
190
+ Our results are reported in Table 3. Since there are no standard data splits on the Genia and Twitter corpora, we do not include these datasets into our comparison. The results for CoNLL 2000 chunking, CoNLL 2003 NER, and PTB POS tagging are obtained by transfer learning between the three tasks, i.e., transferring from two tasks to the other. The results for Spanish and Dutch NER are obtained with transfer learning between the NER datasets in three languages (English, Spanish, and Dutch). From Table 3, we can draw two conclusions. First, our transfer learning approach achieves new state-of-the-art results on all the considered benchmark datasets except PTB POS tagging, which indicates that transfer learning can still improve the performance even on datasets with relatively abundant labels. Second, our base model (w/o transfer) performs competitively compared to the state-of-the-art systems, which means that the improvements shown in Section 4.2 are obtained over a strong baseline.
191
+
192
+ # 5 CONCLUSION
193
+
194
+ In this paper we develop a transfer learning approach for sequence tagging, which exploits the generality demonstrated by deep neural networks in previous work. We design three neural network architectures for the settings of cross-domain, cross-application, and cross-lingual transfer. Our transfer learning approach achieves significant improvement on various datasets under low-resource conditions, as well as new state-of-the-art results on some of the benchmarks. With thorough experiments, we observe that the following factors are crucial for the performance of our transfer learning approach: a) label abundance for the target task, b) relatedness between the source and target tasks, and c) the number of parameters that can be shared. In the future, it will be interesting to combine model-based transfer (as in this work) with resource-based transfer for cross-lingual transfer learning.
195
+
196
+ # ACKNOWLEDGMENTS
197
+
198
+ This work was funded by NVIDIA, the Office of Naval Research grant N000141512791, the ADeLAIDE grant FA8750-16C-0130-001, the NSF grant IIS1250956, and Google Research.
199
+
200
+ # REFERENCES
201
+
202
+ Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. Polyglot: Distributed word representations for multilingual nlp. In ACL, 2013.
203
+ Rie Kubota Ando and Tong Zhang. A framework for learning predictive structures from multiple tasks and unlabeled data. JMLR, 6:1817–1853, 2005.
204
+ Neil Barrett and Jens Weber-Jahnke. A token centric part-of-speech tagger for biomedical text. Artificial intelligence in medicine, 61(1):11–20, 2014.
205
+ Minmin Chen, Kilian Q Weinberger, and John Blitzer. Co-training for domain adaptation. In NIPS, pp. 2456– 2464, 2011.
206
+ Jason PC Chiu and Eric Nichols. Named entity recognition with bidirectional lstm-cnns. arXiv preprint arXiv:1511.08308, 2015.
207
+ Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural ¨ machine translation: Encoder-decoder approaches. In ACL, 2014.
208
+ Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natural ´ language processing (almost) from scratch. JMLR, 12:2493–2537, 2011.
209
+ John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011.
210
+ Jenny Rose Finkel and Christopher D Manning. Hierarchical bayesian domain adaptation. In HLT, pp. 602– 610, 2009.
211
+ Dan Gillick, Cliff Brunk, Oriol Vinyals, and Amarnag Subramanya. Multilingual language processing from bytes. arXiv preprint arXiv:1512.00103, 2015.
212
+ Kevin Gimpel and Noah A Smith. Softmax-margin crfs: Training log-linear models with cost functions. In NAACL, pp. 733–736, 2010.
213
+ Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015.
214
+ J-D Kim, Tomoko Ohta, Yuka Tateisi, and Junichi Tsujii. Genia corpusa semantically annotated corpus for bio-textmining. Bioinformatics, 19(suppl 1):i180–i182, 2003.
215
+ Young-Bum Kim, Karl Stratos, Ruhi Sarikaya, and Minwoo Jeong. New transfer learning techniques for disparate label sets. In ACL, 2015.
216
+ Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. In NAACL, 2016.
217
+ Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ramon Fernandez Astudillo, Silvio Amir, Chris Dyer, Alan W Black, ´ and Isabel Trancoso. Finding function in form: Compositional character models for open vocabulary word representation. In EMNLP, 2015.
218
+ Gang Luo, Xiaojiang Huang, Chin-Yew Lin, and Zaiqing Nie. Joint named entity recognition and disambiguation. In ACL, 2015.
219
+ Xuezhe Ma and Eduard Hovy. End-to-end sequence labeling via bi-directional lstm-cnns-crf. In ACL, 2016.
220
+ Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. Knowledge and Data Engineering, IEEE Transactions on, 22(10):1345–1359, 2010.
221
+ Alexandre Passos, Vineet Kumar, and Andrew McCallum. Lexicon infused phrase embeddings for named entity resolution. In HLT, 2014.
222
+ Nanyun Peng and Mark Dredze. Improving named entity recognition for chinese social media with word segmentation representation learning. In ACL, 2016.
223
+ Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In EMNLP, volume 14, pp. 1532–1543, 2014.
224
+ Lev Ratinov and Dan Roth. Design challenges and misconceptions in named entity recognition. In CoNLL, pp. 147–155, 2009.
225
+ Alan Ritter, Sam Clark, Oren Etzioni, et al. Named entity recognition in tweets: an experimental study. In EMNLP, pp. 1524–1534, 2011.
226
+ Tobias Schnabel and Hinrich Schutze. Flors: Fast and simple domain adaptation for part-of-speech tagging. ¨ TACL, 2:15–26, 2014.
227
+ Kristina Toutanova, Dan Klein, Christopher D Manning, and Yoram Singer. Feature-rich part-of-speech tagging with a cyclic dependency network. In NAACL, pp. 173–180, 2003.
228
+ Mengqiu Wang and Christopher D Manning. Cross-lingual pseudo-projected expectation regularization for weakly supervised learning. TACL, 2014.
229
+ David Yarowsky, Grace Ngai, and Richard Wicentowski. Inducing multilingual text analysis tools via robust projection across aligned corpora. In HLT, pp. 1–8, 2001.
230
+ Ayah Zirikly and Masato Hagiwara. Cross-lingual transfer of named entity recognizers without parallel corpora. In ACL, 2015.
md/train/GSXEx6iYd0/GSXEx6iYd0.md ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Numerical Composition of Differential Privacy∗
2
+
3
+ Sivakanth Gopi Microsoft Research sigopi@microsoft.com
4
+
5
+ Yin Tat Lee University of Washington yintat@uw.edu
6
+
7
+ Lukas Wutschitz Microsoft lukas.wutschitz@microsoft.com
8
+
9
+ # Abstract
10
+
11
+ We give a fast algorithm to optimally compose privacy guarantees of differentially private (DP) algorithms to arbitrary accuracy. Our method is based on the notion of privacy loss random variables to quantify the privacy loss of DP algorithms. The running time and memory needed for our algorithm to approximate the privacy√ curve of a DP algorithm composed with itself $k$ times is $\bar { \tilde { O } } ( { \sqrt { k } } )$ . This improves over the best prior method by [KH21] which requires $\tilde { \Omega } ( k ^ { 1 . 5 } )$ running time. We demonstrate the utility of our algorithm by accurately computing the privacy loss of DP-SGD algorithm of Abadi et al. $[ \mathsf { A C G } ^ { + } 1 6 ]$ and showing that our algorithm speeds up the privacy computations by a few orders of magnitude compared to prior work, while maintaining similar accuracy.
12
+
13
+ # 1 Introduction
14
+
15
+ Differential privacy (DP) introduced by [DMNS06] provides a provable and quantifiable guarantee of privacy when the results of an algorithm run on private data are made public. Formally, we can define an $( \varepsilon , \delta )$ -differentially private algorithm as follows.
16
+
17
+ Definition 1.1 ( $( \varepsilon , \delta )$ -DP [DMNS06, $\mathrm { D K M ^ { + } 0 6 ] }$ ). An algorithm $\mathcal { M }$ is $( \varepsilon , \delta )$ -DP if for any two neighboring databases $D , D ^ { \prime }$ differing in exactly one user and any subset $S$ of outputs, we have $\operatorname* { P r } [ \mathcal { M } ( D ) \in S ] \le e ^ { \varepsilon } \operatorname* { P r } [ \mathcal { M } ( D ^ { \prime } ) \in S ] + \delta$ .
18
+
19
+ Intuitively, it says that looking at the outcome of $\mathcal { M }$ , we cannot tell whether it was run on $D$ or $D ^ { \prime }$ . Hence an adversary cannot infer the existence of any particular user in the input database, and therefore cannot learn any personal data of any particular user.
20
+
21
+ DP algorithms have an important property called composition. Suppose $M _ { 1 }$ and $M _ { 2 }$ are DP algorithms and say $M ( D ) = ( M _ { 1 } ( D ) , M _ { 2 } ( D ) )$ , i.e., $M$ runs both the algorithms on $D$ and outputs their results. Then $M$ is also a DP algorithm.
22
+
23
+ Proposition 1.2 (Simple composition $\mathrm { [ D K M ^ { + } 0 6 }$ , DL09]). If $M _ { 1 }$ is $( \varepsilon _ { 1 } , \delta _ { 1 } )$ -DP and $M _ { 2 }$ is $( \varepsilon _ { 2 } , \delta _ { 2 } )$ - $D P ,$ then $M ( D ) = ( \bar { M } _ { 1 } ( D ) , \bar { M } _ { 2 } ( D ) )$ is $( \varepsilon _ { 1 } + \varepsilon _ { 2 } , \delta _ { 1 } + \delta _ { 2 } ) – D P .$ .
24
+
25
+ This also holds under adaptive composition (denoted by $M = M _ { 2 } \circ M _ { 1 } )$ , where $M _ { 2 }$ can look at both the database and the output of $M _ { 1 }$ (here $M ( D ) = ( M _ { 1 } ( D ) , M _ { 2 } ( D , M _ { 1 } ( D ) ) ) )$ . It turns out that both compositions enjoy much better DP guarantees than this simple composition rule. Let $M$ be an $( \varepsilon , \delta )$ -DP algorithm and let $M ^ { \circ k }$ denote the (adaptive) composition of $M$ with itself $k$ times. The naive composition rule shows that $M ^ { \circ k }$ is $( k \varepsilon , k \delta )$ -DP. This was significantly improved in [DRV10].
26
+
27
+ Proposition 1.3 (Advanced composition [DRV10, $\mathrm { D R } ^ { + } 1 4 ]$ ). If $M$ is $( \varepsilon , \delta )$ -DP, then $M ^ { \circ k }$ is $( \varepsilon ^ { \prime } , k \delta +$ $\delta ^ { \prime }$ )-DP where
28
+
29
+ $$
30
+ \varepsilon ^ { \prime } = \varepsilon \sqrt { 2 k \log \left( \frac { 1 } { \delta ^ { \prime } } \right) } + k \varepsilon ( e ^ { \varepsilon } - 1 ) .
31
+ $$
32
+
33
+ Note that if $\begin{array} { r } { \varepsilon = O \left( \frac { 1 } { \sqrt { k } } \right) } \end{array}$ and $\begin{array} { r } { \delta = o \left( \frac { 1 } { k } \right) } \end{array}$ , then $M ^ { \circ k }$ satisfies $( O _ { \delta ^ { \prime } } ( 1 ) , \delta ^ { \prime } )$ -DP. Using simple composition (Proposition 1.2), we can only claim that $M ^ { \circ k }$ is $( O ( { \sqrt { k } } ) , o ( 1 ) )$ -DP. Thus advanced composition often results in $\sqrt { k }$ -factor savings in privacy which is significant in practice. The optimal DP guarantees for $k$ -fold composition of an $( \varepsilon , \delta )$ -DP algorithm were finally obtained by [KOV15]. For composing different algorithms, the situation is more complicated. If $M _ { 1 } , M _ { 2 } , \ldots , M _ { k }$ are DP algorithms such that $M _ { i }$ is $( \varepsilon _ { i } , \delta _ { i } )$ -DP, then it is shown by [MV16] that computing the exact DP guarantees for $M = M _ { 1 } \circ M _ { 2 } \circ \cdot \cdot \cdot \circ M _ { k }$ is #P-complete. They also give an algorithm to approximate the DP guarantees of $M$ to desired accuracy $\eta$ which runs in
34
+
35
+ $$
36
+ \tilde { O } \left( \frac { k ^ { 3 } \bar { \varepsilon } ( 1 + \bar { \varepsilon } ) } { \eta } \right)
37
+ $$
38
+
39
+ time where $\textstyle { \bar { \varepsilon } } = ( \sum _ { i = 1 } ^ { k } \varepsilon _ { i } ) / k$ .2 If each $\begin{array} { r } { \varepsilon _ { i } \approx \frac { 1 } { \sqrt { k } } } \end{array}$ (so that $M$ will satisfy reasonable privacy guarantees by advanced composition), then the running time is $\tilde { O } ( k ^ { 2 . 5 } / \eta )$ .
40
+
41
+ In most situations, DP algorithms come with a collection of $( \varepsilon , \delta )$ -DP guarantees, i.e., for each value of $\varepsilon$ , there exists $\delta$ such that the algorithm is $( \varepsilon , \delta )$ -DP.
42
+
43
+ Definition 1.4 (Privacy curve). A DP algorithm $M$ is said to have privacy curve $\delta : \mathbb { R } [ 0 , 1 ] ,$ if for every $\varepsilon \in \mathbb { R }$ , $M$ is $( \varepsilon , \delta ( \varepsilon ) ) \lrcorner D P .$
44
+
45
+ For example the privacy curve of a Gaussian mechanism (with sensitivity 1 and noise scale $\sigma$ ) is given by $\delta ( \varepsilon ) = \Phi \left( - \varepsilon \sigma + 1 / 2 \sigma \right) - e ^ { \varepsilon } \Phi \left( - \varepsilon \sigma - 1 / 2 \sigma \right)$ where $\Phi ( \cdot )$ is the Gaussian CDF [BW18]. Suppose we want to compose several Gaussian mechanisms, which $( \varepsilon , \delta )$ -DP guarantee should we choose for each mechanism? Any choice will lead to suboptimal DP guarantees for the final composition. Instead, we need a way to compose the privacy curves directly. This was suggested through the use of privacy region in [KOV15] and explicitly studied in the $f$ -DP framework of [DRS19]. $f$ -DP is a dual way (and equivalent) to look at the privacy curve $\delta ( \varepsilon )$ .
46
+
47
+ Independently, an algorithm called Privacy Buckets for approximately composing privacy curves using the notion of was initiated in [MM18]. This algorithm depends on the notion of Privacy Loss Random Variable (PRV) [DR16], whose distribution is called Privacy Loss Distribution (PLD). For any DP-algorithm, one can associate a PRV and the privacy curve of that algorithm can be easily obtained from the PRV. The really useful property of PRVs is that under adaptive composition, they just add up; the PRV $Y$ of the composition $M = M _ { 1 } \circ M _ { 2 } \circ \cdots \circ M _ { k }$ is given by $\begin{array} { r } { \bar { Y } = \sum _ { i = 1 } ^ { k } \bar { Y _ { i } } } \end{array}$ where $Y _ { i }$ is the PRV of $M _ { i }$ .3 Therefore, one can find the distribution of $Y$ by the convolution of the distributions of $Y _ { 1 } , Y _ { 2 } , \ldots , Y _ { k }$ . In an important paper, $[ \mathrm { K J H ^ { + } } 2 0 ]$ proposed that one can speed up the convolutions using Fast Fourier Transform (FFT). Explicit error bounds were obtained for the approximation obtained by their algorithm in $[ \mathrm { K J H ^ { + } } 2 0 $ , KJPH21, KH21]. The running time of this algorithm was analyzed in [KH21] where it was shown that the privacy curve $\delta _ { M } ( \varepsilon )$ of $M = M _ { 1 } \circ M _ { 2 } \circ \cdot \cdot \cdot \circ M _ { k }$ can be computed up to an additive error of $\delta _ { \mathrm { e r r o r } }$ in time
48
+
49
+ $$
50
+ \tilde { O } \left( \frac { k ^ { 3 } \bar { \varepsilon } } { \delta _ { \mathrm { e r r o r } } } \right) ,
51
+ $$
52
+
53
+ if each algorithm $M _ { i }$ is satisfies $( \varepsilon _ { i } , 0 )$ -DP and $\begin{array} { r } { \bar { \varepsilon } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \varepsilon _ { i } } \end{array}$ . Assuming that each $\begin{array} { r } { \varepsilon _ { i } \approx \frac { 1 } { \sqrt { k } } } \end{array}$ , we get $\tilde { O } ( k ^ { 2 . 5 } / \delta _ { \mathrm { e r r o r } } )$ running time. Note that this is slightly worse than (1), where the denominator $\eta$ is the multiplicative error in $\delta _ { M }$ . When composing the same algorithm with itself for $k$ times, the running time can be improved to $\begin{array} { r } { \tilde { O } \left( \frac { k ^ { 2 } \bar { \varepsilon } } { \delta _ { \mathrm { e r r o r } } } \right) } \end{array}$ , which is $\begin{array} { r } { \tilde { O } \left( \frac { k ^ { 1 . 5 } } { \delta _ { \mathrm { e r r o r } } } \right) } \end{array}$ when ε¯ = √1k .
54
+
55
+ Moments Accountant and Renyi DP In an influential paper where they introduce Differentially Private Deep Learning, $[ \mathsf { A C G } ^ { + } 1 6 ]$ proposed a method called the Moments Accountant (MA) for giving an upper bound the privacy curve of a composition of DP algorithms. They applied their method to bound the privacy loss of differentially private Stochastic Gradient Descent (DP-SGD) algorithm which they introduced. Analyzing the privacy loss of DP-SGD involves composing the privacy curve of each iteration of training with itself $k$ times, where $k$ is the total of number of training iterations. Typical values of $k$ range from 1000 to 300000 (such as when training large models like GPT3). The Moments Accountant was subsumed into the framework of Renyi Differential Privacy (RDP) introduced by [Mir17]. The running time of these accountants are independent of $k$ , but they only give an upper bound and cannot approximate the privacy curve to arbitrary accuracy.
56
+
57
+ DP-SGD is one of the most important DP algorithms in practice, because one can use it to train neural networks to achieve good privacy-vs-utility tradeoffs. Therefore obtaining accurate and tight privacy guarantees for DP-SGD is important. For example reducing $\varepsilon$ from 2 to 1, can mean that one can train the network for 4 times more epochs while staying within the same privacy budget. Therefore DP-SGD is one of the main motivations for this work.
58
+
59
+ There are also situations when the PRVs do not have bounded moments and so Moments Accountant or Renyi DP cannot be applied for analyzing privacy. An example of such an algorithm is the DP-SGD-JL algorithm of $[ \mathrm { B G K } ^ { + } 2 1 ]$ which uses numerical composition of PRVs to analyze privacy.
60
+
61
+ GDP Accountant [DRS19, BDLS19] introduced the notion of Gaussian Differential Privacy (GDP) and used it to develop an accountant for DP-SGD. The accountant is based on central limit theorem and only gives an approximation to the true privacy curve, where the approximation gets better with $k$ . But as we show in Figure 1, GDP accountant can significantly underreport the true epsilon value.
62
+
63
+ Several different notions of privacy were introduced for obtaining good upper bounds on the privacy curve of composition of DP algorithms such as Concentrated DP (CDP) [DR16, BS16], Truncated CDP [BDRS18] etc. None of these methods can approximate the privacy curve of compositions to arbitrary accuracy. The notion of $f$ -DP introduced by [DRS19], allows for a lossless composition theorem, but computing the privacy curve of composition seems computationally hard and they do not give any algorithms for doing it.
64
+
65
+ # 1.1 Our Contributions
66
+
67
+ The main contribution of this work is a new algorithm with an improved analysis for computing the privacy curve of the composition of a large number of DP algorithms.
68
+
69
+ Theorem 1.5 (Informal version of Theorem 5.5). Suppose $M _ { 1 } , M _ { 2 } , \ldots , M _ { k }$ are $D P$ algorithms. Then the privacy curve $\delta _ { M } ( \varepsilon )$ of adaptive composition $M = M _ { 1 } \circ M _ { 2 } \circ \cdot \cdot \cdot \circ M _ { k }$ can be approximated in time
70
+
71
+ $$
72
+ O \left( \frac { \varepsilon _ { \mathrm { u p p e r } } k ^ { 1 . 5 } \log k \sqrt { \log \frac { 1 } { \delta _ { \mathrm { e r r o r } } } } } { \varepsilon _ { \mathrm { e r r o r } } } \right) ,
73
+ $$
74
+
75
+ where $\varepsilon _ { \mathrm { e r r o r } }$ is the additive error in $\varepsilon$ , $\delta _ { \mathrm { e r r o r } }$ is the additive error in $\delta$ and $\varepsilon _ { \mathrm { u p p e r } }$ is an upper bound on max $\begin{array} { r } { \left\{ \varepsilon _ { M } ( \delta _ { \mathrm { e r r o r } } ) , \mathrm { m a x } _ { i } \varepsilon _ { M _ { i } } \left( \frac { \delta _ { \mathrm { e r r o r } } } { k } \right) \right\} } \end{array}$ . 4
76
+
77
+ If each $M _ { i }$ satisfies $\scriptstyle \left( { \frac { 1 } { \sqrt { k } } } , { \frac { o ( 1 ) } { k } } \right)$ -DP, then by advanced composition (Proposition 1.3), we can set $\varepsilon _ { \mathrm { u p p e r } } = O ( 1 )$ . Therefore the running time of our algorithm in this case is $\tilde { O } \left( \frac { k ^ { 1 . 5 } \sqrt { \log \frac { 1 } { \delta _ { \mathrm { e r r o r } } } } } { \varepsilon _ { \mathrm { e r r o r } } } \right)$ . We can save a factor of $k$ , when we compose the same algorithm with itself $k$ times.
78
+
79
+ Theorem 1.6. Suppose $M$ is a DP algorithm. Then the privacy curve $\delta _ { M ^ { \circ } k } ( \varepsilon )$ of $M$ (adaptively) composed with itself $k$ times can be approximated in time
80
+
81
+ $$
82
+ O \left( \frac { \varepsilon _ { \mathrm { u p p e r } } k ^ { \frac { 1 } { 2 } } \log k \sqrt { \log \frac { 1 } { \delta _ { \mathrm { e r r o r } } } } } { \varepsilon _ { \mathrm { e r r o r } } } \right) ,
83
+ $$
84
+
85
+ where $\varepsilon _ { \mathrm { e r r o r } }$ is the additive error in $\varepsilon$ , $\delta _ { \mathrm { e r r o r } }$ is the additive error in $\delta$ and $\varepsilon _ { \mathrm { u p p e r } }$ is an upper bound on max $\begin{array} { r } { \left\{ \varepsilon _ { M ^ { \circ k } } ( \delta _ { \mathrm { e r r o r } } ) , \varepsilon _ { M } \left( \frac { \delta _ { \mathrm { e r r o r } } } { k } \right) \right\} } \end{array}$ .
86
+
87
+ Thus we improve the state-of-the-art by at least a factor of $k$ in running time. We also note that our algorithm improves the memory required by a factor of $k$ . See Figure 1 for a comparison of our algorithm with that of [KJPH21]. Also note that RDP Accountant (equivalent to the Moments Accountant) significantly overestimates the true $\varepsilon$ , while the GDP Accountant significantly underestimates the true $\varepsilon$ . In contrast, the upper and lower bounds provided by our algorithm lie very close to each other.
88
+
89
+ ![](images/8e9f81b58d5b20927335c64d5bde49592def1d97d29b397a5ab89e225d8706ef.jpg)
90
+
91
+ ![](images/9d2af7302e29615a33af3e6ff3f26516bd66935578ca15397ae42aa3cec7bb70.jpg)
92
+ (b) Our algorithm can improve significantly over the RDP Accountant. We also see that GDP Accountant can significantly underreport the true $\varepsilon$ . We have set $\varepsilon _ { \mathrm { e r r o r } } = 0 . 1$ , $\delta _ { \mathrm { e r r o r } } = { \bar { \delta } } / 1 0 0 0$ here.
93
+
94
+ (a) Our algorithm gives much closer upper and lower bounds on the true privacy curve compared to [KJPH21], under the same mesh size of $4 ~ \times$ $1 0 ^ { - 5 }$ . Our upper and lower bounds are nearly coinciding.
95
+
96
+ Figure 1: Case study on DP-SGD. Sampling probability $p = 1 0 ^ { - 3 }$ , noise scale $\sigma = 0 . 8$ , $\delta = 1 0 ^ { - 7 }$
97
+
98
+ Our Techniques Our algorithm (also the prior work of $\mathrm { [ K J H ^ { + } 2 0 ] }$ ) proceeds by approximating the privacy loss random variables (PRVs) by truncating and discretizing them. We then use Fast Fourier Transform (FFT) to convolve the distributions efficiently. The main difference is in the approximation procedure and the error analysis. In the approximation procedure, we correct the approximation so that the expected value of the discretization matches with the expected value of the PRV.
99
+
100
+ To analyze the approximation error, we introduce the concept of coupling approximation (Definition 5.1), which is a variant of Wasserstein (optimal transport) distance specifically tailored to this application. We first show that the approximation output by our algorithm to each privacy random variable is a good coupling approximation. We then show that when independent coupling approximations are added, cancellation happens between the errors due to Hoeffding bound, producing a much better coupling approximation than one naively expects from the triangle inequality. This allows us to choose the mesh size in our discretization to be $\approx { \frac { 1 } { \sqrt { k } } }$ , whereas [KH21] choose a mesh size of $\approx \frac { 1 } { k }$ . The other improvement is the truncation procedure. We give a tight tail bound of the PRVs (Lemma 5.4). This allows us to choose the domain size for in truncation to be√ $\approx \tilde { O } ( 1 )$ , whereas [KH21] choose $\approx \tilde { O } ( \sqrt { k } )$ . Both ideas together saves a factor of $k$ in the run time and memory.
101
+
102
+ For the analysis, the previous paper analyzes the discretization error by studying the stability of convolution. This leads to complicated calculations with the runtime linear in $1 / \bar { \delta } _ { \mathrm { e r r o r } } \bar { }$ (see (2)). Since $\delta _ { \mathrm { e r r o r } } \ll \delta \ll 1 / N$ is required to give meaningful privacy guarantee $N$ is the number of users), this term $1 / \delta _ { \mathrm { e r r o r } }$ is huge. In this paper, we show various facts about how coupling approximation accumulates and use them to give a runtime depending only on $\sqrt { \log ( 1 / \delta _ { \mathrm { e r r o r } } ) }$ .
103
+
104
+ # 2 DP Preliminaries
105
+
106
+ Given a DP algorithm $\mathcal { M }$ , for each value of $\varepsilon \geq 0$ , there exists some $\delta \in [ 0 , 1 ]$ such that $\mathcal { M }$ is $( \varepsilon , \delta )$ -DP. We can represent all these privacy guarantees by a function $\delta _ { \mathcal { M } } ( \varepsilon ) : \mathbb { R } ^ { \geq 0 } [ 0 , 1 ]$ and say that $\delta _ { \mathcal { M } } ( \cdot )$ is the privacy curve of $\mathcal { M }$ . This inspires the following definition of a privacy curve between two random variables.
107
+
108
+ Definition 2.1 (Privacy curve). Given two random variables $X , Y$ supported on some set $\Omega$ , define $\delta ( X \vert \vert Y ) : \mathbb { R } \to [ 0 , 1 ]$ as:
109
+
110
+ $$
111
+ \delta ( X | | Y ) ( \varepsilon ) = \operatorname* { s u p } _ { S \subset \Omega } \operatorname* { P r } [ Y \in S ] - e ^ { \varepsilon } \operatorname* { P r } [ X \in S ] .
112
+ $$
113
+
114
+ Therefore an algorithm $\mathcal { M }$ is $( \varepsilon , \delta )$ -DP iff $\delta \left( \mathcal { M } ( D ) \vert \vert \mathcal { M } ( D ^ { \prime } ) \right) ( \varepsilon ) \leq \delta$ for all neighboring databases $D , D ^ { \prime }$ .
115
+
116
+ Remark 2.2. Note that not all functions $\delta : \mathbb { R } [ 0 , 1 ]$ are privacy curves. A characterization of privacy curves can be obtained using the $f$ -DP framework of [DRS19]. The notion of privacy curve $\delta ( X \vert \vert Y )$ and tradeoff function $T ( X \vert \vert Y )$ are dual to each other via convex duality [DRS19]. This implies a characterization of privacy curves as shown in [ZDW21].
117
+
118
+ Definition 2.3 (Composition of privacy curves [DRS19]). Let $\delta _ { 1 } \equiv \delta ( X _ { 1 } | | Y _ { 1 } )$ and $\delta _ { 2 } \equiv \delta ( X _ { 2 } | | Y _ { 2 } )$ be any two privacy curves. The composition of the privacy curves, denoted by $\delta _ { 1 } \otimes \delta _ { 2 }$ , is defined as
119
+
120
+ $$
121
+ \delta _ { 1 } \otimes \delta _ { 2 } \equiv \delta \left( ( X _ { 1 } , X _ { 2 } ) | | ( Y _ { 1 } , Y _ { 2 } ) \right)
122
+ $$
123
+
124
+ where $X _ { 1 } , X _ { 2 }$ are independently sampled and $Y _ { 1 } , Y _ { 2 }$ are independently sampled.
125
+
126
+ Note that there can be many pairs of random variables which have the same privacy curve, but the above operation is well-defined. If $\delta ( X _ { 1 } | | Y _ { 1 } ) \equiv \delta ( X _ { 1 } ^ { \prime } | | Y _ { 1 } ^ { \prime } )$ and $\delta ( X _ { 2 } | | Y _ { 2 } ) \equiv \delta ( X _ { 2 } ^ { \prime } | | Y _ { 2 } ^ { \prime } )$ , then it was shown by [DRS19] that
127
+
128
+ $$
129
+ \delta \left( ( X _ { 1 } , X _ { 2 } ) | | ( Y _ { 1 } , Y _ { 2 } ) \right) = \delta \left( ( X _ { 1 } ^ { \prime } , X _ { 2 } ^ { \prime } ) | | ( Y _ { 1 } ^ { \prime } , Y _ { 2 } ^ { \prime } ) \right) .
130
+ $$
131
+
132
+ [DRS19] also show that $\otimes$ is a commutative and associative operation.
133
+
134
+ Given two DP algorithms $M _ { 1 }$ and $M _ { 2 }$ , the adaptive composition $( M _ { 2 } \circ M _ { 1 } ) ( D )$ is an algorithm which outputs $( M _ { 1 } ( D ) , M _ { 2 } ( D , M _ { 1 } ( D ) )$ , i.e., $M _ { 2 }$ can look at the database $D$ and also the output of the previous algorithm $M _ { 1 } ( D )$ . Adaptive composition of more than two algorithms is similarly defined. Suppose $M _ { 1 }$ has privacy curve $\delta _ { 1 }$ and $M _ { 2 }$ has privacy curve $\delta _ { 2 }$ (i.e., $M _ { 2 } ( \cdot , y )$ is a $\mathrm { D P }$ algorithm with privacy curve $\delta _ { 2 }$ for any fixed $y$ .). The following composition theorem shows how to get the privacy curve of $M _ { 2 } \circ M _ { 1 }$ .
135
+
136
+ Theorem 2.4 (Composition theorem [DRS19]). Let $M _ { 1 } , M _ { 2 } , \ldots , M _ { k }$ be DP algorithms with privacy curves given by $\delta _ { 1 } , \delta _ { 2 } , \dots , \delta _ { k }$ respectively. The privacy curve of the adaptive composition $M _ { k } \circ$ $M _ { k - 1 } \circ \cdots \circ M _ { 1 }$ is given by $\delta _ { 1 } \otimes \delta _ { 2 } \otimes \cdot \cdot \cdot \otimes \delta _ { k }$ .
137
+
138
+ # 3 Privacy loss random variables
139
+
140
+ The notion of privacy loss random variables (PRVs) is a unique way to assign a pair $( X , Y )$ for any privacy curve $\delta$ such that $\delta \equiv \delta ( X | | Y )$ . PRVs allow us to compute composition of two algorithms via summing random variables (Theorem 3.5) (equivalently, convolving their distributions). Thus PRVs can be thought of as a reparametrization of privacy curves where composition becomes convolution. In this paper, we differ from the usual definition of PRVs given in [DR16, $\mathrm { K J H } ^ { + } 2 0 ]$ , which are tied to a specific algorithm. Instead we think of them as a reparametrization of privacy curves and study them directly. This allows us to succinctly prove many useful properties of PRVs.
141
+
142
+ Let ${ \overline { { \mathbb { R } } } } = \mathbb { R } \cup \{ - \infty , \infty \}$ be the extended real line where we define $\infty + x = \infty$ and $- \infty + x = - \infty$ for $x \in \mathbb { R }$ .
143
+
144
+ Definition 3.1 (Privacy loss random variables (PRVs)). Given a privacy curve $\delta : \mathbb { R } [ 0 , 1 ]$ , we say that $( X , Y )$ are privacy loss random variables for $\delta$ , if they satisfy the following conditions:
145
+
146
+ • $X , Y$ are supported on ${ \overline { { \mathbb { R } } } } ,$ , • $\delta ( X | | Y ) \equiv \delta$ , • $Y ( t ) = e ^ { t } X ( t )$ for every $t \in \mathbb { R }$ and • $Y ( - \infty ) = 0 a n d X ( \infty ) = 0$
147
+
148
+ where $X ( t ) , Y ( t )$ are probability density functions of $X , Y$ respectively.
149
+
150
+ Mathematically, the correct way to write the condition $Y ( t ) = e ^ { t } X ( t )$ is to say that $\mathbb { E } _ { Y } [ \phi ( Y ) ] =$ $\mathbb { E } _ { X } [ \phi ( X ) e ^ { X } ]$ for all test functions $\phi : \overline { { \mathbb { R } } } [ 0 , 1 ]$ with $\phi ( \infty ) = \phi ( - \infty ) = 0$ . This will generalize to all situations where $X , Y$ are continuous or discrete or both. For ease of exposition, we ignore this complication and assume that $X ( t ) , Y ( t )$ represent the PDFs if $X , Y$ are continuous at $t$ , or the probability masses if they have point masses at $t$ .
151
+
152
+ The following theorem shows that the PRVs for a privacy curve $\delta = \delta ( P | | Q )$ are given by the log-likelihood random variables of $P , Q$ .
153
+
154
+ Theorem 3.2. Let $\delta : \mathbb { R } [ 0 , 1 ]$ be a privacy curve given by $\delta \equiv \delta ( P | | Q )$ where $P , Q$ are two random variables supported on $\Omega$ . The PRVs $( X , Y )$ for the privacy curve $\delta$ are given $b y ^ { 5 }$ :
155
+
156
+ $$
157
+ \begin{array} { r } { X = \log \left( \frac { Q ( \omega ) } { P ( \omega ) } \right) ~ w h e r e ~ \omega \sim P , } \\ { Y = \log \left( \frac { Q ( \omega ) } { P ( \omega ) } \right) ~ w h e r e ~ \omega \sim Q . } \end{array}
158
+ $$
159
+
160
+ The following theorem provides a formula for computing the privacy curve $\delta$ in terms of the PRVs and conversely a formula for PRVs in terms of the privacy curve. A similar statement appears in [SMM19, $\mathrm { K J H } ^ { + } 2 0 ]$ ].
161
+
162
+ Theorem 3.3. The privacy curve $\delta$ can be expressed in terms of PRVs $( X , Y )$ as:
163
+
164
+ $$
165
+ \delta ( \varepsilon ) = \operatorname* { P r } [ Y > \varepsilon ] - e ^ { \varepsilon } \operatorname* { P r } [ X > \varepsilon ] = \mathbb { E } _ { Y } [ ( 1 - e ^ { \varepsilon - Y } ) _ { + } ] = \operatorname* { P r } [ Y \geq \varepsilon + Z ] .
166
+ $$
167
+
168
+ where $Z$ is an exponential random variable.6 Conversely, given a privacy curve $\delta : \mathbb { R } [ 0 , 1 ]$ , we can compute the PDFs of its $P R V s$ $( X , Y )$ as:
169
+
170
+ $$
171
+ Y ( t ) = \delta ^ { \prime \prime } ( t ) - \delta ^ { \prime } ( t ) a n d X ( t ) = e ^ { t } ( \delta ^ { \prime \prime } ( t ) - \delta ^ { \prime } ( t ) ) .
172
+ $$
173
+
174
+ Remark 3.4. Theorem 3.3 shows that the PRVs $X , Y$ do not depend on the particular $P , Q$ used to represent the privacy curve $\delta$ in Theorem 3.2. So we should think of the PDF of of the $P R V Y$ $( o r X )$ as an equivalent reparametrization of the privacy curve $\delta : \mathbb { R } [ 0 , 1 ]$ , just as the notion of $f$ -DP [DRS19] is a reparametrization of the privacy curve $\delta$ .
175
+
176
+ PRVs are useful in computing privacy curves because the composition of two privacy curves can be computed by adding the corresponding pairs of PRVs. A similar statement appears in [DR16].
177
+
178
+ Theorem 3.5. Let $\delta _ { 1 } , \delta _ { 2 }$ be two privacy curves with PRVs $( X _ { 1 } , Y _ { 1 } )$ and $( X _ { 2 } , Y _ { 2 } )$ respectively. Then the PRVs for $\delta _ { 1 } \otimes \delta _ { 2 } = \delta ( X _ { 1 } , X _ { 2 } | | Y _ { 1 } , Y _ { 2 } )$ are given by $\left( X _ { 1 } + X _ { 2 } , Y _ { 1 } + Y _ { 2 } \right)$ . In particular,
179
+
180
+ $$
181
+ \delta _ { 1 } \otimes \delta _ { 2 } = \delta ( X _ { 1 } + X _ { 2 } | | Y _ { 1 } + Y _ { 2 } ) .
182
+ $$
183
+
184
+ Proof. Let $( X , Y )$ be the privacy random variables for $\delta ( X _ { 1 } , X _ { 2 } | | Y _ { 1 } , Y _ { 2 } )$ . By Theorem 3.2,
185
+
186
+ $$
187
+ \begin{array} { r l } & { X = \log \left( \frac { ( Y _ { 1 } , Y _ { 2 } ) ( t _ { 1 } , t _ { 2 } ) } { ( X _ { 1 } , X _ { 2 } ) ( t _ { 1 } , t _ { 2 } ) } \right) \mathrm { ~ w h e r e ~ } ( t _ { 1 } , t _ { 2 } ) \sim ( X _ { 1 } , X _ { 2 } ) } \\ & { \quad = \log \left( \frac { Y _ { 1 } ( t _ { 1 } ) Y _ { 2 } ( t _ { 2 } ) } { X _ { 1 } ( t _ { 1 } ) \cdot X _ { 2 } ( t _ { 2 } ) } \right) \mathrm { ~ w h e r e ~ } t _ { 1 } \sim X _ { 1 } , t _ { 2 } \sim X _ { 2 } } \\ & { \qquad \mathrm { ( B y ~ i n d e p e n d e n c e ~ o f ~ } X _ { 1 } , X _ { 2 } \mathrm { ~ a n d ~ i n d p e n d } } \\ & { \quad = \log \left( e ^ { t _ { 1 } } \cdot e ^ { t _ { 2 } } \right) \mathrm { ~ w h e r e ~ } t _ { 1 } \sim X _ { 1 } , t _ { 2 } \sim X _ { 2 } } \\ & { \quad = t _ { 1 } + t _ { 2 } \mathrm { ~ w h e r e ~ } t _ { 1 } \sim X _ { 1 } , t _ { 2 } \sim X _ { 2 } } \\ & { \quad = X _ { 1 } + X _ { 2 } . } \end{array}
188
+ $$
189
+
190
+ Similarly,
191
+
192
+ $$
193
+ { \begin{array} { r l } & { Y = \log \left( { \frac { ( Y _ { 1 } , Y _ { 2 } ) ( t _ { 1 } , t _ { 2 } ) } { ( X _ { 1 } , X _ { 2 } ) ( t _ { 1 } , t _ { 2 } ) } } \right) { \mathrm { ~ w h e r e ~ } } ( t _ { 1 } , t _ { 2 } ) \sim ( Y _ { 1 } , Y _ { 2 } ) } \\ & { \quad = t _ { 1 } + t _ { 2 } { \mathrm { ~ w h e r e ~ } } t _ { 1 } \sim Y _ { 1 } , t _ { 2 } \sim Y _ { 2 } } \\ & { \quad = Y _ { 1 } + Y _ { 2 } . } \end{array} }
194
+ $$
195
+
196
+ In the supplementary material, we provide a proof of Theorems 3.2 and 3.3. We also discuss how to compute the PRVs for a subsampled mechanism given the PRVs for the original mechanism and give examples of PRVs for few standard mechanisms. These are used in our experiments to calculate the PRVs for DP-SGD.
197
+
198
+ # 4 Numerical composition of privacy curves
199
+
200
+ In this section, we present an efficient and numerically accurate method, ComposePRV (Algorithm 1), for composing privacy guarantees by utilizing the notion of PRVs.
201
+
202
+ Input: CDFs of PRVs $Y _ { 1 } , Y _ { 2 } , \ldots , Y _ { k }$ , mesh size $h$ , Truncation parameter $\textstyle L \in { \frac { h } { 2 } } + h \mathbb { Z } ^ { > 0 }$
203
+ Output: PDF of an approximation $\widetilde { Y }$ for $\begin{array} { r } { Y = \sum _ { i = 1 } ^ { k } Y _ { i } } \end{array}$ . $\widetilde { Y }$ will be supported on $\mu + ( h \mathbb { Z } \cap [ - L , L ] )$ for some $\mu \in [ 0 , \frac { h } { 2 } ]$ .
204
+ for $\ell = 1$ to $k$ do $\begin{array} { r l } { \big | } & { { } \widetilde { Y } _ { i } \gets \mathsf { D i s c r e t i z e P R V } ( Y _ { i } , L , h ) ; } \end{array}$
205
+ end
206
+ Compute PDF Of $\widetilde { Y } = \widetilde { Y } _ { 1 } \oplus _ { L } \widetilde { Y } _ { 2 } \oplus _ { L } \cdot \cdot \cdot \oplus _ { L } \widetilde { Y } _ { k }$ by convolving PDFs of $\widetilde { Y } _ { 1 } , \widetilde { Y } _ { 2 } , \ldots , \widetilde { Y } _ { k }$ using FFT;
207
+ Compu $\mathbf { \varepsilon } \mathbf { e } \delta _ { \widetilde { Y } } ( \varepsilon ) = \mathbb { E } _ { \widetilde { Y } } \left[ \left( 1 - e ^ { \varepsilon - \widetilde { Y } } \right) _ { + } \right] \mathrm { f o r } \mathrm { a l l } \varepsilon \in [ 0 , L ] ;$
208
+ Return Y , δ e Y (·)
209
+
210
+ In the algorithm ComposePRV, we compute the circular convolution $\oplus _ { L }$ using Fast Fourier Transform (FFT). Fix some $L > 0$ . For $x \in \mathbb { R }$ , we define $x$ $( { \bmod { 2 } } L ) = x - 2 L n$ where $n \in \mathbb { Z }$ is chosen such that $x - 2 L n \in ( - L , L ]$ . Given $x , y$ , we define the circular addition $x \oplus _ { L } y = x + y$ (mod $2 L$ ). When we use FFT to compute the convolution of two discrete distributions $Y _ { 1 } , Y _ { 2 }$ supported on $h \mathbb { Z } \cap [ - L , L ]$ , we are implicitly calculating the the distribution of $Y _ { 1 } \oplus _ { L } Y _ { 2 }$ . We will later show that $\widetilde { Y } _ { 1 } \oplus _ { L } \widetilde { Y } _ { 2 } \oplus _ { L } \cdot \cdot \cdot \oplus _ { L } \widetilde { Y } _ { k }$ is a good approximation of $Y _ { 1 } + Y _ { 2 } + \cdots + Y _ { k }$ .
211
+
212
+ The subroutine DiscretizePRV (Algorithm 2) is used to truncate and discretize PRVs. In this subroutine, we shift the discretized random variables such that it has the same mean as the original variables. This is one of main differences between our algorithm and the algorithm in [KJPH21, KH21]. We show that this significantly decreases the discretization error and allow us to use much coarser mesh $h \approx 1 / \sqrt { k }$ instead of $h \approx 1 / k$ .
213
+
214
+ Input: $\mathrm { C D F } _ { Y } ( \cdot )$ of a PRV $Y$ , mesh size $h$ , Truncation parameter $\textstyle L \in { \frac { h } { 2 } } + h \mathbb { Z } ^ { > 0 }$
215
+ Output: PDF of an approximation $\widetilde { Y }$ supported on $\mu + ( h \mathbb { Z } \cap [ - L , L ] )$ for some $\mu \in [ 0 , \frac { h } { 2 } ]$ . $n { \frac { L - { \frac { h } { 2 } } } { h } }$
216
+ for $i = - n$ to $n$ do
217
+ $| \quad q _ { i } \gets \mathrm { C D F } _ { Y } ( i h + h / 2 ) - \mathrm { C D F } _ { Y } ( i h - h / 2 ) ;$
218
+ end
219
+ $q q / ( \sum _ { i = - n } ^ { n } q _ { i } )$ ; // Normalize $q$ to make it a probability distribution $Y ^ { L } \gets Y | _ { | Y | \leq L }$ (i.e., $Y$ conditioned on $| Y | \leq L )$ ;
220
+ $\begin{array} { r l } & { \mu \mathbb { E } [ Y ^ { \dot { L } } ] \stackrel { - } { - } \textstyle \sum _ { i = - n } ^ { n } i h \cdot q _ { i } ; } \\ & { \widetilde { Y } \{ i h + \mu \quad \mathrm { ~ w . p . ~ } q _ { i } \mathrm { ~ f o r ~ } - n \leq i \leq n ; } \end{array}$
221
+ Return $\widetilde { Y }$ ;
222
+
223
+ For simplicity, throughout this paper, we will assume that the PRVs $Y _ { 1 } , Y _ { 2 } , \ldots , Y _ { k }$ do not have any mass at $\infty$ . This is with out loss of generality. Suppose $\mathrm { P r } [ Y _ { i } = \infty ] = \delta _ { i }$ for each $i$ . Let $Y _ { i } ^ { \prime } = Y _ { i } | _ { Y _ { i } \neq \infty }$ . Then
224
+
225
+ $$
226
+ \begin{array} { r } { Y _ { 1 } + Y _ { 2 } + \cdots + Y _ { k } = \left\{ \begin{array} { l l } { Y _ { 1 } ^ { \prime } + Y _ { 2 } ^ { \prime } + \cdots + Y _ { k } ^ { \prime } } & { \mathrm { w . p . ~ } ( 1 - \delta _ { 1 } ) ( 1 - \delta _ { 2 } ) \cdots ( 1 - \delta _ { k } ) } \\ { \infty } & { \mathrm { w . p . ~ } 1 - ( 1 - \delta _ { 1 } ) ( 1 - \delta _ { 2 } ) \cdots ( 1 - \delta _ { k } ) . } \end{array} \right. } \end{array}
227
+ $$
228
+
229
+ Therefore we can use Algorithm 1 to approximate the distribution of $Y _ { 1 } ^ { \prime } + Y _ { 2 } ^ { \prime } + \cdots + Y _ { k } ^ { \prime }$ , and use it to approximate the distribution of $Y _ { 1 } + Y _ { 2 } + \cdots + Y _ { k }$ .
230
+
231
+ # 5 Error analysis
232
+
233
+ To analyze the discretization error, we introduce the notion of coupling approximation, a variant of Wasserstein distance. Intuitively, a good coupling approximation is a coupling where the two random variables are close to each other with high probability.
234
+
235
+ Definition 5.1 (coupling approximation). Given two random variables $Y _ { 1 } , Y _ { 2 }$ , we write $| Y _ { 1 } - Y _ { 2 } | \leq _ { \eta }$ h if there exists a coupling between $Y _ { 1 } , Y _ { 2 }$ such that $\operatorname* { P r } [ | Y _ { 1 } - Y _ { 2 } | > h ] \leq \eta$ .
236
+
237
+ The following lemma shows that if we have a good coupling approximation $\widetilde { Y }$ to a PRV $Y$ , then the privacy curves $\delta _ { Y } ( \varepsilon )$ and $\delta _ { \widetilde { Y } } ( \varepsilon )$ should be close.
238
+
239
+ Lemma 5.2. If $Y$ and $\widetilde { Y }$ are two random variables such that $| Y - { \widetilde { Y } } | \leq _ { \eta } h ,$ , then for every $\varepsilon \in \mathbb { R } ,$
240
+
241
+ $$
242
+ \delta _ { \widetilde { Y } } ( \varepsilon + h ) - \eta \leq \delta _ { Y } ( \varepsilon ) \leq \delta _ { \widetilde { Y } } ( \varepsilon - h ) + \eta .
243
+ $$
244
+
245
+ Proof. By Theorem 3.2, $\delta _ { Y } ( \varepsilon ) = \operatorname* { P r } [ Y \geq \varepsilon + Z ]$ and hence
246
+
247
+ $$
248
+ \begin{array} { r l } & { \delta _ { Y } ( \varepsilon ) = \operatorname* { P r } [ Y - \widetilde { Y } + \widetilde { Y } \geq \varepsilon + Z ] } \\ & { \qquad \leq \operatorname* { P r } [ Y - \widetilde { Y } \geq h ] + \operatorname* { P r } [ \widetilde { Y } \geq \varepsilon - h + Z ] } \\ & { \qquad \leq \eta + \delta _ { \widetilde { Y } } ( \varepsilon - h ) . } \end{array}
249
+ $$
250
+
251
+ Similarly, we have $\delta _ { \widetilde { Y } } ( \varepsilon ) \leq \eta + \delta _ { Y } ( \varepsilon - h )$ for all $\varepsilon \in \mathbb { R }$
252
+
253
+ Therefore the goal of our analysis is to show that the ComposePRV algorithm finds a good coupling approximation $\widetilde { Y }$ to $Y = { \dot { \sum _ { i = 1 } ^ { k } } } Y _ { i }$ . We first show that the DiscretizePRV algorithm computes a good coupling approximation to the PRVs and crucially, it preserves the expected value after truncation. Lemma D.5 shows that $| \widetilde { Y } - Y ^ { L } | \le _ { 0 } h$ where $\widetilde { Y }$ is the approximation of a PRV $Y$ output by Algorithm 2 and $Y ^ { L }$ is the truncation of $Y$ to $[ - L , L ]$ .
254
+
255
+ We then use the following key lemma which shows that when we add independent coupling approximations (where expected values match), we get a much better coupling approximation than what the triangle inequality predicts.
256
+
257
+ Lemma 5.3. Suppose $Y _ { 1 } , Y _ { 2 } , \ldots , Y _ { k }$ and $\widetilde { Y } _ { 1 } , \widetilde { Y } _ { 2 } , \ldots , \widetilde { Y } _ { k }$ are two collections of independent random variables such that $| Y _ { i } - \widetilde { Y } _ { i } | \le _ { 0 } h$ and $\mathbb { E } [ Y _ { i } ] = \mathbb { E } [ \widetilde { Y } _ { i } ]$ for all $i$ , then
258
+
259
+ $$
260
+ \left| \sum _ { i = 1 } ^ { k } Y _ { i } - \sum _ { i = 1 } ^ { k } { \widetilde { Y } } _ { i } \right| \leq _ { \eta } h { \sqrt { 2 k \log { \frac { 2 } { \eta } } } } .
261
+ $$
262
+
263
+ Proof. Let $X _ { i } = Y _ { i } - \widetilde { Y } _ { i }$ where $( Y _ { i } , \widetilde { Y _ { i } } )$ are coupled such that $| Y _ { i } { - } \widetilde { Y } _ { i } | \leq h$ w.p. 1. Then $X _ { i } \in [ - h , h ]$ w.p. 1. Note that $X _ { 1 } , X _ { 2 } , \ldots , X _ { k }$ are independent of each other. By Hoeffding’s inequality,
264
+
265
+ $$
266
+ \operatorname* { P r } \left[ \left| \sum _ { i } X _ { i } \right| \geq t \right] \leq 2 \exp \left( - { \frac { 2 t ^ { 2 } } { k ( 2 h ) ^ { 2 } } } \right) = \eta
267
+ $$
268
+
269
+ if we set $t = h \sqrt { 2 k \log \frac { 2 } { \eta } }$
270
+
271
+ This lemma shows that the error of $k$ times composition is around $\sqrt { k } \cdot h$ and hence setting $h \approx 1 / \sqrt { k }$ gives small enough error. Next, we bound the domain size $L$ . Naively, the domain size $L$ should be of the order of $\sqrt { k }$ because $Y$ is the sum of $k$ independent random variables with each bounded by a constant. In the supplementary material, we prove a tighter tail bound of $Y$ .
272
+
273
+ Lemma 5.4. Let $( X , Y )$ be the privacy random variables for a $( \varepsilon , \delta )$ -DP algorithm, then for any $t \geq 0$ , we have
274
+
275
+ $$
276
+ \operatorname* { P r } [ | Y | \geq \varepsilon + t ] \leq { \frac { \delta \left( 1 + e ^ { - \varepsilon - t } \right) } { 1 - e ^ { - t } } } .
277
+ $$
278
+
279
+ This shows that $\begin{array} { r } { \operatorname* { P r } [ | Y | \ge \varepsilon + 2 ] \le \frac { 4 } { 3 } \delta } \end{array}$ and hence truncating the domain with $L = 2 + \varepsilon$ only introduces an additive $\delta$ error in the privacy curve. Therefore, if the composition satisfies a good privacy guarantee (namely $\varepsilon = O ( 1 )$ for small enough $\delta$ ), we can truncate the domain at $L = \Theta ( 1 )$ . Together with the fact that mesh size is $1 / \sqrt { k }$ , this gives a $O ( { \sqrt { k } } )$ -time algorithm for computing the privacy curve when we compose the same mechanism with itself $k$ times. The following theorem gives a formal statement of the error bounds of our algorithm, it is proved in the supplementary material.
280
+
281
+ Theorem 5.5. Let $\varepsilon _ { \mathrm { e r r o r } }$ , $\delta _ { \mathrm { { e r r o r } } } > 0$ be some fixed error terms. Let $\mathcal { M } _ { 1 } , \mathcal { M } _ { 2 } , \ldots , \mathcal { M } _ { k }$ be $D P$ algorithms with privacy curves $\delta _ { { \cal M } _ { i } } ( \varepsilon )$ . Let $Y _ { i }$ be the PRV corresponding to $\mathcal { M } _ { i }$ such that $\delta _ { { \cal M } _ { i } } ( \varepsilon ) =$ $\delta _ { Y _ { i } } ( \varepsilon )$ for $\varepsilon \geq 0$ . Let $\mathcal { M }$ be the (adaptive) composition of $\mathcal { M } _ { 1 } , \mathcal { M } _ { 2 } , \ldots , \mathcal { M } _ { k }$ and let $\delta _ { \mathcal { M } } ( \varepsilon )$ be its privacy curve. Set $L \ge 2 + \varepsilon _ { \mathrm { e r r o r } }$ sufficiently large such that
282
+
283
+ $$
284
+ \sum _ { i = 1 } ^ { k } \delta _ { \mathcal { M } _ { i } } ( L - 2 ) \leq \frac { \delta _ { \mathrm { e r r o r } } } { 8 } a n d \delta _ { \mathcal { M } } ( L - 2 - \varepsilon _ { \mathrm { e r r o r } } ) \leq \frac { \delta _ { \mathrm { e r r o r } } } { 4 } .
285
+ $$
286
+
287
+ Let $\widetilde { Y }$ be the approximation of $\textstyle Y = \sum _ { i = 1 } ^ { k } Y _ { i }$ produced by ComposePRV algorithm with mesh size
288
+
289
+ $$
290
+ h = { \frac { \varepsilon _ { \mathrm { e r r o r } } } { \sqrt { { \frac { k } { 2 } } \log { \frac { 1 2 } { \delta _ { \mathrm { e r r o r } } } } } } } .
291
+ $$
292
+
293
+ Then
294
+
295
+ $$
296
+ \delta _ { \widetilde { Y } } ( \varepsilon + \varepsilon _ { \mathrm { e r r o r } } ) - \delta _ { \mathrm { e r r o r } } \leq \delta _ { Y } ( \varepsilon ) = \delta _ { \mathcal { M } } ( \varepsilon ) \leq \delta _ { \widetilde { Y } } ( \varepsilon - \varepsilon _ { \mathrm { e r r o r } } ) + \delta _ { \mathrm { e r r o r } } .
297
+ $$
298
+
299
+ Furthermore, our algorithm takes $O \left( b { \frac { L } { h } } \log \left( { \frac { L } { h } } \right) \right)$ time where $b$ is the number of distinct algorithms among $\mathcal { M } _ { 1 } , \mathcal { M } _ { 2 } , \ldots , \mathcal { M } _ { k }$ .
300
+
301
+ Remark 5.6. A simple way to set $L$ such that the condition (7) holds is by choosing an $L$ such that:
302
+
303
+ $$
304
+ L \geq 2 + \operatorname* { m a x } \left\{ \varepsilon _ { \mathrm { e r r o r } } + \varepsilon _ { \mathcal { M } } \left( \frac { \delta _ { \mathrm { e r r o r } } } { 4 } \right) , \operatorname* { m a x } _ { i \in [ k ] } \varepsilon _ { \mathcal { M } _ { i } } \left( \frac { \delta _ { \mathrm { e r r o r } } } { 8 k } \right) \right\}
305
+ $$
306
+
307
+ where $\varepsilon _ { \mathcal { A } } ( \delta )$ is the inverse of $\delta _ { \mathcal { A } } ( \varepsilon )$ . To set the value of $L$ , we do not need the exact value of $\varepsilon _ { \mathcal { M } }$ $( o r \varepsilon _ { \mathcal { M } _ { i } } ,$ ). We only need an upper bound on $\varepsilon _ { \mathcal { M } }$ , which can often by obtained by using the $R D P$ Accountant or any other method to derive upper bounds on privacy.
308
+
309
+ # 6 Experiments
310
+
311
+ We demonstrate the utility of our composition method by computing the privacy curves for the DP-SGD algorithm, which is one of the most important algorithms in differential privacy.
312
+
313
+ The DP-SGD algorithm $[ \mathsf { A C G } ^ { + } 1 6 ]$ is a variant of stochastic gradient descent with $k$ steps. In each step, the algorithm selects a $p$ fraction of training examples uniformly at random. The algorithm adds a Gaussian vector with variance $\propto \sigma ^ { 2 }$ to the clipped gradient of the selected batch. Then it performs a gradient step (or any other iterative methods) using the noisy gradient computed. The privacy loss of DP-SGD involves composing the privacy curve of each iteration with itself $k$ times. The PRVs for each iteration have a closed form and depend only $p , \sigma$ (see supplementary material). Our algorithms use this closed form of PRVs.
314
+
315
+ ![](images/dd651af1c46cfcf948587466619d538bd872fe0785ba6d83d42653f689a3929f.jpg)
316
+ Figure 2: Setting $p = 1$ and comparing to the analytical solution (10).
317
+
318
+ See Figure 1(b) for the comparison between our algorithm and the GDP and RDP Accountant. Our method provides a lower and upper bound of the privacy curve according to (8). In Figure 1(a), we compare our algorithm with [KJPH21] (implemented in [KP21]). Under the same mesh size, our algorithm computes a much closer upper and lower bound.
319
+
320
+ We validate our program for the case $p = 1$ . When $p = 1$ , we have an exact formula for
321
+
322
+ $$
323
+ \delta ( \varepsilon ) = \Phi \left( - { \frac { \varepsilon } { \mu } } + { \frac { \mu } { 2 } } \right) - e ^ { \varepsilon } \Phi \left( - { \frac { \varepsilon } { \mu } } - { \frac { \mu } { 2 } } \right)
324
+ $$
325
+
326
+ where the bo $\textstyle \mu = { \frac { \sqrt { k } } { \sigma } }$ . In Figure 2, we show that the true privacy curve is indeed sandwicompute and that the vertical distance between our bounds is indeed etweenwith a $2 \varepsilon _ { \mathrm { e r r o r } }$ neglible δerror of 10−10.
327
+
328
+ Floating point errors Note that our error analysis in Section 5 ignores floating point errors. This is because they are negligible compared to the discretization and truncation errors we analyzed in Section 5 for the range of $\delta$ we are interested in. See supplementary material for more details.
329
+
330
+ # 6.1 Comparison with [KJPH21]
331
+
332
+ ![](images/ca0b62a1d9d64fe917e548bfcb7e7c09e98d280fde0ba10ba8c592a3576fb941.jpg)
333
+ Figure 3: (a) Comparison of error bounds of $\delta$ with varying number of discretisation points for $p = 4 \times 1 0 ^ { - 3 } , \sigma = 0 . 8 , \varepsilon = 1 . 5 , k = 1 0 0 0$ . (b) Comparing runtimes for our algorithm with that of [KJPH21] when aligned on accuracy for $\sigma = 0 . 8$ , $p = \dot { 4 } \times \dot { 1 } 0 ^ { - 3 }$ . We can see a significant reduction in runtime in particular for large number of DPSGD steps. We were not able to run the algorithm of [KJPH21] beyond 2,000 steps, since it becomes unstable beyond that point.7. We also plot the speed up directly on the secondary $y$ -axis.
334
+
335
+ In this section, we provide more results demonstrating the practical use of our algorithm. We compare runtimes of our algorithm with [KJPH21], which is the state-of-the-art, for typical values of privacy parameters $\mathit { \check { \sigma } } = 0 . 8$ , $p = 4 \times 1 0 ^ { - 3 }$ , $\varepsilon = 1 . 5$ ). See Figure 3(a) for the effect of the number of discretisation points $n$ on the accuracy of $\delta$ . Our algorithm requires about a few orders of magnitude smaller number of discretization points to converge compared to the algorithm of [KJPH21].
336
+
337
+ In order to compare runtimes, we align the accuracy of both FFT algorithms. We set numerical parameters (number of discretization bins and domain length) such that both algorithms give similarly accurate bounds and verify it visually. Figure 3(b) shows a significant speedup (100x) using our algorithms. We note that runtimes are directly proportional to the memory required by the algorithms and so a separate memory analysis is not required; the runtime and memory are dominated by the number of points in the discretization of PRV. All experiments are performed on a Intel Xeon W-2155 CPU with 3.30GHz with 128GB of memory.
338
+
339
+ # Acknowledgments and Disclosure of Funding
340
+
341
+ We would like to thank Janardhan Kulkarni and Sergey Yekhanin for several useful discussions and encouraging us to work on this problem. L.W. would like to thank Daniel Jones and Victor Rühle for fruitful discussions and helpful guidance.
342
+
343
+ References
344
+ $[ \mathrm { A C G ^ { + } } 1 6 ]$ 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, pages 308–318, 2016.
345
+ [BDLS19] Zhiqi Bu, Jinshuo Dong, Qi Long, and Weijie J. Su. Deep learning with gaussian differential privacy, 2019.
346
+ [BDRS18] Mark Bun, Cynthia Dwork, Guy N Rothblum, and Thomas Steinke. Composable and versatile privacy via truncated cdp. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 74–86, 2018.
347
+ $[ \mathrm { B G K } ^ { + } 2 1 ]$ Zhiqi Bu, Sivakanth Gopi, Janardhan Kulkarni, Yin Tat Lee, Judy Hanwen Shen, and Uthaipon Tantipongpipat. Fast and memory efficient differentially private-sgd via jl projections. arXiv preprint arXiv:2102.03013, 2021. [BS16] Mark Bun and Thomas Steinke. Concentrated differential privacy: Simplifications, extensions, and lower bounds. In Theory of Cryptography Conference, pages 635–658. Springer, 2016. [BW18] Borja Balle and Yu-Xiang Wang. Improving the gaussian mechanism for differential privacy: Analytical calibration and optimal denoising. In International Conference on Machine Learning, pages 403–412, 2018.
348
+ $[ \mathrm { D K M ^ { + } } 0 6 ]$ Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pages 486– 503. Springer, 2006. [DL09] Cynthia Dwork and Jing Lei. Differential privacy and robust statistics. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 371–380, 2009.
349
+ [DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference, pages 265–284. Springer, 2006. $[ \mathrm { D R } ^ { + } 1 4 ]$ Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends $\textsuperscript { \textregistered }$ in Theoretical Computer Science, 9(3–4):211–407, 2014. [DR16] Cynthia Dwork and Guy N Rothblum. Concentrated differential privacy. arXiv preprint arXiv:1603.01887, 2016. [DRS19] Jinshuo Dong, Aaron Roth, and Weijie J. Su. Gaussian differential privacy, 2019. [DRV10] Cynthia Dwork, Guy N Rothblum, and Salil Vadhan. Boosting and differential privacy. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, pages 51–60. IEEE, 2010. [KH21] Antti Koskela and Antti Honkela. Computing differential privacy guarantees for heterogeneous compositions using fft. arXiv preprint arXiv:2102.12412, 2021.
350
+ $[ \mathrm { K J H } ^ { + } 2 0 ]$ Antti Koskela, Joonas Jälkö, Antti Honkela, et al. Computing tight differential privacy guarantees using fft. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics. AISTATS, 2020.
351
+ [KJPH21] Antti Koskela, Joonas Jälkö, Lukas Prediger, and Antti Honkela. Tight differential privacy for discrete-valued mechanisms and for the subsampled gaussian mechanism using fft. In Arindam Banerjee and Kenji Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 3358–3366. PMLR, 13–15 Apr 2021.
352
+ [KOV15] Peter Kairouz, Sewoong Oh, and Pramod Viswanath. The composition theorem for differential privacy. In International conference on machine learning, pages 1376–1385. PMLR, 2015. [KP21] Antti Koskela and Lukas Prediger. Github repository for fourier accountant. https: //github.com/DPBayes/PLD-Accountant, 2021. [Mir17] Ilya Mironov. Rényi differential privacy. In 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pages 263–275. IEEE, 2017.
353
+ [MM18] Sebastian Meiser and Esfandiar Mohammadi. Tight on budget? tight bounds for r-fold approximate differential privacy. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pages 247–264, 2018. [MV16] Jack Murtagh and Salil Vadhan. The complexity of computing the optimal composition of differential privacy. In Theory of Cryptography Conference, pages 157–175. Springer, 2016.
354
+ [SMM19] David M Sommer, Sebastian Meiser, and Esfandiar Mohammadi. Privacy loss classes: The central limit theorem in differential privacy. Proceedings on privacy enhancing technologies, 2019(2):245–269, 2019.
355
+ [ZDW21] Yuqing Zhu, Jinshuo Dong, and Yu-Xiang Wang. Optimal accounting of differential privacy via characteristic function. arXiv preprint arXiv:2106.08567, 2021.
md/train/H1cWzoxA-/H1cWzoxA-.md ADDED
@@ -0,0 +1,490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BI-DIRECTIONAL BLOCK SELF-ATTENTION FOR FASTAND MEMORY-EFFICIENT SEQUENCE MODELING
2
+
3
+ Tao Shen†, Tianyi Zhou‡, Guodong Long†, Jing Jiang†& Chengqi Zhang† †Centre for Artificial Intelligence, School of Software, University of Technology Sydney ‡Paul G. Allen School of Computer Science & Engineering, University of Washington tao.shen@student.uts.edu.au,tianyizh@uw.edu {guodong.long,jing.jiang,chengqi.zhang}@uts.edu.au
4
+
5
+ # ABSTRACT
6
+
7
+ Recurrent neural networks (RNN), convolutional neural networks (CNN) and selfattention networks (SAN) are commonly used to produce context-aware representations. RNN can capture long-range dependency but is hard to parallelize and not time-efficient. CNN focuses on local dependency but does not perform well on some tasks. SAN can model both such dependencies via highly parallelizable computation, but memory requirement grows rapidly in line with sequence length. In this paper, we propose a model, called “bi-directional block self-attention network (Bi-BloSAN)”, for RNN/CNN-free sequence encoding. It requires as little memory as RNN but with all the merits of SAN. Bi-BloSAN splits the entire sequence into blocks, and applies an intra-block SAN to each block for modeling local context, then applies an inter-block SAN to the outputs for all blocks to capture long-range dependency. Thus, each SAN only needs to process a short sequence, and only a small amount of memory is required. Additionally, we use feature-level attention to handle the variation of contexts around the same word, and use forward/backward masks to encode temporal order information. On nine benchmark datasets for different NLP tasks, Bi-BloSAN achieves or improves upon state-of-the-art accuracy, and shows better efficiency-memory trade-off than existing RNN/CNN/SAN.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Context dependency provides critical information for most natural language processing (NLP) tasks. In deep neural networks (DNN), context dependency is usually modeled by a context fusion module, whose goal is to learn a context-aware representation for each token from the input sequence. Recurrent neural networks (RNN), convolutional neural networks (CNN) and self-attention networks (SAN) are commonly used as context fusion modules. However, each has its own merits and defects, so which network to use is an open problem and mainly depends on the specific task.
12
+
13
+ RNN is broadly used given its capability in capturing long-range dependency through recurrent computation. It has been applied to various NLP tasks, e.g., question answering (Wang et al., 2017), neural machine translation (Bahdanau et al., 2015), sentiment analysis (Qian et al., 2017), natural language inference (Liu et al., 2016), etc. However, training the basic RNN encounters the gradient dispersion problem, and is difficult to parallelize. Long short-term memory (LSTM) (Hochreiter & Schmidhuber, 1997) effectively avoids the vanishing gradient. Gated recurrent unit (GRU) (Chung et al., 2014) and simple recurrent unit (SRU) (Lei & Zhang, 2017) improve the efficiency by reducing parameters and removing partial temporal-dependency, respectively. However, they still suffer from expensive time cost, especially when applied to long sequences.
14
+
15
+ CNN becomes popular recently on some NLP tasks because of its the highly parallelizable convolution computation (Dong et al., 2017). Unlike RNN, CNN can simultaneously apply convolutions defined by different kernels to multiple chunks of a sequence (Kim, 2014). It is mainly used for sentence-encoding tasks (Lei et al., 2015; Kalchbrenner et al., 2014). Recently, hierarchical CNNs, e.g. ByteNet (Kalchbrenner et al., 2016), and ConvS2S (Gehring et al., 2017), are proposed to capture relatively long-range dependencies by using stacking CNNs to increase the number of input elements represented in a state. Nonetheless, as mentioned by Vaswani et al. (2017), the number of CNNs required to relate signals from two arbitrary input grows in the distance between positions, linearly for ConvS2S and logarithmically for ByteNet. This makes it difficult to learn dependencies between distant positions.
16
+
17
+ Recently, self-attention networks (SAN) have been successfully applied to several NLP tasks. It produces context-aware representation by applying attention to each pair of tokens from the input sequence. Compared to RNN/CNN, SAN is flexible in modeling both long-range and local dependencies. The major computation in SAN is the highly parallelizable matrix multiplication without any temporal iteration, which can be easily accelerated by existing tools. Unlike most works that attach SAN to RNN/CNN as an additional module, two recent works show that SAN independent of any RNN/CNN module can achieve state-of-the-art performance on several NLP tasks. The first, multi-head attention (Vaswani et al., 2017), is a major component of a seq2seq model “Transformer” that outperforms previous methods in neural machine translation. It projects the input sequence into multiple subspaces, applies a SAN to the representation in each subspace, and concatenates the outputs. The second, directional self-attention network (DiSAN) (Shen et al., 2017), computes alignment scores at feature level, rather than at token level, and applies forward/backward masks to the alignment score matrix to encode temporal order information. DiSAN achieves the best or state-ofthe-art test accuracy on several NLP tasks by using less computational time and fewer parameters. More related works can be found in Appendix D.
18
+
19
+ However, one drawback of SAN is its large memory requirement to store the alignment scores of all the token pairs; the number grows quadratically with the sequence length. By contrast, RNN/CNN demand far less memory. The goal of this paper is to develop a novel SAN for RNN/CNN-free sequence encoding, which requires as little memory as RNN but inherits all the advantages of SAN, i.e., highly parallelizable computation, the capability/flexibility in modeling both long-range/local dependencies, and state-of-the-art performance on multiple NLP tasks.
20
+
21
+ We propose an attention mechanism, called “bidirectional block self-attention (Bi-BloSA)”, for fast and memory-efficient context fusion. The basic idea is to split a sequence into several length-equal blocks (with padding if necessary), and apply an intra-block SAN to each block independently. The outputs for all the blocks are then processed by an inter-block SAN. The intra-block SAN captures the local dependency within each block, while the inter-block SAN captures the long-range/global dependency. Hence, every SAN only needs to process a short sequence. Compared to a single SAN applied to the whole sequence, such two-layer stacked SAN saves a significant amount of memory. A feature fusion gate combines the outputs of intra-block and inter-block SAN with the original input, to produce the final contextaware representations of all the tokens. Similar to directional self-attention (DiSA) (Shen et al., 2017), BiBloSA uses forward/backward masks to encode the temporal order information, and feature-level attention to handle the variation of contexts around the same word. Further, a RNN/CNN-free sequence encoding model we build based on Bi-BloSA, called “bi-directional block self-attention network (Bi-BloSAN)”, uses an attention mechanism to compress the output of Bi-BloSA into a vector representation.
22
+
23
+ ![](images/4b9c89c715ce4fe3c14628e6de76cd75e581850cd269a07c916426f45e476dfd.jpg)
24
+ Figure 1: A comparison of Bi-BloSAN and other RNN/CNN/SAN in terms of training time, training memory consumption and test accuracy on SNLI (Bowman et al., 2015). The details of all the models are provided in Section 4.
25
+
26
+ In experiments1, we implement Bi-BloSAN and popular sequence encoding models on several NLP tasks, e.g., language inference, sentiment analysis, semantic relatedness, reading comprehension, question-type classification, etc. The baseline models include Bi-LSTM, Bi-GRU, Bi-SRU, CNNs, multi-head attention and DiSAN. A thorough comparison on nine benchmark datasets demonstrates the advantages of Bi-BloSAN in terms of training speed, inference accuracy and memory consumption. Figure 1 shows that Bi-BloSAN obtains the best accuracy by costing similar training time to DiSAN, and as little memory as Bi-LSTM, Bi-GRU and multi-head attention. This shows that Bi-BloSAN achieves a better efficiency-memory trade-off than existing RNN/CNN/SAN models.
27
+
28
+ Our notations follow these conventions: 1) lowercase denotes a vector; 2) bold lowercase denotes a sequence of vectors (stored as a matrix); and 3) uppercase denotes a matrix or a tensor.
29
+
30
+ # 2 BACKGROUND
31
+
32
+ # 2.1 WORD EMBEDDING
33
+
34
+ Word embedding is the basic processing unit in most DNN for sequence modeling. It transfers each discrete token into a representation vector of real values. Given a sequence of tokens (e.g., words or characters) $\pmb { w } = [ w _ { 1 } , w _ { 2 } , \ldots , w _ { n } ] \in \mathbb { R } ^ { N \times n }$ , where $w _ { i }$ is a one-hot vector, $N$ is the vocabulary size and $n$ is the sequence length. A pre-trained token embedding (e.g. word2vec (Mikolov et al., 2013b)) is applied to $\textbf { \em w }$ , which outputs a sequence of low dimensional vectors $\pmb { x } = [ x _ { 1 } , x _ { 2 } , \ldots , x _ { n } ] \in \mathbb { R } ^ { d _ { e } \times n }$ . This process can be formally written as $\mathbf { \Delta } \mathbf { x } ~ = ~ W ^ { \left( e \right) } \mathbf { \Delta } w$ , where $W ^ { ( e ) } \in \mathbb { R } ^ { d _ { e } \times N }$ is the embedding weight matrix that can be fine-tuned during the training phase.
35
+
36
+ # 2.2 VANILLA ATTENTION AND MULTI-DIMENSIONAL ATTENTION
37
+
38
+ Vanilla Attention: Given an input sequence $\pmb { x } = [ x _ { 1 } , x _ { 2 } , \dots , x _ { n } ]$ composed of token embeddings and a vector representation of a query $\mathbf { \bar { \boldsymbol { q } } } \in \mathbb { R } ^ { d _ { q } }$ , vanilla attention (Bahdanau et al., 2015) computes the alignment score between $q$ and each token $x _ { i }$ (reflecting the attention of $q$ to $x _ { i }$ ) using a compatibility function $f ( x _ { i } , q )$ . A softmax function then transforms the alignment scores $a \in \mathbb { R } ^ { n }$ to a probability distribution $p ( z | \mathbf { \boldsymbol { x } } , q )$ , where $z$ is an indicator of which token is important to $q$ . A large $\bar { p } ( z = i | \mathbf { x } , q )$ means that $x _ { i }$ contributes important information to $q$ . This process can be written as
39
+
40
+ $$
41
+ \begin{array} { r l } & { a = [ f ( x _ { i } , q ) ] _ { i = 1 } ^ { n } , } \\ & { p ( z | \mathbf { x } , q ) = \mathrm { s o f t m a x } ( a ) . } \end{array}
42
+ $$
43
+
44
+ The output $s$ is the expectation of sampling a token according to its importance, i.e.,
45
+
46
+ $$
47
+ s = \sum _ { i = 1 } ^ { n } p ( z = i | \pmb { x } , q ) x _ { i } = \mathbb { E } _ { i \sim p ( z | \pmb { x } , q ) } ( x _ { i } ) .
48
+ $$
49
+
50
+ Multiplicative attention (or dot-product attention) (Vaswani et al., 2017; Sukhbaatar et al., 2015; Rush et al., 2015) and additive attention (or multi-layer perceptron attention) (Bahdanau et al., 2015; Shang et al., 2015) are two commonly used attention mechanisms. They differ in the choice of compatibility function $f ( x _ { i } , q )$ . Multiplicative attention uses the cosine similarity for $f ( x _ { i } , q )$ , i.e.,
51
+
52
+ $$
53
+ f ( x _ { i } , q ) = \left. W ^ { ( 1 ) } x _ { i } , W ^ { ( 2 ) } q \right. ,
54
+ $$
55
+
56
+ where $W ^ { ( 1 ) } \in \mathbb { R } ^ { d _ { h } \times d _ { e } } , W ^ { ( 2 ) } \in \mathbb { R } ^ { d _ { h } \times d _ { q } }$ are the learnable parameters. Additive attention is defined as
57
+
58
+ $$
59
+ f ( x _ { i } , q ) = w ^ { T } \sigma ( W ^ { ( 1 ) } x _ { i } + W ^ { ( 2 ) } q + b ^ { ( 1 ) } ) + b ,
60
+ $$
61
+
62
+ where $w \in \mathbb { R } ^ { d _ { h } }$ , $b ^ { ( 1 ) }$ and $b$ are the biases, and $\sigma ( \cdot )$ is an activation function. Additive attention usually achieves better empirical performance than multiplicative attention, but is expensive in time cost and memory consumption.
63
+
64
+ Multi-dimensional Attention: Unlike vanilla attention, in multi-dimensional (multi-dim) attention (Shen et al., 2017), the alignment score is computed for each feature, i.e., the score of a token pair is a vector rather than a scalar, so the score might be large for some features but small for others. Therefore, it is more expressive than vanilla attention, especially for the words whose meaning varies in different contexts.
65
+
66
+ Multi-dim attention has $d _ { e }$ indicators $z _ { 1 } , \ldots , z _ { d _ { e } }$ for $d _ { e }$ features. Each indicator has a probability distribution that is generated by applying softmax to the $n$ alignment scores of the corresponding feature. Hence, for each feature $k$ in each token $i$ , we have $P _ { k i } \triangleq p ( z _ { k } = i | \pmb { x } , q )$ where $P \in \mathbb { R } ^ { d _ { e } \times n }$ .
67
+
68
+ A large $P _ { k i }$ means that the feature $k$ in token $i$ is important to $q$ . The output of multi-dim attention is written as
69
+
70
+ $$
71
+ s = \left[ \sum _ { i = 1 } ^ { n } P _ { k i } \pmb { x } _ { k i } \right] _ { k = 1 } ^ { d _ { e } } = \left[ \mathbb { E } _ { i \sim p ( z _ { k } | \pmb { x } , q ) } ( \pmb { x } _ { k i } ) \right] _ { k = 1 } ^ { d _ { e } } .
72
+ $$
73
+
74
+ For simplicity, we ignore the subscript $k$ where no confusion is caused. Then, Eq.(6) can be rewritten as an element-wise product, i.e., $\begin{array} { r } { s \stackrel { - } { = } \sum _ { i = 1 } ^ { n } P _ { \cdot i } \odot x _ { i } } \end{array}$ . Here, $P _ { \cdot i }$ is computed by the additive attention in Eq.(5) where $w ^ { T }$ is replaced with a weight matrix $W \in \mathbb { R } ^ { d _ { h } \times d _ { e } }$ , which leads to a score vector for each token pair.
75
+
76
+ # 2.3 TWO TYPES OF SELF-ATTENTION
77
+
78
+ token2token self-attention ( $\mathrm { H u }$ et al., 2017; Vaswani et al., 2017; Shen et al., 2017) produces context-aware representations by exploring the dependency between two tokens $x _ { i }$ and $x _ { j }$ from the same sequence $_ { \textbf { \em x } }$ . In particular, $q$ in Eq.(5) is replaced with $x _ { j }$ , i.e.,
79
+
80
+ $$
81
+ f ( x _ { i } , x _ { j } ) = W ^ { T } \sigma ( W ^ { ( 1 ) } x _ { i } + W ^ { ( 2 ) } x _ { j } + b ^ { ( 1 ) } ) + b .
82
+ $$
83
+
84
+ Similar to the $P$ in multi-dim attention, each input token $x _ { j }$ is associated with a probability matrix $P ^ { j }$ such that $P _ { k i } ^ { j } \triangleq p ( z _ { k } = i | \pmb { x } , x _ { j } )$ . The output representation for $x _ { j }$ is $\begin{array} { r } { s _ { j } = \sum _ { i = 1 } ^ { n } P _ { \cdot i } ^ { j } \odot x _ { i } } \end{array}$ and the final output of token2token self-attention is $\pmb { s } = \left[ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } \right]$ .
85
+
86
+ source2token self-attention (Lin et al., 2017; Shen et al., 2017; Liu et al., 2016) explores the importance of each token to the entire sentence given a specific task. In particular, $q$ is removed from Eq.(5), and the following equation is used as the compatibility function.
87
+
88
+ $$
89
+ \begin{array} { r } { f ( x _ { i } ) = W ^ { T } \sigma ( W ^ { ( 1 ) } x _ { i } + b ^ { ( 1 ) } ) + b . } \end{array}
90
+ $$
91
+
92
+ The probability matrix $P$ is defined as $P _ { k i } \triangleq p ( z _ { k } = i | \pmb { x } )$ . The final output of source2token selfki k attention has the same form as multi-dim attention, i.e., $\begin{array} { r } { \dot { s } = \sum _ { i = 1 } ^ { n } P _ { \cdot i } \odot \dot { x _ { i } } } \end{array}$
93
+
94
+ # 2.4 MASKED SELF-ATTENTION
95
+
96
+ Temporal order information is difficult to encode in token2token self-attention introduced above because the alignment score between two tokens is symmetric. Masked self-attention (Shen et al., 2017) applies a mask $M \in \mathbb { R } ^ { n \times n }$ to the alignment score matrix (or tensor due to feature-level score) computed by Eq.(7), so it allows one-way attention from one token to another. Specifically, the bias $b$ in Eq.(7) is replaced with a constant vector $M _ { i j } { \bf 1 }$ , where the 1 is an all-one vector. In addition, $W$ is fixed to a scalar $c$ and $\operatorname { t a n h } ( \cdot / c )$ is used as the activation function $\sigma ( \cdot )$ , i.e.,
97
+
98
+ ![](images/12fad078d040654ecac6b98a91435c605945ff1804df1076d398ab5ecfbbb190.jpg)
99
+ Figure 2: Masked self-attention mechanism. $f _ { i j }$ denotes $f ( x _ { i } , x _ { j } )$ in Eq.(9).
100
+
101
+ $$
102
+ f ( x _ { i } , x _ { j } ) = c \cdot \operatorname { t a n h } \left( [ W ^ { ( 1 ) } x _ { i } + W ^ { ( 2 ) } x _ { j } + b ^ { ( 1 ) } ] / c \right) + M _ { i j } \mathbf { 1 } ,
103
+ $$
104
+
105
+ where $W ^ { ( 1 ) } \in \mathbb { R } ^ { d _ { e } \times d _ { e } } , W ^ { ( 2 ) } \in \mathbb { R } ^ { d _ { e } \times d _ { q } }$ . The procedures to calculate the attention output from $f ( x _ { i } , x _ { j } )$ are identical to those in token2token self-attention. We use $\pmb { s } = g ^ { m } ( \pmb { x } , M )$ to denote the complete process of masked self-attention with $\pmb { s } = [ s _ { 1 } , s _ { 2 } , . . . , s _ { n } ]$ as the output sequence. An illustration of masked self-attention is given in Figure 2.
106
+
107
+ In order to model bi-directional order information, forward mask $M ^ { f w }$ and backward mask $M ^ { b w }$ are respectively substituted into Eq.(9), which results in forward and backward self-attentions. These two masks are defined as
108
+
109
+ $$
110
+ M _ { i j } ^ { f w } = \left\{ \begin{array} { l l } { 0 , } & { i < j } \\ { - \infty , } & { \mathrm { o t h e r w i s e } } \end{array} \right. \quad M _ { i j } ^ { b w } = \left\{ \begin{array} { l l } { 0 , } & { i > j } \\ { - \infty , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
111
+ $$
112
+
113
+ The outputs of forward and backward self-attentions are denoted by $\begin{array} { r } { s ^ { f w } \ = \ g ^ { m } ( \pmb { x } , M ^ { f w } ) } \end{array}$ and $\begin{array} { r } { s ^ { b w } = \dot { g } ^ { m } ( { \pmb x } , M ^ { b w } ) } \end{array}$ , respectively.
114
+
115
+ # 3 PROPOSED MODEL
116
+
117
+ In this section, we first introduce the “masked block self-attention (mBloSA)” (Section 3.1) as a fundamental self-attention module. Then, we present the “bi-directional block self-attention network (Bi-BloSAN)” (Section 3.2) for sequence encoding, which uses the “bi-directional block selfattention (Bi-BloSA)” (mBloSA with forward and backward masks) as its context fusion module.
118
+
119
+ # 3.1 MASKED BLOCK SELF-ATTENTION
120
+
121
+ As shown in Figure 3, masked block self-attention (mBloSA) has three parts from its bottom to top, i.e., 1) intra-block self-attention, 2) inter-block self-attention, and 3) the context fusion.
122
+
123
+ ![](images/9fc74bf1887d76a783aeb4a2f2918d964204be160c2c116de6e59441d6f49758.jpg)
124
+ Figure 3: Masked block self-attention (mBloSA) mechanism.
125
+
126
+ Intra-block self-attention: We firstly split the input sequence of token/word embeddings into $m$ blocks of equal length $r$ , i.e., $[ { \pmb x } ^ { l } ] _ { l = 1 } ^ { m } \ = \ [ { \pmb x } ^ { 1 } , { \pmb x } ^ { 2 } , . . . , \bar { { \pmb x } } ^ { m } ]$ where $\pmb { x } ^ { 1 } = [ x _ { 1 } , x _ { 2 } , \ldots , { \bar { x _ { r } } } ] , \pmb { x } ^ { 2 } =$ $[ x _ { r + 1 } , x _ { r + 2 } , \ldots , x _ { 2 r } ]$ and $\pmb { x } ^ { m } = [ x _ { n - r + 1 } , x _ { n - r + 2 } , . ~ . ~ , x _ { n } ]$ . Padding can be applied to the last block if necessary. Intra-block self-attention applies the masked self-attentions $g ^ { m } ( \cdot , M )$ with shared parameters to all the blocks , i.e.,
127
+
128
+ $$
129
+ \pmb { h } ^ { l } = g ^ { m } ( \pmb { x } ^ { l } , M ) , l = 1 , 2 , . . . , m .
130
+ $$
131
+
132
+ Its goal is to capture the local context dependency inside each block. Similar to $\mathbf { \Delta } _ { x } l$ , the output representations of the tokens in the $l$ -th block are denoted by $\pmb { h } ^ { l } = [ h _ { r ( l - 1 ) + 1 } , h _ { r ( l - 1 ) + 2 } , \ldots , h _ { r \times l } ]$ . Note, the block length $r$ is a hyper-parameter and $m = n / r$ . In Appendix A, we introduce an approach to selecting the optimal $r$ , which results in the maximum memory utility rate in expectation.
133
+
134
+ Inter-block self-attention: To generate a vector representation $v ^ { l }$ of each block, a source2token self-attention $g ^ { s 2 t } ( \cdot )$ is applied to the output $h ^ { l }$ of the intra-block self-attention on each block, i.e.,
135
+
136
+ $$
137
+ v ^ { l } = g ^ { s 2 t } ( h ^ { l } ) , l = 1 , 2 , \ldots , m .
138
+ $$
139
+
140
+ Note we apply the parameter-shared $g ^ { s 2 t } ( \cdot )$ to $h ^ { l }$ for different blocks. This provides us with a sequence $\pmb { v } = [ v _ { 1 } , v _ { 2 } , \dots , v _ { m } ]$ of local-context representations at block level. Inter-block self
141
+
142
+ attention then applies a masked self-attention to $\textbf { { v } }$ in order to capture the long-range/global dependency among the blocks, i.e.,
143
+
144
+ $$
145
+ \begin{array} { r } { \pmb { o } = \pmb { g } ^ { m } ( \pmb { v } , \pmb { M } ) . } \end{array}
146
+ $$
147
+
148
+ To combine the local and global context features at block level, a gate is used to merge the input and the output of the masked self-attention dynamically. This is similar to the gates in LSTM. The output sequence $\boldsymbol { e } = [ e _ { 1 } , \dots , e _ { m } ]$ of the gate is computed by
149
+
150
+ $$
151
+ \begin{array} { r l } & { G = \mathrm { s i g m o i d } \left( W ^ { \left( g 1 \right) } o + W ^ { \left( g 2 \right) } v + b ^ { \left( g \right) } \right) , } \\ & { e = G \odot o + \left( 1 - G \right) \odot v } \end{array}
152
+ $$
153
+
154
+ Context fusion: Given the long-range context representations $\pmb { e } = [ e _ { 1 } , \dots , e _ { m } ] \in \mathbb { R } ^ { d _ { e } \times m }$ at block level, we duplicate $e _ { l }$ for $r$ times to get $e ^ { l } = [ \dot { e _ { l } } , e _ { l } , \dots , e _ { l } ]$ (each token in block $l$ has the global context feature representation $e _ { l }$ ). Let $E \triangleq [ e ^ { l } ] _ { l = 1 } ^ { m } \in \mathbb { R } ^ { d _ { e } \times n }$ . Now, we have the input sequence $_ { \textbf { \em x } }$ of word embeddings, the local context features $^ { h }$ produced by intra-block self-attention, and the long-range/global context features $E$ produced by inter-block self-attention. A feature fusion gate (Gong $\&$ Bowman, 2017) is employed to combine them, and generates the final context-aware representations of all tokens, i.e.,
155
+
156
+ $$
157
+ \begin{array} { r l } & { F = \sigma \left( W ^ { ( f 1 ) } [ \pmb { x } ; \pmb { h } ; E ] + b ^ { ( f 1 ) } \right) , } \\ & { G = \mathrm { s i g m o i d } \left( W ^ { ( f 2 ) } [ \pmb { x } ; \pmb { h } ; E ] + b ^ { ( f 2 ) } \right) , } \\ & { \pmb { u } = G \odot F + ( 1 - G ) \odot \pmb { x } , } \end{array}
158
+ $$
159
+
160
+ where $\sigma ( \cdot )$ is an activation function, and $\pmb { \mathscr { u } } = [ u _ { 1 } , u _ { 2 } , \ldots , u _ { n } ] \in \mathbb { R } ^ { d _ { e } \times n }$ is the mBloSA output, which consists of the context-aware representations of the $n$ tokens.
161
+
162
+ # 3.2 BI-DIRECTIONAL BLOCK SELF-ATTENTION NETWORK FOR SEQUENCE ENCODING
163
+
164
+ We propose a sequence encoding model “Bi-directional block self-attention network (Bi-BloSAN)” with mBloSA as its major components. Its architecture is shown in Figure 4. In Bi-BloSAN, two fully connected layers (with untied parameters) are applied to the input sequence of token embeddings. Their outputs are processed by two mBloSA modules respectively. One uses the forward mask $\Dot { M } ^ { f w }$ and another uses the backward mask Mbw. Their outputs $\mathbf { \nabla } _ { u } f ^ { w }$ and $\mathbf { \Delta } u ^ { b w }$ are concatenated as $\mathbf { \dot { \boldsymbol { u } } } ^ { b i } = [ \mathbf { \boldsymbol { u } } ^ { f w } ; \mathbf { \boldsymbol { u } } ^ { b w } ] \in \mathbb { R } ^ { 2 d _ { e } \times n }$ . The idea of bi-directional attention follows the same spirit as Bi-LSTM and DiSAN. It
165
+
166
+ ![](images/24f82d8f73a072f687078960e1cea1ae995b46653058814ac133fc01d41eb984.jpg)
167
+ Figure 4: Bi-directional block self-attention network (BiBloSAN) for sequence encoding.
168
+
169
+ encodes temporal order information lacking in existing SAN models. The context fusion module in Bi-BloSAN, with the input $_ { \textbf { \em x } }$ and the output $\boldsymbol { u } ^ { b i }$ , is called “Bi-BloSA”. In order to obtain a sequence encoding, a source2token self-attention transforms the sequence $\boldsymbol { u } ^ { b i }$ of concatenated token representations into a vector representation $s$ .
170
+
171
+ # 4 EXPERIMENTS
172
+
173
+ We conduct the experiments of Bi-BloSAN and several popular RNN/CNN/SAN-based sequence encoding models on nine benchmark datasets for multiple different NLP tasks. Note that, in some baseline models, a source2token self-attention is on the top of the models to generate an encoding for the entire sequence. All the models used for comparisons are listed as follows.
174
+
175
+ • Bi-LSTM: 600D Bi-directional LSTM (300D forward LST $\Lambda + 3 0 0 \mathrm { D }$ backward LSTM) (Graves et al., 2013).
176
+
177
+ • Bi-GRU: 600D Bi-directional GRU (Chung et al., 2014).
178
+ • Bi-SRU: 600D Bi-directional SRU (Lei & Zhang, 2017) (with sped-up recurrence but no CUDA level optimization for fair comparison).
179
+ • Multi-CNN: 600D CNN sentence embedding model (Kim, 2014) (200D for each of 3, 4, 5-gram).
180
+ • Hrchy-CNN: 3-layer 300D CNN (Gehring et al., 2017) with kernel length 5, to which gated linear units (Dauphin et al., 2016) and residual connection (He et al., 2016) are applied.
181
+ Multi-head: 600D Multi-head attention (Vaswani et al., 2017) (8 heads, each has 75 hidden units). The positional encoding method used in Vaswani et al. (2017) is applied to the input sequence to encode temporal order information.
182
+ • DiSAN: 600D Directional self-attention network (Shen et al., 2017) (300D forward masked self-attention $+ ~ 3 0 0 \mathrm { D }$ backward masked self-attention).
183
+
184
+ All experimental codes are implemented in Python with Tensorflow and run on a single Nvidia GTX 1080Ti graphic card. Both time cost and memory load data are collected under Tensorflow1.3 with CUDA8 and cuDNN6021. In the rest of this section, we conduct the experiments on natural language inference in Section 4.1, reading comprehension in Section 4.2, semantic relatedness in Section 4.3 and sentence classifications in Section 4.4. Finally, we analyze the time cost and memory load of the different models vs. the sequence length in Section 4.5.
185
+
186
+ # 4.1 NATURAL LANGUAGE INFERENCE
187
+
188
+ Natural language inference (NLI) aims to reason the semantic relationship between a pair of sentences, i.e., a premise sentence and a hypothesis sentence. This relationship could be entailment, neutral or contradiction. In the experiment, we compare Bi-BloSAN to other baselines on the Stanford Natural Language Inference (Bowman et al., 2015) (SNLI)2 dataset, which contains standard training/dev/test split of 549,367/9,842/9,824 samples.
189
+
190
+ Table 1: Experimental results for different methods on SNLI. $| \theta |$ : the number of parameters (excluding word embedding part). Train Accu and Test Accu: the accuracies on training and test sets respectively.
191
+
192
+ <table><tr><td>Model</td><td>|0</td><td>Train Accu</td><td>Test Accu</td></tr><tr><td>Unlexicalized features (Bowman et al.,2015)</td><td></td><td>49.4</td><td>50.4</td></tr><tr><td>+ Unigram and bigram features (Bowman et al., 2015)</td><td></td><td>99.7</td><td>78.2</td></tr><tr><td>100D LSTM encoders (Bowman et al., 2015)</td><td>0.2m</td><td>84.8</td><td>77.6</td></tr><tr><td>300D LSTM encoders (Bowman et al.,2016)</td><td>3.0m</td><td>83.9</td><td>80.6</td></tr><tr><td>1024D GRU encoders (Vendrov et al., 2016)</td><td>15.0m</td><td>98.8</td><td>81.4</td></tr><tr><td>300D Tree-based CNN encoders (Mou et al.,2016)</td><td>3.5m</td><td>83.3</td><td>82.1</td></tr><tr><td>300D SPINN-PI encoders (Bowman et al., 2016)</td><td>3.7m</td><td>89.2</td><td>83.2</td></tr><tr><td>600D Bi-LSTM encoders (Liu et al.,2016)</td><td>2.0m</td><td>86.4</td><td>83.3</td></tr><tr><td>300D NTI-SLSTM-LSTMencoders (Munkhdalai &amp; Yu,2017b)</td><td>4.0m</td><td>82.5</td><td>83.4</td></tr><tr><td>600D Bi-LSTM encoders+intra-attention (Liu et al., 2016)</td><td>2.8m</td><td>84.5</td><td>84.2</td></tr><tr><td>300D NSE encoders (Munkhdalai &amp; Yu,2017a)</td><td>3.0m</td><td>86.2</td><td>84.6</td></tr><tr><td>600D (300+300) Deep Gated Attn. (Chen et al., 2017)</td><td>11.6m</td><td>90.5</td><td>85.5</td></tr><tr><td>Bi-LSTM (Graves et al.,2013)</td><td>2.9m</td><td>90.4</td><td>85.0</td></tr><tr><td>Bi-GRU (Chung et al., 2014)</td><td>2.5m</td><td>91.9</td><td>84.9</td></tr><tr><td>Bi-SRU (Lei &amp; Zhang,2017)</td><td>2.0m</td><td>88.4</td><td>84.8</td></tr><tr><td>Multi-CNN (Kim,2014)</td><td>1.4m</td><td>89.3</td><td>83.2</td></tr><tr><td>Hrchy-CNN (Gehring et al., 2017)</td><td>3.4m</td><td>91.3</td><td>83.9</td></tr><tr><td>Multi-head (Vaswani et al.,2017)</td><td>2.0m</td><td>89.6</td><td>84.2</td></tr><tr><td>DiSAN (Shen et al.,2017)</td><td>2.3m</td><td>91.1</td><td>85.6</td></tr><tr><td>480DBi-BloSAN</td><td>2.8m</td><td>91.7</td><td>85.7</td></tr></table>
193
+
194
+ Following the method of applying sentence-encoding to NLI task given in Bowman et al. (2016), two parameter-tied sentence-encoding models are applied to the premise and the hypothesis sentences respectively, to generate the premise encoding $s ^ { p }$ and the hypothesis encoding ${ \dot { s } } ^ { h }$ . A relation representation concatenating $s ^ { p }$ , $s ^ { h }$ , $s ^ { p } - s ^ { h }$ and $s ^ { p } \odot s ^ { h }$ is passed into a 300D fully connected layer, whose output is given to a 3-unit output layer with softmax to calculate the probability distribution over the three classes.
195
+
196
+ Training Setup: The optimization objective is the cross-entropy loss plus L2 regularization penalty. We minimize the objective by Adadelta (Zeiler, 2012) optimizer which is empirically more stable than Adam (Kingma & Ba, 2015) on SNLI. The batch size is set to 64 for all methods. The training phase takes 50 epochs to converge. All weight matrices are initialized by Glorot Initialization (Glorot & Bengio, 2010), and the biases are initialized with 0. We use 300D GloVe 6B pre-trained vectors (Pennington et al., 2014) to initialize the word embeddings in $_ { \textbf { \em x } }$ . The Out-of-Vocabulary words in the training set are randomly initialized by uniform distribution between $\left( - 0 . 0 5 , 0 . 0 5 \right)$ . The word embeddings are fine-tuned during the training. The Dropout (Srivastava et al., 2014) keep probability and the L2 regularization weight decay factor $\gamma$ are set to 0.75 and $5 { \times } 1 0 ^ { - 5 }$ , respectively. The number of hidden units is 300. The unspecified activation functions in all models are set to Relu (Glorot et al., 2011).
197
+
198
+ In Table 1, we report the number of parameters, and training/test accuracies of all baselines plus the methods from the official leaderboard. For fair comparison, we use 480D Bi-BloSAN, which leads to the similar parameter number with that of baseline encoders. Bi-BloSAN achieves the best test accuracy (similar to DiSAN) among all the sentence encoding models on SNLI. In particular, compared to the RNN models, Bi-BloSAN outperforms Bi-LSTM encoder, Bi-LSTM with attention and deep gated attention by $2 . 4 \%$ , $1 . 5 \%$ and $0 . 2 \%$ , respectively. Bi-BloSAN can even perform better than the semantic tree based models: SPINN-PI encoder $( + 2 . 5 \%$ )&Tree-based CNN encoder $( + 3 . 6 \% )$ , and the memory network based model: NSE encoder $( + 1 . 1 \% )$ . Additionally, Bi-BloSAN achieves the best performance among the baselines which are based on RNN/CNN/SAN. It outperforms Bi-LSTM $\left( + 0 . 7 \% \right)$ , Bi-GRU $( + 0 . 8 \% )$ , Bi-SRU $( + 0 . 9 \% )$ , multi-CNN $( + 2 . 5 \% )$ ), Hrchy-CNN $( + 1 . 8 \% )$ and multi-head attention $( + 1 . 5 \% )$ .
199
+
200
+ Table 2: Time cost and memory consumption of the different methods on SNLI. Time(s)/epoch: average training time (second) per epoch. Memory(MB): Training GPU memory consumption (Megabyte). Inference Time(s): average inference time (second) for all dev data on SNLI with test batch size of 100.
201
+
202
+ <table><tr><td>Model</td><td>Time(s)/epoch</td><td>Memory(MB)</td><td>Inference Time(s)</td><td>Test Accuracy</td></tr><tr><td>Bi-LSTM (Graves et al., 2013)</td><td>2080</td><td>1245</td><td>9.2</td><td>85.0</td></tr><tr><td>Bi-GRU (Chung et al., 2014)</td><td>1728</td><td>1259</td><td>9.3</td><td>84.9</td></tr><tr><td>Bi-SRU (Lei &amp; Zhang,2017)</td><td>1630</td><td>731</td><td>8.2</td><td>84.8</td></tr><tr><td>Multi-CNN (Kim,2014)</td><td>284</td><td>529</td><td>2.4</td><td>83.2</td></tr><tr><td>Hrchy-CNN (Gehring et al., 2017)</td><td>343</td><td>2341</td><td>2.9</td><td>83.9</td></tr><tr><td>Multi-head (Vaswani et al., 2017)</td><td>345</td><td>1245</td><td>3.0</td><td>84.2</td></tr><tr><td>DiSAN (Shen et al., 2017)</td><td>587</td><td>2267</td><td>7.0</td><td>85.6</td></tr><tr><td>480D Bi-BloSAN</td><td>508</td><td>1243</td><td>3.4</td><td>85.7</td></tr></table>
203
+
204
+ In addition, we compare time cost and memory consumption of all the baselines in Table 2. Compared to DiSAN with the same test accuracy, Bi-BloSAN is much faster and more memory efficient. In terms of training and inference time, Bi-BloSAN is $3 \sim 4 \times$ faster than the RNN models (BiLSTM, Bi-GRU, etc.). It is as fast as CNNs and multi-head attention but substantially outperforms them in test accuracy. In terms of training memory, Bi-BloSAN requires similar GPU memory to the RNN-based models and multi-head attention, which is much less than that needed by DiSAN.
205
+
206
+ Finally, we conduct an ablation study of Bi-BloSAN in Table 3. In particular, we evaluate the contribution of each part of Bi-BloSAN by the change of test accuracy after removing the part. The removed part could be: 1) local context representations $^ { h }$ , 2) global context representations $E , 3 )$ ) the context fusion module (mBloSA) or 4) all fundamental modules appeared in this paper. The results show that both the local and global context representations play significant roles in BiBloSAN. They make Bi-BloSAN surpass the state-of-the-art models. Moreover, mBloSA improves the test accuracy from $8 3 . 1 \%$ to $8 5 . 7 \%$ . Source2token self-attention performs much better than vanilla attention, and improves the test accuracy by $3 . 3 \%$ .
207
+
208
+ Table 3: An ablation study of Bi-BloSAN. “Local” denotes the local context representations $^ { h }$ and “Global” denotes the global context representations $E$ . “Bi-BloSAN w/o mBloSA” equals to word embeddings directly followed by a source2token attention and “Bi-BloSAN w/o mBloSA & source2token self-attn.” equals to word embeddings plus a vanilla attention without $q$ .
209
+
210
+ <table><tr><td>Model</td><td>|0</td><td>Test Accuracy</td></tr><tr><td>Bi-BloSAN</td><td>2.8m</td><td>85.7</td></tr><tr><td>Bi-BloSAN w/o Local</td><td>2.5m</td><td>85.2</td></tr><tr><td>Bi-BloSANw/o Global</td><td>1.8m</td><td>85.3</td></tr><tr><td>Bi-BloSAN w/o mBloSA</td><td>0.54m</td><td>83.1</td></tr><tr><td>Bi-BloSAN w/o mBloSA&amp; source2token self-attn.</td><td>0.45m</td><td>79.8</td></tr></table>
211
+
212
+ # 4.2 READING COMPREHENSION
213
+
214
+ Given a passage and a corresponding question, the goal of reading comprehension is to find the correct answer from the passage for the question. We use the Stanford Question Answering Dataset (Rajpurkar et al., 2016) $\mathbf { \bar { \Gamma } } ( \mathbf { S } \mathbf { Q u } \mathbf { \bar { A } } \mathbf { D } ) ^ { 3 }$ to evaluate all models. $\mathrm { S Q u A D }$ consists of questions posed by crowdworkers on a set of Wikipedia articles, where the answer to each question is a segment of text, or a span, from the corresponding passage.
215
+
216
+ Since Bi-BloSAN and other baselines are designed for sequence encoding, such as sentence embedding, we change the task from predicting the answer span to locating the sentence containing the correct answer. We build a network structure to test the power of sequence encoding in different models to find the correct answers. The details are given in Appendix B.
217
+
218
+ Training Setup: We use Adadelta optimizer to minimize the cross-entropy loss plus L2 regularization penalty, with batch size of 32. The network parameters and word embeddings initialization methods are same as those for SNLI, except that both the word embedding dimension and the number of hidden units are set to 100. We use 0.8 dropout keep probability and $1 0 ^ { - 4 }$ L2 regularization weight decay factor.
219
+
220
+ We evaluate the Bi-BloSAN and the baselines except DiSAN because the memory required by DiSAN largely exceeds the GPU memory of GTX 1080Ti (11GB). The number of parameters, per epoch training time and the prediction accuracy on development set are given in Table 4.
221
+
222
+ Table 4: Experimental results for different methods on modified SQuAD task.
223
+
224
+ <table><tr><td>Context Fusion Method</td><td>0</td><td>Time(s)/Epoch</td><td>Dev Accuracy</td></tr><tr><td>Bi-LSTM (Graves et al., 2013)</td><td>0.71m</td><td>857</td><td>68.01</td></tr><tr><td>Bi-GRU (Chung et al., 2014)</td><td>0.57m</td><td>782</td><td>67.98</td></tr><tr><td>Bi-SRU (Lei&amp; Zhang,2017)</td><td>0.32m</td><td>737</td><td>67.32</td></tr><tr><td>Multi-CNN (Kim, 2014)</td><td>0.60m</td><td>114</td><td>63.58</td></tr><tr><td>Multi-head (Vaswani et al., 2017)</td><td>0.45m</td><td>140</td><td>64.82</td></tr><tr><td>Bi-BloSAN</td><td>0.82m</td><td>293</td><td>68.38</td></tr></table>
225
+
226
+ Compared to RNN/CNN models, Bi-BloSAN achieves state-of-the-art prediction accuracy in this modified task. Bi-BloSAN shows its competitive context fusion and sequence encoding capability compared to Bi-LSTM, Bi-GRU, Bi-SRU but is much more time-efficient. In addition, Bi-BloSAN significantly outperforms multi-CNN and multi-head attention.
227
+
228
+ # 4.3 SEMANTIC RELATEDNESS
229
+
230
+ The goal of semantic relatedness is to predict the similarity degree of a given pair of sentences. Unlike the classification problems introduced above, predicting the semantic relatedness of sentences is a regression problem. We use $s ^ { 1 }$ and $s ^ { 2 }$ to denote the encodings of the two sentences, and assume that the similarity degree is between $[ 1 , K ]$ . Following the method introduced by Tai et al. (2015), the concatenation of $s ^ { 1 } \odot s ^ { 2 }$ and $| s ^ { 1 } - s ^ { 2 } |$ is used as the representation of sentence relatedness. This representation is fed into a 300D fully connected layer, followed by a K-unit output layer with softmax to calculate a probability distribution $\hat { p }$ . The details of this regression problem can be found in Appendix C. We evaluate all models on Sentences Involving Compositional Knowledge $\mathrm { ( S I C K ) ^ { 4 } }$ dataset, where the similarity degree is denoted by a real number in the range of [1, 5]. SICK comprises 9,927 sentence pairs with 4,500/500/4,927 instances for training/dev/test sets.
231
+
232
+ Training Setup: The optimization objective of this regression problem is the KL-divergence plus the L2 regularization penalty. We minimize the objective using Adadelta with batch size of 64. The network parameters and word embeddings are initialized as in SNLI experiment. The keep probability of dropout is set to 0.7, and the L2 regularization weight decay factor is set to $1 0 ^ { - 4 }$ .
233
+
234
+ Table 5: Experimental results for different methods on SICK sentence relatedness dataset. The reported accuracies are the mean of five runs (standard deviations in parentheses).
235
+
236
+ <table><tr><td>Model</td><td>Pearson&#x27;s r</td><td>Spearman&#x27;s p</td><td>MSE</td></tr><tr><td>Meaning Factory (Bjerva et al., 2014)</td><td>0.8268</td><td>0.7721</td><td>0.3224</td></tr><tr><td>ECNU (Zhao et al., 2014)</td><td>0.8414</td><td>/</td><td>/</td></tr><tr><td>DT-RNN (Socher et al., 2014)</td><td>0.7923 (0.0070)</td><td>0.7319 (0.0071)</td><td>0.3822 (0.0137)</td></tr><tr><td>SDT-RNN (Socher et al.,2014)</td><td>0.7900 (0.0042)</td><td>0.7304 (0.0042)</td><td>0.3848 (0.0042)</td></tr><tr><td>Constituency Tree-LSTM (Tai et al., 2015)</td><td>0.8582 (0.0038)</td><td>0.7966 (0.0053)</td><td>0.2734 (0.0108)</td></tr><tr><td>Dependency Tree-LSTM(Tai et al.,2015)</td><td>0.8676 (0.0030)</td><td>0.8083 (0.0042)</td><td>0.2532 (0.0052)</td></tr><tr><td>Bi-LSTM (Graves et al.,2013)</td><td>0.8473 (0.0013)</td><td>0.7913 (0.0019)</td><td>0.3276 (0.0087)</td></tr><tr><td>Multi-CNN (Kim,2014)</td><td>0.8374 (0.0021)</td><td>0.7793 (0.0028)</td><td>0.3395 (0.0086)</td></tr><tr><td>Hrchy-CNN(Gehring et al.,2017)</td><td>0.8436 (0.0014)</td><td>0.7874 (0.0022)</td><td>0.3162 (0.0058)</td></tr><tr><td>Multi-head (Vaswani et al.,2017)</td><td>0.8521 (0.0013)</td><td>0.7942 (0.0050)</td><td>0.3258 (0.0149)</td></tr><tr><td>DiSAN (Shen et al., 2017)</td><td>0.8695 (0.0012)</td><td>0.8139 (0.0012)</td><td>0.2879 (0.0036)</td></tr><tr><td>Bi-BloSAN</td><td>0.8616 (0.0012)</td><td>0.8038 (0.0012)</td><td>0.3008 (0.0091)</td></tr></table>
237
+
238
+ The performances of all models are shown in Table 5, which shows that Bi-BloSAN achieves stateof-the-art prediction quality. Although Dependency Tree-LSTM and DiSAN obtain the best performance, the Tree-LSTM needs external semantic parsing tree as the recursive input and expensive recursion computation, and DiSAN requires much larger memory for self-attention calculation. By contrast, Bi-BloSAN, as a RNN/CNN-free model, shows appealing advantage in terms of memory and time efficiency. Note that, performance of Bi-BloSAN is still better than some common models, including Bi-LSTM, CNNs and multi-head attention.
239
+
240
+ # 4.4 SENTENCE CLASSIFICATIONS
241
+
242
+ The goal of sentence classification is to correctly predict the class label of a given sentence in various scenarios. We evaluate the models on six sentence classification benchmarks for various NLP tasks, such as sentiment analysis and question-type classification. They are listed as follows.
243
+
244
+ • $\mathbf { C } \mathbf { R } ^ { 5 }$ : Customer reviews (Hu & Liu, 2004) of various products (cameras etc.). This task is to predict whether the review is positive or negative.
245
+ • MPQA6: Opinion polarity detection subtask of the MPQA dataset (Wiebe et al., 2005).
246
+ • $\mathbf { S U B J } ^ { 7 }$ : Subjectivity dataset (Pang & Lee, 2004), which includes a set of sentences. The corresponding label indicates whether each sentence is subjective or objective.
247
+ • TREC8: TREC question-type classification dataset (Li & Roth, 2002) which coarsely classifies the question sentences into six types.
248
+
249
+ • SST-19: Stanford Sentiment Treebank (Socher et al., 2013), which is a dataset consisting of movie reviews with five fine-grained sentiment labels, i.e., very positive, positive, neutral, negative and very negative. SST-2: Stanford Sentiment Treebank (Socher et al., 2013) with binary sentiment labels. Compared to SST-1, SST-2 removes the neutral instances, and labels the rest with either negative or positive.
250
+
251
+ Note that only SST-1 and SST-2 have the standard training/dev/test split, and TREC has the training/dev split. We implement 10-fold cross validation on SUBJ, CR and MPQA because the original datasets do not provide any split. We do not use the Movie Reviews (Pang & Lee, 2005) dataset because the SST-1/2 are extensions of it.
252
+
253
+ Training Setup: We use the cross-entropy loss plus L2 regularization penalty as the optimization objective. We minimize it by Adam with training batch size of 32 (except DiSAN, which uses batch size of 16 due to the limit of GPU memory). The network parameters and word embeddings are initialized as in SNLI experiment. To avoid overfitting on small datasets, we decrease the dropout keep probability and the L2 regularization weight decay factor $\gamma$ to 0.6 and $1 0 ^ { - 4 }$ , respectively.
254
+
255
+ Table 6: Experimental results for different methods on various sentence classification benchmarks. The reported accuracies on CR, MPQA and SUBJ are the mean of 10-fold cross validation, the accuracies on TREC are the mean of dev accuracies of five runs, and the accuracies on SST-1 and SST-2 are the mean of test accuracies of five runs. All standard deviations are in parentheses.
256
+
257
+ <table><tr><td>Model</td><td>CR</td><td>MPQA</td><td>SUBJ</td><td>TREC</td><td>SST-1</td><td>SST-2</td></tr><tr><td>cBoW (Mikolov et al., 2013a)</td><td>79.9</td><td>86.4</td><td>91.3</td><td>87.3</td><td>/</td><td>/</td></tr><tr><td>Skip-thought (Kiros et al., 2015)</td><td>81.3</td><td>87.5</td><td>93.6</td><td>92.2</td><td>/</td><td>/</td></tr><tr><td>DCNN (Kalchbrenner et al., 2014)</td><td>/</td><td>/</td><td>/</td><td>93.0</td><td>86.8</td><td>48.5</td></tr><tr><td>AdaSent (Zhao et al., 2015)</td><td>83.6 (1.6)</td><td>90.4 (0.7)</td><td>92.2 (1.2)</td><td>91.1 (1.0)</td><td>/</td><td>/</td></tr><tr><td>SRU (Lei &amp; Zhang,2017)</td><td>84.8 (1.3)</td><td>89.7 (1.1)</td><td>93.4 (0.8)</td><td>93.9 (0.6)</td><td>89.1 (0.3)</td><td>/</td></tr><tr><td>Wide CNNs (Lei&amp; Zhang,2017)</td><td>82.2 (2.2)</td><td>88.8 (1.2)</td><td>92.9 (0.7)</td><td>93.2 (0.5)</td><td>85.3 (0.4)</td><td>/</td></tr><tr><td>Bi-LSTM(Graves et al., 2013)</td><td>84.6 (1.6)</td><td>90.2 (0.9)</td><td>94.7 (0.7)</td><td>94.4 (0.3)</td><td>87.7 (0.6)</td><td>49.9 (0.8)</td></tr><tr><td>Multi-head (Vaswani et al., 2017)</td><td>82.6 (1.9)</td><td>89.8 (1.2)</td><td>94.0 (0.8)</td><td>93.4 (0.4)</td><td>83.9 (0.4)</td><td>48.2 (0.6)</td></tr><tr><td>DiSAN (Shen et al., 2017)</td><td>84.8 (2.0)</td><td>90.1 (0.4)</td><td>94.2 (0.6)</td><td>94.2 (0.1)</td><td>87.8 (0.3)</td><td>51.0 (0.7)</td></tr><tr><td>Bi-BloSAN</td><td>84.8 (0.9)</td><td>90.4 (0.8)</td><td>94.5 (0.5)</td><td>94.8 (0.2)</td><td>87.4 (0.2)</td><td>50.6 (0.5)</td></tr></table>
258
+
259
+ The prediction accuracies of different models on the six benchmark datasets are given in Table 6. Bi-BloSAN achieves the best prediction accuracies on CR, MPQA and TREC, and state-of-theart performances on SUBJ, SST-1 and SST-2 datasets (slightly worse than the best performances). Although Bi-BloSAN performs a little bit worse than the RNN models on SUBJ and SST-1, it is much more time-efficient than them. Additionally, on the SST-2 dataset, Bi-BloSAN performs slightly worse than DiSAN in terms of prediction accuracy $( - 0 . 4 \% )$ but obtains a significantly higher memory utility rate.
260
+
261
+ We visualize the progress of training models on CR dataset in Figure 5. The convergence speed of Bi-BloSAN is $\sim 6 \times$ and ${ \sim } 2 \times$ faster than Bi-LSTM and DiSAN respectively. Although Bi-BloSAN is less time-efficient than CNN and multi-head attention, it has much better prediction quality.
262
+
263
+ # 4.5 ANALYSES OF TIME COST AND MEMORY CONSUMPTION
264
+
265
+ To compare the efficiency-memory trade-off for each model on sequences of different lengths, we generate random tensor data, and feed them into the different sequence encoding models. The models we evaluate include Bi-LSTM, Bi-GRU, Bi-SRU, CNN, multi-head attention, DiSAN and Bi-BloSAN. The shape of the random data is [batch size, sequence length, features number]. We fix the batch size to 64 and the features number to 300, then change the sequence length from 16 to 384 with a step size 16.
266
+
267
+ We first discuss the time cost vs. the sequence length. As shown in Figure 6(a), the inference time of Bi-BloSAN is similar to those of multi-head attention and multi-CNN, but Bi-BloSAN outperforms both by a large margin on prediction quality in previous experiments. Moreover, Bi-BloSAN is much faster than the RNN models (Bi-LSTM, Bi-GRU, BI-SRU). In addition, although DiSAN requires less training time than the RNN models in the experiments above, it is much slower during the inference phase because the large memory allocation consumes a great amount of time. By contrast, the block structure of Bi-BloSAN significantly reduces the inference time.
268
+
269
+ ![](images/776a5d89d9ad5e56eb82df816d04ed2f6a6f51c9b7353e1ab65101fd7c7d2ec0.jpg)
270
+ Figure 5: Validation accuracy vs. training time (second) of Bi-LSTM, CNN, multi-head attention, DiSAN and Bi-BloSAN for 800 training steps on CR dataset. (The Bi-LSTM for 800 steps consumes 279s in total.)
271
+
272
+ ![](images/ffd239a83482134dbcc23db770733f8a769becc14bbb42785776e0aa180c7b71.jpg)
273
+ Figure 6: (a) Inference time cost and (b) GPU memory consumption of the sequence encoding models vs. the sequence length with the batch size of 64 and the features number of 300.
274
+
275
+ The GPU memory consumption vs. the sequence length for each model is visualized in Figure 6(b). DiSAN is not scalable because its memory grows explosively with the sequence length. Bi-BloSAN is more memory-efficient and scalable than DiSAN as the growth of its memory is nearly linear. Although Bi-BloSAN consumes more memory than the RNN models, it experimentally has better time efficiency and prediction quality. Since multi-head attention uses multiplicative attention, it requires less memory than all additive attention based models, such as DiSAN and Bi-BloSAN, but multiplicative attention based models usually perform worse than additive attention based models.
276
+
277
+ # 5 CONCLUSIONS
278
+
279
+ This paper presents an attention network, called bi-directional block self-attention network (BiBloSAN), for fast, memory-efficient and RNN/CNN-free sequence modeling. To overcome large memory consumption of existing self-attention networks, Bi-BloSAN splits the sequence into several blocks and employs intra-block and inter-block self-attentions to capture both local and longrange context dependencies, respectively. To encode temporal order information, Bi-BloSAN applies forward and backward masks to the alignment scores between tokens for asymmetric selfattentions.
280
+
281
+ Our experiments on nine benchmark datasets for various different NLP tasks show that Bi-BloSAN can achieve the best or state-of-the-art performance with better efficiency-memory trade-off than existing RNN/CNN/SAN models. Bi-BloSAN is much more time-efficient than the RNN models (e.g., Bi-LSTM, Bi-GRU, etc.), requires much less memory than DiSAN, and significantly outperforms the CNN models and multi-head attention on prediction quality.
282
+
283
+ # 6 ACKNOWLEDGMENTS
284
+
285
+ This research was funded by the Australian Government through the Australian Research Council (ARC) under grants 1) LP160100630 partnership with Australia Government Department of Health and 2) LP150100671 partnership with Australia Research Alliance for Children and Youth (ARACY) and Global Business College Australia (GBCA). We also acknowledge the support of NVIDIA Corporation with the donation of GPU used for this research.
286
+
287
+ # REFERENCES
288
+
289
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
290
+
291
+ Johannes Bjerva, Johan Bos, Rob Van der Goot, and Malvina Nissim. The meaning factory: Formal semantics for recognizing textual entailment and determining semantic similarity. In SemEval@ COLING, pp. 642– 646, 2014.
292
+
293
+ Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In EMNLP, 2015.
294
+
295
+ Samuel R Bowman, Jon Gauthier, Abhinav Rastogi, Raghav Gupta, Christopher D Manning, and Christopher Potts. A fast unified model for parsing and sentence understanding. In ACL, 2016.
296
+
297
+ Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. Recurrent neural networkbased sentence encoder with gated attention for natural language inference. In RepEval@ EMNLP, 2017.
298
+
299
+ Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. In NIPS, 2014.
300
+
301
+ Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016.
302
+
303
+ Xuanyi Dong, Junshi Huang, Yi Yang, and Shuicheng Yan. More is less: A more complicated network with less inference complexity. In Computer Vision and Pattern Recognition, 2017.
304
+
305
+ Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. arXiv preprint arXiv:1705.03122, 2017.
306
+
307
+ 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, pp. 249– 256, 2010.
308
+
309
+ 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.
310
+
311
+ Yichen Gong and Samuel R Bowman. Ruminating reader: Reasoning with gated multi-hop attention. arXiv preprint arXiv:1704.07415, 2017.
312
+
313
+ Alex Graves, Navdeep Jaitly, and Abdel-rahman Mohamed. Hybrid speech recognition with deep bidirectional lstm. In Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on, pp. 273–278. IEEE, 2013.
314
+
315
+ 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.
316
+
317
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8):1735–1780, 1997.
318
+
319
+ Minghao Hu, Yuxing Peng, and Xipeng Qiu. Reinforced mnemonic reader for machine comprehension. arXiv preprint arXiv:1705.02798, 2017.
320
+
321
+ Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 168–177. ACM, 2004.
322
+
323
+ Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for modelling sentences. arXiv preprint arXiv:1404.2188, 2014.
324
+
325
+ Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Koray Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016.
326
+
327
+ Yoon Kim. Convolutional neural networks for sentence classification. In EMNLP, 2014.
328
+
329
+ Yoon Kim, Carl Denton, Luong Hoang, and Alexander M Rush. Structured attention networks. In ICLR, 2017.
330
+
331
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
332
+
333
+ Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In NIPS, 2015.
334
+
335
+ Filippos Kokkinos and Alexandros Potamianos. Structural attention neural networks for improved sentiment analysis. arXiv preprint arXiv:1701.01811, 2017.
336
+
337
+ Tao Lei and Yu Zhang. Training rnns as fast as cnns. arXiv preprint arXiv:1709.02755, 2017.
338
+
339
+ Tao Lei, Regina Barzilay, and Tommi Jaakkola. Molding cnns for text: non-linear, non-consecutive convolutions. In EMNLP, 2015.
340
+
341
+ Xin Li and Dan Roth. Learning question classifiers. In ACL, 2002.
342
+
343
+ Zheng Li, Yu Zhang, Ying Wei, Yuxiang Wu, and Qiang Yang. End-to-end adversarial memory network for cross-domain sentiment classification. In IJCAI, pp. 2237–2243, 2017.
344
+
345
+ Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. In ICLR, 2017.
346
+
347
+ Yang Liu, Chengjie Sun, Lei Lin, and Xiaolong Wang. Learning natural language inference using bidirectional lstm model and inner-attention. arXiv preprint arXiv:1605.09090, 2016.
348
+
349
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a.
350
+
351
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013b.
352
+
353
+ Lili Mou, Rui Men, Ge Li, Yan Xu, Lu Zhang, Rui Yan, and Zhi Jin. Natural language inference by tree-based convolution and heuristic matching. In ACL, 2016.
354
+
355
+ Tsendsuren Munkhdalai and Hong Yu. Neural semantic encoders. In EACL, 2017a.
356
+
357
+ Tsendsuren Munkhdalai and Hong Yu. Neural tree indexers for text understanding. In EACL, 2017b.
358
+
359
+ Bo Pang and Lillian Lee. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In ACL, 2004.
360
+
361
+ Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In ACL, 2005.
362
+
363
+ Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
364
+
365
+ Qiao Qian, Minlie Huang, and Xiaoyan Zhu. Linguistically regularized lstms for sentiment classification. In ACL, 2017.
366
+
367
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In EMNLP, 2016.
368
+
369
+ Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In EMNLP, 2015.
370
+
371
+ Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. In ACL, 2015.
372
+
373
+ Tao Shen, Tianyi Zhou, Guodong Long, Jing Jiang, Shirui Pan, and Chengqi Zhang. Disan: Directional selfattention network for rnn/cnn-free language understanding. arXiv preprint arXiv:1709.04696, 2017.
374
+
375
+ Richard Socher, Alex Perelygin, Jean Y Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, Christopher Potts, et al. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013.
376
+
377
+ Richard Socher, Andrej Karpathy, Quoc V Le, Christopher D Manning, and Andrew Y Ng. Grounded compositional semantics for finding and describing images with sentences. Transactions of the Association for Computational Linguistics, 2:207–218, 2014.
378
+
379
+ 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.
380
+
381
+ Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In NIPS, 2015.
382
+
383
+ Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from treestructured long short-term memory networks. In ACL, 2015.
384
+
385
+ Zhiyang Teng and Yue Zhang. Bidirectional tree-structured lstm with head lexicalization. In ACL, 2017.
386
+
387
+ Ashish Vaswani, Shazeer, Noam, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
388
+
389
+ Ivan Vendrov, Ryan Kiros, Sanja Fidler, and Raquel Urtasun. Order-embeddings of images and language. In ICLR, 2016.
390
+
391
+ Wenhui Wang, Nan Yang, Furu Wei, Baobao Chang, and Ming Zhou. Gated self-matching networks for reading comprehension and question answering. In ACL, 2017.
392
+
393
+ Zhiguo Wang, Haitao Mi, Wael Hamza, and Radu Florian. Multi-perspective context matching for machine comprehension. arXiv preprint arXiv:1612.04211, 2016.
394
+
395
+ Janyce Wiebe, Theresa Wilson, and Claire Cardie. Annotating expressions of opinions and emotions in language. Language resources and evaluation, 39(2):165–210, 2005.
396
+
397
+ Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alexander J Smola, and Eduard H Hovy. Hierarchical attention networks for document classification. In HLT-NAACL, 2016.
398
+
399
+ Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
400
+
401
+ Han Zhao, Zhengdong Lu, and Pascal Poupart. Self-adaptive hierarchical sentence model. In IJCAI, 2015.
402
+
403
+ Jiang Zhao, Tiantian Zhu, and Man Lan. Ecnu: One stone two birds: Ensemble of heterogenous measures for semantic relatedness and textual entailment. In SemEval@ COLING, pp. 271–277, 2014.
404
+
405
+ # A THE SELECTION OF BLOCK LENGTH
406
+
407
+ In mBloSA, the length $r$ of each block is a hyper-parameter that determines memory consumption of mBloSA. To minimize the memory consumption, we propose an approach that calculates the optimized block length $r$ as follows.
408
+
409
+ We first introduce the method for determining $r$ for a dataset that has fixed sentence length $n$ . Given the sentence length $n$ and the block number $m = n / r$ , we have the following facts: 1) the major memory consumption in mBloSA is dominated by the masked self-attentions $g ^ { m } ( \cdot , M )$ ; 2) the memory consumption of the masked self-attention is proportional to the square of the sentence length; and 3) mBloSA contains $m$ masked self-attention with a sequence length of $r$ , and 1 masked self-attention with a sequence length of $m$ . Therefore, the memory $\xi$ required by mBloSA can be calculated by
410
+
411
+ $$
412
+ \begin{array} { r } { \xi \propto r ^ { 2 } \cdot m + m ^ { 2 } \cdot 1 } \\ { = r ^ { 2 } \cdot \frac { n } { r } + ( \frac { n } { r } ) ^ { 2 } . } \end{array}
413
+ $$
414
+
415
+ By setting the gradient of √ $\xi$ w.r.t. $r$ to zero, we know that the memory consumption $\xi$ is minimum when $r = \sqrt [ 3 ] { 2 n }$ .
416
+
417
+ Second, we propose a method for selecting $r$ given a dataset with the sentence lengths that follow a normal distribution $N ( \mu , \sigma ^ { 2 } )$ . We consider the case where mini-batch SGD with a batch size of $B$ or its variant is used for training. We need to calculate the upper bound of the expectation of the maximal sentence length for each mini-batch. Let us first consider $B$ random variables $[ X _ { 1 } , X _ { 2 } , \ldots , X _ { B } ]$ in the distribution $N ( 0 , \sigma ^ { 2 } )$ . The goal is to find the upper bound of the expectation of random variable $Z + \mu$ , where $Z$ is defined as
418
+
419
+ $$
420
+ Z = \operatorname* { m a x } _ { i } X _ { i } , { \mathrm { f o r } } i = 1 , 2 , \ldots , B .
421
+ $$
422
+
423
+ By Jensen’s inequality,
424
+
425
+ $$
426
+ \begin{array} { r } { e ^ { t \mathbb { E } [ Z ] } \le \mathbb { E } [ e ^ { t Z } ] = E [ \operatorname* { m a x } _ { i } e ^ { t X _ { i } } ] } \\ { \le \displaystyle \sum _ { i = 1 } ^ { B } \mathbb { E } [ e ^ { t X _ { i } } ] = n e ^ { t ^ { 2 } \frac { \sigma ^ { 2 } } { 2 } } } \end{array}
427
+ $$
428
+
429
+ Eq.(21) leads to
430
+
431
+ $$
432
+ \mathbb { E } [ Z ] \leq \frac { \ln B } { t } + \frac { t \sigma ^ { 2 } } { 2 } .
433
+ $$
434
+
435
+ Let t = 2 ln B and we obtain the following upper bound.
436
+
437
+ $$
438
+ \mathbb { E } [ Z ] \le \sigma \sqrt { 2 \ln B }
439
+ $$
440
+
441
+ Hence, the upper bound of the expectation of the maximal sentence length among all the √ $B$ sentences in each mini-batch is $\sigma { \sqrt { 2 \ln B } } + \mu$ . Therefore, the block length $r$ is computed by
442
+
443
+ $$
444
+ r = { \sqrt [ 3 ] { 2 n } } = { \sqrt [ 3 ] { 2 ( \sigma { \sqrt { 2 \ln B } } + \mu ) } } .
445
+ $$
446
+
447
+ # B NETWORK SETUP FOR MACHINE COMPREHENSION
448
+
449
+ Each sample in the Stanford Question Answering Dataset (SQuAD) (Rajpurkar et al., 2016) is composed of three parts, i.e., a passage consisting of multiple sentences, a question sentence and a span in the passage indicating the position of the answer. In order to evaluate the performance of sentence embedding models, we change the task from predicting the span of the answer to finding the sentence containing the correct answer.
450
+
451
+ Given a passage consisting of $m$ sentences $\left[ s ^ { 1 } , s ^ { 2 } , \ldots , s ^ { m } \right]$ where $\pmb { s } ^ { k } = [ x _ { k 1 } , x _ { k 2 } , \pmb { . . . } , x _ { k n } ]$ , and the embedded question token sequence $\pmb { q } = [ q _ { 1 } , q _ { 2 } , \dots , q _ { l } ]$ , the goal is to predict which sentence in the $m$ sentences contains the correct answer to the question $\pmb q$ .
452
+
453
+ The neural net we use to evaluate different sequence encoding models is given in Figure 7. First, we process each sentence from the passage by a context fusion layer with shared parameters, followed by a source2token self-attention with shared parameters, which outputs a vector representation of the sentence. Therefore, the $m$ sentences are represented by $m$ vectors $[ u _ { 1 } , u _ { 2 } , \ldots , u _ { m } ]$ . The question sentence $\pmb q$ is compressed into a vector representation $q$ using source2token self-attention. Second, we combine each sentence $u _ { k }$ with $q$ by concatenating $u _ { k }$ , q, $u _ { k } - q$ and $u _ { k } \odot q$ , i.e.,
454
+
455
+ $$
456
+ c _ { k } = [ u _ { k } ; q ; u _ { k } - q ; u _ { k } \odot q ] , \mathrm { f o r } \ k = 1 , 2 , \ldots , m .
457
+ $$
458
+
459
+ Then $\pmb { c } = [ c _ { 1 } , c _ { 2 } , \dots , c _ { m } ]$ is fed into another context fusion layer that explores sentence-level dependencies. Finally, the resultant output representation of each sentence is separately fed into a fully connected layer to compute a scalar score indicating the possibility of the sentence containing the answer. A softmax function is applied to the scores of all $m$ sentences, to generate a probability distribution $\hat { p } \in \mathbb { R } ^ { m }$ for cross-entropy loss function. The sentence with the largest probability is predicted as the sentence containing the answer.
460
+
461
+ ![](images/e071f8f33f303b03d9f2570c0c0c36eee33ed3c64dd170e7bd80ec35924fccd1.jpg)
462
+ Figure 7: The structure of a neural network for machine comprehension. The candidates of the context fusion layer include Bi-LSTM, Bi-GRU, Bi-SRU, multi-CNN, multi-head attention and Bi-BloSA. Unlike the original multi-CNN for sentence embedding, we use padding and remove the max-pooling along the time axis to obtain an output of the same length as input. DiSA is not considered due to memory limitation.
463
+
464
+ # C LOSS OF REGRESSION PROBLEM
465
+
466
+ Following the setting introduced by Tai et al. (2015) and given a predicted probability distribution $\hat { p }$ as the output of a feedforward network, the regression model predicts the similarity degree as
467
+
468
+ $$
469
+ \hat { y } = \beta ^ { T } \hat { p } ,
470
+ $$
471
+
472
+ where $\beta = [ 1 , 2 , \dots , K ]$ . The ground-truth similarity degree $y$ should be mapped to a probability distribution $p = [ p _ { i } ] _ { i = 1 } ^ { K }$ as the training target, where $p$ needs to fulfill $y = \beta ^ { \hat { T } } \overset { \cdot } { p }$ . The mapping can be defined as
473
+
474
+ $$
475
+ p _ { i } = { \left\{ \begin{array} { l l } { y - \lfloor y \rfloor , } & { i = \lfloor y \rfloor + 1 } \\ { \lfloor y \rfloor - y + 1 , } & { i = \lfloor y \rfloor } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. } , i = 1 , 2 , \ldots , K .
476
+ $$
477
+
478
+ We use KL-divergence between $p$ and $\hat { p }$ as our loss function, i.e.,
479
+
480
+ $$
481
+ L = \frac { 1 } { M } \sum _ { k = 1 } ^ { M } K L ( p ^ { ( k ) } | | \hat { p } ^ { ( k ) } ) ,
482
+ $$
483
+
484
+ where the $p ^ { ( k ) }$ and $\hat { p } ^ { ( k ) }$ represent the target and predicted probability distributions of the $k$ -th sample, respectively.
485
+
486
+ # D RELATED WORKS
487
+
488
+ Recently, several structured attention mechanisms (Kim et al., 2017; Kokkinos & Potamianos, 2017) are proposed for capturing structural information from input sequence(s). When applied to selfattention, structured attentions share a similar idea to self-alignment attention (Hu et al., 2017) and multi-head attention (Vaswani et al., 2017) with one head, which aims to model the dependencies between the tokens. Similar to the attention from multiple perspectives in multi-head attention, multi-perspective context matching (Wang et al., 2016) explores the dependencies between passage and question from multiple perspectives for reading comprehension, while self-attentive structure (Lin et al., 2017) embeds sentences from various perspectives to produce matrix representations of the sentences. In recursive models, self-attention over children nodes (Teng & Zhang, 2017) can provide effective input for their parent node that has no standard input (Tai et al., 2015) as long as it is a non-leaf node in a semantic constituency parsing tree. Li et al. (2017) applies the multi-hop attention mechanism to transfer learning for cross-domain sentiment analysis without any RNN/CNN structure.
489
+
490
+ Bi-BloSA and hierarchical attention network (Yang et al., 2016) have similar structure, i.e., both stack two-layer attention mechanisms from bottom to top. However, they are different in three respects: 1) Bi-BloSA aims to learn context-aware representation for each token, while hierarchical attention is designed for document embedding; 2) the input of Bi-BloSA is a sentence, while the intput of hierarchical attention is a document composed of multiple sentences; and 3) the hierarchical attention performs vanilla attention twice, i.e., token-level attention on each sentence and sentence-level attention. Bi-BloSA, however, applies masked self-attention twice, i.e., intra-block self-attention and inter-block self-attention. Additionally, Bi-BloSA uses a feature fusion gate for each token to combine local and global context, and positional masks to encode temporal order information.
md/train/H1lj0nNFwB/H1lj0nNFwB.md ADDED
@@ -0,0 +1,870 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # THE IMPLICIT BIAS OF DEPTH: HOW INCREMENTAL LEARNING DRIVES GENERALIZATION
2
+
3
+ Daniel Gissin, Shai Shalev-Shwartz, Amit Daniely
4
+ School of Computer Science
5
+ The Hebrew University
6
+ Jerusalem, Israel
7
+ {daniel.gissin,shais,amit.daniely}@mail.huji.ac.il
8
+
9
+ # ABSTRACT
10
+
11
+ A leading hypothesis for the surprising generalization of neural networks is that the dynamics of gradient descent bias the model towards simple solutions, by searching through the solution space in an incremental order of complexity. We formally define the notion of incremental learning dynamics and derive the conditions on depth and initialization for which this phenomenon arises in deep linear models. Our main theoretical contribution is a dynamical depth separation result, proving that while shallow models can exhibit incremental learning dynamics, they require the initialization to be exponentially small for these dynamics to present themselves. However, once the model becomes deeper, the dependence becomes polynomial and incremental learning can arise in more natural settings. We complement our theoretical findings by experimenting with deep matrix sensing, quadratic neural networks and with binary classification using diagonal and convolutional linear networks, showing all of these models exhibit incremental learning.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Neural networks have led to a breakthrough in modern machine learning, allowing us to efficiently learn highly expressive models that still generalize to unseen data. The theoretical reasons for this success are still unclear, as the generalization capabilities of neural networks defy the classic statistical learning theory bounds. Since these bounds, which depend solely on the capacity of the learned model, are unable to account for the success of neural networks, we must examine additional properties of the learning process. One such property is the optimization algorithm - while neural networks can express a multitude of possible ERM solutions for a given training set, gradient-based methods with the right initialization may be implicitly biased towards certain solutions which generalize.
16
+
17
+ A possible way such an implicit bias may present itself, is if gradient-based methods were to search the hypothesis space for possible solutions of gradually increasing complexity. This would suggest that while the hypothesis space itself is extremely complex, our search strategy favors the simplest solutions and thus generalizes. One of the leading results along these lines has been by Saxe et al. (2013), deriving an analytical solution for the gradient flow dynamics of deep linear networks and showing that for such models, the singular values converge at different rates, with larger values converging first. At the limit of infinitesimal initialization of the deep linear network, Gidel et al. (2019) show these dynamics exhibit a behavior of “incremental learning” - the singular values of the model are learned separately, one at a time. Our work generalizes these results to small but finite initialization scales.
18
+
19
+ Incremental learning dynamics have also been explored in gradient descent applied to matrix completion and sensing with a factorized parameterization (Gunasekar et al. (2017), Arora et al. (2018), Woodworth et al. (2019)). When initialized with small Gaussian weights and trained with a small learning rate, such a model is able to successfully recover the low-rank matrix which labeled the data, even if the problem is highly over-determined and no additional regularization is applied. In their proof of low-rank recovery for such models, Li et al. (2017) show that the model remains lowrank throughout the optimization process, leading to the successful generalization. Additionally,
20
+
21
+ ![](images/14126dc03eaae57887ee79a34684cde80a2ac3af64c8443f5095c0fc7eaad71c.jpg)
22
+ Figure 1: Incremental learning dynamics in deep models. Each panel shows the evolution of the five largest values of $\sigma$ , the parameters of the induced model. All models were trained using gradient descent with a small initialization and learning rate, on a small training set such that there are multiple possible solutions. In all cases, the deep parameterization of the models lead to “incremental learning”, where the values are learned at different rates (larger values are learned first), leading to sparse solutions. (a) Depth 4 matrix sensing, $\sigma$ denotes singular values (see section 4.1). (b) Quadratic networks, $\sigma$ denotes singular values (see section 4.2). (c) Depth 3 diagonal networks, $\sigma$ denotes feature weights (see section 4.3). (d) Depth 3 circular-convolutional networks, $\sigma$ denotes amplitudes in the frequency domain of the feature weights (see appendix G).
23
+
24
+ Arora et al. (2019) explore the dynamics of such models, showing the singular values are learned at different rates and that deeper models exhibit stronger incremental learning dynamics. Our work deals with a more simplified setting, allowing us to determine explicitly under which conditions depth leads to this dynamical phenomenon.
25
+
26
+ Finally, the learning dynamics of nonlinear models have been studied as well. Combes et al. (2018) and Williams et al. (2019) study the gradient flow dynamics of shallow ReLU networks under restrictive distributional assumptions, Ronen et al. (2019) show that shallow networks learn functions of gradually increasing frequencies and Nakkiran et al. (2019) show how deep ReLU networks correlate with linear classifiers in the early stages of training.
27
+
28
+ These findings, along with others, suggest that the generalization ability of deep networks is at least in part due to the incremental learning dynamics of gradient descent. Following this line of work, we begin by explicitly defining the notion of incremental learning for a toy model which exhibits this sort of behavior. Analyzing the dynamics of the model for gradient flow and gradient descent, we characterize the effect of the model’s depth and initialization scale on incremental learning, showing how deeper models allow for incremental learning in larger (realistic) initialization scales. Specifically, we show that a depth-2 model requires exponentially small initialization for incremental learning to occur, while deeper models only require the initialization to be polynomially small.
29
+
30
+ Once incremental learning has been defined and characterized for the toy model, we generalize our results theoretically and empirically for larger linear and quadratic models. Examples of incremental learning in these models can be seen in figure 1, which we discuss further in section 4.
31
+
32
+ # 2 DYNAMICAL ANALYSIS OF A TOY MODEL
33
+
34
+ We begin by analyzing incremental learning for a simple model. This will allow us to gain a clear understanding of the phenomenon and the conditions for it, which we will later be able to apply to a variety of other models in which incremental learning is present.
35
+
36
+ # 2.1 PRELIMINARIES
37
+
38
+ Our simple linear model will be similar to the toy model analyzed by Woodworth et al. (2019). Our input space will be $\mathcal { X } = \mathbb { R } ^ { d }$ and the hypothesis space will be linear models with non-negative weights, such that:
39
+
40
+ $$
41
+ f _ { \sigma } ( { \boldsymbol { x } } ) = \langle \sigma , { \boldsymbol { x } } \rangle \qquad \sigma \in \mathbb { R } _ { \geq 0 } ^ { d }
42
+ $$
43
+
44
+ We will introduce depth into our model, by parameterizing $\sigma$ using $w \in \mathbb { R } _ { \geq 0 } ^ { d }$ in the following way:
45
+
46
+ $$
47
+ \forall i : \sigma _ { i } = w _ { i } ^ { N }
48
+ $$
49
+
50
+ Where $N$ represents the depth of the model. Since we restrict the model to having non-negative weights, this parameterization doesn’t change the expressiveness, but it does radically change it’s optimization dynamics.
51
+
52
+ Assuming the data is labeled by some $\sigma ^ { * } \in \mathbb { R } _ { \geq 0 } ^ { d }$ , we will study the dynamics of this model for general under a depth-normalized1 squared loss over Gaussian inputs, which will allow us to derive our analytical solution:
53
+
54
+ $$
55
+ \ell _ { N } ( w ) = \frac { 1 } { 2 N ^ { 2 } } \mathbb { E } _ { x } [ ( \langle \sigma ^ { * } , x \rangle - \langle w ^ { N } , x \rangle ) ^ { 2 } ] = \frac { 1 } { 2 N ^ { 2 } } | | w ^ { N } - \sigma ^ { * } | | ^ { 2 }
56
+ $$
57
+
58
+ We will assume that our model is initialized uniformly with a tunable scaling factor, such that:
59
+
60
+ $$
61
+ \forall i : \ w _ { i } ( 0 ) = \ \sqrt [ N ] { \sigma _ { 0 } }
62
+ $$
63
+
64
+ # 2.2 GRADIENT FLOW ANALYTICAL SOLUTIONS
65
+
66
+ Analyzing our toy model using gradient flow allows us to obtain an analytical solution for the dynamics of $\sigma ( t )$ along with the dynamics of the loss function for a general $N$ . For brevity, the following theorem refers only to $N = 1 , 2$ and $N \to \infty$ , however the solutions for $3 \leq N < \infty$ are similar in structure to $N \to \infty$ , but more complicated. We also assume $\sigma _ { i } ^ { * } > 0$ for brevity, however we can derive the solutions for $\sigma _ { i } ^ { * } = 0$ as well. Note that this result is a special case adaptation of the one presented in Saxe et al. (2013) for deep linear networks:
67
+
68
+ Theorem 1. Minimizing the toy linear model described in (1) with gradient flow over the depth normalized squared loss (2), with Gaussian inputs and weights initialized as in (3) and assuming $\sigma _ { i } ^ { * } > 0$ leads to the following analytical solutions for different values of $N$ :
69
+
70
+ $$
71
+ \begin{array} { r l } & { \begin{array} { r l } { N = 1 : } & { \sigma _ { i } ( t ) = \sigma _ { i } ^ { * } + ( \sigma _ { 0 } - \sigma _ { i } ^ { * } ) e ^ { - t } } \\ { N = 2 : } & { \sigma _ { i } ( t ) = \frac { \sigma _ { 0 } \sigma _ { i } ^ { * } e ^ { \sigma _ { i } ^ { * } t } } { \sigma _ { 0 } \left( e ^ { \sigma _ { i } ^ { * } t } - 1 \right) + \sigma _ { i } ^ { * } } } \end{array} } \\ & { \begin{array} { r l } { N \to \infty : } & { t = \frac { 1 } { ( \sigma _ { i } ^ { * } ) ^ { 2 } } \log \big ( \frac { \sigma _ { i } ( t ) ( \sigma _ { 0 } - \sigma _ { i } ^ { * } ) } { \sigma _ { 0 } \left( \sigma _ { i } ( t ) - \sigma _ { i } ^ { * } \right) } \big ) - \frac { 1 } { \sigma _ { i } ^ { * } } \big ( \frac { 1 } { \sigma _ { i } ( t ) } - \frac { 1 } { \sigma _ { 0 } } \big ) } \end{array} } \end{array}
72
+ $$
73
+
74
+ Proof. The gradient flow equations for our model are the following:
75
+
76
+ $$
77
+ \dot { w } _ { i } = - \nabla _ { w _ { i } } \ell = \frac { 1 } { N } w _ { i } ^ { N - 1 } ( \sigma _ { i } ^ { * } - w _ { i } ^ { N } )
78
+ $$
79
+
80
+ Given the dynamics of the $w$ parameters, we may use the chain rule to derive the dynamics of the induced model, $\sigma$ :
81
+
82
+ $$
83
+ \dot { \sigma } _ { i } = \frac { d \sigma _ { i } } { d w _ { i } } \dot { w } _ { i } = w ^ { 2 N - 2 } ( \sigma _ { i } ^ { * } - w _ { i } ^ { N } ) = \sigma _ { i } ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } )
84
+ $$
85
+
86
+ This differential equation is solvable for all $N$ , leading to the solutions in the theorem. Taking $N \to \infty$ in (4) leads to $\dot { \sigma } _ { i } = \sigma _ { i } ^ { 2 } ( \sigma _ { i } ^ { * } - \sigma _ { i } )$ , which is also solvable.
87
+
88
+ ![](images/c32e4b6822cc4e3b3801507a0f18a13c9706cba7f76cc5695c9ee740ff4a57cf.jpg)
89
+ Figure 2: Incremental learning dynamics in the toy model. Each panel shows the evolution of $\frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } }$ for $\sigma _ { i } ^ { * } \in \{ 1 2 , 6 , 4 , 3 \}$ according to the analytical solutions in theorem 1, under different depths and initializations. The first column has all values converging at the same rate. Notice how the deep parameterization with small initialization leads to distinct phases of learning, where values are learned incrementally (bottom-right). The shallow model’s much weaker incremental learning, even at small initialization scales (second column), is explained in theorem 2.
90
+
91
+ Analyzing these solutions, we see how even in such a simple model depth causes different factors of the model to be learned at different rates. Specifically, values corresponding to larger optimal values converge faster, suggesting a form of incremental learning. This is most clear for $N = 2$ where the solution isn’t implicit, but is also the case for $N \geq 3$ , as we will see in the next subsection.
92
+
93
+ These dynamics are depicted in figure 2, where we see the dynamics of the different values of $\sigma ( t )$ as learning progresses. When $N = 1$ , all values are learned at the same rate regardless of the initialization, while the deeper models are clearly biased towards learning the larger singular values first, especially at small initialization scales.
94
+
95
+ Our model has only one optimal solution due to the population loss, but it is clear how this sort of dynamic can induce sparse solutions - if the model is able to fit the data after a small amount of learning phases, then it’s obtained result will be sparse. Alternatively, if $N = 1$ , we know that the dynamics will lead to the minimal $\ell _ { 2 }$ norm solution which is dense. We explore the sparsity inducing bias of our toy model by comparing it empirically2 to a greedy sparse approximation algorithm in appendix D, and give our theoretical results in the next section.
96
+
97
+ # 3 INCREMENTAL LEARNING
98
+
99
+ Equipped with analytical solutions for the dynamics of our model for every depth, we turn to study how the depth and initialization effect incremental learning. While Gidel et al. (2019) focuses on incremental learning in depth-2 models at the limit of $\sigma _ { 0 } 0$ , we will study the phenomenon for a general depth and for $\sigma _ { 0 } > 0$ .
100
+
101
+ First, we will define the notion of incremental learning. Since all values of $\sigma$ are learned in parallel, we can’t expect one value to converge before the other moves at all (which happens for infinitesimal initialization as shown by Gidel et al. (2019)). We will need a more relaxed definition for incremental learning in finite initialization scales.
102
+
103
+ Definition 1. Given two values $\sigma _ { i } , \sigma _ { j }$ such that $\sigma _ { i } ^ { * } > \sigma _ { j } ^ { * } > 0$ and both are initialized as $\sigma _ { i } ( 0 ) =$ $\sigma _ { j } ( 0 ) = \sigma _ { 0 } < \sigma _ { j } ^ { * }$ , and given two scalars $s \in ( 0 , \frac { 1 } { 4 } )$ and $f \in \left( \frac { 3 } { 4 } , 1 \right)$ , we call the learning of the values $( s , f )$ -incremental if there exists a t for which:
104
+
105
+ $$
106
+ \sigma _ { j } ( t ) \leq s \sigma _ { j } ^ { * } < f \sigma _ { i } ^ { * } \leq \sigma _ { i } ( t )
107
+ $$
108
+
109
+ In words, two values have distinct learning phases if the first almost converges $( f \approx 1 )$ before the second changes by much $s \ll 1 \ r _ { \cdot }$ ). Note that for any $N , \sigma ( t )$ is monotonically increasing and so once $\sigma _ { j } ( t ) = s \sigma _ { j } ^ { * }$ , it will not decrease to allow further incremental learning. Given this definition of incremental learning, we turn to study the conditions that facilitate incremental learning in our toy model.
110
+
111
+ Our main result is a dynamical depth separation result, showing that incremental learning is dependent on $\frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } }$ in different ways for different values of $N$ . The largest difference in dependence happens between $N = 2$ and $N = 3$ , where the dependence changes from exponential to polynomial:
112
+
113
+ Theorem 2. Given two values $\sigma _ { i } , \sigma _ { j }$ of a toy linear model as in (1), where $\begin{array} { r } { \frac { { \sigma } _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ and the model is initialized as in (3), and given two scalars $s \in ( 0 , \frac { 1 } { 4 } )$ and $f \in \left( \frac { 3 } { 4 } , 1 \right)$ , then the largest initialization value for which the learning phases of the values are $( s , f )$ -incremental, denoted $\sigma _ { 0 } ^ { t h }$ , is bounded in the following way:
114
+
115
+ $$
116
+ \begin{array} { r l r } { s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { s } { r f } \Big ) ^ { \frac { 1 } { ( 1 - f ) ( r - 1 ) } } } & { \le \sigma _ { 0 } ^ { t h } \le s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { s } { r f } \Big ) ^ { \frac { 1 - s } { r - 1 } } } & { \qquad } & { N = 2 } \\ { s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { ( 1 - f ) ( r - 1 ) } { 1 + ( 1 - f ) ( r - 1 ) } \Big ) ^ { \frac { N } { N - 2 } } } & { \le \sigma _ { 0 } ^ { t h } \le s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { r - 1 } { r - s } \Big ) ^ { \frac { N } { N - 2 } } } & { \qquad } & { N \ge 3 } \end{array}
117
+ $$
118
+
119
+ Proof sketch (the full proof is given in appendix $A$ ). Rewriting the separable differential equation in (4) to calculate the time until $\sigma ( t ) = \alpha \sigma ^ { * }$ , we get the following:
120
+
121
+ $$
122
+ t _ { \alpha } ( \sigma ) = \int _ { \sigma _ { 0 } } ^ { \alpha \sigma ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma ^ { * } - \sigma ) }
123
+ $$
124
+
125
+ The condition for incremental learning is then the requirement that $t _ { f } ( \sigma _ { i } ) \leq t _ { s } ( \sigma _ { j } )$ , resulting in:
126
+
127
+ $$
128
+ \int _ { \sigma _ { 0 } } ^ { f \sigma _ { i } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma ) } \le \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma _ { j } ^ { * } - \sigma ) }
129
+ $$
130
+
131
+ We then relax/restrict the above condition to get a necessary/sufficient condition on $\sigma _ { 0 }$ , leading to a lower and upper bound on $\sigma _ { 0 } ^ { t h }$ .
132
+
133
+ Note that the value determining the condition for incremental learning is $\frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } }$ same order of magnitude, then their ratio will be close to 1 and we will need a small initialization to obtain incremental learning. The dependence on the ratio changes with depth, and is exponential for $N = 2$ . This means that incremental learning, while possible for shallow models, is difficult to see in practice. This result explains why changing the initialization scale in figure 2 changes the dynamics of the $N \geq 3$ models, while not changing the dynamics for $N = 2$ noticeably.
134
+
135
+ The next theorem extends part of our analysis to gradient descent, a more realistic setting than the infinitesimal learning rate of gradient flow:
136
+
137
+ Theorem 3. Given two values $\sigma _ { i } , \sigma _ { j }$ of a depth-2 toy linear model as in (1), such that $\begin{array} { r } { \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ and the model is initialized as in (3), and given two scalars $s \in ( 0 , \frac { 1 } { 4 } )$ and $f \in ( \frac { 3 } { 4 } , 1 )$ , and assuming $\sigma _ { j } ^ { * } ~ \geq ~ 2 \sigma _ { 0 }$ , and assuming we optimize with gradient descent with a learning rate $\begin{array} { r } { \eta \ \leq \ \frac { c } { \sigma _ { 1 } ^ { * } } } \end{array}$ for $c < 2 ( { \sqrt { 2 } } - 1 )$ and $\sigma _ { 1 } ^ { * }$ the largest value of $\sigma ^ { * }$ , then the largest initialization value for which the learning phases of the values are $( s , f )$ -incremental, denoted $\sigma _ { 0 } ^ { t h }$ , is lower and upper bounded in the following way:
138
+
139
+ $$
140
+ \frac { 1 } { 2 } \frac { s } { 1 - s } \sigma _ { j } ^ { * } \Bigl ( \frac { 1 - f } { 2 r f } \frac { s } { 1 - s } \Bigr ) ^ { \frac { 1 } { A - 1 } } \leq \sigma _ { 0 } ^ { t h } \leq \frac { s } { 1 - s } \sigma _ { j } ^ { * } \Bigl ( \frac { 1 - f } { f } \frac { s } { 1 - s } \Bigr ) ^ { \frac { 1 } { B - 1 } }
141
+ $$
142
+
143
+ Where $A$ and $B$ are defined as:
144
+
145
+ $$
146
+ A = \frac { \log \left( 1 - c \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } + c ^ { 2 } \big ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } { \log \left( 1 - c \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } - \frac { c ^ { 2 } } { 4 } \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } \qquad B = \frac { \log \left( 1 - c \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } - \frac { c ^ { 2 } } { 4 } \big ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } { \log \left( 1 - c \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } + c ^ { 2 } \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) }
147
+ $$
148
+
149
+ We defer the proof to appendix B.
150
+
151
+ Note that this result, while less elegant than the bounds of the gradient flow analysis, is similar in nature. Both $A$ and $B$ simplify to $r$ when we take their first order approximation around $c = 0$ , giving us similar bounds and showing that the condition on $\sigma _ { 0 }$ for $N = 2$ is exponential in gradient descent as well.
152
+
153
+ While similar gradient descent results are harder to obtain for deeper models, we discuss the general effect of depth on the gradient decent dynamics in appendix C.
154
+
155
+ # 4 INCREMENTAL LEARNING IN LARGER MODELS
156
+
157
+ So far, we have only shown interesting properties of incremental learning caused by depth for a toy model. In this section, we will relate several deep models to our toy model and show how incremental learning presents itself in larger models as well.
158
+
159
+ # 4.1 MATRIX SENSING
160
+
161
+ The task of matrix sensing is a generalization of matrix completion, where our input space is $\mathcal { X } =$ $\mathbb { R } ^ { d \times d }$ and our model is a matrix $\mathbf { \bar { \boldsymbol { W } } } \in \mathbb { R } ^ { d \times d }$ , such that:
162
+
163
+ $$
164
+ f _ { W } ( A ) = \langle W , A \rangle = t r \big ( W ^ { T } A \big )
165
+ $$
166
+
167
+ Following Arora et al. (2019), we introduce depth by parameterizing the model using a product of matrices and the following initialization scheme $( W _ { i } ^ { \setminus } \in \mathbb { R } ^ { d \times d } )$ ):
168
+
169
+ $$
170
+ \begin{array} { c } { { W = W _ { N } W _ { N - 1 } \cdot \cdot \cdot W _ { 1 } } } \\ { { \forall i \in [ N ] , ~ W _ { i } ( 0 ) = ~ \sqrt [ N ] { \sigma _ { 0 } } I } } \end{array}
171
+ $$
172
+
173
+ Note that when $d = 1$ , the deep matrix sensing model reduces to our toy model without weight sharing. We study the dynamics of the model under gradient flow over a depth-normalized squared loss, assuming the data is labeled by a matrix sensing model parameterized by a PSD $W ^ { \ast } \in \mathring { \mathbb { R } } ^ { d \times d }$ :
174
+
175
+ $$
176
+ \begin{array} { c } { \displaystyle \ell _ { N } ( W _ { N } W _ { N - 1 } \cdot \cdot \cdot W _ { 1 } ) = \displaystyle \frac { 1 } { 2 N } \mathbb { E } _ { A } [ ( \langle \left( W _ { N } W _ { N - 1 } \cdot \cdot \cdot W _ { 1 } \right) - W ^ { * } , A \rangle ^ { 2 } ] } \\ { = \displaystyle \frac { 1 } { 2 N } | | \big ( W _ { N } W _ { N - 1 } \cdot \cdot \cdot W _ { 1 } \big ) - W ^ { * } | | _ { F } ^ { 2 } } \end{array}
177
+ $$
178
+
179
+ The following theorem relates the deep matrix sensing model to our toy model, showing the two have the same dynamical equations:
180
+
181
+ Theorem 4. Optimizing the deep matrix sensing model described in (5) with gradient flow over the depth normalized squared loss ((6)), with weights initialized as in (5) leads to the following dynamical equations for different values of $N$ :
182
+
183
+ $$
184
+ \dot { \sigma } _ { i } ( t ) = \sigma _ { i } ( t ) ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) )
185
+ $$
186
+
187
+ Where $\sigma _ { i }$ and $\sigma _ { i } ^ { * }$ are the ith singular values of $W$ and $W ^ { * }$ , respectively, corresponding to the same singular vector.
188
+
189
+ The proof follows that of Saxe et al. (2013) and Gidel et al. (2019) and is deferred to appendix E.
190
+
191
+ Theorem 4 shows us that the bias towards sparse solutions introduced by depth in the toy model is equivalent to the bias for low-rank solutions in the matrix sensing task. This bias was studied in a more general setting in Arora et al. (2019), with empirical results supporting the effect of depth on the obtainment of low-rank solutions under a more natural loss and initialization scheme. We recreate and discuss these experiments and their connection to our analysis in appendix E, and an example of these dynamics in deep matrix sensing can also be seen in panel (a) of figure 1.
192
+
193
+ # 4.2 QUADRATIC NEURAL NETWORKS
194
+
195
+ By drawing connections between quadratic networks and matrix sensing (as in Soltanolkotabi et al. (2018)), we can extend our results to these nonlinear models. We will study a simplified quadratic network, where our input space is $\mathcal { X } = \mathbb { R } ^ { d }$ and the first layer is parameterized by a weight matrix $W \in \mathbb { R } ^ { d \times d }$ and followed by a quadratic activation function. The final layer will be a summation layer. We assume, like before, that the labeling function is a quadratic network parameterized by $\bar { W } ^ { * } \in \mathbb { R } ^ { d \times d }$ . Our model can be written in the following way, using the following orthogonal initialization scheme:
196
+
197
+ $$
198
+ \begin{array} { r l } & { f _ { W } ( x ) = \displaystyle \sum _ { i = 1 } ^ { d } ( w _ { i } ^ { T } x ) ^ { 2 } = x ^ { T } W ^ { T } W x = \langle W ^ { T } W , x x ^ { T } \rangle } \\ & { W _ { 0 } ^ { T } W _ { 0 } = \sigma _ { 0 } I } \end{array}
199
+ $$
200
+
201
+ Immediately, we see the similarity of the quadratic network to the deep matrix sensing model with $N = 2$ , where the input space is made up of rank-1 matrices. However, the change in input space forces us to optimize over a different loss function to reproduce the same dynamics:
202
+
203
+ Definition 2. Given an input distribution over an input space $\mathcal { X }$ with a labeling function $y : \mathcal { X } \mathbb { R }$ and a hypothesis $h$ , the variance loss is defined in the following way:
204
+
205
+ $$
206
+ \ell _ { v a r } ( h ) = \frac { 1 } { 1 6 } \mathbb { E } _ { x } [ ( y ( x ) - h ( x ) ) ^ { 2 } ] - \frac { 1 } { 1 6 } \mathbb { E } _ { x } [ y ( x ) - h ( x ) ] ^ { 2 }
207
+ $$
208
+
209
+ Note that minimizing this loss function amounts to minimizing the variance of the error, while the squared loss minimizes the second moment of the error. We note that both loss functions have the same minimum for our problem, and the dynamics of the squared loss can be approximated in certain cases by the dynamics of the variance loss. For a complete discussion of the two losses, including the cases where the two losses have similar dynamics, we refer the reader to appendix F.
210
+
211
+ Theorem 5. Minimizing the quadratic network described and initialized as in (7) with gradient flow over the variance loss defined in (2) leads to the following dynamical equations:
212
+
213
+ $$
214
+ \dot { \sigma } _ { i } ( t ) = \sigma _ { i } ( t ) ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) )
215
+ $$
216
+
217
+ Where $\sigma _ { i }$ and $\sigma _ { i } ^ { * }$ are the ith singular values of $W$ and $W ^ { * }$ , respectively, corresponding to the same singular vector.
218
+
219
+ We defer the proof to appendix F and note that these dynamics are the same as our depth-2 toy model, showing that shallow quadratic networks can exhibit incremental learning (albeit requiring a small initialization).
220
+
221
+ # 4.3 DIAGONAL/CONVOLUTIONAL LINEAR NETWORKS
222
+
223
+ While incremental learning has been described for deep linear networks in the past, it has been restricted to regression tasks. Here, we illustrate how incremental learning presents itself in binary classification, where implicit bias results have so far focused on convergence at $t \to \infty$ (Soudry et al. (2018), Nacson et al. (2018), Ji & Telgarsky (2019)). Deep linear networks with diagonal weight matrices have been shown to be biased towards sparse solutions when $N > 1$ in Gunasekar et al. (2018), and biased towards the max-margin solution for $N = 1$ . Instead of analyzing convergence at $t \infty$ , we intend to show that the model favors sparse solutions for the entire duration of optimization, and that this is due to the dynamics of incremental learning.
224
+
225
+ Our theoretical illustration will use our toy model as in (1) (initialized as in (3)) as a special weightshared case of deep networks with diagonal weight matrices, and we will then show empirical results for the more general setting. We analyze the optimization dynamics of this model over a separable dataset $\{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { m }$ where $y _ { i } \in \{ \pm 1 \}$ . We use the exponential loss $( \ell ( f ( x ) , y ) = e ^ { - y f ( x ) } )$ for the theoretical illustration and experiment on the exponential and logistic losses.
226
+
227
+ Computing the gradient for the model over $w$ , the gradient flow dynamics for $\sigma$ become:
228
+
229
+ $$
230
+ \dot { \sigma } _ { i } = \frac { N ^ { 2 } } { m } \sigma _ { i } ^ { 2 - \frac { 2 } { N } } \sum _ { j = 1 } ^ { m } e ^ { - y _ { j } \langle \beta , x _ { j } \rangle } x _ { j }
231
+ $$
232
+
233
+ We see the same dynamical attenuation of small values of $\sigma$ that is seen in the regression model, caused by the multiplication by σ2− 2N From this, we can expect the same type of incremental learning to occur - weights of $\sigma$ will be learned incrementally until the dataset can be separated by the current support of $\sigma$ . Then, the dynamics strengthen the growth of the current support while relatively attenuating that of the other values. Since the data is separated, increasing the values of the current support reduces the loss and the magnitude of subsequent gradients, and so we should expect the support to remain the same and the model to converge to a sparse solution.
234
+
235
+ Granted, the above description is just intuition, but panel (c) of figure 1 shows how it is born out in practice (similar results are obtained for the logistic loss). In appendix G we further explore this model, showing deeper networks have a stronger bias for sparsity. We also observe that the initialization scale plays a similar role as before - deep models are less biased towards sparsity when $\sigma _ { 0 }$ is large.
236
+
237
+ In their work, Gunasekar et al. (2018) show an equivalence between the diagonal network and the circular-convolutional network in the frequency domain. According to their results, we should expect to see the same sparsity-bias of diagonal networks in convolutional networks, when looking at the Fourier coefficients of $\sigma$ . An example of this can be seen in panel (d) of figure 1, and we refer the reader to appendix $\mathbf { G }$ for a full discussion of their convolutional model and it’s incremental learning dynamics.
238
+
239
+ # 5 CONCLUSION
240
+
241
+ Gradient-based optimization for deep linear models has an implicit bias towards simple (sparse) solutions, caused by an incremental search strategy over the hypothesis space. Deeper models have a stronger tendency for incremental learning, exhibiting it in more realistic initialization scales.
242
+
243
+ This dynamical phenomenon exists for the entire optimization process for regression as well as classification tasks, and for many types of models - diagonal networks, convolutional networks, matrix completion and even the nonlinear quadratic network. We believe this kind of dynamical analysis may be able to shed light on the generalization of deeper nonlinear neural networks as well, with shallow quadratic networks being only a first step towards that goal.
244
+
245
+ # ACKNOWLEDGMENTS
246
+
247
+ This research is supported by the European Research Council (TheoryDL project).
248
+
249
+ # REFERENCES
250
+
251
+ Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. arXiv preprint arXiv:1802.06509, 2018.
252
+
253
+ Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit regularization in deep matrix factorization. In Advances in Neural Information Processing Systems 32, pp. 7411–7422. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8960-implicit-regularization-in-deep-matrix-factorization.pdf.
254
+
255
+ Remi Tachet des Combes, Mohammad Pezeshki, Samira Shabanian, Aaron Courville, and Yoshua Bengio. On the learning dynamics of deep neural networks. arXiv preprint arXiv:1809.06848, 2018.
256
+
257
+ Gauthier Gidel, Francis Bach, and Simon Lacoste-Julien. Implicit regularization of discrete gradient dynamics in linear neural networks. In Advances in Neural Information Processing Systems, pp. 3196–3206, 2019.
258
+
259
+ Suriya Gunasekar, Blake E Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Implicit regularization in matrix factorization. In Advances in Neural Information Processing Systems, pp. 6151–6159, 2017.
260
+
261
+ Suriya Gunasekar, Jason D Lee, Daniel Soudry, and Nati Srebro. Implicit bias of gradient descent on linear convolutional networks. In Advances in Neural Information Processing Systems, pp. 9461–9471, 2018.
262
+
263
+ Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Conference on Learning Theory, pp. 1772–1798, 2019.
264
+
265
+ Yuanzhi Li, Tengyu Ma, and Hongyang Zhang. Algorithmic regularization in over-parameterized matrix sensing and neural networks with quadratic activations. arXiv preprint arXiv:1712.09203, 2017.
266
+
267
+ Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro HP Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. arXiv preprint arXiv:1803.01905, 2018.
268
+
269
+ Preetum Nakkiran, Gal Kaplun, Dimitris Kalimeris, Tristan Yang, Benjamin L Edelman, Fred Zhang, and Boaz Barak. Sgd on neural networks learns functions of increasing complexity. arXiv preprint arXiv:1905.11604, 2019.
270
+
271
+ Yagyensh Chandra Pati, Ramin Rezaiifar, and Perinkulam Sambamurthy Krishnaprasad. Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition. In Proceedings of 27th Asilomar conference on signals, systems and computers, pp. 40–44. IEEE, 1993.
272
+
273
+ Basri Ronen, David Jacobs, Yoni Kasten, and Shira Kritchman. The convergence rate of neural networks for learned functions of different frequencies. In Advances in Neural Information Processing Systems 32, pp. 4763–4772. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8723-the-convergence-rate-of-neural-networks-for-learned-functions-of-different-fr pdf.
274
+
275
+ Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
276
+
277
+ Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. IEEE Transactions on Information Theory, 65(2):742–769, 2018.
278
+
279
+ Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19 (1):2822–2878, 2018.
280
+
281
+ Francis Williams, Matthew Trager, Claudio Silva, Daniele Panozzo, Denis Zorin, and Joan Bruna. Gradient dynamics of shallow univariate relu networks. arXiv preprint arXiv:1906.07842, 2019.
282
+
283
+ Blake Woodworth, Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Kernel and deep regimes in overparametrized models. arXiv preprint arXiv:1906.05827, 2019.
284
+
285
+ # A PROOF OF THEOREM 2
286
+
287
+ Theorem. Given two values $\sigma _ { i } , \sigma _ { j }$ of a toy linear model as in (1), such that $\begin{array} { r } { \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ and the model is initialized as in (3), and given two scalars $s \in ( 0 , \frac { 1 } { 4 } )$ and $f \in \left( \frac { 3 } { 4 } , 1 \right)$ , then the largest initialization value for which the learning phases of the values are $( s , f )$ -incremental, denoted $\sigma _ { 0 } ^ { t h }$ , is lower and upper bounded in the following way:
288
+
289
+ $$
290
+ \begin{array} { r l r } { s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { s } { r f } \Big ) ^ { \frac { 1 } { ( 1 - f ) ( r - 1 ) } } } & { \le \sigma _ { 0 } ^ { t h } \le s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { s } { r f } \Big ) ^ { \frac { 1 - s } { r - 1 } } } & { \qquad } & { N = 2 } \\ { s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { ( 1 - f ) ( r - 1 ) } { 1 + ( 1 - f ) ( r - 1 ) } \Big ) ^ { \frac { N } { N - 2 } } } & { \le \sigma _ { 0 } ^ { t h } \le s \sigma _ { j } ^ { * } \Big ( \displaystyle \frac { r - 1 } { r - s } \Big ) ^ { \frac { N } { N - 2 } } } & { \qquad } & { N \ge 3 } \end{array}
291
+ $$
292
+
293
+ Proof. Our strategy will be to define the time $t _ { \alpha }$ for which a value reaches a fraction $\alpha$ of it’s optimal value, and then require that $t _ { f } ( \sigma _ { i } ) \leq t _ { s } ( \sigma _ { j } )$ . We begin with recalling the differential equation which determines the dynamics of the model:
294
+
295
+ $$
296
+ \dot { \sigma } = \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma ^ { * } - \sigma )
297
+ $$
298
+
299
+ Since the solution for $N \geq 3$ is implicit and difficult to manage in a general form, we will define $t _ { \alpha }$ using the integral of the differential equation. The equation is separable, and under initialization of $\sigma _ { 0 }$ we can describe $t _ { \alpha } ( \sigma )$ in the following way:
300
+
301
+ $$
302
+ t _ { \alpha } ( \sigma ) = \int _ { \sigma _ { 0 } } ^ { \alpha \sigma ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma ^ { * } - \sigma ) }
303
+ $$
304
+
305
+ Incremental learning takes place when $\sigma _ { i } ( t _ { f } ) = f \sigma _ { i } ^ { * }$ happens before $\sigma _ { j } ( t _ { s } ) = s \sigma _ { j } ^ { * }$ . We can write this condition in the following way:
306
+
307
+ $$
308
+ \int _ { \sigma _ { 0 } } ^ { f \sigma _ { i } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma ) } \le \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( \sigma _ { j } ^ { * } - \sigma ) }
309
+ $$
310
+
311
+ Plugging in $\sigma _ { i } = r \sigma _ { j }$ and rearranging, we get the following necessary and sufficient condition for incremental learning:
312
+
313
+ $$
314
+ \int _ { \sigma _ { 0 } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) } \leq r \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { \sigma _ { j } ^ { * } } ) }
315
+ $$
316
+
317
+ Our last step before relaxing and restricting our condition will be to split the integral on the left-hand side into two integrals:
318
+
319
+ $$
320
+ \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) } + \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) } \le r \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { \sigma _ { j } ^ { * } } ) }
321
+ $$
322
+
323
+ At this point, we cannot solve this equation and isolate $\sigma _ { 0 }$ to obtain a clear threshold condition on it for incremental learning. Instead, we will relax/restrict the above condition to get a necessary/sufficient condition on $\sigma _ { 0 }$ , leading to a lower and upper bound on the threshold value of $\sigma _ { 0 }$ .
324
+
325
+ # SUFFICIENT CONDITION
326
+
327
+ To obtain a sufficient (but not necessary) condition on $\sigma _ { 0 }$ , we may make the condition stricter either by increasing the left-hand side or decreasing the right-hand side. We can increase the left-hand side by removing $r$ from the left-most integral’s denominator $( r > 1 )$ ) and then combine the left-most and right-most integrals:
328
+
329
+ $$
330
+ \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) } \le ( r - 1 ) \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { \sigma _ { j } ^ { * } } ) }
331
+ $$
332
+
333
+ Next, we note that the integration bounds give us a bound on $\sigma$ for either integral. This means we can replace $\begin{array} { r } { 1 - \frac { \sigma } { \sigma _ { j } ^ { * } } } \end{array}$ with 1 on the right-hand side, and replace $\begin{array} { r } { 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } } \end{array}$ with $1 - f$ on the left-hand side:
334
+
335
+ $$
336
+ \frac { 1 } { 1 - f } \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } } \le ( r - 1 ) \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } }
337
+ $$
338
+
339
+ We may now solve these integrals for every $N$ and isolate $\sigma _ { 0 }$ , obtaining the lower bound on $\sigma _ { 0 } ^ { t h }$ . We start with the case where $N = 2$ :
340
+
341
+ $$
342
+ \frac { 1 } { 1 - f } \big ( \log ( f r \sigma _ { j } ^ { * } ) - \log ( s \sigma _ { j } ^ { * } ) \big ) \leq ( r - 1 ) \big ( \log ( s \sigma _ { j } ^ { * } ) - \log ( \sigma _ { 0 } ) \big )
343
+ $$
344
+
345
+ Rearranging to isolate $\sigma _ { 0 }$ , we obtain our result:
346
+
347
+ $$
348
+ \sigma _ { 0 } \leq s \sigma _ { j } ^ { * } \big ( { \frac { s } { r f } } \big ) ^ { \frac { 1 } { ( 1 - f ) ( r - 1 ) } }
349
+ $$
350
+
351
+ For the $N \geq 3$ case, we have the following after solving the integrals:
352
+
353
+ $$
354
+ \frac { 1 } { 1 - f } \Big ( \big ( \frac { 1 } { s \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } - \big ( \frac { 1 } { r f \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } \Big ) \leq ( r - 1 ) \Big ( \big ( \frac { 1 } { \sigma _ { 0 } } \big ) ^ { 1 - \frac { 2 } { N } } - \big ( \frac { 1 } { s \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } \Big )
355
+ $$
356
+
357
+ For simplicity we may further restrict the condition by removing the term $\Big ( \frac { 1 } { r f \sigma _ { j } ^ { * } } \Big ) ^ { 1 - \frac { 2 } { N } }$ 1− 2N . Solving for $\sigma _ { 0 }$ gives us the following:
358
+
359
+ $$
360
+ \sigma _ { 0 } \leq s \sigma _ { j } ^ { * } \Big ( \frac { ( 1 - f ) ( r - 1 ) } { 1 + ( 1 - f ) ( r - 1 ) } \Big ) ^ { \frac { N } { N - 2 } }
361
+ $$
362
+
363
+ # NECESSARY CONDITION
364
+
365
+ To obtain a necessary (but not sufficient) condition on $\sigma _ { 0 }$ , we may relax the condition in (8) either by decreasing the left-hand side or increasing the right-hand side. We begin by rearranging the equation:
366
+
367
+ $$
368
+ \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) } \leq r \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { \sigma _ { j } ^ { * } } ) } - \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } ( 1 - \frac { \sigma } { r \sigma _ { j } ^ { * } } ) }
369
+ $$
370
+
371
+ Like before, we may use the integration bounds to bound $\sigma$ . Plugging in $\sigma = s \sigma _ { j } ^ { * }$ for all integrals decreases the left-hand side and increases the right-hand side, leading us to the following:
372
+
373
+ $$
374
+ \frac { r } { r - s } \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } } \le \big ( \frac { r } { 1 - s } - \frac { r } { r - s } \big ) \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } }
375
+ $$
376
+
377
+ Rearranging, we get the following inequality:
378
+
379
+ $$
380
+ \int _ { s \sigma _ { j } ^ { * } } ^ { f r \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } } \leq \frac { r - 1 } { 1 - s } \int _ { \sigma _ { 0 } } ^ { s \sigma _ { j } ^ { * } } \frac { d \sigma } { \sigma ^ { 2 - \frac { 2 } { N } } }
381
+ $$
382
+
383
+ We now solve the integrals for the different cases. For $N = 2$ , we have:
384
+
385
+ $$
386
+ \log ( f r \sigma _ { j } ^ { * } ) - \log ( s \sigma _ { j } ^ { * } ) \leq \frac { r - 1 } { 1 - s } \Bigl ( \log ( s \sigma _ { j } ^ { * } ) - \log ( \sigma _ { 0 } ) \Bigr )
387
+ $$
388
+
389
+ Rearranging to isolate $\sigma _ { 0 }$ , we get our condition:
390
+
391
+ $$
392
+ \sigma _ { 0 } \leq s \sigma _ { j } ^ { * } \big ( \frac { s } { r f } \big ) ^ { \frac { 1 - s } { r - 1 } }
393
+ $$
394
+
395
+ Finally, for $N \geq 3$ , we solve the integrals to give us:
396
+
397
+ $$
398
+ \Big ( \big ( \frac { 1 } { s \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } - \big ( \frac { 1 } { r f \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } \Big ) \leq \frac { r - 1 } { 1 - s } \Big ( \big ( \frac { 1 } { \sigma _ { 0 } } \big ) ^ { 1 - \frac { 2 } { N } } - \big ( \frac { 1 } { s \sigma _ { j } ^ { * } } \big ) ^ { 1 - \frac { 2 } { N } } \Big )
399
+ $$
400
+
401
+ Rearranging to isolate $\sigma _ { 0 }$ , we get our condition:
402
+
403
+ $$
404
+ \sigma _ { 0 } \leq s \sigma _ { j } ^ { * } \Big ( \frac { r - 1 } { r - s } \Big ) ^ { \frac { N } { N - 2 } }
405
+ $$
406
+
407
+ SUMMARY
408
+
409
+ For a given $N$ , we derived a sufficient condition and a necessary condition on $\sigma _ { 0 }$ for $( s , f )$ - incremental learning. The necessary and sufficient condition on $\sigma _ { 0 }$ , which is the largest initialization value for which we see incremental learning (denoted $\sigma _ { 0 } ^ { t h \cdot }$ ), is between the two derived bounds.
410
+
411
+ The precise bounds can possibly be improved a bit, but the asymptotic dependence on $r$ is the crux of the matter, showing the dependence on $r$ changes with depth with a substantial difference when we move from shallow models $N = 2$ ) to deeper ones $( N \geq 3$ )
412
+
413
+ # B PROOF OF THEOREM 3
414
+
415
+ Theorem. Given two values $\sigma _ { i } , \sigma _ { j }$ of a depth-2 toy linear model as in (1), such that $\begin{array} { r } { \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ and the model is initialized as in (3), and given two scalars $s \in ( 0 , \frac { 1 } { 4 } )$ and $f \in ( \frac { 3 } { 4 } , 1 )$ , and assuming $\sigma _ { j } ^ { * } ~ \geq ~ 2 \sigma _ { 0 }$ , and assuming we optimize with gradient descent with a learning rate $\begin{array} { r } { \eta \ \leq \ \frac { c } { \sigma _ { 1 } ^ { * } } } \end{array}$ for $c < 2 ( { \sqrt { 2 } } - 1 )$ and $\sigma _ { 1 } ^ { * }$ the largest value of $\sigma ^ { * }$ , then the largest initialization value for which the learning phases of the values are $( s , f )$ -incremental, denoted $\sigma _ { 0 } ^ { t h }$ , is lower and upper bounded in the following way:
416
+
417
+ $$
418
+ \frac { 1 } { 2 } \frac { s } { 1 - s } \sigma _ { j } ^ { * } \Bigl ( \frac { 1 - f } { 2 r f } \frac { s } { 1 - s } \Bigr ) ^ { \frac { 1 } { A - 1 } } \leq \sigma _ { 0 } ^ { t h } \leq \frac { s } { 1 - s } \sigma _ { j } ^ { * } \Bigl ( \frac { 1 - f } { f } \frac { s } { 1 - s } \Bigr ) ^ { \frac { 1 } { B - 1 } }
419
+ $$
420
+
421
+ Where $A$ and $B$ are defined as:
422
+
423
+ $$
424
+ A = \frac { \log \left( 1 - c \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } + c ^ { 2 } \big ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } { \log \left( 1 - c \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } - \frac { c ^ { 2 } } { 4 } \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } \qquad B = \frac { \log \left( 1 - c \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } - \frac { c ^ { 2 } } { 4 } \big ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) } { \log \left( 1 - c \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } + c ^ { 2 } \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 } \right) }
425
+ $$
426
+
427
+ Proof. To show our result for gradient descent and $N = 2$ , we build on the proof techniques of theorem 3 of Gidel et al. (2019). We start by deriving the recurrence relation for the values $\sigma ( t )$ for general depth, when $t$ now stands for the iteration. Remembering that $w _ { i } ^ { n } = \sigma _ { i }$ , we write down the gradient update for $w _ { i } ( t )$ :
428
+
429
+ $$
430
+ w _ { i } ( t + 1 ) = w _ { i } ( t ) + \eta \frac { 1 } { N } w _ { i } ( t ) ^ { N - 1 } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) ) = \sqrt [ N ] { \sigma _ { i } ( t ) } + \eta \frac { 1 } { N } \sigma _ { i } ( t ) ^ { 1 - \frac { 1 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) )
431
+ $$
432
+
433
+ Raising $w _ { i } ( t )$ to the $N$ th power, we get the gradient update for the $\sigma$ values:
434
+
435
+ $$
436
+ r _ { i } ( t + 1 ) = \bigg ( \sqrt [ r ] { \sigma _ { i } ( t ) } + \eta \frac { 1 } { N } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) ) \sigma _ { i } ( t ) ^ { 1 - \frac { 1 } { N } } \bigg ) ^ { N } = \sigma _ { i } ( t ) \Big ( 1 + \eta \frac { 1 } { N } \sigma _ { i } ( t ) ^ { 1 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) ) \Big ) ^ { N }
437
+ $$
438
+
439
+ Next, we will prove a simple lemma which gives us the maximal learning rate we will consider for the analysis, for which there is no overshooting (the values don’t grow larger than the optimal values).
440
+
441
+ Lemma 1. For the gradient update in (9), assuming $\sigma _ { i } ( 0 ) < \sigma _ { i } ^ { * }$ , if $\begin{array} { r } { \eta \leq \left( \frac { 1 } { \sigma _ { 1 } ^ { * } } \right) ^ { 2 - \frac { 2 } { N } } } \end{array}$ and $N \geq 2$ , then:
442
+
443
+ $$
444
+ \forall t : \ \sigma _ { i } ( t ) \leq \sigma _ { i } ^ { * }
445
+ $$
446
+
447
+ Proof. Plugging in $\begin{array} { r } { \eta = c \bigg ( \frac { 1 } { \sigma _ { i } ^ { * } } \bigg ) ^ { 2 - \frac { 2 } { N } } } \end{array}$ for $c \leq 1$ , we have:
448
+
449
+ $$
450
+ \sigma _ { i } ( t + 1 ) = \sigma _ { i } ( t ) \Big ( 1 + \frac { c } { N } \Big ( \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } \Big ) ^ { 1 - \frac { 2 } { N } } \Big ( 1 - \big ( \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } \big ) \Big ) \Big ) ^ { N } \leq \sigma _ { i } ( t ) e ^ { \left( \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } \right) ^ { 1 - \frac { 2 } { N } } \Big ( 1 - \big ( \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } \big ) \Big ) }
451
+ $$
452
+
453
+ Defining ri = σiσ∗i a nd dividing both sides by $\sigma _ { i } ^ { * }$ , we have:
454
+
455
+ $$
456
+ r _ { i } ( t + 1 ) \leq r _ { i } ( t ) e ^ { r _ { i } ( t ) ^ { 1 - \frac { 2 } { N } } ( 1 - r _ { i } ( t ) ) }
457
+ $$
458
+
459
+ It is enough to show that for any $0 \leq r \leq 1$ , we have that $r e ^ { r ^ { 1 - \frac { 2 } { N } } ( 1 - r ) } \leq 1$ , as over-shooting occurs when $r _ { i } ( \bar { t } ) > 1$ . Indeed, this function is monotonic increasing in $0 \leq r \leq 1$ (since the exponent is non negative), and equals 1 when $r = 1$ . Since $r = 1$ is a fixed point and no iteration that starts at $r < 1$ can cross 1, then $r _ { i } ( t ) \leq 1$ for any $t$ . This concludes our proof. □
460
+
461
+ Under this choice of learning rate, we can now obtain our incremental learning results for gradient descent when $N = 2$ . Our strategy will be bounding $\sigma _ { i } ( t )$ from below and above, which will give us a lower and upper bound for $t _ { \alpha } ( \sigma _ { i } )$ . Once we have these bounds, we will be able to describe either a necessary or a sufficient condition on $\sigma _ { 0 }$ for incremental learning, similar to theorem 2.
462
+
463
+ The update rule for $N = 2$ is:
464
+
465
+ $$
466
+ \sigma _ { i } ( t + 1 ) = \sigma _ { i } ( t ) \Big ( 1 + \frac { 1 } { 2 } \eta ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) ) \Big ) ^ { 2 }
467
+ $$
468
+
469
+ Next, we plug in $\begin{array} { r } { \eta = \frac { c } { \sigma _ { 1 } ^ { * } } } \end{array}$ for $c < 2 ( \sqrt { 2 } - 1 ) < 1$ and denote $\begin{array} { r } { R _ { i } = \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } \leq 1 } \end{array}$ and $\begin{array} { r } { r _ { i } ( t ) = \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } \le 1 } \end{array}$ to get:
470
+
471
+ $$
472
+ \sigma _ { i } ( t + 1 ) = \sigma _ { i } ( t ) \Big ( 1 + \frac { c } { 2 } R _ { i } ( 1 - r _ { i } ( t ) ) \Big ) ^ { 2 }
473
+ $$
474
+
475
+ Following theorem 3 of Gidel et al. (2019), we bound $\frac { 1 } { \sigma _ { i } ( t ) }$ :
476
+
477
+ $$
478
+ \begin{array} { r l } & { \frac { 1 } { \sigma _ { i } ( t + 1 ) } = \frac { 1 } { \sigma _ { i } ( t ) } \frac { 1 } { \left( 1 + \frac { \varepsilon } { 2 } R _ { i } ( 1 - r _ { i } ( t ) ) \right) ^ { 2 } } } \\ & { \qquad = \frac { 1 } { \sigma _ { i } ( t ) } \frac { 1 } { 1 + \left( 1 - r _ { i } ( t ) \right) \left( \boldsymbol { { C R } } _ { i } + \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \left( 1 - r _ { i } ( t ) \right) \right) } } \\ & { \qquad \ge \frac { 1 } { \sigma _ { i } ( t ) } \frac { 1 } { 1 + \left( 1 - r _ { i } ( t ) \right) \left( \boldsymbol { { C R } } _ { i } + \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \right) } } \\ & { \qquad \ge \frac { 1 } { \sigma _ { i } ( t ) } \bigl ( 1 - ( 1 - r _ { i } ( t ) ) ( { c R } _ { i } + \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } ) \bigr ) } \\ & { \qquad = \frac { 1 } { \sigma _ { i } ( t ) } - ( \frac { 1 } { \sigma _ { i } ( t ) } - \frac { 1 } { \sigma _ { i } ^ { * } } ) ( { c R } _ { i } + \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } ) } \end{array}
479
+ $$
480
+
481
+ Where in the fourth line we use the inequality $\begin{array} { r } { \frac { 1 } { 1 + x } \geq 1 - x , \forall x \geq 0 } \end{array}$ . We may now subtract $\textstyle { \frac { 1 } { \sigma _ { i } ^ { * } } }$ from both sides to obtain:
482
+
483
+ $$
484
+ \frac { 1 } { \sigma _ { i } ( t ) } - \frac { 1 } { \sigma _ { i } ^ { * } } \geq \big ( \frac { 1 } { \sigma _ { i } ( t - 1 ) } - \frac { 1 } { \sigma _ { i } ^ { * } } \big ) \big ( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \big ) \geq \big ( \frac { 1 } { \sigma _ { 0 } } - \frac { 1 } { \sigma _ { i } ^ { * } } \big ) \big ( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \big ) ^ { t }
485
+ $$
486
+
487
+ We may now obtain a bound on $t _ { \alpha } ( \sigma _ { i } )$ by plugging in $\sigma _ { i } ( t ) = \alpha \sigma _ { i } ^ { * }$ and taking the log:
488
+
489
+ $$
490
+ \log \big ( \frac { 1 - \alpha } { \alpha \big ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 0 } } - 1 \big ) } \big ) \geq t _ { \alpha } \cdot \log \big ( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \big )
491
+ $$
492
+
493
+ Rearranging (note that $\begin{array} { r } { \log \left( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \right) < 0 } \end{array}$ and that our choice of $c$ keeps the argument of the log positive), we get:
494
+
495
+ $$
496
+ t _ { \alpha } ( \sigma _ { i } ) \geq \frac { \log \big ( \frac { 1 - \alpha } { \alpha ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 0 } } - 1 ) } \big ) } { \log \big ( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \big ) }
497
+ $$
498
+
499
+ Next, we follow the same procedure for an upper bound. Starting with our update step:
500
+
501
+ $$
502
+ \begin{array} { r l r } { { \frac { 1 } { \sigma _ { i } ( t + 1 ) } = \frac { 1 } { \sigma _ { i } ( t ) } \frac { 1 } { 1 + ( 1 - r _ { i } ( t ) ) ( c R _ { i } + \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } ( 1 - r _ { i } ( t ) ) ) } } } \\ & { } & { \leq \frac { 1 } { \sigma _ { i } ( t ) } \frac { 1 } { 1 + ( 1 - r _ { i } ( t ) ) c R _ { i } } } \\ & { } & { \leq \frac { 1 } { \sigma _ { i } ( t ) } ( 1 - ( 1 - r _ { i } ( t ) ) c R _ { i } + ( 1 - r _ { i } ( t ) ) ^ { 2 } c ^ { 2 } R _ { i } ^ { 2 } ) } \end{array}
503
+ $$
504
+
505
+ Where in the last line we use the inequality $\begin{array} { r } { \frac { 1 } { 1 + x } \leq 1 - x + x ^ { 2 } , \forall x \geq 0 } \end{array}$ . Subtracting $\textstyle { \frac { 1 } { \sigma _ { i } ^ { * } } }$ from both sides, we get:
506
+
507
+ $$
508
+ \frac { 1 } { \sigma _ { i } ( t ) } - \frac { 1 } { \sigma _ { i } ^ { * } } \leq \big ( \frac { 1 } { \sigma _ { i } ( t - 1 ) } - \frac { 1 } { \sigma _ { i } ^ { * } } \big ) \big ( 1 - c R _ { i } + c ^ { 2 } R _ { i } ^ { 2 } \big ) \leq \big ( \frac { 1 } { \sigma _ { 0 } } - \frac { 1 } { \sigma _ { i } ^ { * } } \big ) \big ( 1 - c R _ { i } + c ^ { 2 } R _ { i } ^ { 2 } \big ) ^ { t }
509
+ $$
510
+
511
+ Rearranging like before, we get the bound on the $\alpha$ -time:
512
+
513
+ $$
514
+ t _ { \alpha } ( \sigma _ { i } ) \leq \frac { \log \big ( \frac { 1 - \alpha } { \alpha ( \frac { \sigma _ { i } ^ { * } } { \sigma _ { 0 } } - 1 ) } \big ) } { \log \big ( 1 - c R _ { i } + c ^ { 2 } R _ { i } ^ { 2 } \big ) }
515
+ $$
516
+
517
+ Given these bounds, we would like to find the conditions on $\sigma _ { 0 }$ that allows for $( s , f )$ -incremental learning. We will find a sufficient condition and a necessary condition, like in the proof of theorem 2.
518
+
519
+ # SUFFICIENT CONDITION
520
+
521
+ A sufficient condition for incremental learning will be one which is possibly stricter than the exact condition. We can find such a condition by requiring the upper bound of $t _ { f } ( \sigma _ { i } )$ to be smaller than the lower bound on $t _ { s } ( \sigma _ { j } )$ . This becomes the following condition:
522
+
523
+ $$
524
+ \frac { \log \left( \frac { 1 - f } { f } \frac { \sigma _ { 0 } } { \sigma _ { i } ^ { * } - \sigma _ { 0 } } \right) } { \log \left( 1 - c R _ { i } + c ^ { 2 } R _ { i } ^ { 2 } \right) } \leq \frac { \log \left( \frac { 1 - s } { s } \frac { \sigma _ { 0 } } { \sigma _ { j } ^ { * } - \sigma _ { 0 } } \right) } { \log \left( 1 - c R _ { j } - \frac { c ^ { 2 } } { 4 } R _ { j } ^ { 2 } \right) }
525
+ $$
526
+
527
+ Defining $\begin{array} { r } { A = \frac { \log \big ( 1 - c R _ { i } + c ^ { 2 } R _ { i } ^ { 2 } \big ) } { \log \big ( 1 - c R _ { j } - \frac { c ^ { 2 } } { 4 } R _ { j } ^ { 2 } \big ) } } \end{array}$ and rearranging, we get the following:
528
+
529
+ $$
530
+ \log \big ( \frac { 1 - f } { f } \frac { \sigma _ { 0 } } { \sigma _ { i } ^ { * } - \sigma _ { 0 } } \big ) \geq A \log \big ( \frac { 1 - s } { s } \frac { \sigma _ { 0 } } { \sigma _ { j } ^ { * } - \sigma _ { 0 } } \big )
531
+ $$
532
+
533
+ We may now take the exponent of both sides and rearrange again, remembering $\begin{array} { r } { \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ , to get the following condition:
534
+
535
+ $$
536
+ \frac { ( \sigma _ { j } ^ { * } - \sigma _ { 0 } ) ^ { A } } { \sigma _ { 0 } ^ { A - 1 } ( r \sigma _ { j } ^ { * } - \sigma _ { 0 } ) } \geq \frac { f } { 1 - f } ( \frac { 1 - s } { s } ) ^ { A }
537
+ $$
538
+
539
+ Now, we will add the very reasonable assumption that $\sigma _ { j } ^ { * } \geq 2 \sigma _ { 0 }$ , which allows us to replace $\frac { \sigma _ { j } ^ { * } - \sigma _ { 0 } } { r \sigma _ { j } ^ { * } - \sigma _ { 0 } }$ with $\textstyle { \frac { 1 } { 2 r } }$ and replace $( \sigma _ { j } ^ { * } - \sigma _ { 0 } ) ^ { A - 1 }$ with $\textstyle { \left( { \frac { 1 } { 2 } } \sigma _ { j } \right) } ^ { A - 1 }$ , only making the condition stricter. This simplifies the expression to the following:
540
+
541
+ $$
542
+ \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 0 } } \big ) ^ { A - 1 } \geq \frac { r f } { 1 - f } \big ( \frac { 2 - 2 s } { s } \big ) ^ { A }
543
+ $$
544
+
545
+ Now we can rearrange and isolate $\sigma _ { 0 }$ to get a sufficient condition for incremental learning:
546
+
547
+ $$
548
+ \sigma _ { 0 } \leq \frac { 1 } { 2 } \frac { s } { 1 - s } \sigma _ { j } ^ { * } \bigg ( \frac { 1 - f } { 2 r f } \frac { s } { 1 - s } \bigg ) ^ { \frac { 1 } { A - 1 } }
549
+ $$
550
+
551
+ # NECESSARY CONDITION
552
+
553
+ A necessary condition for incremental learning will be one which is possibly more relaxed than the exact condition. We can find such a condition by requiring the lower bound of $t _ { f } ( \sigma _ { i } )$ to be smaller than the upper bound on $t _ { s } ( \sigma _ { j } )$ . This becomes the following condition:
554
+
555
+ $$
556
+ \frac { \log \left( \frac { 1 - f } { f } \frac { \sigma _ { 0 } } { \sigma _ { i } ^ { * } - \sigma _ { 0 } } \right) } { \log \left( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \right) } \leq \frac { \log \left( \frac { 1 - s } { s } \frac { \sigma _ { 0 } } { \sigma _ { j } ^ { * } - \sigma _ { 0 } } \right) } { \log \left( 1 - c R _ { j } + c ^ { 2 } R _ { j } ^ { 2 } \right) }
557
+ $$
558
+
559
+ Defining $\begin{array} { r } { B = \frac { \log \big ( 1 - c R _ { i } - \frac { c ^ { 2 } } { 4 } R _ { i } ^ { 2 } \big ) } { \log \big ( 1 - c R _ { j } + c ^ { 2 } R _ { j } ^ { 2 } \big ) } } \end{array}$ and rearranging, we get the following:
560
+
561
+ $$
562
+ \log \Big ( \frac { 1 - f } { f } \frac { \sigma _ { 0 } } { \sigma _ { i } ^ { * } - \sigma _ { 0 } } \Big ) \geq B \log \Big ( \frac { 1 - s } { s } \frac { \sigma _ { 0 } } { \sigma _ { j } ^ { * } - \sigma _ { 0 } } \Big )
563
+ $$
564
+
565
+ We may now take the exponent of both sides and rearrange again, remembering $\begin{array} { r } { \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } = r > 1 } \end{array}$ , to get the following condition:
566
+
567
+ $$
568
+ \frac { ( \sigma _ { j } ^ { * } - \sigma _ { 0 } ) ^ { B } } { \sigma _ { 0 } ^ { B - 1 } ( r \sigma _ { j } ^ { * } - \sigma _ { 0 } ) } \geq \frac { f } { 1 - f } ( \frac { 1 - s } { s } ) ^ { B }
569
+ $$
570
+
571
+ We may now relax the condition further, by removing the $r$ from the denominator of the left-hand side and the $\sigma _ { 0 }$ from the numerator. This gives us the following:
572
+
573
+ $$
574
+ \big ( \frac { \sigma _ { j } ^ { * } } { \sigma _ { 0 } } \big ) ^ { B - 1 } \geq \frac { f } { 1 - f } \big ( \frac { 1 - s } { s } \big ) ^ { B }
575
+ $$
576
+
577
+ Finally, rearranging gives us the necessary condition:
578
+
579
+ $$
580
+ \sigma _ { 0 } \leq \frac { s } { 1 - s } \sigma _ { j } ^ { * } \Bigl ( \frac { 1 - f } { f } \frac { s } { 1 - s } \Bigr ) ^ { \frac { 1 } { B - 1 } }
581
+ $$
582
+
583
+ # C DISCUSSION OF GRADIENT DESCENT FOR GENERAL $N$
584
+
585
+ While we were able to generalize our result to gradient descent for $N = 2$ , our proof technique relies on the ability to get a non-implicit solution for $\sigma ( t )$ which we discretized and bounded. This is harder to generalize to larger values of $N$ , where the solution is implicit. Still, we can informally illustrate the effect of depth on the dynamics of gradient descent by approximating the update rule of the values.
586
+
587
+ We start by reminding ourselves of the gradient descent update rule for $\sigma$ , for a learning rate $\eta =$ c 1σ ∗  2 − 2N :
588
+
589
+ $$
590
+ \sigma _ { i } ( t + 1 ) = \sigma _ { i } ( t ) \Big ( 1 + \frac { c } { N } \big ( \frac { 1 } { \sigma _ { 1 } ^ { * } } \big ) ^ { 2 - \frac { 2 } { N } } \sigma _ { i } ( t ) ^ { 1 - \frac { 2 } { N } } \big ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) \big ) \Big ) ^ { N }
591
+ $$
592
+
593
+ To compare two values in the same scales, we will divide both sides by the optimal value $\sigma _ { i } ^ { * }$ and look at the update step of the ratio $\begin{array} { r } { r _ { i } = \frac { \sigma _ { i } ( t ) } { \sigma _ { i } ^ { * } } } \end{array}$ , also denoting $\begin{array} { r } { R _ { i } = \frac { \sigma _ { i } ^ { * } } { \sigma _ { 1 } ^ { * } } } \end{array}$ :
594
+
595
+ $$
596
+ r _ { i } ( t + 1 ) = r _ { i } ( t ) \Big ( 1 + \frac { c } { N } R _ { i } ^ { 2 - \frac { 2 } { N } } r _ { i } ( t ) ^ { 1 - \frac { 2 } { N } } ( 1 - r _ { i } ( t ) ) \Big ) ^ { N }
597
+ $$
598
+
599
+ We will focus on the early stages of the optimization process, where $r \ll 1$ . This means we can neglect the $1 - r _ { i } ( t )$ term in the update step, giving us the approximate update step we will use to compare the general $i , j$ values:
600
+
601
+ $$
602
+ r _ { i } ( t + 1 ) \approx r _ { i } ( t ) \left( 1 + \frac { c } { N } R _ { i } ^ { 2 - \frac { 2 } { N } } r _ { i } ( t ) ^ { 1 - \frac { 2 } { N } } \right) ^ { N }
603
+ $$
604
+
605
+ We would like to compare the dynamics of $r _ { i }$ and $r _ { j }$ , which is difficult to do when the recurrence relation isn’t solvable. However, we can observe the first iteration of gradient descent and see how depth affects this iteration. Since we are dealing with variables which are ratios of different optimal values, the initial values of $r$ are different. Denoting $\begin{array} { r } { \mathbf { r } = \frac { \sigma _ { i } ^ { * } } { \sigma _ { j } ^ { * } } } \end{array}$ , we can describe the initialization of $r _ { j }$ using that of $r _ { i }$ :
606
+
607
+ $$
608
+ r _ { j } ( 0 ) = { \bf r } r _ { i } ( 0 )
609
+ $$
610
+
611
+ Plugging in the initial conditions and noting that $R _ { i } = { \bf r } R _ { j }$ , we get:
612
+
613
+ $$
614
+ \begin{array} { r } { r _ { i } ( 1 ) \approx r _ { i } ( 0 ) \Big ( 1 + \frac { c R _ { i } ^ { 2 - \frac { 2 } { N } } } { N } r _ { i } ( 0 ) ^ { 1 - \frac { 2 } { N } } \Big ) ^ { N } } \\ { r _ { j } ( 1 ) \approx r _ { i } ( 0 ) \Big ( \sqrt [ N ] { \mathbf { r } } + \big ( \frac { 1 } { \mathbf { r } } \big ) ^ { \frac { N - 1 } { N } } \frac { c R _ { i } ^ { 2 - \frac { 2 } { N } } } { N } r _ { i } ( 0 ) ^ { 1 - \frac { 2 } { N } } \Big ) ^ { N } } \end{array}
615
+ $$
616
+
617
+ We see that the two ratios have a similar update, with the ratio of optimal values playing a role in how large the initial value is versus how large the added value is. When we use a small learning rate, we have a very small $c$ which means we can make a final approximation and neglect the higher order terms of $c$ :
618
+
619
+ $$
620
+ \begin{array} { r l } & { r _ { i } ( 1 ) \approx r _ { i } ( 0 ) + c R _ { i } ^ { 2 - \frac { 2 } { N } } r _ { i } ( 0 ) ^ { 2 - \frac { 2 } { N } } } \\ & { r _ { j } ( 1 ) \approx { \bf r } r _ { i } ( 0 ) + \big ( \frac { 1 } { { \bf r } } \big ) ^ { \frac { N - 1 } { N } } c R _ { i } ^ { 2 - \frac { 2 } { N } } r _ { i } ( 0 ) ^ { 2 - \frac { 2 } { N } } } \end{array}
621
+ $$
622
+
623
+ We can see that while the initial conditions favor $r _ { j }$ , the size of the update for $r _ { i }$ is larger by a factor of $r ^ { \frac { N - 1 } { N } }$ when the initialization and learning rates are small. This accumulates throughout the optimization, making $r _ { i }$ eventually converge faster than $r _ { j }$ .
624
+
625
+ The effect of depth here is clear - the deeper the model, the larger the relative step size of $r _ { i }$ and the faster it converges relative to $r _ { j }$ .
626
+
627
+ # D COMPARISON OF THE TOY MODEL AND OMP
628
+
629
+ Learning our toy model, when it’s incremental learning is taken to the limit, can be described as an iterative procedure where at every step an additional feature is introduced such that it’s weight is non-zero and then the model is optimized over the current set of features. This description is also relevant for the sparse approximation algorithm orthogonal matching pursuit (Pati et al., 1993), where the next feature is greedily chosen to be the one which most improves the current model.
630
+
631
+ While the toy model and OMP are very different algorithms for learning sparse linear models, we will show empirically that they behave similarly. This allows us to view incremental learning as a continuous-time extension of a greedy iterative algorithm.
632
+
633
+ To allow for negative weights in our experiments, we augment our toy model as in the toy model of Woodworth et al. (2019). Our model will have the same induced form as before:
634
+
635
+ $$
636
+ f _ { \sigma } ( x ) = \langle \sigma , x \rangle
637
+ $$
638
+
639
+ However, we parameterize $\sigma$ using $w _ { + } , w _ { - } \in \mathbb { R } ^ { d }$ in the following way:
640
+
641
+ $$
642
+ \begin{array} { c } { \sigma _ { i } = w _ { + , i } ^ { N } - w _ { - , i } ^ { N } } \\ { \qquad \forall i , \ w _ { + , i } ( 0 ) = w _ { - , i } ( 0 ) = \sqrt [ N ] { \sigma _ { 0 } } } \end{array}
643
+ $$
644
+
645
+ We can now treat this algorithm as a sparse approximation pursuit algorithm - given a dictionary $D \in \mathbb { R } ^ { d \times n }$ and an example $x \in \mathbb { R } ^ { d }$ , we wish to find the sparsest $\alpha$ for which $D \alpha \approx x$ by minimizing the $\ell _ { 0 }$ norm of $\alpha$ subject to $\| D \alpha - x \| _ { 2 } ^ { 2 } = 0 ^ { 3 }$ . Under this setting, we can compare OMP to our toy model by comparing the sets of features that the two algorithms choose for a given example and dictionary.
646
+
647
+ In figure 3 we run such a comparison. Using a dictionary of 1000 atoms and an example of dimensionality 80 sampled from a random hidden vector of a given sparsity $s$ , we run both algorithms and record the first $s$ features chosen4.
648
+
649
+ ![](images/850628cf8a6350a15f50e62eeedfcba28e4ac2fa035fa393674ec77b7c764190.jpg)
650
+ Figure 3: Empirical comparison of the dynamics of the toy model to OMP. The toy model has a depth of 5 and was initialized with a scale of 1e-4 and a learning rate of 3e-3. We compare the fraction of agreement between the sets of first $s$ features selected of the two algorithms for every given sparsity level $s$ , averaged over 100 experiments (the shaded regions are empirical standard deviations). For example, for sparsity level 3, we look at the sets of first 3 features selected by each algorithm and calculate the fraction of them that appear in both sets.
651
+
652
+ For every sparsity $s$ , we plot the mean fraction of agreement between the sets of features chosen by OMP and the toy model over 100 experiments. We see that the two algorithms choose very similar features at the beginning, suggesting that the deep model approximates the discrete behavior of OMP. Only when the number of features increases do we see that the behavior of the two models begins to differ, caused by the fact that the toy model has a finite initialization scale and learning rate.
653
+
654
+ These experiments demonstrate the similarity between the incremental learning of deep models and the discrete behavior of greedy approximation algorithms such as OMP. Adopting this view also allows us to put our finger on another strength of the dynamics of deep models - while greedy algorithms such as OMP require the analytical solution or approximation of every iterate, the dynamics of deep models are able to incrementally learn any differentiable function. For example, looking back at the matrix sensing task and the classification models in section 4, we see that while there isn’t an immediate and efficient extension of OMP for these settings, the dynamics of learning deep models extends naturally and exhibits the same incremental learning as OMP.
655
+
656
+ # E INCREMENTAL LEARNING IN MATRIX SENSING
657
+
658
+ # E.1 PROOF OF THEOREM 4
659
+
660
+ Theorem. Minimizing the deep matrix sensing model described in (5) with gradient flow over the depth normalized squared loss (6), with Gaussian inputs and weights initialized as in (5) leads to the following dynamical equations for different values of $N$ :
661
+
662
+ $$
663
+ \dot { \sigma } _ { i } ( t ) = \sigma _ { i } ( t ) ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) )
664
+ $$
665
+
666
+ Where $\sigma _ { i }$ and $\sigma _ { i } ^ { * }$ are the ith singular values of $W$ and $W ^ { * }$ , respectively, corresponding to the same singular vectors.
667
+
668
+ Proof. We will adapt the proof from Saxe et al. (2013) for multilayer linear networks. The gradient flow equations for $W _ { n } , n \in [ N ]$ are:
669
+
670
+ $$
671
+ \dot { W _ { n } } = { \frac { 1 } { N } } W _ { 1 : n - 1 } ^ { T } ( W ^ { * } - W ) W _ { n + 1 : N } ^ { T }
672
+ $$
673
+
674
+ Where we denote $\begin{array} { r } { W _ { j : k } = \prod _ { i = j } ^ { k } W _ { i } } \end{array}$
675
+
676
+ Since we assumed $W ^ { * }$ is (symmetric) PSD, there exists an orthogonal matrix $U$ for which $D ^ { * } =$ $U W ^ { * } U ^ { T }$ where $D ^ { * }$ is diagonal. Under the initialization in (3), $U$ diagonalizes all $W _ { n }$ matrices at initialization such that ${ \cal D } _ { n } \overline { { } } = U W _ { n } U ^ { T } = \sqrt [ N ] { \sigma _ { 0 } } I$ . Making this change of variables for all $W _ { n }$ , we get:
677
+
678
+ $$
679
+ \dot { W _ { n } } = \frac { 1 } { N } U ^ { T } D _ { 1 : n - 1 } U ( W ^ { * } - W ) U ^ { T } D _ { n + 1 : N } U
680
+ $$
681
+
682
+ Rearranging, we get a set of decoupled differential equations for the singular values of $W _ { n }$
683
+
684
+ $$
685
+ \dot { D _ { n } } = { \frac { 1 } { N } } D _ { 1 : n - 1 } ( D ^ { * } - D ) D _ { n + 1 : N }
686
+ $$
687
+
688
+ Note that since these matrices are all diagonal at initialization, the above dynamics ensure that they remain diagonal throughout the optimization. Denoting $\sigma _ { n , i }$ as the $i ^ { \because }$ ’th singular value of $W _ { n }$ and $\sigma _ { i }$ as the $\overrightarrow { \imath } ^ { \prime }$ ’th singular value of $W$ , we get the following differential equation:
689
+
690
+ $$
691
+ \dot { \sigma } _ { n , i } = \frac { 1 } { N } ( \sigma _ { i } ^ { * } - \sigma _ { i } ) \prod _ { j \neq n } \sigma _ { j , i }
692
+ $$
693
+
694
+ Since we assume at initialization that $\forall n , m , i : \sigma _ { n , i } ( 0 ) = \sigma _ { m , i } ( 0 ) = \sqrt [ N ] { \sigma _ { 0 } }$ , the above dynamics are the same for all singular values and we get $\forall n , m , i : \sigma _ { n , i } ( t ) = \sigma _ { m , i } ( t ) = \sqrt [ N ] { \sigma _ { i } ( t ) }$ . We may now use this to calculate the dynamics of the singular value of $W$ , since they are the product the the singular values of all $W _ { n }$ matrices. Denoting $\begin{array} { r } { \sigma _ { - n , i } = \prod _ { k \neq n } \sigma _ { k , i } } \end{array}$ and using the chain rule:
695
+
696
+ $$
697
+ \dot { \sigma } _ { i } = \sum _ { n = 1 } ^ { N } \sigma _ { - n , i } \dot { \sigma } _ { n , i } = \sigma _ { i } ^ { 2 - \frac { 2 } { N } } ( \sigma _ { i } ^ { * } - \sigma _ { i } )
698
+ $$
699
+
700
+ # E.2 EMPIRICAL EXAMINATION
701
+
702
+ Our analytical results are only applicable for the population loss over Gaussian inputs. These conditions are far from the ones used in practice and studied in Arora et al. (2019), where the problem is over-determined and the weights are drawn from a Gaussian distribution with a small variance. To show our conclusions regarding incremental learning extend qualitatively to more natural settings, we empirically examine the deep matrix sensing model in this natural setting for different depths and initialization scales as seen in figure 4.
703
+
704
+ Notice how incremental learning is exhibited even when the number of examples is much smaller than the number of parameters in the model. While we can’t rely on our theory for describing the exact dynamics of the optimization for these kinds of over-determined problems, the qualitative conclusions we get from it are still applicable.
705
+
706
+ Another interesting phenomena we should note is that once the dataset becomes very small (the second row of the figure), we see all “currently active” singular values change at the beginning of every new phase (this is best seen in the bottom-right panel). This suggests that since there is more than one optimal solution, once we increase the current rank of our model it may find a solution that has a different set of singular values and vectors and thus all singular values change at the beginning of a new learning phase. This demonstrates the importance of incremental learning for obtaining sparse solutions - once the initialization conditions and depth are such that the learning phases are distinct, gradient descent finds the optimal rank- $i$ solution in every phase $i$ . For these dynamics to successfully recover the optimal solution at every phase, the phases need to be far enough apart from each other to allow for the singular values and vectors to change before the next phase begins.
707
+
708
+ ![](images/30d0053940d521183eae431a6073eb95e1a63934ce44ff4a2a09d223b98048e2.jpg)
709
+ Figure 4: Evolution of the top-5 singular values of the deep matrix sensing model, with Gaussian initialization with variance such that the initial singular values are in expectation 1e-4. The model’s size and data are in $\mathbb { R } ^ { 5 0 \times 5 0 }$ . The columns correspond to different parameterization depths, while the rows correspond to different dataset sizes. In both cases the problem is over-determined, since the number of examples is smaller than the number of parameters. Since the original matrix is rank-4, we can recognize an unsuccessful recovery when all five singular values are nonzero, as seen clearly for both depth-1 plots.
710
+
711
+ F INCREMENTAL LEARNING IN QUADRATIC NETWORKS
712
+
713
+ F.1 PROOF OF THEOREM 5
714
+
715
+ Theorem. Minimizing the quadratic network described and initialized as in (7) with gradient flow over the variance loss defined in (2) with Gaussian inputs leads to the following dynamical equations:
716
+
717
+ $$
718
+ \dot { \sigma } _ { i } ( t ) = \sigma _ { i } ( t ) ( \sigma _ { i } ^ { * } - \sigma _ { i } ( t ) )
719
+ $$
720
+
721
+ Where $\sigma _ { i }$ and $\sigma _ { i } ^ { * }$ are the ith singular values of $W$ and $W ^ { * }$ , respectively, corresponding to the same singular vectors.
722
+
723
+ Proof. Our proof will follow similar lines as the analysis of the deep matrix sensing model. Taking the expectation of the variance loss over Gaussian inputs for our model gives us:
724
+
725
+ $$
726
+ \begin{array} { l } { \displaystyle \ell _ { v a r } ( W ) = \frac { 1 } { 1 6 } \mathbb { E } _ { { x } } [ ( \langle W _ { * } ^ { T } W _ { * } - W ^ { T } W , x x ^ { T } \rangle ) ^ { 2 } ] - \frac { 1 } { 1 6 } \mathbb { E } _ { { x } } [ \langle W _ { * } ^ { T } W _ { * } - W ^ { T } W , x x ^ { T } \rangle ] ^ { 2 } } \\ { \displaystyle = \frac { 1 } { 8 } \| W _ { * } ^ { T } W _ { * } - W ^ { T } W \| _ { F } ^ { 2 } + \frac { 1 } { 1 6 } T r ( W _ { * } ^ { T } W _ { * } - W ^ { T } W ) ^ { 2 } - \frac { 1 } { 1 6 } T r ( W _ { * } ^ { T } W _ { * } - W ^ { T } W ) ^ { 2 } } \\ { \displaystyle \quad = \frac { 1 } { 8 } \| W _ { * } ^ { T } W _ { * } - W ^ { T } W \| _ { F } ^ { 2 } } \end{array}
727
+ $$
728
+
729
+ Following the gradient flow dynamics over $W$ leads to the following differential equation:
730
+
731
+ $$
732
+ \dot { W } = \frac { 1 } { 2 } W ( W _ { * } ^ { T } W _ { * } - W ^ { T } W )
733
+ $$
734
+
735
+ We can now calculate the gradient flow dynamics of $W ^ { T } W$ using the chain rule:
736
+
737
+ $$
738
+ W ^ { \dot { T } } W = W ^ { T } \dot { W } + \dot { W } ^ { T } W = \frac { 1 } { 2 } \Bigl ( W ^ { T } W ( W _ { * } ^ { T } W _ { * } - W ^ { T } W ) + ( W _ { * } ^ { T } W _ { * } - W ^ { T } W ) W ^ { T } W \Bigr )
739
+ $$
740
+
741
+ Now, under our initialization $W _ { 0 } ^ { T } W _ { 0 } = \sigma _ { 0 } I \mathrm { . }$ , we get that $W ^ { T } W$ and $W _ { * } ^ { T } W _ { * }$ are simultaneously diagonalizable at initialization by some matrix $U$ , such that the following is true for diagonal $D$ and $D ^ { * }$ :
742
+
743
+ $$
744
+ D ( 0 ) = U ^ { T } W ( 0 ) ^ { T } W ( 0 ) U
745
+ $$
746
+
747
+ $$
748
+ D ^ { * } = U ^ { T } W _ { * } ^ { T } W _ { * } U
749
+ $$
750
+
751
+ Multiplying equation (10) by $U$ and $U ^ { T }$ gives us the following dynamics for the singular values of $W ^ { T } W$ :
752
+
753
+ $$
754
+ \dot { D } = \frac { 1 } { 2 } \Big ( D ( D ^ { * } - D ) + ( D ^ { * } - D ) D \Big ) = D ( D ^ { * } - D )
755
+ $$
756
+
757
+ These matrices are diagonal at initialization, and remain diagonal throughout the dynamics (the offdiagonal elements are static according to these equations). We may now look at the dynamics of a single diagonal element, noticing it is equivalent to the depth-2 toy model:
758
+
759
+ $$
760
+ \dot { \sigma } _ { i } = \sigma _ { i } ( \sigma _ { i } ^ { * } - \sigma _ { i } )
761
+ $$
762
+
763
+ # F.2 DISCUSSION OF THE VARIANCE LOSS
764
+
765
+ It may seem that the variance loss is an unnatural loss function to analyze, since it isn’t used in practice. While this is true, we will show how the dynamics of this loss function are an approximation of the square loss dynamics.
766
+
767
+ We begin by describing the dynamics of both losses, showing how incremental learning can’t take place for quadratic networks as defined over the squared loss. Then, we show how adding a global bias to the quadratic network leads to similar dynamics for small initialization scales.
768
+
769
+ # F.2.1 DYNAMICAL DERIVATION
770
+
771
+ in the previous section, we derive the differential equations for the singular values of $W ^ { T } W$ under the variance loss:
772
+
773
+ $$
774
+ \dot { \sigma } _ { i } = \sigma _ { i } ( \sigma _ { i } ^ { * } - \sigma _ { i } )
775
+ $$
776
+
777
+ We will now derive similar equations for the squared loss. The scaled squared loss in expectation over the Gaussian inputs is:
778
+
779
+ $$
780
+ \begin{array} { r l } & { \ell ( W ) = \displaystyle \frac { 1 } { 1 6 } \mathbb { E } _ { x } [ ( \langle W _ { * } ^ { T } W _ { * } - W ^ { T } W , x x ^ { T } \rangle ) ^ { 2 } ] } \\ & { \qquad = \displaystyle \frac { 1 } { 8 } | | W _ { * } ^ { T } W _ { * } - W ^ { T } W | | _ { F } ^ { 2 } + \frac { 1 } { 1 6 } T r ( W _ { * } ^ { T } W _ { * } - W ^ { T } W ) ^ { 2 } } \end{array}
781
+ $$
782
+
783
+ Defining $\Delta = W _ { * } ^ { T } W _ { * } - W ^ { T } W$ for brevity, the differential equations for $W$ become:
784
+
785
+ $$
786
+ \dot { W } = \frac { 1 } { 2 } W \Delta + \frac { 1 } { 4 } T r ( \Delta ) W
787
+ $$
788
+
789
+ Calculating the dynamics of $W ^ { T } W$ after noting that it is simultaneously diagonalizable with $W _ { * } ^ { T } W _ { * }$ (as in the derivation for the variance loss) leads to the following differential equations for the singular values of $W ^ { T } W$ :
790
+
791
+ $$
792
+ \dot { \sigma } _ { i } = \sigma _ { i } \Big ( \sigma _ { i } ^ { * } - \sigma _ { i } + \frac { 1 } { 2 } \sum _ { j } ( \sigma _ { j } ^ { * } - \sigma _ { j } ) \Big )
793
+ $$
794
+
795
+ We see that the equations are now coupled and so we cannot solve them analytically. Another issue is that for our initialization, all singular values have very similar dynamics at initialization due to the coupling. For example, values corresponding to small optimal singular values grow much faster than in the variance loss dynamics, due to the effect the large optimal singular values have on them.
796
+
797
+ We see from these equations that we shouldn’t expect quadratic networks optimized over the squared loss to exhibit incremental learning behavior. We next show how adding a global bias to our model can help.
798
+
799
+ # F.2.2 VARIANCE LOSS APPROXIMATES THE SQUARED LOSS
800
+
801
+ To see how the variance loss can have dynamics resembling those of the squared loss, we will add a global (trainable) bias to our model. This means our model is now parameterized by $W \in \mathbb { R } ^ { d \times d }$ and a scalar $b \in \mathbb { R }$ :
802
+
803
+ $$
804
+ f _ { W , b } ( x ) = \langle W ^ { T } W , x x ^ { T } \rangle + b
805
+ $$
806
+
807
+ We may now analyze gradient flow of the squared loss. Following the same methods as before, this leads us to the following differential equations:
808
+
809
+ $$
810
+ \begin{array} { l } { \displaystyle \dot { \sigma } _ { i } = \sigma _ { i } \Big ( \sigma _ { i } ^ { * } - \sigma _ { i } + \frac { 1 } { 2 } \sum _ { j } ( \sigma _ { j } ^ { * } - \sigma _ { j } ) + \frac { 1 } { 2 } ( b ^ { * } - b ) \Big ) } \\ { \displaystyle \dot { b } = \sum _ { j } ( \sigma _ { j } ^ { * } - \sigma _ { j } ) + b ^ { * } - b } \end{array}
811
+ $$
812
+
813
+ Notice how, if $b$ is at it’s optimum at a given time $\begin{array} { r } { ( b = \sum _ { j } ( \sigma _ { j } ^ { * } - \sigma _ { j } ) + b ^ { * } ) } \end{array}$ , the dynamics of $\sigma _ { i }$ align with those of the variance loss. Alternatively, when $b = b ^ { * }$ , we recover the dynamics of the squared loss without the global bias term.
814
+
815
+ To convince ourselves that the dynamics of this model resemble those of the variance loss, we would need to explain why the global bias is at it’s optimum “most of the time”, such that the singular values don’t change much during the times when it is not at it’s optimum.
816
+
817
+ Observing the differential equations for $b$ and for $\sigma _ { i }$ , we see they are similar (if we ignore the $\sigma _ { i } ^ { * } - \sigma _ { i }$ value which doesn’t change the order of magnitude of the entire expression when there haven’t been many learning phases yet). The only difference being a multiplication by $\sigma _ { i }$ . This means that we may informally write:
818
+
819
+ $$
820
+ \frac { \dot { \sigma } _ { i } ( t ) } { \dot { b } ( t ) } \approx \sigma _ { i } ( t )
821
+ $$
822
+
823
+ Since at initialization and until the learning phase of $\sigma _ { i }$ takes place, we have $\sigma _ { i } ( t ) \ll 1$ , we see that the global bias optimizes much faster than the singular values for which the learning phase hasn’t begun yet. This means these singular values will remain small during the times in which the bias isn’t optimal, and so incremental learning can still take place (assuming a small enough initialization).
824
+
825
+ ![](images/0ec431bf9815c02f0689d4f67bcd2532ec6e6174e98a709848c535d46e23f897.jpg)
826
+ Figure 5: Quadratic model’s evolution of top-5 singular values for a rank-4 labeling function. The rows correspond to whether or not a global bias is introduced to the model. The first two columns are for a large dataset (one optimal solution) and the last two columns are for a small dataset (overdetermined problem). When a bias is introduced, it is initialized to it’s optimal value at initialization. Note how without the bias, the singular values are learned together and there is over-shooting of the optimal singular value caused by the coupling of the dynamics of the singular values. For the small datasets, we see that the model with no bias reaches a solution with a larger rank. Once a global bias is introduced, the dynamics become more incremental as in the analysis of the variance loss. Note that in this case the solution obtained for the small dataset is the optimal low-rank solution.
827
+
828
+ Under these considerations, we say that the dynamics of the squared loss for a quadratic network with an added global bias resemble the idealized dynamics of the variance loss for a depth-2 linear model which we analyze formally in the paper. In figure 5 we experimentally show how adding a bias to a quadratic network does lead to incremental learning similar to the depth-2 toy model.
829
+
830
+ # G INCREMENTAL LEARNING IN CLASSIFICATION
831
+
832
+ # G.1 DIAGONAL NETWORKS
833
+
834
+ In section 4.3 we viewed our toy model as a special case of the deep diagonal networks described in Gunasekar et al. (2018), expected to be biased towards sparse solutions. Figure 6 shows the dynamics of the largest values of $\sigma$ for different depths of the model. We see that the same type of incremental learning we saw in earlier models exists here as well - the features are learned one by one in deeper models, resulting in a sparse solution. The leftmost panel shows how the initialization scale plays a role here as well, with the solution being more sparse when the initialization is small. We should note that these results do not defy the results of Gunasekar et al. (2018) (from which we would expect the initialization not to matter), since their results deal with the solution at $t \to \infty$ .
835
+
836
+ # G.2 CONVOLUTIONAL NETWORKS - PRELIMINARIES
837
+
838
+ The linear circular-convolutional network of Gunasekar et al. (2018) deals with one-dimensional convolutions with the same number of outputs as inputs, such that the mapping from one hidden layer to the next is parameterized by $w _ { n }$ and defined to be:
839
+
840
+ $$
841
+ h _ { n } [ i ] = \sum _ { k = 0 } ^ { d - 1 } w _ { n } [ k ] h _ { n - 1 } [ ( i + k ) \mod d ] = ( h _ { n - 1 } \star w _ { n } ) [ i ]
842
+ $$
843
+
844
+ ![](images/f24003e92c57d90fdbdbc73d05bd3dd33d93af75d8ddeff5e4ea5313c8d7c9a4.jpg)
845
+ Figure 6: Incremental learning in binary classification. A model as in section 4.3 is trained over 200 i.i.d. random Gaussian examples, where $d = 1 0 0$ . The data is labeled by a weight vector with 4 nonzero values, making the problem realizable with a sparse solution while the max-margin solution isn’t sparse. The left panel describes the obtained solution’s correlation with the sparse labeling vector for different depths and initializations. The results are averaged over 100 experiments, with shaded regions denoting empirical standard deviations. We see that depth-1 models reach results similar to the max-margin SVM solution as predicted by Gunasekar et al. (2018), while deeper models are highly correlated with the sparse solution, with this correlation increasing when the initialization scale is small. The other panels show the evolution of the absolute values of the top-5 weights of $\sigma$ for the smallest initialization scale. Note that as we increase the depth, incremental learning is clearly presented.
846
+
847
+ The final layer is a fully connected layer parameterized by $w _ { N } \in \mathbb { R } ^ { d }$ , such that the final model can be written in the following way:
848
+
849
+ $$
850
+ f _ { \sigma } ( x ) = ( ( ( ( x \star w _ { 1 } ) \star w _ { 2 } ) \cdot \cdot \cdot ) \star w _ { N - 1 } ) ^ { T } w _ { N }
851
+ $$
852
+
853
+ Lemma 3 from Gunasekar et al. (2018) shows how we can relate the Fourier coefficients of the weight vectors to the Fourier coefficients of the linear model induced by the model:
854
+
855
+ Lemma. For the circular-convolutional model as in (11):
856
+
857
+ $$
858
+ \hat { \sigma } = d i a g ( \hat { w } _ { 1 } ) \cdot \cdot \cdot d i a g ( \hat { w } _ { N - 1 } ) \hat { w } _ { N } ,
859
+ $$
860
+
861
+ where for $n = 1 , 2 , . . . , N , \hat { w } _ { n } \in \mathbb { C } ^ { d }$ are the Fourier coefficients of the parameters $w _ { n } \in \mathbb { R } ^ { d }$
862
+
863
+ This lemma connects the convolutional network to the diagonal network, and thus we should expect to see the same incremental learning of the values of the diagonal network exhibited by the Fourier coefficients of the convolutional network.
864
+
865
+ # G.3 CONVOLUTIONAL NETWORKS - EMPIRICAL EXAMINATION
866
+
867
+ In figure 7 we see the same plots as in figure 6 but for the Fourier coefficients of the convolutional model. We see that even when the model is far from the toy parameterization (there is no weight sharing and the initialization is with random Gaussian weights), incremental learning is still clearly seen in the dynamics of the model. We see how the inherent reason for the sparsity towards sparse solution found in Gunasekar et al. (2018) is the result of the dynamics of the model - small amplitudes are attenuated while large ones are amplified.
868
+
869
+ ![](images/ce17411c14f982ed90cef0de02508e3a99c1bff2ecdf153320a808745f475e11.jpg)
870
+ Figure 7: Incremental learning in convolutional networks. A model as in appendix G is trained over 200 i.i.d. random Gaussian examples, where $d = 1 0 0$ . The weights are initialized randomly and the data is labeled by a weight vector with 4 nonzero frequencies, making the problem realizable with a sparse solution in the frequency domain. The left panel describes the obtained solution’s correlation in the frequency domain with the sparse labeling vector for different depths and initializations. The results are averaged over 9 experiments, with shaded regions denoting empirical standard deviations. We see that depth-1 models reach results similar to the max-margin SVM solution, while deeper models are highly correlated with the optimal sparse solution. The other panels show the evolution of the amplitudes of the top-5 frequencies of $\sigma$ for the smallest initialization scale. Note that as we increase the depth, incremental learning is clearly presented.
md/train/H8VDvtm1ij8/H8VDvtm1ij8.md ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # NORMALIZING FLOWS FOR CALIBRATION AND RECALIBRATION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ In machine learning, due to model misspecification and overfitting, estimates of the aleatoric uncertainty are often inaccurate. One approach to fix this is isotonic regression, in which a monotonic function is fit on a validation set to map the model’s CDF to an optimally calibrated CDF. However, this makes it infeasible to compute additional statistics of interest on the model distribution (such as the mean). In this paper, through a reframing of recalibration as MLE, we replace isotonic regression with normalizing flows. This allows us to retain the ability to compute the statistical properties of the model (such as closed-form likelihoods, mean, correlation, etc.) and provides an opportunity for additional capacity at the cost of possible overfitting. Most importantly, the fundamental properties of normalizing flows allow us to generalize recalibration to conditional and multivariate distributions. To aid in detecting miscalibration and measuring our success at fixing it, we use a simple extension of the calibration Q-Q plot.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Recent advances in deep learning have led to models with significantly higher overall accuracy on both classification and regression tasks compared to what was achievable in the past. However, an important component in conjunction with accuracy is a model’s ability to accurately assess the uncertainty in its prediction. Most taxonomies classify uncertainty into three sources: approximation, aleatoric, and epistemic uncertainty (Der Kiureghian & Ditlevsen, 2009). Approximation uncertainty quantifies the error from fitting a simple model to complex data. Aleatoric uncertainty quantifies the uncertainty of the conditional distribution of the target variable given features. This uncertainty arises from hidden variables or measurement errors and cannot be reduced through collecting more data under the same experimental conditions. Epistemic uncertainty quantifies the uncertainty arising from fitting a model utilizing finite data, i.e. it is inversely proportional to the density of the training examples and can be reduced by collecting data in the low density regions.
12
+
13
+ These different sources of uncertainty have different techniques for handling them. Using high capacity models such as neural networks removes a large part of the approximation uncertainty. By fitting a full distribution on the target conditional on features, we can model the aleatoric uncertainty from observations. Inaccurate estimates of aleatoric uncertainty can be explained by underfitting (insufficient complexity in the conditional distributions) or overfitting (models with sufficient capacity can memorize the data, leading to the distributions collapsing to deltas). Though epistemic uncertainty is important for the model to answer what it does not know, the focus of this paper is on improving estimates of the aleatoric uncertainty.
14
+
15
+ Our approach in this paper is to handle both model fit and calibration using normalizing flows. Normalizing flows can be used in conjunction with amortized inference to improve the flexibility of the output distribution, and further, through a reframing of recalibration as maximum likelihood estimation (MLE), normalizing flows can be used to handle any miscalibration found on a validation set. Further, we use a simple extension of the calibration plot from Kuleshov et al. (2018) to help with the the analysis of the calibration of a model across different regions of the data.
16
+
17
+ # 2 RELATED WORK
18
+
19
+ One method for handling aleatoric uncertainty is amortized inference with Gaussians (Lakshminarayanan et al., 2017; Nix & Weigend, 1994; Kendall & Gal, 2017) where a model, such as a neural network, maps from features to the parameters of a Gaussian. This approach models aleatoric uncertainty directly but suffers from approximation uncertainty as a Gaussian cannot model complex targets.
20
+
21
+ Another approach is Bayesian methods such as Bayesian Ridge Regression (Tipping, 2001) and MC Dropout (Gal & Ghahramani, 2016). Similar to amortized inference with Gaussians, the output distribution limits the capacity of the model. Full Bayesian techniques with neural networks are often too computationally expensive in practice, and approximate methods often fail to capture the full complexity of the uncertainty (Lakshminarayanan et al., 2017).
22
+
23
+ Another family of methods uses quantile regression with non-linear techniques such as decision trees or neural networks. Some of these methods require a predefined set of quantiles (Takeuchi et al., 2006; Wen et al., 2017; Rodrigues & Pereira, 2018; Taylor, 2000). Simultaneous Quantile Regression (SQR, Tagasovska & Lopez-Paz (2019)) trains one model on all quantiles and is able to learn complex shaped distributions. However the training procedure requires the model to learn to be monotonic instead of being constrained to be so and is not trivial to extend to multidimensional outputs. Pearce et al. (2018) learns a finite set of quantiles by using quality metrics for predictive intervals.
24
+
25
+ Normalizing flows have been used in the contexts of variational inference and generative modeling. The approaches to normalizing flows can be categorized into autoregressive methods (Kingma et al., 2016; Papamakarios et al., 2017; Huang et al., 2018; Cao et al., 2019), coupling layers (Dinh et al., 2014; 2016; Kingma & Dhariwal, 2018; Ho et al., 2019), residual networks (Rezende & Mohamed, 2015; van den Berg et al., 2018; Gopal, 2020) and continuous flows (Grathwohl et al., 2018).
26
+
27
+ # 3 BACKGROUND
28
+
29
+ # 3.1 RECALIBRATION
30
+
31
+ An important goal in modeling is to have well-calibrated distributions as this allows users of the model to understand the confidence the model places on its prediction. In other words, with a well-calibrated model, we can better ascertain the uncertainty in the model’s predictions and respond differently to those predictions depending on the uncertainty surrounding them.
32
+
33
+ Guo et al. (2017) showed that unlike techniques used decades ago such as Bayesian Ridge Regression, modern neural network-based classifiers are very poorly calibrated. A simple variant of Platt scaling and other histogram based techniques applied to a validation set were shown to help alleviate the calibration problem where perfect calibration is defined as
34
+
35
+ $$
36
+ \mathbb { P } ( \hat { Y } = Y | \hat { P } = p ) = p , \quad \forall p \in [ 0 , 1 ]
37
+ $$
38
+
39
+ where $\hat { Y }$ is a class prediction and $\hat { P }$ is its predicted probability of correctness.
40
+
41
+ Kuleshov et al. (2018) extended the analysis in Guo et al. (2017) to neural network-based regressors; isotonic regression, a method for learning monotonic univariate functions, was applied to map from $\mathcal { F } _ { x _ { j } } ( y _ { j } ) = \hat { p } _ { j }$ to $| \{ y _ { n } | \mathcal { F } _ { x _ { n } } ( y _ { n } ) < \hat { p } _ { j } , n \stackrel { - } { = } 1 , . . . , N \} | / N$ (the fraction of the data where the model CDF is less than $\hat { p }$ ) to improve calibration where perfect calibration is defined as
42
+
43
+ $$
44
+ \mathbb { P } ( Y < \mathcal { F } _ { X } ^ { - 1 } ( p ) ) = p , \quad \forall p \in [ 0 , 1 ]
45
+ $$
46
+
47
+ where ${ \mathcal { F } } _ { X }$ is the predicted CDF function.
48
+
49
+ Kuleshov et al. (2018) further introduced calibration error as a metric to quantitatively measure how well the quantiles are aligned:
50
+
51
+ $$
52
+ \begin{array} { r } { \hat { p } _ { j } = \vert \{ y _ { n } \vert \mathcal { F } _ { x _ { n } } ( y _ { n } ) < p _ { j } , n = 1 , \ldots , N \} \vert / N } \\ { \operatorname { c a l } ( y _ { 1 } , \ldots , y _ { N } ) = \displaystyle \sum _ { j = 1 } ^ { M } ( p _ { j } - \hat { p } _ { j } ) ^ { 2 } } \end{array}
53
+ $$
54
+
55
+ where $M$ is the number of quantiles that are evaluated. In this paper, we set this to 100 evenly spaced quantiles.
56
+
57
+ ![](images/52aa6c065ffeced6d996d72cde20955f69b0c8da9a20d8031cebe127f210d0b4.jpg)
58
+ Figure 1: A comparison between using a hypernetwork approach versus conditional approach to creating Conditional QuAR Flows to model $p ( X | c )$ where $W _ { 1 }$ and $W _ { 2 }$ parametrize the layers in the residual connection.
59
+
60
+ # 3.2 NORMALIZING FLOWS
61
+
62
+ A crucial component in improving uncertainty estimates in this paper is to fit normalizing flows, a generative model for density estimation using invertible functions.
63
+
64
+ Suppose that we wish to formulate a joint distribution on an $n$ -dimensional real vector $x$ . A flowbased approach treats $x$ as the result of a transformation $g$ applied to an underlying vector $z$ sampled from a base distribution $p _ { z } ( z )$ . The generative process for flows is defined as:
65
+
66
+ $$
67
+ \begin{array} { l } { z \sim p _ { z } ( z ) } \\ { x = g ( z ) } \end{array}
68
+ $$
69
+
70
+ where $p _ { z }$ is often a Normal distribution and $g$ is an invertible function. Notationally, we will use $f = g ^ { - 1 }$ . Using change of variables, the log likelihood of $x$ is
71
+
72
+ $$
73
+ \log p _ { x } ( x ) = \log p _ { z } \left( f ( x ) \right) + \log \left| { \operatorname* { d e t } \left( \frac { \partial f ( x ) } { \partial x } \right) } \right|
74
+ $$
75
+
76
+ To train flows (i.e. maximize the log likelihood of data points), we need to be able to compute the logarithm of the absolute value of the determinant of the Jacobian of $f$ , also called the log-determinant. To construct large normalizing flows, we can compose smaller ones as this is still invertible and the log-determinant of this composition is the sum of the individual log-determinants.
77
+
78
+ An important observation is that every univariate distribution can be viewed as a flow in which the base distribution $p _ { z } ( z )$ is a Uniform distribution over $[ 0 , 1 ]$ and $g$ is the inverse CDF of the univariate distribution. This can be generalized to multivariate distributions using the chain rule.
79
+
80
+ # 3.3 CONDITIONAL QUAR FLOWS
81
+
82
+ In this paper, the specific normalizing flow used is Quasi-Autoregressive Residual Flows (QuAR Flows, Gopal (2020)). QuAR Flows were shown to handle modeling complex distributions while having nice optimization properties and computationally efficient log-likelihoods. Other commonly used normalizing flows have drawbacks. Coupling layers do not work for one-dimensional inputs. Autoregressive flows are often conditional Gaussians which means in the one-dimensional case, the flow is simply a Gaussian. Residual Flows (Chen et al., 2019) are expressive but, though equivalent to QuAR Flows in the one-dimensional case, are computationally expensive for high-dimensional distributions.
83
+
84
+ If we would like to condition a QuAR Flow given some features $c$ , we could use a hypernetwork that maps $c$ to the parameters of the QuAR Flow (Figure 1a). However, this can be computationally expensive if the QuAR Flow is parameterized with thousands of parameters. Instead, conditional information can be incorporated by concatenating the conditions $c$ before applying the first layer in the residual connection within a QuAR Flow (Figure 1b).
85
+
86
+ # 4 REGRESSION USING NORMALIZING FLOWS
87
+
88
+ The goal of regression is to model the conditional probability distribution $p ( y | x )$ . Frequently, this task is reduced to obtaining point estimates of the mean or median by minimizing the mean squared error or mean absolute error respectively. In order to access uncertainties, we must model the full conditional distribution; in addition to this, we can still retrieve point estimates of the mean, median, or any other distributional statistic. In this section, we discuss how normalizing flows can be used to this end as well as how recalibration can be reframed as maximum likelihood estimation (MLE).
89
+
90
+ # 4.1 CALIBRATION WITH NORMALIZING FLOWS
91
+
92
+ One approach to modeling aleatoric uncertainty is to use amortized inference with a Normal distribution as its output distribution, conditioned on features (Lakshminarayanan et al., 2017). However, if a Gaussian is not appropriate to fit the target, then the error in miscalibration can be attributed to approximation error, i.e. insufficient capacity to learn the distribution. A simple example of this is where we have no features to condition on (or all the features we have contain no relevant information) with a one-dimensional target. In Figure 2, we can see that since the target is bimodal, the Gaussian fit does not well describe the data.
93
+
94
+ To improve this model, we replace the Gaussian with a normalizing flow conditioned on our data, similar to Figure 1b. In this way, the distribution fit to the targets has sufficient capacity to learn complex distributions, including multimodal distributions (Figure 2).
95
+
96
+ # 4.2 RECALIBRATION WITH NORMALIZING FLOWS
97
+
98
+ To handle overfitting of the uncertainty, we recalibrate the results of the original model where we assume the original model outputs a full distribution that has closed-form likelihoods. Since the only requirement is a full distribution with a closed-form likelihood, the original model that we recalibrate can be as simple as a Bayesian Linear Regression model or as complicated as a conditional normalizing flow. We recalibrate the original model by fitting a normalizing flow on top of it. In this way, the training process is the following two-step procedure:
99
+
100
+ ![](images/ad181b91bb85b484eab2f815ac5f66a3057be04180b0b5783e57d91cc0f6099a.jpg)
101
+ Figure 2: One-dimensional example of Gaussian versus Flow
102
+
103
+ $$
104
+ \begin{array} { r l } & { 1 . \ f _ { \theta } = \arg \operatorname* { m a x } _ { f _ { \theta } } \sum _ { i = 1 } ^ { N _ { t r } } \log p _ { f _ { \theta } } ( y _ { i } ^ { t r } | x _ { i } ^ { t r } ) } \\ & { 2 . \ g _ { \phi } = \arg \operatorname* { m a x } _ { g _ { \phi } } \sum _ { i = 1 } ^ { N _ { v a l } } \log p _ { g _ { \phi } } ( F _ { \theta } ( y _ { i } ^ { v a l } | x _ { i } ^ { v a l } ) ) } \end{array}
105
+ $$
106
+
107
+ where the tra $f _ { \boldsymbol { \theta } } ( \boldsymbol { y } | \boldsymbol { x } )$ is thet and nction given is the valid $x$ , i $F _ { \theta } ( y | x )$ is the CDF of hough the for $f _ { \theta } ( y | x ) , \{ x ^ { t r } , y ^ { t r } \} _ { i = 1 } ^ { N _ { t r } }$ ison $\{ x ^ { v a l } , y ^ { v a l } \} _ { i = 1 } ^ { N _ { v a l } }$ above shows we can use any likelihood model for $g _ { \phi }$ , since isotonic regression is a method to fit a free form function to the CDFs, we choose to use normalizing flows, specifically QuAR Flows, as these are more flexible than using autoregressive flows such as MAFs (Papamakarios et al., 2017).
108
+
109
+ After the two-step training, the new generative process is:
110
+
111
+ $$
112
+ \begin{array} { l } { z \sim \mathrm { U n i f o r m } ( 0 , 1 ) } \\ { u = G _ { \phi } ^ { - 1 } ( z ) } \\ { y = F _ { \theta } ^ { - 1 } ( u | x ) } \end{array}
113
+ $$
114
+
115
+ where $G _ { \phi }$ is the CDF of $g _ { \phi }$ . The density function of the above generative process is simply the product of the individual density functions: $f _ { \theta }$ and $g _ { \phi }$ . Given this view of the generative process, one interpretation of the two-step process is to first fit $\theta$ on the training set where $\phi$ is initialized so that $G _ { \phi } ^ { - 1 }$ is the identity function, and then to fit $\phi$ on the validation set while keeping $\theta$ frozen. Though $\theta$ and $\phi$ could be trained end-to-end, similar to the approach in Section 4.1, we show in our experiments (Section 6.2) that there are benefits to this two-step approach.
116
+
117
+ ![](images/9212fa4438adc3e36c2e75cfd149f1d9ffde426fb5aa80f4de671bd843cb558c.jpg)
118
+ Figure 3: Comparison plots of isotonic regression and flow recalibration on multiple outputs. The two axes are different targets being modeled, and the scatter plot shows that the targets are correlated. The top and right sides show the marginal histogram as well as the fit from the recalibrated distribution. The contour plot shows the two-dimensional contours of the recalibrated distribution which can be seen to not align well for isotonic regression.
119
+
120
+ Given this log-likelihood viewpoint of recalibration, we can trivially incorporate conditioning of the normalizing flow on additional information. For example, say $f _ { \theta }$ outputs $\mu$ and $\sigma$ that parameterize a Normal distribution, we could then condition $g _ { \phi }$ on these two outputs. If we were to use many features to condition on, we would return to the first situation where we could overfit to the finite number of observations we have. We can think of the first model $f _ { \theta }$ as compressing/embedding the data into two dimensions, and the second model utilizing the embedding to create a meaningful and well-calibrated distribution on the target. Compared to isotonic regression, we can easily incorporate conditional information while retaining monotonicity as normalizing flows are monotonic by construction.
121
+
122
+ Recalibration is interesting in that it is useful for both overfitting as well as underfitting. From Guo et al. (2017), we see that multinomial classification models have sufficient capacity to overfit uncertainties and benefit from recalibration. On the other hand, the simple example in Figure 2 suffers from miscalibrated uncertainties due to approximation uncertainty (underfitting), and recalibration reduces the approximation error.
123
+
124
+ One solution to handling overfitting is to early-stop on a validation set. Whether early stopping occurs or not, our solution incorporates the information of the validation set to correct potential overfitting. However, if we try to correct for multiple sources of overfitting, then we could introduce a new overfitting problem. In essence, there is a tradeoff between the validation size (which in turn controls training size) and how many sources of overfitting one can try to correct after training.
125
+
126
+ # 4.3 MULTIVARIATE RECALIBRATION
127
+
128
+ Whereas Platt scaling (Guo et al., 2017) and isotonic regression (Kuleshov et al., 2018) have been shown to improve the calibration of distributions when we have one-dimensional outputs, scaling these solutions to high-dimensional targets is non-trivial.
129
+
130
+ Say we are modeling two-dimensional real-valued targets and use isotonic regression to calibrate the targets individually. For simplicity, say we use amortized inference with independent output distributions. If the targets are not conditionally independent, the distribution will not be wellcalibrated, even after recalibration with isotonic regression (Figure 3a). However, using normalizing flows, we can compute the CDF of the observed targets per output distribution and recalibrate this two-dimensional distribution (Figure 3b).
131
+
132
+ The general procedure of recalibrating $N$ -dimensional distributions is to fit a normalizing flow on the $N$ -dimensional vector $x _ { i } = F ( y _ { i } | y _ { < i } )$ .
133
+
134
+ ![](images/bd31ec7371b5fbab3c41c4af090e7e01d02a0effd5315ff0fe11e911a5356c31.jpg)
135
+ Figure 4: Calibration Q-Q plots for recalibration using isotonic regression and recalibration using flows for the simulated multivariate case in Figure 3a. The legend contains the calibration error for each curve.
136
+
137
+ # 5 MULTIVARIATE RECALIBRATION EXAMPLE
138
+
139
+ In multiclass classification, we often focus on individual metrics such as accuracy, precision, recall, F1, etc. However, exploring the accuracy of the separate classes using a confusion matrix can show if the model is biased even if the performance on average is good. Similar to this view for classification, we extend the calibration plot introduced in (Kuleshov et al., 2018) to show calibration performance on different subsets of the data, binned by either a feature or a prediction, e.g. Figure 4. The only restriction is the binning cannot be a function of the target we are evaluating.
140
+
141
+ Say we are modeling two-dimensional real-valued targets $( Y _ { 1 } , Y _ { 2 } )$ shown in Figure 3a. If we fit independent Gaussians to the target, the resulting distribution will not align with the contours of the data.
142
+
143
+ We first recalibrate the distribution by fittting isotonic regression models on $F ( Y _ { 1 } )$ and $F ( Y _ { 2 } | Y _ { 1 } )$ The results for $F ( Y _ { 2 } | Y _ { 1 } )$ are shown in Figure 4a where we can see that, though across the full dataset the calibration error is zero, when we bucket by $F ( Y _ { 1 } )$ , the calibration error achieved is both significant and a strong function of $Y _ { 1 }$ as it is unable to account for correlations in $Y _ { 1 }$ and $Y _ { 2 }$ . In other words, the model is not calibrated in any given region of the data but only in aggregate.
144
+
145
+ However, if we recalibrate using normalizing flows by fitting a flow on the pair $( F ( Y _ { 1 } ) , F ( Y _ { 2 } | Y _ { 1 } ) )$ , we can see in Figure 4b that even if we bucket by $F ( Y _ { 1 } )$ , the calibration error stays close to zero. Unlike isotonic regression, the flow can learn the correlation between the CDFs by being trained jointly on all of them. In addition to this, had we used a more complex calibration model that could model the correlations directly, we would not be able to compute the correlation after recalibrating with isotonic regression. By recalibrating with flows, we obtain a result that is still a distribution with a closed-form likelihood; this allows us to still be able to use the model to compute the correlation and any other distributional statistics.
146
+
147
+ In Figure 5, we show visually the difference between recalibration with flows and with isotonic regression. The key differences being that flows can recalibrate the CDFs jointly and be conditioned on additional information $c$ , while isotonic regression is fit on each CDF independently and is unable to incorporate any additional information. The reason is that flows are monotonic by construction and can therefore handle multiple variables and conditions.
148
+
149
+ # 6 EXPERIMENTS
150
+
151
+ In this section, we analyze the performance of flows on multiple UCI datasets. Importantly, we do not aim for state-of-the-art performance, nor do we expect normalizing flows to outperform isotonic
152
+
153
+ ![](images/875700dffcddbe4a75f5e5d09bdaf048c24fbe3c4bd6dcd6bef0495db4def2fa.jpg)
154
+ Figure 5: A diagram for multivariate recalibration using the same notation as that used in Section 4.2. The first step for recalibration is always the calibration step, shown in the blue box, where any likelihood model $f _ { \theta }$ can be used. On the left, isotonic regression is used to recalibrate the CDFs from $f _ { \theta }$ ; on the right, normalizing flows $g _ { \phi }$ are used to recalibrate the CDFs from $f _ { \theta }$ conditioned on some $c$ .
155
+
156
+ regression in aggregate. In terms of calibration, we show that the increase in expressivity can be beneficial; in terms of recalibration, we show specific failure points of isotonic regression that binning uncovers and how normalizing flows fixes these issues.
157
+
158
+ # 6.1 CALIBRATION
159
+
160
+ To test the effect of increased capacity in distributions, we tested how well normalizing flows improve performance in distributional estimates compared to a few other popular approaches for estimating uncertainties. We do not compare directly against other methods for conditional distributions such as autoregressive flows for the reason specified in Section 3.3: in the one dimensional case, those are often the same as ConditionalGaussian. Instead of replacing the output distribution with a complex distribution created by hand, such as an explicit mixture, we rely on using more expressive flows which can model mixture behavior as well as more complicated behavior such as skew and kurtosis.
161
+
162
+ Table 1: Results before and after recalibration on the UCI dataset “naval-propulsion-plant”. Details on the model methodology as well as performance on other UCI datasets are in Appendix B. The mean squared error (MSE) and its uncertainty is computed using 20 seeds. “Calib” is the calibration error (Equation 1) using 100 quantiles across 20 seeds instead of per seed.
163
+
164
+ <table><tr><td rowspan="3"></td><td colspan="2">Before Recalib.</td><td colspan="2">Isotonic Recalib.</td><td colspan="2">Flow Recalib.</td></tr><tr><td>MSE</td><td>Calib</td><td>MSE</td><td>Calib</td><td>MSE</td><td>Calib</td></tr><tr><td>ConditionalFlow</td><td>0.009 ±0.004</td><td>0.45</td><td>N.A.</td><td>&lt;0.01</td><td>0.016 ± 0.012</td><td>&lt;0.01</td></tr><tr><td>ConditionalGaussian</td><td>0.012 ±0.006</td><td>2.35</td><td>N.A.</td><td>&lt;0.01</td><td>0.012 ±0.006</td><td>&lt;0.01</td></tr><tr><td>BayesianRidgeRegression</td><td>0.055 ±0.004</td><td>8.03</td><td>N.A.</td><td>0.01</td><td>0.48 ± 0.02</td><td>&lt;0.01</td></tr><tr><td>MC Dropout</td><td>0.005 ±0.002</td><td>0.51</td><td>N.A.</td><td>N.A.</td><td>N.A.</td><td>N.A.</td></tr><tr><td>SQR</td><td>0.0052 ± 0.0012</td><td>1.44</td><td>N.A.</td><td>N.A.</td><td>N.A.</td><td>N.A.</td></tr></table>
165
+
166
+ All results were evaluated on a held out test set that was not used for calibration or recalibration. Due to limited space, the full extent of the results and details of the models are left for Appendix A and Appendix B. To show the usefulness of the plot we introduced in Section 5, we focus on the results on the UCI dataset “naval-propulsion-plant” (Dheeru & Karra Taniskidou, 2017) in Table 1 and Section 6.2.
167
+
168
+ The models with consistent performance across UCI datasets in terms of calibration are Bayesian Ridge Regression, Conditional Gaussian, and Conditional Flow, with Conditional Flow often performing well in cases where Conditional Gaussian is unable to. Whereas these three models are well calibrated, the mean performance is much weaker for Bayesian Ridge Regression due to the limitations of linear functions.
169
+
170
+ # 6.2 RECALIBRATION
171
+
172
+ Of the models we tested, we recalibrated the Bayesian Ridge Regression, Conditional Gaussian, and Conditional Flow models. MC Dropout and SQR could also be recalibrated, though we chose not to as they lack closed form CDFs, meaning the technique would be approximate. In Table 1, we see the calibration errors after recalibrating with normalizing flows are comparable to those from isotonic regression. However, after isotonic regression is applied, only the calibration error can be computed. In contrast, we can still compute ordinary distribution statistics such as the mean after applying normalizing flows. Due to this property, we can even detect cases in which an improvement in calibration error coincides with a degradation of mean performance, suggesting if the goal were to only get point estimates of the mean, recalibration could be detrimental. For example, in Table 1 this was the case for Bayesian Ridge Regression.
173
+
174
+ In Figure 6a, whereas the calibration error metric shows the flow recalibrated model is well-calibrated averaged across the full dataset, we can see that see that, when bucketing by the predicted mean, the calibration error is significant.
175
+
176
+ To improve this, we recalibrate with a normalizing flow conditioned on the mean predicted by the original model. In this way, we see in Figure 6b that though the aggregate performance does not change, the performance is improved across different buckets. In essence we see that if we were analyzing the distribution across the dataset, we would be accurate; if we started to look closer to individual distributions, the performance is worse suggesting the quantiles of individual distributions cannot be trusted.
177
+
178
+ ![](images/5ba0a74e3b6aa56744216a122f89938ce61fa7461edf3b64016e47551252acc8.jpg)
179
+ Figure 6: Calibration Q-Q plots for recalibration with an unconditional flow and recalibration with a conditional flow on the dataset “naval-propulsion-plant”. The legend contains the calibration error for each curve.
180
+
181
+ ![](images/96799e60b702cd7228ab4ea95bae04d75bb639f63db7286ef906822c86a386ab.jpg)
182
+ Figure 7: Calibration Q-Q plots for recalibration with isotonic regression and recalibration with normalizing flows on the second time step on the dataset “electricity”. The legend contains the calibration error for each curve.
183
+
184
+ # 6.3 TIME SERIES
185
+
186
+ For our time series example, we trained a model on the UCI Dataset “electricity”. We predict two time steps and show that even though we used an autoregressive model for calibration (the model could learn correlated distributions), there is still some correlation not captured that recalibration can help with.
187
+
188
+ Figure 7a shows that the calibration error of $F ( Y _ { 2 } | Y _ { 1 } )$ when recalibrated independently with isotonic regression is significant. Figure 7b shows that a flow trained jointly on the CDFs significantly reduces the errors. Although the calibration error of the marginal distribution for the second step is comparable between the two approaches, the conditional performance favors normalizing flows. A possible explanantion of the still imperfect calibration of the flow model, though better than isotonic regression, is distribution shift.
189
+
190
+ # 7 CONCLUSION AND FUTURE WORK
191
+
192
+ In this paper, we addressed the calibration issue in modern neural networks through using higher capacity distributions via normalizing flows. We showed that normalizing flows can not only help during calibration, but also in recalibrating miscalibrated distributions, even improving the fit in the underfitting case. Though isotonic regression also uses a two-step producedure, we reframe the problem as MLE through which we can trivially generalize recalibration to the multivariate case. Though isotonic regression could be extended such that we could compute the log likelihood implied by its change of variables, normalizing flows are a more natural way to handle this with more research backing this technique, and are easily extendable to conditional and joint distributions. Interestingly, though the Conditional Flow has all it needs to be well calibrated, recalibration helps the overall calibration which was similarly found for classification in Guo et al. (2017); it remains for future work to better understand why and when this is useful.
193
+
194
+ Further, we extend the plot introduced in Kuleshov et al. (2018) by showing the calibration error on different subsets of the data, for example bucketed by mean prediction. Though this plot is able to show the calibration error across buckets, for future work, we will explore ways to visually show any trends in the miscalibration as well as whether the misalignments of the quantiles are statistically significant.
195
+
196
+ # REFERENCES
197
+
198
+ Nicola De Cao, Wilker Aziz, and Ivan Titov. Block neural autoregressive flow. In Conference on Uncertainty in Artificial Intelligence, volume 3, pp. 1723–1735. UAI, 2019. URL http: //auai.org/uai2019/proceedings/papers/511.pdf.
199
+
200
+ Ricky T. Q. Chen, Jens Behrmann, David K Duvenaud, and Joern-Henrik Jacobsen. Residual flows for invertible generative modeling. In H. Wallach, H. Larochelle, A. Beygelzimer, F. dAlch ´ e-´ Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 9916–9926. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/9183- residual-flows-for-invertible-generative-modeling.pdf.
201
+
202
+ Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and Accurate Deep Network ´ Learning by Exponential Linear Units (ELUs). arXiv e-prints, art. arXiv:1511.07289, November 2015.
203
+
204
+ Armen Der Kiureghian and Ove Ditlevsen. Aleatory or epistemic? does it matter? Structural safety, 31(2):105–112, 2009.
205
+
206
+ Dua Dheeru and Efi Karra Taniskidou. UCI machine learning repository, 2017. URL http: //archive.ics.uci.edu/ml.
207
+
208
+ Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear Independent Components Estimation. arXiv e-prints, art. arXiv:1410.8516, October 2014.
209
+
210
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. arXiv e-prints, art. arXiv:1605.08803, May 2016.
211
+
212
+ Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 1050–1059, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/v48/gal16.html.
213
+
214
+ Achintya Gopal. Quasi-Autoregressive Residual (QuAR) Flows. arXiv e-prints, art. arXiv:2009.07419, September 2020.
215
+
216
+ Will Grathwohl, Ricky T. Q. Chen, Jesse Bettencourt, Ilya Sutskever, and David Duvenaud. FFJORD: Free-form Continuous Dynamics for Scalable Reversible Generative Models. arXiv e-prints, art. arXiv:1810.01367, October 2018.
217
+
218
+ Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1321–1330, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/guo17a.html.
219
+
220
+ Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2722–2730, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/ v97/ho19a.html.
221
+
222
+ Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2078–2087, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/huang18d.html.
223
+
224
+ Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu. Lightgbm: A highly efficient gradient boosting decision tree. In
225
+
226
+ 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. 3146–3154. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/6907-lightgbm-ahighly-efficient-gradient-boosting-decision-tree.pdf.
227
+
228
+ Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? 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. 5574–5584. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7141-what-uncertainties-do-we-needin-bayesian-deep-learning-for-computer-vision.pdf.
229
+
230
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 10215–10224. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/8224-glow-generative-flowwith-invertible-1x1-convolutions.pdf.
231
+
232
+ Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4743–4751. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/6581-improved-variationalinference-with-inverse-autoregressive-flow.pdf.
233
+
234
+ Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2796–2804, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/kuleshov18a.html.
235
+
236
+ Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. 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. 6402–6413. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7219-simple-and-scalablepredictive-uncertainty-estimation-using-deep-ensembles.pdf.
237
+
238
+ David A Nix and Andreas S Weigend. Estimating the mean and variance of the target probability distribution. In Proceedings of 1994 ieee international conference on neural networks (ICNN’94), volume 1, pp. 55–60. IEEE, 1994.
239
+
240
+ George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. 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. 2338–2347. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/6828-maskedautoregressive-flow-for-density-estimation.pdf.
241
+
242
+ Tim Pearce, Alexandra Brintrup, Mohamed Zaki, and Andy Neely. High-quality prediction intervals for deep learning: A distribution-free, ensembled approach. volume 80 of Proceedings of Machine Learning Research, pp. 4075–4084, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/pearce18a.html.
243
+
244
+ Boris Polyak and Anatoli Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30:838–855, 07 1992. doi: 10.1137/0330046.
245
+
246
+ Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1530–1538, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr.press/v37/rezende15.html.
247
+
248
+ Filipe Rodrigues and Francisco C. Pereira. Beyond expectation: Deep joint mean and quantile regression for spatio-temporal problems. arXiv e-prints, art. arXiv:1808.08798, August 2018.
249
+
250
+ David Salinas, Valentin Flunkert, and Jan Gasthaus. DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks. arXiv e-prints, art. arXiv:1704.04110, April 2017.
251
+
252
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929–1958, 2014. URL http://jmlr.org/papers/v15/ srivastava14a.html.
253
+
254
+ Natasa Tagasovska and David Lopez-Paz. Single-model uncertainties for deep learning. In Advances in Neural Information Processing Systems 32, pp. 6417–6428. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/8870-single-modeluncertainties-for-deep-learning.pdf.
255
+
256
+ Ichiro Takeuchi, Quoc V Le, Timothy D Sears, and Alexander J Smola. Nonparametric quantile estimation. Journal of Machine Learning Research, 7:1231–1264, 2006.
257
+
258
+ James W Taylor. A quantile regression neural network approach to estimating the conditional density of multiperiod returns. Journal of Forecasting, 19:299–311, 2000.
259
+
260
+ Michael E Tipping. Sparse bayesian learning and the relevance vector machine. Journal of machine learning research, 1(Jun):211–244, 2001.
261
+
262
+ Rianne van den Berg, Leonard Hasenclever, Jakub M. Tomczak, and Max Welling. Sylvester Normalizing Flows for Variational Inference. arXiv e-prints, art. arXiv:1803.05649, March 2018.
263
+
264
+ Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A Multi-Horizon Quantile Recurrent Forecaster. arXiv e-prints, art. arXiv:1711.11053, November 2017.
265
+
266
+ ![](images/c75db8aacd9d4a38c987062b87207c17d500f45fc7262577a8766d51b64af6c7.jpg)
267
+ Figure 8: In this figure, we show our conditional flow model. A neural network takes $X$ and outputs the scale and shift of an affine flow and a condition vector for QuAR Flows. The condition used in the QuAR Flow is the same for both $\mathrm { Q u A R }$ Flows. After the first conditional affine flow, there are two QuAR Flows with unconditional affine flows placed in between these two and at the end. The Conditional Flow model is equivalent to a Conditional Gaussian if we removed the QuAR Flows.
268
+
269
+ # A MODEL TRAINING DETAILS
270
+
271
+ # A.1 CALIBRATION
272
+
273
+ We compare the performance of our model and multiple other popular approaches on 8 UCI datasets (Dheeru & Karra Taniskidou, 2017): boston-housing, concrete, energy, kin8nm, naval-propulsionplant, power-plant, wine-quality-red and yacht. The models we compared Conditional Flows to were: Conditional Gaussian (amortized inference with Gaussians, Lakshminarayanan et al. (2017)), Bayesian Ridge Regression (Tipping, 2001), MC Dropout (Gal & Ghahramani, 2016), Simultaneous Quantile Regression (SQR) (Tagasovska & Lopez-Paz, 2019), Conditional Quantile (SQR where we only learn prespecified quantiles), Quality Driven (Pearce et al., 2018), and a Gradient Boosted Decision Tree with LightGBM (Ke et al., 2017).
274
+
275
+ Figure 8 shows a representation of the Conditional Flow network we used. The QuAR Flows are conditioned on a 64-dimensional representation from the condition network. Each Conditional QuAR Flow has two hidden layers in the residual connection with a hidden size 64 with ELU (Clevert et al., 2015) as our activation. The condition network has a single hidden layer with size 64 and ReLU as our activation. The QuAR Flows are conditioned on the 64-dimensional representation from the condition network.
276
+
277
+ For the other neural network approaches, we used networks with two hidden layers with size 128 and used ReLU as our nonlinearity. For hyperparameter tuning on all our neural networks, we searched the following grid:
278
+
279
+ • Learning rate: 1e-2, 1e-3, 1e-4
280
+ • Weight decay: 0, 1e-3, 1e-2, 1e-1
281
+ • Dropout Rates: 0.1 0.25, 0.5 0.75
282
+
283
+ The hyperparameters we used were taken from Tagasovska & Lopez-Paz (2019). We trained each of our neural networks for 2000 epochs with batch size 128.
284
+
285
+ For our LightGBM tree model (Ke et al., 2017), we used mean squared error as our loss to learn the mean of the output distribution. The grid of hyperparameters we searched was:
286
+
287
+ • Number of Trees: 100, 1000
288
+ • Maximum Depths: 3, 5, 7, 9
289
+ • Learning Rates: 1e-1, 1e-2, 1e-3, 1e-4
290
+ • Minimum Child Samples: 1, 20
291
+ • Dropout Rates: 0.1 0.25, 0.5 0.75
292
+
293
+ To make the tree model distributional, assuming homoscedasticity, we computed the standard deviation of the predicted normal distribution by computing the standard deviation of the residuals (observations minus predictions).
294
+
295
+ For SQR and MC Dropout, we computed the estimated mean and CDF from 1000 samples. For Conditional Flows, we computed the estimated mean by using the Gauss-Legendre quadrature with 100 points to approximate the integral.
296
+
297
+ # A.2 RECALIBRATION
298
+
299
+ For recalibration, we trained the recalibration model on the validation set of each of the 20 seeds. For the flow architecture, we stacked 8 QuAR Flows with affine flows in between each one as well as at the beginning and end. Since the input to the flow is a $\mathrm { C D F } \in [ 0 , 1 ]$ , we also transform the data with a Logit Function as the first layer of the flow and account for the change of variables in the loss. In addition to this, we used a dropout rate of 0.25, two hidden layers with size 64 in each residual connection, and used Polyak averaging (Polyak & Juditsky, 1992) with a decay of 0.999 for evaluation.
300
+
301
+ # A.3 TIME SERIES
302
+
303
+ For our time series experiments, we tested the performance of flow recalibration on the UCI dataset “electricity”. We filtered the data down to observations after 2014-01-01. We split the data by date, where the first $72 \%$ of dates are in the train set, the next $18 \%$ are in validation set, and the last $10 \%$ are in the test set.
304
+
305
+ The data is given in 15 minute increments, and so similarly to Deep AR (Salinas et al., 2017), we averaged the values per hour to have hourly data. Since we were trying to analyze the effect of correlated targets, we predicted two time steps conditioned on 48 hours of data using an autoregressive model.
306
+
307
+ We included three numeric covariates: the time step within the sampled time series, the hour of the day, and the day of the week. Each of the covariates were normalized to have zero mean and one standard deviation. In addition to this, since there are 370 different types of time series, we also added an embedding layer from 370 to an embedding dimension of 20, same as that used in Deep AR (Salinas et al., 2017). We concatenated this vector with the observations and covariates, leading to a 27-dimensional vector.
308
+
309
+ Since all the observations are positive, we model the target with a conditional Gamma distribution (i.e. amortized inference with Gamma distributiet al., 2017), we normalized each time series $\{ z _ { i , t } \} _ { t = 0 } ^ { T - 1 }$ of by $\begin{array} { r } { v _ { i } = 1 + 1 / T \sum _ { t = 0 } ^ { T - 1 } z _ { i , t } . } \end{array}$ eep AR (Salinas. We account for the scaling in the output distribution, i.e. Gamma $( k , \theta * v _ { i } )$ .
310
+
311
+ The model we used was a 1 layer LSTM, and then two linear layers with a ReLU and Dropout (Srivastava et al., 2014) in between were applied to the hidden representation. We set the dropout rate to 0.5 and used a hidden size of 48 everywhere. For evaluation, we used Polyak averaging (Polyak & Juditsky, 1992) with a decay of 0.999.
312
+
313
+ For recalibration with flows, we trained on the CDFs for both time steps with a flow with the same architecture as that used in Appendix A.2.
314
+
315
+ # B EXPERIMENTAL RESULTS
316
+
317
+ # B.1 CALIBRATION
318
+
319
+ In Table 2, we compare Conditional Flows against multiple other approaches for estimating uncertainty, and we measure performance using Prediction Interval Coverage Probability (PICP), Mean Squared Error (MSE), and Calibration Error.
320
+
321
+ For each model, we trained the model on 20 different seeds where each seed randomly splits the data in $72 \%$ train, $18 \%$ validation, and $10 \%$ test. We picked the best hyperparameter by choosing the hyperparameters that gave the best average validation loss across the 20 seeds where the loss used is the loss defined by the training procedure for the model, e.g. for Conditional Gaussian, we used log likelihood; for LightGBM, we used MSE; for QualityDriven, we used the Quality Driven Loss, etc.
322
+
323
+ Table 2: Results on percentage of data captured from 0.025 to 0.975 quantiles (PICP), MSE, and calibration error with 100 buckets. The results are from minimizing the average validation loss across 20 seeds. The optimal value of PICP is 0.95, and the optimal value for MSE and Calib is 0.00.
324
+
325
+ <table><tr><td></td><td colspan="3">bostonHousing</td><td colspan="3">concrete</td></tr><tr><td></td><td>PICP</td><td>MSE</td><td>Calib</td><td>PICP</td><td>MSE</td><td>Calib</td></tr><tr><td>ConditionalFlow</td><td>0.93 ± 0.04</td><td>0.13 ± 0.06</td><td>0.06</td><td>0.92 ± 0.03</td><td>0.09 ±0.03</td><td>0.01</td></tr><tr><td>ConditionalGaussian</td><td>0.93 ± 0.03</td><td>0.14±0.07</td><td>0.13</td><td>0.91 ± 0.02</td><td>0.09 ±0.03</td><td>0.06</td></tr><tr><td>BayesianRidgeRegression</td><td>0.95 ± 0.03</td><td>0.28±0.08</td><td>0.34</td><td>0.95 ± 0.03</td><td>0.40±0.07</td><td>0.01</td></tr><tr><td>MC Dropout</td><td>0.50 ± 0.08</td><td>0.11 ± 0.05</td><td>2.99</td><td>0.69 ± 0.05</td><td>0.07±0.03</td><td>0.89</td></tr><tr><td>SQR</td><td>0.73 ± 0.08</td><td>0.11 ± 0.05</td><td>0.48</td><td>0.74± 0.04</td><td>0.07± 0.03</td><td>0.47</td></tr><tr><td>ConditionalQuantile</td><td>0.92 ± 0.05</td><td>N.A.</td><td>N.A.</td><td>0.93 ± 0.03</td><td>N.A.</td><td>N.A.</td></tr><tr><td>QualityDriven</td><td>0.83 ± 0.06</td><td>N.A.</td><td>N.A.</td><td>0.83± 0.04</td><td>N.A.</td><td>N.A.</td></tr><tr><td>LightGBM</td><td>0.04±0.03</td><td>0.12 ± 0.06</td><td>7.74</td><td>0.63±0.07</td><td>0.07±0.02</td><td>1.25</td></tr><tr><td></td><td colspan="3">energy</td><td colspan="3">kin8nm</td></tr><tr><td></td><td>PICP</td><td>MSE</td><td>Calib</td><td>PICP</td><td>MSE</td><td>Calib</td></tr><tr><td>ConditionalFlow</td><td>0.96 ± 0.02</td><td>0.0022 ± 0.0006</td><td>0.12</td><td>0.952 ± 0.006</td><td>0.081 ± 0.013</td><td>0.01</td></tr><tr><td>ConditionalGaussian</td><td>0.97 ± 0.03</td><td>0.0030± 0.0009</td><td>0.26</td><td>0.947 ± 0.007</td><td>0.071 ± 0.005</td><td>&lt;0.01</td></tr><tr><td>BayesianRidgeRegression</td><td>0.89 ± 0.04</td><td>0.09 ±0.02</td><td>0.24</td><td>0.951 ± 0.007</td><td>0.59 ± 0.02</td><td>0.09</td></tr><tr><td>MC Dropout</td><td>0.97± 0.02</td><td>0.0026 ± 0.0010</td><td>0.17</td><td>0.69 ± 0.02</td><td>0.069 ± 0.005</td><td>1.14</td></tr><tr><td>SQR</td><td>0.97± 0.02</td><td>0.0028 ± 0.0012</td><td>0.37</td><td>0.892 ± 0.010</td><td>0.072 ± 0.005</td><td>0.01</td></tr><tr><td>ConditionalQuantile</td><td>0.98 ±0.02</td><td>N.A.</td><td>N.A.</td><td>0.943 ± 0.011</td><td>N.A.</td><td>N.A.</td></tr><tr><td>QualityDriven</td><td>0.96 ± 0.04</td><td>N.A.</td><td>N.A.</td><td>0.88±0.02</td><td>N.A.</td><td>N.A.</td></tr><tr><td>LightGBM</td><td>0.24±0.05</td><td>0.0013 ± 0.0006</td><td>5.18</td><td>0.205 ± 0.010</td><td>0.190 ± 0.011</td><td>5.59</td></tr><tr><td></td><td colspan="3">naval-propulsion-plant</td><td colspan="3">power-plant</td></tr><tr><td></td><td>PICP</td><td>MSE</td><td>Calib</td><td>PICP</td><td>MSE</td><td>Calib</td></tr><tr><td>ConditionalFlow</td><td>0.98 ± 0.03</td><td>0.009 ±0.004</td><td>0.45</td><td>0.952 ± 0.007</td><td>0.048 ±0.007</td><td>0.01</td></tr><tr><td>ConditionalGaussian</td><td>0.9995 ± 0.0007</td><td>0.012 ± 0.006</td><td>2.35</td><td>0.947 ± 0.010</td><td>0.048 ±0.006</td><td>&lt;0.01</td></tr><tr><td>BayesianRidgeRegression</td><td>1.0 ±0.0</td><td>0.055 ± 0.004</td><td>8.03</td><td>0.964 ± 0.007</td><td>0.072 ± 0.007</td><td>0.01</td></tr><tr><td>MC Dropout</td><td>0.98 ±0.02</td><td>0.005±0.002</td><td>0.51</td><td>0.59 ±0.02</td><td>0.046±0.007</td><td>1.88</td></tr><tr><td>SQR</td><td>0.998 ± 0.002</td><td>0.0052 ± 0.0012</td><td>1.44</td><td>0.93 ± 0.02</td><td>0.048 ±0.007</td><td>0.02</td></tr><tr><td>ConditionalQuantile</td><td>0.97±0.02</td><td>N.A.</td><td>N.A.</td><td>0.937 ± 0.014</td><td>N.A.</td><td>N.A.</td></tr><tr><td>QualityDriven</td><td>0.949 ± 0.010</td><td>N.A.</td><td>N.A.</td><td>0.89 ±0.02</td><td>N.A.</td><td>N.A.</td></tr><tr><td>LightGBM</td><td>0.714 ± 0.011</td><td>0.0056 ± 0.0009</td><td>0.79</td><td>0.17 ± 0.02</td><td>0.035 ± 0.007</td><td>5.95</td></tr><tr><td></td><td colspan="3">wine-quality-red</td><td colspan="3">yacht</td></tr><tr><td></td><td>PICP</td><td>MSE</td><td>Calib</td><td>PICP</td><td>MSE</td><td>Calib</td></tr><tr><td>ConditionalFlow</td><td>0.90 ±0.02</td><td>0.6±0.2</td><td>0.04</td><td>0.95 ± 0.04</td><td>0.004��0.003</td><td>0.27</td></tr><tr><td>ConditionalGaussian</td><td>0.95 ± 0.02</td><td>0.59 ± 0.09</td><td>0.22</td><td>0.99 ±0.02</td><td>0.004±0.002</td><td>0.62</td></tr><tr><td>BayesianRidgeRegression</td><td>0.95 ± 0.02</td><td>0.63 ± 0.11</td><td>0.05</td><td>0.94± 0.03</td><td>0.35 ± 0.10</td><td>0.25</td></tr><tr><td>MC Dropout</td><td>0.35 ± 0.04</td><td>0.57 ±0.09</td><td>4.01</td><td>0.97 ± 0.04</td><td>0.004±0.002</td><td>0.21</td></tr><tr><td>SQR</td><td>0.81±0.09</td><td>0.59 ±0.10</td><td>0.15</td><td>0.96 ±0.04</td><td>0.004±0.004</td><td>0.49</td></tr><tr><td>ConditionalQuantile</td><td>0.95 ± 0.02</td><td>N.A.</td><td>N.A.</td><td>0.99 ± 0.02</td><td>N.A.</td><td>N.A.</td></tr><tr><td>QualityDriven</td><td>0.84 ±0.03</td><td>N.A.</td><td>N.A.</td><td>0.97 ± 0.04</td><td>N.A.</td><td>N.A.</td></tr><tr><td>LightGBM</td><td>0.40 ± 0.05</td><td>0.55± 0.10</td><td>2.93</td><td>0.45 ± 0.08</td><td>0.003±0.003</td><td>3.04</td></tr></table>
326
+
327
+ Table 3: Calibration error (with 100 buckets) before and after recalibration.
328
+
329
+ <table><tr><td></td><td colspan="3">BayesianRidgeRegression</td><td colspan="3">ConditionalGaussian</td><td colspan="3">ConditionalFlow</td></tr><tr><td></td><td>Before</td><td>Flow</td><td>Iso</td><td>Before</td><td>Flow</td><td>Iso</td><td>Before</td><td>Flow</td><td>Iso</td></tr><tr><td>bostonHousing</td><td>0.34</td><td>0.02</td><td>0.02</td><td>0.13</td><td>0.04</td><td>0.02</td><td>0.06</td><td>0.02</td><td>0.01</td></tr><tr><td>concrete</td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.06</td><td>0.02</td><td>0.02</td><td>0.01</td><td>0.02</td><td>0.03</td></tr><tr><td>energy</td><td>0.24</td><td>0.02</td><td>0.01</td><td>0.26</td><td>&lt;0.01</td><td>0.01</td><td>0.12</td><td>0.01</td><td>0.01</td></tr><tr><td>kin8nm</td><td>0.09</td><td>0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>0.01</td><td>&lt;0.01</td><td>&lt;0.01</td></tr><tr><td>naval-propulsion-plant</td><td>8.03</td><td>0.01</td><td>&lt;0.01</td><td>2.35</td><td>&lt;0.01</td><td>&lt;0.01</td><td>0.45</td><td>&lt;0.01</td><td>&lt;0.01</td></tr><tr><td>power-plant</td><td>0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>&lt;0.01</td><td>0.01</td><td>&lt;0.01</td><td>&lt;0.01</td></tr><tr><td>wine-quality-red</td><td>0.05</td><td>0.02</td><td>&lt;0.01</td><td>0.22</td><td>0.04</td><td>0.02</td><td>0.04</td><td>0.01</td><td>0.01</td></tr><tr><td>yacht</td><td>0.25</td><td>0.05</td><td>0.07</td><td>0.62</td><td>0.03</td><td>0.03</td><td>0.27</td><td>0.02</td><td>0.03</td></tr></table>
330
+
331
+ Table 4: MSE performance before and after recalibration. We do not show the MSE for isotonic regression as the mean cannot be computed after recalibrating with isotonic regression.
332
+
333
+ <table><tr><td rowspan="3"></td><td colspan="2">BayesianRidgeRegression</td><td colspan="2">ConditionalGaussian</td></tr><tr><td>Before</td><td>Flow</td><td>Before</td><td>Flow</td></tr><tr><td>bostonHousing</td><td>0.28 ±0.08</td><td>0.28 ±0.08</td><td>0.14 ± 0.07</td><td>0.14 ± 0.07</td></tr><tr><td>concrete</td><td>0.40 ± 0.07</td><td>0.40 ± 0.07</td><td>0.09 ±0.03</td><td>0.09 ± 0.03</td></tr><tr><td>energy</td><td>0.09 ±0.02</td><td>0.09 ±0.02</td><td>0.0030 ±0.0009</td><td>0.0032 ± 0.0011</td></tr><tr><td>kin8nm</td><td>0.59 ± 0.02</td><td>0.59 ± 0.02</td><td>0.071 ± 0.005</td><td>0.072 ± 0.005</td></tr><tr><td>naval-propulsion-plant</td><td>0.055 ± 0.004</td><td>0.48 ±0.02</td><td>0.012 ± 0.006</td><td>0.012 ± 0.007</td></tr><tr><td>power-plant</td><td>0.072 ± 0.007</td><td>0.072 ± 0.007</td><td>0.048 ± 0.006</td><td>0.049 ± 0.006</td></tr><tr><td>wine-quality-red</td><td>0.63 ± 0.11</td><td>0.63 ± 0.11</td><td>0.59 ± 0.09</td><td>0.59 ± 0.10</td></tr><tr><td>yacht</td><td>0.35 ± 0.10</td><td>0.36 ± 0.10</td><td>0.004 ±0.002</td><td>0.004 ± 0.003</td></tr><tr><td colspan="2"></td><td colspan="2">ConditionalFlow</td><td></td></tr><tr><td rowspan="10"></td><td></td><td>Before</td><td>Flow</td><td></td></tr><tr><td>bostonHousing</td><td>0.13 ± 0.06</td><td></td><td></td></tr><tr><td>concrete</td><td>0.09 ± 0.03</td><td>0.13 ± 0.06 0.09 ± 0.03</td><td></td></tr><tr><td></td><td>0.0022 ± 0.0006</td><td>0.0027 ± 0.0007</td><td></td></tr><tr><td>energy kin8nm</td><td>0.081 ± 0.013</td><td>0.081 ± 0.013</td><td></td></tr><tr><td>naval-propulsion-plant</td><td>0.009 ± 0.004</td><td>0.016 ± 0.012</td><td></td></tr><tr><td>power-plant</td><td>0.048 ± 0.007</td><td>0.048 ± 0.007</td><td></td></tr><tr><td>wine-quality-red</td><td>0.6± 0.2</td><td>0.64 ± 0.15</td><td></td></tr><tr><td>yacht</td><td></td><td></td><td></td></tr><tr><td></td><td>0.004 ± 0.003</td><td>0.008 ± 0.012</td><td></td></tr></table>
334
+
335
+ Reported in Table 2 are the mean and standard deviation of PICP and MSE across the 20 seeds. Due to the limited data, for calibration error with 100 bins, we computed it over the CDFs from all 20 seeds. We included PICP (the percentage of true observations between the quantiles 0.025 and 0.975) to compare against alternative approaches where we prespecify which quantiles we need.
336
+
337
+ # B.2 RECALIBRATION
338
+
339
+ From the above section, we recalibrate the best Bayesian Ridge Regression, Conditional Gaussian, and Conditional Flow. In Table 3, we compare the calibration error before recalibration, after recalibration with isotonic regression, and after recalibration with normalizing flows.
340
+
341
+ As we can see, across all 8 UCI datasets, the calibration errors after recalibrating with normalizing flows are comparable to those from isotonic regression. More interestingly though, improvement in calibration error can be detrimental to mean performance.
md/train/Hk6a8N5xe/Hk6a8N5xe.md ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLASSIFY OR SELECT: NEURAL ARCHITECTURES FOR EXTRACTIVE DOCUMENT SUMMARIZATION
2
+
3
+ Ramesh Nallapati, Bowen Zhou IBM Watson Yorktown Heights, NY 10598 USA {nallapati,zhou}@us.ibm.com
4
+
5
+ Mingbo Ma
6
+ Oregon State University
7
+ Kelley Engineering Center, Corvallis, OR, 97331
8
+ mam@oregonstate.edu
9
+
10
+ # ABSTRACT
11
+
12
+ We present two novel and contrasting Recurrent Neural Network (RNN) based architectures for extractive summarization of documents. The Classifier based architecture sequentially accepts or rejects each sentence in the original document order for its membership in the final summary. The Selector architecture, on the other hand, is free to pick one sentence at a time in any arbitrary order to piece together the summary.
13
+
14
+ Our models under both architectures jointly capture the notions of salience and redundancy of sentences. In addition, these models have the advantage of being very interpretable, since they allow visualization of their predictions broken up by abstract features such as information content, salience and redundancy.
15
+
16
+ We show that our models reach or outperform state-of-the-art supervised models on two different corpora. We also recommend the conditions under which one architecture is superior to the other based on experimental evidence.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Document summarization is an important problem that has many applications in information retrieval and natural language understanding. Summarization techniques are mainly classified into two categories: extractive and abstractive. Extractive methods aim to select salient snippets, sentences or passages from documents, while abstractive summarization techniques aim to concisely paraphrase the information content in the documents.
21
+
22
+ A vast majority of the literature on document summarization is devoted to extractive summarization. Traditional methods for extractive summarization can be broadly classified into greedy approaches (e.g., Carbonell & Goldstein (1998)), graph based approaches (e.g., Radev & Erkan (2004)) and constraint optimization based approaches (e.g., McDonald (2007)).
23
+
24
+ Recently, neural network based approaches have become popular for extractive summarization. For example, Kageback et al. (2014) employed the recursive autoencoder (Socher et al. (2011)) to summarize documents, producing best performance on the Opinosis dataset (Ganesan et al. (2010)). Yin & Pei (2015) applied Convolutional Neural Networks (CNN) to project sentences to continuous vector space and then select sentences by minimizing the cost based on their ‘prestige’ and ‘diverseness’, on the task of multi-document extractive summarization. Another related work is that of Cao et al. (2016), who address the problem of query-focused multi-document summarization using query-attention-weighted CNNs.
25
+
26
+ Recently, with the emergence of strong generative neural models for text Bahdanau et al. (2014), abstractive techniques are also becoming increasingly popular (Rush et al. (2015), Nallapati et al. (2016b) and Nallapati et al. (2016a)). Despite the emergence of abstractive techniques, extractive techniques are still attractive as they are less complex, less expensive, and generate grammatically and semantically correct summaries most of the time. In a very recent work, Cheng & Lapata (2016) proposed an attentional encoder-decoder for extractive single-document summarization and trained it on Daily Mail corpus, a large news data set, achieving state-of-the-art performance. Like Cheng & Lapata (2016), our work also focuses only on sentential extractive summarization of single documents using neural networks.
27
+
28
+ # 2 TWO ARCHITECTURES
29
+
30
+ Our architectures are motivated by two intuitive strategies that humans tend to adopt when they are tasked with extracting salient sentences in a document. The first strategy, which we call Classify, involves reading the whole document once to understand its contents, and then traversing through the sentences in the original document order and deciding whether or not each sentence belongs to the summary. The other strategy that we call Select involves memorizing the whole document once as before, and then picking sentences that should belong to the summary one at a time, in any order of one’s choosing. Qualitatively, the latter strategy appears to be a better one since it allows us to make globally optimal decisions at each step. While it may be harder for humans to follow this strategy since we are forgetful by nature, one may expect that the Select strategy could deliver an advantage for the machines, since ’forgetfulness’ is not a real ‘concern’ for them. In this work, we will explore both the strategies empirically and make a recommendation on which strategy is optimal under what conditions.
31
+
32
+ Broadly, our Classify architecture involves an RNN based sequence classification model that sequentially classifies each sentence into 0/1 binary labels, while the Select architecture involves a generative model that sequentially generates the indices of the sentences that should belong to the summary. We will first discuss the components shared by both the architectures and then we will present each architecture separately.
33
+
34
+ Shared Building Blocks: Both architectures begin with word-level bidirectional Gated Recurrent Unit (GRU) based RNNs (Chung et al. (2014)) run independently over each sentence in the document, where each time-step of the RNN corresponds to a word index in the sentence. The average pooling of the concatenated hidden states of this bidirectional RNN is then used as an input to another bidirectional RNN whose time steps correspond to sentence indices in the document. The concatenated hidden states $\mathbf { \hat { h } } \mathbf { \Phi } $ from the forward and backward layers of this second layer of bidirectional RNN at each time step are used as corresponding sentence representations. We also use the average pooling of the sentence representations as the document representation $\mathbf { \cdot } _ { \mathbf { d } } ,$ . Both architectures also maintain a dynamic summary representation ‘s’ whose estimation is architecture dependent. Models under each architecture compute a score for each sentence towards its summary membership. Motivated by the need to build humanly interpretable models, we compute this score by explicitly modeling abstract features such as salience, novelty and information content as shown below:
35
+
36
+ $$
37
+ \begin{array} { r l r l } { \mathord { \mathrm { s c o r e } } ( \mathbf { h } _ { j } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { j } ) = w _ { c } \sigma ( \mathbf { W } _ { c } ^ { T } \mathbf { h } _ { j } ) } & { } & { \textnormal { \# } ( \mathrm { c o n t e n t ~ r i c h n e s s } ) } \\ { + w _ { s } \sigma ( \cos ( \mathbf { h } _ { j } , \mathbf { d } ) ) } & { } & { \textnormal { \# } ( \mathrm { s a l ~ i e n c e ~ w . r . t . ~ d o c u m e n t } ) } \\ { + w _ { p } \sigma ( \mathbf { W } _ { p } ^ { T } \mathbf { p } _ { j } ) } & { } & { \textnormal { \# } ( \mathrm { p o s i t i o n a l ~ i m p o r t a n c e } ) } \\ { - w _ { r } \sigma ( \cos ( \mathbf { h } _ { j } , \mathbf { s } _ { j } ) ) } & { } & { \textnormal { \# } ( \mathrm { r e d u n d a n c y ~ w . r . t . ~ s u m m a r y } ) } \\ { + b ) , } & { } & { \textnormal { \# } ( \mathrm { b i a s ~ t e r m } ) } \end{array}
38
+ $$
39
+
40
+ where $j$ is the index of the sentence in the document, $\mathbf { p } _ { j }$ is the positional embedding of the sentence computed by concatenation of embeddings corresponding to forward and backward position indices of the sentence in the document; $\cos ( \mathbf { a } , \mathbf { b } )$ is the standard cosine similarity between the two vectors $\mathbf { a }$ and $\mathbf { b }$ ; $\mathbf { W } _ { c }$ and $\mathbf { W } _ { p }$ are parameter vectors to model content richness and positional importance of sentences respectively; and $w _ { c } , w _ { s } , w _ { p }$ and $w _ { r }$ are scalar weights to model relative importance of various abstract features, and are learned automatically. In the equation above, the abstract feature that each term represents is printed against the term in comments. In other words, assuming the importance weights are positive, in order for a sentence to score high for summary membership, it needs to be highly salient, content rich and occupy important positions in the document, while being least redundant with respect to the summary generated till that point. Note that our formulation of the scoring function simultaneously captures both salience of the sentence $\mathbf { h } _ { j }$ with respect to the document $\mathbf { d }$ as well as its redundancy with respect to the current summary representation ${ \bf s } _ { j }$ . In the next subsection, we will describe the estimation of dynamic summary representation ${ \bf s } _ { j }$ and the formulation of the cost function for training in each architecture. We will also present shallow and deep models under each architecture.
41
+
42
+ # 2.1 CLASSIFIER ARCHITECTURE
43
+
44
+ In this architecture, we sequentially visit each sentence in the original document order and binaryclassify the sentence in terms of whether it belongs to the summary. The probability of the sentence belonging to the summary, $P ( y _ { j } = 1 )$ is given as follows:
45
+
46
+ $$
47
+ P ( y _ { j } = 1 | \mathbf { h } _ { j } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { j } ) = \sigma ( { \mathsf { s c o r e } } ( \mathbf { h } _ { j } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { j } )
48
+ $$
49
+
50
+ The objective function to minimize at training is the negative log-likelihood of the training data labels:
51
+
52
+ $$
53
+ \ell ( \mathbf { W } , \mathbf { w } , \mathbf { b } ) = - \sum _ { d = 1 } ^ { N } \sum _ { j = 1 } ^ { N _ { d } } ( y _ { j } ^ { d } \log P ( y _ { j } ^ { d } = 1 | \mathbf { h } _ { j } ^ { d } , \mathbf { s } _ { j } ^ { d } , \mathbf { d } _ { d } ) + ( 1 - y _ { j } ^ { d } ) \log ( 1 - P ( y _ { j } ^ { d } = 1 | \mathbf { h } _ { j } ^ { d } , \mathbf { s } _ { j } ^ { d } , \mathbf { d } _ { d } ) )
54
+ $$
55
+
56
+ where $N$ is the size of the training corpus and $N _ { d }$ is the number of sentences in the document $d$ . Now the only detail that remains is how the dynamic summary representation ${ \bf s } _ { j }$ is estimated. This is where the shallow and deep models under this architecture differ, and we describe them below.
57
+
58
+ ![](images/22dfb52afa32430a634e87ff92dc82078c1f5d3c0928962112dea681948f3f26.jpg)
59
+ Figure 1: The shallow and deep versions of the Classifier architecture for extractive summarization.
60
+
61
+ Shallow Model: In the shallow model, we estimate the dynamic summary representation as the running sum of the representations of the sentences visited so far weighted by their probability of being in the summary.
62
+
63
+ $$
64
+ \begin{array}{c} \begin{array} { r c l } { { { \bf { s } } _ { j } } } & { { = } } & { { \displaystyle \sum _ { i = 1 } ^ { j - 1 } { { \bf { h } } _ { i } y _ { i } \qquad } } } \\ { { { \bf { s } } _ { j } } } & { { = } } & { { \displaystyle \sum _ { i = 1 } ^ { j - 1 } { { \bf { h } } _ { i } y _ { i } \qquad } } } \end{array} \textstyle { \Psi } { \mathrm { ~ ( t r a i n i n g ~ t ~ t i m e ) } } \\ { { \bf { s } } _ { j } } & { { = } } & { { \displaystyle \sum _ { i = 1 } ^ { j - 1 } { { \bf { h } } _ { i } { \cal P } \big ( { y _ { i } = 1 \big | { { \bf { h } } _ { i } , { \bf { s } } _ { i } , { \bf { d } } } \big ) \mathrm { ~ } } \mathrm { ~ \# ~ ( t e s t ~ t i m e ) } } } } \end{array}
65
+ $$
66
+
67
+ In other words, at training time, since the summary membership of sentences is known, the probabilities are binary, whereas at test time we use a weighted pooling based on the estimated probability that each sentence belongs to the summary. There is no need to normalize the summary representations since the cosine similarity metric we use in the scoring function of Eq. (1) automatically normalizes them.
68
+
69
+ Deep Model: In the deep model, we introduce an additional layer of unidirectional sentence-level GRU-RNN that takes as input the sentence representations $\mathbf { h } _ { j }$ at each time-step. The hidden state of the new GRU $\hat { \mathbf { h } } _ { j } = G R U ( \mathbf { h } _ { j } )$ is used as a replacement for sentence representation $\mathbf { h } _ { j }$ in computing summary membership scores using Eq. (1) as well as in computing the dynamic summary representation using Eq. (3). The main idea behind using this additional layer of GRU is to allow a greater degree of non-linearity in computing the summary representation.
70
+
71
+ The graphical representations of the shallow and deep models under the Classifier architecture are displayed in Figure 1 with their full set of dependencies.
72
+
73
+ # 2.2 SELECTOR ARCHITECTURE
74
+
75
+ In this architecture, the models do not make decisions in the sequence of sentence ordering; instead, they pick one sentence at a time in an order that they deem fit. The act of picking a sentence is cast as a sequential generative model in which one sentence-index is emitted at each time step that maximizes the score in Eq. 1. Accordingly, the probability of picking a sentence with index $I ( j ) = k \in \{ 1 , \dots , N _ { d } \}$ at time-step $j$ is given by the softmax over the scoring function:
76
+
77
+ $$
78
+ P ( I ( j ) = k | \mathbf { s } _ { j } , \mathbf { h } _ { k } , \mathbf { d } ) = \frac { \exp ( \operatorname { s c o r e } ( \mathbf { h } _ { k } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { k } ) ) } { \sum _ { l \in \{ 1 , \dots , N _ { d } \} } \exp ( \operatorname { s c o r e } ( \mathbf { h } _ { l } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { l } ) ) }
79
+ $$
80
+
81
+ The loss function in this case is the negative log-likelihood of the selected sentences in the ground truth data as shown below.
82
+
83
+ $$
84
+ \begin{array} { r l r } { \ell ( { \mathbf W } , { \mathbf w } , { \mathbf b } ) } & { = } & { - \displaystyle \sum _ { d = 1 } ^ { N } \sum _ { j = 1 } ^ { M _ { d } } \log P ( I ( j ) ^ { ( d ) } | { \mathbf h } _ { I ( j ) ^ { ( d ) } } , { \mathbf s } _ { j } ^ { d } , { \mathbf d } _ { d } ) } \end{array}
85
+ $$
86
+
87
+ where $M _ { d }$ is the number of sentences selected in the ground truth of document $d$ , $\{ I ( 1 ) ^ { ( d ) } , \dots , I ( M _ { d } ) ^ { ( d ) } \}$ is the ordered list of selected sentence indices in the ground truth of document $d$ . The dependence of the loss function on the order of the selected sentences can be gauged by the fact that the probability of selecting a sentence at time step $j$ depends on the dynamic summary representation ${ \bf s } _ { j }$ , which is estimated based on the all sentences selected up to time step $j - 1$ .
88
+
89
+ At test time, at each time-step, the model emits the index of the sentence that has the best score given the current summary representation as shown below.
90
+
91
+ $$
92
+ I ( j ) = \arg \operatorname* { m a x } _ { k \in \{ 1 , \dots , N _ { d } \} } \mathtt { s c o r e } ( \mathbf { h } _ { k } , \mathbf { s } _ { j } , \mathbf { d } , \mathbf { p } _ { k } )
93
+ $$
94
+
95
+ The estimation of dynamic summary representation is done differently for the shallow and deep selector models as described below.
96
+
97
+ Shallow Model: In this model, we sum the representations of the selected sentences until the time step $j$ as the dynamic summary representation. This is true for both training time and test time.
98
+
99
+ $$
100
+ \mathbf { s } _ { j } = \sum _ { i = 1 } ^ { j - 1 } \mathbf { h } _ { I ( i ) } .
101
+ $$
102
+
103
+ Deep Model: In the deep model, we introduce an additional GRU-RNN whose time steps correspond to the sentence index emission events. At each time-step, it takes as input the representation of the previously selected sentence $\mathbf { h } _ { I ( j - 1 ) }$ , and computes a new hidden state $\hat { \mathbf { h } } _ { j } = G R U ( \mathbf { h } _ { I ( j - 1 ) } )$ . Unlike the shallow model that maintains a separate vector for summary representation ${ \bf s } _ { j }$ , we use $\hat { \mathbf { h } } _ { j }$ as the summary representation ${ \bf s } _ { j }$ at time step $j$ . This makes sense for the case of the Selector architecture since both at training and test time we make hard decisions of sentence selection, with the effect that the hidden state of the new GRU can capture a non-linear aggregation of the sentences selected until time step $j - 1$ .
104
+
105
+ ![](images/eb9e93e233925f834a6b17c74e15ea081d07fe5886a372e0868ee6806320d105.jpg)
106
+ Figure 2: Selector architecture for extractive summarization. The shallow and deep versions are identical except for the fact that the simple vector representation for summary representation in the shallow version is replaced with a gated recurrent unit in the deep version.
107
+
108
+ Fig. 2 shows the graphical representation of the Selector architecture with all the dependencies between the nodes. The architecture is the same for both shallow and deep models with the only difference being that the simple summary representation in the former is replaced with a gated recurrent unit in the latter.
109
+
110
+ # 3 RELATED WORK
111
+
112
+ Previous researcher such as Shen et al. (2007) have proposed modeling extractive document summarization as a sequence classification problem using Conditional Random Fields. Our approach is different from theirs in the sense that we use RNNs in our model that do not require any handcrafted features for representing sentences and documents.
113
+
114
+ The Selector architecture broadly involves ranking of sentences by some criterion, therefore does correspond to traditional methods for extractive summarization such as TextRank (Mihalcea & Tarau (2004)) that also involve ranking of sentences by salience and novelty. However, to the best of our knowledge, our Selector framework is a novel deep learning framework for extractive summarization. Broader efforts are being made in the deep learning community to build more sophisticated sequence to sequence models towards the objective of automatically learning complex tasks such as sorting sequences (Oriol Vinyals (2015); Graves et al. (2014)), but their utility for extractive summarization remains to be explored.
115
+
116
+ In the deep learning framework, the extractive summarization work of Cheng & Lapata (2016) is the closest to our work. Their model is based on an encoder-decoder approach where the encoder learns the representation of sentences and documents while the decoder classifies each sentence using an attention mechanism. Broadly, their model is also in the Classifier framework, but architecturally, our approaches are different. While their approach can be termed as a multi-pass approach where both the encoder and decoder consume the same sentence representations, our approach is a deep one where the representations learned by the bidirectional GRU encoder are in turn consumed by the Classifier or Selector models. Another key difference between our work and theirs is that unlike our unsupervised greedy approach to convert abstractive summaries to extractive labels, Cheng & Lapata (2016) chose to train a separate supervised classifier using manually created labels on a subset of the data. This may yield more accurate gold extractive labels which may help boost the performance of their models, but incurs additional annotation costs.
117
+
118
+ # 4 EXPERIMENTS AND RESULTS
119
+
120
+ Pseudo ground-truth generation: In order to train our extractive Classifier and Selector models, for each document we need ground truth in the form of sentence-level binary labels and ordered list of selected sentences respectively. However, most summarization corpora only contain human written abstractive summaries as ground truth. To solve this problem, we use an unsupervised approach to convert the abstractive summaries to extractive labels. Our approach is based on the idea that the selected sentences from the document should be the ones that maximize the Rouge score with respect to gold abstractive summaries. Since it is computationally expensive to find a globally optimal subset of sentences that maximizes the Rouge score, we employ a greedy approach, where we add one sentence at a time incrementally to the summary, such that the Rouge score of the current set of selected sentences is maximized with respect to the entire gold summary. We stop adding sentences when either none of the remaining candidate sentences improves the Rouge score upon addition to the current summary set or when the maximum summary length is reached. We return this ordered list of sentences as the ground-truth for the Selector architecture. The ordered list is converted into binary summary-membership labels that are consumed by the Classifier architecture for training.
121
+
122
+ We note that similar approaches have been employed by other researchers such as Svore et al. (2007) to handle the problem of converting abstractive summaries to extractive ground truth. We would also like to point readers to a recent work by Cao et al. (2015) that proposes an ILP based approach to solve this problem optimally. Since this is not the focus of this work, we chose a simple greedy algorithm.
123
+
124
+ Corpora: For our experiments, we used the Daily Mail corpus originally constructed by Hermann et al. (2015) for the task of passage-based question answering, and re-purposed for the task of document summarization as proposed in Cheng & Lapata (2016) for extractive summarization and Nallapati et al. (2016a) for abstractive summarization. Overall, we have 196,557 training documents, 12,147 validation documents and 10,396 test documents from the Daily Mail corpus. On average, there are about 28 sentences per document in the training set, and an average of 3-4 sentences in the reference summaries. The average word count per document in the training set is 802.
125
+
126
+ We also used the DUC 2002 single-document summarization dataset1 consisting of 567 documents as an additional out-of-domain test set to evaluate our models.
127
+
128
+ Evaluation: In our experiments below, we evaluate the performance of our models using different variants of the Rouge metric2 computed with respect to the gold abstractive summaries. Following Cheng & Lapata (2016), we use limited length Rouge recall at 75 bytes of summary as well as 275 bytes on the Daily Mail corpus. On DUC 2002 corpus, following the official guidelines, we use limited length Rouge recall at 75 words. We report the scores from Rouge-1, Rouge-2 and RougeL, which are computed using matches of unigrams, bigrams and longest common subsequences respectively, with the ground truth summaries.
129
+
130
+ Baselines: On all datasets, we use Lead-3 model, which simply produces the leading three sentences of the document as the summary, as a baseline. On the Daily Mail and DUC 2002 corpora, we also report performance of $L R e g$ , a feature-rich logistic classifier used as a baseline by Cheng & Lapata (2016). On DUC 2002 corpus, we report several baselines such as Integer Linear Programming based approach (Woodsend & Lapata (2010)), and graph based approaches such as TGRAPH (Parveen et al. (2015)) and URANK (Wan (2010)) which achieve very high performance on this corpus. In addition, we also compare with the state-of-the art deep learning supervised extractive model from Cheng & Lapata (2016).
131
+
132
+ Experimental Settings: We used 100-dimensional word2vec (Mikolov et al. (2013)) embeddings trained on the Daily Mail corpus as our embedding initialization. We limited the vocabulary size to 150K and the maximum sentence length to 50 words, to speed up computation. We fixed the model hidden state size at 200. We used a batch size of 32 at training time, and employed adadelta (Zeiler (2012)) to train our model. We employed gradient clipping and L-2 regularization to prevent overfitting and an early stopping criterion based on validation cost.
133
+
134
+ At test time, for the Classifier models we pick sentences sorted by the predicted probabilities until we exceed the length limit as determined by the Rouge metric. Likewise, we allow the Selector models to emit sentence indices until the desired summary length is reached. For the Selector model, we also make sure the emitted sentence ids are not repeated across time steps by traversing down the sorted predicted probabilities of the softmax layer at each time step until we reach a sentence-id that was not emitted before.
135
+
136
+ We note that it is possible to optimize the Classifier performance at test time using the Viterbi algorithm to compute the best sequence of labels, subject to the Markovian assumptions of the architecture and model. Similarly, it is also possible to further boost the Selector’s performance by using beam search at test time. However, in this work we used greedy classification/selection for inference since our primary interest is in comparing the two architectures, and our choice allows us to make a fair apples-to-apples comparison.
137
+
138
+ Results on Daily Mail corpus: Table 1 shows the performance comparison of our models with state-of-the-art model of Cheng & Lapata (2016) and other baselines on the DailyMail corpus using Rouge recall at two different summary lengths.
139
+
140
+ Table 1: Performance of various models on the entire Daily Mail test set using the limited length recall variants of Rouge with respect to the abstractive ground truth at 75 bytes and 275 bytes. Entries with asterisk are statistically significant using $9 5 \%$ confidence interval with respect to the nearest state-of-the-art model, as estimated by the Rouge script.
141
+
142
+ <table><tr><td rowspan="2">Model</td><td colspan="3">Recall at 75 bytes</td><td colspan="3">Recall at 275 bytes</td></tr><tr><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td></tr><tr><td>Lead-3</td><td>21.9</td><td>7.2</td><td>11.6</td><td>40.5</td><td>14.9</td><td>32.6</td></tr><tr><td>LReg(500)</td><td>18.5</td><td>6.9</td><td>10.2</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>Cheng &#x27;16</td><td>22.7</td><td>8.5</td><td>12.5</td><td>42.2</td><td>17.3*</td><td>34.8</td></tr><tr><td>Shal.-Select</td><td>25.6</td><td>10.3</td><td>14.0</td><td>41.3</td><td>16.8</td><td>34.9</td></tr><tr><td>Deep-Select</td><td>26.1</td><td>10.7</td><td>14.4</td><td>41.3</td><td>15.3</td><td>33.5</td></tr><tr><td>Shal.-Cls.</td><td>26.0</td><td>10.5</td><td>14.23</td><td>42.1</td><td>16.8</td><td>34.8</td></tr><tr><td>Deep-Cls.</td><td>26.2* ±0.4</td><td>10.7* ±0.4</td><td>14.4* ±0.4</td><td>42.2 ±0.2</td><td>16.8 ±0.2</td><td>35.0 ±0.2</td></tr></table>
143
+
144
+ The results show that contrary to our initial expectation, the Classifier architecture is superior to the Selector architecture. Within each architecture, the deeper models are better performing than the shallower ones. Our deep classifier model outperforms Cheng & Lapata (2016) with a statistically significant margin at 75 bytes, while matching their model at 275 bytes. One potential reason our models do not consistently outperform the extractive model of Cheng & Lapata (2016) is the additional supervised training they used to create sentence-level extractive labels to train their model. Our models instead use an unsupervised greedy approximation to create extractive labels from abstractive summaries, and as a result, may generate noisier ground truth than theirs.
145
+
146
+ Results on the Out-of-Domain DUC 2002 corpus: We also evaluated the models trained on the DailyMail corpus on the out-of-domain DUC 2002 set as shown in Table 2. The performance trend is similar to that on Daily Mail. Our best model, Deep Classifier is again statistically on par with the model of Cheng & Lapata (2016). However, both models perform worse than graph-based TGRAPH (Parveen et al. (2015)) and URANK (Wan (2010)) algorithms, which are the state-of-the-art models on this corpus. Deep learning based supervised models such as ours and that of Cheng & Lapata (2016) perform very well on the domain they are trained on, but may suffer from domain adaptation issues when tested on a different corpus such as DUC 2002.
147
+
148
+ # 5 DISCUSSION
149
+
150
+ Impact of Document Structure: In all our experiments thus far, the classifier architecture has proven superior to the selector architecture. We conjecture that decision making in the same sequence as the original sentence ordering is perhaps advantageous in document summarization since there is a smooth sequential discourse structure in news stories starting with the main highlights of the story in the beginning, more elaborate description in the middle and ending with conclusive remarks. If this is true, then in scenarios where sentence ordering is less structured, the selector architecture should be superior since it has freedom to select salient sentences in any arbitrary order. Such scenarios actually do occur in practice, e.g., summarization of a cluster of tweets on a topic where there is no specific discourse structure between individual tweets, or in multi-document summarization where a pair of sentences across document boundaries have no specific ordering. In order to test this hypothesis, we simulated such data in the Daily Mail corpus by randomly shuffling the sentences in each document in the training set and retraining models under both the architectures, and evaluating them on the original test sets. The results, summarized in Table 3, show that the Classifier architecture suffers bigger losses than the Selector architecture when the document structure is destroyed. In fact, the Selector architecture performs slightly better than the Classifier architecture when trained on the shuffled data, indicating that our hypothesis may indeed be true.
151
+
152
+ Table 2: Performance of various models on the DUC 2002 set using the limited length recall variants of Rouge at 75 words. Our Deep Classifier is statistically within the margin of error at $9 5 \%$ C.I. with respect to the model of Cheng & Lapata (2016), but both are lower than state-of-the-art results due to out-of-domain training.
153
+
154
+ <table><tr><td></td><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td></tr><tr><td>Lead-3</td><td>43.6</td><td>21.0</td><td>40.2</td></tr><tr><td>LReg</td><td>43.8</td><td>20.7</td><td>40.3</td></tr><tr><td>ILP</td><td>45.4</td><td>21.3</td><td>42.8</td></tr><tr><td>TGRAPH</td><td>48.1</td><td>24.3*</td><td></td></tr><tr><td>URANK</td><td>48.5*</td><td>21.5</td><td>=</td></tr><tr><td>Cheng et al &#x27;16</td><td>47.4</td><td>23.0</td><td>43.5</td></tr><tr><td>Shallow-Selector</td><td>44.6</td><td>20.0</td><td>41.1</td></tr><tr><td>Deep-Selector</td><td>45.9</td><td>21.5</td><td>42.4</td></tr><tr><td>Shallow-Classifier</td><td>45.9</td><td>21.5</td><td>42.3</td></tr><tr><td>Deep-Classifier</td><td>46.8 ±0.9</td><td>22.6 ±0.9</td><td>43.1 ±0.9</td></tr></table>
155
+
156
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>Trained on original data</td><td rowspan=1 colspan=3>Trained on shuffled sentences</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Rouge-1</td><td rowspan=1 colspan=1>Rouge-2</td><td rowspan=1 colspan=1>Rouge-L</td><td rowspan=1 colspan=1>Rouge-1</td><td rowspan=1 colspan=1>Rouge-2</td><td rowspan=1 colspan=1>Rouge-L</td></tr><tr><td rowspan=2 colspan=1>Shallow-SelectorShallow-Classifier</td><td rowspan=2 colspan=1>41.342.1</td><td rowspan=2 colspan=1>16.816.8</td><td rowspan=1 colspan=1>34.9</td><td rowspan=1 colspan=1>40.6</td><td rowspan=2 colspan=1>15.615.3</td><td rowspan=2 colspan=1>33.032.9</td></tr><tr><td rowspan=1 colspan=1>35.0</td><td rowspan=1 colspan=1>40.1</td></tr><tr><td rowspan=1 colspan=1>Deep-SelectorDeep-Classifier</td><td rowspan=1 colspan=1>41.342.2</td><td rowspan=1 colspan=1>15.316.8</td><td rowspan=1 colspan=1>33.535.0</td><td rowspan=1 colspan=1>40.540.1</td><td rowspan=1 colspan=1>15.315.1</td><td rowspan=1 colspan=1>32.532.9</td></tr></table>
157
+
158
+ Table 3: Simulated experiment to demonstrate the impact of document discourse structure on model performance. Evaluation is done using Rouge limited length recall at 275 bytes. The Selector architecture exhibits superior performance when the discourse structure of the document is destroyed.
159
+
160
+ Qualitative Analysis: One of the advantages of our model design is teasing out various abstract features for the sake of interpretability of system predictions. In the appendix, we present a visualization (see Fig. 3 in the Appendix) of the system predictions based on the scores for various abstract features listed in Eq. (1). We also present the learned importance weights of these features in Table 4. A few representative documents are also presented in the appendix highlighting the sentences chosen by our models for summarization.
161
+
162
+ # 6 CONCLUSION AND FUTURE WORK
163
+
164
+ In this work, we propose two neural architectures for extractive summarization. Our proposed models under these architectures are not only very interpretable, but also achieve state-of-the-art performance on two different data sets. We also empirically compare our two frameworks and suggest conditions under which each of them can deliver optimal performance.
165
+
166
+ As part of our future work, we plan to further investigate the applicability of the novel Selector architecture to relatively less structured summarization problems such as summarization of multiple documents or topical clusters of tweets. In addition, we also intend to perform additional experiments on the Daily Mail dataset such as incorporating beam search in both model inference as well in pseudo ground truth generation that may result in further performance improvements.
167
+
168
+ # REFERENCES
169
+
170
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
171
+
172
+ Ziqiang Cao, Chengyao Chen, Wenjie Li, Sujian Li, Furu Wei, and Ming Zhou. Tgsum: Build tweet guided multi-document summarization dataset. CoRR, abs/1511.08417, 2015. URL http: //arxiv.org/abs/1511.08417.
173
+
174
+ Ziqiang Cao, Wenjie Li, Sujian Li, and Furu Wei. Attsum: Joint learning of focusing and summarization with neural attention. arXiv preprint arXiv:1604.00125, 2016.
175
+
176
+ Jaime Carbonell and Jade Goldstein. The use of mmr, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st annual international ACM SIGIR conference on Research and development in information retrieval, pp. 335–336. ACM, 1998.
177
+
178
+ Jianpeng Cheng and Mirella Lapata. Neural summarization by extracting sentences and words. 54th Annual Meeting of the Association for Computational Linguistics, 2016. URL http://arxiv. org/abs/1603.07252.
179
+
180
+ Junyoung Chung, C¸ aglar Gulc¸ehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation ¨ of gated recurrent neural networks on sequence modeling. CoRR, abs/1412.3555, 2014. URL http://arxiv.org/abs/1412.3555.
181
+
182
+ Kavita Ganesan, ChengXiang Zhai, and Jiawei Han. Opinosis: a graph-based approach to abstractive summarization of highly redundant opinions. In Proceedings of the 23rd international conference on computational linguistics, pp. 340–348. Association for Computational Linguistics, 2010.
183
+
184
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
185
+
186
+ Karl Moritz Hermann, Tomas Kocisk ´ y, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Su-´ leyman, and Phil Blunsom. Teaching machines to read and comprehend. CoRR, abs/1506.03340, 2015. URL http://arxiv.org/abs/1506.03340.
187
+
188
+ Mikael Kageback, Olof Mogren, Nina Tahmasebi, and Devdatt Dubhashi. Extractive summarization using continuous vector space models. pp. 31–39. 2014.
189
+
190
+ Ryan McDonald. A study of global inference algorithms in multi-document summarization. pp. 557–564. 2007.
191
+
192
+ Rada Mihalcea and Paul Tarau. Textrank: Bringing order into texts. Empirical Methods in Natural Language Processing, 2004.
193
+
194
+ 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.
195
+
196
+ Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Caglar Gulcehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence rnns and beyond. The SIGNLL Conference on Computational Natural Language Learning, 2016a.
197
+
198
+ Ramesh Nallapati, Bowen Zhou, and Bing Xiang. Sequence-to-sequence rnns for text summarization. International Conference on Learning Representations, Workshop track, 2016b.
199
+
200
+ Manjunath Kudlur Oriol Vinyals, Samy Bengio. Order matters: Sequence to sequence for sets. International Conference on Learning Representations, 2015.
201
+
202
+ Daraksha Parveen, Hans-Martin Ramsl, and Michael Strube. Topical coherence for graph-based extractive summarization. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 19491954, 2015.
203
+
204
+ Dragomir Radev and Gunes Erkan. Lexrank: Graph-based lexical centrality as salience in text ¨ summarization. Journal of Artificial Intelligence Research, pp. 457–479, 2004.
205
+
206
+ Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. arXiv preprint arXiv:1509.00685, 2015.
207
+ Dou Shen, Jian-Tao Sun, Hua Li, Qiang Yang, and Zheng Chen. Document summarization using conditional random fields. In Proceedings of IJCAI, 2007.
208
+ Richard Socher, Eric H. Huang, Jeffrey Pennin, Christopher D. Manning, and Andrew Y. Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. pp. 801–809. 2011.
209
+ Krysta M. Svore, Lucy Vanderwende, and Christopher J.C. Burges. Enhancing single-document summarization by combining ranknet and third-party sources. In Proceedings of the Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pp. 448–457, 2007.
210
+ Xiaojun Wan. Towards a unified approach to simultaneous single-document and multidocument summarizations. In In Proceedings of the 23rd COLING, pp. 11371145, 2010.
211
+ Kristian Woodsend and Mirella Lapata. Automatic generation of story highlights. In In Proceedings of the 48th ACL, pp. 565574, 2010.
212
+ Wenpeng Yin and Yulong Pei. Optimizing sentence modeling and selection for document summarization. In Proceedings of the 24th International Conference on Artificial Intelligence, pp. 1383–1389. AAAI Press, 2015.
213
+ Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. URL http://arxiv.org/abs/1212.5701.
214
+
215
+ # 7 APPENDIX
216
+
217
+ In this section, we will present some additional qualitative and quantitative analysis of our models that we hope will shed some light on their behavior.
218
+
219
+ # 7.1 VISUALIZATION OF MODEL OUTPUT
220
+
221
+ In addition to being state-of-the-art performers, our models have the additional advantage of being very interpretable. The clearly separated terms in the scoring function (see Eqn. 1) allow us to tease out various factors responsible for the classification/selection of each sentence. This is illustrated in Figure 3, where we display a representative document from our validation set along with normalized scores from each abstract feature from the deep classifier model. Such visualization is especially useful in explaining to the end-user the decisions made by the system.
222
+
223
+ # 7.2 LEARNED IMPORTANCE WEIGHTS
224
+
225
+ We display in Table 4 the learned importance weights corresponding to various abstract features for deep sentence selector. Confirming our intuition, the model learns that salience and redundancy are the most important predictive features for summary membership of a sentence, followed by positional feature and content based feature. Further, when the same model is trained on documents with randomly shuffled sentences, it learns very small weight for the positional features, which is exactly what one expects.
226
+
227
+ <table><tr><td rowspan=1 colspan=1>Trainingcondition</td><td rowspan=1 colspan=1>Salience</td><td rowspan=1 colspan=1>Content</td><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>Redundancy</td></tr><tr><td rowspan=1 colspan=1>Original dataShuffled data</td><td rowspan=1 colspan=1>42.759.69</td><td rowspan=1 colspan=1>14.832.85</td><td rowspan=1 colspan=1>-31.090.20</td><td rowspan=1 colspan=1>40.9916.08</td></tr></table>
228
+
229
+ Table 4: Learned weights of various abstract features from the deep sentence selector model. Salience and redundancy are the most important features as learned by the model, followed by position and content. The negative sign for position weights has no particular significance. The positional feature gets very low weight when the document structure is destroyed by randomly shuffling sentences in each document the training data.
230
+
231
+ <table><tr><td rowspan=1 colspan=1>Gold Summary:Redpath has ended his eight-year association with SaleSharks. Redpath spent five years as a player and three as acoach at sale. He has thanked the owners, coaches and players for their support.</td><td rowspan=1 colspan=1>Salience</td><td rowspan=1 colspan=1>Content</td><td rowspan=1 colspan=1>Novelty</td><td rowspan=1 colspan=1>Position Prob.</td><td rowspan=1 colspan=1>Position Prob.</td></tr><tr><td rowspan=1 colspan=1>Bryan Redpath has left his coaching role at Sale Sharks withimmediate effect.</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.3</td></tr><tr><td rowspan=1 colspan=1>The 43- year- old Scot ends an eight-year association withthe Aviva Premiership side, having spent five years with them as a player and three as a coach.</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.7</td></tr><tr><td rowspan=1 colspan=1> Redpath returned to Sale in June 2012 as director of rugbyafter starting a coaching career at Gloucester and progressing to the top job at Kingsholm .</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.6</td></tr><tr><td rowspan=2 colspan=1>Redpath spent five years with Sale Sharks as a player and afurther three as a coach but with Sale Sharks struggling fourmonths into Redpath&#x27;s tenure, he was removed from thedirector of rugby role at the Salford-based side and has sincebeen operating as head coach .</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.9</td><td rowspan=2 colspan=1>0.7</td><td rowspan=2 colspan=1>0.8</td><td rowspan=2 colspan=1>0.9</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>‘I would like to thank the owners,coaches,players and stafffor all their helpand support since I returned to the club in2012.</td><td rowspan=1 colspan=1>0.4</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.7</td><td rowspan=2 colspan=1>0.2</td></tr><tr><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=2 colspan=1> Also to the supporters who have been great with me both asa player and as a coach,&#x27; Redpath said.</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.2</td></tr><tr><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></table>
232
+
233
+ # 7.3 ABLATION EXPERIMENTS
234
+
235
+ We evaluated the performance of the deep selector and deep classifier models on the validation set by deleting one abstract feature at a time from the model, with replacement. The performance numbers, displayed in Table 5, show that removing any of the features results in a small loss in performance. Note that the priority of features in the ablation experiments need not correspond to their priority in terms of learned weights in Table 4, since feature correlations may affect the two metrics differently. For the deep classifier, content and redundancy seem to matter the most while for the deep selector, dropping positional features hurts the most. Based on this analysis, we plan to investigate more thoroughly the reasons behind the poor ablation performance of salience and redundancy in the classifier and selector models respectively.
236
+
237
+ <table><tr><td></td><td colspan="3">Deep Classifier</td><td colspan="3">Deep Selector</td></tr><tr><td>Features</td><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td><td>Rouge-1</td><td>Rouge-2</td><td>Rouge-L</td></tr><tr><td>All</td><td>42.43</td><td>17.32</td><td>34.07</td><td>41.55</td><td>16.52</td><td>32.41</td></tr><tr><td>-Salience</td><td>42.40</td><td>17.27</td><td>34.09</td><td>40.82</td><td>15.99</td><td>31.45</td></tr><tr><td>-Position</td><td>41.78</td><td>16.76</td><td>33.58</td><td>39.06</td><td>14.32</td><td>29.85</td></tr><tr><td>-Content</td><td>41.12</td><td>15.78</td><td>33.23</td><td>40.68</td><td>15.83</td><td>31.13</td></tr><tr><td>-Redundancy</td><td>41.67</td><td>16.86</td><td>32.93</td><td>41.46</td><td>16.50</td><td>32.31</td></tr></table>
238
+
239
+ Table 5: Ablation experiments on the validation set to gauge the relative importance of each abstract feature. The top row is where all four abstract features are present. The following rows corresponding to removal of one feature at a time with replacement. Evaluation is done using Rouge limited length recall at 275 bytes. Bold faced entries correspond to largest reduction in performance when the corresponding features are dropped.
240
+
241
+ # 7.4 REPRESENTATIVE DOCUMENTS AND EXTRACTIVE SUMMARIES
242
+
243
+ We display a couple of representative documents, one each from the Daily Mail and DUC corpora, highlighting the sentences chosen by deep classifier and comparing them with the gold summaries in Table 6. The examples demonstrate qualitatively that the model performs a reasonably good job in identifying the key messages of a document.
244
+
245
+ <table><tr><td>Document:@entityO have an interest in @entity3 defender @entity2 but are unlikely to make a move until january . the 00 - year - old @entity6 captain has yet to open talks over a new contract at @entity3 and his current deal runs out in 0000 .@entity3 defender @entity2 could be targeted by @entityO in the january transfer window @entityO like @entity2 but do n&#x27;t expect @ entity3 to sell yet they know he will be free to talk to foreign clubs from january.@entity12 will make a Omillion offer for @entity3 goalkeeper @entity14 this summer.the OO - year - old is poised to leave @entityl6 and wants to play for a @entity18 contender . @entity12 are set to make a Omillion bid for @entity2’s @en-</td></tr><tr><td>tity3 team - mate @entity14 in the summer Gold Summary:@entity2&#x27;s contract at @entity3 expires at the end of next season .OO - year-old has yet to open talks over a new deal at @entityl6 .@entity14 is poised to leave @entity3 at the end of</td></tr><tr><td>the season Document: today, the foreign ministry said that control opera- tions carried out by the corvette spiro against a korean-flagged asreceived ship fishing illegally in argentine waters were car- ried out “ in accordance with international law and in coordi- nation with the foreign ministry ”.the foreign ministry thus ap- proved the intervention by the argentine corvette when it discovered the korean ship chin yuan hsing violating argentine jurisdictional waters on OO may.... the korean ship,which had been fishing illegally in argentine waters,was sunk by its own crew after failing to answer to the argentine ship &#x27;s warnings .the crew was transferred to the chin chuan hsing,which was sailing nearby and</td></tr><tr><td>approached to rescue the crew of the sinking ship... Gold Summary:the korean-flagged fishing vessel chin yuan hs- ing was scuttled in waters off argentina on OO may OOoO .adverse weather conditions prevailed when the argentine corvette spiro spot- ted the korean ship fishing illegally in restricted argentine waters . the korean vessel did not respond to the corvette &#x27;s warning .instead ,the korean crew sank their ship,and transferred to another korean ship sailing nearby.in accordance with a uk-argentine agreement, the argentine navy turned the surveillance of the second korean ves- sel over to the british when it approached within OO nautical miles of the malvinas(falkland)islands .</td></tr></table>
md/train/Hkbd5xZRb/Hkbd5xZRb.md ADDED
@@ -0,0 +1,439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPHERICAL CNNS
2
+
3
+ Taco S. Cohen∗ University of Amsterdam
4
+
5
+ Mario Geiger∗ EPFL
6
+
7
+ Jonas Köhler∗ University of Amsterdam
8
+
9
+ Max Welling University of Amsterdam & CIFAR
10
+
11
+ # ABSTRACT
12
+
13
+ Convolutional Neural Networks (CNNs) have become the method of choice for learning problems involving 2D planar images. However, a number of problems of recent interest have created a demand for models that can analyze spherical images. Examples include omnidirectional vision for drones, robots, and autonomous cars, molecular regression problems, and global weather and climate modelling. A naive application of convolutional networks to a planar projection of the spherical signal is destined to fail, because the space-varying distortions introduced by such a projection will make translational weight sharing ineffective.
14
+
15
+ In this paper we introduce the building blocks for constructing spherical CNNs. We propose a definition for the spherical cross-correlation that is both expressive and rotation-equivariant. The spherical correlation satisfies a generalized Fourier theorem, which allows us to compute it efficiently using a generalized (non-commutative) Fast Fourier Transform (FFT) algorithm. We demonstrate the computational efficiency, numerical accuracy, and effectiveness of spherical CNNs applied to 3D model recognition and atomization energy regression.
16
+
17
+ # 1 INTRODUCTION
18
+
19
+ Convolutional networks are able to detect local patterns regardless of their position in the image. Like patterns in a planar image, patterns on the sphere can move around, but in this case the “move” is a 3D rotation instead of a translation. In analogy to the planar CNN, we would like to build a network that can detect patterns regardless of how they are rotated over the sphere.
20
+
21
+ As shown in Figure 1, there is no good way to use translational convolution or cross-correlation1 to analyze spherical signals. The most obvious approach, then, is to change the definition of crosscorrelation by replacing filter translations by rotations. Doing so, we run into a subtle but important difference between the plane and the sphere: whereas the space of moves for the plane (2D translations) is itself isomorphic to the plane, the space of moves for the sphere (3D rotations) is a different, three-dimensional manifold called $\mathrm { S O } ( 3 ) ^ { 2 }$ . It follows that the result of a spherical correlation (the output feature map) is to be considered a signal on SO(3), not a signal on the sphere, $S ^ { 2 }$ . For this reason, we deploy SO(3) group correlation in the higher layers of a spherical CNN (Cohen and Welling, 2016).
22
+
23
+ ![](images/c8d6512dee59b774fc859d6f4501fd9ab640e57125959535a8447d58e8127426.jpg)
24
+ Figure 1: Any planar projection of a spherical signal will result in distortions. Rotation of a spherical signal cannot be emulated by translation of its planar projection.
25
+
26
+ The implementation of a spherical CNN ( $S ^ { 2 }$ -CNN) involves two major challenges. Whereas a square grid of pixels has discrete translation symmetries, no perfectly symmetrical grids for the sphere exist. This means that there is no simple way to define the rotation of a spherical filter by one pixel. Instead, in order to rotate a filter we would need to perform some kind of interpolation. The other challenge is computational efficiency; SO(3) is a three-dimensional manifold, so a naive implementation of SO(3) correlation is $O ( n ^ { 6 } )$ .
27
+
28
+ We address both of these problems using techniques from non-commutative harmonic analysis (Chirikjian and Kyatkin, 2001; Folland, 1995). This field presents us with a far-reaching generalization of the Fourier transform, which is applicable to signals on the sphere as well as the rotation group. It is known that the SO(3) correlation satisfies a Fourier theorem with respect to the SO(3) Fourier transform, and the same is true for our definition of $S ^ { 2 }$ correlation. Hence, the $S ^ { 2 }$ and SO(3) correlation can be implemented efficiently using generalized FFT algorithms.
29
+
30
+ Because we are the first to use cross-correlation on a continuous group inside a multi-layer neural network, we rigorously evaluate the degree to which the mathematical properties predicted by the continuous theory hold in practice for our discretized implementation.
31
+
32
+ Furthermore, we demonstrate the utility of spherical CNNs for rotation invariant classification and regression problems by experiments on three datasets. First, we show that spherical CNNs are much better at rotation invariant classification of Spherical MNIST images than planar CNNs. Second, we use the CNN for classifying 3D shapes. In a third experiment we use the model for molecular energy regression, an important problem in computational chemistry.
33
+
34
+ # CONTRIBUTIONS
35
+
36
+ The main contributions of this work are the following:
37
+
38
+ 1. The theory of spherical CNNs.
39
+ 2. The first automatically differentiable implementation of the generalized Fourier transform for $S ^ { 2 }$ and SO(3). Our PyTorch code is easy to use, fast, and memory efficient.
40
+ 3. The first empirical support for the utility of spherical CNNs for rotation-invariant learning problems.
41
+
42
+ # 2 RELATED WORK
43
+
44
+ It is well understood that the power of CNNs stems in large part from their ability to exploit (translational) symmetries though a combination of weight sharing and translation equivariance. It thus becomes natural to consider generalizations that exploit larger groups of symmetries, and indeed this has been the subject of several recent papers by Gens and Domingos (2014); Olah (2014); Dieleman et al. (2015; 2016); Cohen and Welling (2016); Ravanbakhsh et al. (2017); Zaheer et al. (2017b); Guttenberg et al. (2016); Cohen and Welling (2017). With the exception of SO(2)-steerable networks (Worrall et al., 2017; Weiler et al., 2017), these networks are all limited to discrete groups, such as discrete rotations acting on planar images or permutations acting on point clouds. Other very recent work is concerned with the analysis of spherical images, but does not define an equivariant architecture (Su and Grauman, 2017; Boomsma and Frellsen, 2017). Our work is the first to achieve equivariance to a continuous, non-commutative group (SO(3)), and the first to use the generalized Fourier transform for fast group correlation. A preliminary version of this work appeared as Cohen et al. (2017).
45
+
46
+ To efficiently perform cross-correlations on the sphere and rotation group, we use generalized FFT algorithms. Generalized Fourier analysis, sometimes called abstract- or noncommutative harmonic analysis, has a long history in mathematics and many books have been written on the subject (Sugiura, 1990; Taylor, 1986; Folland, 1995). For a good engineering-oriented treatment which covers generalized FFT algorithms, see (Chirikjian and Kyatkin, 2001). Other important works include (Driscoll and Healy, 1994; Healy et al., 2003; Potts et al., 1998; Kunis and Potts, 2003; Drake et al., 2008; Maslen, 1998; Rockmore, 2004; Kostelec and Rockmore, 2007; 2008; Potts et al., 2009; Makadia et al., 2007; Gutman et al., 2008).
47
+
48
+ # 3 CORRELATION ON THE SPHERE AND ROTATION GROUP
49
+
50
+ We will explain the $S ^ { 2 }$ and SO(3) correlation by analogy to the classical planar $\mathbb { Z } ^ { 2 }$ correlation. The planar correlation can be understood as follows:
51
+
52
+ The value of the output feature map at translation $x \in \mathbb { Z } ^ { 2 }$ is computed as an inner product between the input feature map and a filter, shifted by $x$ .
53
+
54
+ Similarly, the spherical correlation can be understood as follows:
55
+
56
+ The value of the output feature map evaluated at rotation $R \in \mathrm { S O ( 3 ) }$ is computed as an inner product between the input feature map and a filter, rotated by $R$ .
57
+
58
+ Because the output feature map is indexed by a rotation, it is modelled as a function on SO(3). We will discuss this issue in more detail shortly.
59
+
60
+ The above definition refers to various concepts that we have not yet defined mathematically. In what follows, we will go through the required concepts one by one and provide a precise definition. Our goal for this section is only to present a mathematical model of spherical CNNs. Generalized Fourier theory and implementation details will be treated later.
61
+
62
+ The Unit Sphere $S ^ { 2 }$ can be defined as the set of points $x \in \mathbb { R } ^ { 3 }$ with norm 1. It is a two-dimensional manifold, which can be parameterized by spherical coordinates $\alpha \in [ 0 , 2 \pi ]$ and $\beta \in [ 0 , \pi ]$ .
63
+
64
+ Spherical Signals We model spherical images and filters as continuous functions $f : S ^ { 2 } \to \mathbb { R } ^ { K }$ , where $K$ is the number of channels.
65
+
66
+ Rotations The set of rotations in three dimensions is called SO(3), the “special orthogonal group”. Rotations can be represented by $3 \times 3$ matrices that preserve distance (i.e. $\mathbf { \left| | \it { R x } \right| | } \mathbf { \bar { \alpha } } = \mathbf { \left| | \bar { x } \right| | } )$ and orientation $\operatorname* { d e t } ( R ) = + 1$ ). If we represent points on the sphere as 3D unit vectors $x$ , we can perform a rotation using the matrix-vector product $R x$ . The rotation group SO(3) is a three-dimensional manifold, and can be parameterized by ZYZ-Euler angles $\alpha \in [ 0 , 2 \pi ]$ , $\beta \in [ 0 , \pi ]$ , and $\gamma \in [ 0 , 2 \pi ]$ .
67
+
68
+ Rotation of Spherical Signals In order to define the spherical correlation, we need to know not only how to rotate points $x \in \breve { S } ^ { 2 }$ but also how to rotate filters (i.e. functions) on the sphere. To this end, we introduce the rotation operator $L _ { R }$ that takes a function $f$ and produces a rotated function $L _ { R } f$ by composing $f$ with the rotation $R ^ { - 1 }$ :
69
+
70
+ $$
71
+ [ L _ { R } f ] ( x ) = f ( R ^ { - 1 } x ) .
72
+ $$
73
+
74
+ Due to the inverse on $R$ , we have $L _ { R R ^ { \prime } } = L _ { R } L _ { R ^ { \prime } }$
75
+
76
+ Inner products The inner product on the vector space of spherical signals is defined as:
77
+
78
+ $$
79
+ \left. \psi , f \right. = \int _ { S ^ { 2 } } \sum _ { k = 1 } ^ { K } \psi _ { k } ( x ) f _ { k } ( x ) d x ,
80
+ $$
81
+
82
+ The integration measure $d x$ denotes the standard rotation invariant integration measure on the sphere, which can be expressed as $d \alpha \sin ( \beta ) d \beta / 4 \pi$ in spherical coordinates (see Appendix A). The invariance of the measure ensures that $\begin{array} { r } { \int _ { S ^ { 2 } } f ( R x ) d x = \int _ { S ^ { 2 } } f ( x ) d x } \end{array}$ , for any rotation $R \in \mathrm { S O ( 3 ) }$ . That is, the volume under a spherical heightmap does not change when rotated. Using this fact, we can show that $L _ { R ^ { - 1 } }$ is adjoint to $L _ { R }$ , which implies that $L _ { R }$ is unitary:
83
+
84
+ $$
85
+ \begin{array} { c l } { \displaystyle \langle L _ { R } \psi , f \rangle = \displaystyle \int _ { S ^ { 2 } } \sum _ { k = 1 } ^ { K } \psi _ { k } ( R ^ { - 1 } x ) f _ { k } ( x ) d x } \\ { \displaystyle } \\ { \displaystyle } \\ { \displaystyle } \end{array}
86
+ $$
87
+
88
+ Spherical Correlation With these ingredients in place, we are now ready to state mathematically what was stated in words before. For spherical signals $f$ and $\psi$ , we define the correlation as:
89
+
90
+ $$
91
+ [ \psi \star f ] ( R ) = \langle L _ { R } \psi , f \rangle = \int _ { S ^ { 2 } } \sum _ { k = 1 } ^ { K } \psi _ { k } ( R ^ { - 1 } x ) f _ { k } ( x ) d x .
92
+ $$
93
+
94
+ As mentioned before, the output of the spherical correlation is a function on SO(3). This is perhaps somewhat counterintuitive, and indeed the conventional definition of spherical convolution gives as output a function on the sphere. However, as shown in Appendix B, the conventional definition effectively restricts the filter to be circularly symmetric about the $\textsf { Z }$ axis, which would greatly limit the expressive capacity of the network.
95
+
96
+ Rotation of SO(3) Signals We defined the rotation operator $L _ { R }$ for spherical signals (eq. 1), and used it to define spherical cross-correlation (eq. 4). To define the SO(3) correlation, we need to generalize the rotation operator so that it can act on signals defined on SO(3). As we will show, naively reusing eq. 1 is the way to go. That is, for $f : \mathrm { S } \bar { \mathrm { O } } ( 3 ) \to \mathbb { R } ^ { K }$ , and $R , \bar { Q } \in \mathrm { S O } ( 3 )$ :
97
+
98
+ $$
99
+ [ L _ { R } f ] ( Q ) = f ( R ^ { - 1 } Q ) .
100
+ $$
101
+
102
+ Note that while the argument $R ^ { - 1 } x$ in Eq. 1 denotes the rotation of $x \in S ^ { 2 }$ by $R ^ { - 1 } \in \mathrm { S O } ( 3 )$ , the analogous term $R ^ { - 1 } Q$ in Eq. 5 denotes to the composition of rotations (i.e. matrix multiplication).
103
+
104
+ Rotation Group Correlation Using the same analogy as before, we can define the correlation of two signals on the rotation group, $f , \psi : \mathrm { S O } ( 3 ) \to \mathbb { R } ^ { \overline { { K } } }$ , as follows:
105
+
106
+ $$
107
+ [ \psi \star f ] ( R ) = \langle L _ { R } \psi , f \rangle = \int _ { \mathrm { S O } ( 3 ) } \sum _ { k = 1 } ^ { K } \psi _ { k } ( R ^ { - 1 } Q ) f _ { k } ( Q ) d Q .
108
+ $$
109
+
110
+ The integration measure $d Q$ is the invariant measure on SO(3), which may be expressed in ZYZ-Euler angles as $d \alpha \sin ( \beta ) d \beta d \gamma / ( 8 \pi ^ { 2 } )$ (see Appendix A).
111
+
112
+ Equivariance As we have seen, correlation is defined in terms of the rotation operator $L _ { R }$ . This operator acts naturally on the input space of the network, but what justification do we have for using it in the second layer and beyond?
113
+
114
+ The justification is provided by an important property, shared by all kinds of convolution and correlation, called equivariance. A layer $\Phi$ is equivariant if $\Phi \circ L _ { R } = T _ { R } \circ \Phi$ , for some operator $T _ { R }$ . Using the definition of correlation and the unitarity of $L _ { R }$ , showing equivariance is a one liner:
115
+
116
+ $$
117
+ [ \psi \star [ L _ { Q } f ] ] ( R ) = \langle L _ { R } \psi , L _ { Q } f \rangle = \langle L _ { Q ^ { - 1 } R } \psi , f \rangle = [ \psi \star f ] ( Q ^ { - 1 } R ) = [ L _ { Q } [ \psi \star f ] ] ( R ) .
118
+ $$
119
+
120
+ The derivation is valid for spherical correlation as well as rotation group correlation.
121
+
122
+ # 4 FAST SPHERICAL CORRELATION WITH G-FFT
123
+
124
+ It is well known that correlations and convolutions can be computed efficiently using the Fast Fourier Transform (FFT). This is a result of the Fourier theorem, which states that $\widehat { f * \psi } = \hat { f } \cdot \hat { \psi }$ . Since the FFT can be computed in $O ( n \log n )$ time and the product $\cdot$ has linear complexity, implementing the correlation using FFTs is asymptotically faster than the naive $O ( n ^ { 2 } )$ spatial implementation.
125
+
126
+ For functions on the sphere and rotation group, there is an analogous transform, which we will refer to as the generalized Fourier transform (GFT) and a corresponding fast algorithm (GFFT). This transform finds it roots in the representation theory of groups, but due to space constraints we will not go into details here and instead refer the interested reader to Sugiura (1990) and Folland (1995).
127
+
128
+ Conceptually, the GFT is nothing more than the linear projection of a function onto a set of orthogonal basis functions called “matrix element of irreducible unitary representations”. For the circle $( \breve { S } ^ { 1 } )$ or line $( \mathbb { R } )$ , these are the familiar complex exponentials $\exp ( i n \theta )$ . For SO(3), we have the Wigner Dfunctions $D _ { m n } ^ { l } ( R )$ indexed by $l \geq 0$ and $- l \leq m , n \leq l$ . For $S ^ { 2 }$ , these are the spherical harmonics3 $Y _ { m } ^ { l } ( x )$ indexed by $l \geq 0$ and $- l \leq m \leq l$ .
129
+
130
+ Denoting the manifold ( $S ^ { 2 }$ or SO(3)) by $X$ and the corresponding basis functions by $U ^ { l }$ (which is either vector-valued $( Y ^ { l } )$ or matrix-valued $( D ^ { l } )$ ), we can write the GFT of a function $f : X \to \mathbb { R }$ as
131
+
132
+ $$
133
+ { \hat { f } } ^ { l } = \int _ { X } f ( x ) { \overline { { U ^ { l } ( x ) } } } d x .
134
+ $$
135
+
136
+ This integral can be computed efficiently using a GFFT algorithm (see Section 4.1).
137
+
138
+ The inverse SO(3) Fourier transform is defined as:
139
+
140
+ $$
141
+ f ( R ) = \sum _ { l = 0 } ^ { b } ( 2 l + 1 ) \sum _ { m = - l } ^ { l } \sum _ { n = - l } ^ { l } \hat { f } _ { m n } ^ { l } D _ { m n } ^ { l } ( R ) ,
142
+ $$
143
+
144
+ and similarly for $S ^ { 2 }$ . The maximum frequency $b$ is known as the bandwidth, and is related to the resolution of the spatial grid (Kostelec and Rockmore, 2007).
145
+
146
+ Using the well-known (in fact, defining) property of the Wigner D-functions that $D ^ { l } ( R ) D ^ { l } ( R ^ { \prime } ) =$ $D ^ { l } ( R R ^ { \prime } )$ and $D ^ { l } ( R ^ { - 1 } ) = D ^ { l } ( R ) ^ { \dagger }$ , it can be shown (see Appendix D) that the SO(3) correlation satisfies a Fourier theorem4: $\widehat { \psi \star f } = \hat { f } \cdot \hat { \psi } ^ { \dagger }$ , where $\cdot$ denotes matrix multiplication of the two block matrices $\hat { f }$ and $\hat { \psi } ^ { \dagger }$ .
147
+
148
+ Similarly, using $Y ( R x ) = D ( R ) Y ( x )$ and $Y _ { m } ^ { l } = D _ { m 0 } ^ { l } | _ { S ^ { 2 } }$ , one can derive an analogous $S ^ { 2 }$ convolution theorem: $\widehat { \psi \star f } ^ { l } = \hat { f } ^ { l } \cdot \hat { \psi } ^ { l \dagger }$ , where $\hat { f } ^ { l }$ and $\hat { \psi } ^ { l }$ are now vectors. This says that the SO(3)-FT of the $S ^ { 2 }$ correlation of two spherical signals can be computed by taking the outer product of the $S ^ { 2 }$ -FTs of the signals. This is shown in figure 2.
149
+
150
+ ![](images/ef46a6517fac6309c8b4a96ddd8de9dcb4835d254d5bdea7d4b35c2f3dea7bd8.jpg)
151
+ Figure 2: Spherical correlation in the spectrum. The signal $f$ and the locally-supported filter $\psi$ are Fourier transformed, block-wise tensored, summed over input channels, and finally inverse transformed. Note that because the filter is locally supported, it is faster to use a matrix multiplication (DFT) than an FFT algorithm for it. We parameterize the sphere using spherical coordinates $\alpha , \beta$ , and SO(3) with ZYZ-Euler angles $\alpha , \beta , \gamma$ .
152
+
153
+ # 4.1 IMPLEMENTATION OF G-FFT AND SPECTRAL G-CONV
154
+
155
+ Here we sketch the implementation of GFFTs. For details, see (Kostelec and Rockmore, 2007).
156
+
157
+ The input of the SO(3) FFT is a spatial signal $f$ on SO(3), sampled on a discrete grid and stored as a 3D array. The axes correspond to the ZYZ-Euler angles $\alpha , \beta , \gamma$ . The first step of the SO(3)-FFT is to perform a standard 2D translational FFT over the $\alpha$ and $\gamma$ axes. The FFT’ed axes correspond to the $m , n$ axes of the result. The second and last step is a linear contraction of the $\beta$ axis of the FFT’ed array with a precomputed array of samples from the Wigner-d (small-d) functions $d _ { m n } ^ { l } ( \beta )$ . Because the shape of $\dot { \boldsymbol { d } } ^ { l }$ depends on $l$ (it is $( 2 l + 1 ) \times ( 2 l + 1 ) )$ , this linear contraction is implemented as a custom GPU kernel. The output is a set of Fourier coefficients $\hat { f } _ { m n } ^ { l }$ for $l \ge n , m \ge - l$ and $l = 0 , \ldots , L _ { \mathrm { m a x } }$ .
158
+
159
+ The algorithm for the $S ^ { 2 }$ -FFTs is very similar, only in this case we FFT over the $\alpha$ axis only, and do a linear contraction with precomputed Legendre functions over the $\beta$ axis.
160
+
161
+ Our code is available at https://github.com/jonas-koehler/s2cnn.
162
+
163
+ # 5 EXPERIMENTS
164
+
165
+ In a first sequence of experiments, we evaluate the numerical stability and accuracy of our algorithm. In a second sequence of experiments, we showcase that the new cross-correlation layers we have
166
+
167
+ introduced are indeed useful building blocks for several real problems involving spherical signals. Our examples for this are recognition of 3D shapes and predicting the atomization energy of molecules.
168
+
169
+ # 5.1 EQUIVARIANCE ERROR
170
+
171
+ In this paper we have presented the first instance of a group equivariant CNN for a continuous, non-commutative group. In the discrete case, one can prove that the network is exactly equivariant, but although we can prove $[ L _ { R } f ] * \psi = L _ { R } [ f * \psi ]$ for continuous functions $f$ and $\psi$ on the sphere or rotation group, this is not exactly true for the discretized version that we actually compute. Hence, it is reasonable to ask if there are any significant discretization artifacts and whether they affect the equivariance properties of the network. If equivariance can not be maintained for many layers, one may expect the weight sharing scheme to become much less effective.
172
+
173
+ We first tested the equivariance of the SO(3) correlation at various resolutions $b$ . We do this by first sampling $ { n _ { \mathrm { ~ ~ } } } = { \mathrm { ~ ~ } } 5 0 0$ random rotations $R _ { i }$ as well as $n$ feature maps $f _ { i }$ with $\begin{array} { r l r } { K } & { { } = } & { 1 0 } \end{array}$ channels. Then we compute ∆ = 1 Pni= $\begin{array} { r l r } { \Delta } & { { } = } & { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathrm { s t d } ( L _ { R _ { i } } \Phi ( f _ { i } ) - \frac { } { } } \end{array}$ $\Phi ( \dot { L _ { R _ { i } } } f _ { i } ) ) / \mathrm { s t d } ( \Phi ( f _ { i } ^ { * } ) ) ^ { 2 }$ $\Phi$ tion of $\mathrm { S O ( 3 ) }$ correlation layers with randomly initialized filters. In case of perfect equivariance, we expect this quantity to be zero. The results
174
+
175
+ ![](images/d3d7c1c36009b883f99afd321836e7794cb56d52e986769f5a1e5f2d6b48f8b4.jpg)
176
+ Figure 3: $\Delta$ as a function of the resolution and the number of layers.
177
+
178
+ (figure 3 (top)), show that although the approximation error $\Delta$ grows with the resolution and the number of layers, it stays manageable for the range of resolutions of interest.
179
+
180
+ We repeat the experiment with ReLU activation function after each correlation operation. As shown in figure 3 (bottom), the error is higher but stays flat. This indicates that the error is not due to the network layers, but due to the feature map rotation, which is exact only for bandlimited functions.
181
+
182
+ # 5.2 ROTATED MNIST ON THE SPHERE
183
+
184
+ In this experiment we evaluate the generalization performance with respect to rotations of the input. For testing we propose a version MNIST dataset projected on the sphere (see fig. 4). We created two instances of this dataset: one in which each digit is projected on the northern hemisphere and one in which each projected digit is additionally randomly rotated.
185
+
186
+ Architecture and Hyperparameters As a baseline model, we use a simple CNN with layers conv-ReLU-conv-ReLU-FC-softmax, with filters of size $5 \times 5$ , $k ~ = ~ 3 2 , 6 4 , 1 0$ channels, and stride 3 in both layers $( \approx ~ 6 8 \mathrm { { K } }$ parameters). We compare to a spherical CNN with layers $S ^ { 2 }$ conv-ReLU-SO(3)conv-ReLUFC-softmax, bandwidth $b = 3 0 , 1 0 , 6$ and $k =$ 20, 40, 10 channels $\approx 5 8 \mathrm { K }$ parameters).
187
+
188
+ ![](images/fd74038b7a6f9e503d2ac0b3b06f33d17cb2ccc19e37d81033e2e2b5d918fc45.jpg)
189
+ Figure 4: Two MNIST digits projected onto the sphere using stereographic projection. Mapping back to the plane results in non-linear distortions.
190
+
191
+ Results We trained each model on the nonrotated (NR) and the rotated (R) training set and evaluated it on the non-rotated and rotated test set. See table 1. While the planar CNN achieves high accuracy in the NR / NR regime, its performance in the $\textbf { R } / \textbf { R }$ regime is much worse, while the spherical CNN is unaffected. When trained on the non-rotated dataset and evaluated on the rotated dataset $\left( \mathrm { N R } / \mathrm { R } \right)$ , the planar CNN does no better than random chance. The spherical CNN shows a slight decrease in performance compared to $R / R$ , but still performs very well.
192
+
193
+ ![](images/07e466c257be7b4745e5ce199d940869e8c6b31e1c0dee749cec91c6da683f1b.jpg)
194
+ Figure 5: The ray is cast from the surface of the sphere towards the origin. The first intersection with the model gives the values of the signal. The two images of the right represent two spherical signals in $( \alpha , \beta )$ coordinates. They contain respectively the distance from the sphere and the cosine of the ray with the normal of the model. The red dot corresponds to the pixel set by the red line.
195
+
196
+ <table><tr><td></td><td>NR/NR R/R</td><td>NR/R</td></tr><tr><td>planar</td><td>0.98</td><td>0.23 0.11</td></tr><tr><td>spherical</td><td>0.96</td><td>0.95 0.94</td></tr></table>
197
+
198
+ Table 1: Test accuracy for the networks evaluated on the spherical MNIST dataset. Here ${ \bf R } =$ rotated, ${ \mathrm { N R } } =$ non-rotated and $\Chi / \Upsilon$ denotes, that the network was trained on $\mathrm { X }$ and evaluated on Y.
199
+
200
+ # 5.3 RECOGNITION OF 3D SHAPES
201
+
202
+ Next, we applied $S ^ { 2 } C \mathrm { N N }$ to 3D shape classification. The SHREC17 task (Savva et al., 2017) contains 51300 3D models taken from the ShapeNet dataset (Chang et al., 2015) which have to be classified into 55 common categories (tables, airplanes, persons, etc.). There is a consistently aligned regular dataset and a version in which all models are randomly perturbed by rotations. We concentrate on the latter to test the quality of our rotation equivariant representations learned by $S ^ { 2 } C \mathbf { N } \mathbf { N }$ .
203
+
204
+ Representation We project the 3D meshes onto an enclosing sphere using a straightforward ray casting scheme (see Fig. 5). For each point on the sphere we send a ray towards the origin and collect 3 types of information from the intersection: ray length and cos / sin of the surface angle. We further augment this information with ray casting information for the convex hull of the model, which in total gives us 6 channels for the signal. This signal is discretized using a Driscoll-Healy grid (Driscoll and Healy, 1994) with bandwidth $b = 1 2 8$ . Ignoring non-convexity of surfaces we assume this projection captures enough information of the shape to be useful for the recognition task.
205
+
206
+ Architecture and Hyperparameters Our network consists of an initial $S ^ { 2 }$ conv-BN-ReLU block followed by two SO(3)conv-BN-ReLU blocks. The resulting filters are pooled using a max pooling layer followed by a last batch normalization and then fed into a linear layer for the final classification. It is important to note that the the max pooling happens over the group SO(3): if $f _ { k }$ is the $k$ -th filter in the final layer (a function on SO(3)) the result of the pooling is $\mathrm { m a x } _ { x \in S O ( 3 ) } f _ { k } ( x )$ . We used 50, 70, and 350 features for the $S ^ { 2 }$ and the two SO(3) layers, respectively. Further, in each layer we reduce the resolution $b$ , from 128, 32, 22 to 7 in the final layer. Each filter kernel $\psi$ on SO(3) has non-local support, where $\boldsymbol { \psi } ( \alpha , \beta , \gamma ) \neq \boldsymbol { 0 }$ iff $\beta = \textstyle { \frac { \pi } { 2 } }$ and $\gamma = 0$ and the number of points of the discretization is proportional to the bandwidth in each layer. The final network contains $\approx 1 . 4 \mathbf { M }$ parameters, takes 8GB of memory at batch size 16, and takes 50 hours to train.
207
+
208
+ Table 2: Results and best competing methods for the SHREC17 competition.
209
+
210
+ <table><tr><td>Method</td><td>P@N</td><td>R@N</td><td>F1@N</td><td>mAP</td><td>NDCG</td></tr><tr><td>Tatsuma_ReVGG</td><td>0.705</td><td>0.769</td><td>0.719</td><td>0.696</td><td>0.783</td></tr><tr><td>Furuya_DLAN</td><td>0.814</td><td>0.683</td><td>0.706</td><td>0.656</td><td>0.754</td></tr><tr><td>SHREC16-Bai_GIFT</td><td>0.678</td><td>0.667</td><td>0.661</td><td>0.607</td><td>0.735</td></tr><tr><td>Deng_CM-VGG5-6DB</td><td>0.412</td><td>0.706</td><td>0.472</td><td>0.524</td><td>0.624</td></tr><tr><td>Ours</td><td>0.701 (3rd)</td><td>0.711 (2nd)</td><td>0.699 (3rd)</td><td>0.676 (2nd)</td><td>0.756 (2nd)</td></tr></table>
211
+
212
+ Results We evaluated our trained model using the official metrics and compared to the top three competitors in each category (see table 2 for results). Except for precision and $\mathrm { F } 1 @ \mathrm { N }$ , in which our model ranks third, it is the runner up on each other metric. The main competitors, Tatsuma_ReVGG and Furuya_DLAN use input representations and network architectures that are highly specialized to the SHREC17 task. Given the rather task agnostic architecture of our model and the lossy input representation we use, we interpret our models performance as strong empirical support for the effectiveness of Spherical CNNs.
213
+
214
+ # 5.4 PREDICTION OF ATOMIZATION ENERGIES FROM MOLECULAR GEOMETRY
215
+
216
+ Finally, we apply $S ^ { 2 } C \mathbf { N } \mathbf { N }$ on molecular energy regression. In the QM7 task (Blum and Reymond, 2009; Rupp et al., 2012) the atomization energy of molecules has to be predicted from geometry and charges. Molecules contain up to $N = 2 3$ atoms of $T = 5$ types (H, C, N, O, S). They are given as a list of positions $p _ { i }$ and charges $z _ { i }$ for each atom $i$ .
217
+
218
+ Representation by Coulomb matrices Rupp et al. (2012) propose a rotation and translation invariant representation of molecules by defining the Coulomb matrix $C \in \mathbb { R } ^ { N \times N }$ (CM). For each pair of atoms $i \neq j$ they set $C _ { i j } = ( z _ { i } z _ { j } ) / ( | p _ { i } - p _ { j } | )$ and $C _ { i i } = 0 . 5 z _ { i } ^ { 2 . 4 }$ . Diagonal elements encode the atomic energy by nuclear charge, while other elements encode Coulomb repulsion between atoms. This representation is not permutation invariant. To this end Rupp et al. (2012) propose a distance measure between Coulomb matrices used within Gaussian kernels whereas Montavon et al. (2012) propose sorting $C$ or random sampling index permutations.
219
+
220
+ Representation as a spherical signal We utilize spherical symmetries in the geometry by defining a sphere $S _ { i }$ around around $p _ { i }$ for each atom $i$ . The radius is kept uniform across atoms and molecules and chosen minimal such that no intersections among spheres in the training set happen. Generalizing the Coulomb matrix approach we define for each possible $z$ and for each point $x$ on $S _ { i }$ potential functions Uz(x) = Pj6=i,zj=z zi·z|x−pi| producing a $T$ channel spherical signal for each atom in the molecule (see figure 6). This representation is invariant with respect to translations and equivariant with respect to rotations. However, it is still not permutation invariant. The signal is discretized using a Driscoll-Healy (Driscoll and Healy, 1994) grid with bandwidth $b = 1 0$ representing the molecule as a sparse $N \times T \times 2 b \times 2 b$ tensor.
221
+
222
+ Architecture and Hyperparameters We use a deep ResNet style $S ^ { 2 } { \mathrm { C N N } }$ . Each ResNet block is made of $S ^ { 2 } / \mathrm { S O ( 3 ) }$ conv-BN-ReLU-SO(3)conv-BN after which the input is added to the result. We share weights among atoms making filters permutation invariant, by pushing the atom dimension into the batch dimension. In each layer we downsample the bandwidth, while increasing the number of features $F$ . After integrating the signal over SO(3) each molecule becomes a $N \times F$ tensor. For permutation invariance over atoms we follow Zaheer et al. (2017a) and embed each resulting feature vector of an atom into a latent space using a MLP $\phi$ . Then we sum these latent representations over the atom dimension and get our final regression value for the molecule by mapping with another $\mathrm { M L P } \psi$ . Both $\phi$ and $\psi$ are jointly optimized. Training a simple MLP only on the 5 frequencies of atom types in a molecule already gives a RMSE of $\sim 1 9$ . Thus, we train the $S ^ { 2 } C \mathrm { N N }$ on the residual only, which improved convergence speed and stability over direct training. The final architecture is sketched in table 3. It has about 1.4M parameters, consumes 7GB of memory at batch size 20, and takes 3 hours to train.
223
+
224
+ ![](images/a142f943ea7e93794eabd7c5d6860fe444d43941c6436c4c69d271ae40f7c11a.jpg)
225
+ Figure 6: The five potential channels $U _ { z }$ with $z \in \{ 1 , 6 , 7 , 8 , 1 6 \}$ for a molecule containing atoms H (red), C (green), N (orange), O (brown), S (gray).
226
+
227
+ Table 3: Left: Experiment results for the QM7 task: (a) Montavon et al. (2012) (b) Raj et al. (2016). Right: ResNet architecture for the molecule task.
228
+
229
+ <table><tr><td>Method</td><td>Author</td><td>RMSE</td><td>S²CNN</td><td>Layer</td><td>Bandwidth</td><td>Features</td></tr><tr><td>MLP/random CM</td><td>(a)</td><td>5.96</td><td></td><td>Input</td><td></td><td>5</td></tr><tr><td>LGIKA(RF)</td><td>(b)</td><td>10.82</td><td></td><td>ResBlock</td><td>10</td><td>20</td></tr><tr><td>RBF kernels /random CM</td><td>(a)</td><td>11.40</td><td></td><td>ResBlock</td><td>8</td><td>40</td></tr><tr><td>RBFkernels /sorted CM</td><td>(a)</td><td>12.59</td><td></td><td>ResBlock</td><td>6</td><td>60</td></tr><tr><td>MLP /sorted CM</td><td>(a)</td><td>16.06</td><td></td><td>ResBlock</td><td>4</td><td>80</td></tr><tr><td rowspan="4">Ours</td><td></td><td>8.47</td><td></td><td>ResBlock</td><td>2</td><td>160</td></tr><tr><td></td><td></td><td>DeepSet</td><td>Layer</td><td>Input/Hidden</td><td></td></tr><tr><td></td><td></td><td></td><td>(MLP)</td><td>160/150</td><td></td></tr><tr><td></td><td></td><td></td><td> (MLP)</td><td>100/50</td><td></td></tr></table>
230
+
231
+ Results We evaluate by RMSE and compare our results to Montavon et al. (2012) and Raj et al. (2016) (see table 3). Our learned representation outperforms all kernel-based approaches and a MLP trained on sorted Coulomb matrices. Superior performance could only be achieved for an MLP trained on randomly permuted Coulomb matrices. However, sufficient sampling of random permutations grows exponentially with $N$ , so this method is unlikely to scale to large molecules.
232
+
233
+ # 6 DISCUSSION & CONCLUSION
234
+
235
+ In this paper we have presented the theory of Spherical CNNs and evaluated them on two important learning problems. We have defined $S ^ { 2 }$ and SO(3) cross-correlations, analyzed their properties, and implemented a Generalized FFT-based correlation algorithm. Our numerical results confirm the stability and accuracy of this algorithm, even for deep networks. Furthermore, we have shown that Spherical CNNs can effectively generalize across rotations, and achieve near state-of-the-art results on competitive 3D Model Recognition and Molecular Energy Regression challenges, without excessive feature engineering and task-tuning.
236
+
237
+ For intrinsically volumetric tasks like 3D model recognition, we believe that further improvements can be attained by generalizing further beyond SO(3) to the roto-translation group SE(3). The development of Spherical CNNs is an important first step in this direction. Another interesting generalization is the development of a Steerable CNN for the sphere (Cohen and Welling, 2017), which would make it possible to analyze vector fields such as global wind directions, as well as other sections of vector bundles over the sphere.
238
+
239
+ Perhaps the most exciting future application of the Spherical CNN is in omnidirectional vision. Although very little omnidirectional image data is currently available in public repositories, the increasing prevalence of omnidirectional sensors in drones, robots, and autonomous cars makes this a very compelling application of our work.
240
+
241
+ #
242
+
243
+ REFERENCES
244
+ L. C. Blum and J.-L. Reymond. 970 million druglike small molecules for virtual screening in the chemical universe database GDB-13. J. Am. Chem. Soc., 131:8732, 2009.
245
+ W. Boomsma and J. Frellsen. Spherical convolutions and their application in molecular modelling. In I Guyon, U V Luxburg, S Bengio, H Wallach, R Fergus, S Vishwanathan, and R Garnett, editors, Advances in Neural Information Processing Systems 30, pages 3436–3446. Curran Associates, Inc., 2017.
246
+ A.X. Chang, T. Funkhouser, L. Guibas, P. Hanrahan, Q. Huang, Z. Li, S. Savarese, M. Savva, S. Song, H. Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
247
+ G.S. Chirikjian and A.B. Kyatkin. Engineering Applications of Noncommutative Harmonic Analysis. CRC Press, 1 edition, may 2001. ISBN 9781420041767.
248
+ T.S. Cohen and M. Welling. Group equivariant convolutional networks. In Proceedings of The 33rd International Conference on Machine Learning (ICML), volume 48, pages 2990–2999, 2016.
249
+ T.S. Cohen and M. Welling. Steerable CNNs. In ICLR, 2017.
250
+ T.S. Cohen, M. Geiger, J. Koehler, and M. Welling. Convolutional networks for spherical signals. In ICML Workshop on Principled Approaches to Deep Learning, 2017.
251
+ S. Dieleman, K. W. Willett, and J. Dambre. Rotation-invariant convolutional neural networks for galaxy morphology prediction. Monthly Notices of the Royal Astronomical Society, 450(2), 2015.
252
+ S. Dieleman, J. De Fauw, and K. Kavukcuoglu. Exploiting Cyclic Symmetry in Convolutional Neural Networks. In International Conference on Machine Learning (ICML), 2016.
253
+ J.B. Drake, P.H. Worley, and E.F. D’Azevedo. Algorithm 888: Spherical harmonic transform algorithms. ACM Trans. Math. Softw., 35(3):23:1–23:23, 2008. doi: 10.1145/1391989.1404581.
254
+ J.R. Driscoll and D.M. Healy. Computing Fourier transforms and convolutions on the 2-sphere. Advances in applied mathematics, 1994.
255
+ G.B. Folland. A Course in Abstract Harmonic Analysis. CRC Press, 1995.
256
+ R. Gens and P. Domingos. Deep Symmetry Networks. In Advances in Neural Information Processing Systems (NIPS), 2014.
257
+ B. Gutman, Y. Wang, T. Chan, P.M. Thompson, and others. Shape registration with spherical cross correlation. 2nd MICCAI workshop, 2008.
258
+ N. Guttenberg, N. Virgo, O. Witkowski, H. Aoki, and R. Kanai. Permutation-equivariant neural networks applied to dynamics prediction. 2016.
259
+ D. Healy, D. Rockmore, P. Kostelec, and S. Moore. FFTs for the 2-Sphere – Improvements and Variations. The journal of Fourier analysis and applications, 9(4):340–385, 2003.
260
+ P.J. Kostelec and D.N. Rockmore. SOFT: SO(3) Fourier Transforms. 2007. URL http://www. cs.dartmouth.edu/\~geelong/soft/soft20_fx.pdf.
261
+ P.J. Kostelec and D.N. Rockmore. FFTs on the rotation group. Journal of Fourier Analysis and Applications, 14(2):145–179, 2008.
262
+ S. Kunis and D. Potts. Fast spherical Fourier algorithms. Journal of Computational and Applied Mathematics, 161:75–98, 2003.
263
+ A. Makadia, C. Geyer, and K. Daniilidis. Correspondence-free structure from motion. Int. J. Comput. Vis., 75(3):311–327, December 2007.
264
+ D.K. Maslen. Efficient Computation of Fourier Transforms on Compact Groups. Journal of Fourier Analysis and Applications, 4(1), 1998.
265
+
266
+ G. Montavon, K. Hansen, S. Fazli, M. Rupp, F. Biegler, A. Ziehe, A. Tkatchenko, O.A. von Lilienfeld, and K. Müller. Learning invariant representations of molecules for atomization energy prediction. In P. Bartlett, F.C.N. Pereira, C.J.C. Burges, L. Bottou, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 449–457. 2012.
267
+
268
+ L. Nachbin. The Haar Integral. 1965.
269
+
270
+ C. Olah. Groups and Group Convolutions, 2014. URL https://colah.github.io/posts/ 2014-12-Groups-Convolution/.
271
+
272
+ D. Potts, G. Steidl, and M. Tasche. Fast and stable algorithms for discrete spherical Fourier transforms. Linear Algebra and its Applications, 275:433–450, 1998.
273
+
274
+ D. Potts, J. Prestin, and A. Vollrath. A fast algorithm for nonequispaced Fourier transforms on the rotation group. Numerical Algorithms, pages 1–28, 2009.
275
+
276
+ A. Raj, A. Kumar, Y. Mroueh, P.T. Fletcher, et al. Local group invariant representations via orbit embeddings. arXiv preprint arXiv:1612.01988, 2016.
277
+
278
+ S. Ravanbakhsh, J. Schneider, and B. Poczos. Deep learning with sets and point clouds. In International Conference on Learning Representations (ICLR) – workshop track, 2017.
279
+
280
+ D.N. Rockmore. Recent Progress and Applications in Group FFTS. NATO Science Series II: Mathematics, Physics and Chemistry, 136:227–254, 2004.
281
+
282
+ M. Rupp, A. Tkatchenko, K.-R. Müller, and O. A. von Lilienfeld. Fast and accurate modeling of molecular atomization energies with machine learning. Physical Review Letters, 108:058301, 2012.
283
+
284
+ M. Savva, F. Yu, H. Su, A. Kanezaki, T. Furuya, R. Ohbuchi, Z. Zhou, R. Yu, S. Bai, X. Bai, M. Aono, A. Tatsuma, S. Thermos, A. Axenopoulos, G. Th. Papadopoulos, P. Daras, X. Deng, Z. Lian, B. Li, H. Johan, Y. Lu, and S. Mk. Large-Scale 3D Shape Retrieval from ShapeNet Core55. In Ioannis Pratikakis, Florent Dupont, and Maks Ovsjanikov, editors, Eurographics Workshop on 3D Object Retrieval. The Eurographics Association, 2017. ISBN 978-3-03868-030-7. doi: 10.2312/3dor.20171050.
285
+
286
+ Y.C. Su and K. Grauman. Learning spherical convolution for fast features from 360 imagery. Adv. Neural Inf. Process. Syst., 2017.
287
+
288
+ M. Sugiura. Unitary Representations and Harmonic Analysis. John Wiley & Sons, New York, London, Sydney, Toronto, 2nd edition, 1990.
289
+
290
+ M.E. Taylor. Noncommutative Harmonic Analysis. American Mathematical Society, 1986. ISBN 0821815237.
291
+
292
+ M. Weiler, F.A. Hamprecht, and M. Storath. Learning steerable filters for rotation equivariant CNNs. 2017.
293
+
294
+ D.E. Worrall, S.J. Garbin, D. Turmukhambetov, and G.J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In CVPR, 2017.
295
+
296
+ M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. Salakhutdinov, and A. Smola. Deep sets. arXiv preprint arXiv:1703.06114, 2017a.
297
+
298
+ M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R.R. Salakhutdinov, and A.J. Smola. Deep sets. In Advances in Neural Information Processing Systems 30, pages 3393–3403, 2017b.
299
+
300
+ # APPENDIX A: PARAMETERIZATION OF AND INTEGRATION ON $S ^ { 2 }$ AND SO(3)
301
+
302
+ We use the ZYZ Euler parameterization for SO(3). An element $R \in \mathrm { S O ( 3 ) }$ is written as
303
+
304
+ $$
305
+ R = R ( \alpha , \beta , \gamma ) = Z ( \alpha ) Y ( \beta ) Z ( \gamma ) ,
306
+ $$
307
+
308
+ where $\alpha \in [ 0 , 2 \pi ] , \beta \in [ 0 , \pi ]$ and $\gamma \in [ 0 , 2 \pi ]$ , and $Z$ resp. $Y$ are rotations around the $\textsf { Z }$ and $\mathrm { Y }$ axes. Using this parameterization, the normalized Haar measure is
309
+
310
+ $$
311
+ d R = \frac { d \alpha } { 2 \pi } \frac { d \beta \sin ( \beta ) } { 2 } \frac { d \gamma } { 2 \pi }
312
+ $$
313
+
314
+ We have $\int _ { \mathrm { S O ( 3 ) } } d R \ = \ 1$ . The Haar measure (Nachbin, 1965; Chirikjian and Kyatkin, 2001) is sometimes called the invariant measure because it has the property that $\begin{array} { r } { \int _ { \mathrm { S O ( 3 ) } } f ( R ^ { \prime } R ) d R = } \end{array}$ $\int _ { \mathrm { S O ( 3 ) } } f ( R ) d R$ (this is analogous to the more familiar property $\textstyle \int _ { \mathbb { R } } f ( x + y ) d x = \int _ { \mathbb { R } } f ( x ) d x$ for functions on the line). This invariance property allows us to do many useful substitutions.
315
+
316
+ We have a related parameterization for the sphere. An element $x \in S ^ { 2 }$ is written
317
+
318
+ $$
319
+ x ( \alpha , \beta ) = Z ( \alpha ) Y ( \beta ) n
320
+ $$
321
+
322
+ where $n$ is the north pole.
323
+
324
+ This parameterization makes explicit the fact that the sphere is a quotient $S ^ { 2 } = \mathrm { S O ( 3 ) } / \mathrm { S O ( 2 ) }$ , where $H = \mathrm { S O } ( 2 )$ is the subgroup of rotations around the $\textsf { Z }$ axis. Elements of this subgroup $H$ leave the north pole invariant, and have the form $Z ( \gamma )$ . The point $x ( \alpha , \beta ) \in S ^ { 2 }$ is associated with the coset representative $\bar { x } = R ( \alpha , \beta , 0 ) \in \mathrm { S O } ( 3 )$ . This element represents the coset $\bar { x } H = \{ R ( \alpha , \beta , \gamma ) | \gamma \in$ $[ 0 , 2 \pi ] \}$ .
325
+
326
+ The normalized Haar measure for the sphere is
327
+
328
+ $$
329
+ d x = { \frac { d \alpha } { 2 \pi } } { \frac { d \beta \sin \beta } { 2 } }
330
+ $$
331
+
332
+ The normalized Haar measure for SO(2) is
333
+
334
+ $$
335
+ d h = \frac { d \gamma } { 2 \pi }
336
+ $$
337
+
338
+ So we have $d R = d x d h$ , again reflecting the quotient structure.
339
+
340
+ We can think of a function on $S ^ { 2 }$ as a $\gamma$ -invariant function on SO(3). Given a function $f : S ^ { 2 } \to \mathbb { C }$ we associate the function $\bar { f } ( \alpha , \beta , \gamma ) = f ( \alpha , \beta )$ . When using normalized Haar measures, we have:
341
+
342
+ $$
343
+ \begin{array} { l l l } { { \displaystyle \int _ { \mathrm { S O } ( 3 ) } \bar { f } ( R ) d R = \frac { 1 } { 8 \pi ^ { 2 } } \int _ { 0 } ^ { 2 \pi } d \alpha \int _ { 0 } ^ { \pi } \sin \beta d \beta \int _ { 0 } ^ { 2 \pi } d \gamma \bar { f } ( \alpha , \beta , \gamma ) } } \\ { { \displaystyle \qquad = \frac { 1 } { 8 \pi ^ { 2 } } \int _ { 0 } ^ { 2 \pi } d \alpha \int _ { 0 } ^ { \pi } \sin \beta d \beta f ( \alpha , \beta ) \int _ { 0 } ^ { 2 \pi } d \gamma } } \\ { { \displaystyle \qquad = \frac { 1 } { 4 \pi } \int _ { 0 } ^ { 2 \pi } d \alpha \int _ { 0 } ^ { \pi } \sin \beta d \beta f ( \alpha , \beta ) } } \\ { { \displaystyle \qquad = \int _ { S ^ { 2 } } f ( x ) d x } } \end{array}
344
+ $$
345
+
346
+ This will allow us to define the Fourier transform on $S ^ { 2 }$ from the Fourier transform on SO(3), by viewing a function on $S ^ { 2 }$ as a $\gamma$ -invariant function on SO(3) and taking its SO(3)-Fourier transform.
347
+
348
+ # APPENDIX B: CORRELATION & EQUIVARIANCE
349
+
350
+ We have defined the $S ^ { 2 }$ correlation as
351
+
352
+ $$
353
+ [ \psi \star f ] ( R ) = \langle L _ { R } \psi , f \rangle = \int _ { S ^ { 2 } } \sum _ { k = 1 } ^ { K } \psi _ { k } ( R ^ { - 1 } x ) f _ { k } ( x ) d x .
354
+ $$
355
+
356
+ Without loss of generality, we will analyze here the single-channel case $K = 1$
357
+
358
+ This operation is equivariant:
359
+
360
+ $$
361
+ \begin{array} { l } { [ \psi \star [ L _ { Q } f ] ] ( R ) = \displaystyle \int _ { S ^ { 2 } } \psi ( R ^ { - 1 } x ) f ( Q ^ { - 1 } x ) d x } \\ { \displaystyle \qquad = \displaystyle \int _ { S ^ { 2 } } \psi ( R ^ { - 1 } Q x ) f ( x ) d x } \\ { \displaystyle \qquad = \displaystyle \int _ { S ^ { 2 } } \psi ( ( Q ^ { - 1 } R ) ^ { - 1 } x ) f ( x ) d x } \\ { \displaystyle \qquad = [ \psi \star f ] ( Q ^ { - 1 } R ) } \\ { \displaystyle \qquad = [ L _ { Q } [ \psi \star f ] ] ( R ) } \end{array}
362
+ $$
363
+
364
+ A similar derivation can be made for the SO(3) correlation.
365
+
366
+ The spherical convolution defined by Driscoll and Healy (1994) is:
367
+
368
+ $$
369
+ [ f * \psi ] ( x ) = \int _ { \mathrm { S O ( 3 ) } } f ( R n ) \psi ( R ^ { - 1 } x ) d R
370
+ $$
371
+
372
+ where $n$ is the north pole. Note that in this definition, the output of the spherical convolution is a function on the sphere, not a function on SO(3) as in our definition of cross-correlation. Note further that unlike our definition, this definition involves an integral over SO(3).
373
+
374
+ If we write out the integral in terms of Euler angles, noting that the north-pole $n$ is invariant to $Z$ -axis rotations by $\gamma$ , i.e. $\bar { R ( \alpha , \beta , \gamma ) } n = Z ( \alpha ) Y ( \bar { \beta } ) Z ( \gamma ) n \stackrel { . . } { = } Z ( \alpha ) Y ( \beta ) n$ , we see that this definition implicitly integrates over $\gamma$ in only one of the factors (namely $\psi$ ), making it invariant wrt $\gamma$ rotation. In other words, the filter is first “averaged” (making it circularly symmetric) before it is combined with $f$ (This was observed before by Makadia et al. (2007)). We consider this to be much too limited for the purpose of pattern matching in spherical CNNs.
375
+
376
+ # APPENDIX C: GENERALIZED FOURIER TRANSFORM
377
+
378
+ With each compact topological group (like SO(3)) is associated a discrete set of orthogonal functions that arise as matrix elements of irreducible unitary representations of these groups. For the circle (the group SO(2)) these are the complex exponentials (in the complex case) or sinusoids (for real functions). For SO(3), these functions are known as the Wigner D-functions.
379
+
380
+ As discussed in the paper, the Wigner D-functions are parameterized by a degree parameter $l \geq 0$ and order parameters $m , n \in [ - l , \ldots , l ]$ . In other words, we have a set of matrix-valued functions $D ^ { l } : \mathrm { S O ( 3 ) } \mathbb { C } ^ { ( 2 l + 1 ) \times ( 2 l + 1 ) }$ .
381
+
382
+ The Wigner D-functions are orthogonal:
383
+
384
+ $$
385
+ \langle D _ { m n } ^ { l } , D _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } \rangle = \int _ { 0 } ^ { 2 \pi } { \frac { d \alpha } { 2 \pi } } \int _ { 0 } ^ { \pi } { \frac { d \beta \sin \beta } { 2 } } \int _ { 0 } ^ { 2 \pi } { \frac { d \gamma } { 2 \pi } } D _ { m n } ^ { l } ( \alpha , \beta , \gamma ) \overline { { { D _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } } } } ( \alpha , \beta , \gamma ) = { \frac { \delta _ { l l ^ { \prime } } \delta _ { m m ^ { \prime } } \delta _ { n n ^ { \prime } } } { 2 l + 1 } }
386
+ $$
387
+
388
+ Furthermore, they are complete, meaning that any well behaved function $f : \mathrm { S O } ( 3 ) \mathbb { C }$ can be written as a linear combination of Wigner D-functions. This is the idea of the Generalized Fourier Transform $\mathcal { F }$ on SO(3):
389
+
390
+ $$
391
+ f ( R ) = [ \mathcal { F } ^ { - 1 } \hat { f } ] ( R ) = \sum _ { l = 0 } ^ { \infty } ( 2 l + 1 ) \sum _ { m = - l } ^ { l } \sum _ { n = - l } ^ { l } \hat { f } _ { m n } ^ { l } D _ { m n } ^ { l } ( R )
392
+ $$
393
+
394
+ where $\hat { f } _ { m n } ^ { l }$ are called the Fourier coefficients of $f$ . Using the orthogonality property of the Wigner D-functions, one can see that the Fourier coefficients can be retrieved by computing the inner product with the Wigner D-functions:
395
+
396
+ $$
397
+ \begin{array} { l } { { \displaystyle | \mathcal { F } f | _ { m n } ^ { l } = \int _ { \mathrm { S O } ( 3 ) } f ( R ) \overline { { { D _ { m n } ^ { l } ( R ) } } } d R } } \\ { { \displaystyle \quad = \int _ { \mathrm { S O } ( 3 ) } \left[ \sum _ { \ell ^ { \prime } = 0 } ^ { \infty } ( 2 l ^ { \prime } + 1 ) \sum _ { m ^ { \prime } = - l ^ { \prime } } ^ { \ell ^ { \prime } } \sum _ { n ^ { \prime } = - l ^ { \prime } } ^ { l ^ { \prime } } \hat { f } _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } D _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } ( R ) \right] \overline { { { D _ { m n } ^ { l } ( R ) } } } d R } } \\ { { \displaystyle \quad = \sum _ { l ^ { \prime } = 0 } ^ { \infty } ( 2 l ^ { \prime } + 1 ) \sum _ { m ^ { \prime } = - l ^ { \prime } } ^ { l ^ { \prime } } \sum _ { n ^ { \prime } = - l ^ { \prime } } ^ { l ^ { \prime } } \hat { f } _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } \int _ { \mathrm { S O } ( 3 ) } D _ { m ^ { \prime } n ^ { \prime } } ^ { l ^ { \prime } } ( R ) \overline { { { D _ { m n } ^ { l } } } } d R } } \\ { { \displaystyle \quad = \hat { f } _ { m n } ^ { l } } } \end{array}
398
+ $$
399
+
400
+ # APPENDIX D: FOURIER THEOREMS
401
+
402
+ Fourier convolution theorems for SO(3) and $\ S ^ { 2 }$ can be found in Kostelec and Rockmore (2008);
403
+ Makadia et al. (2007); Gutman et al. (2008). We derive them here for completeness.
404
+
405
+ To derive the convolution theorems, we will use the defining property of the Wigner D-matrices: that they are (irreducible, unitary) representations of SO(3). This means that they satisfy:
406
+
407
+ $$
408
+ D ^ { l } ( R ) D ^ { l } ( R ^ { \prime } ) = D ^ { l } ( R R ^ { \prime } ) ,
409
+ $$
410
+
411
+ for any $R , R ^ { \prime } \in \mathrm { S O } ( 3 )$ . Notice that the complex exponentials satisfy an analogous criterion for the circle group $S ^ { 1 } \cong \operatorname { S O } ( 2 )$ . That is, $e ^ { i n x } e ^ { i n y } = e ^ { i n ( x + y ) }$ , where $x + y$ is the group operation for SO(2).
412
+
413
+ Unitarity means that $D ^ { l } ( R ) D ^ { l \dagger } ( R ) = I$ . Irreducibility means, essentially, that the set of matrices $\{ D ^ { l } ( R ) \mathbf { \bar { \vert } } R \in \mathrm { S O ( 3 ) } \}$ cannot be simultaneously block-diagonalized.
414
+
415
+ To derive the Fourier theorem for SO(3), we use the invariance of the integration measure $d R$ : $\begin{array} { r } { \int _ { \mathrm { S O ( 3 ) } } f ( R ^ { \prime } R ) d R = \int _ { \mathrm { S O ( 3 ) } } f ( R ) d R } \end{array}$ .
416
+
417
+ With these facts understood, we can proceed to derive:
418
+
419
+ $$
420
+ \begin{array} { r l } { { \widetilde { \psi ^ { * } \mathcal { H } } = \int _ { \mathrm { s o o ( 3 ) } } ( \psi * f ) ( R ) \widetilde { D ^ { \prime } ( R ) } d R } } \\ & { = \int _ { \mathrm { s o ( 3 ) } } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ^ { - 1 } R ^ { \prime } ) f ( R ^ { \prime } ) d R ^ { \prime } \overline { { D ^ { \prime } ( R ) } } d R } \\ & { = \int _ { \mathrm { s o ( 3 ) } } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ^ { - 1 } ) f ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ^ { \prime } \widetilde { D } ) } } d R ^ { \prime } d R } \\ & { = \int _ { \mathrm { s o ( 3 ) } } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ^ { \prime } ) } } d R ^ { \prime } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ^ { - 1 } ) \overline { { D ^ { \prime } ( R ) } } d R } \\ & { = \int _ { \mathrm { s o ( 3 ) } } f ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ^ { \prime } ) } } d R ^ { \prime } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ) } } d R } \\ & { = \int _ { \mathrm { s o ( 3 ) } } f ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ^ { \prime } ) } } d R ^ { \prime } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ) \overline { { D ^ { \prime } ( R ) } } ^ { \dag } d R } \\ & { = \int _ { \mathrm { s o ( 3 ) } } ^ { t } \psi ( R ^ { \prime } ) \overline { { D ^ { \prime } ( R ^ { \prime } ) } } d R ^ { \prime } \int _ { \mathrm { s o ( 3 ) } } \psi ( R ) \overline { { D ^ { \prime } ( R ) } } ^ { \dag } d R } \\ & { = \int _ { t } ^ { t } \hat { \psi } ^ { \mathrm { H } } } \end{array}
421
+ $$
422
+
423
+ So the SO(3)-Fourier transform of the SO(3) convolution of $\psi$ and $f$ is equal to the matrix product of the SO(3)-Fourier transforms $\hat { f }$ and $\hat { \psi }$ .
424
+
425
+ For the sphere, we can derive an analogous transform that is sometimes called the spherical harmonics transform. The spherical harmonics ${ \bar { Y } } _ { m } ^ { l } : S ^ { 2 } \to \mathbb { C }$ are a complete orthogonal family of functions. The spherical harmonics are related to the Wigner $\mathrm { D }$ functions by the relation $D _ { m n } ^ { l } ( \alpha , \beta , \gamma ) =$ $Y _ { m } ^ { l } ( \alpha , \beta ) e ^ { i n \gamma }$ , so that $Y _ { m } ^ { l } ( \alpha , \beta ) = D _ { m 0 } ^ { l } ( \alpha , \beta , 0 )$ .
426
+
427
+ The $S ^ { 2 }$ convolution of $f _ { 1 }$ and $f _ { 2 }$ is equivalent to the SO(3) convolution of the associated rightinvariant functions ${ \bar { f } } _ { 1 } , { \bar { f } } _ { 2 }$ (see Appendix A):
428
+
429
+ $$
430
+ \begin{array} { l } { { [ f _ { 1 } \star f _ { 2 } ] ( R ) = \displaystyle \int _ { S ^ { 2 } } f _ { 1 } ( R ^ { - 1 } x ) f _ { 2 } ( x ) d x } } \\ { { \displaystyle \quad = \int _ { S \mathrm { O } ( 2 ) } \int _ { S ^ { 2 } } f _ { 1 } ( R ^ { - 1 } x ) f _ { 2 } ( x ) d x d h } } \\ { { \displaystyle \quad = \int _ { S \mathrm { O } ( 3 ) } \bar { f } _ { 1 } ( R ^ { - 1 } R ^ { \prime } ) \bar { f } _ { 2 } ( R ^ { \prime } ) d R ^ { \prime } } } \\ { { \displaystyle \quad = [ \bar { f } _ { 1 } \star \bar { f } _ { 2 } ] ( R ) } } \end{array}
431
+ $$
432
+
433
+ The Fourier transform of a right invariant function on SO(3) equals
434
+
435
+ $$
436
+ \begin{array} { r l } { { [ \mathcal { F } \bar { f } ] _ { m n } ^ { l } = \int _ { 0 } ^ { 2 \pi } \displaystyle \frac { d \alpha } { 2 \pi } \int _ { 0 } ^ { \pi } \displaystyle \frac { d \beta \sin \beta } { 2 } \int _ { 0 } ^ { 2 \pi } \displaystyle \frac { d \gamma } { 2 \pi } \bar { f } ( \alpha , \beta , \gamma ) \overline { { D _ { m n } ^ { l } ( \alpha , \beta , \gamma ) } } } } \\ & { = \int _ { 0 } ^ { 2 \pi } \displaystyle \frac { d \alpha } { 2 \pi } \int _ { 0 } ^ { \pi } \displaystyle \frac { d \beta \sin \beta } { 2 } f ( \alpha , \beta ) \int _ { 0 } ^ { 2 \pi } \displaystyle \frac { d \gamma } { 2 \pi } \displaystyle \frac { l } { D _ { m n } ^ { l } ( \alpha , \beta , \gamma ) } } \\ & { = \delta _ { n 0 } \int _ { 0 } ^ { 2 \pi } \displaystyle \frac { d \alpha } { 2 \pi } \int _ { 0 } ^ { \pi } \displaystyle \frac { d \beta \sin \beta } { 2 } f ( \alpha , \beta ) \overline { { D _ { m 0 } ^ { l } ( \alpha , \beta , 0 ) } } } \\ & { = \delta _ { n 0 } \displaystyle \int _ { S ^ { 2 } } f ( x ) \overline { { Y _ { m } ^ { l } ( x ) } } d x } \end{array}
437
+ $$
438
+
439
+ So we can think of the $S ^ { 2 }$ Fourier transform of a function on $S ^ { 2 }$ as the $n = 0$ column of the SO(3) Fourier transform of the associated right-invariant function. This is a beautiful result that we have not been able to find a reference for, though it seems likely that it has been observed before.
md/train/HyMS8iRcK7/HyMS8iRcK7.md ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEQUENCE MODELLING WITH AUTO-ADDRESSINGAND RECURRENT MEMORY INTEGRATING NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Processing sequential data with long term dependencies and learn complex transitions are two major challenges in many deep learning applications. In this paper, we introduce a novel architecture, the Auto-addressing and Recurrent Memory Integrating Network (ARMIN) to address these issues. The ARMIN explicitly stores previous hidden states and recurrently integrate useful past states into current time-step by an efficient memory addressing mechanism. Compared to existing memory networks, the ARMIN is more light-weight and inference-time efficient. Our network can be trained on small slices of long sequential data, and thus, can boost its training speed. Experiments on various tasks demonstrate the efficiency of the ARMIN architecture. Codes and models will be available.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Recurrent neural networks, such as the Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) and Gated Recurrent Unit (GRU) (Cho et al., 2014) have shown promising performance for processing sequential data. However, it’s known that RNNs suffer from gradient vanishing problem. Moreover, as pointed out by Rae et al. (2016), the number of parameters grows proportionally to the square of the size of the hidden units, which carry the historical information. Recent memorybased approaches exhibit potential to address these issues, by decoupling memory capacity from model parameters, and backpropagating the gradients through the memory.
12
+
13
+ Neural Turing Machine (NTM) (Graves et al., 2014) first emerged as a recurrent model that incorporates external memory abilities. NTM maintains a memory matrix, and at every time-step, the network reads and writes (with erasing) to the memory matrix using certain soft-attentional mechanism, controlled by an LSTM that produces read and write vectors. NTM and its successor, the Differentiable Neural Computer(Graves et al., 2016), have shown success on some algorithmic tasks such as copying, priority sorting and some real-world tasks such as question answering. But one limitation of the NTM is that due to its smooth read and write mechanism, NTM has to do propagations on the entire memory, usually causing huge amount of memory consumption. To this end, Rae et al. (2016) proposes the Sparse Access Memory(SAM) network, by thresholding memory modifications to a sparse subset, i.e. all read and write operations are limited to several memory words. This allows memory and time efficient propagations while maintaining NTM’s performance. However, these external memory models have relatively complicated memory addressing mechanisms, making them suitable for only large-scale memory. Moreover, the RNN in these models plays a simple role of being a controller, but the gradient vanishing problem of RNN itself is not given attention. In contrast to these networks, our network uses a light-weight read mechanism to address a small external memory, and relieves the gradient vanishing problem by directly concatenating memory word to output.
14
+
15
+ Inspired by prior memory models, efforts have been made to build a bridge between simple RNNs and complicated memory models. Kurach et al. (2015) propose the Neural Random-access Machines (NRAM) that can manipulate and dereference pointers to an external variable-size random-access memory. Danihelka et al. (2016) improve LSTM with ideas from Holographic Reduced Representations (Plate, 2003) that enables key-value storage of data. Grave et al. (2016) propose a method of augmenting LSTM by storing previous (hidden state, input word) pairs in memory and using the current hidden state as a query vector to recover historical input words. This method requires no backpropagation through memory and is well-suited to word-level language tasks. Grefenstette et al. (2015); Dyer et al. (2015); Joulin & Mikolov (2015) augment RNNs with a stack structure that works as a natural parsing tool, and use them to process algorithmic and nature language processing (NLP) tasks; nonetheless, the speed of stack-augmented RNNs is rather slow due to multiple push-pop operations at every time-step. Ke et al. (2018) propose the Sparse Attentive Backtracking (SAB) architecture, which recalls a few past hidden sates at every time-step and do “mental” backpropogations to the nearby hidden states with respect to the past hidden states. Gulcehre et al. (2017) propose the TARDIS network, which is an LSTM-resembled RNN that directly stores a fixed number of previous hidden states with learned key parameters for memory addressing. At every time-step, the network reads out one historical state $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ from the memory, and uses it, along with the input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and last hidden state $h _ { t - 1 }$ , to produce new hidden state $h _ { t }$ , then overwrites $\boldsymbol { h } _ { t }$ to the location of $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ . TARDIS optionally uses the gumbel-softmax estimator(Maddison et al., 2016; Jang et al., 2016) to sample the location of $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ (we will explain this in section 2.1), so the whole network is differentiable. However, the TARDIS still involves some hand-crafted memory addressing method and its addressing mechanism requires a considerable amount of memory and time consumption.
16
+
17
+ Inspired by the TARDIS, we introduce the ARMIN architecture, a more light-weight and memorybased architecture with a very simple memory addressing mechanism and in-depth modification of the existing LSTM structure. Concretely, our contributions are as follows:
18
+
19
+ • We distill previous memory addressing methods and propose a simple yet effective memory addressing mechanism for the external memory, namely Auto-addressing, by encoding the information for memory addressing directly via the inputs $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and the hidden states $\boldsymbol { h } _ { t - 1 }$ . • We propose a novel recurrent cell that combines the gating advantages of LSTM and allows direct gradient backpropagation from output to memory. With only a single cell, it learns better representations than many hierarchical RNN structures. • We show in our ablation study that the ARMIN is robust to small iteration lengths when training long sequential data, which enables training with large batch sizes and boost its training speed. We further demonstrate in char-level language modelling task that the ARMIN obtain $4 0 \%$ training speed gain than LSTM while keeping similar performance and memory consumption.
20
+
21
+ • We demonstrate competitive results on various tasks while keeping efficient time and memory consumption during training and inference time.
22
+
23
+ # 2 BACKGROUND
24
+
25
+ # 2.1 GUMBEL-SOFTMAX ESTIMATOR
26
+
27
+ Categorical distribution is a natural choice for representing discrete structure in the world; however, it’s rarely used in neural networks due to its inability to backpropagate through samples(Jang et al., 2016). To this end, Maddison et al. (2016) and Jang et al. (2016) propose a continuous relaxation of categorical distribution and the corresponding gumbel-softmax gradient estimator that replaces the non-differentiable sample from a categorical distribution with a differentiable sample. Specifically, given a probability distribution $\pmb { p } = ( \pi _ { 1 } , \pi _ { 2 } , . . . , \pi _ { k } )$ over $k$ categories, the gumbel-softmax estimator produces an one-hot sample vector $\textbf { { y } }$ with its $i$ -th element calculated as follows:
28
+
29
+ $$
30
+ y _ { i } = { \frac { \exp ( ( \log ( \pi _ { i } ) + g _ { i } ) / \tau ) } { \sum _ { j = 1 } ^ { k } \exp ( ( \log ( \pi _ { j } ) + g _ { j } ) / \tau ) } } \quad { \mathrm { f o r ~ } } i = 1 , 2 , . . . , k ,
31
+ $$
32
+
33
+ where $g _ { 1 } , . . . , g _ { k }$ are i.i.d samples drawn from Gumbel distribution(Gumbel, 1954):
34
+
35
+ $$
36
+ g _ { i } = - \log ( - \log ( u _ { i } ) ) \ , u _ { i } \sim \mathrm { U n i f o r m } ( 0 , 1 ) ,
37
+ $$
38
+
39
+ and $\tau$ is the temperature parameter. In practice, we usually start at a high temperature and anneal to a small but non-zero temperature (Jang et al., 2016).
40
+
41
+ # 3 AUTO-ADDRESSING AND RECURRENT MEMORY INTEGRATING NETWORK
42
+
43
+ In this section, we describe the structure of the ARMIN network as shown in Figure 1. It consists of a recurrent cell and a small external memory that stores historical hidden states. While processing
44
+
45
+ ![](images/eab2a73d816507916b458d579eb538fc7d49d69aba42b4a31414c981c7c3217e.jpg)
46
+ Figure 1: The ARMIN structure. At each time-step, the ARMIN performs read operation, cell processing and write operation in chronological order: (a) It reads out a historical hidden state $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ from memory with an one-hot read vector produced via passing $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $\boldsymbol { h } _ { t - 1 }$ to a fully connected layer followed by a gumbel-softmax function. (b) The ARMIN cell receives $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , $h _ { t - 1 }$ and $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ as inputs and outputs $\mathbf { } _ { o _ { t } }$ and $\boldsymbol { h } _ { t }$ . $\mathbf { } _ { o _ { t } }$ is passed to output layers, and $h _ { t }$ is passed to next time-step. (c) $\boldsymbol { h } _ { t }$ is written to the previous location of $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ .
47
+
48
+ sequential data, the ARMIN performs reading from memory, cell processing and writing to memory operations in chronological order during each time-step. In the following subsections, we first explain the structure of the recurrent cell, and then discuss the read and write operations.
49
+
50
+ # 3.1 THE RECURRENT CELL OF ARMIN
51
+
52
+ Inspired by classical LSTM structure (please refer to APPENDIX A for details in RNN and LSTM structures), we propose a novel memory-augmented recurrent cell structure, namely the ARMIN cell. At every time-step, it takes in an input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , the last hidden state $\boldsymbol { h } _ { t - 1 }$ and a recovered historical hidden state $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ chosen by a read operation, and produces an output vector $\mathbf { } _ { o _ { t } }$ and the new hidden state $\boldsymbol { h } _ { t }$ . The computation process is as follows:
53
+
54
+ $$
55
+ \left\{ { g } _ { t } ^ { h } \atop { g } _ { t } ^ { r } \right\} = \left\{ { \sigma } \atop { \sigma } \right\} W _ { i g } [ x _ { t } , h _ { t - 1 } , r _ { t } ] + b _ { i g } ,
56
+ $$
57
+
58
+ $$
59
+ h _ { t - 1 } ^ { g } = { \pmb g } _ { t } ^ { h } \circ { \pmb h } _ { t - 1 } ,
60
+ $$
61
+
62
+ $$
63
+ \begin{array} { r } { \pmb { r } _ { t } ^ { g } = \pmb { g } _ { t } ^ { r } \circ \pmb { r } _ { t } , } \end{array}
64
+ $$
65
+
66
+ $$
67
+ \left\{ \begin{array} { c } { i _ { t } } \\ { f _ { t } } \\ { g _ { t } } \\ { o _ { t } ^ { h } } \\ { o _ { t } ^ { r } } \end{array} \right\} = \left\{ \begin{array} { c } { \sigma } \\ { \sigma } \\ { \operatorname { t a n h } } \\ { \sigma } \\ { \sigma } \\ { \sigma } \end{array} \right\} W _ { g o } [ \boldsymbol { x } _ { t } , h _ { t - 1 } ^ { g } , \boldsymbol { r } _ { t } ^ { g } ] + b _ { g o } ,
68
+ $$
69
+
70
+ $$
71
+ \pmb { h } _ { t } = \pmb { f } _ { t } \circ \pmb { h } _ { t - 1 } + i _ { t } \circ \pmb { g } _ { t } ,
72
+ $$
73
+
74
+ $$
75
+ \begin{array} { r } { \pmb { o } _ { t } = \left[ \pmb { o } _ { t } ^ { h } \circ \operatorname { t a n h } ( \pmb { h } _ { t } ) , \pmb { o } _ { t } ^ { r } \circ \operatorname { t a n h } ( \pmb { r } _ { t } ) \right] . } \end{array}
76
+ $$
77
+
78
+ where $h _ { t - 1 } , h _ { t } \in \mathbb { R } ^ { d _ { h } } , { \boldsymbol { r } } _ { t } \in \mathbb { R } ^ { d _ { r } } , { \boldsymbol { x } } _ { t } \in \mathbb { R } ^ { d _ { i } }$ , and $\begin{array} { r c l } { W _ { i g } } & { \in } & { \mathbb { R } ^ { 2 d _ { h } \times ( d _ { i } + d _ { h } + d _ { r } ) } , W _ { g o } } & { \in } \end{array}$ $\begin{array} { r } { \mathbb { R } ^ { ( 4 d _ { h } + d _ { r } ) \times ( d _ { i } + d _ { h } + d _ { r } ) } , \pmb { b } _ { i g } \ \in \ \mathbb { R } ^ { d _ { h } + d _ { r } } , \pmb { b } _ { g o } \ \in \ \mathbb { R } ^ { 4 d _ { h } + d _ { r } } , \pmb { o } _ { t } \ \in \ \mathbb { R } ^ { d _ { h } + d _ { r } } } \end{array}$ . We refer to $d _ { h }$ as the hidden size of the recurrent cell of ARMIN. Usually we have $d _ { h } = d _ { r }$ and allocate equal number of weight parameters for $\boldsymbol { h } _ { t }$ and $\mathbf { \nabla } _ { \mathbf { \boldsymbol { r } } _ { t } }$ .
79
+
80
+ In equation $3 \sim 5$ , two gates are calculated to control the information flow for $h _ { t - 1 }$ and $r _ { t }$ respectively, generating gated hidden state $h _ { t - 1 } ^ { g }$ and historical state $\boldsymbol { r } _ { t } ^ { g }$ ; using this method, we can filter out the irrelevant information for the current time-step. Then as shown in equation 6, we compute the input gate $\mathbf { \delta } _ { i _ { t } }$ , forget gate $\pmb { f } _ { t }$ , cell state $\mathbf { \pmb { g } } _ { t }$ and output gate $\mathbf { \sigma } _ { o _ { t } ^ { h } } ^ { h }$ for the new hidden state just like in classical LSTM structure. Additionally, an output gate ${ \mathbf { } } _ { o _ { t } ^ { r } }$ for historical state $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ is computed. Next in equation 7, we compute new hidden state $h _ { t }$ that is the sum of $h _ { t - 1 }$ and cell state $\mathbf { \sigma } _ { \mathbf { \sigma } _ { \mathbf { \sigma } _ { \mathbf { \lambda } } } } \mathbf { \sigma } _ { \mathbf { \sigma } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \mathbf { \lambda } } } \mathbf { \sigma } _ { \mathbf { \lambda } _ { \lambda } }$ , leveraged by forget gate $\pmb { f } _ { t }$ and input gate $\dot { \mathbf { \delta } } _ { \mathbf { \delta } }$ . Finally in equation 8, we calculate the output of this timestep, which is the concatenation of the gated contents from $h _ { t }$ and $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ . Using this method, we can selectively backpropagate gradients from the output to the historical state $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ . We involve $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ (or $\boldsymbol { r } _ { t } ^ { g }$ ) in all gates’ computations.
81
+
82
+ Intuitively, the $\boldsymbol { h } _ { t - 1 }$ acts as the old working memory, and $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ is treated as the long-term memory. The cell processes them with the input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ to generate the new working memory $\boldsymbol { h } _ { t }$ and the output $\mathbf { } _ { o _ { t } }$ . More specifically, each $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ is a summary of historical hidden states selected by auto-addressing mechanism. The ARMIN cell learns to recurrently integrate the summary of long-term information from $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ into the working memory $\boldsymbol { h } _ { t }$ . We will demonstrate the efficiency of recurrent memory integration in language modelling tasks.
83
+
84
+ Unlike the LSTM that passes a tuple of $\left( \boldsymbol { h } _ { t } , \boldsymbol { c } _ { t } \right)$ to the next recurrence and outputs $\boldsymbol { h } _ { t }$ at the same time, the ARMIN only passes one hidden state $h _ { t }$ and separately uses $\mathbf { } _ { o _ { t } }$ as output, which has 2 benefits: one is that it takes lower memory consumption to store one hidden state rather than two, and the other is we can decouple the information needed for the output $\mathbf { } _ \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf $ , from the information (i.e. $\boldsymbol { h } _ { t }$ ) that is needed for memorizing and being used at later time-steps. Furthermore, we list 3 important differences between the ARMIN cell and TARDIS cell, please refer to APPENDIX B.1.
85
+
86
+ # 3.2 READ OPERATION WITH AUTO-ADDRESSING
87
+
88
+ The ARMIN maintains a memory matrix $M \in \mathbb { R } ^ { n _ { m e m } \times d _ { h } }$ , where the constant $n _ { m e m }$ denotes the number of memory slots. At each recurrence, the ARMIN chooses a historical state $r _ { t }$ from memory according to the information in $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $\boldsymbol { h } _ { t - 1 }$ ,which is formulated as follows:
89
+
90
+ $$
91
+ \begin{array} { c } { { \displaystyle s _ { t } = \mathrm { g u m b e l - s o f t m a x } \big ( W _ { s } [ \ : x _ { t } \ : , h _ { t - 1 } \ : ] + b _ { s } \big ) \ : , } } \\ { { { } } } \\ { { \displaystyle r _ { t } = \sum _ { i = 0 } ^ { n - 1 } s _ { t } ( i ) M ( i , : ) \ : . } } \end{array}
92
+ $$
93
+
94
+ where $W _ { s } \ \in \ \mathbb { R } ^ { n _ { m e m } \times ( d _ { i } + d _ { h } ) }$ , $b _ { s } \in \mathbb { R } ^ { n _ { m e m } }$ , $\mathbf { \Delta } _ { \mathbf { \mathcal { S } } _ { t } }$ is a one-hot vector sampled by gumbel-softmax function, $s _ { t } ( i )$ denotes the $i$ -th element of $\mathbf { \boldsymbol { s } } _ { t }$ , $M ( i , : )$ denotes the $i$ -th row of $M$ .
95
+
96
+ As opposed to previous memory networks such as Santoro et al. (2016) and Gulcehre et al. (2017), we don’t use any extra usage vectors and learnable key parameters that manually encode memory addressing information to assist memory addressing. As our ablation study (Appendix E) shows, the hidden state $\boldsymbol { h } _ { t - 1 }$ is sufficient to encode the historical memory accessing information. Furthermore, the TARDIS addressing mechanism requires concatenating $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $\boldsymbol { h } _ { t }$ to every memory cell, which usually causes large extra memory and time consumption in practical scenes. Please refer to APPENDIX B.2 for more precise comparison regarding addressing mechanism of the ARMIN and TARDIS networks.
97
+
98
+ # 3.3 WRITE OPERATION
99
+
100
+ After the reading and cell processing stages, the ARMIN writes the new hidden state $\boldsymbol { h } _ { t }$ to the memory $M$ . Following the TARDIS network (Gulcehre et al., 2017), we simply overwrite $h _ { t }$ to the memory slot where we just read out the $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ (for conditions where $d _ { h }$ is not equal to $d _ { r }$ , we first use a linear layer to transform $\boldsymbol { h } _ { t }$ from $d _ { h }$ dimension to $d _ { r }$ dimension). But at the initial time-steps, we write the hidden states to the empty memory slots, until all empty slots are filled with historical states. In this way, we can maximally preserve useful historical information, because the ARMIN cell can learn to copy the useful information from $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ to $\boldsymbol { h } _ { t }$ , and then write $h _ { t }$ to the previous location of $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ . The read/write mechanism can be viewed as a form of a skip-connection of hidden states. By training the whole network, the ARMIN can easily learn long-term dependencies via direct access to historical hidden states. From this point of view, our network is similar to the Skip RNN proposed by Campos Camunez et al. (2018), which differs from our network in that they use a binary state update gate to select whether the state of the RNN will be updated or copied from the previous time-step.
101
+
102
+ # 4 EXPERIMENTS
103
+
104
+ We evaluate our model on algorithmic tasks, character-level language modelling task and temporal action detection and proposal task. We compare our network with NTM (with an LSTM controller), TARDIS and vanilla LSTM networks. We also directly compare the auto-addressing against the TARDIS addressing mechanism, by replacing auto-addressing with the TARDIS addressing method in ARMIN. We refer to this network as ARMIN $^ +$ TARDIS-addr in our experiments. Please refer to APPENDIX C for some universal setups used in all our experiments below.
105
+
106
+ # 4.1 ALGORITHMIC TASKS
107
+
108
+ Along with the NTM, Graves et al. (2014) introduced a set of synthetic algorithm tasks which consists of copy, repeat copy, associative recall, N-gram and priority sort tasks. Here we use four out of five of these tasks (excluding the N-gram task) to examine if our network can choose correct time-steps from the past and effectively make use of them. Please refer to APPENDIX C.1 for more explanations and hyperparameter setups with respect to these tasks. Note that we have a strong LSTM baseline with about 4 times larger parameter count than memory networks, and the training of our copy and priority sort tasks are more challenging than the original tasks in Graves et al. (2014), for having more than 2 times longer input and target sequences. The models are optimized to minimize the averaged binary cross-entropy loss on the target multi-bit binary sequences. Following Gulcehre et al. (2017); Campos Camunez et al. (2018), in all tasks, we consider a task solved if the validation loss is at least two orders of magnitude below the initial cost which is around 0.70, i.e. the validation loss (the validation set is generated randomly) converges to less than 0.01 (with less than $3 0 \%$ in 10 consecutive validation of sharp losses that are higher than 0.01 ). In our evaluation, we are interested in if a model can successfully solve the task in 100k iterations and the elapsed training time and iterations till the model succeeds on the task. For all networks we ensure the similar total parameter counts. All important hyperparameters are shown in APPENDIX C.1. We run all experiments with batch size of 1 under 2.8 GHz Intel Core i7 CPU and report the wall clock time and the number of iterations for solved tasks of each model. For models that fail to converge to less than 0.01 loss in $1 0 0 \mathrm { k }$ iterations, we report the average loss of the final 10 validations (denoted in underlines) and the elapsed training time for 100k iterations. The results are shown in Table 1. The training curves for each task are shown in APPENDIX D.
109
+
110
+ The results show that the ARMIN can solve 3 out of 4 tasks in a fast converge speed. By comparing the ARMIN with NTM, we observe that the NTM is able to almost solve all of the tasks, but with a much slower training speed compared to the ARMIN, for example, the training time of NTM is 5 times larger than ARMIN to solve the copy task. In fact, the training speed of ARMIN for each iteration is about $3 \sim 4$ times faster than the NTM’s speed. We observe that the TARDIS and ARMIN $\dotplus$ TARDIS-addr fail to solve 3 out 4 tasks in the given $1 0 0 \mathrm { k }$ iterations. By comparing them with the ARMIN, we confirm the efficiency of the auto-addressing of ARMIN, for bringing a fast converge speed and short training time. We also find that the LSTM, when given enough parameter counts (4 times larger than memory networks), is able to solve the priority sort task quickly and converge to a better performance than TARDIS and ARMIN $^ +$ TARDIS in other tasks. We believe there are 2 possible reasons for the poor performance of the TARDIS addressing mechanism: a) The tanh activation (see equation 21 in APPENDIX B.2) might cause the gradient vanishing problem when it cooperates with the gumbel-softmax function. b) The multiple inputs of $\pmb { x } _ { t } , \pmb { h } _ { t } , \pmb { M } _ { t } [ i ] , \pmb { u } _ { t }$ in equation 21 cause the network hard to initialize to keep equal input and output variances for the linear layer and might also cause gradient dispersion. The auto-addressing has neither of these two issues and can better integrately backpropogate gradients, therefore it can perform well and quickly on these tasks. However, we would like to point out 2 limitations of the auto-addressing: a) The associative recall task shows the auto-addressing might have problems in establishing indirect references among memory data. b) The auto-addressing is relatively hard to generalize to unseen longer sequence in tasks such as copy and repeat copy due to its simplicity, whereas the NTM is able to do that. We leave these 2 issues for future work.
111
+
112
+ Table 1: The average elapsed time(min) and iterations ${ \mathrm { ( k ) } }$ of different networks till task solved in given $1 0 0 \mathrm { k }$ iterations. The wall clock training time for 100k iterations and the average loss of final 10 validations (denoted in underlines) are shown for the unsolved tasks.
113
+
114
+ <table><tr><td rowspan="2"></td><td colspan="2">Copy</td><td colspan="2">Repeat Copy</td><td colspan="2">Associative Recall</td><td colspan="2">Priority Sort</td></tr><tr><td>time</td><td>iter.</td><td>time</td><td>iter.</td><td>time</td><td>iter.</td><td>time</td><td>iter.</td></tr><tr><td>LSTM</td><td>66</td><td>0.359</td><td>45</td><td>0.016</td><td></td><td>0.325</td><td>32</td><td>37.0</td></tr><tr><td>NTM</td><td>32</td><td>12.4</td><td>171</td><td>0.014</td><td></td><td>19.6</td><td>360</td><td>0.012</td></tr><tr><td>TARDIS</td><td>157</td><td>0.451</td><td>97</td><td>0.166</td><td>342266</td><td>0.330</td><td>133</td><td>62.6</td></tr><tr><td>ARMIN+TARDIS-addr</td><td>152</td><td>0.410</td><td>95</td><td>0.297</td><td>64</td><td>0.336</td><td>151</td><td>71.4</td></tr><tr><td>ARMIN</td><td>6</td><td>7.6</td><td>36</td><td>67.8</td><td>33</td><td>0.052</td><td>37</td><td>33.4</td></tr></table>
115
+
116
+ Table 2: Bits-per-character on Penn Treebank and enwik8 test set.
117
+
118
+ <table><tr><td rowspan="2">Model</td><td colspan="2">PTB</td><td colspan="2">enwik8</td></tr><tr><td>BPC</td><td>Params</td><td>BPC</td><td>Params</td></tr><tr><td>LSTM</td><td>1.36</td><td>一</td><td>1.45</td><td></td></tr><tr><td>LSTM+Zoneout (Krueger et al., 2016)</td><td>1.27</td><td>1</td><td>1</td><td></td></tr><tr><td>LSTM+Layer Norm(1000 units)1</td><td>1.267</td><td>4.26M</td><td>1</td><td>一</td></tr><tr><td>LSTM+Layer Norm+Zoneout(1024 units)²</td><td>1.24</td><td>4.79M</td><td>一</td><td></td></tr><tr><td>HM-LSTM+Layer Norm (Chung et al.,2016)</td><td>1.24</td><td>1</td><td>1.32</td><td>35M</td></tr><tr><td>HyperLSTM+Layer Norm(Ha et al., 2016)</td><td>1.219</td><td>14.41M</td><td>1.340</td><td>26.5M</td></tr><tr><td>NASCell (Zoph &amp; Le,2016)</td><td>1.214</td><td>16.28M</td><td></td><td></td></tr><tr><td>IndRNN (21 layers) (Li et al.,2018)</td><td>1.21</td><td></td><td>1</td><td>1</td></tr><tr><td>Recurrent Highway Hypernetwork (Suarez, 2017)</td><td>1.19</td><td>一 15.5M</td><td>1</td><td>1</td></tr><tr><td>Fast-Slow LSTM (Mujika et al., 2017)</td><td>1.190</td><td>7.2M</td><td>1.277</td><td>一 27M</td></tr><tr><td>NTM(800 units, nhead = 1, Pdropout=0.6)</td><td></td><td></td><td></td><td></td></tr><tr><td>TARDIS(paper)</td><td>1.535</td><td>8.28M</td><td></td><td>1</td></tr><tr><td></td><td>1.25</td><td>一</td><td></td><td></td></tr><tr><td>TARDIS(1000 units,Pdropout=0.6)</td><td>1.268</td><td>9.2M</td><td></td><td>一</td></tr><tr><td>ARMIN+TARDIS-addr(800 units,Pdropout=0.6)</td><td>1.223</td><td>10.2M</td><td></td><td></td></tr><tr><td>ARMIN (500 units, Pdropout=0.4) (Ours)</td><td>1.236</td><td>4.03M</td><td></td><td></td></tr><tr><td>ARMIN (800 units, Pdropout=0.6) (Ours)</td><td>1.202</td><td>9.8M</td><td></td><td></td></tr><tr><td>ARMIN(800 units,2 layer) (Ours)</td><td>1</td><td>1</td><td>1.331</td><td>21.6M</td></tr></table>
119
+
120
+ # 4.2 CHARACTER-LEVEL LANGUAGE MODELLING
121
+
122
+ The character-level language modelling task consists of predicting the probability distribution of the next character given all the previous ones, and we use the widely used Penn Treebank and Hutter Prize Wikipedia (also known as enwik8) datasets for this task. We compare our network with vanilla LSTMs and other memory networks on Penn Treebank, and compare with some popular RNN variants on both datasets. We ensure similar parameter counts and hyperparameters for all memory networks. Following prior works, we apply truncated backpropagation through time(TBPTT) (Rumelhart et al., 1986; Elman, 1990) to approximate the gradients: at each iteration, the network predict the next 150 characters, and the hidden state $\boldsymbol { h } _ { t }$ and memory state $M$ are passed to the next iteration. The gradients are truncated between different iterations. Please refer to APPENDIX C.2 for more experimental details.
123
+
124
+ The results are shown in table 2. On Penn Treebank dataset, our best performing network achieves competitive 1.202 BPC on Penn Treebank dataset, which is the best single cell performance that we are aware of, with relatively small parameter count. By comparing TARDIS and ARMIN $^ +$ TARDISaddr, we observe about 4 points of improvement, which shows the efficiency of the ARMIN cell. By comparing ARMIN $+$ TARDIS-addr, we observe a further improvement of around 2 points, which shows the efficiency of the auto-addressing mechanism. We also find that the same architecture of NTM that performs well in algorithmic tasks fails to converge to a lower BPC than vanilla LSTM, even with various regularizations we add to NTM.
125
+
126
+ The results on Penn Treebank show our single ARMIN cell learns better representations than many hierarchical RNN structures, such as the HM-LSTM, 2-Layer HyperLSTM and 21 layer IndRNN. Our network is outperformed by Recurrent Highway Hypernetwork and Fast-slow LSTM which are both multi-scale and deep transition RNNs and are state-of-the-art results without any auxiliary technics on this dataset. By saying “better representations”, we refer to the concatenation of the gated contents from $\boldsymbol { h } _ { t }$ and $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ as in equation 8. For example, if we remove the gated contents of $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ from $\mathbf { } _ { o _ { t } }$ , the ARMIN undergoes a BPC performance drop from 1.202 to 1.220, which is still better than the best performing BPC of 1.24 of the LSTM. We believe the rest of the performance gain comes from the recurrent memory integration of the ARMIN cell, which also favors a paradigm of deep transition, as is shown by the success of the deep transition RNNs on this task. For more ablation study regarding the auto-addressing mechanism and the ARMIN cell please refer to APPENDIX E (where we show the robustness of ARMIN to small TBPTT length).
127
+
128
+ The result on enwik8 demonstrates a simple 2-layer ARMIN can achieve competitive BPC performance of 1.33, with less parameter count compared to the HyperLSTM and HM-LSTM. By constructing deeper ARMIN network or even combining with other multi-scale and hierarchical RNN architectures, we believe the performance can be further improved.
129
+
130
+ # 4.3 TEMPORAL ACTION DETECTION AND PROPOSALS ON THUMOS’ 14
131
+
132
+ In this subsection, we evaluate the ARMIN on a more complicated real-world task concerning video analysis, i.e. the temporal action detection and proposals, which consists of taking an input video and producing a set of temporal intervals that are likely to contain human actions (Buch et al., 2017). We use the Single-Stream Temporal Action Proposal(SST) (Buch et al., 2017) as our framework, and evaluate the model on the THUMOS’ 14 dataset (Jiang et al., 2014), which contains $^ { 2 0 + }$ hours of video with 200 train/validation and 213 test untrimmed video sequences. The SST consists of a GRU and a fully connected output layer. In our experiment, we replace the GRU encoder in SST with a single ARMIN cell, and we call the modified network MA-SST. For fairness, we also implement a modified SST with LSTM encoder and compare them with the original SST in Buch et al. (2017). Please refer to APPENDIX C.3 for more experimental details.
133
+
134
+ Table 3: Comparison of proposal generation performance in terms of recall at 1000 proposals. We choose $\mathrm { \ t I o U { = } 0 } . 6$ and 0.8 to compare for consistency with Buch et al. (2017). Our MA-SST achieves highest recall at $\mathrm { \ t I o U { = } } 0 . 8$ .
135
+ Table 4: Comparison for performance and cost of different setups on Penn Treebank dataset.
136
+
137
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>ARMIN</td><td rowspan=1 colspan=2>LSTM</td></tr><tr><td rowspan=1 colspan=1>Setup</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=8 colspan=1>Hidden sizenparam(M)nmemTtruncbatch sizeMemory(GB)Speed(chars/s)BPC</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>550</td><td rowspan=1 colspan=1>1k</td><td rowspan=1 colspan=1>1k</td></tr><tr><td rowspan=2 colspan=1>4.025</td><td rowspan=1 colspan=1>4.81</td><td rowspan=1 colspan=1>4.79</td><td rowspan=2 colspan=1>4.791</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>150</td></tr><tr><td rowspan=1 colspan=1>384</td><td rowspan=1 colspan=1>300</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td></tr><tr><td rowspan=1 colspan=1>3.49</td><td rowspan=1 colspan=1>3.56</td><td rowspan=1 colspan=1>2.36</td><td rowspan=1 colspan=1>3.27</td></tr><tr><td rowspan=1 colspan=1>98k</td><td rowspan=1 colspan=1>75k</td><td rowspan=1 colspan=1>71k</td><td rowspan=1 colspan=1>70k</td></tr><tr><td rowspan=1 colspan=1>1.238</td><td rowspan=1 colspan=1>1.226</td><td rowspan=1 colspan=1>1.27</td><td rowspan=1 colspan=1>1.24</td></tr></table>
138
+
139
+ <table><tr><td>Model</td><td>tIoU=0.6</td><td>tIoU=0.8</td></tr><tr><td>SST (Paper)</td><td>0.920</td><td>0.672</td></tr><tr><td>SST (We implement)</td><td>0.897</td><td>0.732</td></tr><tr><td>MA-SST(Ours)</td><td>0.911</td><td>0.759</td></tr></table>
140
+
141
+ The average recall under different proposal numbers and tIoUs3 are depicted in figure 2. MA-SST outperforms the original SST and our SST simultaneously. To the best of our knowledge, MA-SST achieves highest performance of recall at around $\mathrm { \ t I o U { = } } 0 . 8$ (see table 3), even if other competitive non-RNN networks (Escorcia et al., 2016; Caba Heilbron et al., 2016; Gao et al., 2017; Guo et al., 2018) are taken into account. The MA-SST tends to precisely generate proposals that has a high overlapping area with the ground truth action intervals, leading to high recall performance at high tIoUs. We believe the MA-SST has better performance than the SST mainly because of the direct access to historical states from which it can better locate the starting frame of an action.
142
+
143
+ ![](images/80e05beebf3cb64569df7a0d731d988352907332c1e2de7be2c1637e50fd4897.jpg)
144
+ Figure 2: Comparison of proposal generation performance. For data generation, we use the code offered in Buch et al. (2017) for consistency. (Left) The average number of proposals v.s. average recall for $\mathrm { t I o U } \geq 0 . 5$ . The MA-SST outperforms our SST when average number of proposals is less than 500, and outperforms the original SST when average number of proposals is more than 500. (Right) Different tIoU v.s. recall of 1000 average proposals. The MA-SST strongly outperforms the original SST and outperform our SST by a maximal margin of $2 . 7 \%$ .
145
+
146
+ # 5 TOWARDS MORE LIGHT-WEIGHT RECURRENT MEMORY NETWORKS
147
+
148
+ It’s known that the speed and computer memory consumption have important influences on the practicability of an RNN, especially when external memory is involved. We have shown in some of the algorithmic tasks that the ARMIN can be trained 3 4 times faster than the NTM in terms of wall clock time. Next we conduct a more thorough comparison experiment among the vanilla LSTM and memory networks under different hidden sizes. The experiment is based on the character-level language modelling task on Penn Treebank dataset, without the loss of generality. For a fair comparison, we implement all networks with near-optimal implementations using Pytorch, an efficient deep-learning framework. We use the aforementioned experiment setup, and keep all memory matrices the same size, i.e. $2 0 \times d _ { h }$ . We run the experiment using single-precision floating point calculations under a Titan XP GPU that has 12GB memory space. The results are depicted in figure 3. From the results we observe 2 important phenomena: a) The ARMIN consistently outperform other memory networks shown in the graph in terms of running speed both at training and inference stages, and the main contribution to this comes from the simple auto-addressing mechanism of the ARMIN. Moreover, at inference stage, we can replace the memory matrix with a list of discrete memory slots, and update memory by simply replacing the old hidden states with the new ones, furthermore, we can replace the gumbel-softmax function with argmax. Using these methods, ARMIN’s inference speed obtains significant improvement than in training stage. b) The ARMIN outperforms TARDIS and ARMIN $\dotplus$ TARDIS-addr in terms of training memory consumption, mainly because the TARDIS addressing mechanism requires concatenating $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $\boldsymbol { h } _ { t - 1 }$ to every memory cell for parallelization. At inference stage, we observe TARDIS have smaller memory consumption than ARMIN and ARMIN $+ { \bf \Phi }$ TARDIS-addr, mainly because TARDIS has smaller parameter counts under the same hidden size. However, we would like to point out that under the same parameter counts the ARMIN usually outperforms TARDIS as we show in algorithm and language modelling tasks. We also observe the NTM has the largest memory consumption at inference time, mainly because its complex addressing mechanism.
149
+
150
+ We have shown in the ablation study (see APPENDIX E) that our network is robust to small iteration length when trained with TBPTT. We realize that we can use this feature to enable large batch size, and boost ARMIN’s training speed while keeping better performance than LSTM. To validate this benefit, we conduct an experiment to compare the performance and cost of ARMIN against our best performing LSTM. We also provide the test result of the same LSTM under TBPTT length $T _ { t r u n c } = 1 0 0$ for better comparing. The hyperparameter setups and results are shown in Table 4.
151
+
152
+ By comparing ARMIN setup 1 with LSTM setup 2, we observe that with only $6 . 7 \%$ more memory consumption, we obtain $4 0 \%$ training speed gain while keeping a slightly better BPC performance and $1 6 \%$ less parameter count; by comparing ARMIN setup 2 with LSTM setup 2, we observe that with only $8 . 8 \%$ more memory consumption, we obtain about 1.5 points of BPC performance gain and $7 . 1 \%$ training speed gain under similar parameter count.
153
+
154
+ ![](images/fb603389200962c80fad3cc21f0db454db3b03532b7db183bfb4f4b91ccf1b51.jpg)
155
+ Figure 3: The running speed and memory consumption at the training and inference stages $( n _ { m e m } = 2 0 )$ ). The solid blocks shows the memory consumption and the curves denote the running speed in characters/s. (a) shows the training stage, and (b) shows the inference stage (note that ARMIN $+$ TARDIS-addr has basically the same memory consumption with ARMIN, so it’s not shown in the graph).
156
+
157
+ # 6 CONCLUSION
158
+
159
+ In this paper, we have introduced the ARMIN, a light-weight and memory-augmented RNN architecture with a novel ARMIN cell. The ARMIN incorporates an efficient external memory with the light-weight auto-addressing mechanism. We demonstrate competitive performance of ARMIN in various tasks, and shows the generality of our model. Our ablation study suggests the efficacy of our external memory and addressing mechanism, and notably, our network is robust to shortlength TBPTT which enables using large batch size to speed up the training and further increase performance on sequence modelling tasks. Further research may lead to the efficient hierarchical and multi-scale structures of the ARMIN and its successful applications in Seq2Seq models and complicated reasoning tasks.
160
+
161
+ # REFERENCES
162
+
163
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
164
+
165
+ Shyamal Buch, Victor Escorcia, Chuanqi Shen, Bernard Ghanem, and Juan Carlos Niebles. Sst: Single-stream temporal action proposals. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6373–6382. IEEE, 2017.
166
+
167
+ Fabian Caba Heilbron, Juan Carlos Niebles, and Bernard Ghanem. Fast temporal activity proposals for efficient detection of human actions in untrimmed videos. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1914–1923, 2016.
168
+
169
+ Victor Campos Camunez, Brendan Jou, Xavier Giro Nieto, Jordi Torres Vi ´ nals, and Shih-Fu Chang. ˜ Skip rnn: learning to skip state updates in recurrent neural networks. In Sixth International Conference on Learning Representations: Monday April 30-Thursday May 03, 2018, Vancouver Convention Center, Vancouver:[proceedings], pp. 1–17, 2018.
170
+
171
+ 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. arXiv preprint arXiv:1406.1078, 2014.
172
+
173
+ Junyoung Chung, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. Gated feedback recurrent neural networks. In International Conference on Machine Learning, pp. 2067–2075, 2015.
174
+
175
+ Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016.
176
+
177
+ Ivo Danihelka, Greg Wayne, Benigno Uria, Nal Kalchbrenner, and Alex Graves. Associative long short-term memory. In Proceedings of the 33rd International Conference on International Conference on Machine Learning-Volume 48, pp. 1986–1994. JMLR. org, 2016.
178
+
179
+ Chris Dyer, Miguel Ballesteros, Wang Ling, Austin Matthews, and Noah A Smith. Transition-based dependency parsing with stack long short-term memory. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pp. 334–343, 2015.
180
+
181
+ Jeffrey L Elman. Finding structure in time. Cognitive science, 14(2):179–211, 1990.
182
+
183
+ Victor Escorcia, Fabian Caba Heilbron, Juan Carlos Niebles, and Bernard Ghanem. Daps: Deep action proposals for action understanding. In European Conference on Computer Vision, pp. 768–784. Springer, 2016.
184
+
185
+ Jiyang Gao, Zhenheng Yang, Chen Sun, Kan Chen, and Ram Nevatia. Turn tap: Temporal unit regression network for temporal action proposals. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 3648–3656. IEEE, 2017.
186
+
187
+ Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016.
188
+
189
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
190
+
191
+ Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471, 2016.
192
+
193
+ Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Advances in Neural Information Processing Systems, pp. 1828–1836, 2015.
194
+
195
+ Caglar Gulcehre, Sarath Chandar, and Yoshua Bengio. Memory augmented neural networks with wormhole connections. arXiv preprint arXiv:1701.08718, 2017.
196
+
197
+ Emil Julius Gumbel. Statistical theory of extreme values and some practical applications: a series of lectures. Number 33. US Govt. Print. Office, 1954.
198
+
199
+ Dashan Guo, Wei Li, and Xiangzhong Fang. Fully convolutional network for multiscale temporal action proposals. IEEE Transactions on Multimedia, 2018.
200
+
201
+ David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
202
+
203
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
204
+
205
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
206
+
207
+ YG Jiang, Jingen Liu, A Roshan Zamir, G Toderici, I Laptev, Mubarak Shah, and Rahul Sukthankar. Thumos challenge: Action recognition with a large number of classes, 2014.
208
+
209
+ Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Advances in neural information processing systems, pp. 190–198, 2015.
210
+
211
+ Nan Rosemary Ke, Anirudh Goyal, Olexa Bilaniuk, Jonathan Binas, Michael C Mozer, Chris Pal, and Yoshua Bengio. Sparse attentive backtracking: Temporal creditassignment through reminding. arXiv preprint arXiv:1809.03702, 2018.
212
+
213
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
214
+
215
+ David Krueger, Tegan Maharaj, Janos Kramar, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary Ke, Anirudh Goyal, Yoshua Bengio, Aaron Courville, and Christopher Pal. Zoneout: Regularizing rnns by randomly preserving hidden activations. 2016.
216
+
217
+ Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random-access machines. arXiv preprint arXiv:1511.06392, 2015.
218
+
219
+ Shuai Li, Wanqing Li, Chris Cook, Ce Zhu, and Yanbo Gao. Independently recurrent neural network (indrnn): Building a longer and deeper rnn. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5457–5466, 2018.
220
+
221
+ 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.
222
+
223
+ Toma´s Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Stefan Kombrink, and Jan Cer- ˇ nocky. Subword language modeling with neural networks. preprint (http://www. fit. vutbr. cz/imikolov/rnnlm/char. pdf), 8, 2012.
224
+
225
+ Asier Mujika, Florian Meier, and Angelika Steger. Fast-slow recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 5915–5924, 2017.
226
+
227
+ Tony A Plate. Holographic reduced representation: Distributed representation for cognitive structures. 2003.
228
+
229
+ Jack Rae, Jonathan J Hunt, Ivo Danihelka, Timothy Harley, Andrew W Senior, Gregory Wayne, Alex Graves, and Tim Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes. In Advances in Neural Information Processing Systems, pp. 3621–3629, 2016.
230
+
231
+ David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. nature, 323(6088):533, 1986.
232
+
233
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Oneshot learning with memory-augmented neural networks. arXiv preprint arXiv:1605.06065, 2016.
234
+
235
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
236
+
237
+ Joseph Suarez. Language modeling with recurrent highway hypernetworks. In Advances in Neural Information Processing Systems, pp. 3267–3276, 2017.
238
+
239
+ 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(2):26– 31, 2012.
240
+
241
+ Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pp. 4489–4497, 2015.
242
+
243
+ Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
244
+
245
+ # APPENDIX A RNN AND LONG SHORT-TERM MEMORY
246
+
247
+ A recurrent neural network (RNN) is a class of neural network that recurrently processes a sequence of inputs $\{ \pmb { x } _ { 1 } , \pmb { x } _ { 2 } , . . . , \pmb { x } _ { T } \}$ , and returns a sequence of outputs $\left\{ y _ { 1 } , y _ { 2 } , . . . , y _ { T } \right\}$ where $\pmb { x } _ { t } \in \mathbb { R } ^ { d _ { i } }$ , $\pmb { y } _ { t } \in \mathbb { R } ^ { d _ { o } }$ , and $d _ { i } , d _ { o }$ is the input size and output size, respectively. In a vanilla RNN, $\mathbf { \nabla } _ { \mathbf { \boldsymbol { y } } _ { i } }$ is given by following equations:
248
+
249
+ $$
250
+ \begin{array} { r } { \pmb { h } _ { t } = \sigma ( \pmb { U } \pmb { x } _ { t } + \pmb { W } \pmb { h } _ { t - 1 } + \pmb { b } ) , } \end{array}
251
+ $$
252
+
253
+ $$
254
+ \pmb { y } _ { t } = \pmb { V } \pmb { h } _ { t } + \pmb { c } ,
255
+ $$
256
+
257
+ where the hidden state $\pmb { h } _ { t } ~ \in ~ \mathbb { R } ^ { d _ { h } }$ is passed to the next recurrence. $d _ { h }$ is the hidden size, and $U , W , V , b , c$ are learnable parameters.
258
+
259
+ The LSTM (Hochreiter & Schmidhuber, 1997) is designed to overcome the gradient vanishing and exploding problem in vanilla RNN and learn long-term dependencies, by passing a tuple of $\left( { { h _ { t } } , { c _ { t } } } \right)$ to the next recurrence. Its computation process is defined as follows:
260
+
261
+ $$
262
+ \left\{ \begin{array} { c } { i _ { t } } \\ { f _ { t } } \\ { g _ { t } } \\ { o _ { t } } \end{array} \right\} = \left\{ \begin{array} { c } { \sigma } \\ { \sigma } \\ { \operatorname { t a n h } } \\ { \sigma } \end{array} \right\} W _ { 0 } [ \ : x _ { t } , h _ { t - 1 } \ : ] + b _ { 0 } ,
263
+ $$
264
+
265
+ $$
266
+ \begin{array} { r } { \pmb { c } _ { t } = \pmb { f } _ { t } \circ \pmb { c } _ { t - 1 } + \pmb { i } _ { t } \circ \pmb { g } _ { t } , } \\ { \pmb { h } _ { t } = \pmb { o } _ { t } \circ \operatorname { t a n h } ( \pmb { c } _ { t } ) , } \end{array}
267
+ $$
268
+
269
+ where $\circ$ is the element-wise product, $W _ { 0 } \in \mathbb { R } ^ { 4 d _ { h } \times ( d _ { i } + d _ { h } ) }$ , $b _ { 0 } \in \mathbb { R } ^ { 4 d _ { h } }$ , $i _ { t } , f _ { t } , g _ { t } o _ { t }$ are the input gate, forget gate, cell state, output gate at time $t$ , respectively, and they control the information flow in the LSTM.
270
+
271
+ # APPENDIX B DIFFERENCES BETWEEN TARDIS AND ARMIN
272
+
273
+ The major differences between ARMIN and TARDIS networks are the recurrent cell computation and read operation. We show these differences respectively in subsections below:
274
+
275
+ # B.1 CELL COMPUTATIONS
276
+
277
+ The cell computation process of TARDIS is as follow:
278
+
279
+ $$
280
+ \left\{ \begin{array} { l } { i _ { t } } \\ { f _ { t } } \\ { o _ { t } } \end{array} \right\} = \left\{ \begin{array} { l } { \sigma } \\ { \sigma } \\ { \sigma } \end{array} \right\} W [ \ : x _ { t } , h _ { t - 1 } , r _ { t } \ : ] + b \ : ,
281
+ $$
282
+
283
+ $$
284
+ \left\{ \begin{array} { l } \alpha _ { t } \right\} = \left\{ \begin{array} { l l } { \mathrm { g u m b e l - s i g m o i d } } \\ { \mathrm { g u m b e l - s i g m o i d } } \end{array} \right\} \left\{ \begin{array} { l } { \pmb { w } ^ { \alpha \top } } \\ { \pmb { w } ^ { \beta \top } } \end{array} \right\} \left[ \begin{array} { l } { \pmb { x } _ { t } , \pmb { h } _ { t - 1 } , \pmb { r } _ { t } } \end{array} \right] , \end{array}
285
+ $$
286
+
287
+ $$
288
+ g _ { t } = \operatorname { t a n h } ( W ^ { g } [ x _ { t } , \alpha _ { t } h _ { t - 1 } , \beta _ { t } { r } _ { t } ] + b ^ { g } ) ,
289
+ $$
290
+
291
+ $$
292
+ \pmb { c } _ { t } = \pmb { f } _ { t } \circ \pmb { c } _ { t - 1 } + i _ { t } \circ \pmb { g } _ { t } ,
293
+ $$
294
+
295
+ $$
296
+ h _ { t } = o _ { t } \circ \operatorname { t a n h } ( c _ { t } ) ,
297
+ $$
298
+
299
+ where $h _ { t - 1 } , h _ { t } , c _ { t } , i _ { t } , f _ { t } , o _ { t } , g _ { t } \in \mathbb { R } ^ { d _ { h } } , { r } _ { t } \in \mathbb { R } ^ { d _ { r } } , { \pmb x } _ { t } \in \mathbb { R } ^ { d _ { i } } , { \pmb w } ^ { \alpha } , { \pmb w } ^ { \beta } \in \mathbb { R } ^ { d _ { i } + d _ { h } + d _ { r } }$ , and $W \in$ R3dh×(di+dh+dr) $, \pmb { W } ^ { g } \in \mathbb { R } ^ { d _ { h } \times ( d _ { i } + d _ { h } + d _ { r } ) } , \pmb { b } \in \mathbb { R } ^ { 3 d _ { h } } , \pmb { b } ^ { g } \in \mathbb { R } ^ { d _ { h } }$ . The output of TARDIS is the concatenation of $\boldsymbol { h } _ { t }$ and $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ .
300
+
301
+ There are 3 important points that distinguish the ARMIN cell from TARDIS cell, which are as follows:
302
+
303
+ • The TARDIS uses two binary scalar gates $\alpha _ { t } , \beta _ { t }$ to control the information flow in equation 17. The two scalar gates are activated using gumbel-sigmoid (which is similar to gumbel-softmax and the output is close to binary), whereas the ARMIN uses two soft vector gates to control the information flow, which is more flexible and enable larger model capacity. For example, in the charlevel language modelling experiments, if we replace the sigmoid activations in equation 3 with the element-wise gumbel-sigmoid, the BPC performance immediately drops from 1.202 to 1.235.
304
+
305
+ • The TADIS apply information control only when calculating the cell state $\mathbf { \nabla } _ { \mathbf { \boldsymbol { g } } _ { t } }$ , whereas the ARMIN apply information control immediately after the read operation. Our main motivation to this change is that if we don’t filter out irrelevant information in $\mathbf { \nabla } _ { \mathbf { r } _ { t } }$ and $h _ { t }$ at first, these noisy information will cause the weight parameters hard to learn. Furthermore, if the read operation chooses the wrong past state, we can block the information flow for $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ at the first place.
306
+
307
+ • The ARMIN has an extra gate $\mathbf { \delta } _ { o _ { t } ^ { r } }$ to control the output from $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ as in equation 8, which the TARDIS doesn’t have. If we remove this gate and directly output $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ like in TARDIS, we get a BPC performance drop from 1.202 to 1.219 in char-level language modelling task.
308
+
309
+ Finally, despite that the ARMIN has 3 more vector gates than the TARDIS, we have shown in the $p \mathrm { M N I S T }$ and Penn Treebank experiments that the ARMIN can still outperform the TARDIS under similar parameter counts.
310
+
311
+ # B.2 READ OPERATION
312
+
313
+ The memory matrix $M _ { t }$ of TARDIS has disjoint address section $\mathbf { \boldsymbol { A } } _ { t } ~ \in ~ \mathbb { R } ^ { n _ { m e m } \times d _ { k } }$ and content section $C _ { t } \ \stackrel { \cdot } { \in } \ \mathbb { R } ^ { n _ { m e m } \times d _ { r } }$ , $M _ { t } = [ A _ { t } ; C _ { t } ]$ . The controller reads both the address and the content parts of the memory, but it will only write into the content section of the memory.
314
+
315
+ The TARDIS paper explored two ways to sample the read locations——using reinforce and using gumbel-softmax function, respectively. The gumbel-softmax way shows a better performance and its read operation can be formulated as follow:
316
+
317
+ $$
318
+ \begin{array} { c } { { \pi _ { t } [ i ] = a ^ { \top } \operatorname { t a n h } ( W ^ { \gamma } [ h _ { t } , x _ { t } , M _ { t } [ i ] , { \boldsymbol u } _ { t } ] + b ^ { \gamma } ) , } } \\ { { s _ { t } = \mathrm { g u m b e l - s o f t m a x } ( \pi _ { t } ) . } } \end{array}
319
+ $$
320
+
321
+ where $\{ a , W ^ { \gamma } , b ^ { \gamma } \}$ are learnable parameters (note that in our experiments, we always set the dimension of $\textbf { \em a }$ to about 1/4 of the hidden size) and $\mathbf { \Delta } \mathbf { u } _ { t }$ is a hand-crafted usage vector which denotes the frequency of accesses to each cell in the memory.
322
+
323
+ There are two important differences with respect to TARDIS addressing mechanism and our autoaddressing mechanism:
324
+
325
+ • In practice, equation 21 requires concatenating $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $h _ { t }$ to every memory cells $M _ { t } [ i ]$ for parallelization, which often causes significant extra memory and time consumption compared to the auto-addressing of ARMIN, as we show in the algorithmic tasks and char-level language modelling task.
326
+
327
+ • The auto-addressing omits the learnable address section $\pmb { A } _ { t }$ , the hand-crafted $\mathbf { \pmb { u } } _ { t }$ vector, the tanh activation and an auxiliary vector $^ { a }$ compared to TARDIS addressing mechanism. The TARDIS also requires manually subtracting 100 in unnormalized probability at last read location to avoid repeated read, whereas the auto-addressing doesn’t need to. With these simplifications, we found the auto-addressing mechanism easier to train and it leads to a much faster converge speed, as we show in the algorithmic tasks. We also observe a BPC performance growth from 1.223 to 1.202 in char-level language modelling task when we switch from ARMIN $^ +$ TARDIS-addr to ARMIN with auto-addressing.
328
+
329
+ # APPENDIX C EXPERIMENT SETUPS
330
+
331
+ We first describe some universal setups in all our experiments (unless we mention them again with different setup). Our model can be trained end-to-end, due to the utilization of gumbel-softmax function. As pointed out in Maddison et al. (2016), when the temperature $\tau \leq ( n - 1 ) ^ { - 1 }$ , the density function of gumbel-softmax estimator is log-convex, which gives us a good guarantee for optimization. However, smaller $\tau$ will also bring higher variance of the gradients (Jang et al., 2016). So in all experiments, we initialize the reciprocal of $\tau$ as 1, and increase it by 1 after each epoch, until the reciprocal equals to $n - 1$ . This scheme has shown better performance than other schemes.
332
+
333
+ Table 5: Hyperparameters of the models for algorithmic tasks.
334
+
335
+ <table><tr><td>Model</td><td>Hidden Size</td><td>memory Size</td><td>Param Count</td></tr><tr><td>LSTM</td><td>300</td><td>一</td><td>376k</td></tr><tr><td>NTM</td><td>120</td><td>128×20</td><td>88k</td></tr><tr><td>TARDIS</td><td>120</td><td>50×32</td><td>90k</td></tr><tr><td>ARMIN+TARDIS</td><td>100</td><td>50×32</td><td>91k</td></tr><tr><td>ARMIN</td><td>100</td><td>50×32</td><td>90k</td></tr></table>
336
+
337
+ Table 6: Hyperparameters of the algorithmic tasks.
338
+
339
+ <table><tr><td>Task</td><td>Setup</td></tr><tr><td>Copy</td><td>copy length =1~50</td></tr><tr><td>Repeat Copy</td><td>copyl length=1~10 number of repeats = 1~10</td></tr><tr><td>Associative Recall</td><td>item size=3×6 item number = 2~6</td></tr><tr><td>Priority Sort</td><td>Sort length = 40</td></tr></table>
340
+
341
+ We apply Layer Normalization(Ba et al., 2016) to all networks. In the ARMIN case, layer norm is applied to equation 3, 6 and 7, which we find important to regulate the hidden state when scale grows. To avoid overfitting, we apply dropout (Srivastava et al., 2014) to the input and output layers, and Zoneout(Krueger et al., 2016) is applied for recurrent connections. The networks are trained with Adam optimizer (Kingma & Ba, 2014). All weight matrices in RNNs are initialized to orthogonal matrices, and the bias of the forget gate $\pmb { f } _ { t }$ is initialized to 1. For all models using TARDIS addressing mechanism, we set the memory key size to about 1/5 of the memory content size.
342
+
343
+ # C.1 ALGORITHMIC TASKS
344
+
345
+ In all algorithmic experiments below, following Graves et al. (2014), we apply RMSProp optimizer (Tieleman & Hinton, 2012) with a momentum of 0.9. The learning rate is 0.0001 and gradient norms are clipped to 10.0. No regularization is used as the size of the networks is small. Following Graves et al. (2014), we have learned bias of initial hidden states and memory matrices for all memory networks. For TARDIS, ARMIN $+ { \bf \Phi }$ TARDIS-addr and ARMIN we increase the reciprocal of temperature $\tau$ by 1 for every 200 iterations. The hyperparamters for models and tasks are shown in Table 5 and Table 6, respectively. We explain these tasks in detail in subsections below:
346
+
347
+ # C.1.1 COPY
348
+
349
+ The copy task tests whether a recurrent model can correctly store and recall a long sequence of arbitrary information. In our experiment, the networks are given randomly generated eight-bit binary sequences with its length ranging from 1 to 50, followed by a finish indicator. Then the networks are asked to output the same sequence with the input.
350
+
351
+ # C.1.2 REPEAT COPY
352
+
353
+ The repeat copy task is a repeat version of the copy task. The main motivation was to see if a recurrent model could memorize input information and repeatedly reuse them at later time-steps. In
354
+
355
+ our experiment, the networks are asked to repeatedly copy the randomly generated input sequence with length ranging from 1 to 10 to output for 1 to 10 times.
356
+
357
+ # C.1.3 ASSOCIATIVE RECALL
358
+
359
+ This task test whether a memory network has the ability to retrieve memory data indirectly. The networks are given a sequence of items and then a query with one of the items, and are asked to output the subsequent item. In our experiments, each item consists of three six-bit binary vectors, and the number of items are ranging from 2 to 6.
360
+
361
+ # C.1.4 PRIORITY SORT
362
+
363
+ This task test whether a recurrent model can do priority sort——a classic elementary algorithm. This task is more challenging than previous ones as it not only require memorizing the input sequences but also making efficient use of the mutual relations of the items in the input sequences. In our experiments, the networks are given 40 eight-bit random binary keys with scalar priority values in a sequence, and are asked to output the top 30 keys in descending order of priority.
364
+
365
+ C.2 CHARACTER-LEVEL LANGUAGE MODELLING ON PENN TREENBANK DATASET
366
+
367
+ # C.2.1 PENN TREEBANK DATASET
368
+
369
+ We use the train/validation/test split outlined in Mikolov et al. (2012). The train/validation/test batch size are 128/64/1 respectively. Following prior works on this task (Ha et al., 2016; Suarez, 2017; Mujika et al., 2017), the model is optimized over the cross-entropy loss between the predictions and the training labels, and evaluated using a bits-per-character measure. We use a single ARMIN cell of different hidden sizes, with a fully connected layer to output the predictive probabilities. The input embedding size $d _ { i }$ is set to 128. The number of memory slots $n _ { m e m }$ is 20. The zoneout probability is 0.3. We train the networks for 200 epochs with a learning rate of 0.002, and decay with a factor of 10 at the last 20 epochs. We clip the gradients to a maximum norm of 1.0.
370
+
371
+ # C.2.2 HUTTER PRIZE WIKIPEDIA DATASET
372
+
373
+ We use the train/validation/test split outlined in Chung et al. (2015). The train/validation/test batch size are 128/64/1 respectively, and the vocabulary size is 205. The zoneout and dropout probabilities are 0.3 and 0.2, respectively. The input embedding size is 256. Our ARMIN network has 2 layer and 800 units at each layer, connected by a linear layer to convert 1600-dimensional features from layer 1 to 256 dimension as input to layer 2. $n _ { m e m }$ for each layer is set to 10. We train the networks for 50 epochs with a learning rate of 0.001, and decay with a factor of 10 at the last 10 peochs. We clip the gradients to a maximum norm of 1.0.
374
+
375
+ # C.3 TEMPORAL ACTION DETECTION AND PROPOSALS ON THUMOS’ 14
376
+
377
+ The SST takes in sequential inputs of a video and outputs the existing probability predictions of action proposals with different time lengths that end at each time-step, and uses a multi-label loss to optimize its parameters. The sequential inputs are 4096-dimensional features extracted from every 16 consecutive video frames using C3D network (Tran et al., 2015), followed by PCA to downsize the input feature dimensionality.
378
+
379
+ Our experiment setup is basically the same as the SST paper, except that we use a simple fully connected layer to downsize the input features instead of using PCA. The input size of the two networks are both set to 256. The MA-SST have 256 hidden units, while the SST with LSTM have 512 hidden units. This ensures the 2 networks have roughly the same parameter count. The dropout and zoneout probabilities are both set to 0.2 and 0.3. $n _ { m e m }$ of the MA-SST is set to 35. We train the networks for 300 epochs with initial learning rate of 0.002, and decay with a factor of 10 at the last 60 epochs.
380
+
381
+ ![](images/50001ffd2185dd7661fc9aba2d9d75316cd989dcf8de377293cc7dbfab09dd11.jpg)
382
+ Figure 4: Copy task.
383
+
384
+ ![](images/4550719af5c0f00a37cd0f179fc1ec6a044179f516a3a2932ce1e6936572202f.jpg)
385
+ Figure 5: Repeat copy task.
386
+
387
+ ![](images/040994a58270f2a89222cd44b6a7cbcbc8407ddd4dfecf1d485eb625bbffc5c4.jpg)
388
+ Figure 6: Associative recall task.
389
+
390
+ ![](images/4cb5157c10e72c964f7ac67806728f1c6305e97e3dd30e339a3d94d5e8a27dc8.jpg)
391
+ Figure 7: Priority sort task.
392
+
393
+ Table 7: Ablation on Penn Treebank $\scriptstyle ( d _ { h } = 8 0 0 )$ .
394
+
395
+ <table><tr><td>Abaltion Model</td><td>BPC</td></tr><tr><td>No Control Gates</td><td>1.354</td></tr><tr><td>LSTM (TBPTT length=50) ARMIN(TBPTT length=50)</td><td>1.390 1.220</td></tr><tr><td>Random Read</td><td>1.224</td></tr><tr><td>Queue-style Write</td><td>1.352</td></tr><tr><td>Independent Read/write</td><td>1.245</td></tr><tr><td>SmoothRead/write</td><td>1.212</td></tr></table>
396
+
397
+ APPENDIX D TRAINING CURVES ON ALGORITHMIC TASKS
398
+
399
+ # APPENDIX E ABLATION STUDY ON MEMORY AND ADDRESSING MECHANISM
400
+
401
+ In this subsection, we show the efficacy of our external memory and addressing mechanism by ablation experiments. We choose the char-level language modelling task to do the ablation research as it is a relatively standard benchmark task and has appropriate medium scale. We use the aforementioned experiment setup. To validate the efficacy of our external memory, we conduct the experiments as follows and the results are depicted in table 7:
402
+
403
+ • Short TBPTT Length We shorten the truncated length in TBPTT from 150 to 50. The gradients are truncated so we can’t do backpropagation on hidden states or memory from last iteration, but the ARMIN still has direct access to historical hidden states. By comparing the performance of the LSTM and ARMIN under such circumstances, we can know the efficacy of the external memory. The results show that the LSTM has a dramatic performance drop of 1.390 BPC while the ARMIN only has a minor performance drop of 1.220 BPC. The results confirm that the direct access to memory is crucial when the networks can’t access historical information by backpropagating gradients. And notably, our experiment shows that the ARMIN is very robust to short-length TBPTT, i.e. small iteration length, which means lower memory consumption. It enables using very large batch size to speed up the training and further increasing performance on sequence modelling tasks.
404
+
405
+ • No Control Gates We remove the control gate $\pmb { g } _ { t } ^ { h }$ and $\pmb { g } _ { t } ^ { r }$ in ARMIN cell as depicted in equation 3, and directly use $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $\boldsymbol { h } _ { t - 1 }$ to compute the gates in equation 6. The result shows a BPC of 1.354 that has a dramatic performance drop compared the 1.202 BPC of normal ARMIN. From this, we deduce that the control gates successfully filter out irrelevant information. Without the control gates, the historical state $\mathbf { } _ { \mathbf { } \mathbf { } \mathbf { } \mathbf { } r _ { t } }$ would have bring more noise than useful information.
406
+
407
+ To validate the efficacy of the addressing mechanism of the ARMIN, we do the following modifications to the read/write operations of the ARMIN, and the results are also depicted in table 7:
408
+
409
+ • Random Read The ARMIN randomly chooses a historical state while reading. The result shows a BPC of 1.224, compared to the 1.202 BPC of normal ARMIN. It proves that the read regime we proposed in section 3.2 is effective and can choose more useful historical state than random read.
410
+
411
+ • Queue-style Write While writing, the ARMIN follows a fashion of first-in-first-out, i.e. always chooses the oldest memory slot to write. It makes the memory $M$ stubbornly store the hidden states of the last 20 time-steps. The result shows a BPC of 1.352, which proves our normal read/write mechanism has much more flexibility and can learn long-term patterns.
412
+
413
+ • Independent Read/write While writing, the ARMIN doesn’t write to the last read memory slot, but independently choose a memory slot to overwrite according to $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ and $h _ { t }$ , in a similar fashion with the read operation we presented in section 3.2. The result shows a BPC of 1.245, proving that the normal writing regime in the ARMIN can better learn long-term patterns and maximally preserve historical information, as we explain in section 3.3.
414
+
415
+ • Smooth Read/write We replace the gumbel-softmax function with the vanilla softmax function, so the ARMIN reads and writes in a smooth way. The results show a minor performance drop of 1.212 BPC. The result shows that our discrete read/write regime is still better. Moreover, the smooth read/write regime would consume much more memory at both training and inference stages.
md/train/QZpx42n0BWr/QZpx42n0BWr.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FINE Samples for Learning with Noisy Labels
2
+
3
+ Taehyeon Kim ∗
4
+ KAIST AI
5
+ KAIST
6
+ Daejeon, South Korea
7
+ potter32@kaist.ac.kr
8
+ Jongwoo Ko ∗
9
+ KAIST AI
10
+ KAIST
11
+ Daejeon, South Korea
12
+ jongwoo.ko@kaist.ac.kr
13
+ Sangwook Cho
14
+ KAIST AI
15
+ KAIST
16
+ Daejeon, South Korea
17
+ sangwookcho@kaist.ac.kr
18
+ Jinhwan Choi
19
+ KAIST AI
20
+ KAIST
21
+ Daejeon, South Korea
22
+ jinhwanchoi@kaist.ac.kr
23
+ Se-Young Yun
24
+ KAIST AI
25
+ KAIST
26
+ Daejeon, South Korea
27
+ yunseyoung@kaist.ac.kr
28
+
29
+ # Abstract
30
+
31
+ Modern deep neural networks (DNNs) become weak when the datasets contain noisy (incorrect) class labels. Robust techniques in the presence of noisy labels can be categorized into two types: developing noise-robust functions or using noisecleansing methods by detecting the noisy data. Recently, noise-cleansing methods have been considered as the most competitive noisy-label learning algorithms. Despite their success, their noisy label detectors are often based on heuristics more than a theory, requiring a robust classifier to predict the noisy data with loss values. In this paper, we propose a novel detector for filtering label noise. Unlike most existing methods, we focus on each data point’s latent representation dynamics and measure the alignment between the latent distribution and each representation using the eigen decomposition of the data gram matrix. Our framework, coined as filtering noisy instances via their eigenvectors (FINE), provides a robust detector using derivative-free simple methods with theoretical guarantees. Under our framework, we propose three applications of the FINE: sample-selection approach, semi-supervised learning (SSL) approach, and collaboration with noiserobust loss functions. Experimental results show that the proposed methods consistently outperform corresponding baselines for all three applications on various benchmark datasets 1.
32
+
33
+ # 1 Introduction
34
+
35
+ Deep neural networks (DNNs) have achieved remarkable success in numerous tasks as the amount of accessible data has dramatically increased [21, 15]. On the other hand, accumulated datasets are typically labeled by a human, a labor-intensive job or through web crawling [48] so that they may be easily corrupted (label noise) in real-world situations. Recent studies have shown that deep neural networks have the capacity to memorize essentially any labeling of the data [49]. Even a small amount of such noisy data can hinder the generalization of DNNs owing to their strong memorization of noisy labels [49, 29]. Hence, it becomes crucial to train DNNs that are robust to corrupted labels. As label noise problems may appear anywhere, such robustness increases reliability in many applications such as the e-commerce market [9], medical fields [45], on-device AI [46], and autonomous driving systems [11].
36
+
37
+ To improve the robustness against noisy data, the methods for learning with noisy labels (LNL) have been evolving in two main directions [18]: (1) designing noise-robust objective functions or regularizations and (2) detecting and cleansing the noisy data. In general, the former noise-robust direction uses explicit regularization techniques [6, 52, 50] or robust loss functions [38, 13, 40, 51], but their performance is far from state-of-the-art [49, 26] on datasets with severe noise rates. Recently, researchers have designed noise-cleansing algorithms focused on segregating the clean data (i.e., samples with uncorrupted labels) from the corrupted data [19, 14, 47, 18, 32, 42]. One of the popular criteria for the segregation process is the loss value between the prediction of the noisy classifier and its noisy label, where it is generally assumed that the noisy data have a large loss [19, 14, 47, 18] or the magnitude of the gradient during training [51, 40]. However, these methods may still be biased by the corrupted linear classifier towards label noise because their criterion (e.g., loss values or weight gradient) uses the posterior information of such a linear classifier [24]. Maennel et al. [31] analytically showed that the principal components of the weights of a neural network align with the randomly labeled data; this phenomenon can yield more negative effects on the classifier as the number of randomly labeled classes increases. Recently, Wu et al. [42] used an inherent geometric structure induced by nearest neighbors (NN) in latent space and filtered out isolated data in such topology, and its quality was sensitive to its hyperparameters regarding NN clustering in the presence of severe noise rates.
38
+
39
+ ![](images/5dc76db62bc5fdf618d00e6a7419d8677909c74d57178c02c103d2a86cb6ad74.jpg)
40
+ Figure 1: Illustration of (a) basic concept of this work and (b) proposed detection framework, FINE. Noise-cleansing learning generally separates clean data from the original dataset by using prediction outputs. We propose a novel derivative-free detector based on an unsupervised clustering algorithm on the high-order topological space. FINE measures the alignment of pre-logits (i.e., penultimate layer representation vectors) toward the class-representative vector that is extracted through the eigen decomposition of the gram matrix of data representations.
41
+
42
+ To mitigate such issues for label noise detectors, we provide a novel yet simple detector framework, filtering noisy labels via their eigenvectors (FINE) with theoretical guarantees to provide a high-quality splitting of clean and corrupted examples (without the need to estimate noise rates). Instead of using the neural network’s linear classifier, FINE utilizes the principal components of latent representations made by eigen decomposition which is one of the most widely used unsupervised learning algorithms and separates clean data and noisy data by these components (Figure 1a). To motivate our approach, as Figure 1b shows, we find that the clean data (blue points) are mainly aligned on the principal component (black dotted line), whereas the noisy data (orange points) are not; thus, the dataset is well clustered with the alignment of representations toward the principal component by fitting them into Gaussian mixture models (GMM). We apply our framework to various LNL methods: the sample selection approach, a semi-supervised learning (SSL) approach, and collaboration with noise-robust loss functions. The key contributions of this work are summarized as follows:
43
+
44
+ • We propose a novel framework, termed FINE (filtering noisy labels via their eigenvectors), for detecting clean instances from noisy datasets. FINE makes robust decision boundary for the high-order topological information of data in latent space by using eigen decomposition of their gram matrix.
45
+ • We provide provable evidence that FINE allows a meaningful decision boundary made by eigenvectors in latent space. We support our theoretical analysis with various experimental results regarding the characteristics of the principal components extracted by our FINE detector.
46
+ • We develop a simple sample-selection method by replacing the existing detector method with FINE. We empirically validate that a sample-selection learning with FINE provides consistently superior detection quality and higher test accuracy than other existing alternative methods such as the Co-teaching family [14, 47], TopoFilter [42], and CRUST [32].
47
+
48
+ • We experimentally show that our detection framework can be applied in various ways to existing LNL methods and validate that ours consistently improves the generalization in the presence of noisy data: sample-selection approach [14, 47], SSL approach [25], and collaboration with noise-robust loss functions [51, 40, 29].
49
+
50
+ Organization. The remainder of this paper is organized as follows. In Section 2, we discuss the recent literature on LNL solutions and meaningful detectors. In Section 3, we address our motivation for creating a noisy label detector with theoretical insights and provide our main method, filtering the noisy labels via their eigenvectors (FINE). In Section 4, we present the experimental results. Finally, Section 5 concludes the paper.
51
+
52
+ # 2 Related Works
53
+
54
+ Zhang et al. [49] empirically showed that any convolutional neural networks trained using stochastic gradient methods easily fit a random labeling of the training data. To tackle this issue, numerous works have examined the classification task with noisy labels. We do not consider the works that assumed the availability of small subsets of training data with clean labels [17, 36, 39, 53, 3].
55
+
56
+ Noise-Cleansing-based Approaches. Noise-cleansing methods have evolved following the improvement of noisy detectors. Han et al. [14] suggested a noisy detection approach, named coteaching, that utilizes two networks, extracts subsets of instances with small losses from each network, and trains each network with subsets of instances filtered by another network. Yu et al. [47] combined a disagreement training procedure with co-teaching, which only selects instances predicted differently by two networks. Huang et al. [18] provided a simple noise-cleansing framework, training-filtering-training; the empirical efficacy was improved by first finding label errors, then training the model only on data predicted as clean. Recently, new noisy detectors with theoretical support have been developed. Wu et al. [42] proposed a method called TopoFilter that filters noisy data by utilizing the $\mathbf { k }$ -nearest neighborhood algorithm and Euclidean distance between pre-logits. Mirzasoleiman et al. [32] introduced an algorithm that selects subsets of clean instances that provide an approximately low-rank Jacobian matrix and proved that gradient descent applied to the subsets prevents overfitting to noisy labels. Pleiss et al. [34] proposed an area under margin (AUM) statistic that measures the average difference between the logit values of the assigned class and its highest non-assigned class to divide clean and noisy samples. Cheng et. al [8] progressively filtered out corrupted instances using a novel confidence regularization term. The noise-cleansing method was also developed in a semi-supervised learning (SSL) manner. Li et al. [25] modeled the per-sample loss distribution and divide it into a labeled set with clean samples and an unlabeled set with noisy samples, and they leverage the noisy samples through the well-known SSL technique MixMatch [4].
57
+
58
+ Noise-Robust Models. Noise-robust models have been studied in the following directions: robustloss functions, regularizations, and strategies. First, for robust-loss functions, Ghosh et al. [13] showed that the mean absolute error (MAE) might be robust against noisy labels. Zhang & Sabuncu et al. [51] argued that MAE performed poorly with DNNs and proposed a GCE loss function, which can be seen as a generalization of MAE and cross-entropy (CE). Wang et al. [40] introduced the reverse version of the cross-entropy term (RCE) and suggested that the SCE loss function is a weighted sum of the CE and RCE. Some studies have stated that the early-stopped model can prevent the memorization phenomenon for noisy labels [2, 49] and theoretically analyzed it [26]. Based on this hypothesis, Liu et al. [29] proposed an early-learning regularization (ELR) loss function to prohibit memorizing noisy data by leveraging the semi-supervised learning techniques. Xia et al. [43] clarified which neural network parameters cause memorization and proposed a robust training strategy for these parameters. Efforts have been made to develop regularizations on the prediction level by smoothing the one-hot vector [30], using linear interpolation between data instances [50], and distilling the rescaled prediction of other models [20]. However, these works have limitations in terms of performance as the noise rate of the dataset increases.
59
+
60
+ Dataset Resampling. Label-noise detection may be a category of data resampling which is a common technique in the machine learning community that extracts a “helpful” dataset from the distribution of the original dataset to remove the dataset bias. In class-imbalance tasks, numerous studies have conducted over-sampling of minority classes [7, 1] or undersampling the majority classes [5] to balance the amount of data per class. Li & Vasconcelos et al. [27] proposed a resampling procedure to reduce the representation bias of the data by learning a weight distribution that favors difficult instances for a given feature representation. Le Bras et al. [22] suggested an adversarial filteringbased approach to remove spurious artifacts in a dataset. Analogously, in anomaly detection and
61
+
62
+ INPUT : Noisy training data $\mathcal { D }$ , feature extractor $g$ , number of classes $K$ , clean probability threshold $\zeta$ , set of FINE scores for class $k \mathcal { F } _ { k }$
63
+ OUTPUT : Collected clean data $\mathcal { C }$
64
+ 1: Initialize $c \gets \emptyset$ , $\hat { \mathcal { D } } \gets \mathcal { D }$ , $\Sigma _ { k } \gets \mathbf { 0 }$ for all $k = 1 , \ldots , K$ $/ { * }$ Update the convariance matrices for all classes $^ { * }$
65
+ 2: for $( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) \in \mathcal { D }$ do
66
+ 3: ${ z _ { i } \gets g ( { \pmb x } _ { i } ) }$
67
+ 4: Update the gram matrix $\Sigma _ { y _ { i } } \gets \Sigma _ { y _ { i } } + z _ { i } z _ { i } ^ { \top }$
68
+ 5: end for $/ { * }$ Generate the principal component with eigen decomposition $^ { * }$
69
+ 6: for $k = 1 , \ldots , K$ do
70
+ 7: $\mathbf { U } _ { k } , \mathbf { \Lambda } \Lambda _ { k } \gets$ EIGEN DECOMPOSITION OF $\Sigma _ { k }$
71
+ 8: $\mathbf { u } _ { k } \gets$ THE FIRST COLUMN OF $\mathbf { U } _ { k }$
72
+ 9: end for $/ { * }$ Compute the alignment score and get clean subset $\mathcal { C }$ \*/
73
+ 10: for $( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) \in \mathcal { D }$ do
74
+ 11: Compute the FINE score $f _ { i } = \left. \mathbf { u } _ { y _ { i } } , z _ { i } \right. ^ { 2 }$ and $\mathcal { F } _ { y _ { i } } \gets \mathcal { F } _ { y _ { i } } \cup \{ f _ { i } \}$
75
+ 12: end for $/ { * }$ Finding the samples whose clean probability is larger than $\zeta$ \*/
76
+ 13: ${ \mathcal { C } } \gets { \mathcal { C } } \cup$ GMM $( \mathcal { F } _ { k } , \zeta )$ for all $k = 1 , \ldots , K$
77
+
78
+ out-of-distribution detection problems [16, 28, 23], the malicious data are usually detected by examining the loss value or negative behavior in the feature representation space. While our research is motivated by such previous works, this paper focuses on the noisy image classification task.
79
+
80
+ # 3 Method
81
+
82
+ In this section, we present our detector framework and the theoretical motivation behind using the detector in high-dimensional classification. To segregate the clean data, we utilize the degree of alignment between the representations and the eigenvector of the representations’ gram matrices for all classes, called FINE (FIltering Noisy instnaces via their Eigenvectors). Our algorithm is as follows (Algorithm 1). FINE first creates a gram matrix of the representation in the noisy training dataset for each class and conducts the eigen decomposition for those gram matrices. Then, FINE finds clean and noisy instances using the square of inner product values between the representations and the first eigenvector having the largest eigenvalue. In this manner, we treat the data as clean if aligned onto the first eigenvector, while most of the noisy instances are not. Here, we formally define ‘alignment’ and ‘alignment clusterability’ in Definition 1 and Definition 2, respectively.
83
+
84
+ # Definition 1. (Alignment) $D$
85
+
86
+ Definition 2. (Alignment Clusterability) For all features labeled as class $k$ in dataset $\mathcal { D }$ , let fit a Gaussian Mixture Model (GMM) on their alignment (Definition 1) distribution to divide current samples into a clean set and a noisy set; the set having larger mean value is treated as a clean set, and another one is a noisy set. Then, we say a dataset $\mathcal { D }$ satisfies alignment clusterability if the representation $_ z$ labeled as the same true class belongs to the clean set.
87
+
88
+ As an empirical evaluation, the quality of our detector for noisy data is measured with the $\boldsymbol { F }$ -score, a widely used criterion in noisy label detection, anomaly detection and out-of-distribution detection [8, 16, 28, 23]. We treat the selected clean samples as the positive class and the noisy samples as negative class. The $F _ { \mathrm { \ell } }$ -score is the harmonic mean of the precision and the recall; the precision indicates the fraction of clean samples among all samples that are predicted as clean, and the recall indicates the portion of clean samples that are identified correctly.
89
+
90
+ # 3.1 Alignment Analysis for Noisy Label Detector
91
+
92
+ To design a robust label noise filtering framework, we explore the linear nature of the topological space of feature vectors for data resampling techniques and deal with the classifier contamination due to random labels. Recent studies on the distribution of latent representations in DNNs provide insight regarding how correctly the outlier samples can be filtered with the hidden space’s geometrical information. For instance, in [23, 24], the authors proposed frameworks for novelty detection using the topological information of pre-logit based on the Mahalanobis distance, and, in [42], the authors filtered the noisy data based on the Euclidean distance between pre-logits. Maennel et al. [31] analytically showed that an alignment between the principal components of network parameters and those of data takes place when training with random labels. This finding points out that random labels can corrupt a classifier, and thus building a robust classifier is required.
93
+
94
+ Motivated by these works, we aim to design a novel detector using the principal components of latent features to satisfy Definition 2. However, it is intractable to find the optimal classifier to maximize the separation of alignment clusterability because clean data distribution and noisy data distribution are inaccessible. To handle this issue, we attempt to approximate the clean eigenvector to maximize the alignment values of clean data rather than to maximize the separation; the algorithm utilizes the eigenvector of the data for each class (Figure 2). Below, we provide the upper bound for the perturbation toward the clean data’s eigenvector under simple problem settings with noisy labels referred to in other studies [29, 42]. We first introduce notations. Next, we establish the theoretical evidence that our FINE algorithm approximates the clean data’s eigenvectors under some assumptions for its analytic tractability (Theorem 1). We mainly present the theorem and its interpretation; details of the proofs can be found in the Appendix.
95
+
96
+ ![](images/2b530cf95684b0b0d61d6b3d5be3a3529386939349751e8aa4ec2aa62c5d612a.jpg)
97
+ Figure 2: Illustration for the problem settings and Theorem 1. The perturbation (green shade) is the angle between the first eigenvector of clean instances (blue line) and the estimated first eigenvector (green line) which is perturbed by that of noisy instances (orange line). Note that blue and orange points are clean instances and noisy instances, respectively.
98
+
99
+ Notations. Consider a binary classification task. Assume that the data points and labels lie in $\mathcal { X } \times \mathcal { V }$ , where the feature space $\mathcal { X } \subset \mathbb { R } ^ { d }$ and label space $\mathcal { Y } = \{ - 1 , + 1 \}$ . A single data point $_ { \textbf { \em x } }$ and its true label $y$ follow a distribution $( \pmb { x } , y ) \sim P _ { { \pmb { \chi } } \times { \pmb { y } } }$ . Denote by $\tilde { y }$ the observed label (potentially corrupted). Without loss of generality, we focus on the set of data points whose observed label is $\tilde { y } = + 1$ .
100
+
101
+ Let $\mathbf x \subset \mathcal X$ be the finite set of features with clean instances whose true label is $y = + 1$ . Similarly, let $\tilde { \textbf { X } } ( ~ \mathcal { X } ~ $ be the set of noisy instances whose true label is $y = - 1$ . To establish our theorem, we assume the following reasonable conditions referred to other works using linear discriminant analysis (LDA) assumptions [24, 12]:
102
+
103
+ Assumption 1. The feature distribution is comprised of two Gaussians, each identified as a clean cluster and a noisy cluster.
104
+
105
+ Assumption 2. The features of all instances with $y = + 1$ are aligned on the unit vector v with the white noise, i.e., $\mathbb { E } _ { \pmb { x } \in \mathbf { X } } \left[ \pmb { x } \right] = \pmb { v }$ . Similarly, features of all instances with $y = - 1$ are aligned on the unit vector $\pmb { w }$ , i.e., $\mathbb { E } _ { { \pmb x } \in \tilde { \bf X } } \left[ { \pmb x } \right] = { \pmb w }$ .
106
+
107
+ Theorem 1. (Upper bound for the perturbation towards the clean data’s eigenvector v) Let $N _ { + }$ and $N _ { - }$ be the number of clean instances and noisy instances, respectively, and u be the FINE’s eigenvector which is the first column of U from the eigen decomposition of the whole data’s matrix $\pmb { \Sigma }$ . For any $\delta \in ( 0 , 1 )$ , its perturbation towards the v in assumption 2 (i.e., 2-norm for difference of projection matrices; left hand side of Eq. $( l )$ ) holds the following with probability $1 - \delta$ :
108
+
109
+ $$
110
+ \| \pmb { u } \pmb { u } ^ { \top } - \pmb { v } \pmb { v } ^ { \top } \| _ { 2 } \leq \frac { 3 \tau \cos \theta + \mathcal { O } ( \sigma ^ { 2 } \sqrt { \frac { d + \log ( 4 / \delta ) } { N _ { + } } } ) } { 1 - \tau ( \sin \theta + 3 \cos \theta ) - \mathcal { O } ( \sigma ^ { 2 } \sqrt { \frac { d + \log ( 4 / \delta ) } { N _ { + } } } ) }
111
+ $$
112
+
113
+ where w is the first eigenvector of noisy instances, $\tau$ is the fraction between noisy and clean instances $( \frac { N _ { - } } { N _ { + } } ) , \theta$ is $\scriptstyle \angle ( w , v )$ , and $\sigma ^ { 2 }$ is a variance of white noise.
114
+
115
+ Theorem 1 states that the upper bound for the perturbation toward $\textbf { { v } }$ are dependent on both the ratio $\tau$ and the angle $\theta$ between $\pmb { w }$ and $\textbf { { v } }$ ; small upper bound can be guaranteed as the number of clean data increases, $\tau$ decreases, and $\theta$ approaches $\frac { \pi } { 2 }$ . We also derive the lower bound for the precision and the recall when using the eigenvector $\textbf { \em u }$ in Appendix. In this theoretical analysis, we can ensure that such lower bound values become larger as $\pmb { v }$ and $\textbf { \em w }$ become orthogonal to each other. To verify these assumptions, we provide various experimental results for the separation of alignment clusterability, the perturbation values, the scalability to the number of samples, the quality of our detector in the application of sample selection approach, and the comparison with an alternative clustering-based estimator [24].
116
+
117
+ ![](images/8a7dfe8ad4826fde753b055955563adfdc0f0a32d7816be67610bdec671492af.jpg)
118
+ Figure 3: (a), (b): Heatmaps of Eq. (2) values on unit circle in random hyperplane. We evaluate this visualization on the ResNet34 model trained with common cross-entropy loss on CIFAR-10 with asymmetric noise $40 \%$ and CIFAR-100 with symmetric noise $80 \%$ , respectively. Colors closer to yellow indicate larger the values; (c): comparison of perturbations of Eq. (1) on CIFAR-10 with symmetric noise $20 \%$ ; (d): comparison of cosine similarity values between FINE’s principal components and approximated principal components using fraction of data on CIFAR-10 with symmetric noise $80 \%$ .
119
+
120
+ Validation for our Estimated Eigenvector. To validate our FINE’s principal components, we first propose a simple visualization scheme based on the following steps: (1) Pick the first eigenvector $( { \pmb u } )$ extracted by FINE algorithm, (2) Generate a random hyperplane spanned by such eigenvector $( { \pmb u } )$ and a random vector, (3) Calculate the value of the following Eq. (2) on any unit vectors $\mathbf { \Pi } ( \mathbf { a } )$ in such hyperplane and plot a heatmap with them:
121
+
122
+ $$
123
+ { \frac { 1 } { \left| \mathbf { X } \right| } } \sum _ { \pmb { x } _ { i } \in \mathbf { X } } \left. \pmb { a } , \pmb { x } _ { i } \right. ^ { 2 } - { \frac { 1 } { \left| \tilde { \mathbf { X } } \right| } } \sum _ { \pmb { x } _ { j } \in \tilde { \mathbf { X } } } \left. \pmb { a } , \pmb { x } _ { j } \right. ^ { 2 }
124
+ $$
125
+
126
+ Eq. (2) is maximized when the unit vector $^ { a }$ not only maximizes the FINE scores of clean data for the first term in Eq. (2), but also minimizes those of noisy data for the second term in Eq. (2). This visualization shows in 2-D how FINE’s first eigenvector $( \pmb { u } )$ optimizes such values in the presence of noisy instances (Figure 3a and 3b). As the figures show, the FINE’s eigenvector $\textbf { \em u }$ (red dotted line) has almost maximum value of Eq. (2). Furthermore, we empirically evaluate the perturbation values in Theorem 1 as the noise rate changes (Figure 3c); FINE has small perturbation values even in a severe noise rate.
127
+
128
+ Scalability to Number of Samples. Despite FINE’s superiority, it may require high computational costs if the whole dataset is used for eigen decomposition. To address this issue, we approximate the eigenvector with a small portion of the dataset and measure the cosine similarity values between the approximated term and the original one $( u )$ (Figure 3d). Interestingly, we verify that far accurate eigenvector is computed even using $1 \%$ data (i.e., a cosine similarity value is 0.99), and thus the eigenvector can be accurately estimated with little computation time.
129
+
130
+ Validation for Dynamics of Sample-selection Approach. We evaluate the F-score dynamics of every training epoch on the symmetric and the asymmetric label noise in Figure 4. We compare FINE with the following sample-selection approaches: Co-teaching [14] and TopoFilter [42]. In Figure 4, during the training process, F-scores of FINE becomes consistently higher on both symmetric noise and asymmetric noise settings, while Co-teaching and TopoFilter achieve lower quality. Unlike TopoFilter and FINE, Co-teaching even performs the sample-selection with the access of noise rate. This evidence show that FINE is also applicable to the naive sample-selection approaches.
131
+
132
+ ![](images/035e0c7836c4f96bc84ff561c9be9cff0497e1c1c5a8f0a792ed9bc537024004.jpg)
133
+ Figure 4: Comparisons of F-scores on CIFAR10 and CIFAR100 under symmetric and asymmetric label noise. C10 and C100 denote CIFAR-10 and CIFAR-100, respectively.
134
+
135
+ Comparison for Mahalanobis Distance Estimator Under similar conditions, Lee et al. [24] measured the Mahalanobis distance of pre-logits using the minimum covariance determinant (MCD) estimator and selected clean samples based on this distance. While they also utilized the LDA assumptions on pre-logits, FINE consistently outperforms MCD in both precision and recall, thus yielding better Fscore (Figure 5). The experimental results justify our proposed detector, in comparison with a similar alternative.
136
+
137
+ ![](images/26d68f38364785b989815bb5939e6ce9c08f14c73d88e7bfeec9f205465683ce.jpg)
138
+ Figure 5: Comparisons of F-scores on CIFAR-10 and CIFAR-100 under symmetric (S) and asymmetric noise (A) settings.
139
+
140
+ # 4 Experiment
141
+
142
+ In this section, we demonstrate the effectiveness of our FINE detector for three applications: sample selection approach, SSL, and collaboration with noise-robust loss functions.
143
+
144
+ # 4.1 Experimental Settings
145
+
146
+ Noisy Benchmark Dataset. Following the previous setups [25, 29], we artificially generate two types of random noisy labels: injecting uniform randomness into a fraction of labels (symmetric) and corrupting a label only to a specific class (asymmetric). For example, we generate noise by mapping TRUCK AUTOMOBILE, BIRD AIRPLANE, DEER $ \mathrm { H O R S E }$ , $\mathbf { C A T } \mathbf { D O G }$ to make asymmetric noise for CIFAR-10. For CIFAR-100, we create 20 five-size super-classes and generate asymmetric noise by changing each class to the next class within super-classes circularly. For a real-world dataset, Clothing1M [44] containing inherent noisy labels is used. This dataset contains 1 million clothing images obtained from online shopping websites with 14 classes2. The dataset provides $5 0 k , 1 4 k$ , and $1 0 k$ verified as clean data for training, validation, and testing. Instead of using the $5 0 k$ clean training data, we use a randomly sampled pseudo-balanced subset as a training set with $1 2 0 k$ images. For evaluation, we compute the classification accuracy on the $1 0 k$ clean dataset.
147
+
148
+ Networks and Hyperparameter Settings. We use the architectures and hyperparameter settings for all baseline experiments following the setup of Liu et al. [29] except with SSL approaches. For SSL approaches, we follow the setup of Li et al. [25]. We set the threshold $\zeta$ as 0.5.
149
+
150
+ # 4.2 Application of FINE
151
+
152
+ # 4.2.1 Sample Selection-Based Approaches
153
+
154
+ We apply our FINE detector for various sample selection algorithms. In detail, after warmup training, at every epoch, FINE selects the clean data with the eigenvectors generated from the gram matrices of data predicted to be clean in the previous round, and then the neural networks are trained with them. We compare our proposed method with the following sample selection approaches: (1) Bootstrap [35], (2) Forward [33], (3) Co-teaching [14]; (4) Co-teaching $^ +$ [47]; (5) TopoFilter [42]; (6) CRUST [32]. We evaluate these algorithms three times and report error bars.
155
+
156
+ Table 1: Test accuracies $( \% )$ on CIFAR-10 and CIFAR-100 under different noisy types and fractions. All comparison methods are reproduced with publicly available code, while the results for Bootstrap [35] and Forward [33] are taken from [29]. For CRUST [32], we experiment without mixup to compare the intrinsic sample selection effect of each method. The average accuracies and standard deviations over three trials are reported. Here, we substitute the sample selection method of Co-teaching [14, 47] with FINE (i.e., F-Co-teaching). The best results sharing the noisy fraction and method are highlighted in bold.
157
+
158
+ <table><tr><td>Dataset</td><td colspan="4">CIFAR-10</td><td colspan="4">CIFAR-100</td></tr><tr><td>Noisy Type</td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td></tr><tr><td>Noise Ratio</td><td>20</td><td>50</td><td>80</td><td>40</td><td>20</td><td>50</td><td>80</td><td>40</td></tr><tr><td>Standard</td><td>87.0 ± 0.1</td><td>78.2 ±0.8</td><td>53.8 ±1.0</td><td>85.0±0.0</td><td>58.7 ±0.3</td><td>42.5± 0.3</td><td>18.1 ± 0.8</td><td>42.7 ± 0.6</td></tr><tr><td>Bootstrap [35]</td><td>86.2 ±0.2</td><td>1</td><td>54.1 ± 1.3</td><td>81.2 ± 1.5</td><td>58.3 ±0.2</td><td>-</td><td>21.6 ± 1.0</td><td>45.1 ± 0.6</td></tr><tr><td>Forward [33]</td><td>88.0±0.4</td><td></td><td>54.6 ± 0.4</td><td>83.6± 0.6</td><td>39.2 ± 2.6</td><td></td><td>9.0±0.6</td><td>34.4 ± 1.9</td></tr><tr><td>Co-teaching[14]</td><td>89.3 ±0.3</td><td>83.3 ±0.6</td><td>66.3 ± 1.5</td><td>88.4±2.8</td><td>63.4 ± 0.0</td><td>49.1 ± 0.4</td><td>20.5 ± 1.3</td><td>47.7 ± 1.2</td></tr><tr><td>Co-teaching+[47]</td><td>89.1 ± 0.5</td><td>84.9 ±0.4</td><td>63.8± 2.3</td><td>86.5 ± 1.2</td><td>59.2 ± 0.4</td><td>47.1 ± 0.3</td><td>20.2 ± 0.9</td><td>44.7 ± 0.6</td></tr><tr><td>TopoFilter[42]</td><td>90.4± 0.2</td><td>86.8 ±0.3</td><td>46.8 ± 1.0</td><td>87.5± 0.4</td><td>66.9 ± 0.4</td><td>53.4 ±1.8</td><td>18.3 ± 1.7</td><td>56.6±0.5</td></tr><tr><td>CRUST[32]</td><td>89.4 ±0.2</td><td>87.0 ± 0.1</td><td>64.8 ± 1.5</td><td>82.4± 0.0</td><td>69.3 ±0.2</td><td>62.3 ± 0.2</td><td>21.7 ± 0.7</td><td>56.1 ± 0.5</td></tr><tr><td>FINE</td><td>91.0 ± 0.1</td><td>87.3 ± 0.2</td><td>69.4 ± 1.1</td><td>89.5 ± 0.1</td><td>70.3 ± 0.2</td><td>64.2 ± 0.5</td><td>25.6 ± 1.2</td><td>61.7 ± 1.0</td></tr><tr><td>F-Coteaching</td><td>92.0 ± 0.1</td><td>87.5 ± 0.1</td><td>74.2 ± 0.8</td><td>90.5 ± 0.2</td><td>71.1 ± 0.2</td><td>64.7 ± 0.3</td><td>31.6 ± 1.0</td><td>64.8 ± 0.7</td></tr></table>
159
+
160
+ Table 1 summarizes the performances of different sample selection approaches on various noise distribution and datasets. We observe that our FINE method consistently outperforms the competitive methods over the various noise rates. Our FINE methods can filter the clean instances without losing essential information, leading to training the robust network.
161
+
162
+ To go further, we improve the performance of Co-teaching [14] by substituting its sample selection state with our FINE algorithm. To combine FINE and the Co-teaching family, unlike the original methods that utilize the small loss instances to train with clean labels, we train one model with extracted samples by conducting FINE on another model. The results of the experiments are shown in the eighth and ninth rows of Table 1.
163
+
164
+ # 4.2.2 SSL-Based Approaches
165
+
166
+ SSL approaches [25, 10, 41] divide the training data into clean instances as labeled instances and noisy instances as unlabeled instances and use both the labeled and unlabeled samples to train the networks in SSL. Recently, methods belonging to this category have shown the best performance among the various LNL methods, and these methods can train robust networks for even extremely high noise rates. We compare the performances of the existing semi-supervised approaches and that in which the sample selection state of DivideMix [25] is substituted with our FINE algorithm (i.e., F-DivideMix). The results of the experiments are shown in Table 2. We achieve consistently higher performance than DivideMix by utilizing FINE instead of its loss-based filtering method and show comparable performance to the state-of-the-art SSL methods such as DST [41] and LongReMix [10]. Interestingly, as Figure 6 shows, clean and noisy data are well classified in F-DivideMix under extreme noise cases.
167
+
168
+ ![](images/11adb8995afaef343b648fa666cd40c5a34b839ed05e8c31a9be3bce97d46429.jpg)
169
+ Figure 6: Comparisons of F-scores on CIFAR-10 under symmetric $90 \%$ noise. Blue line indicates the error bar of two networks’ F-score used in Dividemix [25], and Orange line indicates those replaced by our FINE detector.
170
+
171
+ # 4.2.3 Collaboration with Noise-Robust Loss Functions
172
+
173
+ The goal of the noise-robust loss function is to achieve a small risk for unseen clean data even when noisy labels exist in the training data. There have been few collaboration studies of the noise-robust loss function methodology and dynamic sample selection. Most studies have selected clean and noisy data based on cross-entropy loss.
174
+
175
+ Here, we state the collaboration effects of FINE with various noise-robust loss functions: generalized cross entropy (GCE) [51], symmetric cross entropy (SCE) [40], and early-learning regularization (ELR) [29]. Figure 7 shows that FINE facilitates generalization in the application of noise-robust loss functions on severe noise rate settings. The detailed results are reported in the Appendix. Unlike other methods, it is still theoretically supported because FINE extracts clean data with a robust classifier using representation.
176
+
177
+ ![](images/f283614e95a0f1cd3f6fa0c1544c9102377f47d401ff9597b6134bd5b8d79b1a.jpg)
178
+ Figure 7: Test accuracies $( \% )$ on CIFAR-10 and CIFAR-100 under different noisy types and fractions for noise-robust loss approaches. Note that the blue and orange bars are results for without and with FINE, respectively. The average accuracies and standard deviations over three trials are reported.
179
+
180
+ # 4.3 Experiments on Real-World Dataset
181
+
182
+ As Table 3 shows, FINE and F-DivideMix work fairly well on the Clothing 1M dataset compared to other approaches when we reproduce the experimental results under the same settings.
183
+
184
+ Table 2: Comparison of test accuracies $( \% )$ for FINE collaborating with DivideMix and existing semi-supervised approaches on CIFAR-10 and CIFAR-100 under different noisy types and fractions. The results for all comparison methods are taken from their original works.
185
+ Table 3: Test accuracy on Clothing1M dataset
186
+
187
+ <table><tr><td>Method</td><td>Standard</td><td>GCE[51]</td><td>SCE[40]</td><td>ELR [29]</td><td>DivideMix [25]</td><td>CORES² [8]</td><td>FINE</td><td>F-DivideMix</td></tr><tr><td>Accuracy</td><td>68.94</td><td>69.75</td><td>71.02</td><td>72.87</td><td>74.30</td><td>73.24</td><td>72.91</td><td>74.37</td></tr></table>
188
+
189
+ # 5 Conclusion
190
+
191
+ This paper introduces FINE for detecting label noise by designing a robust noise detector. Our main idea is utilizing the principal components of latent representations made by eigen decomposition. Most existing detection methods are dependent on the loss values, while such losses may be biased by corrupted classifier [24, 31]. Our methodology alleviates this issue by extracting key information from representations without using explicit knowledge of the noise rates. We show that the FINE detector has an excellent ability to detect noisy labels in theoretical and experimental results. We propose three applications of the FINE detector: sample-selection approach, SSL approach, and collaboration with noise-robust loss functions. FINE yields strong results on standard benchmarks and a real-world dataset for various LNL approaches.
192
+
193
+ We believe that our work opens the door to detecting samples having noisy labels with explainable results. It is a non-trivial task and of social significance, and thus, our work will have a substantial social impact on DL practitioners because it avoids the a labor-intensive job of checking data label quality. As future work, we hope that our work will trigger interest in the design of new labelnoise detectors and bring a fresh perspective for other data-resampling approaches (e.g., anomaly detection and novelty detection). The development of robustness against label noise even leads to an improvement in the performance of network trained with data collected through web crawling. We believe that our contribution will lower the barriers to entry for developing robust models for DL practitioners and greatly impact the internet industry. On the other hand, we are concerned that it can be exploited to train robust models using data collected illegally and indiscriminately on the dark web (e.g., web crawling), and thus it may raise privacy concerns (e.g., copyright).
194
+
195
+ # Acknowledgments and Disclosure of Funding
196
+
197
+ 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)] and [No. 2021-0-00907, Development of Adaptive and Lightweight Edge-Collaborative Analysis Technology for Enabling Proactively Immediate Response and Rapid Learning]. We thank Seongyoon Kim for discussing about the concept of perturbation.
198
+
199
+ # References
200
+
201
+ [1] Shin Ando and Chun Yuan Huang. Deep over-sampling framework for classifying imbalanced data. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 770–785. Springer, 2017.
202
+ [2] 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. In International Conference on Machine Learning, pages 233–242. PMLR, 2017.
203
+ [3] Dara Bahri, Heinrich Jiang, and Maya Gupta. Deep k-nn for noisy labels. In International Conference on Machine Learning, pages 540–550. PMLR, 2020.
204
+ [4] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, pages 5049–5059, 2019.
205
+ [5] 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.
206
+ [6] Kaidi Cao, Yining Chen, Junwei Lu, Nikos Arechiga, Adrien Gaidon, and Tengyu Ma. Heteroskedastic and imbalanced deep learning with adaptive regularization. arXiv preprint arXiv:2006.15766, 2020.
207
+ [7] 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.
208
+ [8] Hao Cheng, Zhaowei Zhu, Xingyu Li, Yifei Gong, Xing Sun, and Yang Liu. Learning with instance-dependent label noise: A sample sieve approach. arXiv preprint arXiv:2010.02347, 2020.
209
+ [9] Charles Corbiere, Hedi Ben-Younes, Alexandre Ramé, and Charles Ollion. Leveraging weakly annotated data for fashion image retrieval and label prediction. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 2268–2274, 2017.
210
+ [10] Filipe R Cordeiro, Ragav Sachdeva, Vasileios Belagiannis, Ian Reid, and Gustavo Carneiro. Longremix: Robust learning with high confidence samples in a noisy label environment. arXiv preprint arXiv:2103.04173, 2021.
211
+ [11] Di Feng, Christian Haase-Schutz, Lars Rosenbaum, Heinz Hertlein, Claudius Glaser, Fabian Timm, Werner Wiesbeck, and Klaus Dietmayer. Deep multi-modal object detection and semantic segmentation for autonomous driving: Datasets, methods, and challenges. IEEE Transactions on Intelligent Transportation Systems, 22(3):1341–1360, Mar 2021.
212
+ [12] Ronald A Fisher. The use of multiple measurements in taxonomic problems. Annals of eugenics, 7(2):179–188, 1936.
213
+ [13] Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In AAAI, 2017.
214
+ [14] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in neural information processing systems, pages 8527–8537, 2018.
215
+ [15] 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.
216
+ [16] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-ofdistribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016.
217
+ [17] Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. arXiv preprint arXiv:1802.05300, 2018.
218
+ [18] Jinchi Huang, Lie Qu, Rongfei Jia, and Binqiang Zhao. O2u-net: A simple noisy label detection approach for deep neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3326–3334, 2019.
219
+ [19] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels, 2018.
220
+ [20] Taehyeon Kim, Jaehoon Oh, NakYil Kim, Sangwook Cho, and Se-Young Yun. Comparing kullback-leibler divergence and mean squared error loss in knowledge distillation, 2021.
221
+ [21] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097– 1105, 2012.
222
+ [22] Ronan Le Bras, Swabha Swayamdipta, Chandra Bhagavatula, Rowan Zellers, Matthew Peters, Ashish Sabharwal, and Yejin Choi. Adversarial filters of dataset biases. In International Conference on Machine Learning, pages 1078–1088. PMLR, 2020.
223
+ [23] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pages 7167–7177, 2018.
224
+ [24] Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. In International Conference on Machine Learning, pages 3763–3772. PMLR, 2019.
225
+ [25] Junnan Li, Richard Socher, and Steven C.H. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In International Conference on Learning Representations, 2020.
226
+ [26] Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International Conference on Artificial Intelligence and Statistics, pages 4313–4324. PMLR, 2020.
227
+ [27] Yi Li and Nuno Vasconcelos. Repair: Removing representation bias by dataset resampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9572–9581, 2019.
228
+ [28] Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-ofdistribution image detection in neural networks. arXiv preprint arXiv:1706.02690, 2017.
229
+ [29] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. arXiv preprint arXiv:2007.00151, 2020.
230
+ [30] Michal Lukasik, Srinadh Bhojanapalli, Aditya Menon, and Sanjiv Kumar. Does label smoothing mitigate label noise? In International Conference on Machine Learning, pages 6448–6458. PMLR, 2020.
231
+ [31] Hartmut Maennel, Ibrahim Alabdulmohsin, Ilya Tolstikhin, Robert JN Baldock, Olivier Bousquet, Sylvain Gelly, and Daniel Keysers. What do neural networks learn when trained with random labels? arXiv preprint arXiv:2006.10455, 2020.
232
+ [32] Baharan Mirzasoleiman, Kaidi Cao, and Jure Leskovec. Coresets for robust training of neural networks against noisy labels. arXiv preprint arXiv:2011.07451, 2020.
233
+ [33] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1944–1952, 2017.
234
+ [34] Geoff Pleiss, Tianyi Zhang, Ethan R Elenberg, and Kilian Q Weinberger. Identifying mislabeled data using the area under the margin ranking. arXiv preprint arXiv:2001.10528, 2020.
235
+ [35] Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
236
+ [36] Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In International Conference on Machine Learning, pages 4334–4343. PMLR, 2018.
237
+ [37] Hwanjun Song, Minseok Kim, Dongmin Park, and Jae-Gil Lee. Prestopping: How does early stopping help generalization against label noise?, 2020.
238
+ [38] Brendan Van Rooyen, Aditya Krishna Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. arXiv preprint arXiv:1505.07634, 2015.
239
+ [39] Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 839–847, 2017.
240
+ [40] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 322–330, 2019.
241
+ [41] Yi Wei, Xue Mei, Xin Liu, and Pengxiang Xu. Dst: Data selection and joint training for learning with noisy labels. arXiv preprint arXiv:2103.00813, 2021.
242
+ [42] Pengxiang Wu, Songzhu Zheng, Mayank Goswami, Dimitris Metaxas, and Chao Chen. A topological filter for learning with label noise. arXiv preprint arXiv:2012.04835, 2020.
243
+ [43] Xiaobo Xia, Tongliang Liu, Bo Han, Chen Gong, Nannan Wang, Zongyuan Ge, and Yi Chang. Robust early-learning: Hindering the memorization of noisy labels. In International Conference on Learning Representations, 2021.
244
+ [44] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2691–2699, 2015.
245
+ [45] Yilun Xu, Peng Cao, Yuqing Kong, and Yizhou Wang. L_dmi: A novel information-theoretic loss function for training deep nets robust to label noise. In NeurIPS, pages 6222–6233, 2019.
246
+ [46] Seunghan Yang, Hyoungseob Park, Junyoung Byun, and Changick Kim. Robust federated learning with noisy labels, 2020.
247
+ [47] Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor W Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? arXiv preprint arXiv:1901.04215, 2019.
248
+ [48] Xiyu Yu, Tongliang Liu, Mingming Gong, and Dacheng Tao. Learning with biased complementary labels. In Proceedings of the European conference on computer vision (ECCV), pages 68–83, 2018.
249
+ [49] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
250
+ [50] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
251
+ [51] Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. arXiv preprint arXiv:1805.07836, 2018.
252
+ [52] Zizhao Zhang, Han Zhang, Sercan O Arik, Honglak Lee, and Tomas Pfister. Distilling effective supervision from severe label noise. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9294–9303, 2020.
253
+ [53] Zizhao Zhang, Han Zhang, Sercan O. Arik, Honglak Lee, and Tomas Pfister. Distilling effective supervision from severe label noise. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
md/train/S1ANxQW0b/S1ANxQW0b.md ADDED
@@ -0,0 +1,747 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MAXIMUM A POSTERIORI POLICY OPTIMISATION
2
+
3
+ Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos,
4
+ Nicolas Heess, Martin Riedmiller
5
+ DeepMind, London, UK
6
+ {aabdolmaleki,springenberg,tassa,munos,heess,riedmiller}@google.com
7
+
8
+ # ABSTRACT
9
+
10
+ We introduce a new algorithm for reinforcement learning called Maximum aposteriori Policy Optimisation (MPO) based on coordinate ascent on a relativeentropy objective. We show that several existing methods can directly be related to our derivation. We develop two off-policy algorithms and demonstrate that they are competitive with the state-of-the-art in deep reinforcement learning. In particular, for continuous control, our method outperforms existing methods with respect to sample efficiency, premature convergence and robustness to hyperparameter settings.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ Model free reinforcement learning algorithms can acquire sophisticated behaviours by interacting with the environment while receiving simple rewards. Recent experiments (Mnih et al., 2015; Jaderberg et al., 2016; Heess et al., 2017) successfully combined these algorithms with powerful deep neural-network approximators while benefiting from the increase of compute capacity.
15
+
16
+ Unfortunately, the generality and flexibility of these algorithms comes at a price: They can require a large number of samples and – especially in continuous action spaces – suffer from high gradient variance. Taken together these issues can lead to unstable learning and/or slow convergence. Nonetheless, recent years have seen significant progress, with improvements to different aspects of learning algorithms including stability, data-efficiency and speed, enabling notable results on a variety of domains, including locomotion (Heess et al., 2017; Peng et al., 2016), multi-agent behaviour (Bansal et al., 2017) and classical control (Duan et al., 2016).
17
+
18
+ Two types of algorithms currently dominate scalable learning for continuous control problems: First, Trust-Region Policy Optimisation (TRPO; Schulman et al. 2015) and the derivative family of Proximal Policy Optimisation algorithms (PPO; Schulman et al. 2017b). These policy-gradient algorithms are on-policy by design, reducing gradient variance through large batches and limiting the allowed change in parameters. They are robust, applicable to high-dimensional problems, and require moderate parameter tuning, making them a popular first choice (Ho & Ermon, 2016). However, as on-policy algorithms, they suffer from poor sample efficiency.
19
+
20
+ In contrast, off-policy value-gradient algorithms such as the Deep Deterministic Policy Gradient (DDPG, Silver et al. 2014; Lillicrap et al. 2016), Stochastic Value Gradient (SVG, Heess et al. 2015), and the related Normalized Advantage Function formulation (NAF, Gu et al. 2016b) rely on experience replay and learned (action-)value functions. These algorithms exhibit much better data efficiency, approaching the regime where experiments with real robots are possible (Gu et al., 2016a; Andrychowicz et al., 2017). While also popular, these algorithms can be difficult to tune, especially for high-dimensional domains like general robot manipulation tasks.
21
+
22
+ In this paper we propose a novel off-policy algorithm that benefits from the best properties of both classes. It exhibits the scalability, robustness and hyperparameter insensitivity of on-policy algorithms, while offering the data-efficiency of off-policy, value-based methods.
23
+
24
+ To derive our algorithm, we take advantage of the duality between control and estimation by using Expectation Maximisation (EM), a powerful tool from the probabilistic estimation toolbox, in order to solve control problems. This duality can be understood as replacing the question “what are the actions which maximise future rewards?” with the question “assuming future success in maximising rewards, what are the actions most likely to have been taken?”. By using this estimation objective we have more control over the policy change in both E and M steps, yielding robust learning. We show below that several algorithms, including TRPO, can be directly related to this perspective. We leverage the fast convergence properties of EM-style coordinate ascent by alternating a nonparametric data-based E-step which re-weights state-action samples, with a supervised, parametric M-step using deep neural networks.
25
+
26
+ We evaluate our algorithm on a broad spectrum of continuous control problems including a 56 DoF humanoid body. All experiments used the same optimisation hyperparameters 1. Our algorithm shows remarkable data efficiency often solving the tasks we consider an order of magnitude faster than the state-of-the-art. A video of some resulting behaviours can be found here dropbox.com/s/pgcmjst7t0zwm4y/MPO.mp4.
27
+
28
+ # 2 BACKGROUND AND NOTATION
29
+
30
+ # 2.1 RELATED WORK
31
+
32
+ Casting Reinforcement Learning (RL) as an inference problem has a long history dating back at least two decades (Dayan & Hinton, 1997). The framework presented here is inspired by a variational inference perspective on RL that has previously been utilised in multiple studies; c.f. Dayan & Hinton (1997); Neumann (2011); Deisenroth et al. (2013); Rawlik et al. (2012); Levine & Koltun (2013); Florensa et al. (2017).
33
+
34
+ Particular attention has been paid to obtaining maximum entropy policies as the solution to an inference problem. The penalisation of determinism can be seen encouraging both robustness and simplicity. Among these are methods that perform trajectory optimisation using either linearised dynamics (Todorov, 2008; Toussaint, 2009; Levine & Koltun, 2013) or general dynamics as in path integral control (Kappen, 2005; Theodorou et al., 2010). In contrast to these algorithms, here we do not assume the availability of a transition model and avoid on-policy optimisation. A number of other authors have considered the same perspective but in a model-free RL setting (Neumann, 2011; Peters et al., 2010a; Florensa et al., 2017; Daniel et al., 2016) or inverse RL problems (Ziebart et al., 2008). These algorithms are more directly related to our work and can be cast in the same (EM-like) alternating optimisation scheme on which we base our algorithm. However, they typically lack the maximisation (M)-step – with the prominent exception of REPS, AC-REPS, $\mathrm { P \bar { I } ^ { 2 } }$ -GPS and MDGPS (Peters et al., 2010a; Wirth et al., 2016; Chebotar et al., 2016; Montgomery & Levine, 2016) to which our algorithm is closely related as outlined below. An interesting recent addition to these approaches is an EM-perspective on the PoWER algorithm (Roux, 2016) which uses the same iterative policy improvement employed here, but commits to parametric inference distributions and avoids an exponential reward transformation, resulting in a harder to optimise lower bound.
35
+
36
+ As an alternative to these policy gradient inspired algorithms, the class of recent algorithms for soft Q-learning (e.g. Rawlik et al. (2012); Haarnoja et al. (2017); Fox et al. (2016) parameterise and estimate a so called “soft” Q-function directly, implicitly inducing a maximum entropy policy. A perspective that can also be extended to hierarchical policies (Florensa et al., 2017), and has recently been used to establish connections between Q-learning and policy gradient methods (O’Donoghue et al., 2016; Schulman et al., 2017a). In contrast, we here rely on a parametric policy, our bound and derivation is however closely related to the definition of the soft (entropy regularised) Q-function.
37
+
38
+ A line of work, that is directly related to the “RL as inference” perspective, has focused on using information theoretic regularisers such as the entropy of the policy or the Kullback-Leibler divergence (KL) between policies to stabilise standard RL objectives. In fact, most state-of-the-art policy gradient algorithms fall into this category. For example see the entropy regularization terms used in Mnih et al. (2016) or the KL constraints employed by work on trust-region based methods (Schulman et al., 2015; 2017b; Gu et al., 2017; Wang et al., 2017). The latter methods introduce a trust region constraint, defined by the KL divergence between the new policy and the old policy, so that the expected KL divergence over state space is bounded. From the perspective of this paper these trust-region based methods can be seen as optimising a parametric E-step, as in our algorithm, but are “missing” an explicit M-step.
39
+
40
+ Finally, the connection between RL and inference has been invoked to motivate work on exploration. The most prominent examples for this are formed by work on Boltzmann exploration such as Kaelbling et al. (1996); Perkins & Precup (2002); Sutton (1990); O’Donoghue et al. (2017), which can be connected back to soft Q-learning (and thus to our approach) as shown in Haarnoja et al. (2017).
41
+
42
+ # 2.2 MARKOV DECISION PROCESSES
43
+
44
+ We consider the problem of finding an optimal policy $\pi$ for a discounted reinforcement learning (RL) problem; formally characterized by a Markov decision process (MDP). The MDP consists of: continuous states $s$ , actions $a$ , transition probabilities $p ( s _ { t + 1 } | s _ { t } , a _ { t } )$ – specifying the probability of transitioning from state $s _ { t }$ to $s _ { t + 1 }$ under action $a _ { t } \textrm { -- }$ , a reward function $r ( s , a ) \in \mathbb { R }$ as well as the discounting factor $\gamma \in [ 0 , 1 )$ . The policy $\pi ( a | s , \theta )$ (with parameters $\pmb { \theta }$ ) is assumed to specify a probability distribution over action choices given any state and – together with the transition probabilities – gives rise to the stationary distribution $\mu _ { \pi } ( s )$ .
45
+
46
+ Using these basic quantities we can now define the notion of a Markov sequence or trajec$\overline { { \tau } } _ { \pi } ~ = ~ \{ ( s _ { 0 } , a _ { 0 } ) \} \ldots ( s _ { T } , a _ { T } ) \}$ by following the policy ; and the expected return $\pi$ $\begin{array} { r } { \tau _ { \pi } ~ \sim ~ p _ { \pi } ( \tau ) } \end{array}$ with. We $\begin{array} { r } { p _ { \pi } ( \tau ) = p ( s _ { 0 } ) \prod _ { t > 0 } p ( s _ { t + 1 } \vert s _ { t } , a _ { t } ) \pi ( a _ { t } \vert s _ { t } ) ; } \end{array}$ $\begin{array} { r } { \mathbb { E } _ { \tau _ { \pi } } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , s _ { t } ) ] } \end{array}$ will use the shorthand $r _ { t } = r ( s _ { t } , a _ { t } )$ .
47
+
48
+ # 3 MAXIMUM A POSTERIORI POLICY OPTIMISATION
49
+
50
+ Our approach is motivated by the well established connection between RL and probabilistic inference. This connection casts the reinforcement learning problem as that of inference in a particular probabilistic model. Conventional formulations of RL aim to find a trajectory that maximizes expected reward. In contrast, inference formulations start from a prior distribution over trajectories, condition a desired outcome such as achieving a goal state, and then estimate the posterior distribution over trajectories consistent with this outcome.
51
+
52
+ A finite-horizon undiscounted reward formulation can be cast as inference problem by constructing a suitable probabilistic model via a likelihood function $p ( O = 1 | \tau ) \propto \mathrm { e x p } ( \Sigma _ { t } r _ { t } / \alpha )$ , where $\alpha$ is a temperature parameter. Intuitively, $O$ can be interpreted as the event of obtaining maximum reward by choosing an action; or the event of succeeding at the RL task (Toussaint, 2009; Neumann, 2011). With this definition we can define the following lower bound on the likelihood of optimality for the policy $\pi$ :
53
+
54
+ $$
55
+ \begin{array} { l } { \displaystyle \log p _ { \pi } ( O = 1 ) = \log \int p _ { \pi } ( \tau ) p ( O = 1 | \tau ) d \tau \geq \int q ( \tau ) \big [ \log p ( O = 1 | \tau ) + \log \frac { p _ { \pi } ( \tau ) } { q ( \tau ) } \big ] d \tau } \\ { \displaystyle \qquad = \mathbb { E } _ { q } \Big [ \sum _ { t } r _ { t } / \alpha \Big ] - \mathrm { K L } \Big ( q ( \tau ) | | p _ { \pi } ( \tau ) \Big ) = \mathcal { I } ( q , \pi ) , } \end{array}
56
+ $$
57
+
58
+ where $p _ { \pi }$ is the trajectory distribution induced by policy $\pi ( a | s )$ as described in section 2.2 and $q ( \tau )$ is an auxiliary distribution over trajectories that will discussed in more detail below. The lower bound $\mathcal { I }$ is the evidence lower bound (ELBO) which plays an important role in the probabilistic modeling literature. It is worth already noting here that optimizing (2) with respect to $q$ can be seen as a regularized RL problem.
59
+
60
+ An important motivation for transforming a RL problem into an inference problem is that this allows us draw from the rich toolbox of inference methods: For instance, $\mathcal { I }$ can be optimized with the familiy of expectation maximization (EM) algorithms which alternate between improving $\mathcal { I }$ with respect to $q$ and $\pi$ . In this paper we follow classical (Dayan & Hinton, 1997) and more recent works (e.g. Peters et al. 2010b; Levine & Koltun 2013; Daniel et al. 2016; Wirth et al. 2016) and cast policy search as a particular instance of this family. Our algorithm then combines properties of existing approaches in this family with properties of recent off-policy algorithms for neural networks.
61
+
62
+ The algorithm alternates between two phases which we refer to as E and M step in reference to an EM-algorithm. The E-step improves $\mathcal { I }$ with respect to $q$ . Existing EM policy search approaches perform this step typically by reweighting trajectories with sample returns (Kober & Peters, 2009) or via local trajectory optimization (Levine & Koltun, 2013). We show how off-policy deep RL techniques and value-function approximation can be used to make this step both scalable as well as data efficient. The M-step then updates the parametric policy in a supervised learning step using the reweighted state-action samples from the E-step as targets.
63
+
64
+ These choices lead to the following desirable properties: (a) low-variance estimates of the expected return via function approximation; (b) low-sample complexity of value function estimate via robust off-policy learning; (c) minimal parametric assumption about the form of the trajectory distribution in the E-step; (d) policy updates via supervised learning in the M step; (e) robust updates via hard trust-region constraints in both the E and the M step.
65
+
66
+ # 3.1 POLICY IMPROVEMENT
67
+
68
+ The derivation of our algorithm then starts from the infinite-horizon analogue of the KL-regularized expected reward objective from Equation (2). In particular, we consider variational distributions $q ( \tau )$ that factor in the same way as $p _ { \pi }$ , i.e. $\begin{array} { r } { q ( \tau ) = \bar { p } ( s _ { 0 } ) \prod _ { t > 0 } p ( s _ { t + 1 } | s _ { t } , a _ { t } ) q ( a _ { t } | s _ { t } ) } \end{array}$ which yields:
69
+
70
+ $$
71
+ \mathcal { I } ( \boldsymbol { q } , \theta ) = \mathbb { E } _ { \boldsymbol { q } } \Big [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \big [ r _ { t } - \alpha \mathbf { K L } \big ( \boldsymbol { q } ( \boldsymbol { a } | s _ { t } ) \| \pi ( \boldsymbol { a } | s _ { t } , \theta ) \big ) \big ] \Big ] + \log p ( \theta ) .
72
+ $$
73
+
74
+ Note that due to the assumption about the structure of $q ( \tau )$ the $\mathrm { K L }$ over trajectories decomposes into a KL over the individual state-conditional action distributions. This objective has also been considered e.g. by Haarnoja et al. (2017); Schulman et al. (2017a). The additional $\log p ( \pmb \theta )$ term is a prior over policy parameters and can be motivated by a maximum a-posteriori estimation problem (see appendix for more details).
75
+
76
+ We also define the regularized Q-value function associated with (3) as
77
+
78
+ $$
79
+ Q _ { \theta } ^ { q } ( s , a ) = r _ { 0 } + \mathbb { E } _ { q ( \tau ) , s _ { 0 } = s , a _ { 0 } = a } \left[ \sum _ { t \geq 1 } ^ { \infty } \gamma ^ { t } \big [ r _ { t } - \alpha \mathrm { K L } ( q _ { t } \| \pi _ { t } ) \big ] \right] ,
80
+ $$
81
+
82
+ with $\mathrm { K L } \big ( q _ { t } | | \pi _ { t } \big ) = \mathrm { K L } \big ( q ( a | s _ { t } ) \big ) \| \pi ( a | s _ { t } , \pmb { \theta } ) \big )$ . Note that $\mathrm { K L } \big ( q _ { 0 } | | \pi _ { 0 } \big )$ and $p ( \theta )$ are not part of the Q-function as they are not a function of the action.
83
+
84
+ We observe that optimizing $\mathcal { I }$ with respect to $q$ is equivalent to solving an expected reward RL problem with augmented reward $\begin{array} { r } { \tilde { r } _ { t } = r _ { t } - \alpha \log \frac { q ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } , \pmb { \theta } ) } } \end{array}$ . In this view $\pi$ represents a default policy towards which $q$ is regularized – i.e. the current best policy. The MPO algorithm treats $\pi$ as the primary object of interest. In this case $q$ serves as an auxiliary distribution that allows optimizing $\mathcal { I }$ via alternate coordinate ascent in $q$ and $\pi _ { \pmb { \theta } }$ , analogous to the expectation-maximization algorithm in the probabilistic modelling literature. In our case, the E-step optimizes $\mathcal { I }$ with respect to $q$ while the M-step optimizes $\mathcal { I }$ with respect to $\pi$ . Different optimizations in the $\mathrm { E }$ -step and M-step lead to different algorithms. In particular, we note that for the case where $p ( \pmb \theta )$ is an uninformative prior a variant of our algorithm has a monotonic improvement guarantee as show in the Appendix A.
85
+
86
+ # 3.2 E-STEP
87
+
88
+ In the E-step of iteration $i$ we perform a partial maximization of $\mathcal { I } ( \boldsymbol { q } , \boldsymbol { \theta } )$ with respect to $q$ given $\theta = \theta _ { i }$ . We start by setting $q = \pi _ { \pmb { \theta } _ { i } }$ and estimate the unregularized action-value function:
89
+
90
+ $$
91
+ Q _ { \theta _ { i } } ^ { q } ( s , a ) = Q _ { \theta _ { i } } ( s , a ) = \mathbb { E } _ { \tau _ { \pi _ { i } } , s _ { 0 } = s , a _ { 0 } = a } \left[ \sum _ { t } ^ { \infty } \gamma ^ { t } r _ { t } \right] ,
92
+ $$
93
+
94
+ since $\mathrm { K L } ( q | | \pi _ { i } ) = 0$ . In practice we estimate $Q _ { \pmb { \theta } _ { i } }$ from off-policy data (we refer to Section 4 for details about the policy evaluation step). This greatly increases the data efficiency of our algorithm. Given $Q _ { \pmb { \theta } _ { i } }$ we improve the lower bound $\mathcal { I }$ w.r.t. $q$ by first expanding $Q _ { \theta _ { i } } ( s , a )$ via the regularized Bellman operator $\begin{array} { r } { T ^ { \pi , q } = \mathbb { E } _ { q ( a \mid s ) } \Big [ r ( s , a ) - \alpha \mathbf { K L } ( q \| \pi _ { i } ) + \gamma \mathbb { E } _ { p ( s ^ { \prime } \mid s , a ) } [ V _ { \pmb { \theta } _ { i } } ( s ^ { \prime } ) ] \Big ] . } \end{array}$ , and optimize the “one-step” KL regularised objective
95
+
96
+ $$
97
+ \begin{array} { l } { \displaystyle \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } \bar { \mathcal { T } } _ { s } ( \boldsymbol { q } , \theta _ { i } ) = \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } T ^ { \pi , { q } } Q _ { \theta _ { i } } ( s , \boldsymbol { a } ) } \\ { \displaystyle \mathop { \quad = } \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \Big [ \mathbb { E } _ { \boldsymbol { q } ( \cdot \vert s ) } [ Q _ { \theta _ { i } } ( s , \boldsymbol { a } ) ] - \alpha \mathbf { K } \mathbf { L } ( \boldsymbol { q } \| \pi _ { i } ) \Big ] , } \end{array}
98
+ $$
99
+
100
+ since $V _ { \pmb { \theta } _ { i } } ( s ) = \mathbb { E } _ { q ( a | s } [ Q _ { \pmb { \theta } _ { i } } ( s , a ) ]$ and thus $Q _ { \pmb { \theta } _ { i } } ( s , a ) = r ( s , a ) + \gamma V _ { \pmb { \theta } _ { i } } ( s ) .$ .
101
+
102
+ Maximizing Equation (6), thus obtaining $q _ { i } = \arg \operatorname* { m a x } \bar { \mathcal { I } } ( q , \theta _ { i } )$ , does not fully optimize $\mathcal { I }$ since we treat $Q _ { \theta _ { i } }$ as constant with respect to $q$ . An intuitive interpretation $q _ { i }$ is that it chooses the softoptimal action for one step and then resorts to executing policy $\pi$ . In the language of the EM algorithm this optimization implements a partial E-step. In practice we also choose $\mu _ { q }$ to be the stationary distribution as given through samples from the replay buffer.
103
+
104
+ # CONSTRAINED E-STEP
105
+
106
+ The reward and the KL terms are on an arbitray relative scale. This can make it difficult to choose $\alpha$ . We therefore replace the soft KL regularization with a hard constraint with parameter $\epsilon$ , i.e,
107
+
108
+ $$
109
+ \begin{array} { r l } & { \underset { q } { \operatorname* { m a x } } \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \left[ \mathbb { E } _ { q ( a \mid s ) } \left[ Q _ { \boldsymbol { \theta } _ { i } } ( s , a ) \right] \right] } \\ & { s . t . \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \left[ { \mathbf { K L } } ( q ( a \mid s ) , \pi ( a \mid s , \boldsymbol { \theta } _ { i } ) ) \right] < \epsilon . } \end{array}
110
+ $$
111
+
112
+ If we choose to explicitly parameterize $q ( a | s ) -$ option 1 below – the resulting optimisation is similar to that performed by the recent TRPO algorithm for continuous control (Schulman et al., 2015); only in an off-policy setting. Analogously, the unconstrained objective (6) is similar to the objective used by PPO (Schulman et al., 2017b). We note, however, that the KL is reversed when compared to the KL used by TRPO and PPO.
113
+
114
+ To implement (7) we need to choose a form for the variational policy $q ( a | s )$ . Two options arise:
115
+
116
+ 1. We can use a parametric variational distribution $q ( a | s , \pmb \theta ^ { q } )$ , with parameters $\pmb { \theta } ^ { q }$ , and optimise Equation (7) via the likelihood ratio or action-value gradients. This leads to an algorithm similar to TRPO/PPO and an explicit M-step becomes unnecessary (see. Alg. 3). 2. We can choose a non-parametric representation of $q ( a | s )$ given by one probability factor per sample. To achieve generalization in state space we then fit a parametric policy in the M-step.
117
+
118
+ Fitting a parametric policy in the M-step is a supervised learning problem, allowing us to employ various regularization techniques at that point. It also makes it easier to enforce the hard KL constraint.
119
+
120
+ # NON PARAMETRIC VARIATIONAL DISTRIBUTION
121
+
122
+ In the non-parametric case we can obtain the optimal sample based $q$ distribution – the solution to Equation (7) – in closed form (see the appendix for a full derivation), as,
123
+
124
+ $$
125
+ q _ { i } ( a | s ) \propto \pi ( a | s , \pmb { \theta } _ { i } ) \exp \Big ( \frac { Q _ { \theta _ { i } } ( s , a ) } { \eta ^ { * } } \Big ) ,
126
+ $$
127
+
128
+ where we can obtain $\eta ^ { * }$ by minimising the following convex dual function,
129
+
130
+ $$
131
+ g ( \eta ) = \eta \epsilon + \eta \int \mu ( s ) \log \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp \Big ( \frac { Q _ { \theta _ { i } } ( s , a ) } { \eta } \Big ) d a d s ,
132
+ $$
133
+
134
+ after the optimisation of which we can evaluate $q _ { i } ( a | s )$ on given samples.
135
+
136
+ This optimization problem is similar to the one solved by relative entropy policy search (REPS) (Peters et al., 2010a) with the difference that we optimise only for the conditional variational distribution $q ( a | s )$ instead of a joint distribution $\scriptstyle q ( a , s )$ – effectively fixing $\mu _ { q } ( s )$ to the stationary distribution given by previously collected experience – and we use the $\mathrm { Q }$ function of the old policy to evaluate the integral over $a$ . While this might seem unimportant it is crucial as it allows us to estimate the integral over actions with multiple samples without additional environment interaction. This greatly reduces the variance of the estimate and allows for fully off-policy learning at the cost of performing only a partial optimization of $\mathcal { I }$ as described above.
137
+
138
+ # 3.3 M-STEP
139
+
140
+ Given $q _ { i }$ from the E-step we can optimize the lower bound $\mathcal { I }$ with respect to $\pmb \theta$ to obtain an updated policy $\pmb { \theta } _ { i + 1 } = \arg \operatorname* { m a x } _ { \pmb { \theta } } \mathcal { I } ( q _ { i } , \pmb { \theta } )$ . Dropping terms independent of $\pmb { \theta }$ this entails solving for the solution of
141
+
142
+ $$
143
+ \operatorname* { m a x } _ { \theta } \mathcal { I } ( q _ { i } , \theta ) = \operatorname* { m a x } _ { \theta } \mathbb { E } _ { \mu _ { q } ( s ) } \Big [ \mathbb { E } _ { q ( a | s ) } \Big [ \log \pi ( a | s , \theta ) \Big ] \Big ] + \log p ( \theta ) ,
144
+ $$
145
+
146
+ which corresponds to a weighted maximum a-posteriroi estimation (MAP) problem where samples are weighted by the variational distribution from the E-step. Since this is essentially a supervised learning step we can choose any policy representation in combination with any prior for regularisation. In this paper we set $p ( \pmb \theta )$ to a Gaussian prior around the current policy, i.e, $\begin{array} { r } { p ( \pmb { \theta } ) \approx \mathcal { N } \Big ( \mu = \pmb { \theta } _ { i } , \Sigma = \frac { F _ { \pmb { \theta } _ { i } } } { \lambda } \Big ) } \end{array}$ , where $\pmb \theta _ { i }$ are the parameters of the current policy distribution, $F _ { \pmb { \theta } _ { i } }$ is the empirical Fisher information matrix and $\lambda$ is a positive scalar. As shown in the appendix this suggests the following generalized M-step:
147
+
148
+ $$
149
+ \operatorname* { m a x } _ { \pi } \mathbb { E } _ { \mu _ { q } ( s ) } \Big [ \mathbb { E } _ { q ( a | s ) } \Big [ \log \pi ( a | s , \pmb { \theta } ) \Big ] - \lambda \mathrm { K L } \Big ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) \Big ) \Big ]
150
+ $$
151
+
152
+ which can be re-written as the hard constrained version:
153
+
154
+ $$
155
+ \begin{array} { r } { \underset { \pi } { \operatorname* { m a x } } \mathbb { E } _ { \mu _ { q } ( s ) } \left[ \mathbb { E } _ { q ( a | s ) } \left[ \log \pi ( a | s , \pmb { \theta } ) \right] \right] } \\ { s . t . \mathbb { E } _ { \mu _ { q } ( s ) } \left[ { \mathbf { K L } } ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) ) \right] < \epsilon . } \end{array}
156
+ $$
157
+
158
+ This additional constraint minimises the risk of overfitting the samples, i.e. it helps us to obtain a policy that generalises beyond the state-action samples used for the optimisation. In practice we have found the KL constraint in the M step to greatly increase stability of the algorithm. We also note that in the E-step we are using the reverse, mode-seeking, KL while in the M-step we are using the forward, moment-matching, KL which reduces the tendency of the entropy of the parametric policy to collapse. This is in contrast to other RL algorithms that use M-projection without KL constraint to fit a parametric policy (Peters et al., 2010a; Wirth et al., 2016; Chebotar et al., 2016; Montgomery & Levine, 2016). Using KL constraint in M-step has also been shown effective for stochastic search algorithms (Abdolmaleki et al., 2017).
159
+
160
+ # 4 POLICY EVALUATION
161
+
162
+ Our method is directly applicable in an off-policy setting. For this, we have to rely on a stable policy evaluation operator to obtain a parametric representation of the Q-function $Q _ { \theta } ( s , a )$ . We make use of the policy evaluation operator from the Retrace algorithm Munos et al. (2016), which we found to yield stable policy evaluation in practice2. Concretely, we fit the Q-function $Q _ { \theta _ { i } } ( s , a , \phi )$ as represented by a neural network, with parameters $\phi$ , by minimising the squared loss:
163
+
164
+ $$
165
+ \begin{array} { l } { \displaystyle \mathop { \operatorname* { m i n } } _ { \phi } L ( \phi ) = \mathop { \operatorname* { m i n } } _ { \phi } \mathbb { E } _ { \mu _ { b } ( s ) , b ( a | s ) } \left[ \left( Q _ { \theta _ { i } } ( s _ { t } , a _ { t } , \phi ) - Q _ { t } ^ { \mathrm { r e t } } \right) ^ { 2 } \right] , \mathrm { w i t h } } \\ { \displaystyle Q _ { t } ^ { \mathrm { r e t } } = Q _ { \phi ^ { \prime } } ( s _ { t } , a _ { t } ) + \sum _ { j = t } ^ { \infty } \gamma ^ { j - t } \Big ( \prod _ { k = t + 1 } ^ { j } c _ { k } \Big ) \left[ r ( s _ { j } , a _ { j } ) + \mathbb { E } _ { \pi ( a | s _ { j + 1 } ) } [ Q _ { \phi ^ { \prime } } ( s _ { j + 1 } , a ) ] - Q _ { \phi ^ { \prime } } ( s _ { j } , a _ { j } ) \right] , } \\ { \displaystyle c _ { k } = \operatorname* { m i n } \Big ( 1 , \frac { \pi ( a _ { k } | s _ { k } ) } { b ( a _ { k } | s _ { k } ) } \Big ) , } \end{array}
166
+ $$
167
+
168
+ where $Q _ { \phi ^ { \prime } } ( s , a )$ denotes the output of a target Q-network, with parameters $\phi ^ { \prime }$ , that we copy from the current parameters $\phi$ after each M-step. We truncate the infinite sum after $N$ steps by bootstrapping with $Q _ { \phi ^ { \prime } }$ (rather than considering a $\lambda$ return). Additionally, $b ( a | s )$ denotes the probabilities of an arbitrary behaviour policy. In our case we use an experience replay buffer and hence $b$ is given by the action probabilities stored in the buffer; which correspond to the action probabilities at the time of action selection.
169
+
170
+ # 5 EXPERIMENTS
171
+
172
+ For our experiments we evaluate our MPO algorithm across a wide range of tasks. Specifically, we start by looking at the continuous control tasks of the DeepMind Control Suite (Tassa et al. (2018), see Figure 1), and then consider the challenging parkour environments recently published in Heess et al. (2017). In both cases we use a Gaussian distribution for the policy whose mean and covariance are parameterized by a neural network (see appendix for details). In addition, we present initial experiments for discrete control using ATARI environments using a categorical policy distribution (whose logits are again parameterized by a neural network) in the appendix.
173
+
174
+ # 5.1 EVALUATION ON CONTROL SUITE
175
+
176
+ ![](images/754c06df74f11ccb9772163bdb2d3c935cb2cba2b5b65def9b07cd08ab62b078.jpg)
177
+ Figure 1: Control Suite domains used for benchmarking. Top: Acrobot, Ball-in-cup, Cart-pole, Cheetah, Finger, Fish, Hopper. Bottom: Humanoid, Manipulator, Pendulum, Point-mass, Reacher, Swimmers (6 and 15 links), Walker.
178
+
179
+ The suite of continuous control tasks that we are evaluating against contains 18 tasks, comprising a wide range of domains including well known tasks from the literature. For example, the classical cart-pole and acrobot dynamical systems, 2D and Humanoid walking as well as simple low-dimensional planar reaching and manipulation tasks. This suite of tasks was built in python on top of mujoco and will also be open sourced to the public by the time of publication.
180
+
181
+ While we include plots depicting the performance of our algorithm on all tasks below; comparing it against the state-of-the-art algorithms in terms of data-efficiency. We want to start by directing the attention of the reader to a more detailed evaluation on three of the harder tasks from the suite.
182
+
183
+ 5.1.1 DETAILED ANALYSIS ON WALKER-2D, ACROBOT, HOPPER
184
+
185
+ We start by looking at the results for the classical Acrobot task (two degrees of freedom, one continuous action dimension) as well as the 2D walker (which has 12 degrees of freedom and thus a 12 dimensional action space and a 21 dimensional state space) and the hopper standing task. The reward in the Acrobot task is the distance of the robots end-effector to an upright position of the underactuated system. For the walker task it is given by the forward velocity, whereas in the hopper the requirement is to stand still.
186
+
187
+ Figure 2 shows the results for this task obtained by applying our algorithm MPO as well as several ablations – in which different parts were removed from the MPO optimization – and two baselines: our implementation of Proximal Policy Optimization (PPO) (Schulman et al., 2017b) and DDPG. The hyperparameters for MPO were kept fixed for all experiments in the paper (see the appendix for hyperparameter settings).
188
+
189
+ As a first observation, we can see that MPO gives stable learning on all tasks and, thanks to its fully off-policy implementation, is significantly more sample efficient than the on-policy PPO baseline. Furthermore, we can observe that changing from the non-parametric variational distribution to a parametric distribution3 (which, as described above, can be related to PPO) results in only a minor asymptotic performance loss but slowed down optimisation and thus hampered sample efficiency; which can be attributed to the fact that the parametric $q$ distribution required a stricter KL constraint. Removing the automatically tuned KL constraint and replacing it with a manually set entropy regulariser then yields an off-policy actor-critic method with Retrace. This policy gradient method still uses the idea of estimating the integral over actions – and thus, for a gradient based optimiser, its likelihood ratio derivative – via multiple action samples (as judged by a Q-Retrace critic). This idea has previously been coined as using the expected policy gradient (EPG) (Ciosek & Whiteson, 2017) and we hence denote the corresponding algorithm with EPG $^ +$ Retrace, which no-longer follows the intuitions of the MPO perspective. $\mathrm { E P G } + .$ Retrace performed well when the correct entropy regularisation scale is used. This, however, required task specific tuning (c.f. Figure 4 where this hyperparameter was set to the one that performed best in average across tasks). Finally using only a single sample to estimate the integral (and hence the likelihood ratio gradient) results in an actor-critic variant with Retrace that is the least performant off-policy algorithm in our comparison.
190
+
191
+ ![](images/c77b362823bc448bf6268c862a2c6ae8c0cbe92c11eed9cb0fed52cbb3223fbf.jpg)
192
+ Figure 2: Ablation study of the MPO algorithm and comparison to common baselines from the literature on three domains from the control suite. We plot the median performance over 10 experiments with different random seeds.
193
+
194
+ # 5.1.2 COMPLETE RESULTS ON THE CONTROL SUITE
195
+
196
+ The results for MPO (non-parameteric) – and a comparison to an implementation of state-of-the-art algorithms from the literature in our framework – on all the environments from the control suite that we tested on are shown in Figure 4. All tasks have rewards that are scaled to be between 0 and 1000. We note that in order to ensure a fair comparison all algorithms ran with exactly the same network configuration, used a single learner (no distributed computation), used the same optimizer and were tuned w.r.t. their hyperparameters for best performance across all tasks. We refer to the appendix for a complete description of the hyperparameters. Our comparison is made in terms of data-efficiency.
197
+
198
+ From the plot a few trends are readily apparent: i) We can clearly observe the advantage in terms of data-efficiency that methods relying on a Q-critic obtain over the PPO baseline. This difference is so extreme that in several instances the PPO baseline converges an order of magnitude slower than the off-policy algorithms and we thus indicate the asymptotic performance of each algorithm of PPO and DDPG (which also improved significantly later during training in some instances) with a colored star in the plot; ii) the difference between the MPO results and the (expected) policy gradient (EPG) with entropy regularisation confirm our suspicion from Section 5.1.1: finding a good setting for the entropy regulariser that transfers across environments without additional constraints on the policy distribution is very difficult, leading to instabilities in the learning curves. In contrast to this the MPO results appear to be stable across all environments; iii) Finally, in terms of data-efficiency the methods utilising Retrace obtain a clear advantage over DDPG. The single learner vanilla DDPG implementation learns the lower dimensional environments quickly but suffers in terms of learning speed in environments with sparse rewards (finger, acrobot) and higher dimensional action spaces. Overall, MPO is able to solve all environments using surprisingly moderate amounts of data. On average less than 1000 trajectories (or $1 0 ^ { 6 }$ samples) are needed to reach the best performance.
199
+
200
+ # 5.2 HIGH-DIMENSIONAL CONTINUOUS CONTROL
201
+
202
+ Next we turn to evaluating our algorithm on two higher-dimensional continuous control problems; humanoid and walker. To make computation time bearable in these more complicated domains we utilize a parallel variant of our algorithm: in this implementation K learners are all independently collecting data from an instance of the environment. Updates are performed at the end of each collected trajectory using distributed synchronous gradient descent on a shared set of policy and Q-function parameters (we refer to the appendix for an algorithm description). The results of this experiment are depicted in Figure 3.
203
+
204
+ For the Humanoid running domain we can observe a similar trend to the experiments from the previous section: MPO quickly finds a stable running policy, outperforming all other algorithms in terms of sample efficiency also in this high-dimensional control problem.
205
+
206
+ The case for the Walker-2D parkour domain (where we compare against a PPO baseline) is even more striking: where standard PPO requires approximately 1M trajectories to find a good policy MPO finds a solution that is asymptotically no worse than the PPO solution in in about 70k trajectories (or 60M samples), resulting in an order of magnitude improvement. In addition to the walker experiment we have also evaluated MPO on the Parkour domain using a humanoid body (with 22 degrees of freedom) which was learned successfully (not shown in the plot, please see the supplementary video).
207
+
208
+ ![](images/3f0db1cdbd6cb97bb8fdb4b7ec7943a5ae55699354d37055db91d206400596e2.jpg)
209
+ Figure 3: MPO on high-dimensional control problems (Parkour Walker2D and Humanoid walking from control suite).
210
+
211
+ ![](images/b39b3f4bf39eeac87f2d9d9433c59fe69a73415f4747eb95d2ef18eb773ea4b6.jpg)
212
+
213
+ # 5.3 DISCRETE CONTROL
214
+
215
+ As a proof of concept – showcasing the robustness of our algorithm and its hyperparameters – we performed an experiment on a subset of the games contained contained in the "Arcade Learning Environment" (ALE) where we used the same hyperparameter settings for the KL constraints as for the continuous control experiments. The results of this experiment can be found in the Appendix.
216
+
217
+ # 6 CONCLUSION
218
+
219
+ We have presented a new off-policy reinforcement learning algorithm called Maximum a-posteriori Policy Optimisation (MPO). The algorithm is motivated by the connection between RL and inference and it consists of an alternating optimisation scheme that has a direct relation to several existing algorithms from the literature. Overall, we arrive at a novel, off-policy algorithm that is highly data efficient, robust to hyperparameter choices and applicable to complex control problems. We demonstrated the effectiveness of MPO on a large set of continuous control problems.
220
+
221
+ ![](images/1fb493111520008f89fe9fd5525df44f3315390e08daaf3a2e48f3e75e24a2a1.jpg)
222
+ Figure 4: Complete comparison of results for the control suite. We plot the median performance over 10 random seeds together with 5 and $95 \%$ quantiles (shaded area). Note that for DDPG we only plot the median to avoid clutter in the plots. For DDPG and PPO final performance is marked by a star).
223
+
224
+ # REFERENCES
225
+
226
+ Abbas Abdolmaleki, Bob Price, Nuno Lau, Luis Paulo Reis, Gerhard Neumann, et al. Deriving and improving cma-es with information geometric trust regions. Proceedings of the Genetic and Evolutionary Computation Conference, 2017.
227
+
228
+ Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay, 2017.
229
+
230
+ Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition, 2017.
231
+
232
+ Marc G. Bellemare, Will Dabney, and Rémi Munos. A distributional perspective on reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML, 2017.
233
+
234
+ Yevgen Chebotar, Mrinal Kalakrishnan, Ali Yahya, Adrian Li, Stefan Schaal, and Sergey Levine. Path integral guided policy search. CoRR, abs/1610.00529, 2016.
235
+
236
+ Kamil Ciosek and Shimon Whiteson. Expected policy gradients. CoRR, abs/1706.05374, 2017.
237
+
238
+ C. Daniel, G. Neumann, O. Kroemer, and J. Peters. Hierarchical relative entropy policy search. Journal of Machine Learning Research (JMLR), 2016.
239
+
240
+ Peter Dayan and Geoffrey E Hinton. Using expectation-maximization for reinforcement learning. Neural Computation, 9(2):271–278, 1997.
241
+
242
+ Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2):1–142, 2013.
243
+
244
+ Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1329– 1338. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id $=$ 3045390. 3045531.
245
+
246
+ Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. CoRR, abs/1704.03012, 2017.
247
+
248
+ Roy Fox, Ari Pakman, and Naftali Tishby. Taming the noise in reinforcement learning via soft updates. In Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence UAI, 2016.
249
+
250
+ Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation. arXiv preprint arXiv:1610.00633, 2016a.
251
+
252
+ Shixiang Gu, Tim Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning (ICML), 2016b.
253
+
254
+ Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E. Turner, and Sergey Levine. Qprop: Sample-efficient policy gradient with an off-policy critic. In 5th International Conference on Learning Representations (ICLR), 2017.
255
+
256
+ Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. CoRR, abs/1702.08165, 2017.
257
+
258
+ Nicolas Heess, Gregory Wayne, David Silver, Tim Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Advances in Neural Information Processing Systems (NIPS), pp. 2926–2934, 2015.
259
+
260
+ Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
261
+
262
+ Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4565–4573. Curran Associates, Inc., 2016. URL http://papers. nips.cc/paper/6391-generative-adversarial-imitation-learning. pdf.
263
+
264
+ Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks, 2016.
265
+
266
+ Leslie Pack Kaelbling, Michael L. Littman, and Andrew P. Moore. Reinforcement learning: A survey. Journal of Artificial Intelligence Research, 4:237–285, 1996.
267
+
268
+ H J Kappen. Path integrals and symmetry breaking for optimal control theory. Journal of Statistical Mechanics: Theory and Experiment, 2005.
269
+
270
+ Jens Kober and Jan Peters. Policy search for motor primitives in robotics. In Advances in neural information processing systems, pp. 849–856, 2009.
271
+
272
+ Sergey Levine and Vladlen Koltun. Variational policy search via trajectory optimization. In Advances in Neural Information Processing Systems, pp. 207–215, 2013.
273
+
274
+ 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. International Conference on Learning Representations (ICLR), 2016.
275
+
276
+ 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.
277
+
278
+ Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning (ICML), 2016.
279
+
280
+ William Montgomery and Sergey Levine. Guided policy search as approximate mirror descent. CoRR, abs/1607.04614, 2016. URL http://arxiv.org/abs/1607.04614.
281
+
282
+ Rémi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient offpolicy reinforcement learning. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems (NIPS), 2016.
283
+
284
+ Gerhard Neumann. Variational inference for policy search in changing situations. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 817–824, 2011.
285
+
286
+ Brendan O’Donoghue, Rémi Munos, Koray Kavukcuoglu, and Volodymyr Mnih. PGQ: combining policy gradient and q-learning. CoRR, abs/1611.01626, 2016.
287
+
288
+ Brendan O’Donoghue, Ian Osband, Rémi Munos, and Volodymyr Mnih. The uncertainty bellman equation and exploration. CoRR, abs/1709.05380, 2017. URL http://arxiv.org/abs/ 1709.05380.
289
+
290
+ Xue Bin Peng, Glen Berseth, and Michiel van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. ACM Transactions on Graphics (Proc. SIGGRAPH 2016), 2016.
291
+
292
+ Theodore J. Perkins and Doina Precup. A convergent form of approximate policy iteration. In Advances in Neural Information Processing Systems 15 (NIPS). MIT Press, Cambridge, MA, 2002.
293
+
294
+ Jan Peters, Katharina Mülling, and Yasemin Altün. Relative entropy policy search. In Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence (AAAI), 2010a.
295
+
296
+ Jan Peters, Katharina Mülling, and Yasemin Altun. Relative entropy policy search. In AAAI. Atlanta, 2010b.
297
+
298
+ Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In (R:SS 2012), 2012. Runner Up Best Paper Award.
299
+
300
+ Nicolas Le Roux. Efficient iterative policy optimization. CoRR, abs/1612.08967, 2016. URL http://arxiv.org/abs/1612.08967.
301
+
302
+ 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), 2015.
303
+
304
+ John Schulman, Pieter Abbeel, and Xi Chen. Equivalence between policy gradients and soft qlearning. CoRR, abs/1704.06440, 2017a.
305
+
306
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017b. URL http://arxiv.org/abs/ 1707.06347.
307
+
308
+ David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In International Conference on Machine Learning (ICML), 2014.
309
+
310
+ Richard S Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In International Conference on Machine Learning (ICML), pp. 216–224, 1990.
311
+
312
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018. URL http://arxiv.org/abs/1801.00690.
313
+
314
+ Evangelos Theodorou, Jonas Buchli, and Stefan Schaal. A generalized path integral control approach to reinforcement learning. Journal of Machine Learning Research (JMLR), 2010.
315
+
316
+ Emanuel Todorov. General duality between optimal control and estimation. In Proceedings of the 47th IEEE Conference on Decision and Control, CDC 2008, December 9-11, 2008, Cancún, México, pp. 4286–4292, 2008.
317
+
318
+ Ahmed Touati, Pierre-Luc Bacon, Doina Precup, and Pascal Vincent. Convergent tree-backup and retrace with function approximation. CoRR, abs/1705.09322, 2017. URL http://arxiv. org/abs/1705.09322.
319
+
320
+ Marc Toussaint. Robot trajectory optimization using approximate inference. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pp. 1049–1056, 2009. ISBN 978-1-60558-516-1.
321
+
322
+ Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Rémi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. 5th International Conference on Learning Representations (ICLR), 2017.
323
+
324
+ Christian Wirth, Johannes Furnkranz, and Gerhard Neumann. Model-free preference-based reinforcement learning. In 30th AAAI Conference on Artificial Intelligence, AAAI 2016, pp. 2222– 2228, 2016.
325
+
326
+ Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, pp. 1433–1438, 2008.
327
+
328
+ # A PROOF OF MONOTONIC IMPROVEMENT FOR THE KL-REGULARIZED POLICY OPTIMIZATION PROCEDURE
329
+
330
+ In this section we prove a monotonic improvement guarantee for KL-regularized policy optimization via alternating updates on $\pi$ and $q$ under the assumption that the prior on $\theta$ is uninformative.
331
+
332
+ # A.1 REGULARIZED REINFORCEMENT LEARNING
333
+
334
+ Let $\pi$ be an arbitrary policy. For any other policy $q$ such that, for all $x , a , \{ \pi ( a | x ) > 0 \} \implies$ $\{ q ( a | x ) > 0 \}$ , define the $\pi$ -regularized reward for policy $q$ :
335
+
336
+ $$
337
+ r _ { \alpha } ^ { \pi , q } ( x , a ) = r ( x , a ) - \alpha \log \frac { q ( a | x ) } { \pi ( a | x ) } ,
338
+ $$
339
+
340
+ where $\alpha > 0$ .
341
+
342
+ Bellman operators: Define the $\pi$ -regularized Bellman operator for policy $q$
343
+
344
+ $$
345
+ \begin{array} { r } { T _ { \alpha } ^ { \pi , q } V ( x ) = \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ r _ { \alpha } ^ { \pi , q } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ( y ) \Big ] , } \end{array}
346
+ $$
347
+
348
+ and the non-regularized Bellman operator for policy $q$
349
+
350
+ $$
351
+ T ^ { q } V ( x ) = \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ( y ) \Big ] .
352
+ $$
353
+
354
+ Value function: Define the $\pi$ -regularized value function for policy $q$ as
355
+
356
+ $$
357
+ V _ { \alpha } ^ { \pi , q } ( \boldsymbol { x } ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } r _ { \alpha } ^ { \pi , q } ( \boldsymbol { x } _ { t } , a _ { t } ) | \boldsymbol { x } _ { 0 } = \boldsymbol { x } , q \Big ] .
358
+ $$
359
+
360
+ and the non-regularized value function
361
+
362
+ $$
363
+ V ^ { q } ( x ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } r ( x _ { t } , a _ { t } ) | x _ { 0 } = x , q \Big ] .
364
+ $$
365
+
366
+ Proposition 1. For any $q , \pi , V$ , we have $V _ { \alpha } ^ { \pi , q } \leq V ^ { q }$ and $T _ { \alpha } ^ { \pi , q } V \le T ^ { q } V$ . Indeed
367
+
368
+ $$
369
+ \mathbb { E } _ { q } \Big [ \log \frac { q \big ( a _ { t } | x _ { t } \big ) } { \pi \big ( a _ { t } | x _ { t } \big ) } \Big ] = K L \big ( q ( \cdot | x _ { t } ) \| \pi ( \cdot | x _ { t } ) \big ) \geq 0 .
370
+ $$
371
+
372
+ Optimal value function and policy Define the optimal regularized value function: $V _ { \alpha } ^ { \pi , * } ( x ) =$ $\operatorname* { m a x } _ { q } V _ { \alpha } ^ { \pi , q } ( x )$ , and the optimal (non-regularized) value function: $V ^ { * } ( x ) = \operatorname* { m a x } _ { q } V ^ { q } ( x )$ .
373
+
374
+ The optimal policy of the $\pi$ -regularized problem $q _ { \alpha } ^ { \pi , * } ( \cdot | x ) = \arg \operatorname* { m a x } _ { q } V _ { \alpha } ^ { \pi , q } ( x )$ and the optimal policy of the non-regularized problem $q ^ { * } ( \cdot | x ) = \arg \operatorname* { m a x } _ { q } V ^ { q }$ .
375
+
376
+ Proposition 2. We have that $V _ { \alpha } ^ { \pi , q }$ is the unique fixed point of $T _ { \alpha } ^ { \pi , q }$ , and $V ^ { q }$ is the unique fixed point of $T ^ { q }$ . Thus we have the following Bellman equations: For all $x \in X$ ,
377
+
378
+ $$
379
+ \begin{array} { r c l } { { V _ { \alpha } ^ { \pi , q } ( x ) } } & { { = } } & { { \displaystyle \sum _ { a } q ( a | x ) \Big [ r _ { \alpha } ^ { \pi , q } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V _ { \alpha } ^ { \pi , q } ( y ) \big ] \Big ] } } \\ { { } } & { { } } & { { } } \\ { { V ^ { q } ( x ) } } & { { = } } & { { \displaystyle \sum _ { a } q ( a | x ) \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V ^ { q } ( y ) \big ] \Big ] } } \\ { { } } & { { } } & { { } } \\ { { V _ { \alpha } ^ { \pi , * } ( x ) } } & { { = } } & { { \displaystyle r _ { \alpha } ^ { \pi , q _ { \alpha } ^ { \pi , * } } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V _ { \alpha } ^ { \pi , * } ( y ) \big ] f o r a l l a \in A , } } \\ { { } } & { { } } & { { } } \\ { { V ^ { * } ( x ) } } & { { = } } & { { \displaystyle \operatorname* { m a x } _ { a \in A } \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V ^ { * } ( y ) \big ] \Big ] . } } \end{array}
380
+ $$
381
+
382
+ Notice that (16) holds for all actions $a \in A$ , and not in expectation w.r.t. $a \sim q ( \cdot | x )$ only.
383
+
384
+ # A.2 REGULARIZED JOINT POLICY GRADIENT
385
+
386
+ We now consider a parametrized policy $\pi _ { \theta }$ and consider maximizing the regularized joint policy optimization problem for a given initial state $x _ { 0 }$ (this could be a distribution over initial states). Thus we want to find a parameter $\theta$ that (locally) maximizes
387
+
388
+ $$
389
+ \mathcal { I } ( \theta , q ) = V ^ { \pi _ { \theta } , q } ( \boldsymbol { x } _ { 0 } ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } \big ( r ( \boldsymbol { x } _ { t } , a _ { t } ) - \alpha \mathrm { K L } ( q ( \cdot | \boldsymbol { x } _ { t } ) | | \pi _ { \theta } ( \cdot | \boldsymbol { x } _ { t } ) ) \big ) \big | \boldsymbol { x } _ { 0 } , q \Big ] .
390
+ $$
391
+
392
+ We start with an initial parameter $\theta _ { 0 }$ and define a sequence of policies $\pi _ { i } = \pi _ { \theta _ { i } }$ parametrized by $\theta _ { i }$ , in the following way:
393
+
394
+ • Given $\theta _ { i }$ , define
395
+
396
+ $$
397
+ q _ { i } = \arg \operatorname* { m a x } _ { q } T _ { \alpha } ^ { \pi _ { \theta _ { i } } , q } V ^ { \pi _ { \theta _ { i } } } ,
398
+ $$
399
+
400
+ • Define $\theta _ { i + 1 }$ as
401
+
402
+ $$
403
+ \theta _ { i + 1 } = \theta _ { i } - \beta \nabla _ { \theta } \mathbb { E } _ { \pi _ { i } } \left[ \sum _ { t \geq 0 } \gamma ^ { t } \mathrm { K L } \big ( q _ { k } ( \cdot | x _ { t } ) | | \pi _ { \theta } ( \cdot | x _ { t } ) \big ) _ { | \theta = \theta _ { i } } \big | x _ { 0 } , \pi _ { i } \right] .
404
+ $$
405
+
406
+ Proposition 3. We have the following properties:
407
+
408
+ • The policy $q _ { i }$ satisfies:
409
+
410
+ $$
411
+ q _ { i } ( a | x ) = \frac { \pi _ { i } ( a | x ) e ^ { \frac { 1 } { \alpha } Q ^ { \pi _ { i } } ( x , a ) } } { \mathbb { E } _ { b \sim \pi _ { i } ( \cdot | x ) } \big [ e ^ { \frac { 1 } { \alpha } Q ^ { \pi _ { i } } ( x , b ) } \big ] } ,
412
+ $$
413
+
414
+ where $Q ^ { \pi } ( x , a ) = r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ^ { \pi } ( y ) .$
415
+
416
+ • We have
417
+
418
+ $$
419
+ V _ { \alpha } ^ { \pi _ { i } , q _ { i } } \geq V ^ { \pi _ { i } } .
420
+ $$
421
+
422
+ • For η sufficiently small, we have
423
+
424
+ $$
425
+ \mathcal { I } ( \theta _ { i + 1 } , q _ { i + 1 } ) \geq \mathcal { I } ( \theta _ { i } , q _ { i } ) + c g _ { i } ,
426
+ $$
427
+
428
+ where c is a numerical constant, and $g _ { i }$ is the norm of the gradient (minimized by the algorithm):
429
+
430
+ $$
431
+ g _ { i } = \Big \| \nabla _ { \theta } \mathbb { E } _ { \pi _ { i } } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } K L \big ( q _ { i } ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) _ { | \theta = \theta _ { i } } \big | x _ { 0 } , \pi _ { i } \Big ] \Big \| .
432
+ $$
433
+
434
+ Thus we build a sequence of policies $( \pi _ { \theta _ { i } } , q _ { i } )$ whose values $\mathcal { I } ( \theta _ { i } , q _ { i } )$ are non-decreasing thus converge to a local maximum. In addition, the improvement is lower-bounded by $a$ constant times the norm of the gradient, thus the algorithm keeps improving the performance until the gradient vanishes (when we reach the limit of the capacity of our representation).
435
+
436
+ Proof. We have
437
+
438
+ $$
439
+ \begin{array} { r l r } { q _ { i } ( \cdot | x ) } & { = } & { \arg \underset { q } { \operatorname* { m a x } } \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ \underset { Q ^ { \pi _ { i } } ( x , a ) } { \underbrace { r \big ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ^ { \pi _ { i } } ( y ) } } - \alpha \log \frac { q \big ( a | x \big ) } { \pi _ { i } \big ( a | x \big ) } \Big ] , } \end{array}
440
+ $$
441
+
442
+ from which we deduce (19). Now, from the definition of $q _ { i }$ , we have
443
+
444
+ $$
445
+ T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V ^ { \pi _ { i } } \geq T _ { \alpha } ^ { \pi _ { i } , \pi _ { i } } V ^ { \pi _ { i } } = T ^ { \pi _ { i } } V ^ { \pi _ { i } } = V ^ { \pi _ { i } } .
446
+ $$
447
+
448
+ Now, since and its fixe $T _ { \alpha } ^ { \pi _ { i } , q _ { i } }$ is is otone operator (i.e. if , we have $V _ { 1 } \geq V _ { 2 }$ elementwise, then $T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V _ { 1 } \geq T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V _ { 2 } )$ $V _ { \alpha } ^ { \pi _ { i } , q _ { i } }$
449
+
450
+ $$
451
+ V _ { \alpha } ^ { \pi _ { i } , q _ { i } } = \operatorname* { l i m } _ { t \to \infty } ( T _ { \alpha } ^ { \pi _ { i } , q _ { i } } ) ^ { t } V ^ { \pi _ { i } } \geq V ^ { \pi _ { i } } ,
452
+ $$
453
+
454
+ which proves (20).
455
+
456
+ Now, in order to prove (21) we derive the following steps.
457
+
458
+ Step 1: From the definition of $q _ { i + 1 }$ we have, for any $x$
459
+
460
+ $$
461
+ \begin{array} { r } { \tilde { \Sigma } _ { a \sim q _ { 4 } + 1 } \left[ Q ^ { \pi _ { i + 1 } } ( x , a ) \right] - \alpha \mathbf { K L } \left( q _ { i + 1 } ( \cdot | x ) \| \pi _ { i + 1 } ( \cdot | x ) \right) \geq \mathbb { E } _ { a \sim q _ { 4 } } \left[ Q ^ { \pi _ { i + 1 } } ( x , a ) \right] - \alpha \mathbf { K L } \left( q _ { i } ( \cdot | x ) \| \pi _ { i + 1 } ( \cdot | x ) \right) } \end{array}
462
+ $$
463
+
464
+ Writing the functional that we minimize
465
+
466
+ $$
467
+ f ( \pi , q , \theta ) = \mathbb { E } _ { \pi } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } \mathrm { K L } \big ( q ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) \big | x _ { 0 } , \pi \Big ] ,
468
+ $$
469
+
470
+ the update rule is $\theta _ { i + 1 } = \theta _ { i } - \beta \nabla _ { \theta } f ( \pi _ { i } , q _ { i } , \theta _ { i } )$ . Thus we have that for sufficiently small $\beta$ ,
471
+
472
+ $$
473
+ f ( \pi _ { i } , q _ { i } , \theta _ { i + 1 } ) \leq f ( \pi _ { i } , q _ { i } , \theta _ { i } ) - \beta g _ { i } ,
474
+ $$
475
+
476
+ where $\begin{array} { r } { g _ { i } = \frac { 1 } { 2 } \| \nabla _ { \theta } f ( \pi _ { i } , q _ { i } , \theta _ { i } ) \| } \end{array}$ .
477
+
478
+ Step 2: Now define $\mathcal { F }$ :
479
+
480
+ $$
481
+ \begin{array} { r c l } { \mathcal { F } ( \pi , q , \theta , \pi ^ { \prime } ) } & { = } & { \displaystyle \mathbb { E } _ { \pi } \left[ \sum _ { t \geq 0 } \gamma ^ { t } \big ( \mathbb { E } _ { a \sim q } \big [ Q ^ { \pi ^ { \prime } } ( x _ { t } , a ) \big ] - \alpha \mathrm { K L } \big ( q ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) \big ) \big | x _ { 0 } , \pi \right] } \\ & { = } & { \displaystyle \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi } \big ) ^ { - 1 } T _ { \alpha } ^ { \pi _ { \theta } , q } V ^ { \pi ^ { \prime } } } \\ & { = } & { \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi } \big ) ^ { - 1 } T ^ { q } V ^ { \pi ^ { \prime } } - f ( \pi , q , \theta ) , } \end{array}
482
+ $$
483
+
484
+ where $\delta _ { x _ { 0 } }$ is a Dirac (in the row vector $x _ { 0 }$ ), and $P ^ { \pi }$ is the transition matrix for policy $\pi$
485
+
486
+ From (22) and (23) we deduce that
487
+
488
+ $$
489
+ \begin{array} { r c l } { \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i + 1 } ) } & { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i + 1 } , \pi _ { i + 1 } ) } \\ & { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i + 1 } ) + \beta g _ { i } . } \end{array}
490
+ $$
491
+
492
+ We deduce
493
+
494
+ $$
495
+ \begin{array} { r l } & { \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i } ) } \\ { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) + \beta g _ { i } } \\ & { + \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i } ) - \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i + 1 } ) + \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i + 1 } ) - \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) } \\ { = } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) + \beta g _ { i } + } \\ & { \mathbb { E } _ { \pi _ { i } } \Big [ \displaystyle \sum _ { t \geq 0 } \gamma ^ { t } \big ( \mathbb { E } _ { a \sim q _ { i + 1 } } \big [ Q ^ { \pi _ { i } } ( x _ { t } , a ) - Q ^ { \pi _ { i + 1 } } ( x _ { t } , a ) \big ] - \mathbb { E } _ { a \sim q _ { i } } \big [ Q ^ { \pi _ { i } } ( x _ { t } , a ) - Q ^ { \pi _ { i + 1 } } ( x _ { t } , a ) \big ] \big ) \Big ] } \end{array}
496
+ $$
497
+
498
+ This rewrites:
499
+
500
+ $$
501
+ \delta _ { x _ { 0 } } ( I - \gamma ^ { \pi _ { i } } ) ^ { - 1 } \big ( T _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { i } } \big ) \geq \eta g _ { i } + O ( \beta ^ { 2 } ) .
502
+ $$
503
+
504
+ Step 3: Now a bit of algebra. For two stochastic matrices $P$ and $P ^ { \prime }$ , we have
505
+
506
+ $$
507
+ \begin{array} { r l } & { ( I - \gamma P ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma \big [ ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } \big ] ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ^ { \prime } ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ & { + \gamma ^ { 2 } ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } . } \end{array}
508
+ $$
509
+
510
+ Applying this equality to the transition matrices $P ^ { \pi _ { k } }$ and $P ^ { \pi _ { k + 1 } }$ and since $\lVert P ^ { \pi _ { k + 1 } } - P ^ { \pi _ { k } } \rVert = O ( \eta )$ , we have:
511
+
512
+ $$
513
+ \begin{array} { r l } & { V _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } + \gamma ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( P ^ { \pi _ { i + 1 } } - P ^ { \pi _ { i } } ) ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } + O ( \beta ^ { 2 } ) } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i } , \pi _ { i } } + ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } - r _ { \alpha } ^ { q _ { i } , \pi _ { i } } + \gamma P ^ { \pi _ { i + 1 } } - \gamma P ^ { \pi _ { i } } ) ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i } , \pi _ { i } } } \\ { = } & { V _ { \alpha } ^ { q _ { i } , \pi _ { i } } + ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( T _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i } + 1 } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { k } } ) + O ( \beta ^ { 2 } ) . } \end{array}
514
+ $$
515
+
516
+ Table 1: Results on a subset of the ALE environments in comparison to baselines taken from (Bellemare et al., 2017)
517
+
518
+ <table><tr><td>Game/Agent</td><td>Human</td><td>DQN</td><td>Prior. Dueling</td><td>C51</td><td>MPO</td></tr><tr><td></td><td></td><td>19.5</td><td>20.9</td><td></td><td></td></tr><tr><td>Pong Breakout</td><td>14.6 30.5</td><td>385.5</td><td>366.0</td><td>20.9 748</td><td>20.9 360.5</td></tr><tr><td></td><td>13,455.0</td><td>13,117.3</td><td>18,760.3</td><td>23,784</td><td></td></tr><tr><td>Q*bert Tennis</td><td>-8.3</td><td>12.2</td><td>0.0</td><td>23.1</td><td>10,317.0</td></tr><tr><td></td><td></td><td></td><td>98.9</td><td></td><td>22.2</td></tr><tr><td>Boxing</td><td>12.1</td><td>88.0</td><td></td><td>97.8</td><td>82.0</td></tr></table>
519
+
520
+ Finally, using (24), we deduce that
521
+
522
+ $$
523
+ \begin{array} { l l l } { \mathcal { I } ( \theta _ { i + 1 } , q _ { i + 1 } ) } & { = } & { V _ { \alpha } ^ { q _ { i } + 1 , \pi _ { i } + 1 } \big ( x _ { 0 } \big ) } \\ & { = } & { V _ { \alpha } ^ { q _ { i } , \pi _ { i } } \big ( x _ { 0 } \big ) + \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi _ { i } } \big ) ^ { - 1 } \big ( T _ { \alpha } ^ { q _ { i } + 1 , \pi _ { i + 1 } } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { i } } \big ) + O ( \beta ^ { 2 } ) } \\ & { \geq } & { \mathcal { I } ( \theta _ { i } , q _ { i } ) + \eta g _ { i } + O ( \beta ^ { 2 } ) } \\ & { \geq } & { \mathcal { I } ( \theta _ { i } , q _ { i } ) + \frac { 1 } { 2 } \eta g _ { i } , } \end{array}
524
+ $$
525
+
526
+ for small enough $\eta$ .
527
+
528
+ # B ADDITIONAL EXPERIMENT: DISCRETE CONTROL
529
+
530
+ As a proof of concept – showcasing the robustness of our algorithm and its hyperparameters – we performed an experiment on a subset of the games contained contained in the "Arcade Learning Environment" (ALE). For this experiment we used the same hyperparameter settings for the KL constraints as for the continuous control experiments as well as the same learning rate and merely altered the network architecture to the standard network structure used by DQN Mnih et al. (2015) – and created a seperate network with the same architecture, but predicting the parameters of the policy distribution. A comparison between our algorithm and well established baselines from the literature, in terms of the mean performance, is listed in Table 1. While we do not obtain state-ofthe-art performance in this experiment, the fact that MPO is competitive, out-of-the-box in these domains suggests that combining the ideas presented in this paper with recent advances for RL with discrete actions (Bellemare et al., 2017) could be a fruitful avenue for future work.
531
+
532
+ # C EXPERIMENT DETAILS
533
+
534
+ In this section we give the details on the hyper-parameters used for each experiment. All the continuous control experiments use a feed-forward network except for Parkour-2d were we used the same network architecture as in Heess et al. (2017). Other hyper parameters for MPO with non parametric variational distribution were set as follows,
535
+
536
+ Table 2: Parameters for non-parametric variational distribution
537
+
538
+ <table><tr><td>Hyperparameter</td><td>control suite</td><td>humanoid</td></tr><tr><td>Policy net</td><td>100-100</td><td>200-200</td></tr><tr><td>Q function net</td><td>200-200</td><td>300-300</td></tr><tr><td>E</td><td>0.1</td><td>1</td></tr><tr><td>Eμ</td><td>0.1</td><td>&quot;</td></tr><tr><td>£</td><td>0.0001</td><td>&quot;</td></tr><tr><td>Discount factor()</td><td>0.99</td><td>1</td></tr><tr><td>Adam learning rate</td><td>0.0005</td><td>1</td></tr></table>
539
+
540
+ Hyperparameters for MPO with parametric variational distribution were as follows,
541
+
542
+ Table 3: Parameters for parametric variational distribution
543
+
544
+ <table><tr><td>Hyperparameter</td><td>control suite tasks</td><td>humanoid</td></tr><tr><td>Policy net</td><td>100-100</td><td>200-200</td></tr><tr><td>Q function net</td><td>200-200</td><td>300-300</td></tr><tr><td>Eμ</td><td>0.1</td><td>1</td></tr><tr><td>£</td><td>0.0001</td><td>1</td></tr><tr><td>Discount factor ()</td><td>0.99</td><td>1</td></tr><tr><td>Adam learning rate</td><td>0.0005</td><td>1</td></tr></table>
545
+
546
+ # D DERIVATION OF UPDATE RULES FOR A GAUSSIAN POLICY
547
+
548
+ For continuous control we assume that the policy is given by a Gaussian distribution with a full covariance matrix, i.e, $\pi ( \boldsymbol { a } | \boldsymbol { s } , \pmb { \theta } ) = \mathcal { N } \left( \mu , \pmb { \Sigma } \right)$ . Our neural network outputs the mean $\mu = \mu ( s )$ and Cholesky factor $A = A ( s )$ , such that $\Sigma = A A ^ { T }$ . The lower triagular factor $A$ has positive diagonal elements enforced by the softplus transform $A _ { i i } \log ( 1 + \exp ( A _ { i i } ) )$ .
549
+
550
+ # D.1 NON-PARAMETRIC VARIATIONAL DISTRIBUTION
551
+
552
+ In this section we provide the derivations and implementation details for the non-parametric variational distribution case for both $\mathrm { E }$ -step and M-step.
553
+
554
+ # D.2 E-STEP
555
+
556
+ The E-step with a non-parametric variational solves the following program, where we have replaced expectations with integrals to simplify the following derivations:
557
+
558
+ $$
559
+ \begin{array} { l } { \displaystyle \operatorname* { m a x } _ { q } \int \mu _ { q } ( s ) \int q ( a | s ) Q _ { \theta _ { i } } ( s , a ) d a d s } \\ { \displaystyle s . t . \int \mu _ { q } ( s ) { \bf K L } ( q ( a | s ) , \pi ( a | s , \theta _ { i } ) ) d a < \epsilon , } \\ { \displaystyle \iint \mu _ { q } ( s ) q ( a | s ) d a d s = 1 . } \end{array}
560
+ $$
561
+
562
+ First we write the Lagrangian equation, i.e,
563
+
564
+ $$
565
+ \begin{array} { c } { { L ( q , \eta , \gamma ) = \displaystyle \int \mu _ { q } ( s ) \int q ( a | s ) Q _ { \theta _ { i } } ( s , a ) d a d s + } } \\ { { \displaystyle \eta \left( \epsilon - \int \mu _ { q } ( s ) \int q ( a | s ) \log \frac { q ( a | s ) } { \pi ( a | s , \theta _ { i } ) } \right) + \gamma \left( 1 - \displaystyle \iint \mu _ { q } ( s ) q ( a | s ) d a d s \right) . } } \end{array}
566
+ $$
567
+
568
+ Next we maximise the Lagrangian $L$ w.r.t the primal variable $q$ . The derivative w.r.t $q$ reads,
569
+
570
+ $$
571
+ \partial q L ( q , \eta , \gamma ) = Q _ { \theta _ { i } } ( a , s ) - \eta \log q ( a | s ) + \eta \log \pi ( a | s , \pmb \theta _ { i } ) - ( \eta - \gamma ) .
572
+ $$
573
+
574
+ Setting it to zero and rearranging terms we get
575
+
576
+ $$
577
+ q ( a | s ) = \pi ( a | s , \pmb { \theta } _ { i } ) \exp \left( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } \right) \exp \left( - \frac { \eta - \gamma } { \eta } \right) .
578
+ $$
579
+
580
+ However the last exponential term is a normalisation constant for $q$ . Therefore we can write,
581
+
582
+ $$
583
+ \exp ( - \frac { \eta - \gamma } { \eta } ) = \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } ) d a ,
584
+ $$
585
+
586
+ $$
587
+ \gamma = \eta - \eta \log \left( \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } ) d a \right) .
588
+ $$
589
+
590
+ Note that we could write $\gamma$ based on $\pi$ and $\eta$ . At this point we can derive the dual function,
591
+
592
+ $$
593
+ g ( \eta ) = \eta \epsilon + \eta \int \mu _ { q } ( s ) \log \left( \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q ( a , s ) } { \eta } ) d a \right) .
594
+ $$
595
+
596
+ # D.3 M-STEP
597
+
598
+ To obtain the KL constraint in the $\mathbf { M }$ step we set $p ( \theta )$ to a Gaussian prior around the current policy, i.e,
599
+
600
+ $$
601
+ p ( \pmb \theta ) \approx \mathcal { N } \Big ( \mu = \pmb \theta _ { i } , \Sigma = \frac { F _ { \pmb \theta _ { i } } } { \lambda } \Big ) ,
602
+ $$
603
+
604
+ where $\theta _ { i }$ are the parameters of the current policy distribution, $F _ { \pmb { \theta } _ { i } }$ is the empirical Fisher information matrix and $\lambda$ .
605
+
606
+ With this, and dropping constant terms our optimization program becomes
607
+
608
+ $$
609
+ \operatorname* { m a x } _ { \pi } \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \pmb { \theta } ) d a d s - \lambda ( \pmb { \theta } - \pmb { \theta } _ { i } ) ^ { T } F _ { \pmb { \theta _ { i } } } ^ { - 1 } ( \pmb { \theta } - \pmb { \theta } _ { i } ) .
610
+ $$
611
+
612
+ We can observe that $( \pmb \theta - \pmb \theta _ { i } ) ^ { T } F _ { \pmb \theta _ { i } } ^ { - 1 } ( \pmb \theta - \pmb \theta _ { i } )$ is the second order Taylor approximation of $\begin{array} { r } { \int \mu _ { q } ( s ) \mathrm { K L } ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) ) d s } \end{array}$ which leads us to the generalized M-step objective:
613
+
614
+ $$
615
+ \operatorname* { m a x } _ { \pi } \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \theta ) d a d s - \lambda \int \mu _ { q } ( s ) \mathbf { K L } ( \pi ( a | s , \theta _ { i } ) , \pi ( a | s , \theta ) ) d s
616
+ $$
617
+
618
+ which corresponds to Equation (11) from the main text, where expectations are replaced by integrals.
619
+
620
+ After obtaining the non parametric variational distribution in the $\mathbf { M }$ step with a Gaussian policy we empirically observed that better results could be achieved by decoupling the KL constraint into two terms such that we can constrain the contribution of the mean and covariance separately i.e.
621
+
622
+ $$
623
+ \int \mu _ { q } ( s ) \mathrm { K L } ( \pi _ { i } ( a | s , \pmb \theta ) , \pi ( a | s , \pmb \theta ) ) = C _ { \mu } + C _ { \Sigma } ,
624
+ $$
625
+
626
+ where
627
+
628
+ $$
629
+ \begin{array} { c } { { C _ { \mu } = \displaystyle \int \mu _ { q } ( s ) \frac 1 2 \big ( \mathrm { t r } \big ( \Sigma ^ { - 1 } \Sigma _ { i } \big ) - n + \mathrm { l n } ( \frac { \Sigma } { \Sigma _ { i } } ) \big ) d s , } } \\ { { { } } } \\ { { C _ { \Sigma } = \displaystyle \int \mu _ { q } ( s ) \frac 1 2 \big ( \mu - \mu _ { i } \big ) ^ { T } \Sigma ^ { - 1 } ( \mu - \mu _ { i } ) d s . } } \end{array}
630
+ $$
631
+
632
+ This decoupling allows us to set different $\epsilon$ values for each component, i.e., $\epsilon _ { \mu } , \epsilon _ { \Sigma }$ for the mean, the covariance matrix respectively. Different $\epsilon$ lead to different learning rates. The effectivness of this decoupling has also been shown in Abdolmaleki et al. (2017). We always set a much smaller epsilon for covariance than the mean. The intuition is that while we would like the distribution moves fast in the action space, we also want to keep the exploration to avoid premature convergence.
633
+
634
+ In order to solve the constrained optimisation in the M-step, we first write the generalised Lagrangian equation, i.e,
635
+
636
+ $$
637
+ L ( \pmb \theta , \eta _ { \mu } , \eta _ { \Sigma } ) = \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \pmb \theta ) d a d s + \eta _ { \mu } ( \epsilon _ { \mu } - C _ { \mu } ) + \eta _ { \Sigma } ( \epsilon _ { \Sigma } - C _ { \Sigma } )
638
+ $$
639
+
640
+ Where $\eta _ { \mu }$ and $\eta _ { \Sigma }$ are Lagrangian multipliers. Following prior work on constraint optimisation, we formulate the following primal problem,
641
+
642
+ $$
643
+ \operatorname* { m a x } _ { \pmb { \theta } } \operatorname* { m i n } _ { \eta _ { \mu } > 0 , \eta _ { \Sigma } > 0 } L ( \pmb { \theta } , \eta _ { \mu } , \eta _ { \Sigma } ) .
644
+ $$
645
+
646
+ In order to solve for $\pmb \theta$ we iteratively solve the inner and outer optimisation programs independently: We fix the Lagrangian multipliers to their current value and optimise for $\pmb \theta$ (outer maximisation) and then fix the parameters $\pmb \theta$ to their current value and optimise for the Lagrangian multipliers (inner minimisation). We continue this procedure until policy parameters $\pmb { \theta }$ and Lagrangian multipliers converge. Please note that the same approach can be employed to bound the KL explicitly instead of decoupling the contribution of mean and covariance matrix to the KL.
647
+
648
+ # D.4 PARAMETRIC VARIATIONAL DISTRIBUTION
649
+
650
+ In this case we assume our variational distribution also uses a Gaussian distribution over the action space and use the same structure as our policy $\pi$ .
651
+
652
+ Similar to the non-parametric case for a Gaussian distribution in the M-step we also use a decoupled KL but this time in the E-step for a Gaussian variational distribution. Using the same reasoning as in the previous section we can obtain the following generalized Lagrangian equation:
653
+
654
+ $$
655
+ L ( \theta ^ { q } , \eta _ { \mu } , \eta _ { \Sigma } ) = \int \mu _ { q } ( s ) \int q ( a | s ; \theta ^ { q } ) A _ { i } ( a , s ) d a d s + \eta _ { \mu } ( \epsilon _ { \mu } - C _ { \mu } ) + \eta _ { \Sigma } ( \epsilon _ { \Sigma } - C _ { \Sigma } ) .
656
+ $$
657
+
658
+ Where $\eta _ { \mu }$ and $\eta _ { \Sigma }$ are Lagrangian multipliers. And where we use the advantage function $A ( a , s )$ instead of the $\mathrm { Q }$ function $Q ( a , s )$ , as it empirically gave better performance. Please note that the KL in the $\mathrm { E }$ -step is different than the one used in the M-step. Following prior works on constraint optimisation, we can formulate the following primal problem,
659
+
660
+ $$
661
+ \operatorname* { m a x } _ { \pmb { \theta } ^ { q } } \operatorname* { m i n } _ { \eta _ { \mu } > 0 , \eta _ { \Sigma } > 0 } L ( \pmb { \theta } ^ { q } , \eta _ { \mu } , \eta _ { \Sigma } )
662
+ $$
663
+
664
+ In order to solve for $\pmb { \theta } ^ { q }$ we iteratively solve the inner and outer optimisation programs independently. In order to that we fix the Lagrangian multipliers to their current value and optimise for $\pmb { \theta } ^ { q }$ (outer maximisation), in this case we use the likelihood ratio gradient to compute the gradient w.r.t $\pmb { \theta } ^ { q }$ . Subsequently we fix the parameters $\pmb { \theta } ^ { q }$ to their current value and optimise for Lagrangian multipliers (inner minimisation). We iteratively continue this procedure until the policy parameters $\pmb { \theta } ^ { q }$ and the Lagrangian multipliers converges. Please note that the same approach can be used to bound the KL explicitly instead of decoupling the contribution of mean and covariance matrix to the KL. As our policy has the same structure as the parametric variational distribution, the M step in this case reduce to set the policy parameters $\pmb { \theta }$ to the parameters $\pmb { \theta } ^ { q }$ we obtained in E-step, i.e,
665
+
666
+ $$
667
+ \pmb \theta _ { i + 1 } = \pmb \theta ^ { q }
668
+ $$
669
+
670
+ # E IMPLEMENTATION DETAILS
671
+
672
+ While we ran most of our experiments using a single learner, we implemented a scalable variant of the presented method in which multiple workers collect data independently in an instance of the considered environment, compute gradients and send them to a chief (or parameter server) that performs parameter update by averaging gradients. That is we use distributed synchronous gradient descent. These procedures are described in Algorithms 1 and 2 for the non-parametric case and 3 for the parametric case.
673
+
674
+ # Algorithm 1 MPO (chief)
675
+
676
+ 1: Input $G$ number of gradients to average
677
+ 2: while True do
678
+ 3: initialize $\Nu = 0$
679
+ 4: initialize gradient store $s _ { \phi } = \{ \} , s _ { \eta } = \{ \} , s _ { \eta _ { \mu } } = \{ \} , s _ { \eta _ { \Sigma } } = \{ \} \ : s _ { \theta } = \{ \}$
680
+ 5: while $N < G$ do
681
+ 6: receive next gradient from worker $w$
682
+ 7: $\begin{array} { l } { { s _ { \phi } = s _ { \phi } + [ \bar { \delta } \phi ^ { w } ] } } \\ { { s _ { \phi } = s _ { \theta } + [ \delta \theta ^ { w } ] } } \\ { { s _ { \eta } = s _ { \eta } + [ \delta \eta ^ { w } ] } } \\ { { s _ { \eta _ { \mu } } = s _ { \eta _ { \mu } } + [ \delta \eta _ { \mu } ^ { w } ] } } \\ { { s _ { \eta _ { \theta } } = s _ { \eta _ { \theta } } + [ \delta \eta _ { \theta } ^ { w } ] } } \end{array}$
683
+ 8:
684
+ 9:
685
+ 10:
686
+ 11:
687
+ 12: update parameters with average gradient from
688
+ 13: $s _ { \phi }$ , sη, sηµ, sηΣ sθ
689
+ 14: send new parameters to workers
690
+
691
+ # Algorithm 2 MPO (worker) - Non parametric variational distribution
692
+
693
+ 1: Input = , Σ, µ, Lmax
694
+ 2: $i = 0$ , $L _ { \mathrm { c u r r } } = 0$
695
+ 3: Initialise $Q _ { \omega _ { i } } ( a , s ) , \pi ( a | s , \pmb { \theta } _ { i } ) , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
696
+ 4: for each worker do
697
+ 5: while $L _ { \mathrm { c u r r } } > L _ { \mathrm { m a x } }$ do
698
+ 6: update replay buffer $\boldsymbol { B }$ with $\mathrm { L }$ trajectories from the environment
699
+ 7: $\bar { k = 0 }$
700
+ 8: // Find better policy by gradient descent
701
+ 9: while $k < 1 0 0 0$ do
702
+ 10: sample a mini-batch $\boldsymbol { B }$ of $N$ $( s , a , r )$ pairs from replay
703
+ 11: sample $M$ additional actions for each state from $\boldsymbol { B }$ , $\bar { \pi } ( \bar { a } | s , \pmb \theta _ { i } )$ for estimating integrals
704
+ 12: compute gradients, estimating integrals using samples
705
+ 13: // Q-function gradient:
706
+ 14: $\delta _ { \phi } = \partial _ { \phi } L _ { \phi } ^ { \prime } ( \phi )$
707
+ 15: // E-Step gradient:
708
+ 16: $\delta \eta = \bar { \partial _ { \eta } g ( \eta ) }$
709
+ 17: Let: q(a|s) ∝ π(a|s, θi) exp( Qθt (a,s,φ0)η )
710
+ 18: // M-Step gradient:
711
+ 19: $[ \delta _ { \eta _ { \mu } } , \delta _ { \eta _ { \Sigma } } ] \stackrel { - } { = } \alpha \partial _ { \eta _ { \mu } , \eta _ { \Sigma } } { \cal L } ( \theta _ { k } , \eta _ { \mu } , \eta _ { \Sigma } )$
712
+ 20: $\delta _ { \theta } = \partial _ { \theta } L ( \theta , \eta _ { \mu _ { k + 1 } } , \eta _ { \Sigma k + 1 } )$
713
+ 21: send gradients to chief worker
714
+ 22: wait for gradient update by chief
715
+ 23: fetch new parameters $\phi , \theta , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
716
+ 24: $\begin{array} { r } { k = k + 1 ^ { \circ } } \\ { i = i + 1 , L _ { \mathrm { c u r r } } = L _ { \mathrm { c u r r } } + L } \\ { \pmb { \theta } _ { i } = \pmb { \theta } , \phi ^ { \prime } = \phi } \end{array}$
717
+ 25:
718
+ 26:
719
+
720
+ # Algorithm 3 MPO (worker) - parametric variational distribution
721
+
722
+ 1: Input = Σ, µ, Lmax
723
+ 2: $i = 0$ , Lcurr = 0
724
+ 3: Initialise $Q _ { \omega _ { i } } ( a , s ) , \pi ( a | s , \pmb { \theta } _ { i } ) , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
725
+ 4: for each worker do
726
+ 5: while $L _ { \mathrm { c u r r } } < L _ { \mathrm { m a x } }$ do
727
+ 6: update replay buffer $\boldsymbol { B }$ with $\mathrm { L }$ trajectories from the environment
728
+ 7: $k = 0$
729
+ 8: // Find better policy by gradient descent
730
+ 9: while $k < 1 0 0 0$ do
731
+ 10: sample a mini-batch $\boldsymbol { B }$ of $\mathrm { ~ V ~ } ( s , a , r )$ pairs from replay
732
+ 11: sample $M$ additional actions for each state from $\boldsymbol { B }$ , $\dot { \pi } ( a | s , \theta _ { k } )$ for estimating inte
733
+ grals
734
+ 12: compute gradients, estimating integrals using samples
735
+ 13: // Q-function gradient:
736
+ 14: $\delta _ { \phi } = \partial _ { \phi } L _ { \phi } ^ { \prime } ( \phi )$
737
+ 15: // E-Step gradient:
738
+ 16: $\begin{array} { r l } & { \bigl [ \delta _ { \eta _ { \mu } } , \delta _ { \eta _ { \Sigma } } \bigr ] ^ { \circ } = \alpha \partial _ { \eta _ { \mu } , \eta _ { \Sigma } } L ( \pmb \theta _ { k } , \eta _ { \mu } , \eta _ { \Sigma } ) } \\ & { \delta _ { \theta } = \partial _ { \theta } L ( \pmb \theta , \eta _ { \mu _ { k + 1 } } , \eta _ { \Sigma k + 1 , \eta } , } \\ & { \dots , \dots } \end{array}$
739
+ 17:
740
+ 18: // M-Step gradient: In practice there is no M-step in this case as policy and variatinal
741
+ distribution $q$ use a same structure.
742
+ 19: send gradients to chief worker
743
+ 20: wait for gradient update by chief
744
+ 21: fetch new parameters $\phi , \theta , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
745
+ 22: $\begin{array} { r } { k = k + 1 ^ { \mathbf { \complement } } } \\ { i = i + 1 , L _ { \mathrm { c u r r } } = L _ { \mathrm { c u r r } } + L } \\ { \pmb { \theta } _ { i } = \pmb { \theta } , \phi ^ { \prime } = \phi } \end{array}$
746
+ 23:
747
+ 24:
md/train/SJg4Y3VFPS/SJg4Y3VFPS.md ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GROUP-CONNECTED MULTILAYER PERCEPTRON NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Despite the success of deep learning in domains such as image, voice, and graphs, there has been little progress in deep representation learning for domains without a known structure between features. For instance, a tabular dataset of different demographic and clinical factors where the feature interactions are not given as a prior. In this paper, we propose Group-Connected Multilayer Perceptron (GMLP) networks to enable deep representation learning in these domains. GMLP is based on the idea of learning expressive feature combinations (groups) and exploiting them to reduce the network complexity by defining local group-wise operations. During the training phase, GMLP learns a sparse feature grouping matrix using temperature annealing softmax with an added entropy loss term to encourage the sparsity. Furthermore, an architecture is suggested which resembles binary trees, where group-wise operations are followed by pooling operations to combine information; reducing the number of groups as the network grows in depth. To evaluate the proposed method, we conducted experiments on five different real-world datasets covering various application areas. Additionally, we provide visualizations on MNIST and synthesized data. According to the results, GMLP is able to successfully learn and exploit expressive feature combinations and achieve state-of-the-art classification performance on different datasets.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep neural networks have been quite successful across various machine learning tasks. However, this advancement has been mostly limited to certain domains. For example in image and voice data, one can leverage domain properties such as location invariance, scale invariance, coherence, etc. via using convolutional layers (Goodfellow et al., 2016). Alternatively, for graph data, graph convolutional networks were suggested to leverage adjacency patterns present in datasets structured as a graph (Kipf & Welling, 2016; Xu et al., 2019).
12
+
13
+ However, there has been little progress in learning deep representations for datasets that do not follow a particular known structure in the feature domain. Take for instance the case of a simple tabular dataset for disease diagnosis. Such a dataset may consist of features from different categories such as demographics (e.g., age, gender, income, etc.), examinations (e.g., blood pressure, lab results, etc.), and other clinical conditions. In this scenario, the lack of any known structure between features to be used as a prior would lead to the use of a fully-connected multilayer perceptron network (MLP). Nonetheless, it has been known in the literature that MLP architectures, due to their huge complexity, do not usually admit efficient training and generalization for networks of more than a few layers.
14
+
15
+ In this paper, we propose Group-Connected Multiplayer Perceptron (GMLP) networks. The main idea behind GMLP is to learn and leverage expressive feature subsets, henceforth referred to as feature groups. A feature group is defined as a subset of features that provides a meaningful representation or high-level concept that would help the downstream task. For instance, in the disease diagnosis example, the combination of a certain blood factor and age might be the indicator of a higher level clinical condition which would help the final classification task. Furthermore, GMLP leverages feature groups limiting network connections to local group-wise connections and builds a feature hierarchy via merging groups as the network grows in depth. GMLP can be seen as an architecture that learns expressive feature combinations and leverages them via group-wise operations.
16
+
17
+ The main contributions of this paper are as follows: $( i )$ proposing a method for end-to-end learning of expressive feature combinations, $( i i )$ suggesting a network architecture to utilize feature groups and local connections to build deep representations, (iii) conducting extensive experiments demonstrating the effectiveness of GMLP as well as visualizations and ablation studies for better understanding of the suggested architecture.
18
+
19
+ We evaluated the proposed method on five different real-world datasets in various application domains and demonstrated the effectiveness of GMLP compared to state-of-the-art methods in the literature. Furthermore, we conducted ablation studies and comparisons to study different architectural and training factors as well as visualizations on MNIST and synthesized data. To help to reproduce the results and encouraging future studies on group-connected architectures, we made the source code related to this paper available online 1.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ Fully-connected MLPs are the most widely-used neural models for datasets in which no prior assumption is made on the relationship between features. However, due to the huge complexity of fully-connected layers, MLPs are prone to overfitting resulting in shallow architectures limited to a few layers in depth (Goodfellow et al., 2016). Various techniques have been suggested to improve training these models which include regularization techniques such as L-1/L-2 regularization, dropout, etc. and normalization techniques such as layer normalization, weigh normalization, batch normalization, etc.(Srivastava et al., 2014; Ba et al., 2016; Salimans & Kingma, 2016; Ioffe & Szegedy, 2015). For instance, self-normalizing neural networks (SNNs) have been recently suggested as state of the art normalization methods that prevent vanishing or exploding gradients which help training feed-forward networks with higher depths (Klambauer et al., 2017).
24
+
25
+ From the architectural perspective, there has been great attention toward networks consisting of sparse connections between layers rather than having dense fully-connected layers (Dey et al., 2018). Sparse connected neural networks are usually trained based on either a sparse prior structure over the network architecture (Richter & Wattenhofer, 2018) or based on pruning a fully-connected network to a sparse network (Yun et al., 2019; Tartaglione et al., 2018; Mocanu et al., 2018). However, it should be noted that the main objective of most sparse neural network literature has been focused on improving the memory and compute requirements while maintaining competitive accuracies compared to MLPs.
26
+
27
+ As a parallel line of research, the idea of using expressive feature combinations or groups has been suggested as a prior over the feature domain. Perhaps, the most successful and widespread use of this idea is in creating random forest models in which different trees are trained based on different feature subsets in order to deal with high-dimensional and high-variance data (Breiman, 2001). More recently, feature grouping is suggested by Aydore et al. (2019) as a statistical regularization technique to learn from datasets of large feature size and a small number of training samples. They do the forward network computation by projecting input features using samples taken from a bank of feature grouping matrices, reducing the input layer complexity and regularizing the model. In another recent study, Ke et al. (2018) used expressive feature combinations to learn from tabular datasets using a recursive encoder with a shared embedding network. They suggest a recursive architecture in which more important feature groups have a more direct impact on the final prediction.
28
+
29
+ While promising results have been reported using these methods, feature grouping has been mostly considered as a preprocessing step. For instance, Aydore et al. (2019) uses the recursive nearest agglomeration (ReNA) (Hoyos-Idrobo et al., 2018) clustering to determine feature groups prior to the analysis. Alternatively, Ke et al. (2018) defined feature groups based on a pre-trained gradient boosting decision tree (GBDT) (Friedman, 2001). Feature grouping as a preprocessing step not only increases the complexity and raises practical considerations, but also limits the optimality of the selected features in subsequent analysis. In this study, we propose an end-to-end solution to learn expressive feature groups. Moreover, we introduce a network architecture to exploit interrelations within the feature groups to reduce the network complexity and to train deeper representations.
30
+
31
+ ![](images/c1d29b2cea3d35501f1bef3d00700d77364f884f1a3ac447f57fd5a8e7118523.jpg)
32
+ Figure 1: The GMLP network architecture.
33
+
34
+ # 3 PROPOSED METHOD
35
+
36
+ # 3.1 ARCHITECTURE OVERVIEW
37
+
38
+ In this paper, we propose GMLP which intuitively can be broken down to three stages: $( i )$ selecting expressive feature groups, $( i i )$ learning dynamics within each group individually, and (iii) merging information between groups as the network grows in depth (see Figure 1). In this architecture, expressive groups are jointly selected during the training phase. Furthermore, GMLP is leveraging feature groups and using local group-wise weight layers to significantly reduce the number of parameters. While the suggested idea can be materialized as different architectures, in the current study, we suggest organization of the network as architectures resembling a binary tree spanning from leaves (i.e., features) to a certain abstraction depth closer to the root2. As the network grows deeper, after each local group-wise weight layer, half of the groups are merged using pooling operations, effectively reducing the width of the network while increasing the receptive field. At the last layer, all features within all groups are concatenated into a dense feature vector fed to the output layer.
39
+
40
+ # 3.2 NOTATION
41
+
42
+ We consider the generic problem of supervised classification based on a dataset of feature and target pairs, $\mathcal { D }$ : $\left( \pmb { x } _ { 1 : N } , \pmb { y } _ { 1 : N } \right)$ , where $\pmb { x } _ { i } \in \Re ^ { d }$ , $y _ { i } \in \{ 1 \ldots C \}$ , and $N$ is the number of dataset samples. Furthermore, we define group size, $m$ , as the number of neurons or elements within each group, and group count, $k$ , as the number of selected groups which are essentially subsets of input features. Also, $L$ is used to refer to the total depth of a network. We use $\pmb { z } _ { i } ^ { l } \in \Re ^ { m }$ to refer to activation values of group $i$ in layer $l$ . In this paper, we define all vectors as column vectors.
43
+
44
+ # 3.3 NETWORK LAYERS
45
+
46
+ In this section, we present the formal definition of different GMLP network layers. The very first layer of the network, Group-Select, is responsible for organizing features into $k$ groups of size $m$ each. A routing matrix, $\Psi$ , is used for connecting each neuron within each group to exactly one feature in the feature set:
47
+
48
+ $$
49
+ z _ { 1 : k } ^ { 0 } = \Psi x ,
50
+ $$
51
+
52
+ where $\Psi \in \{ 0 , 1 \} ^ { k m \times d }$ is a sparse matrix determining features that are present in each group. As we are interested in jointly learning $\Psi$ during the training phase, we use the following continuous relaxation:
53
+
54
+ $$
55
+ \Psi _ { i , j } \approx \frac { \exp ( \psi _ { i , j } / \tau ) } { \sum _ { j ^ { \prime } = 1 } ^ { j ^ { \prime } = d } \exp ( \psi _ { i , j ^ { \prime } } / \tau ) } .
56
+ $$
57
+
58
+ In this equation, $\psi$ is a real-valued matrix reparameterizing the routing matrix through a softmax operation with temperature, $\tau$ . The lower the temperature, the more (2) converges to the desired discrete and sparse binary routing matrix. Note that, in the continuous relaxation, the matrix $\psi$ can be optimized via the backpropagation of gradients from classification loss terms. In the next section, we provide further detail on temperature annealing schedules as well as other techniques to enhance the $\Psi$ approximation.
59
+
60
+ Based on selected groups, we suggest local fully-connected weight layers for each group: Group-FC. The goal of Group-FC is to extract higher-level representations using the selected expressive feature subsets. This operation is usually followed by non-linearity functions (e.g., ReLU), normalization operations (e.g, Batch Norm), and dropout. Formally, Group-FC can be defined as:
61
+
62
+ $$
63
+ \begin{array} { r } { \pmb { z } _ { i } ^ { l + 1 } = f ( W _ { i } ^ { l } \pmb { z } _ { i } ^ { l } + \pmb { b } _ { i } ^ { l } ) , } \end{array}
64
+ $$
65
+
66
+ where $W _ { i } ^ { l } \in \Re ^ { m \times m }$ and $\pmb { b } _ { i } ^ { l } \in \Re ^ { m }$ are the weight matrix and bias vector, applied on group $i$ at layer $l$ Here, $f$ represents other subsequent operations such as non-linearity, normalization, and dropout.
67
+
68
+ Lastly, Group-Pool is defined as an operation which merges representations of two groups into a single group, reducing network width by half while increasing the effective receptive field:
69
+
70
+ $$
71
+ \begin{array} { r } { z _ { i } ^ { l + 1 } = p o o l ( z _ { i } ^ { l } , z _ { i + k / 2 ^ { l + 1 } } ^ { l } ) , } \end{array}
72
+ $$
73
+
74
+ where $z _ { i } ^ { l }$ and $z _ { i + k / 2 } ^ { l }$ are the ith group from the first and second halves, respectively; and pool is a pooling function from $\Re ^ { 2 m }$ to $\Re ^ { m }$ . In this study, we explore different variants of pooling functions such as max pooling, average pooling, or using linear weight layers as transformations from $\Re ^ { 2 m }$ to $\Re ^ { m }$ . Please note that while we use a similar terminology as pooling in convolutional networks, the pooling operation explained here is not applied location-wise, but instead it is applied feature-wise, between different groups pairs.
75
+
76
+ The values of $m$ and $k$ are closely related to the number and order of feature interactions for a certain task. Using proper $m$ and $k$ values enables us to reduce the parameter space while maintaining the model complexity required to solve the task. However, finding the ideal $m$ and $k$ directly from a given dataset is a very challenging problem. In this work, we treat $m$ and $k$ as hyperparameters to be found by a hyperparameter search.
77
+
78
+ # 3.4 TRAINING
79
+
80
+ We define the objective function to be used for end-to-end training of weights as well as the routing matrix as:
81
+
82
+ $$
83
+ L = - \frac { 1 } { N } \sum _ { i } \sum _ { c } y _ { i , c } \log ( F _ { \theta } ( \pmb { x } _ { i } ) ) + \lambda H ( \psi ) + \alpha \sum _ { \omega \in \theta } | | \omega | | _ { 2 } ^ { 2 } .
84
+ $$
85
+
86
+ In this objective function, the first term is the standard cross-entropy classification loss where $F _ { \theta }$ denotes the GMLP network as a function with parameters $\theta$ , and $N$ is the number of training samples used. The second term is an entropy loss over the distribution of the routing matrix that is weighted by the hyperparameter $\lambda$ :
87
+
88
+ $$
89
+ H ( \psi ) = - \frac { 1 } { d } \sum _ { j = 1 } ^ { j = d } \sum _ { i = 1 } ^ { i = k m } \frac { \exp ( \psi _ { i , j } ) } { \sum _ { j ^ { \prime } = 1 } ^ { j ^ { \prime } = d } \exp ( \psi _ { i , j ^ { \prime } } ) } \mathrm { l o g } ( \frac { \exp ( \psi _ { i , j } ) } { \sum _ { j ^ { \prime } = 1 } ^ { j ^ { \prime } = d } \exp ( \psi _ { i , j ^ { \prime } } ) } ) .
90
+ $$
91
+
92
+ $H ( \psi )$ is minimizing the entropy corresponding to the distribution of $\psi$ regardless of the temperature used for $\Psi$ approximation. Accordingly, $\lambda$ can be viewed as a hyperparameter and as an additional method for encouraging sparse $\Psi$ matrices. The last term in (5) is an L-2 regularization term with the hyperparameter $\alpha$ to control the magnitude of parameters in layer weights and in $\psi$ . Note that without the L-2 regularization term, $\psi$ elements may keep increasing during the optimization loop, since $\psi$ only appears in normalized form in the objective function of (5).
93
+
94
+ We use Adam (Kingma & Ba, 2014) optimization algorithm starting from the default 0.001 learning rate and reducing the learning rate by a factor of 5 as the validation accuracy stops improving. Regarding the temperature annealing, during the training, the temperature is exponentially decayed from 1.0 to 0.01. In order to initialize the Group-FC weights, we used Xavier initialization (Glorot & Bengio, 2010) with m for both fan-in and fan-out values. Similarly, the $\psi$ matrix is initialized by setting the fan-in equal to $d$ and fan-out to $k m$ .
95
+
96
+ Further detail on architectures and hyperparameters used for each specific experiment as well as details on the software implementation are provided as appendices to this paper.
97
+
98
+ # 3.5 ANALYSIS
99
+
100
+ The computational complexity of GMLP at the prediction time can be written as (for simplicity, ignoring bias and pooling terms):
101
+
102
+ $$
103
+ k m + k m ^ { 2 } + \frac { k m ^ { 2 } } { 2 } + \frac { k m ^ { 2 } } { 4 } + . . . + \frac { k m ^ { 2 } } { 2 ^ { L - 1 } } + C \frac { k m } { 2 ^ { L - 1 } } .
104
+ $$
105
+
106
+ In this series, the first term, $k m$ , is the work required to organize features to groups. The subsequent terms, except the last term, are representing the computational cost of local fully-connected operations at each layer. The last term is the complexity of the output layer transformation from the concatenated features to the number of classes. Therefore, the computational complexity of GMLP at the prediction time can be written as with a similar network $\begin{array} { r } { \mathcal { O } ( k m ^ { 2 } + \frac { C k m } { 2 L - 1 } ) } \end{array}$ . In comparison, the computational complexity of an MLP
107
+
108
+ $$
109
+ k m d + k ^ { 2 } m ^ { 2 } + \frac { k ^ { 2 } m ^ { 2 } } { 2 } + \frac { k ^ { 2 } m ^ { 2 } } { 4 } + . . . + \frac { k ^ { 2 } m ^ { 2 } } { 2 ^ { L - 1 } } + C \frac { k m } { 2 ^ { L - 1 } } ,
110
+ $$
111
+
112
+ where the first term is the work required for the first network layer from $d$ to $k m$ neurons, the second term is corresponding to a hidden layer of size $k m$ , and so forth. The last term is the complexity $\begin{array} { r } { \mathcal { O } ( k m d + { k ^ { 2 } } { m ^ { 2 } } + \frac { C k m } { 2 { L - 1 } } ) } \end{array}$ r to the case of GMLP. The overall work required from this equa) complexity. This is substantially higher than GMLP, for typical $k , d .$ is of, and $C$ values.
113
+
114
+ Additionally, the density of the Group-FC layer connections can be calculated as: $\begin{array} { r } { \frac { k m ^ { 2 } } { k ^ { 2 } m ^ { 2 } } = \frac { 1 } { k } } \end{array}$ , which is very small for reasonably large number of $k$ values used in our experiments. Also, assuming pooling operations in every other layer, the receptive field size or the maximum number of features impacting a neuron at layer $l$ can be written as $2 ^ { { \hat { l } } - 1 } m$ . For instance, a neuron in the first layer of the network is only connected to $m$ features, and a neuron in the second layer is connected to two groups or $2 m$ features and so forth.
115
+
116
+ # 4 EXPERIMENTS
117
+
118
+ # 4.1 EXPERIMENTAL SETUP
119
+
120
+ The proposed method is evaluated on five different real-world datasets, covering various domains and applications: permutation invariant CIFAR-10 (Krizhevsky et al., 2009), human activity recognition (HAPT) (Anguita et al., 2013), diabetes classification (Kachuee et al., 2019), UCI Landsat (Dua & Graff, 2017), and MIT-BIH arrhythmia classification (Moody & Mark, 2001) datasets. Additionally, we use MNIST (LeCun et al., 2010) and a synthesized dataset to provide further insight into the operation of GMLP (see Section 4.4). Table 1 presents a summary of datasets used in this study. Regarding the CIFAR-10 dataset, we permute the image pixels to discard pixel coordinates in our experiments. Note that the permutation is not changing across samples, it is merely a fixed random ordering used to remove pixel coordinates for each experiment. For all datasets, basic statistical normalization with $\mu = 0$ and $\sigma = 1$ is used to normalize features as a preprocessing step. The only exception is CIFAR-10 for which we used the standard channel-wise normalization and standard data augmentation (i.e., random crops and random horizontal flips). The standard test and train data splits were used as dictated by dataset publishers. In cases that the separated sets are not provided, test and train subsets are created by randomly splitting samples to $2 0 \%$ for test and the rest for training/validation.
121
+
122
+ Table 1: Summary of datasets used in our experiments.
123
+
124
+ <table><tr><td>Dataset</td><td># Train Samples</td><td># Test Samples</td><td>#Features</td><td># Classes</td><td>Domain</td></tr><tr><td>CIFAR-10a (Krizhevsky et al.,2009)</td><td>50,000</td><td>10.000</td><td>3072</td><td>10</td><td>Image Classification</td></tr><tr><td>HAPT (Anguita et al., 2013)</td><td>6,002</td><td>2,451</td><td>561</td><td>5</td><td>Activity Recognition</td></tr><tr><td>Diabetes (Kachuee et al., 2019)</td><td>73,649</td><td>18,413</td><td>45</td><td>3</td><td>Disease Diagnosis</td></tr><tr><td>Landsat (Dua &amp; Graff,2017)</td><td>4,435</td><td>2,000</td><td>36</td><td>6</td><td>Satellite Imaging</td></tr><tr><td>MIT-BIH(Moody &amp; Mark,2001)</td><td>87,554</td><td>21,892</td><td>187</td><td>5</td><td>Time Series</td></tr><tr><td>MNIST (LeCun et al., 2010)</td><td>60,000</td><td>10,000</td><td>784</td><td>10</td><td>Digit Classification</td></tr><tr><td>Synthesized (Section 4.4)</td><td>5,120</td><td>1,280</td><td>6</td><td>2</td><td>See Figure 8</td></tr></table>
125
+
126
+ aPermuted version, i.e. pixel coordinates are ignored.
127
+
128
+ We compare the performance of the proposed method with recent related work including SelfNormalizing Neural Networks (SNN) (Klambauer et al., 2017), Sparse Evolutionary Training (SET) (Mocanu et al., $2 0 1 8 ) ^ { 3 }$ , Feature Grouping as a Stochastic Regularizer (in this paper, denoted as FGR) (Aydore et al., 2019)4 as well as the basic dropout regularized and batch normalized MLPs. In order to ensure a fair comparison, we adapted source codes provided by other work to be compatible with our data loader and preprocessing modules.
129
+
130
+ Furthermore, for each method, we conducted an extensive hyperparameter search using Microsoft Neural Network Intelligence (NNI) toolkit5 and the Tree-structured Parzen Estimator (TPE) tuner (Bergstra et al., 2011) covering different architectural and learning hyperparameters for each case. More detail on hyperparameter search spaces and specific architectures used in this paper is provided in Appendix A and Appendix B. We run each case using the best hyperparameter configuration eight times and report mean and standard deviation values.
131
+
132
+ # 4.2 RESULTS
133
+
134
+ Table 2 presents a comparison between the proposed method (GMLP) and 4 other baselines: MLP, SNN (Klambauer et al., 2017), SET (Mocanu et al., 2018), and FGR (Aydore et al., 2019). As it can be seen from this comparison, GMLP outperforms other work, achieving state-of-the-art classification accuracies. Concerning the CIFAR-10 results, to the best of our knowledge, GMLP achieves a new state-of-the-art performance on permutation invariant CIFAR-10 augmented using the standard data augmentation. We believe that leveraging expressive feature groups enables GMLP to consistently perform better across different datasets.
135
+
136
+ To compare model complexity and performance we conduct an experiment by changing the number of model parameters and reporting the resulting test accuracies. Here, we reduce the number of parameters by reducing the width of each network; i.e. reducing the number of groups and hidden neurons for GMLP and MLP, respectively. Figure 2 shows accuracy versus the number of parameters for the GMLP and MLP baseline on CIFAR-10 and MIT-BIH datasets. Based on this figure, GMLP is able to achieve higher accuracies using significantly less number of parameters. It is consistent with the complexity analysis provided in Section 3.5. Note that in this comparison, we consider the number of parameters involved at the prediction time.
137
+
138
+ # 4.3 ABLATION STUDY
139
+
140
+ Figure 3 presents an ablation study comparing the performance of GMLP on CIFAR-10 dataset for networks trained: $( i )$ using both the temperature annealing and the entropy loss objective, (ii) using only temperature annealing without the entropy loss objective, $( i i i )$ using no temperature annealing but using the entropy loss objective, $( i v )$ not using any of the temperature annealing or the entropy loss objective. From this figure, it can be seen that excluding both techniques leads to a significantly lower performance. However, using any of the two techniques leads to relatively similar high accuracies. It is consistent with the intuition that the functionality of these techniques is to encourage learning sparse routing matrices, either using softmax temperatures or entropy regularization to achieve this. In this paper, in order to ensure sparse and low complexity routing matrices, we use both techniques simultaneously as in case $( i )$ .
141
+
142
+ Table 2: Comparison of top-1 test accuracies for GMLP and other work.
143
+
144
+ <table><tr><td></td><td colspan="5">Accuracy (%)</td></tr><tr><td>Dataset</td><td>GMLP</td><td>MLP</td><td>SNNa</td><td>SETb</td><td>FGRc</td></tr><tr><td>CIFAR-10d (Krizhevsky et al., 2009)</td><td>73.76 (±0.14)</td><td>68.15 (±0.56)</td><td>66.88 (±0.30)</td><td>72.71 (±0.29)</td><td>45.90 (±0.40)</td></tr><tr><td>HAPT (Anguita et al., 2013)</td><td>96.34 (±0.19)</td><td>95.73 (±0.38)</td><td>95.47 (±0.09)</td><td>71.35 (±0.74)</td><td>91.57 (±0.31)</td></tr><tr><td>Diabetes (Kachuee et al.,2019)</td><td>90.92 (±0.07)</td><td>90.68 (±0.06)</td><td>90.31 (±0.10)</td><td>85.07 (±0.61)</td><td>89.24 (±0.08)</td></tr><tr><td>Landsat (Dua &amp; Graff,2017)</td><td>91.54 (±0.16)</td><td>91.21 (±0.44)</td><td>91.37 (±0.21)</td><td>91.03 (±0.56)</td><td>90.70 (±0.17)</td></tr><tr><td>MIT-BIH(Moody &amp; Mark,2001)</td><td>98.74 (±0.04)</td><td>98.65 (±0.01)</td><td>98.56 (±0.02)</td><td>98.10 (±0.01)</td><td>98.13 (±0.03)</td></tr></table>
145
+
146
+ aSelf-Normalizing Neural Networks (Klambauer et al., 2017) bSparse Evolutionary Training (Mocanu et al., 2018) cFeature Grouping as a Stochastic Regularizer (Aydore et al., 2019) dPermuted version, i.e. pixel coordinates are ignored.
147
+
148
+ ![](images/d26c4b320c2c398b02009e440c592db21896536976c571200b75f1d20484e65b.jpg)
149
+ Figure 2: Accuracy versus number of parameters for this work (GMLP) and the MLP baseline: (a) CIFAR-10 dataset, (b) MIT-BIH dataset. The $\mathbf { X }$ -axis is in a logarithmic scale
150
+
151
+ Figure 4 shows a comparison between GMLP models trained on CIFAR-10 using different pooling types: $( i )$ linear transformation, $( i i )$ max pooling, and $( i i i )$ average pooling. As it can be seen from this comparison, while there are slight differences in the convergence speed of using different pooling types, all of them achieve relatively similar accuracies. In our experiments, we decided to use max pooling and average pooling as they provide reasonable results without the need to introduce additional parameters required for the linear pooling method.
152
+
153
+ Figure 5 shows learning curves for training CIFAR-10 GMLP models using different group sizes. As it can be seen from this figure, using very small group sizes would cause a reduction in the final accuracy. At the other extreme, the improvement achieved using larger values is negligible for $m$ values more than 16. Finally, Figure 6 shows a comparison between learning curves for using a different number of groups. Using very small $k$ values result in a significant reduction in performance. However, the rate of performance gains for using more groups is very small for $k$ of more than 1536. Note that the number of model parameters and compute scales linearly with $k$ and quadratically with $m$ (see Section 3.5).
154
+
155
+ ![](images/ec451b5dcc3d15a4b055447f394e6b8be9a5fa4bfe08e4a086a4fdc284d82bb0.jpg)
156
+ Figure 3: Ablation study demonstrating the impact of temperature annealing and entropy loss terms.
157
+
158
+ ![](images/31eb22c5a65b11f8db055dab3da98be8c4fff744e3c6ce3eb7019fda6b37313a.jpg)
159
+ Figure 5: Ablation study on the impact of using different group sizes $( m )$ . For this experiment, we used $k { = } 1 5 3 6$ .
160
+
161
+ ![](images/f5d07291db61bdf6e202b4af44e455999a04c9bd2e363b9f778a6200f99f31b6.jpg)
162
+ Figure 4: Ablation study demonstrating the impact of different pooling functions.
163
+ Figure 6: Ablation study on the impact of using different number of groups $( k )$ . For this experiment, we used $m { = } 1 6$ .
164
+
165
+ # 4.4 EXPERIMENTS ON MNIST AND SYNTHESIZED DATA
166
+
167
+ MNIST dataset (LeCun et al., 2010) is used to visually inspect the performance of the Group-Select layer. Figure 7 shows a heat-map of how frequently each pixel is selected across all feature groups for: $( a )$ original MNIST samples, (b) MNIST samples where the lower-half is replaced by Gaussian noise. From Figure 7a, it can be seen that most groups are selecting pixels within the center of the frame, effectively discarding margin pixels. This is consistent with other work which show the importance of different locations for MNIST images (Kachuee et al., 2018). Apart from this, in Figure 7b, a version of the MNIST dataset is used in which half of the frame does not provide any useful information for the downstream classification task. From this figure, GMLP is not selecting any features to be used from the lower region.
168
+
169
+ In order to show the effectiveness of GMLP, we synthesized a dataset which has intrinsic and known expressive feature groups. Specifically, we used a simple Bayesian network as depicted in Figure 8. This network consists of six binary features, A to F, interacting with each other as specified by the graph edges, which determine the distribution of the target node, J. The graph and conditionals are designed such that each of the nodes in the second level take the XOR value of their parents with a $9 9 \%$ probability. The target node, J, is essentially one with a high probability if at least two of the second level nodes are one. We synthesized dataset by sampling 6,400 samples from the network (1,280 samples for test and the rest of training/evaluation). On this dataset, we trained a very simple GMLP consisting of four groups of size two, one group-wise fully-connected layer, and an output layer. Figure 9 shows the features selected for each group after the training phase (i.e., the $\Psi$ matrix).
170
+
171
+ ![](images/be34d4ab1e56d0743796f3b972d79052ac656ff4def94a3af94f04280b784cb3.jpg)
172
+ Figure 7: MNIST visualization of pixels selected by the Group-Select layer: (a) using complete images as input, (b) using images that the lower half is replaced by Gaussian noise. In this figure, warmer colors represent pixels being being present in more groups.
173
+
174
+ From this figure, the Group-Select layer successfully learns to detect the feature pairs that are interacting, enabling the Group-FC layers to decode the non-linear XOR relations.
175
+
176
+ ![](images/3028e5791c3271e74e91ac8dd61f67f7a45ce591feb1177f4985246c80008720.jpg)
177
+
178
+ $\begin{array} { l l } { P ( G = A \oplus B ) = 0 . 9 9 } & { , P ( G \neq A \oplus B ) = 0 . 0 1 } \\ { P ( H = C \oplus D ) = 0 . 9 9 } & { , P ( H \neq C \oplus D ) = 0 . 0 1 } \\ { P ( I = E \oplus F ) = 0 . 9 9 } & { , P ( I \neq E \oplus F ) = 0 . 0 1 } \end{array}$ $\begin{array} { l } { P [ J = ( G \land H ) \lor ( G \land I ) \lor ( H \land I ) ] = 0 . 9 9 } \\ { P [ J \neq ( G \land H ) \lor ( G \land I ) \lor ( H \land I ) ] = 0 . 0 1 } \end{array}$
179
+
180
+ ![](images/98b30235aff7dc90e1118b185b0ecf3d8c34a1bc9f40e599bc9dde9753a54ae8.jpg)
181
+ Figure 8: The Bayesian network and conditionals used to generate the synthesized dataset of binary features A-F and target J.
182
+ Figure 9: Visualization of the selected features within each group. Every two consecutive rows show features selected for a certain group.
183
+
184
+ # 5 DISCUSSION
185
+
186
+ Intuitively, training a GMLP model with certain groups can be viewed as a prior assumption over the number and order of interactions between the features. It is a reasonable prior assumption as in many natural datasets, a conceptual hierarchy exists where only a limited number of features interact with each other. Furthermore, it is consistent with the discoveries made in understanding the human decision-making process; finding that we are only able to consider at most nine factors at the same time during a decision making process (Cowan, 2001; Baddeley, 1994).
187
+
188
+ Additionally, GMLP can be considered as a more general neural counterpart of random forests. Both models use different subsets of features (i.e., groups) and learn interactions within each group. One major difference between the two methods is the fact that GMLP combines information between different groups using pooling operations, while random forest uses the selected features to train an ensemble of independent trees on each group. From another perspective, the idea of studying feature groups is closely related to causal models such as Bayesian networks and factor graphs (Darwiche, 2009; Neapolitan et al., 2004; Clifford, 1990). These methods are often impractical for large-scale problems, because without a prior over the causal graph, they require an architecture search of the NP-complete complexity or more.
189
+
190
+ # 6 CONCLUSION
191
+
192
+ In this paper, we proposed GMLP as a solution for deep learning in domains where the feature interactions are not known as prior and do not admit the use of convolutional or other techniques leveraging domain priors. GMLP jointly learns expressive feature combinations and employs groupwise operations to reduce the network complexity. We conducted extensive experiments demonstrating the effectiveness of the proposed idea and compared the achieved performances with state-of-the-art methods in the literature.
193
+
194
+ # REFERENCES
195
+
196
+ Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra, and Jorge Luis Reyes-Ortiz. A public domain dataset for human activity recognition using smartphones. In Esann, 2013.
197
+
198
+ Sergul Aydore, Bertrand Thirion, and Gael Varoquaux. Feature grouping as a stochastic regularizer for high-dimensional structured data. In International Conference on Machine Learning, pp. 385–394, 2019.
199
+
200
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
201
+
202
+ Alan Baddeley. The magical number seven: Still magic after all these years? 1994.
203
+
204
+ James S Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyper-parameter optimization. In Advances in neural information processing systems, pp. 2546–2554, 2011.
205
+
206
+ Leo Breiman. Random forests. Machine learning, 45(1):5–32, 2001.
207
+
208
+ Peter Clifford. Markov random fields in statistics. Disorder in physical systems: A volume in honour of John M. Hammersley, 19, 1990.
209
+
210
+ Nelson Cowan. The magical number 4 in short-term memory: A reconsideration of mental storage capacity. Behavioral and brain sciences, 24(1):87–114, 2001.
211
+
212
+ Adnan Darwiche. Modeling and reasoning with Bayesian networks. Cambridge university press, 2009.
213
+
214
+ Sourya Dey, Kuan-Wen Huang, Peter A Beerel, and Keith M Chugg. Characterizing sparse connectivity patterns in neural networks. In 2018 Information Theory and Applications Workshop (ITA), pp. 1–9. IEEE, 2018.
215
+
216
+ Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive. ics.uci.edu/ml.
217
+
218
+ Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pp. 1189–1232, 2001.
219
+
220
+ 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, pp. 249–256, 2010.
221
+
222
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http: //www.deeplearningbook.org.
223
+
224
+ Andrés Hoyos-Idrobo, Gaël Varoquaux, Jonas Kahn, and Bertrand Thirion. Recursive nearest agglomeration (rena): fast clustering for approximation of structured signals. IEEE transactions on pattern analysis and machine intelligence, 41(3):669–681, 2018.
225
+
226
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
227
+
228
+ Mohammad Kachuee, Sajad Darabi, Babak Moatamed, and Majid Sarrafzadeh. Dynamic feature acquisition using denoising autoencoders. IEEE transactions on neural networks and learning systems, 2018.
229
+
230
+ Mohammad Kachuee, Kimmo Karkkainen, Orpaz Goldstein, Davina Zamanzadeh, and Majid Sarrafzadeh. Nutrition and health data for cost-sensitive learning. arXiv preprint arXiv:1902.07102, 2019.
231
+
232
+ Guolin Ke, Jia Zhang, Zhenhui Xu, Jiang Bian, and Tie-Yan Liu. Tabnn: A universal neural network solution for tabular data. 2018.
233
+
234
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
235
+
236
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
237
+
238
+ Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In Advances in neural information processing systems, pp. 971–980, 2017.
239
+
240
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
241
+
242
+ Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. AT&T Labs [Online]. Available: http://yann. lecun. com/exdb/mnist, 2:18, 2010.
243
+
244
+ Decebal Constantin Mocanu, Elena Mocanu, Peter Stone, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):2383, 2018.
245
+
246
+ George B Moody and Roger G Mark. The impact of the mit-bih arrhythmia database. IEEE Engineering in Medicine and Biology Magazine, 20(3):45–50, 2001.
247
+
248
+ Richard E Neapolitan et al. Learning bayesian networks, volume 38. Pearson Prentice Hall Upper Saddle River, NJ, 2004.
249
+
250
+ Oliver Richter and Roger Wattenhofer. Treeconnect: A sparse alternative to fully connected layers. In 2018 IEEE 30th International Conference on Tools with Artificial Intelligence (ICTAI), pp. 924–931. IEEE, 2018.
251
+
252
+ Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
253
+
254
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
255
+
256
+ Enzo Tartaglione, Skjalg Lepsøy, Attilio Fiandrotti, and Gianluca Francini. Learning sparse neural networks via sensitivity-driven regularization. In Advances in Neural Information Processing Systems, pp. 3878–3888, 2018.
257
+
258
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ryGs6iA5Km.
259
+
260
+ Jihun Yun, Peng Zheng, Eunho Yang, Aurelie Lozano, and Aleksandr Aravkin. Trimming the $l _ { 1 }$ regularizer: Statistical analysis, optimization, and applications to deep learning. In International Conference on Machine Learning, pp. 7242–7251, 2019.
261
+
262
+ # A HYPERPARAMETER SEARCH SPACE
263
+
264
+ Tables 3-5 present the hyperparameter search space considered for experiments on GMLP, MLP, SNN, and FGR, respectively. For the GMLP search space, the number of groups is adjusted based on the number of features and samples in each specific task. Also, the number of layers is adjusted to be compatible with the number of groups being used. Regarding the FGR experiments, due to scalability issues of the published source provided by the original authors, we were only able to train networks with at most two hidden layers. For SET, as their architecture is evolutionary i.e., prunes certain weights and adds new ones, we only explored using a different number of hidden neurons in the range of 500 to 4000.
265
+
266
+ Regarding the number of epochs, we used 2000 epochs for CIFAR-10, 1000 epochs for HAPT, 100 epochs for Diabetes, 300 epochs for Landsat, and 300 epochs for MIT-BIH experiments. The only exception is the SNN experiments where we had to reduce the learning rate to increase the stability of the training resulting in more epochs required to converge.
267
+
268
+ Table 3: Hyperparameter search space used for GMLP experiments.
269
+
270
+ <table><tr><td>Hyperparameter</td><td>Considered Values</td></tr><tr><td>Number of hidden layers</td><td>{1,2,..,8]a</td></tr><tr><td>Number of groups</td><td>16 - 4096b</td></tr><tr><td>Size of groups</td><td>4-32</td></tr><tr><td>Lambda</td><td>[10-²,104]</td></tr><tr><td>Alpha</td><td>[10-12,10-1]</td></tr><tr><td>Dropout rate</td><td>[0,1]</td></tr></table>
271
+
272
+ aThe range is adjusted based on the number of groups. bThe range is adjusted based on the number of features and sample size.
273
+
274
+ Table 4: Hyperparameter search space used for MLP and SNN experiments.
275
+
276
+ <table><tr><td>Hyperparameter</td><td>Considered Values</td></tr><tr><td>Number of hidden layers</td><td>{1,2,..,6}</td></tr><tr><td>Size of hidden layers</td><td>[0.05 × nfeatures] - [20 X nfeatures]</td></tr><tr><td>Alpha</td><td>[10-12,10-1]</td></tr><tr><td>Dropout rate</td><td>[0,1]</td></tr></table>
277
+
278
+ Table 5: Hyperparameter search space used for FGR experiments.
279
+
280
+ <table><tr><td>Hyperparameter</td><td>Considered Values</td></tr><tr><td>Number of hidden layers</td><td>{1,2}</td></tr><tr><td>Size of hidden layers</td><td>nfeatures - [50 X nfeatures]</td></tr><tr><td>Number of groups</td><td>2- nfeatures</td></tr><tr><td>Alpha</td><td>[10-12,10-1]</td></tr></table>
281
+
282
+ # B ARCHITECTURES
283
+
284
+ Table 6,7,8,9,10 show the selected architectures for GMLP, MLP, SNN, SET, and FGR, respectively. We used the following notation to indicate different layer types and parameters: $\mathtt { G S e l - k - m }$ represents a Group-Select layer selecting k groups of m features each. GFC indicates Group-FC layers, and $\operatorname { F C - x }$ represents fully-connected layer with $_ \textrm { x }$ hidden neurons. $\mathtt { G P O O 1 - x }$ is a Group-Pool layer of type $_ \textrm { x }$ (max, mean, linear, etc.). Concat is concatenation of groups used prior to the output layer in GMLP architectures. ${ \mathrm { S C } } ^ { - } \mathrm { x }$ refers to SET sparse evolutionary layer of size $_ \textrm { x }$ .
285
+
286
+ Table 6: GMLP architectures used in our experiments.
287
+
288
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Architecture</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>GSel-1536-16,GFC,ReLU,BNorm,GPool-maX,GFC,ReLU,BNorm,GPool-maX,GFC,ReLU,BNorm,GPool-max,GFC,ReLU,BNorm,Concat,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>HAPT</td><td rowspan=1 colspan=1>GSel-288-12,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,Concat,FC-5,Softmax</td></tr><tr><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>GSel-16-16,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm, GPool-mean,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,Concat,FC-3,Softmax</td></tr><tr><td rowspan=1 colspan=1>Landsat</td><td rowspan=1 colspan=1>GSel-88-16,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,Concat,FC-6,Softmax</td></tr><tr><td rowspan=1 colspan=1>MIT-BIH</td><td rowspan=1 colspan=1>GSel-240-24,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,Concat,FC-5,Softmax</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>GSel-64-16,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,GPool-mean,GFC,ReLU,BNorm,Concat,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>Synthesized</td><td rowspan=1 colspan=1>GSel-4-2,GFC,ReLU,BNorm,Concat,FC-2,Softmax</td></tr></table>
289
+
290
+ Table 7: MLP architectures used in our experiments.
291
+
292
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Architecture</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>FC-3072,ReLU,BNorm,FC-2764,ReLU,BNorm,FC-2488,ReLU,BNorm,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>HAPT</td><td rowspan=1 colspan=1>FC-106,ReLU,BNorm,FC-21,ReLU,BNorm,FC-5,SoftmaX</td></tr><tr><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>FC-45,I ReLU,BNorm,FC-45,ReLU,BNorm,FC-45,ReLU,BNorm,FC-45,ReLU,BNorm,FC-3,Softmax</td></tr><tr><td rowspan=1 colspan=1>Landsat</td><td rowspan=1 colspan=1>FC-68, ReLU,BNorm,FC-68,ReLU,BNorm,FC-68,ReLU,BNorm,FC-68,ReLU,BNorm,FC-6,Softmax</td></tr><tr><td rowspan=1 colspan=1>MIT-BIH</td><td rowspan=1 colspan=1>FC-1737,ReLU,BNorm,FC-1737,ReLU,BNorm,FC-1737,ReLU,BNorm,FC-5,Softmax</td></tr></table>
293
+
294
+ Table 8: SNN architectures used in our experiments.
295
+
296
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Architecture</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>FC-3901,SeLU,BNorm,FC-3901,SeLU,BNorm,FC-3901,SeLU,BNorm,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>HAPT</td><td rowspan=1 colspan=1>FC-510,ReLU,BNorm,FC-510,SeLU,BNorm,FC-510,SeLU,FC-5,Softmax</td></tr><tr><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>FC-105,SeLU,BNorm,FC-105,SeLU,BNorm,FC-105,SeLU,BNorm,FC-3,Softmax</td></tr><tr><td rowspan=1 colspan=1>Landsat</td><td rowspan=1 colspan=1>FC-816,SeLU,BNorm,FC-816,SeLU,BNorm,FC-6,Softmax</td></tr><tr><td rowspan=1 colspan=1>MIT-BIH</td><td rowspan=1 colspan=1>FC-1140,SeLU,BNorm,FC-1140,SeLU,BNorm,FC-1140,SeLU,BNorm,FC-5,Softmax</td></tr></table>
297
+
298
+ Table 9: SET architectures used in our experiments.
299
+
300
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1> Architecture</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1> SC-4000,SReLU,SC-1000,SReLU,SC-4000,SReLU,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>HAPT</td><td rowspan=1 colspan=1>SC-500,SReLU,SC-500,SReLU,SC-500,SReLU,FC-5,Softmax</td></tr><tr><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>SC-1000,SReLU,SC-1000,SReLU,SC-1000,SReLU,FC-3,Softmax</td></tr><tr><td rowspan=1 colspan=1>Landsat</td><td rowspan=1 colspan=1>SC-1000,SReLU,SC-1000,SReLU,SC-1000,SReLU,FC-6,Softmax</td></tr><tr><td rowspan=1 colspan=1>MIT-BIH</td><td rowspan=1 colspan=1> SC-1000,SReLU,SC-1000,SReLU,SC-1000,SReLU,FC-5,SoftmaX</td></tr></table>
301
+
302
+ Table 10: FGR architectures used in our experiments.
303
+
304
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Architecture</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>Group-256,FC-3072,ReLU,FC-10,Softmax</td></tr><tr><td rowspan=1 colspan=1>HAPT</td><td rowspan=1 colspan=1>Group-104,FC-12173,ReLU,FC-5,Softmax</td></tr><tr><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>Group-44,FC-337,ReLU,FC-3,Softmax</td></tr><tr><td rowspan=1 colspan=1>Landsat</td><td rowspan=1 colspan=1>Group-32,FC-1577,ReLU,FC-6,Softmax</td></tr><tr><td rowspan=1 colspan=1>MIT-BIH</td><td rowspan=1 colspan=1>Group-160,FC-3444,ReLU,FC-5,Softmax</td></tr></table>
305
+
306
+ # C SOFTWARE IMPLEMENTATION
307
+
308
+ Table 11 presents the list of software dependencies and versions used in our implementation. To produce results related to this paper, we used a workstation with 4 NVIDIA GeForce RTX-2080Ti GPUs, a 12 core Intel Core i9-7920X processor, and 128 GB memory. Each experiment took between about 30 minutes to 72 hours, based on the task and method being tested.
309
+
310
+ Table 11: Software dependencies.
311
+
312
+ <table><tr><td>Dependency</td><td>Version</td></tr><tr><td>python</td><td>3.7.1</td></tr><tr><td>pytorch</td><td>1.1.0</td></tr><tr><td>torchvision</td><td>0.2.1</td></tr><tr><td>cuda100</td><td>1.0</td></tr><tr><td>ipython</td><td>6.5.0</td></tr><tr><td>jupyter</td><td>1.0.0</td></tr><tr><td>numpy</td><td>1.15.4</td></tr><tr><td>nni</td><td>0.9.1.1</td></tr><tr><td>pandas</td><td>0.23.4</td></tr><tr><td>scikit-learn</td><td>0.19.2</td></tr><tr><td>scipy</td><td>1.1.0</td></tr><tr><td>pomegranate</td><td>0.11.1</td></tr><tr><td>tqdm</td><td>4.32.1</td></tr><tr><td>matplotlib</td><td>3.0.1</td></tr></table>
313
+
314
+ # D VISUAL ANALYSIS
315
+
316
+ In Figure 10, we present a visualization of the selected feature for 25 randomly selected groups in our final CIFAR-10 architecture. Red, green, and blue colors indicate which channel is selected for each location. Compared to visualizations that are frequently used for convolutional networks, as GMLP has the flexibility to select pixels at different locations and different color channels, it is not easy to find explicit patterns in this visualization. However, one noticeable pattern is that features selected from a certain color channel usually appear in clusters resembling irregularly shaped patches.
317
+
318
+ ![](images/f18122c74dd123d377ebf80f5e3ca8a9a8d30d8b9b1e3229f4a82137393c758e.jpg)
319
+ Figure 10: Visualization of pixels selected by each group for the CIFAR-10 GMLP architecture. Red, green, and blue colors indicate which channel is selected for each location. Due to space limitations, 25 random groups out of 1536 total groups visualized here.
320
+
321
+ Figure 11 shows the frequency in which each CIFAR-10 location is selected by the GMLP network. From this visualization, GMLP is mostly ignoring the border areas which can be a result of the data augmentation process used to train the network i.e., randomly cropping the center area and padding the margins.
322
+
323
+ ![](images/c6de4f1b62f90a17c1b1e28a45ef256082d0acf42fbf91947838a92f007d06e2.jpg)
324
+ Figure 11: Visualization of pixels selected by the group-select layer for the CIFAR-10 GMLP model. Warmer colors represent features that are being selected more frequently.
md/train/SkNSehA9FQ/SkNSehA9FQ.md ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OPEN VOCABULARY LEARNING ON SOURCE CODE WITH A GRAPH–STRUCTURED CACHE
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Machine learning models that take computer program source code as input typically use Natural Language Processing (NLP) techniques. However, a major challenge is that code is written using an open, rapidly changing vocabulary due to, e.g., the coinage of new variable and method names. Reasoning over such a vocabulary is not something for which most NLP methods are designed. We introduce a Graph–Structured Cache to address this problem; this cache contains a node for each new word the model encounters with edges connecting each word to its occurrences in the code. We find that combining this graph–structured cache strategy with recent Graph–Neural–Network–based models for supervised learning on code improves the models’ performance on a code completion task and a variable naming task — with over $100 \%$ relative improvement on the latter — at the cost of a moderate increase in computation time.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Computer program source code is an abundant and accessible form of data from which machine learning algorithms could learn to perform many useful software development tasks, including variable name suggestion, code completion, bug finding, security vulnerability identification, code quality assessment, or automated test generation. But despite the similarities between natural language and source code, deep learning methods for Natural Language Processing (NLP) have not been straightforward to apply to learning problems on source code (Allamanis et al., 2017).
12
+
13
+ There are many reasons for this, but two central ones are:
14
+
15
+ 1. Code’s syntactic structure is unlike natural language. While code contains natural language words and phrases in order to be human–readable, code is not meant to be a read like a natural language text. Code is written in a rigid syntax with delimiters that may open and close dozens of lines apart; it consists in great part of references to faraway lines and different files; and it describes computations that proceed in an order often quite distinct from its written order.
16
+
17
+ 2. Code is written using an open vocabulary. Natural language is mostly composed of words from a large but closed (a.k.a. fixed–size and unchanging) vocabulary. Standard NLP methods can thus perform well by fixing a large vocabulary of words before training, and labeling the few words they encounter outside this vocabulary as “unknown”. But in code every new variable, class, or method declared requires a name, and this abundance of names leads to the use of many obscure words: abbreviations, brand names, technical terms, etc.1 A model must be able to reason about these newly–coined words to understand code.
18
+
19
+ The second of these issues is significant. To give one indication: $28 \%$ of variable names contain out–of–vocabulary words in the test set we use in our experiments below. But more broadly, the open vocabulary issue in code is an acute example of a fundamental challenge in machine learning:
20
+
21
+ how to build models that can reason over unbounded domains of entities, sometimes called “open– set” learning. Despite this, the open vocabulary issue in source code has received relatively little attention in prior work.
22
+
23
+ The first issue, in contrast, has been the focus of much prior work. A common strategy in these works is to represent source code as an Abstract Syntax Tree (AST) rather than as linear text. Once in this graph–structured format, code can be passed as input to models like Recursive Neural Networks or Graph Neural Networks (GNNs) that can, in principle, exploit the relational structure of their inputs and avoid the difficulties of reading code in linear order (Allamanis et al., 2018).
24
+
25
+ Our contribution: In this paper we extend such AST–based models for source code in order to address the open vocabulary issue. We do so by introducing a Graph–Structured Cache (GSC) to handle out–of–vocabulary words. The GSC represents vocabulary words as additional nodes in the AST as they are encountered and connects them with the edges to where they are used in the code. We then process the AST+GSC with a GNN to produce outputs. See Figure 1.
26
+
27
+ We empirically evaluated the utility of a Graph–Structured Cache on two tasks: a code completion (a.k.a. fill–in–the–blank) task and a variable naming task. We found that using a GSC improved performance on both tasks at the cost of an approximately $30 \%$ increase in training time. More precisely: even when using hyperparameters optimized for the baseline model, adding a GSC to a baseline model improved its accuracy by at least $7 \%$ on the fill–in–the–blank task and $103 \%$ on the variable naming task. We also report a number of ablation results in which we carefully demonstrate the relative importance of each model component to a model’s performance.
28
+
29
+ # 2 PRIOR WORK
30
+
31
+ # REPRESENTING CODE AS A GRAPH
32
+
33
+ Given their prominence in the study of programming languages, Abstract Syntax Trees (ASTs) and parse trees are a natural choice for representing code and have been used extensively. Often models that operate on source code consume ASTs by linearizing them (usually with a depth–first traversal) as in Amodio et al. (2017), Liu et al. (2017), or Li et al. (2017) or by using AST paths as input features as in Alon et al. (2018), but they can also be processed by deep learning models that take graphs as input, as in White et al. (2016) and Chen et al. (2018) who use Recursive Neural Networks (RveNNs) (Goller & Kuchler, 1996) on ASTs. RveNNs are models that operate on tree– topology graphs, and have been used extensively for language modeling (Socher et al., 2013) and on domains similar to source code, like mathematical expressions (Zaremba et al., 2014; Arabshahi et al., 2018). They can be considered a special case of Message Passing Neural Networks (MPNNs) in the framework of Gilmer et al. (2017): in this analogy RveNNs are to Belief Propagation as MPNNs are to Loopy Belief Propagation. They can also be considered a special case of Graph Networks in the framework of Battaglia et al. (2018). ASTs also serve as a natural basis for models that generate code as output, as in Maddison & Tarlow (2014), Yin & Neubig (2017), Rabinovich et al. (2017), Chen et al. (2018), and Brockschmidt et al. (2018).
34
+
35
+ Data–flow graphs are another type of graphical representation of source code with a long history (Krinke, 2001), and they have occasionally been used to featurize source code for machine learning (Chae et al., 2017).
36
+
37
+ Most closely related to our work is the work of Allamanis et al. (2018), on which our model is heavily based. Allamanis et al. (2018) combine the data–flow graph and AST representation strategies for source code by representing code as an AST augmented with extra labeled edges indicating semantic information like data– and control–flow between variables. These augmentations yield a directed multigraph rather than just a tree,2 so in Allamanis et al. (2018) a variety of MPNN called a Gated Graph Neural Network (GGNN) (Li et al., 2016) is used to consume the Augmented AST and produce an output for a supervised learning task.
38
+
39
+ Graph-based models that are not based on ASTs are also sometimes used for analyzing source code, like Conditional Random Fields for joint variable name prediction in (Raychev et al., 2015).
40
+
41
+ # REASONING ABOUT OPEN SETS
42
+
43
+ The question of how to gracefully reason over an open vocabulary is longstanding in NLP. Character–level embeddings are a typical way deep learning models handle this issue, whether used on their own as in Kim et al. (2016), or in conjunction with word–level embedding Recurrent Neural Networks (RNNs) as in Luong & Manning (2016), or in conjunction with an $n _ { \mathrm { ~ } }$ –gram model as in Bojanowski et al. (2017). Another approach is to learn new word embeddings on–the–fly from context (Kobayashi et al., 2016). Caching novel words, as we do in our model, is yet another strategy (Grave et al., 2017) and has been used to augment N–gram models for analyzing source code (Hellendoorn & Devanbu, 2017).
44
+
45
+ In terms of producing outputs over variable–sized input and outputs, also known as open–set learning, attention-based pointer mechanisms were introduced in Vinyals et al. (2015) and have been used for tasks on code, e.g. in Bhoopchand et al. (2016). Such methods have been used to great effect in NLP in e.g. Gulcehre et al. (2016) and Merity et al. (2017). The latter’s pointer sentinel mixture model is the direct inspiration for the readout function we use in the Variable Naming task below.
46
+
47
+ Using graphs to represent arbitrary collections of entities and their relationships for processing by deep networks has been widely used (Johnson, 2017; Bansal et al., 2017; Pham et al., 2018; Lu et al., 2017), but to our knowledge we are the first to use a graph–building strategy for reasoning (at train and test time) about an open vocabulary of words.
48
+
49
+ # 3 PRELIMINARIES
50
+
51
+ # 3.1 ABSTRACT SYNTAX TREES
52
+
53
+ An Abstract Syntax Tree (AST) is a graph — specifically an ordered tree with labeled nodes — that is a representation of some written computer source code. There is a 1–to–1 relationship between source code and an AST of that source code, modulo comments and whitespace in the written source code.
54
+
55
+ Typically the leaves of an AST correspond to the tokens written in the source code, like variable and method names, while the non–leaf nodes represent syntactic language constructs like function calls or class definitions. The specific node labels and construction rules of ASTs can differ between or within languages. The first step in Figure 1 shows an example.
56
+
57
+ # 3.2 GRAPH NEURAL NETWORKS
58
+
59
+ The term Graph Neural Network (GNN) refers to any deep, differentiable model that takes graphs as input. Many GNNs have been presented in the literature, and several nomenclatures have been proposed for describing the computations they perform, in particular in Gilmer et al. (2017) and Battaglia et al. (2018). Here we give a brief recapitulation of supervised learning with GNNs using the Message Passing Neural Network framework from Gilmer et al. (2017).
60
+
61
+ A GNN is trained using pairs $( G , y )$ where $G = ( V , E )$ is a graph defined by its vertices $V$ and edges $E$ , and $y$ is a label. $y$ can be any sort of mathematical object: scalar, vector, another graph, etc. In the most general case, each graph in the dataset can be a directed multigraph, each with a different number of nodes and different connectivity. In each graph, each vertex $v \in V$ has associated features $\mathbf { \boldsymbol { x } } _ { v }$ , and each edge $( v , w ) \in E$ has features $e _ { v w }$ .
62
+
63
+ A GNN produces a prediction $\hat { y }$ for the label $y$ of a graph $G = ( V , E )$ by the following procedure:
64
+
65
+ 1. A function $S$ is used to initialize a hidden state vector $h _ { v } ^ { 0 }$ for each vertex $v \in V$ as a function of the vertex’s features (e.g., if the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { v } }$ are words, $S$ could be a word embedding function):
66
+
67
+ $$
68
+ \begin{array} { r } { h _ { v } ^ { 0 } = S ( \pmb { x } _ { v } ) } \end{array}
69
+ $$
70
+
71
+ 2. For each round $t$ out of $T$ total rounds:
72
+
73
+ (a) Each vertex $v \in V$ receives the vector $\boldsymbol { m } _ { v } ^ { t + 1 }$ , which is the sum of “messages” from its neighbors, each produced by a function $M _ { t }$ :
74
+
75
+ $$
76
+ m _ { v } ^ { t + 1 } = \sum _ { w \in \mathrm { n e i g h b o r s ~ o f } v } M _ { t } ( h _ { v } ^ { t } , h _ { w } ^ { t } , e _ { v w } ) .
77
+ $$
78
+
79
+ (b) Each vertex $v \in V$ updates its hidden state based on the message it received via a function $U _ { t }$ :
80
+
81
+ $$
82
+ h _ { v } ^ { t + 1 } = U _ { t } ( h _ { v } ^ { t } , m _ { v } ^ { t + 1 } ) .
83
+ $$
84
+
85
+ 3. A function $R$ , the “readout function”, produces a prediction based on the hidden states generated during the message passing (usually just those at from time $T$ ):
86
+
87
+ $$
88
+ \hat { y } = R ( \{ h _ { v } ^ { t } | v \in V , t \in 1 , . . . , T \} ) .
89
+ $$
90
+
91
+ GNNs differ in how they implement $S , M _ { t } , U _ { t }$ , and $R$ . But all these functions are differentiable and most are parameterized, so the model is trainable via stochastic gradient descent of a loss function on $y$ and $\hat { y }$ .
92
+
93
+ # 4 MODEL
94
+
95
+ Our model consumes an input instance of source code and produces an output for a supervised learning task via the following five steps, sketched in Figure 1:
96
+
97
+ 1. Parse the source code (snippet, file, repository, version control history, etc.) into an Abstract Syntax Tree.
98
+ 2. Add edges of varying types (details in Appendix Table 8) to this AST that represent semantic information like data– and control– flow, in the spirit of Allamanis et al. (2018). Also add the reversed version of all edges with their own edge type. This results in a directed multigraph called an Augmented AST.
99
+ 3. Further augment the Augmented AST by adding a Graph–Structured Cache. That is, add a node to the Augmented AST for each vocabulary word encountered in the input instance. Then connect each such “cache node” with an edge (of edge type WORD USE) to all variables whose names contain its word.
100
+ 4. Vectorize the Augmented $\mathrm { A S T } + \mathrm { G S C }$ graph into a form suitable for a GNN. (I.e. perform Step 1 from Section 3.2.) Each AST node that doesn’t represent a variable is vectorized as a learned embedding of the language construct it represents, e.g. Parameter, Method Declaration, etc. Each cache node and each node that represents a variable is vectorized as a learned linear map of the concatenation of a type embedding and a name embedding. The name embedding is a Character–Level Convolutional Neural Network (CharCNN) (Zhang et al., 2015) embedding of the word/name the node contains. The type embedding is a learned embedding of the name of the Java type of the token it contains, e.g. int, a user–defined class, etc., with cache nodes having their own unique Cacher Node type.
101
+ 5. Process the graph with a GNN, as per Section 3.2. (I.e. perform Steps 2 and 3 from Section
102
+ 3.2.) The readout functions differ depending on the task and are described in the Experiments section below.
103
+
104
+ Our main contribution to previous works is the addition of Step 3, the Graph–Structured Cache step. The combination of relational information from the cache nodes’ connections and lexical information from these nodes’ CharCNN embeddings allows the model to, in principle, flexibly reason about words it never saw during training, but also recognize words it did. E.g. it could potentially see a class named “getGuavaDictionary” and a variable named “guava dict” and both (a) utilize the fact that the word “guava” is common to both names despite having never seen this word before, and (b) exploit learned representations for words like “get”, “dictionary”, and “dict” that it has seen during training.
105
+
106
+ # 5 EXPERIMENTS
107
+
108
+ We evaluated our model, described in Section 4, on two supervised tasks: a Fill–In–The–Blank task and a Variable Naming task. For each task, we compare our model to others that differ in how they parse the code and how they treat the words they encounter. Table 1 details the different variations of the procedure in Section 4 against which we compare our model.
109
+
110
+ ![](images/fa59b4133b5607587cc70ae7b40b4e6a20f3afab3cf1561f1e3c0ebf601145cb.jpg)
111
+ Figure 1: Our model’s procedure for consuming a single input instance of source code and producing an output for a supervised learning task.
112
+
113
+ Code to reproduce all experiments is available online.3 4
114
+
115
+ # 5.1 DATA AND IMPLEMENTATION DETAILS
116
+
117
+ We chose to use Java source code as the data for our experiments as it is among the most popular programming languages in use today (TIOBE, 2018; Github, 2017). To construct our dataset, we randomly selected 18 of the 100 most popular Java repos from the Maven repository5 to serve as training data. (See Appendix Table 7 for the list.) Together these repositories contain about 500,000 non–empty, non–comment lines of code. We checked for excessive code duplication in our dataset (Lopes et al., 2017) using $\mathrm { C P D ^ { 6 } }$ and found only about $7 \%$ of the lines to be contiguous, duplicated code blocks containing more than 150 tokens.
118
+
119
+ Table 1: Nomenclature used in Experiments section. Each abbreviation describes a tweak/ablation to our full model as presented in Section 4. Using this nomenclature, our full model as described in Section 4 and shown in Figure 1 would be a “AugAST–GSC” model.
120
+
121
+ <table><tr><td colspan="2">Abbreviation</td><td>Meaning</td></tr><tr><td rowspan="2">Code Representation</td><td>AST</td><td>Skips Step 2 in Section 4.</td></tr><tr><td>AugAST</td><td>Performs Step 2 in Section 4.</td></tr><tr><td rowspan="4">Vocab Strategies</td><td>Closed Vocab</td><td>Skips Step 3 in Section 4,and instead maintains word-embedding vectors for words in a closed vo- cabulary. In Step 4, name embeddings for nodes representing variables are produced by taking the mean of the embeddings of the words in the vari- able&#x27;s name.Words outside this model&#x27;s closed vocabulary are labeled as &lt;UNK&gt;. This is the</td></tr><tr><td>CharCNN</td><td>strategy used in Allamanis et al. (2018). Skips Step 3 in Section 4.</td></tr><tr><td>Pointer Sentinel</td><td>Follows Steps 3 and 4 as described in Section 4,except it doesn&#x27;t add edges connecting cache nodes to the nodes where their word is used. In the Variable Naming task, this is equivalent to us- ing the Pointer Sentinel Mixture Model of Merity</td></tr><tr><td>GSC</td><td>et al. (2017) to produce outputs. Follows Steps 3 and 4 as described in Section 4.</td></tr><tr><td rowspan="3">Graph Neural Network</td><td>GGNN</td><td>Performs Step 5 in Section 4 using the Gated Graph Neural Network of Li et al. (2016).</td></tr><tr><td>DTNN</td><td>Performs Step 5 in Section 4 using the Deep Ten- sor Neural Network of Schuitt et al. (2017).</td></tr><tr><td>RGCN</td><td>Performs Step 5 in Section 4 using the Relational Graph Convolutional Network of Schlichtkrull et al. (2017).</td></tr></table>
122
+
123
+ We randomly chose 3 of these repositories to sequester as an “Unseen Repos” test set. We then separated out $15 \%$ of the files in the remaining 15 repositories to serve as our “Seen Repos” test set. The remaining files served as our training set, from which we separated $15 \%$ of the datapoints to act as a validation set.
124
+
125
+ Our data preprocessor builds on top of the open–source Javaparser7 library to generate ASTs of our source code and then augment the ASTs with the edges described in Appendix Table 8. We used Apache $\mathrm { { \bf M X N e t } } ^ { 8 }$ as our deep learning framework. All hidden states in the GNN contained 64 units; all GNNs ran for 8 rounds of message passing; all models were optimized using the Adam optimizer (Kingma & Ba, 2015); all inputs to the GNNs were truncated to a maximum size of 500 nodes centered on the <FILL-IN-THE-BLANK> or $\mathrm { \ < N A M E - M E > }$ tokens. About $53 \%$ of input graphs were larger than 500 nodes before truncation. The only regularization we used was early stopping — early in our experiments we briefly tried $L _ { 2 }$ and dropout regularization, but saw no effects.
126
+
127
+ We performed only a moderate amount of hyperparameter optimization, but all of it was done on the baseline models to avoid biasing our results in favor of our model. Specifically, we tuned all hyperparameters on the Closed Vocab baseline model, and also did a small amount of extra learning rate exploration for the Pointer Sentinel baseline model to try to maximize its performance.
128
+
129
+ # 5.2 THE FILL–IN–THE–BLANK TASK
130
+
131
+ In this task we randomly selected a single usage of a variable in some source code, replaced it with a <FILL-IN-THE-BLANK> token, and then asked the model to predict what variable should have been there. An example instance from our dataset is shown in Figure 2.
132
+
133
+ ![](images/69398b3fef9fe3f5b523898c2773311a427c29f26873c4f47ff60001f36d5b3c.jpg)
134
+ Figure 2: Example of a model’s procedure for completing the Fill–In–The–Blank task. Each Fill– In–The–Blank instance is created by replacing a single usage of a variable (n, in this example) with the special token <FILL-IN-THE-BLANK>. The model then processes the code as depicted in Figure 1. To produce outputs, the model’s readout function computes a soft–attention weighting over all nodes in the graph; the model’s output is the variable at the node on which it places maximal attention. In this example, if the model put maximal attention weighting on any of the green– highlighted variables, this would be a correct output. If maximal attention is placed on any other node, it would be an incorrect output. Only in–scope usages of a variable are counted as correct.
135
+
136
+ The models indicate their prediction for what variable should go in the blank by pointing with neural attention over all the nodes in the AugAST. This means all training and test instances only considered cases where the obfuscated variable appears somewhere else in the code. Single uses are rare however, since in Java variables must be declared before they are used. It also means there are sometimes multiple usages of the same, correct variable to which a model can point to get the right answer. In our dataset $78 \%$ of variables were used more two times, and $33 \%$ were used more than four times.
137
+
138
+ The models compute the attention weightings $y _ { i }$ for each Augmented AST node $i$ differently depending on the readout function of the GNN they use. Models using a GGNN as their GNN component, as all those in Table $2 \ : \mathrm { d o }$ , compute the attention weightings as per Li et al. (2016):
139
+
140
+ $$
141
+ \begin{array} { r } { \hat { y } _ { i } = \sigma \left( f _ { 1 } ( { h } _ { v } ^ { T } , { h } _ { v } ^ { 0 } ) \right) \odot f _ { 2 } ( { h } _ { v } ^ { T } ) , } \end{array}
142
+ $$
143
+
144
+ where the $f$ s are MLPs, $\boldsymbol { h } _ { v } ^ { t }$ is the hidden state of node $v$ after $t$ message passing iterations, $\sigma$ is the sigmoid function, and $\odot$ is elementwise multiplication. The DTNN and RGCN GNNs compute the attention weightings as per Schutt et al. (2017): ¨
145
+
146
+ $$
147
+ \hat { y } _ { i } = f ( h _ { v } ^ { T } ) ,
148
+ $$
149
+
150
+ where $f$ is a single hidden layer MLP. The models were trained using a binary cross entropy loss computed across the nodes in the graph.
151
+
152
+ The performance of models using our GSC versus those using other methods is reported in Table 2. For context, a baseline strategy of random guessing among all variable nodes within an edge radius of 8 of the <FILL-IN-THE-BLANK $>$ token achieves an accuracy of 0.22. We also compare the performance of different GNNs in Table 3.
153
+
154
+ # 5.3 THE VARIABLE NAMING TASK
155
+
156
+ In this task we replaced all usages of a name of a particular variable, method, class, or parameter in the code with the special token <NAME-ME $>$ , and asked the model to produce the obfuscated name (in the form of the sequence of words that compose the name). An example instance from our dataset is shown in Figure 3.
157
+
158
+ Table 2: Accuracy on the Fill–In–The–Blank task. Our model is the AugAST–GSC. The first number in each cell is the accuracy of the model, where a correct prediction is one in which the graph node that received the maximum attention weighting by the model contained the variable that was originally in the <FILL-IN-THE-BLANK $>$ spot. The second, parenthetical numbers are the top– 5 accuracies, i.e. whether the correct node was among those that received the 5 largest attentions weightings from the model. See Table 1 for explanations of the abbreviations. All models use Gated Graph Neural Networks as their GNN component.
159
+
160
+ <table><tr><td></td><td></td><td>Closed Vocab</td><td>CharCNN</td><td>GSC</td></tr><tr><td rowspan="2"> Seen repos</td><td>AST</td><td>0.57 (0.83)</td><td>0.60 (0.84)</td><td>0.89 (0.96)</td></tr><tr><td>AugAST</td><td>0.80 (0.90)</td><td>0.90 (0.94)</td><td>0.97 (0.99)</td></tr><tr><td rowspan="2">Unseen repos</td><td>AST AugAST</td><td>0.36 (0.68)</td><td>0.48 (0.80)</td><td>0.80 (0.93)</td></tr><tr><td></td><td>0.59 (0.78)</td><td>0.84 (0.92)</td><td>0.92 (0.96)</td></tr></table>
161
+
162
+ Table 3: Accuracy (and top–5 accuracy) on the Fill–In–The–Blank task, depending on which type of GNN the model uses. See Table 1 for explanations of the abbreviations. All models use AugAST as their code representation.
163
+
164
+ <table><tr><td colspan="2"></td><td>GGNN</td><td>DTNN</td><td>RGCN</td></tr><tr><td>Seen repos</td><td>Closed Vocab GSC</td><td>0.80 (0.90) 0.97 (0.99)</td><td>0.72 (0.84) 0.89 (0.95)</td><td>0.80 (0.90) 0.95 (0.98)</td></tr><tr><td>Unseen repos</td><td>Closed Vocab GSC</td><td>0.59 (0.78) 0.92 (0.96)</td><td>0.46 (0.68) 0.80 (0.89)</td><td>0.62 (0.79) 0.88 (0.95)</td></tr></table>
165
+
166
+ ![](images/b21bc85d57d3da138b5330d252092f70b403cbab07c31d848435d51028931d7a.jpg)
167
+ Figure 3: Example of a model’s procedure for completing the Variable Naming task. Each Variable Naming instance is created by replacing all uses of some variable (expectedLength, in this example) with a special $\mathrm { \ < N A M E - M E > }$ token. The model then processes the code as depicted in Figure 1. To produce outputs, the model takes the mean of the <NAME-ME> nodes’ hidden states (depicted here in orange), uses them as the initial hidden state of a Recurrent Neural Network, and unrolls this RNN to produce a name as a sequence of words.
168
+
169
+ To produce a name from the output of the GNN, our models used the readout function of Allamanis et al. (2018). This readout function computes the mean of the hidden states of the $\mathrm { < N A M E - M E > }$ nodes and passing it as the initial hidden state to a 1–layer Gated Recurrent Unit (GRU) RNN (Cho et al., 2014). This GRU is then unrolled to produce words in its predicted name, in the style of a traditional NLP decoder. We used a fixed length unrolling of 8 words, as $9 9 . 8 \%$ of names in our training set were 8 or fewer words long. The models were trained by cross entropy loss over the sequence of words in the name.
170
+
171
+ To decode each hidden state output of the GRU $^ { h }$ into a probability distribution $P _ { \mathrm { v o c a b } } ( \mathbf { w } | h )$ over words w, the Closed Vocab and CharCNN models pass $^ { h }$ through a linear layer and a softmax layer with output dimension equal to the number of words in their closed vocabularies (i.e. a traditional decoder output for NLP). In contrast, the GSC model not only has access to a fixed–size vocabulary but can also produce words by pointing to cache nodes in its Graph–Structured Cache. Specifically, it uses a decoder architecture inspired by the Pointer Sentinel Mixture Model of Merity et al. (2017): the probability of a word w being the GSC decoder’s output given that the GRU’s hidden state was $^ { h }$ is
172
+
173
+ $$
174
+ P ( \mathbf { w } | h ) = P _ { \mathrm { g r a p h } } ( \mathbf { s } | h ) P _ { \mathrm { g r a p h } } ( \mathbf { w } | h ) + ( 1 - P _ { \mathrm { g r a p h } } ( \mathbf { s } | h ) ) P _ { \mathrm { v o c a b } } ( \mathbf { w } | h )
175
+ $$
176
+
177
+ where $P _ { \mathrm { g r a p h } } ( \cdot | h )$ is a conditional probability distribution over cache nodes in the GSC and the sentinel s, and $P _ { \mathrm { v o c a b } } ( \cdot | h )$ is a conditional probability distribution over words in a closed vocabulary. $P _ { \mathrm { g r a p h } } ( \cdot | h )$ is computed by passing the hidden states of all cache nodes and the sentinel node through a single linear layer and then computing the softmax dot–product attention of these values with $^ { h }$ . $P _ { \mathrm { v o c a b } } ( \cdot | h )$ is computed as the softmax of a linear mapping of $^ { h }$ to indices in a closed vocabulary, as in the Closed Vocab and CharCNN models. If there is no cache node for w in the Augmented AST or if w is not in the model’s closed dictionary then $P _ { \mathrm { g r a p h } } ( \mathbf { w } | h )$ and $P _ { \mathrm { v o c a b } } ( \mathbf { w } | h )$ are 0, respectively.
178
+
179
+ The performance of our GSC versus other methods is reported in Table 4. More granular performance statistics are reported in Appendix Table 6. We also compare the performance of different GNNs in Table 5.
180
+
181
+ Table 4: Accuracy on the Variable Naming task. Our model is the AugAST–GSC. The first number in each cell is the accuracy of the model, where we consider a correct output to be exact reproduction of the full name of the obfuscated variable (i.e. all the words in the name and then a EOS token). The second, parenthetical numbers are the top–5 accuracies, i.e. whether the correct full name was among the 5 most probable sequences output by the model. See Table 1 for explanations of the abbreviations. All models use Gated Graph Neural Networks as their GNN component.
182
+
183
+ <table><tr><td colspan="2"></td><td>Closed Vocab</td><td>CharCNN</td><td>Pointer Sentinel</td><td>GSC</td></tr><tr><td rowspan="2"> Seen repos</td><td>AST</td><td>0.23 (0.31)</td><td>0.22 (0.28)</td><td>0.19 (0.33)</td><td>0.49 (0.67)</td></tr><tr><td>AugAST</td><td>0.19 (0.26)</td><td>0.20 (0.27)</td><td>0.26 (0.40)</td><td>0.53 (0.69)</td></tr><tr><td rowspan="2">Unseen repos</td><td>AST</td><td>0.05 (0.07)</td><td>0.06 (0.09)</td><td>0.06 (0.11)</td><td>0.38 (0.53)</td></tr><tr><td>AugAST</td><td>0.04 (0.07)</td><td>0.06 (0.08)</td><td>0.08 (0.14)</td><td>0.41 (0.57)</td></tr></table>
184
+
185
+ Table 5: Accuracy (and top–5 accuracy) on the Variable Naming task, depending on which type of GNN the model uses. See Table 1 for explanations of the abbreviations. All models use AugAST as their code representation.
186
+
187
+ <table><tr><td colspan="2"></td><td>GGNN</td><td>DTNN</td><td>RGCN</td></tr><tr><td rowspan="2">Seen repos</td><td rowspan="2">Closed Vocab GSC</td><td>0.19 (0.26)</td><td>0.23 (0.31)</td><td>0.27 (0.34)</td></tr><tr><td>0.53 (0.69)</td><td>0.33 (0.48)</td><td>0.46 (0.63)</td></tr><tr><td>Unseen repos</td><td>Closed Vocab GSC</td><td>0.04 (0.07) 0.41 (0.57)</td><td>0.06 (0.08) 0.25 (0.40)</td><td>0.06 (0.09) 0.35 (0.49)</td></tr></table>
188
+
189
+ # 6 DISCUSSION
190
+
191
+ As can be seen in Tables 2 and 4, the addition of a GSC improved performance on all tasks. Our full model, the AugAST–GSC model, outperforms the other models tested and does comparatively well at maintaining accuracy between the seen and unseen test repos on the Variable Naming task.
192
+
193
+ To some degree the improved performance from adding the GSC is unsurprising: its addition to a graph–based model is essentially just adding extra features and doesn’t remove any information or flexibility. Under a satisfactory training regime, a model could simply learn to ignore it if it is unhelpful, so its inclusion should never hurt performance. The degree to which it helps, though, especially on the Variable Naming task, suggests that a GSC is well worth using for some tasks. Moreover, the fact that the Pointer Sentinel approach shown in Table 4 performs noticeably less well than the full GSC approach suggests that the relational aspect of the GSC is key: simply having the ability to output out–of–vocabulary words without relational information about their usage appears to be much less helpful.
194
+
195
+ The downsides of using a GSC are thus primarily computational. Our GSC models ran about $30 \%$ slower than the Closed Vocab models. Since we capped the graph size at 500 nodes, the slowdown is presumably due to the large number of edges to and from the graph cache nodes. Better support for sparse operations on GPU in deep learning frameworks would be useful for alleviating this downside.
196
+
197
+ In the near term, there remain a number of design choices to explore regarding AST– and GNN– models for processing source code. Adding information about word order to the GSC might improve performance, as might constructing the vocabulary out of subwords rather than words. It also might help to treat variable types as the GSC treats words: storing them in a GSC and connecting them with edges to the variables of those types; this could be particularly useful when working with code snippets rather than fully compilable code. For the Variable Naming task, there are also many architecture choices to be explored in how to produce a sequence of words for a name: how to unroll the RNN, what to use as the initial hidden state, etc.
198
+
199
+ In the longer term, given that all results above show that augmenting ASTs with data– and control– flow edges improves performance, it would be worth exploring other static analysis concepts from the Programming Language and Software Verification literatures and seeing whether they could be usefully incorporated into Augmented ASTs. Better understanding of how Graph Neural Networks learn is also crucial, since they are central to the performance of our model and many others. Additionally, the entire domain of machine learning on source code faces the practical issue that many of the best data for supervised learning on source code — things like high–quality code reviews, integration test results, code with high test coverage, etc. — are not available outside private organizations.
200
+
201
+ # REFERENCES
202
+
203
+ Miltiadis Allamanis, Earl T. Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv:1709.06182 [cs], 2017. URL https://arxiv. org/abs/1709.06182.
204
+ Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ BJOFETxR-.
205
+ Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. A general path-based representation for predicting program properties. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2018, pp. 404–419, New York, NY, USA, 2018. ACM. ISBN 978-1-4503-5698-5. doi: 10.1145/3192366.3192412. URL http: //doi.acm.org/10.1145/3192366.3192412.
206
+ Matthew Amodio, Swarat Chaudhuri, and Thomas Reps. Neural Attribute Machines for Program Generation. arXiv:1705.09231 [cs], May 2017. URL http://arxiv.org/abs/1705. 09231.
207
+ Forough Arabshahi, Sameer Singh, and Animashree Anandkumar. Combining symbolic expressions and black-box function evaluations for training neural programs. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ Hksj2WWAW.
208
+ Trapit Bansal, Arvind Neelakantan, and Andrew McCallum. Relnet: End-to-end modeling of entities & relations. arXiv:1706.07179 [cs], 2017. URL http://arxiv.org/abs/1706. 07179.
209
+ Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vin´ıcius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, aglar Gulehre, Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish Vaswani, ¨ Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. abs/1806.01261, 2018. URL https: //arxiv.org/abs/1806.01261.
210
+
211
+ Avishkar Bhoopchand, Tim Rocktaschel, Earl T. Barr, and Sebastian Riedel. Learning python code ¨ suggestion with a sparse pointer network. abs/1611.08307, 2016. URL https://arxiv. org/abs/1611.08307.
212
+
213
+ Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. TACL, 5:135–146, 2017.
214
+
215
+ Marc Brockschmidt, Miltiadis Allamanis, Alexander L. Gaunt, and Oleksandr Polozov. Generative code modeling with graphs. abs/1805.08490, 2018. URL https://arxiv.org/abs/ 1805.08490.
216
+
217
+ Kwonsoo Chae, Hakjoo Oh, Kihong Heo, and Hongseok Yang. Automatically generating features for learning program analysis heuristics for c-like languages. Proc. ACM Program. Lang., 1 (OOPSLA):101:1–101:25, October 2017. ISSN 2475-1421. doi: 10.1145/3133925. URL http: //doi.acm.org/10.1145/3133925.
218
+
219
+ Xinyun Chen, Chang Liu, and Dawn Song. Tree-to-tree neural networks for program translation, 2018. URL https://openreview.net/forum?id ${ . } = { }$ rkxY-sl0W.
220
+
221
+ 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 Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734. Association for Computational Linguistics, 2014. doi: 10.3115/v1/D14-1179. URL http://www.aclweb.org/anthology/ D14-1179.
222
+
223
+ Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1263–1272, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/gilmer17a.html.
224
+
225
+ Github. The State of the Octoverse 2017, 2017. URL https://octoverse.github.com/.
226
+
227
+ C. Goller and A. Kuchler. Learning task-dependent distributed representations by backpropagation through structure. In Neural Networks, 1996., IEEE International Conference on, volume 1, pp. 347–352 vol.1, Jun 1996. doi: 10.1109/ICNN.1996.548916.
228
+
229
+ Edouard Grave, Moustapha Cisse, and Armand Joulin. Unbounded cache model for online language ´ modeling with open vocabulary. In NIPS, 2017.
230
+
231
+ Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. Pointing the unknown words. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 140–149. Association for Computational Linguistics, 2016. doi: 10.18653/v1/P16-1014. URL http://www.aclweb.org/anthology/ P16-1014.
232
+
233
+ Vincent J. Hellendoorn and Premkumar T. Devanbu. Are deep neural networks the best choice for modeling source code? In ESEC/SIGSOFT FSE, 2017.
234
+
235
+ Daniel D. Johnson. Learning Graphical State Transitions. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id ${ . } =$ HJ0NvFzxl.
236
+
237
+ Yoon Kim, Yacine Jernite, David Sontag, and Alexander M. Rush. Character-aware neural language models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI’16, pp. 2741–2749. AAAI Press, 2016. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3016100.3016285.
238
+
239
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. URL https://arxiv.org/abs/1412. 6980.
240
+
241
+ Sosuke Kobayashi, Ran Tian, Naoaki Okazaki, and Kentaro Inui. Dynamic Entity Representation with Max-pooling Improves Machine Reading. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, California, June 2016. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/N16-1099.
242
+
243
+ Jens Krinke. Identifying similar code with program dependence graphs. In Proceedings of the Eighth Working Conference on Reverse Engineering (WCRE’01), WCRE ’01, pp. 301–, Washington, DC, USA, 2001. IEEE Computer Society. ISBN 0-7695-1303-4. URL http://dl.acm. org/citation.cfm?id $= \mathfrak { C }$ 832308.837142.
244
+
245
+ Jian Li, Yue Wang, Irwin King, and Michael R. Lyu. Code Completion with Neural Attention and Pointer Networks. arXiv:1711.09573 [cs], November 2017. URL http://arxiv.org/abs/ 1711.09573.
246
+
247
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated Graph Sequence Neural Networks. In International Conference on Learning Representations, 2016. URL https:// arxiv.org/abs/1511.05493.
248
+
249
+ Chang Liu, Xin Wang, Richard Shin, Joseph E. Gonzalez, and Dawn Xiaodong Song. Neural code completion. 2017. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJbPBt9lg& noteId $\underline { { \underline { { \mathbf { \Pi } } } } }$ rJbPBt9lg.
250
+
251
+ Cristina V. Lopes, Petr Maj, Pedro Henrique Martins, Vaibhav Saini, Di Yang, Jakub Zitny, Hitesh Sajnani, and Jan Vitek. Dej´ avu: a map of code duplicates on github. \` PACMPL, 1:84:1–84:28, 2017.
252
+
253
+ Zhengdong Lu, Haotian Cui, Xianggen Liu, Yukun Yan, and Daqi Zheng. Object-oriented Neural Programming (OONP) for Document Understanding. arXiv:1709.08853 [cs], September 2017. URL http://arxiv.org/abs/1709.08853. arXiv: 1709.08853.
254
+
255
+ Minh-Thang Luong and Christopher D. Manning. Achieving Open Vocabulary Neural Machine Translation with Hybrid Word-Character Models. arXiv:1604.00788 [cs], April 2016. URL http://arxiv.org/abs/1604.00788.
256
+
257
+ Chris J. Maddison and Daniel Tarlow. Structured generative models of natural source code. pp. II–649–II–657, 2014. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3044805. 3044965.
258
+
259
+ Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer Sentinel Mixture Models. In International Conference on Learning Representations, 2017. URL https:// openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Byj72udxe.
260
+
261
+ Trang Pham, Truyen Tran, and Svetha Venkatesh. Graph Memory Networks for Molecular Activity Prediction. arXiv:1801.02622 [cs], 2018. URL http://arxiv.org/abs/1801.02622.
262
+
263
+ Maxim Rabinovich, Mitchell Stern, and Dan Klein. Abstract syntax networks for code generation and semantic parsing. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1139–1149. Association for Computational Linguistics, 2017. doi: 10.18653/v1/P17-1105. URL http://www.aclweb.org/ anthology/P17-1105.
264
+
265
+ Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from ”big code”. In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’15, pp. 111–124, New York, NY, USA, 2015. ACM. ISBN 978- 1-4503-3300-9. doi: 10.1145/2676726.2677009. URL http://doi.acm.org/10.1145/ 2676726.2677009.
266
+
267
+ Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling Relational Data with Graph Convolutional Networks. arXiv:1703.06103 [cs, stat], March 2017. URL http://arxiv.org/abs/1703.06103.
268
+
269
+ Kristof T. Schutt, Farhad Arbabzadah, Stefan Chmiela, Klaus R. M ¨ uller, and Alexandre Tkatchenko.¨ Quantum-chemical insights from deep tensor neural networks. In Nature communications, 2017.
270
+
271
+ Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1631–1642, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/D13-1170.
272
+
273
+ TIOBE. TIOBE Index for September 2018, 2018. URL https://www.tiobe.com/ tiobe-index/.
274
+
275
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2692–2700. Curran Associates, Inc., 2015. URL http://papers.nips. cc/paper/5866-pointer-networks.pdf.
276
+
277
+ M. White, M. Tufano, C. Vendome, and D. Poshyvanyk. Deep learning code fragments for code clone detection. In 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 87–98, Sept 2016. URL http://www.cs.wm.edu/˜mtufano/ publications/C5.pdf.
278
+
279
+ Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 440–450. Association for Computational Linguistics, 2017. doi: 10.18653/v1/P17-1041. URL http://www.aclweb.org/anthology/P17-1041.
280
+
281
+ Wojciech Zaremba, Karol Kurach, and Rob Fergus. Learning to discover efficient mathematical identities. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 1278–1286. Curran Associates, Inc., 2014. URL http://papers.nips.cc/paper/ 5350-learning-to-discover-efficient-mathematical-identities.pdf.
282
+
283
+ Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 649– 657. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5782-character-level-convolutional-networks-for-text-classification. pdf.
284
+
285
+ # APPENDIX
286
+
287
+ ADDITIONAL EXPERIMENT INFORMATION
288
+
289
+ Table 6: Extra information about performance on the Variable Naming task. Entries in this table are of the form “subword accuracy, edit distance, edit distance divided by real name length”. The edit distance is the mean of the character–wise Levenshtein distance between the produced name and the real name.
290
+
291
+ <table><tr><td></td><td></td><td>Closed Vocab</td><td>CharCNN</td><td>Pointer Sentinel</td><td>GSC (ours)</td></tr><tr><td> Seen repos</td><td>AST AugAST</td><td>0.30, 7.22, 0.94 0.26, 7.64, 0.94</td><td>0.28,8.67, 1.08 0.28, 7.46, 0.99</td><td>0.32, 8.00, 1.07 0.35, 6.51, 0.77</td><td>0.56, 3.87, 0.39 0.60, 3.68, 0.37</td></tr><tr><td>Unseen repos</td><td>AST</td><td>0.09,8.66,1.23</td><td>0.10, 8.82, 1.12</td><td>0.13, 9,39, 1.37</td><td>0.42, 4.81, 0.59</td></tr><tr><td></td><td>AugAST</td><td>0.09, 8.34, 1.14</td><td>0.10, 8.16, 1.12</td><td>0.14, 8.03, 1.07</td><td>0.48, 4.28, 0.49</td></tr></table>
292
+
293
+ DATASET INFORMATION
294
+
295
+ Table 7: Repositories used in experiments. All were taken from the Maven repository (https://mvnrepository.com/). Entries are in the form “group/repository name/version”.
296
+
297
+ <table><tr><td>Seen Repos</td></tr><tr><td>com.fasterxml.jackson.core/jackson-core/2.9.5 com.h2database/h2/1.4.195 javax.enterprise/cdi-api/2.0 junit/junit/4.12 mysql/mysql-connector-java/6.0.6 org.apache.commons/commons-collections4/4.1 org.apache.commons/commons-math3/3.6.1 org.apache.commons/commons-pool2/2.5.0 org.apache.maven/maven-project/2.2.1 org.codehaus.plexus/plexus-utils/3.1.0 org.eclipse.jetty/jetty-server/9.4.9.v20180320</td></tr><tr><td>org.scalacheck/scalacheck_2.12/1.13.5 org.slf4j/slf4j-api/1.7.25 org.slf4j/slf4j-log4j12/1.7.25 Unseen Repos</td></tr><tr><td>org.javassist/javassist/3.22.0-GA joda-time/joda-time/2.9.9 org.mockito/mockito-core/2.17.0</td></tr></table>
298
+
299
+ Table 8: Edge types used in Augmented ASTs. The initial AST is constructed using the AST and NEXT TOKEN edges, and then the remaining edges are added. In other words, the the “AST” model from Table 1 uses a graph that contains only the AST and NEXT TOKEN edge types (and WORD USE if it also uses a GSC), while the “AugAST” model contains all the edge types below. The reversed version of every edge is also added as its own type (e.g. reverse AST, reverse LAST READ) to let the GNN message passing occur in both directions.
300
+
301
+ <table><tr><td>Edge Name</td><td>Description</td></tr><tr><td>AST NEXT_TOKEN</td><td>The edges used to construct the original AST. Edges added to the original AST that specify the left-to-</td></tr><tr><td></td><td>right ordering of the children of a node in the AST.These edges are necessary since ASTs have ordered children, but we are representing the AST as a directed multigraph.</td></tr><tr><td>COMPUTED_FROM</td><td>Connects a node representing a variable on the left of an equality to those on the right. (E.g. edges from y to x and Z to X in x = y + z.) The same as in Allamanis et al. (2018).</td></tr><tr><td>LAST_READ</td><td>Connects a node representing a usage of a variable to all nodes in the AST at which that variable&#x27;s value could have been last read from memory. The same as in Allamanis et al. (2018).</td></tr><tr><td>LAST_WRITE</td><td>Connects a node representing a usage of a variable to all nodesin the AST at which that variable&#x27;s value could have been last written to memory. The same as in Allamanis et al.</td></tr><tr><td>RETURNS_TO</td><td>(2018). Points a node in a return statement to the node contain- ing the return type of the method. (E.g. x in return X gets an edge pointing to int in public static int</td></tr><tr><td>LAST_SCOPE_USE</td><td>getx(x).) Connects a node representing a variable to the node repre- senting the last time this variable&#x27;s name was used in the text of the code (i.e. capturing information about the text, not the control flow),but only within lexical scope. This edge exists to try and give the non-GSC models as much</td></tr><tr><td>LAST_FIELD_LEX</td><td>lexical information as possible to make them as comparable with the GSC model. Connects a field access (e.g. this.whatever or Foo .whatever) node to the last use of this.whatever (or to the variable&#x27;s initialization,if it&#x27;s the first use).This is not lexical-scope aware (and,in fact,can&#x27;t be in Java,in</td></tr><tr><td>FIELD</td><td>general). Pointseach node representing a field access(e.g. this.whatever) to the node where that field was de-</td></tr><tr><td>WORD_USE</td><td>clared. Points cache nodes to nodes representing variables in which the vocab word was used in the variable&#x27;s name.</td></tr></table>
md/train/SyCSsUDee/SyCSsUDee.md ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEMANTIC NOISE MODELING FORBETTER REPRESENTATION LEARNING
2
+
3
+ Hyo-Eun $\mathbf { K i m } ^ { * }$ and Sangheum Hwang
4
+
5
+ Lunit Inc.
6
+ Seoul, South Korea
7
+ {hekim, shwang}@lunit.io
8
+ Kyunghyun Cho
9
+ Courant Institute of Mathematical Sciences and Centre for Data Science
10
+ New York University
11
+ New York, NY 10012, USA
12
+ kyunghyun.cho@nyu.edu
13
+
14
+ # ABSTRACT
15
+
16
+ Latent representation learned from multi-layered neural networks via hierarchical feature abstraction enables recent success of deep learning. Under the deep learning framework, generalization performance highly depends on the learned latent representation. In this work, we propose a novel latent space modeling method to learn better latent representation. We designed a neural network model based on the assumption that good base representation for supervised tasks can be attained by maximizing the sum of hierarchical mutual informations between the input, latent, and output variables. From this base model, we introduce a semantic noise modeling method which enables semantic perturbation on the latent space to enhance the representational power of learned latent feature. During training, latent vector representation can be stochastically perturbed by a modeled additive noise while preserving its original semantics. It implicitly brings the effect of semantic augmentation on the latent space. The proposed model can be easily learned by back-propagation with common gradient-based optimization algorithms. Experimental results show that the proposed method helps to achieve performance benefits against various previous approaches. We also provide the empirical analyses for the proposed latent space modeling method including t-SNE visualization.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Enhancing the generalization performance against unseen data given some sample data is the main objective in machine learning. Under that point of view, deep learning has been achieved many breakthroughs in several domains such as computer vision (Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016), natural language processing (Collobert & Weston, 2008; Bahdanau et al., 2015), and speech recognition (Hinton et al., 2012; Graves et al., 2013). Deep learning is basically realized on deep layered neural network architecture, and it learns appropriate taskspecific latent representation based on given training data. Better latent representation learned from training data results in better generalization over the future unseen data. Representation learning or latent space modeling becomes one of the key research topics in deep learning. During the past decade, researchers focused on unsupervised representation learning and achieved several remarkable landmarks on deep learning history (Vincent et al., 2010; Hinton et al., 2006; Salakhutdinov & Hinton, 2009). In terms of utilizing good base features for supervised learning, the base representation learned from unsupervised learning can be a good solution for supervised tasks (Bengio et al., 2007; Masci et al., 2011).
21
+
22
+ The definition of ‘good’ representation is, however, different according to target tasks. In unsupervised learning, a model is learned from unlabelled examples. Its main objective is to build a model to estimate true data distribution given examples available for training, so the learned latent representation normally includes broadly-informative components of the raw input data (e.g., mutual information between the input and the latent variable can be maximized for this objective). In supervised learning, however, a model is learned from labelled examples. In the case of classification, a supervised model learns to discriminate input data in terms of the target task using corresponding labels. Latent representation is therefore obtained to maximize the performance on the target supervised tasks.
23
+
24
+ Since the meaning of good representations vary according to target tasks (unsupervised or supervised), pre-trained features from the unsupervised model are not be guaranteed to be useful for subsequent supervised tasks. Instead of the two stage learning strategy (unsupervised pre-training followed by supervised fine-tuning), several works focused on a joint learning model which optimizes unsupervised and supervised objectives concurrently, resulting in better generalization performance (Goodfellow et al., 2013; Larochelle & Bengio, 2008a; Rasmus et al., 2015; Zhao et al., 2015; Zhang et al., 2016; Cho & Chen, 2014).
25
+
26
+ In this work, we propose a novel latent space modeling method for supervised learning as an extension of the joint learning approach. We define a good latent representation of standard feed-forward neural networks under the basis of information theory. Then, we introduce a semantic noise modeling method in order to enhance the generalization performance. The proposed method stochastically perturbs the latent representation of a training example by injecting a modeled semantic additive noise. Since the additive noise is randomly sampled from a pre-defined probability distribution every training iteration, different latent vectors from a single training example can be fully utilized during training. The multiple different latent vectors produced from a single training example are semantically similar under the proposed latent space modeling method, so we can expect semantic augmentation effect on the latent space.
27
+
28
+ Experiments are performed on two datasets; MNIST and CIFAR-10. The proposed model results in better classification performance compared to previous approaches through notable generalization effect (stochastically perturbed training examples well cover the distribution of unseen data).
29
+
30
+ # 2 METHODOLOGY
31
+
32
+ The proposed method starts from the existing joint learning viewpoint. This section first explains the process of obtaining a good base representation for supervised learning which is the basis of the proposed latent space modeling method. And then, we will describe how the proposed semantic noise modeling method perturbs the latent space while maintaining the original semantics.
33
+
34
+ # 2.1 BASE JOINT LEARNING MODEL
35
+
36
+ In a traditional feed-forward neural network model (Figure 1(a)), output $Y$ of input data $X$ is compared with its true label, and the error is propagated backward from top to bottom, which implicitly learns a task-specific latent representation $Z$ of the input $X$ . As an extension of a joint learning approach, an objective to be optimized can be described in general as below (Larochelle & Bengio, 2008b):
37
+
38
+ $$
39
+ \operatorname* { m i n } _ { \theta } \lambda L _ { u n s u p } + L _ { s u p }
40
+ $$
41
+
42
+ where $L _ { u n s u p }$ and $L _ { s u p }$ are respectively an unsupervised loss and a supervised loss, and $\theta$ and $\lambda$ are model parameters to be optimized during training and a loss weighting coefficient, respectively. In terms of modeling $L _ { u n s u p }$ in Eq. (1), we assume that good latent representation $Z$ is attained by maximizing the sum of hierarchical mutual informations between the input, latent, and output variables; i.e. the sum of the mutual information between the input $X$ and the $Z$ and the mutual information between the $Z$ and the output $Y$ . Each mutual information is decomposed into an entropy and a conditional entropy terms, so the sum of hierarchical mutual informations is expressed as follows:
43
+
44
+ $$
45
+ { \bf { I } } ( X ; Z ) + { \bf { I } } ( Z ; Y ) = { \bf { H } } ( X ) - { \bf { H } } ( X \vert Z ) + { \bf { H } } ( Z ) - { \bf { H } } ( Z \vert Y )
46
+ $$
47
+
48
+ ![](images/1137fde88fa95773239a9891f73a9430060b5253fa34e7cd20bedd7afffb1039.jpg)
49
+ Figure 1: (a) Standard feed-forward neural network model, (b) feed-forward neural network model with reconstruction paths, and (c) feed-forward neural network model with reconstruction and stochastic perturbation paths.
50
+
51
+ where $\mathbf { I } ( \cdot ; \cdot )$ is the mutual information between random variables, and $\mathbf { H } ( \cdot )$ and $\mathbf { H } ( \cdot | \cdot )$ are the entropy and the conditional entropy of random variables, respectively. Note that the sum of those mutual informations becomes equivalent to the total correlation of $X , Z$ , and $Y$ under the graphical structure of the general feed-forward model described in Figure 1(a); $P ( X , Z , Y ) = P ( Y | \bar { Z } ) \bar { P } ( Z | X ) P ( X )$ . The total correlation is equal to the sum of all pairwise mutual informations (Watanabe, 1960).
52
+
53
+ Our objective is to find the model parameters which maximize $\mathbf { I } ( X ; Z ) + \mathbf { I } ( Z ; Y )$ . Since $\mathbf { H } ( X )$ and $\mathbf { H } ( Z )$ are non-negative, and $\mathbf { H } ( X )$ is constant in this case, the lower bound on $\mathbf { I } ( X ; Z ) + \mathbf { I } ( Z ; Y )$ can be reduced to 1:
54
+
55
+ $$
56
+ \mathbf { I } ( X ; Z ) + \mathbf { I } ( Z ; Y ) \geq - \mathbf { H } ( X | Z ) - \mathbf { H } ( Z | Y ) .
57
+ $$
58
+
59
+ It is known that maximizing $- \mathbf { H } ( X | Z )$ can be formulated as minimizing the reconstruction error between the input $x ^ { ( i ) }$ ( $i$ -th example sampled from $X$ ) and its reconstruction $x _ { R } ^ { ( i ) }$ under the general audo-encoder framework (Vincent et al., 2010). Since $\mathbf { H } ( X | Z ) + \mathbf { H } ( Z | Y )$ is proportional to the sum of reconstruction errors of $x ^ { ( i ) }$ (with its reconstruction $x _ { R } ^ { ( i ) }$ ) and $z ^ { ( i ) }$ (with its reconstruction $z _ { R } ^ { ( i ) } )$ ), the target objective can be expressed as follows (refer to Appendix (A1) for the details ofhematical derivations):
60
+
61
+ $$
62
+ \operatorname* { m i n } _ { \theta } \sum _ { i } L _ { r e c } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + L _ { r e c } ( z ^ { ( i ) } , z _ { R } ^ { ( i ) } )
63
+ $$
64
+
65
+ where $L _ { r e c }$ is a reconstruction loss.
66
+
67
+ Figure 1(b) shows the target model obtained from the assumption that good latent representation $Z$ can be obtained by maximizing the sum of hierarchical mutual informations. Given an input sample $x$ , feed-forward vectors and their reconstructions are attained deterministically by:
68
+
69
+ $$
70
+ \begin{array} { r l } & { z = f _ { \theta _ { 1 } } ( x ) } \\ & { y = f _ { \theta _ { 2 } } ( f _ { \theta _ { 1 } } ( x ) ) } \\ & { x _ { R } = g _ { \theta _ { 1 } ^ { \prime } } ( z ) = g _ { \theta _ { 1 } ^ { \prime } } ( f _ { \theta _ { 1 } } ( x ) ) } \\ & { z _ { R } = g _ { \theta _ { 2 } ^ { \prime } } ( y ) = g _ { \theta _ { 2 } ^ { \prime } } ( f _ { \theta _ { 2 } } ( f _ { \theta _ { 1 } } ( x ) ) . } \end{array}
71
+ $$
72
+
73
+ Given a set of training pairs $( x ^ { ( i ) } , t ^ { ( i ) } )$ where $x ^ { ( i ) }$ and $t ^ { ( i ) }$ are the $i$ -th input example and its label, target objective in Eq. (1) under the model described in Figure 1(b) can be organized as below (with real-valued input samples, L2 loss $L _ { L 2 }$ is a proper choice for the reconstruction loss $L _ { r e c , }$ ):
74
+
75
+ $$
76
+ \operatorname* { m i n } _ { \theta : \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } \sum _ { i } \lambda \left( L _ { L 2 } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + L _ { L 2 } ( z ^ { ( i ) } , z _ { R } ^ { ( i ) } ) \right) + L _ { N L L } ( y ^ { ( i ) } , t ^ { ( i ) } )
77
+ $$
78
+
79
+ where $L _ { N L L }$ is a negative log-likelihood loss for the target supervised task. Note that Eq. (6) represents the ‘proposed-base’ in our experiment (see Section 4.3).
80
+
81
+ # 2.2 SEMANTIC NOISE MODELING
82
+
83
+ Based on the architecture shown in Figure 1(b) with the target objective in Eq. (6), we conjecture that stochastic perturbation on the latent space during training helps to achieve better generalization performance for supervised tasks. Figure 1(c) shows this strategy which integrates the stochastic perturbation process during training. Suppose that $Z _ { P }$ is a perturbed version of $Z$ , and $Y _ { P }$ is an output which is feed-forwarded from $Z _ { P }$ . Given a latent vector $z = f _ { \boldsymbol { \theta } _ { 1 } } ( x )$ from an input sample $x$ ,
84
+
85
+ $$
86
+ z ^ { \prime } = z + z _ { e } { \mathrm { ~ } } \mathrm { a n d } { \hat { y } } = f _ { \theta _ { 2 } } ( z ^ { \prime } )
87
+ $$
88
+
89
+ where $z ^ { \prime }$ and $\hat { y }$ are a perturbed latent vector and its output respectively, and $z _ { e }$ is an additive noise used in the perturbation process of $z$ . Based on the architecture shown in Figure 1(c), target objective can be modified as:
90
+
91
+ $$
92
+ \operatorname* { m i n } _ { \substack { \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } } \sum _ { i } \lambda _ { 1 } \left( L _ { L 2 } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + L _ { L 2 } ( z ^ { ( i ) } , z _ { R } ^ { ( i ) } ) \right) + \lambda _ { 2 } L _ { N L L } ( y ^ { ( i ) } , t ^ { ( i ) } ) + L _ { N L L } ( \hat { y } ^ { ( i ) } , t ^ { ( i ) } ) .
93
+ $$
94
+
95
+ Using random additive noise directly on $z _ { e }$ is the most intuitive approach (‘proposed-perturb (random)’ in Section 4.3). However, preserving the semantics of the original latent representation $z$ cannot be guaranteed under the direct random perturbation on the latent space. While the latent space is not directly interpretable in general, the output logit $y$ of the latent representation $z$ is interpretable, because the output logit is tightly coupled to the prediction of the target label. In order to preserve the semantics of the original latent representation after perturbation, we indirectly model a semantic noise on the latent space by adding small random noise directly on the output space.
96
+
97
+ Based on the output (pre-softmax) logit $y$ , the semantic-preserving variation of $y$ (i.e. $y ^ { \prime }$ ) can be modeled by $y ^ { \prime } = y + y _ { e }$ , where $y _ { e }$ is a random noise vector stochastically sampled from a zeromean Gaussian with small standard deviation $\sigma ; \mathcal { N } ( \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } )$ . Now, the semantic perturbation $z ^ { \prime }$ can be reconstructed from the random perturbation $y ^ { \prime }$ through the decoding path $g _ { \theta _ { 2 } ^ { \prime } }$ in Figure 1(c). From the original output logit $y$ and the randomly perturbed output logit $y ^ { \prime }$ , semantic additive noise $z _ { e }$ on the latent space can be approximately modeled as below:
98
+
99
+ $$
100
+ \begin{array} { r l } & { z _ { R } = g _ { \theta _ { 2 } ^ { \prime } } ( y ) } \\ & { z _ { R } ^ { \prime } = g _ { \theta _ { 2 } ^ { \prime } } ( y ^ { \prime } ) = g _ { \theta _ { 2 } ^ { \prime } } ( y + y _ { e } ) } \\ & { z _ { e } \simeq z _ { R } ^ { \prime } - z _ { R } = g _ { \theta _ { 2 } ^ { \prime } } ( y + y _ { e } ) - g _ { \theta _ { 2 } ^ { \prime } } ( y ) } \end{array}
101
+ $$
102
+
103
+ By using the modeled semantic additive noise $z _ { e }$ and the original latent representation $z$ , we can obtain the semantic perturbation $z ^ { \prime }$ as well as its output $\hat { y }$ via Eq. (7) for our target objective Eq. (8).
104
+
105
+ From the described semantic noise modeling process (‘proposed-perturb (semantic)’ in Section 4.3), we expect to achieve better representation on the latent space. The effect of the proposed model in terms of learned latent representation will be explained in more detail in Section 4.4.
106
+
107
+ ![](images/687514226030a4d7c6ee1ffba4053d410f23d742a7430240e9b83e42fb27c8fd.jpg)
108
+ Figure 2: Previous works for supervised learning; (a) traditional feed-forward model, and (b) joint learning model with both supervised and unsupervised losses.
109
+
110
+ # 3 RELATED WORKS
111
+
112
+ Previous works on deep neural networks for supervised learning can be categorized into two types as shown in Figure 2; (a) a general feed-forward neural network model (LeCun et al., 1998; Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016), and (b) a joint learning model which optimizes unsupervised and supervised objectives at the same time (Zhao et al., 2015; Zhang et al., 2016; Cho & Chen, 2014). Here are the corresponding objective functions:
113
+
114
+ $$
115
+ \begin{array} { c } { { \displaystyle { \operatorname* { m i n } _ { \theta : \{ \theta _ { 1 } , \theta _ { 2 } \} } \sum _ { i } L _ { N L L } ( y ^ { ( i ) } , t ^ { ( i ) } ) } } } \\ { { \displaystyle { \operatorname* { m i n } _ { \theta : \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } \} } \sum _ { i } \lambda L _ { L 2 } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + L _ { N L L } ( y ^ { ( i ) } , t ^ { ( i ) } ) } } } \end{array}
116
+ $$
117
+
118
+ where $\lambda$ is a loss weighting coefficient between unsupervised and supervised losses.
119
+
120
+ Since the feed-forward neural network model is normally implemented with multiple layers in a deep learning framework, the joint learning model can be sub-classified into two types according to the type of reconstruction; reconstruction only with the input data $x$ (Eq. (11)) and reconstruction with all the intermediate features including the input data $x$ as follows:
121
+
122
+ $$
123
+ \operatorname* { m i n } _ { \theta } \sum _ { i } \left( \lambda _ { 0 } L _ { L 2 } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + \sum _ { j } \lambda _ { j } L _ { L 2 } ( h _ { j } ^ { ( i ) } , h _ { j R } ^ { ( i ) } ) + L _ { N L L } ( y ^ { ( i ) } , t ^ { ( i ) } ) \right) \ .
124
+ $$
125
+
126
+ where h(i)j and $h _ { j _ { R } } ^ { ( i ) }$ are the $j$ -th hidden representation of the $i$ -th training example and its reconstruction.
127
+
128
+ Another type of the joint learning model, a ladder network (Figure 3), was introduced for semisupervised learning (Rasmus et al., 2015). The key concept of the ladder network is to obtain robust features by learning de-noising functions $( g _ { \theta ^ { \prime } } )$ of the representations at every layer of the model via reconstruction losses, and the supervised loss is combined with the reconstruction losses in order to build the semi-supervised model. The ladder network achieved the best performance in semi-supervised tasks, but it is not appropriate for supervised tasks with small-scale training set (experimental analysis for supervised learning on permutation-invariant MNIST is briefly summarized in Appendix (A2)). The proposed model in this work can be extended to semi-supervised learning, but our main focus is to enhance the representational power on latent space given labelled data for supervised learning. We leave the study for semi-supervised learning scenario based on the proposed methodology as our future research.
129
+
130
+ ![](images/0adf99802513d294306f73fcbe86e7d7c12a66294e544f6d889b4fc2e8016158.jpg)
131
+ Figure 3: Ladder network; a representative model for semi-supervised learning (Rasmus et al., 2015).
132
+
133
+ # 4 EXPERIMENTS
134
+
135
+ For quantitative analysis, we compare the proposed methodology with previous approaches described in Section 3; a traditional feed-forward supervised learning model and a joint learning model with two different types of reconstruction losses (reconstruction only with the first layer or with all the intermediate layers including the first layer). The proposed methodology includes a baseline model in Figure 1(b) as well as a stochastic perturbation model in Figure 1(c). Especially in the stochastic perturbation model, we compare the random and semantic perturbations and present some qualitative analysis on the meaning of the proposed perturbation methodology.
136
+
137
+ # 4.1 DATASETS
138
+
139
+ We experiment with two public datasets; MNIST (including a permutation-invariant MNIST case) and CIFAR-10. MNIST (10 classes) consists of $5 0 \mathrm { k }$ , $1 0 \mathrm { k }$ , and 10k $2 8 \times 2 8$ gray-scale images for training, validation, and test datasets, respectively. CIFAR-10 (10 classes) consists of $5 0 \mathrm { k }$ and 10k $3 2 \times 3 2$ 3-channel images for training and test sets, respectively. We split the $5 0 \mathrm { k }$ CIFAR-10 training images into 40k and 10k for training and validation. Experiments are performed with different sizes of training set (from 10 examples per class to the entire training set) in order to verify the effectiveness of the proposed model in terms of generalization performance under varying sizes of training set.
140
+
141
+ # 4.2 IMPLEMENTATION
142
+
143
+ Figure 4 shows the architecture of the neural network model used in this experiment. W ’s are convolution or fully-connected weights (biases are excluded for visual brevity). Three convolution $3 { \times } 3$ (2) 32, $3 \times 3$ (2) 64, $3 \times 3$ (2) 96, where each item means the filter kernel size and (stride) with the number of filters) and two fully-connected (the numbers of output nodes are 128 and 10, respectively) layers are used for MNIST. For the permutation-invariant MNIST setting, 784-512- 256-256-128-10 nodes of fully-connected layers are used. Four convolution $( 5 \times 5$ (1) 64, $3 \times 3$ (2) 64, $3 \times 3$ (2) 64, and $3 \times 3$ (2) 96) and three fully-connected (128, 128, and 10 nodes) layers are used for CIFAR-10. Weights on the decoding (reconstruction) path are tied with corresponding weights on the encoding path as shown in Figure 4 (transposed convolution for the tied convolution layer and transposed matrix multiplication for the tied fully-connected layer).
144
+
145
+ In Figure 4, $z ^ { \prime }$ is perturbed directly from $z$ by adding Gaussian random noise for random perturbation. For semantic perturbation, $z ^ { \prime }$ is indirectly generated from $y ^ { \prime }$ which is perturbed by adding Gaussian random noise on $y$ based on Eq. (9). For perturbation, base activation vector ( $z$ is the base
146
+
147
+ $$
148
+ \begin{array} { r l r } & { } & { z ^ { \prime } \xrightarrow { W _ { N } } \hat { y } \cdots t } \\ & { } & { x \xrightarrow [ ] { W _ { 1 } } \gamma _ { h _ { 1 } } \xrightarrow [ ] { W _ { 2 } } h _ { 2 } \quad \bullet \bullet \quad \xrightarrow [ ] { W _ { N - 1 } } \overbrace { \overset { \underset { \mathrm { A } } { \mathrm { A } } } { \overset { \mathrm { A } } { \sum } } \frac { W _ { N } } { y } } ^ { \overset { \mathrm { A } } { \sum } } y \cdots t } \\ & { } & { x \xrightarrow [ ] { W _ { 1 } ^ { T } } h _ { 1 _ { R } } \overbrace { \Longleftarrow } ^ { W _ { 2 } ^ { T } } h _ { 2 _ { R } } \bullet \bullet \quad \bullet \overbrace { \overset { w _ { N - 1 } ^ { T } } { \Longleftarrow } } ^ { W _ { N - 1 } ^ { T } } \overbrace { \overset { z } { z } _ { R } \overset { w _ { N } ^ { T } } { \llcorner } } ^ { \overset { W _ { N } ^ { T } } { \longrightarrow } \overset { \mathcal { Y } } } \overset { \cdot } { y ^ { \prime } } } \\ & { } & { z _ { R } ^ { \prime } \xrightarrow [ ] { w _ { N } ^ { T } } } \end{array}
149
+ $$
150
+
151
+ Figure 4: Target network architecture; 3 convolution and 2 fully-connected layers were used for MNIST, 5 fully-connected layers were used for permutation-invariant MNIST, and 4 convolution and 3 fully-connected layers were used for CIFAR-10.
152
+
153
+ Table 1: Error rate $( \% )$ on the test set using the model with the best performance on the validation set. Numbers on the first row of each sub-table are the number of randomly chosen per-class training examples. The average performance and the standard deviation of three different random-split datasets (except for the case using the entire training set in the last column) are described in this table (error rate on each random set is summarized in Appendix (A3)). Performance of three previous approaches (with gray background; previous-1, 2, 3 are feed-forward model Figure 2(a), joint learning model with recon-one Figure 2(b), joint learning model with recon-all Figure 2(b), respectively) and the proposed methods (proposed-1, 2, 3 are baseline Figure 1(b), random perturbation Figure 1(c), semantic perturbation Figure 1(c), respectively) is summarized.
154
+
155
+ <table><tr><td>dataset</td><td colspan="8">number of per-class examples chosen from 5Ok entire MNIST training examples</td><td>entire set</td></tr><tr><td>MNIST</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td>50k</td></tr><tr><td>previous-1</td><td>24.55 (3.04)</td><td>16.00 (1.33)</td><td>10.35 (0.66)</td><td>6.58 (0.42)</td><td>4.71 (0.28)</td><td>2.94 (0.23)</td><td>1.90 (0.27)</td><td>1.45 (0.08)</td><td>1.04</td></tr><tr><td>previous-2</td><td>21.67 (3.19)</td><td>13.60 (0.99)</td><td>7.85 (0.10)</td><td>5.44 (0.37)</td><td>4.14 (0.08)</td><td>2.50 (0.15)</td><td>1.84 (0.07)</td><td>1.45 (0.07)</td><td>1.12</td></tr><tr><td>previous-3</td><td>20.11 (2.81)</td><td>13.69 (0.62)</td><td>9.15 (0.15)</td><td>6.77 (0.25)</td><td>5.39 (0.11)</td><td>3.89 (0.27)</td><td>2.91 (0.17)</td><td>2.28 (0.10)</td><td>1.87</td></tr><tr><td>proposed-1</td><td>21.35 (1.16)</td><td>11.65 (1.15)</td><td>6.33 (0.10)</td><td>4.32 (0.31)</td><td>3.07 (0.11)</td><td>1.98 (0.11)</td><td>1.29 (0.09)</td><td>0.94 (0.02)</td><td>0.80</td></tr><tr><td>proposed-2</td><td>20.17 (1.52)</td><td>11.68 (0.81)</td><td>6.24 (0.29)</td><td>4.12 (0.24)</td><td>3.04 (0.13)</td><td>1.88 (0.05)</td><td>1.24 (0.03)</td><td>0.96 (0.08)</td><td>0.65</td></tr><tr><td>proposed-3</td><td>20.11 (0.81)</td><td>10.59 (0.74)</td><td>5.92 (0.12)</td><td>3.79 (0.23)</td><td>2.72 (0.09)</td><td>1.78 (0.05)</td><td>1.15 (0.01)</td><td>0.88 (0.03)</td><td>0.62</td></tr><tr><td>dataset</td><td colspan="7">number of per-class examples chosen from 4Ok entire CIFAR-10 training examples</td><td></td><td>entire set</td></tr><tr><td>CIFAR-10</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td>40k</td></tr><tr><td>previous-1</td><td>73.82 (1.43)</td><td>68.99 (0.54)</td><td>61.30 (0.83)</td><td>54.93 (0.56)</td><td>46.97 (0.59)</td><td>33.69 (0.43)</td><td>26.63 (0.39)</td><td>20.97 (0.09)</td><td>17.80</td></tr><tr><td>previous-2</td><td>75.68 (1.56)</td><td>69.05 (1.13)</td><td>61.44 (0.63)</td><td>55.02 (0.34)</td><td>46.18 (0.51)</td><td>33.62 (0.38)</td><td>26.78 (0.48)</td><td>21.25 (0.40)</td><td>17.68</td></tr><tr><td>previous-3</td><td>73.33 (1.06)</td><td>67.63 (0.56)</td><td>62.59 (0.76)</td><td>56.37 (0.20)</td><td>50.51 (0.61)</td><td>41.26 (0.73)</td><td>32.55 (1.20)</td><td>26.38 (0.08)</td><td>22.71</td></tr><tr><td>proposed-1</td><td>71.63 (0.69)</td><td>66.17 (0.40)</td><td>58.91 (0.86)</td><td>52.65 (0.28)</td><td>43.46 (0.30)</td><td>31.86 (0.54)</td><td>25.76 (0.31)</td><td>21.06 (0.18)</td><td>17.45</td></tr><tr><td>proposed-2</td><td>71.69 (0.25)</td><td>66.75 (0.54)</td><td>58.95 (0.63)</td><td>53.01 (0.26)</td><td>43.71 (0.19)</td><td>31.80 (0.18)</td><td>25.50 (0.33)</td><td>20.81 (0.27)</td><td>17.43</td></tr><tr><td>proposed-3</td><td>71.50 (1.14)</td><td>66.87 (0.17)</td><td>58.30 (0.62)</td><td>52.32 (0.08)</td><td>42.98 (0.34)</td><td>30.91 (0.23)</td><td>24.81 (0.26)</td><td>20.19 (0.25)</td><td>16.16</td></tr></table>
156
+
157
+ vector for the random perturbation and $y$ is the base vector for the semantic perturbation) is scaled to [0.0, 1.0], and the zero-mean Gaussian noise with 0.2 of standard deviation is added (via elementwise addition) on the normalized base activation. This perturbed scaled activation is de-scaled with the original min and max activations of the base vector.
158
+
159
+ Initial learning rates are 0.005 and 0.001 for MNIST and permutation-invariant MNIST, and 0.002 for CIFAR-10, respectively. The learning rates are decayed by a factor of 5 every 40 epochs until the 120-th epoch. For both datasets, the minibatch size is set to 100, and the target objective is optimized using Adam optimizer (Kingma & Ba, 2015) with a momentum 0.9. All the $\lambda$ ’s for reconstruction losses in Eq. (11) and Eq. (12) are 0.03 and 0.01 for MNIST and CIFAR-10, respectively. The same weighting factors for reconstruction losses (0.03 for MNIST and 0.01 for CIFAR-10) are used for $\lambda _ { 1 }$ in Eq (8), and 1.0 is used for $\lambda _ { 2 }$ .
160
+
161
+ Input data is first scaled to [0.0, 1.0] and then whitened by the average across all the training examples. In CIFAR-10, random cropping $2 4 \times 2 4$ image is randomly cropped from the original $3 2 \times 3 2$ image) and random horizontal flipping (mirroring) are used for data augmentation. We selected the network that performed best on the validation dataset for evaluation on the test dataset. All the experiments are performed with TensorFlow (Abadi et al., 2015).
162
+
163
+ # 4.3 QUANTITATIVE ANALYSIS
164
+
165
+ Three previous approaches (a traditional feed-forward model, a joint learning model with the input reconstruction loss, and a joint learning model with reconstruction losses of all the intermediate layers including the input layer) are compared with the proposed methods (the baseline model in Figure 1(b), and the stochastic perturbation model in Figure 1(c) with two different perturbation methods; random and semantic). We measure the classification performance according to varying sizes of training set (examples randomly chosen from the original training dataset). Performance is averaged over three different random trials.
166
+
167
+ ![](images/fd063f072e83bb12f18e90c57656142a6c76f9eaf9710d6764d7b195a4663837.jpg)
168
+ Figure 5: Examples reconstructed from the perturbed latent vectors via (a) random perturbation, and (b) semantic perturbation (top row shows the original training examples). More examples are summarized in Appendix (A4.1).
169
+
170
+ Table 1 summarizes the classification performance for MNIST and CIFAR-10. As we expected, the base model obtained by maximizing the sum of mutual informations (proposed-base) mostly performs better than previous approaches, and the model with the semantic perturbation (proposedperturb (semantic)) performs best among all the comparison targets. Especially in MNIST, the error rate of ‘proposed-perturb (semantic)’ with $2 \mathrm { k }$ per-class training examples is less than the error rate of all types of previous works with the entire training set (approximately 5k per-class examples).
171
+
172
+ We further verify the proposed method on the permutation-invariant MNIST task with a standard feed-forward neural network. Classification performance is measured against three different sizes of training set (1k, 2k, and 5k per-class training examples). ‘Proposed-perturb (semantic)’ achieves the best performance among all the configurations; $2 . 5 7 \%$ , $1 . 8 2 \%$ , and $1 . 2 8 \%$ error rates for 1k, 2k, and 5k per-class training examples, respectively. The joint learning model with the input reconstruction loss performs best among three previous approaches; $2 . 7 2 \%$ , $1 . 9 7 \%$ , and $1 . 3 8 \%$ error rates for 1k, 2k, and 5k per-class training examples, respectively.
173
+
174
+ # 4.4 QUALITATIVE ANALYSIS
175
+
176
+ As mentioned before, random perturbation by adding unstructured noise directly to the latent representation cannot guarantee preserving the semantics of the original representation. We compared two different perturbation methods (random and semantic) by visualizing the examples reconstructed from the perturbed latent vectors (Figure 5). Top row is the original examples selected from training set (among 2k per-class training examples), and the rest are the reconstructions of their perturbed latent representations. Based on the architecture described in Figure 1(b), we generated five different perturbed latent representations according to the type of perturbation, and reconstructed the perturbed latent vectors through decoding path for reconstruction.
177
+
178
+ Figure 5(a) and (b) show the examples reconstructed from the random and semantic perturbations, respectively. For both cases, zero-mean Gaussian random noise (0.2 standard deviation) is used for perturbation. As shown in Figure 5(a), random perturbation partially destroys the original semantics; for example, semantics of $\cdot _ { 1 } \cdot$ is mostly destroyed under random perturbation, and some examples of $\cdot _ { 3 } \cdot$ are reconstructed as being similar to $\cdot _ { 8 } \cdot $ rather than its original content $\cdot _ { 3 } \cdot$ . Figure 5(b) shows the examples reconstructed from the semantic perturbation. The reconstructed examples show subtle semantic variations while preserving the original semantic contents; for example, thickness difference in $\cdot _ { 3 } \cdot$ (example on the third row) or writing style difference in $\cdot _ { 8 } \cdot $ (openness of the top left corner).
179
+
180
+ Figure 6 shows the overall effect of the perturbation. In this analysis, 100 per-class MNIST examples are used for training. From the trained model based on the architecture described in Figure 1(b), latent representations $z$ of all the $5 0 \mathrm { k }$ examples (among 50k examples, only 1k examples were used for training) are visualized by using t-SNE (Maaten & Hinton, 2008). Only the training examples of three classes (0, 1, and 9) among ten classes are depicted as black circles for visual discrimination in
181
+
182
+ ![](images/762dd002da7354f6b01a3b543c08def476bbdd57561f3a870f21d90555f0e26a.jpg)
183
+ Figure 6: Training examples (circles or crosses with colors described below) over the examples not used for training (depicted as background with different colors); (a) training examples (black circles), (b) training examples (yellow circles) with $3 \times$ random-perturbed samples (blue crosses), and (c) training examples (yellow circles) with $3 \times$ semantic-perturbed samples (blue crosses). Best viewed in color.
184
+
185
+ Figure 6(a). The rest of the examples which were not used for training (approximately $4 . 9 \mathrm { k }$ examples per class) are depicted as a background with different colors. We treat the colored background examples (not used for training) as a true distribution of unseen data in order to estimate the generalization level of learned representation according to the type of perturbation. Figure 6(b) and (c) show the training examples (100 examples per class with yellow circles) and their perturbed ones $3 \times$ sampled from each example with blue crosses) through random and semantic perturbations, respectively.
186
+
187
+ In Figure 6(b), perturbed samples are distributed near the original training examples, but some samples outside the true distribution cannot be identified easily with appropriate classes. This can be explained with Figure 5(a), since some perturbed samples are ambiguous semantically. In Figure 6(c), however, most of the perturbed samples evenly cover the true distribution. As mentioned before, stochastic perturbation with the semantic additive noise during training implicitly incurs the effect of augmentation on the latent space while resulting in better generalization. Per-class t-SNE results are summarized in Appendix (A4.2).
188
+
189
+ # 5 DISCUSSION
190
+
191
+ We introduced a novel latent space modeling method for supervised tasks based on the standard feed-forward neural network architecture. The presented model simultaneously optimizes both supervised and unsupervised losses based on the assumption that the better latent representation can be obtained by maximizing the sum of hierarchical mutual informations. Especially the stochastic perturbation process which is achieved by modeling the semantic additive noise during training enhances the representational power of the latent space. From the proposed semantic noise modeling process, we can expect improvement of generalization performance in supervised learning with implicit semantic augmentation effect on the latent space.
192
+
193
+ The presented model architecture can be intuitively extended to semi-supervised learning because it is implemented as the joint optimization of supervised and unsupervised objectives. For semisupervised learning, however, logical link between features learned from labelled and unlabelled data needs to be considered additionally. We leave the extension of the presented approach to semisupervised learning for the future.
194
+
195
+ # REFERENCES
196
+
197
+ Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Watten- ´ berg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
198
+
199
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
200
+
201
+ Yoshua Bengio, Pascal Lamblin, Dan Popovici, Hugo Larochelle, et al. Greedy layer-wise training of deep networks. In Advances in Neural Information Processing Systems (NIPS), 2007.
202
+
203
+ Kyunghyun Cho and Xi Chen. Classifying and visualizing motion capture sequences using deep neural networks. In International Conference on Computer Vision Theory and Applications, 2014.
204
+
205
+ Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In International Conference on Machine Learning (ICML), 2008.
206
+
207
+ Ian Goodfellow, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Multi-prediction deep boltzmann machines. In Advances in Neural Information Processing Systems (NIPS), 2013.
208
+
209
+ Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In International conference on acoustics, speech and signal processing, 2013.
210
+
211
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition (CVPR), 2016.
212
+
213
+ Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. Signal Processing Magazine, IEEE, 29(6):82–97, 2012.
214
+
215
+ Geoffrey E. Hinton, Simon Osindero, and Yee Whye Teh. A fast learning algorithm for deep belief nets. Neural Computation, 18:1527–1554, 2006.
216
+
217
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
218
+
219
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), 2012.
220
+
221
+ Hugo Larochelle and Yoshua Bengio. Classification using discriminative restricted boltzmann machines. In International Conference on Machine Learning (ICML), 2008a.
222
+
223
+ Hugo Larochelle and Yoshua Bengio. Classification using discriminative restricted boltzmann machines. In International Conference on Machine Learning (ICML), 2008b.
224
+
225
+ 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.
226
+
227
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research (JMLR), 9(Nov):2579–2605, 2008.
228
+
229
+ Jonathan Masci, Ueli Meier, Dan Cires¸an, and Jurgen Schmidhuber. Stacked convolutional auto- ¨ encoders for hierarchical feature extraction. In International Conference on Artificial Neural Networks, 2011.
230
+
231
+ Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semisupervised learning with ladder networks. In Advances in Neural Information Processing Systems (NIPS), 2015.
232
+
233
+ Ruslan Salakhutdinov and Geoffrey E Hinton. Deep boltzmann machines. In Artificial Intelligence and Statistics Conference (AISTATS), 2009.
234
+
235
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
236
+
237
+ 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. Journal of Machine Learning Research (JMLR), 11:3371–3408, 2010.
238
+
239
+ Satosi Watanabe. Information theoretical analysis of multivariate correlation. IBM Journal of research and development, 4(1):66–82, 1960.
240
+
241
+ Yuting Zhang, Kibok Lee, and Honglak Lee. Augmenting supervised neural networks with unsupervised objectives for large-scale image classification. In International Conference on Machine Learning (ICML), 2016.
242
+
243
+ Junbo Zhao, Michael Mathieu, Ross Goroshin, and Yann Lecun. Stacked what-where auto-encoders. In International Conference on Learning Representations (ICLR), 2015.
244
+
245
+ # APPENDIX
246
+
247
+ # (A1) DERIVATION OF RECONSTRUCTION ERRORS FROM CONDITIONAL ENTROPY TERMS
248
+
249
+ Extended from Section 2. From the lower bound in Eq. (3), we consider the following optimization problem (refer to ‘Section 2. From mutual information to autoencoders’ in (Vincent et al., 2010)):
250
+
251
+ $$
252
+ \operatorname* { m a x } _ { \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } \mathbb { E } _ { q ( X , Z , Y ) } \left[ \log q ( X | Z ) \right] + \mathbb { E } _ { q ( X , Z , Y ) } \left[ \log q ( Z | Y ) \right] .
253
+ $$
254
+
255
+ Here, we denote $q ( X , Z , Y )$ an unknown joint distribution. Note that $Z$ and $Y$ are respectively the variables transformed from parametric mappings $Z = f _ { \boldsymbol { \theta } _ { 1 } } ( { \boldsymbol { X } } )$ and $Y = f _ { \theta _ { 2 } } ( Z )$ (see Fig. 1). $q ( X , Z , Y )$ then can be reduced to $q ( X )$ from $q ( Z | X ; \theta _ { 1 } ) = \delta ( Z - f _ { \theta _ { 1 } } ( X ) )$ and $\overset { \cdot } { q } ( Y | Z ; \theta _ { 2 } ) =$ $\delta ( Y - f _ { \theta _ { 2 } } ( Z ) )$ where $\delta$ denotes Dirac-delta function.
256
+
257
+ From the Kullback-Leibler divergence that $D _ { \mathrm { K L } } ( q | | p ) \geq 0$ for any two distributions $p$ and $q$ , the optimization in Eq. (13) corresponds to the following optimization problem where $p ( \cdot )$ denotes a parametric distribution:
258
+
259
+ $$
260
+ \operatorname* { m a x } _ { \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } \mathbb { E } _ { q ( X ) } \left[ \log p ( X | Z ; \theta _ { 1 } ^ { \prime } ) \right] + \mathbb { E } _ { q ( X ) } \left[ \log p ( Z | Y ; \theta _ { 2 } ^ { \prime } ) \right] .
261
+ $$
262
+
263
+ By replacing $q ( X )$ with a sample distribution $q ^ { 0 } ( X )$ and putting all parametric dependencies between $X , Z$ and $Y$ , we will have
264
+
265
+ $$
266
+ \operatorname* { m a x } _ { \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } \mathbb { E } _ { q ^ { 0 } ( X ) } \left[ \log p ( X | Z = f _ { \theta _ { 1 } } ( X ) ; \theta _ { 1 } ^ { \prime } ) \right] + \mathbb { E } _ { q ^ { 0 } ( X ) } \left[ \log p ( Z | Y = f _ { \theta _ { 2 } } ( f _ { \theta _ { 1 } } ( X ) ) ; \theta _ { 2 } ^ { \prime } ) \right] ~ .
267
+ $$
268
+
269
+ For a given input sample $x$ of $X$ , it is general to interpret $x _ { R }$ and $z _ { R }$ as the parameters of distributions $p ( X | X _ { R } = x _ { R } )$ and $p ( Z | Z _ { R } = z _ { R } )$ which reconstruct $x$ and $z$ with high probability (i.e. $x _ { R }$ and $z _ { R }$ are not exact reconstructions of $x$ and $z$ ). Since $x _ { R }$ and $z _ { R }$ are real-valued, we assume Gaussian distribution for these conditional distributions, that is,
270
+
271
+ $$
272
+ \begin{array} { r } { p ( { \cal X } | { \cal X } _ { R } = x _ { R } ) = N ( x _ { R } , \sigma _ { 0 } ^ { 2 } { \bf I } ) } \\ { p ( { \cal Z } | { \cal Z } _ { R } = z _ { R } ) = N ( z _ { R } , \sigma _ { 0 } ^ { 2 } { \bf I } ) . } \end{array}
273
+ $$
274
+
275
+ The assumptions yield $- \log p ( \cdot | \cdot ) \propto L _ { L 2 } ( \cdot , \cdot )$ .
276
+
277
+ With the following relations for log terms in Eq. (15),
278
+
279
+ $$
280
+ \begin{array} { c } { { p ( X | Z = f _ { \theta _ { 1 } } ( x ) ; \theta _ { 1 } ^ { \prime } ) = p ( X | X _ { R } = g _ { \theta _ { 1 } ^ { \prime } } ( f _ { \theta _ { 1 } } ( x ) ) ) } } \\ { { p ( Z | Y = f _ { \theta _ { 2 } } ( f _ { \theta _ { 1 } } ( x ) ) ; \theta _ { 2 } ^ { \prime } ) = p ( Z | Z _ { R } = g _ { \theta _ { 2 } ^ { \prime } } ( f _ { \theta _ { 2 } } ( f _ { \theta _ { 1 } } ( x ) ) ) , } } \end{array}
281
+ $$
282
+
283
+ the optimization problem in Eq. (15) corresponds to the minimization problem of reconstruction errors for input examples $x ^ { ( i ) }$ as below:
284
+
285
+ $$
286
+ \operatorname * { m i n } _ { \{ \theta _ { 1 } , \theta _ { 1 } ^ { \prime } , \theta _ { 2 } , \theta _ { 2 } ^ { \prime } \} } \sum _ { i } L _ { L 2 } ( x ^ { ( i ) } , x _ { R } ^ { ( i ) } ) + L _ { L 2 } ( z ^ { ( i ) } , z _ { R } ^ { ( i ) } ) \ : .
287
+ $$
288
+
289
+ # (A2) LADDER NETWORK, A REPRESENTATIVE SEMI-SUPERVISED LEARNING MODEL
290
+
291
+ Extended from Section 3. We performed experiments with a ladder network model (Rasmus et al., 2015) in order to estimate the performance on pure supervised tasks according to different sizes of training set. We used the code (https://github.com/rinuboney/ladder.git) for this experiment. The network architecture implemented on the source code is used as is; (784-1000-500-250-250-250- 10). Based on the same network architecture, we implemented the proposed stochastic perturbation model described in Figure 1(c) and compared the classification performance with the ladder network as described in Table 2 (we did not focus on searching the optimal hyperparameters for the proposed model in this experiment). As summarized in the bottom of the table (mean over 3 random trials), the proposed semantic noise modeling method shows a fairly large performance gain compared to the ladder network model with small-scale datasets (e.g., in a case of 10 per-class training examples, the proposed method achieves $2 2 . 1 1 \%$ of error rate, while the ladder network shows $2 9 . 6 6 \%$ ).
292
+
293
+ Table 2: Classification performance (error rate in $\%$ ) of the ladder network and the proposed model on three different sets of randomly chosen training examples (MNIST).
294
+
295
+ <table><tr><td>set No.1 (# training examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td> (all) 5k</td></tr><tr><td>ladder network model; Figure 3</td><td>25.85</td><td>16.48</td><td>9.26</td><td>6.00</td><td>4.66</td><td>3.07</td><td>2.15</td><td>1.26</td><td>0.91</td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>19.76</td><td>12.33</td><td>8.77</td><td>6.06</td><td>4.59</td><td>2.93</td><td>1.87</td><td>1.31</td><td>0.93</td></tr><tr><td>set No.2 (# training examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>ladder network model; Figure 3</td><td>33.14</td><td>17.46</td><td>10.44</td><td>6.67</td><td>4.43</td><td>2.82</td><td>1.94</td><td>1.37</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>23.36</td><td>15.35</td><td>9.43</td><td>5.75</td><td>4.43</td><td>2.99</td><td>1.87</td><td>1.39</td><td></td></tr><tr><td> set No.3 (# training examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>ladder network model; Figure 3</td><td>29.99</td><td>16.99</td><td>9.73</td><td>7.34</td><td>4.39</td><td>3.00</td><td>2.12</td><td>1.47</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>23.21</td><td>13.98</td><td>8.83</td><td>6.51</td><td>4.32</td><td>2.94</td><td>2.22</td><td>1.49</td><td></td></tr><tr><td>mean over 3 random trials</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td> (all) 5k</td></tr><tr><td>ladder network model; Figure 3</td><td>29.66</td><td>16.98</td><td>9.81</td><td>6.67</td><td>4.49</td><td>2.96</td><td>2.07</td><td>1.37</td><td>0.91</td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>22.11</td><td>13.89</td><td>9.01</td><td>6.11</td><td>4.45</td><td>2.95</td><td>1.99</td><td>1.40</td><td>0.93</td></tr></table>
296
+
297
+ # (A3) QUANTITATIVE ANALYSIS
298
+
299
+ Extended from Section 4.3. Among the total $5 0 \mathrm { k }$ and $4 0 \mathrm { k }$ training examples in MNIST and CIFAR10, we randomly select the examples for training. Classification performance according to three different randomly chosen training sets are summarized in Table 3 (MNIST) and Table 4 (CIFAR10). Further experiments with denoising constraints are also included. Zero-mean Gaussian random noise with 0.1 standard deviation is used for noise injection. Denoising function helps to achieve slightly better performance on MNIST, but it results in performance degradation on CIFAR-10 (we did not focus on searching the optimal parameters for noise injection in this experiments).
300
+
301
+ Table 3: Classification performance (error rate in $\%$ ) on three different sets of randomly chosen training examples (MNIST).
302
+
303
+ <table><tr><td colspan="10">Set No.1(#train examples per class)</td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>10 22.61</td><td>20 14.20</td><td>50 11.25</td><td>100 6.37</td><td>200 4.34</td><td>500 2.63</td><td>1k 1.83</td><td>2k 1.56</td><td>(all) 5k 1.04</td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>18.69</td><td>12.21</td><td>7.84</td><td>5.17</td><td>4.02</td><td>2.58</td><td>1.79</td><td>1.47</td><td>1.12</td></tr><tr><td> joint learning model with recon-one with denoising constraints</td><td>20.39</td><td>11.91</td><td>7.41</td><td>4.64</td><td>3.65</td><td>2.57</td><td>1.97</td><td>1.53</td><td>0.97</td></tr><tr><td> joint learning model with recon-all; Figure 2(b)</td><td>18.82</td><td>12.82</td><td>9.34</td><td>6.43</td><td>5.23</td><td>4.12</td><td>2.68</td><td>2.42</td><td>1.87</td></tr><tr><td>joint learning model with recon-all with denoisingconstraints</td><td>17.93</td><td>11.76</td><td>7.32</td><td>4.78</td><td>3.91</td><td>3.04</td><td>2.52</td><td>1.99</td><td>1.36</td></tr><tr><td>proposed-base; Figure 1(b)</td><td>20.23</td><td>10.18</td><td>6.47</td><td>3.89</td><td>3.04</td><td>1.89</td><td>1.33</td><td>0.91</td><td>0.80</td></tr><tr><td>proposed-base with denoising constraints</td><td>19.88</td><td>10.89</td><td>6.62</td><td>4.26</td><td>3.40</td><td>2.44</td><td>2.11</td><td>1.54</td><td>1.13</td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>18.38</td><td>10.58</td><td>6.64</td><td>3.78</td><td>3.14</td><td>1.90</td><td>1.21</td><td>0.89</td><td>0.65</td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>19.33</td><td>9.72</td><td>5.98</td><td>3.47</td><td>2.84</td><td>1.84</td><td>1.16</td><td>0.84</td><td>0.62</td></tr><tr><td>Set No.2 (# train examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>28.84</td><td>17.36</td><td>10.14</td><td>6.20</td><td>4.78</td><td>3.02</td><td>1.61</td><td>1.41</td><td></td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>26.09</td><td>14.40</td><td>7.98</td><td>5.18</td><td>4.17</td><td>2.29</td><td>1.94</td><td>1.52</td><td></td></tr><tr><td> joint learning model with recon-one with denoising constraints</td><td>27.69</td><td>13.11</td><td>6.95</td><td>5.07</td><td>3.54</td><td>2.37</td><td>1.83</td><td>1.28</td><td></td></tr><tr><td> joint learning model with recon-all; Figure 2(b)</td><td>24.01</td><td>14.13</td><td>8.98</td><td>6.84</td><td>5.44</td><td>3.51</td><td>2.98</td><td>2.18</td><td></td></tr><tr><td> joint learning model with recon-all with denoising constraints</td><td>23.05</td><td>13.29</td><td>7.79</td><td>5.12</td><td>3.92</td><td>3.01</td><td>2.27</td><td>1.84</td><td></td></tr><tr><td>proposed-base; Figure 1(b)</td><td>22.95</td><td>12.98</td><td>6.27</td><td>4.43</td><td>3.22</td><td>2.14</td><td>1.37</td><td>0.96</td><td></td></tr><tr><td>proposed-base with denoising constraints</td><td>26.96</td><td>12.21</td><td>6.45</td><td>4.62</td><td>3.13</td><td>2.53</td><td>1.88</td><td>1.49</td><td></td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>22.10</td><td>12.52</td><td>5.97</td><td>4.26</td><td>2.86</td><td>1.94</td><td>1.23</td><td>0.92</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>21.22</td><td>11.52</td><td>5.75</td><td>3.91</td><td>2.61</td><td>1.73</td><td>1.14</td><td>0.89</td><td></td></tr><tr><td>Set No.3 (# train examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>22.20</td><td>16.43</td><td>9.67</td><td>7.16</td><td>5.02</td><td>3.17</td><td>2.25</td><td>1.39</td><td></td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>20.23</td><td>14.19</td><td>7.73</td><td>5.96</td><td>4.22</td><td>2.62</td><td>1.79</td><td>1.35</td><td></td></tr><tr><td>joint learning model with recon-one with denoising constraints</td><td>19.32</td><td>12.25</td><td>7.44</td><td>5.39</td><td>3.58</td><td>2.37</td><td>1.49</td><td>1.56</td><td></td></tr><tr><td> joint learning model with recon-al; Figure 2(b)</td><td>17.51</td><td>14.12</td><td>9.12</td><td>7.04</td><td>5.49</td><td>4.05</td><td>3.08</td><td>2.25</td><td></td></tr><tr><td> joint learning model with recon-all with denoising constraints</td><td>17.07</td><td>12.50</td><td>7.86</td><td>5.48</td><td>4.05</td><td>2.97</td><td>2.02</td><td>1.98</td><td></td></tr><tr><td>proposed-base; Figure 1(b)</td><td>20.86</td><td>11.79</td><td>6.25</td><td>4.63</td><td>2.96</td><td>1.91</td><td>1.16</td><td>0.96</td><td></td></tr><tr><td>proposed-base with denoising constraints</td><td>19.89</td><td>11.30</td><td>6.26</td><td>4.57</td><td>3.50</td><td>2.63</td><td>1.61</td><td>1.47</td><td></td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>20.02</td><td>11.94</td><td>6.12</td><td>4.32</td><td>3.13</td><td>1.81</td><td>1.28</td><td>1.08</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>19.78</td><td>10.53</td><td>6.03</td><td>4.00</td><td>2.70</td><td>1.76</td><td>1.14</td><td>0.92</td><td></td></tr></table>
304
+
305
+ Table 4: Classification performance (error rate in $\%$ ) on three different sets of randomly chosen training examples (CIFAR-10).
306
+
307
+ <table><tr><td>Set No.1(# train examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td>(all) 4k</td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>73.30</td><td>69.25</td><td>62.42</td><td>55.65</td><td>47.71</td><td>34.30</td><td>27.04</td><td>21.06</td><td>17.80</td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>75.19</td><td>70.38</td><td>62.25</td><td>55.30</td><td>46.89</td><td>34.12</td><td>26.63</td><td>21.05</td><td>17.68</td></tr><tr><td>joint learning model with recon-one with denoising constraints</td><td>73.72</td><td>68.20</td><td>61.99</td><td>55.23</td><td>46.64</td><td>36.37</td><td>29.78</td><td>25.53</td><td>21.73</td></tr><tr><td> joint learning model with recon-all; Figure 2(b)</td><td>74.79</td><td>68.33</td><td>62.92</td><td>56.24</td><td>51.37</td><td>40.30</td><td>30.91</td><td>26.49</td><td>22.71</td></tr><tr><td> joint learning model with recon-all with denoising constraints</td><td>76.56</td><td>69.67</td><td>64.53</td><td>57.88</td><td>52.74</td><td>42.24</td><td>36.90</td><td>30.93</td><td>27.41</td></tr><tr><td>proposed-base; Figure 1(b)</td><td>70.79</td><td>66.57</td><td>59.91</td><td>52.98</td><td>43.29</td><td>32.25</td><td>26.19</td><td>20.92</td><td>17.45</td></tr><tr><td>proposed-base with denoising constraints</td><td>71.03</td><td>67.49</td><td>60.37</td><td>53.52</td><td>44.28</td><td>33.40</td><td>28.00</td><td>25.06</td><td>21.34</td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>71.89</td><td>67.12</td><td>59.22</td><td>52.79</td><td>43.87</td><td>31.82</td><td>25.04</td><td>20.97</td><td>17.43</td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>71.59</td><td>66.90</td><td>58.64</td><td>52.34</td><td>42.74</td><td>30.94</td><td>24.45</td><td>20.10</td><td>16.16</td></tr><tr><td>Set No.2 (# train examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>72.39</td><td>69.49</td><td>60.45</td><td>54.85</td><td>46.91</td><td>33.39</td><td>26.73</td><td>21.00</td><td></td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>74.06</td><td>69.14</td><td>60.71</td><td>54.54</td><td>45.70</td><td>33.54</td><td>27.43</td><td>20.90</td><td></td></tr><tr><td> joint learning model with recon-one with denoising constraints</td><td>76.40</td><td>69.33</td><td>60.28</td><td>55.38</td><td>47.40</td><td>36.29</td><td>29.31</td><td>24.60</td><td></td></tr><tr><td> joint learning model with recon-all; Figure 2(b)</td><td>72.28</td><td>67.60</td><td>61.53</td><td>56.65</td><td>49.99</td><td>42.08</td><td>32.99</td><td>26.33</td><td></td></tr><tr><td> joint learning model with recon-all with denoising constraints</td><td>73.90</td><td>69.23</td><td>61.90</td><td>57.99</td><td>52.35</td><td>45.12</td><td>37.23</td><td>30.14</td><td></td></tr><tr><td>proposed-base; Figure 1(b)</td><td>72.49</td><td>65.62</td><td>57.82</td><td>52.66</td><td>43.20</td><td>32.24</td><td>25.60</td><td>21.32</td><td></td></tr><tr><td>proposed-base with denoising constraints</td><td>72.99</td><td>66.75</td><td>57.78</td><td>53.81</td><td>44.33</td><td>33.56</td><td>28.40</td><td>25.03</td><td></td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>71.84</td><td>65.98</td><td>58.08</td><td>53.37</td><td>43.44</td><td>31.56</td><td>25.69</td><td>21.03</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>72.85</td><td>66.65</td><td>57.44</td><td>52.21</td><td>42.74</td><td>31.17</td><td>24.99</td><td>20.54</td><td></td></tr><tr><td>Set No.3(# train examples per class)</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td><td>500</td><td>1k</td><td>2k</td><td></td></tr><tr><td>feed-forward model; Figure 2(a)</td><td>75.78</td><td>68.24</td><td>61.02</td><td>54.29</td><td>46.28</td><td>33.38</td><td>26.11</td><td>20.85</td><td></td></tr><tr><td> joint learning model with recon-one; Figure 2(b)</td><td>77.79</td><td>67.62</td><td>61.37</td><td>55.22</td><td>45.96</td><td>33.21</td><td>26.29</td><td>21.81</td><td></td></tr><tr><td> joint learning model with recon-one with denoising constraints</td><td>76.60</td><td>69.27</td><td>61.13</td><td>55.10</td><td>47.50</td><td>37.12</td><td>29.63</td><td>24.88</td><td></td></tr><tr><td> joint learning model with recon-all; Figure 2(b)</td><td>72.92</td><td>66.97</td><td>63.31</td><td>56.23</td><td>50.16</td><td>41.41</td><td>33.75</td><td>26.31</td><td></td></tr><tr><td> joint learning model with recon-all with denoising constraints</td><td>76.83</td><td>68.53</td><td>65.58</td><td>58.29</td><td>52.43</td><td>45.42</td><td>39.01</td><td>32.32</td><td></td></tr><tr><td>proposed-base; Figure 1(b)</td><td>71.60</td><td>66.31</td><td>58.99</td><td>52.30</td><td>43.88</td><td>31.10</td><td>25.48</td><td>20.95</td><td></td></tr><tr><td>proposed-base with denoising constraints</td><td>72.39</td><td>67.20</td><td>60.60</td><td>52.64</td><td>44.62</td><td>33.52</td><td>28.01</td><td>25.25</td><td></td></tr><tr><td>proposed-perturb (random); Figure 1(c)</td><td>71.34</td><td>67.15</td><td>59.55</td><td>52.86</td><td>43.81</td><td>32.01</td><td>25.78</td><td>20.42</td><td></td></tr><tr><td>proposed-perturb (semantic); Figure 1(c)</td><td>70.06</td><td>67.07</td><td>58.83</td><td>52.41</td><td>43.47</td><td>30.61</td><td>25.00</td><td>19.94</td><td></td></tr></table>
308
+
309
+ # (A4.1) QUALITATIVE ANALYSIS
310
+
311
+ Extended from Section 4.4. Figure 7 shows reconstructed examples from perturbed (random or semantic) latent representations (refer to Figure 5 and the analysis described in Section 4.4).
312
+
313
+ ![](images/f6a972dc25f50eb96aab8b6b183f045da818ad62acb9bbdc0a1fa7537bee6201.jpg)
314
+ Figure 7: For each example, top row is the original examples selected from the training set, and the rest are reconstructed from the perturbed representations via random (left) and semantic (right) perturbations.
315
+
316
+ # (A4.2) QUALITATIVE ANALYSIS
317
+
318
+ Extended from Section 4.4. Figure 8 shows the t-SNE results per class on MNIST. The overall tendency is similar to the description in Section 4.4.
319
+
320
+ ![](images/67539ce30ef40d4cff811931a9fdada3fcb6273cc65b7d415f958e58e94aa3fd.jpg)
321
+
322
+ ![](images/571139d772703de3df5b815c8ae20f2cb437f0dbde8fae9377558d9641fe2d1c.jpg)
323
+ Figure 8: From top to bottom: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. From left to right: training examples (circle), training examples (circle) $^ +$ random-perturbed samples (cross), and training examples (circle) $^ +$ semantic-perturbed samples (cross). Best viewed in color.
md/train/SyfiiMZA-/SyfiiMZA-.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # JOINTLY LEARNING TO CONSTRUCT AND CONTROL AGENTS USING DEEP REINFORCEMENT LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ The physical design of a robot and the policy that controls its motion are inherently coupled. However, existing approaches largely ignore this coupling, instead choosing to alternate between separate design and control phases, which requires expert intuition throughout and risks convergence to suboptimal designs. In this work, we propose a method that jointly optimizes over the physical design of a robot and the corresponding control policy in a model-free fashion, without any need for expert supervision. Given an arbitrary robot morphology, our method maintains a distribution over the design parameters and uses reinforcement learning to train a neural network controller. Throughout training, we refine the robot distribution to maximize the expected reward. This results in an assignment to the robot parameters and neural network policy that are jointly optimal. We evaluate our approach in the context of legged locomotion, and demonstrate that it discovers novel robot designs and walking gaits for several different morphologies, achieving performance comparable to or better than that of hand-crafted designs.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ An agent’s ability to navigate through and interact with its environment depends not just on its skill at planning and controlling its motion, but also on its physical design. Different physical designs are inherently better suited to different tasks and environments. By making appropriate choices during fabrication, mechanical elements can be designed to improve robustness to non-idealities such as errors in perception, delays in actuation, etc., and indeed, make control problem an easier one to solve. At the same time, robots that take different forms may find completely different control strategies to be optimal to complete the same task. Therefore, the physical and computational design of an agent are inherently coupled, and must ideally be jointly optimized if the robot is to successfully complete a task in a particular environment.
12
+
13
+ Consider the development of a legged robot for locomotion. Variations in physical design will require changes to the joint torques in order to preserve a particular locomotion behavior (e.g., a heavier torso requires greater torque at the ankle), and will likely result in completely different walking gaits, even when the morphology is preserved. In fact, some changes to design may render locomotion impossible for the target operating environment (e.g., a robot with long feet may be unable to locomote up an incline). Meanwhile, careful choice of bipedal design enables passive walking (McGeer, 1990; Goswami et al., 1998; Collins et al., 2001). It is therefore beneficial to not simply consider the robot’s design or gait to be fixed, but to optimize both jointly for the target environment and task. Similar co-design can be beneficial in other settings—for example for the control policy and physical characteristics of digits in robotic grippers for grasping.
14
+
15
+ While a robot’s physical design and the corresponding control policy are inherently coupled, most existing methods ignore this coupling, instead choosing to alternate between separate design and control phases. Existing approaches that jointly reason over design and control (Digumarti et al., 2014; Ha et al., 2017; Spielberg et al., 2017) assume knowledge of an accurate model of the robot dynamics and require expert supervision (e.g., to provide a suitable initial design and guide the optimization process). However, these restrictive assumptions limits their applicability to a handful of specific settings, and often yield solutions heavily influenced by expert intuition.
16
+
17
+ In this work, we seek a general approach—one that can optimize a robot’s physical characteristics jointly with controllers of a desired complexity (Fig. 1), that can be applied to general tasks in some given environment, and that can explore the joint search space of physical design and computational control in a purely data-driven way, without a model of the robot dynamics and independent of the biases of expert intuition. We develop this approach in the context of determining the physical parameters of an articulated agent—the lengths and thicknesses of each limbs in a given morphology— through joint training with a neural network for control, with the objective of achieving locomotion. Our method maintains a distribution over these physical parameters, and simultaneously trains the parameters of this distribution with those of a neural network controller, using deep reinforcement learning. In this way, we pursue a design distribution and control policy that are jointly optimal for the given task and environment. Experimental results show that starting from random initializations, our approach is able to find novel designs and walking gaits that match or exceed the performance of manually designed agents. To the best of our knowledge, our method is the first to successfully carry out such a joint optimization of design and control in a completely model-free manner.
18
+
19
+ ![](images/601586609236628de9cee35fd71c942e14a74590dd246e90589f10ecbea5ea80.jpg)
20
+ Figure 1: Our algorithm learns a robot’s physical design jointly with the control policy. Here we show the learned designs evolving over time for the Hopper (top left), the Walker2d (top right) and the Ant (bottom), each with the default Roboschool design for comparison. Scale is fixed for each robot. Note that these designs correspond to modes of the distribution over robot designs that our algorithm maintains during training.
21
+
22
+ # 2 RELATED WORK
23
+
24
+ Attention has been paid recently to the problem of jointly optimizing the parameters that specify a robot’s design and motion (e.g., gaits) or control. Early work in this area takes an evolutionary approach to optimizing a robot’s design and controller, typically parameterized as a neural network, for virtual agents (Sims, 1994; Paul & Bongard, 2001; Agrawal et al., 2013) and physical robots (Lipson & Pollack, 2000; Bongard, 2011). Particularly relevant to our approach is the work of Ha et al. (2017), who relate design and motion parameters via a set of implicit functions that express robot dynamics, desired trajectories, and actuation limits. These functions encode a manifold that is then linearized to model the relationship between design and motion via the implicit function theorem. The method then solves for the desired parameters in a local fashion via constraint-based optimization. Similarly, Spielberg et al. (2017) describe an approach that jointly reasons over physical design and motion parameters for robots with articulated degrees of freedom (e.g., legged robots). They formulate the problem in the framework of trajectory optimization by incorporating parameters involved in the design of articulated robots, including dimensions, masses, mass distribution, and moments of inertia, together with the contact force and torque variables typically associated with trajectory optimization. They use weighted actuation cost as the objective, subject to a regularization penalty on parameters. Their method is guaranteed to find a feasible design so long as the problem is initialized within a small neighborhood of a feasible solution. Unlike our approach, their method requires that the user provide an estimate of the robot configuration at each time step, as well as an accurate analytic model of constraint dynamics (e.g., foot contact), which is computationally expensive to enforce. Geijtenbeek et al. (2013) propose a derivative-free strategy that optimizes over muscle routing and muscle-based control for simulated bipeds to realize a design that incorporates biomechanical constraints. Meanwhile, Digumarti et al. (2014) describe an evolutionary method that jointly reasons over design and motion parameters for legged robots, while also tuning the parameters of a robust controller that tracks these motions. Their method is limited to biologically inspired quadrupedal foothold patterns, and does not account for contact dynamics. In contrast, our approach applies to arbitrary morphologies and does not require that we model contact dynamics.
25
+
26
+ While the focus on simultaneous optimization over robot design and motion parameters is relatively new, there is a long history of research focused on the related problem of co-design of physical structure and control (Reyer & Papalambros, 2002; Ravichandran et al., 2006). Park & Asada (1994) jointly optimize the link geometry of a high-speed robot arm along with the parameters of a PD joint controller. These methods often rely upon access to an accurate model of the robot dynamics in order to design the controller. In order to reduce the dependence upon a detailed analytical model, Pil & Asada (1996) use on-robot experiments to refine their model as part of the iterative design process. More recently, Villarreal-Cervantes et al. (2013) allow for some degree of uncertainty in the model by including the sensitivity of the design and control parameters to model uncertainty along with the task-specific optimization objectives. However, existing methods still rely upon access to an analytical model of the robot dynamics and are typically limited to simple (e.g., linear) control designs. Our method assumes only that the controller can be modeled via a convolutional neural network, and can thereby learn complex, highly nonlinear control policies with no a priori knowledge of the robot dynamics.
27
+
28
+ Far more attention has been paid to the individual problem of task-driven optimization of robot motion and control. Given an arbitrary robot design chosen by novice users, Megaro et al. (2015) describe an interactive design framework that solves for a realizable walking gait that results in stable locomotion. Similarly, Mordatch et al. (2012) synthesize emergent behaviors (motion) for arbitrary morphologies and tasks from high-level specifications, by jointly optimizing over contact and motion. Mordatch et al. (2015) build upon this work by training recurrent neural networks to serve as feedback controllers capable of producing complex, stable behaviors for a variety of dynamical systems. Their method interleaves supervised learning with trajectory optimization, and incorporates noise to improve generalizability. Meanwhile, there is a large body of literature that formulates motion synthesis as a trajectory optimization problem. This approach has proven effective at respecting contact constraints (e.g., between the foot and ground), which make controlling dynamic motion particularly challenging (Dai & Tedrake, 2016; Posa et al., 2016; Griffin & Grizzle, 2016). These approaches have been shown to generate sophisticated behaviors for complex robot designs (e.g., humanoids) (Tassa et al., 2012), and for robots of arbitrary morphologies using only a high-level specification of the robot’s shape, gait, and task (Wampler et al., 2013). Related, a number of methods interleave trajectory optimization and supervised learning with neural network regression (Levine & Abbeel, 2014; Levine & Koltun, 2014; Mordatch & Todorov, 2014; Mordatch et al., 2015). Unlike our method, the use of trajectory optimization makes these approaches reliant upon knowledge of the model.
29
+
30
+ A great deal of attention of-late has focused on the problem of learning complex control policies directly from low-level sensory input, without any knowledge of the system dynamics. Methods that have proven particularly effective combine neural networks that learn representations of the highdimensional raw sensor input with deep reinforcement learning (Riedmiller, 2005; Mnih et al., 2013; 2015; Schulman et al., 2015a). While much of the work in this area focuses on low-dimensional, discrete action spaces, several methods have been recently proposed that learn continuous control policies through deep reinforcement learning. These techniques have been applied to control simple, simulated robots (Wawrzynski, 2009; Wawrzy ´ nski & Tanwani, 2013; Watter et al., 2015; Lillicrap ´ et al., 2015), perform robot manipulation (Levine et al., 2016a;b; Gu et al., 2017), and control legged robots (Schulman et al., 2015b; Peng et al., 2016).
31
+
32
+ Black-box optimization (Schmidhuber et al., 2007; Risi & Togelius, 2017) is an alternative to using reinforcement learning to training the control policy. These approaches have the advantage that they do not involve backpropagating gradients, are insensitive to reward sparsity, and can handle long time horizons. While black-box optimization strategies have traditionally been thought of as illsuited to difficult reinforcement learning problems, Salimans et al. (2017) recently showed that they perform similarly to state-of-the-art RL methods on difficult continuous control problems, including those that involve locomotion. Closely related is the policy-gradient method of Sehnke et al. (2010), who define the policy as a distribution over the parameters of a controller, which they then sample over. This results in gradient estimates that are far less noisy than is typical of policy gradient algorithms. These approaches are similar to the way in which we learn the robot design, which we formulate as a Gaussian mixture model over design parameters. Indeed, the two referenced methods yield the same gradient estimate for Gaussian parameter distributions (Salimans et al., 2017).
33
+
34
+ Meanwhile, much work has focused on the problem of determining robot designs that meet the requirements of a particular task. Given a user demonstration of the desired behaviors, Coros et al. (2013) learn optimum kinematic linkages that are capable of reproducing these motions. Mehta et al. (2014) synthesize electromechanical robot designs in a compositional fashion based upon a complete user-specified structural specification of the robot. Mehta et al. (2016) build upon this work, allowing the user to specify functional objectives via structured English, which is parsed to a formal specification using linear temporal logic. Censi (2017) describes a theory for co-design that includes the ability to select discrete robot parts according to functional constraints, but do not reason over geometry or motion.
35
+
36
+ Related to our approach is recent work that jointly optimizes sensor design and inference algorithms for perception systems. Chakrabarti (2016) considers the problem of jointly learning a camera sensor’s multiplexing pattern along with reconstruction methods for imaging tasks. They model inference as a neural network together and use stochastic gradient descent to backpropagate the loss to a neural layer representation of the multiplexing pattern. Related, Schaff et al. (2017) jointly learn design and inference for beacon-based localization. They encode beacon allocation (spatially and across transmission channels) as a differential neural layer that interfaces with a neural network for inference. Joint optimization then follows from standard techniques for training neural networks.
37
+
38
+ # 3 APPROACH
39
+
40
+ In this section, we begin by describing the standard reinforcement learning framework for training agent policies, and then describe how we extend this to also learn the physical design of the agent.
41
+
42
+ # 3.1 REINFORCEMENT LEARNING BACKGROUND
43
+
44
+ In the standard reinforcement learning setting, an agent interacts with its environment, usually a Markov Decision Process, over a number of discrete timesteps. At each time step $t$ , the agent receives a state $s _ { t } \in S$ and takes action $a _ { t } \in { \mathcal { A } }$ according to a policy $\pi : { \mathcal { S } } A$ . Then, the agent receives a scalar reward $r _ { t }$ and the next state $s _ { t + 1 }$ from the environment. This process continues until a terminal state is reached. The goal of reinforcement learning is to then find a policy $\pi ^ { * }$ that maximizes the expected return $\mathbb { E } [ \mathcal { R } _ { t } ]$ , where $\begin{array} { r } { \mathcal { R } _ { t } = \sum _ { i = 0 } ^ { \infty } \gamma ^ { i } r _ { t + i } } \end{array}$ and $\gamma \in [ 0 , 1 )$ is a discount factor.
45
+
46
+ Policy gradient methods are a class of algorithms often used to optimize reinforcement learning problems, due to their ability to optimize cumulative reward and the ease with which the can be used with neural networks and other nonlinear function approximators. Consequently, they are commonly used for reinforcement learning problems that involve complex, continuous action spaces. Policy gradient methods directly parameterize a stochastic policy $\bar { \pi _ { \boldsymbol { \theta } } } ( a _ { t } | \boldsymbol { s } _ { t } )$ and perform stochastic gradient ascent on the expected return. “Vanilla” policy gradient methods compute an estimate of the gradient $\nabla _ { \boldsymbol { \theta } } \mathbb { E } [ \mathcal { R } _ { t } ]$ using a sample-based mean computed over $\nabla _ { \theta } \log \pi _ { \theta } ( \bar { a _ { t } } \vert s _ { t } ) \mathcal { R } _ { t }$ (Williams, 1992), which yields an unbiased gradient estimate (Sutton et al., 2000). While the variance in the resulting estimate decreases with the number of samples, sampling is computationally expensive. Another way to reduce variance while maintaining an unbiased estimate is to estimate the gradient by comparing the reward to a “baseline” reward $b ( s _ { t } )$ .
47
+
48
+ These methods are effective but can be unstable, especially when used for deep reinforcement learning. Small changes to the policy parameters may cause large changes in the distribution of visited states. Several methods have been proposed to mitigate these effects. Among them, Schulman et al. (2015a) introduce Trust Region Policy Optimization (TRPO), which imposes a constraint on the KLdivergence between policies before and after an update. Recently, Schulman et al. (2017) proposed proximal policy optimization (PPO), a first-order class of methods similar to TRPO. PPO alternates between sampling data through interaction with the environment and optimizing the objective
49
+
50
+ $$
51
+ \hat { \mathbb { E } } _ { t } \left[ \operatorname* { m i n } ( r _ { t } ( \theta ) \hat { A } _ { t } , \operatorname { c l i p } ( r _ { t } ( \theta ) , 1 - \epsilon , 1 + \epsilon ) ) \right] ,
52
+ $$
53
+
54
+ where $\begin{array} { r } { r _ { t } ( \theta ) = \frac { \pi _ { \theta } ( a _ { t } | s _ { t } ) } { \pi _ { \theta _ { \mathrm { o l d } } } ( a _ { t } | s _ { t } ) } } \end{array}$ and $\hat { \mathbb { E } } _ { t }$ represents an empirical average over a finite sample set. This objective seeks to maximize the expected return while encouraging a small step in policy space. The clipping within the objective removes any incentive for moving $r _ { t } ( \theta )$ outside the interval $[ 1 - \epsilon , 1 + \epsilon ]$ . The net effect of this objective is a simple, robust policy gradient algorithm that attains or matches state-of-the-art results on a wide array of tasks (Schulman et al., 2017).
55
+
56
+ <table><tr><td>Algorithm1Joint Optimization</td><td></td></tr><tr><td>Initialize πθ(a|s,r),PΦ(r)</td><td></td></tr><tr><td>while True do</td><td></td></tr><tr><td>for i ∈[1..np] do</td><td></td></tr><tr><td> Sample ri,.., rn from pΦ</td><td></td></tr><tr><td>Collect rollouts with each design</td><td></td></tr><tr><td>Update 0 to maximize PPO&#x27;s surrogate objective. end for</td><td></td></tr><tr><td>for i∈[1..nr] do</td><td></td></tr><tr><td>Sample ri,.*, rm from pΦ</td><td></td></tr><tr><td>Compute returns R1,., Rm·</td><td></td></tr><tr><td></td><td>Update to maximize PPO&#x27;s surrogate objective.</td></tr><tr><td>end for</td><td></td></tr><tr><td>end while</td><td></td></tr></table>
57
+
58
+ # 3.2 JOINT OPTIMIZATION OF DESIGN AND CONTROL
59
+
60
+ We extend the standard reinforcement learning formulation by considering the space of possible robot designs $\Omega$ . Specifically, we assume that for every design $\mathcal { E } \in \Omega$ , we can define common state and action spaces $s$ and $\mathcal { A }$ , reward function $r ( s , a )$ , and initial state distribution $p _ { 0 } ( s )$ , that are meaningful to all designs. The designs differ only in the transition dynamics they induce $p \varepsilon ( s ^ { \prime } | s , a )$ and share a common action space $A$ —to achieve this, we assume a common morphology for all possible designs.
61
+
62
+ Our goal then is to find the optimal design $\mathcal { E } ^ { * }$ and policy $\pi _ { \mathcal { E } ^ { * } } ^ { * }$ pair that maximizes the expected value of a given reward function. However, this is a non-linear, non-convex optimization problem over the spaces of all possible designs and all possible policies. Solving it exactly would require enumerating all possible designs (possibly through discretization of the design space), learning policies for each, and comparing the resulting expected rewards. This is computationally infeasible for all but the simplest of cases. Instead, we develop a gradient-based approach to solving this optimization problem with the following key components: (1) we maintain a multi-modal distribution over the space of physical designs and update this distribution using policy gradient methods in parameter space, similar to Sehnke et al. (2010) and Salimans et al. (2017); and (2) we train a single controller to act on all sampled designs during training, providing this controller with the design parameters of the specific sample it is controlling. We find that the multi-modal stochastic parameterization of the design space allows our method to explore the space more thoroughly (where a uni-modal Gaussian distribution would frequently get trapped in local minima). Moreover, a common controller makes optimization tractable, allowing efficient evaluation of unseen designs. We additionally benefit from learning common strategies across diverse designs, while still adapting different policies to different parts of the design space given the sample parameters as input. Together, these components enable efficient joint exploration of the design and policy spaces.
63
+
64
+ Formally, let $p ( r ; \phi )$ denote the distribution over designs, and $\pi ( a _ { t } | s _ { t } , r ; \theta )$ a stochastic control policy parameterized by $\phi$ and $\theta$ respectively. In our experiments, we use a neural network to model the control policy $\pi$ , and a Gaussian mixture model as the parametric form of the distribution $p ( r ; \phi )$ . Our goal is then to solve the following optimization problem:
65
+
66
+ $$
67
+ \phi ^ { * } , \theta ^ { * } = \underset { \phi , \theta } { \arg \operatorname* { m a x } } \mathbb { E } _ { r , t } \left[ \mathcal { R } _ { t } \right] ,
68
+ $$
69
+
70
+ where $\mathbb { E } _ { \boldsymbol { r } , t } [ \cdot ]$ is the expectation over robots and trajectories those robots induce.
71
+
72
+ We use stochastic gradient-based updates to optimize Eqn. 2. Our method (Algorithm 3.2) alternates between updating the parameters of the policy and design distributions, $\theta$ and $\phi$ , respectively. We empirically find this to yield convergence to better solutions in a reasonable number of iterations compared to performing simultaneous updates. We optimize the policy parameters $\theta$ using Proximal Policy Optimization. However, instead of collecting data from a single design, we sample a design $r$ after a fixed number $T$ of timesteps according to the distribution $p ( r ; \phi )$ . After $n$ iterations of PPO, we freeze the policy parameters and proceed to optimize the parameters of the design distribution. Without knowledge of the model, we optimize the design parameters $\phi$ via policy gradient over parameter space, similar to Sehnke et al. (2010). This is equivalent to black-box optimization methods that have proven effective for complex learning problems (Salimans et al., 2017). We sample $m$ different designs and compute their returns for a single episode acting under policy $\pi ( \cdot ; \theta )$ . We then use this data to shift the design distribution $p ( \cdot ; \phi )$ in a direction maximizing expected return. These iterations are repeated until convergence.
73
+
74
+ ![](images/0babea94ff71820dd39bdf9c33c7081a0ac16e1f9df8bc584653a1c4ea8568a5.jpg)
75
+ Figure 2: From left to right: the default Hopper, Walker2d, and Ant robots. The Hopper and Walker2d are constrained to walk in a line, while the Ant can walk anywhere in the plane.
76
+
77
+ # 4 RESULTS
78
+
79
+ We validate our approach with three commonly used robots provided in OpenAI’s Roboschool (Schulman et al., 2017). Environments in Roboschool are built on top of Bullet Physics, a popular open-source physics engine. In a series of locomotion experiments, we show that our approach not only discovers novel robot designs and gaits, but also outperforms two out of three of the hand-designed robots trained on the same task and yields performance comparable to the third.
80
+
81
+ # 4.1 EXPERIMENT DETAILS
82
+
83
+ We evaluate our approach on three legged locomotion tasks within Roboschool: RoboschoolHopper, RoboschoolWalker2d, and RoboschoolAnt (note that we subsequently drop the Roboschool prefix for brevity). Figure 2 depicts the default Roboschool design for each robot. These environments describe a locomotion task that has the robots moving along the positive $\mathbf { X }$ -axis (to the right in the figures) towards a distant goal. The reward function defined in these environments is a weighted sum of rewards for forward progress and staying upright, and penalties for applying torques and for joints that reach their rotational limits. The episode ends when the robot falls over or reaches a maximum number of timesteps.
84
+
85
+ We learn robot designs using the morphologies specified by the standard Roboschool designs. For each morphology, we parameterize the robot in terms of the length and radius (e.g., mass) of each link (or just the radius in the case of the sphere for the ant body). We impose symmetry, and share parameters across each leg for the Walker2d and Ant designs. This parameterization permits a wide variety of robots of different shapes and sizes, some of which are better suited to the locomotion objective than others, and some designs that do not permit a control policy that results in locomotion.
86
+
87
+ We model the control policy $\pi ( a _ { t } | s _ { t } , \mathcal { E } ; \theta _ { p } )$ as a feed forward neural network consisting of three fully-connected layers with 64 units and tanh activation functions. A final layer maps the output to the robot action space. With the exception of the last robot-specific layer, the architecture is the same for all experiments. Meanwhile, we represent the distribution over the parameterized robot design $p ( \cdot ; \theta _ { r } )$ using a Gaussian mixture model with four mixture components (each with a diagonal covariance matrix over the different parameters). We initialize the means of each component randomly within a wide range, and initialize the variances in order to span the range of each parameter. We find that our approach maintains high variance distributions during early iterations—thereby continuing exploration of the design space—before committing to a chosen design. The appendix provides further details regardng the evolution of these distributions.
88
+
89
+ ![](images/87d05764a68b4483dd235162ccd22ce42ae5244a22dfc99728015163faafa544.jpg)
90
+ Figure 3: Training curves that show the evolution of reward across training iterations for the Hopper, Walker2d, and Ant environments over eight different random seeds. The black dashed line corresponds to the highest achievable performance of the corresponding baseline robot. In other figures, we display the best-performing checkpoint of each run. Therefore, we make each training curve transparent after it stops improving.
91
+
92
+ We train our method with eight threads of Proximal Policy Optimization for a total of 300M environment timesteps across all threads. We use the publicly available implementation of PPO provided in OpenAI Baselines (Hesse et al., 2017). We alternate between 50 policy PPO iterations and 2 design iterations, finding this ratio to yield convergence to good solutions. We set this and the other hyper-parameters on the Hopper and used the same settings for all experiments.
93
+
94
+ # 4.2 EXPERIMENTS
95
+
96
+ We evaluate the performance of our approach to joint optimization over robot design and control on the Hopper, Walker2d, and Ant robots, and compare against a policy trained for the standard Roboschool design. We evaluate the consistency and robustness of our approach relative to the initial robot parameter distribution using several different random seeds. For each robot morphology, we find that our method learns robot designs and the corresponding control policy that are either comparable (Walker2d) or exceed the performance (Hopper and Ant) achievable using the default designs (Fig. 3). We also see that our method achieves these levels of performance by discovering unique robot designs (Fig. 1) together with novel walking gaits (Fig. 4) that can not be achieved with the default designs. Note that our method was able to learn these designs and control policies from a random initialization, without access to a dynamics model or any expert supervision.
97
+
98
+ Our method learns a joint design and controller for the Hopper that outperforms the baseline by as much as $5 0 \%$ . Our learned robot exploits the small size of the foot to achieve faster, more precise walking gaits. Meanwhile, the longer torso of the learned robot improves stability, allowing it to maintain balance while locomoting at a faster pace. We found this behavior to be consistent across several different Hopper experiments, with the method converging to designs with a small foot and long, thin torso. In the appendix, we explore the stability of this design with respect to variations in the environment using the coefficient of friction as an example, and find the improvement to be consistent. For the ant, our optimization yields a physical design that is significantly different from the default design (Fig. 2). Consequently, the learned Ant drastically outperforms the baseline, improving reward by up to $1 1 6 \%$ . Our method learns a design with a small, lightweight body and extremely long legs. The long legs enable the ant to apply large torque at contact, allowing it to move at a fast pace.
99
+
100
+ Our framework learned different design-control pairs for the Walker2d that perform similarly to the default design. Across several different experiments, we see two distinct, successful designs and walking gaits. Interestingly, neither agent walks primarily on its feet. The first design has small, thick legs and long feet. The controller is then able to exploit the thick middle leg link, which protrudes slightly past the foot, to push off the ground. The long foot then provides additional balance. The second design is similar in geometry to the baseline Walker2d, but moves in a very different way. By lowering the knee joint and lengthening the foot, the Walker2d is able to efficiently balance on its knees and toes. This low stance allows the Walker2d to fully extend its leg backwards, creating a long, powerful stride, similar to that of a sprinter using starting blocks.
101
+
102
+ ![](images/97b6ba644983f0da7af6c1a0a705d198e90586ea3304b1179bfe57ed0dfdfbc5.jpg)
103
+ Figure 4: Here, we compare locomotion of default and learned robots, visualizing both their physical design and corresponding learned gaits. We pick the best results for Hopper and Ant, and two of the best results for Walker2d (due to diversity in gaits). Note that for each robot type, we show a blend of a fixed number of frames in the same time interval, allowing direct comparison between the speed with which different designs are able to locomote.
104
+
105
+ # 5 CONCLUSION
106
+
107
+ We proposed what is, to the best of our knowledge, the first model-free algorithm that jointly optimizes over the physical design of a robot and the corresponding control policy, without any need for expert supervision. Given an arbitrary morphology, our robot maintains a distribution over the robot design parameters and learns these parameters together with a neural network controller using policy gradient-based reinforcement learning. This results in an assignment to the policy over robot parameters and the control policy that are jointly optimal. We evaluated our approach on a series of different legged robot morphologies, demonstrating that it results in novel robot designs and walking gaits, achieving performance that either matches or exceeds that of manually defined designs.
108
+
109
+ Our findings suggest several avenues for future work. The most direct is extending the current approach to find optimized designs for uneven terrain, the presence of obstacles, changes in slope, variations in friction, etc. We are also interested in extending our framework to relax the assumption that the morphology is pre-defined. Finally, we are investigating applications to different types of agents and design spaces beyond legged robots (e.g., end-effectors), and exploring appropriate stochastic parameterization for such designs.
110
+
111
+ # REFERENCES
112
+
113
+ Shailen Agrawal, Shuo Shen, and Michiel van de Panne. Diverse motion variations for physicsbased character animation. In Proc. ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 37–44, 2013.
114
+
115
+ Josh Bongard. Morphological change in machines accelerates the evolution of robust behavior. Proc. National Academy of Sciences, 108(4):1234–1239, 2011.
116
+
117
+ Andrea Censi. A class of co-design problems with cyclic constraints and their solution. Robotics and Automation Letters, 2(1):96–103, 2017.
118
+
119
+ Ayan Chakrabarti. Learning sensor multiplexing design through backpropagation. In Advances in Neural Information Processing Systems (NIPS), December 2016.
120
+
121
+ Steven H Collins, Martijn Wisse, and Andy Ruina. A three-dimensional passive-dynamic walking robot with two legs and knees. Int’l J. of Robotics Research, 20(7):607–615, 2001.
122
+
123
+ Stelian Coros, Bernhard Thomaszewski, Gioacchino Noris, Shinjiro Sueda, Moira Forberg, Robert W. Sumner, Wojciech Matusik, and Bernd Bickel. Computational design of mechanical characters. Trans. on Graphics, 32(4):83, 2013.
124
+
125
+ Hongkai Dai and Russ Tedrake. Planning robust walking motion on uneven terrain via convex optimization. In Proc. Int’l Conf. on Humanoid Robots (Humanoids), 2016.
126
+
127
+ Krishnamanaswi M. Digumarti, Christian Gehring, Stelian Coros, J. Hwangbo, and R. Siegwart. Concurrent optimization of mechanical design and locomotion control of a legged robot. In Proc. IEEE Int’l Conf. on Robotics and Automation (ICRA), July 2014.
128
+
129
+ Thomas Geijtenbeek, Michiel van de Panne, and A. Frank van der Stappen. Flexible muscle-based locomotion for bipedal creatures. Trans. on Graphics, 32(6):206, 2013.
130
+
131
+ Ambarish Goswami, Benoit Thuilot, and Bernard Espiau. A study of the passive gait of a compasslike biped robot: Symmetry and chaos. Int’l J. of Robotics Research, 17(12):1282–1301, 1998.
132
+
133
+ Brent Griffin and Jessy Grizzle. Nonholonomic virtual constraints and gait optimization for robust walking control. Int’l J. of Robotics Research, pp. 895–922, 2016.
134
+
135
+ Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In Proc. IEEE Int’l Conf. on Robotics and Automation (ICRA), 2017.
136
+
137
+ Sehoon Ha, Stelian Coros, Alexander Alspach, Joohyung Kim, and Katsu Yamane. Joint optimization of robot design and motion parameters using the implicit function theorem. In Proc. Robotics: Science and Systems (RSS), June 2017.
138
+
139
+ Christopher Hesse, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. OpenAI baselines. https://github.com/openai/baselines, 2017.
140
+
141
+ Sergey Levine and Pieter Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In Advances in Neural Information Processing Systems (NIPS), 2014.
142
+
143
+ Sergey Levine and Vladlen Koltun. Learning complex neural network policies with trajectory optimization. In Proc. Int’l Conf. on Machine Learning (ICML), 2014.
144
+
145
+ Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. J. Machine Learning Research, 17(39):1–40, 2016a.
146
+
147
+ Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. Int’l J. of Robotics Research, 2016b.
148
+
149
+ 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.02971, 2015.
150
+
151
+ Hod Lipson and Jordan B. Pollack. Automatic design and manufacture of robotic lifeforms. Nature, 406(6799):974–978, 2000.
152
+
153
+ Tad McGeer. Passive dynamic walking. Int’l J. of Robotics Research, 9(2):62–82, 1990.
154
+
155
+ Vittorio Megaro, Bernhard Thomaszewski, Maurizio Nitti, Otmar Hilliges, Markus Gross, and Stelian Coros. Interactive design of 3d-printable robotic creatures. Trans. on Graphics, 34(6): 216, 2015.
156
+
157
+ Ankur M. Mehta, Joseph DelPreto, Benjamin Shaya, and Daniela Rus. Cogeneration of mechanical, electrical, and software designs for printable robots from structural specifications. In Proc. IEEE/RSJ Int’l Conf. on Intelligent Robots and Systems (IROS), 2014.
158
+
159
+ Ankur M. Mehta, Joseph DelPreto, Kai Weng Wong, Scott Hamill, Hadas Kress-Gazit, and Daniela Rus. Robot creation from functional specifications. In Int’l Symp. of Robotics Research (ISRR), 2016.
160
+
161
+ 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.5602, 2013.
162
+
163
+ 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.
164
+
165
+ Igor Mordatch and Emo Todorov. Combining the benefits of function approximation and trajectory optimization. In Proc. Robotics: Science and Systems (RSS), 2014.
166
+
167
+ Igor Mordatch, Emanuel Todorov, and Zoran Popovic. Discovery of complex behaviors through ´ contact-invariant optimization. Trans. on Graphics, 31(4):43, 2012.
168
+
169
+ Igor Mordatch, Kendall Lowrey, Galen Andrew, Zoran Popovic, and Emanuel V Todorov. Interactive ´ control of diverse complex characters with neural networks. In Advances in Neural Information Processing Systems (NIPS), 2015.
170
+
171
+ Jahng-Hyon Park and Haruhiko Asada. Concurrent design optimization of mechanical structure and control for high speed robots. J. Dynamic Systems, Measurement, and Control, 116(3):344–356, 1994.
172
+
173
+ Chandana Paul and Josh C Bongard. The road less travelled: Morphology in the optimization of biped robot locomotion. In Proc. IEEE/RSJ Int’l Conf. on Intelligent Robots and Systems (IROS), volume 1, pp. 226–232. IEEE, 2001.
174
+
175
+ Xue Bin Peng, Glen Berseth, and Michiel Van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. Trans. on Graphics, 35(4):81, 2016.
176
+
177
+ Anton C. Pil and Harry H. Asada. Integrated structure/control design of mechatronic systems using a recursive experimental optimization method. Trans. on Mechatronics, 1(3):191–203, 1996.
178
+
179
+ Michael Posa, Scott Kuindersma, and Russ Tedrake. Optimization and stabilization of trajectories for constrained dynamical systems. In Proc. IEEE Int’l Conf. on Robotics and Automation (ICRA), 2016.
180
+
181
+ Thambirajah Ravichandran, David Wang, and Glenn Heppler. Simultaneous plant-controller design optimization of a two-link planar manipulator. Mechatronics, 16(3):233–242, 2006.
182
+
183
+ Julie A. Reyer and Panos Y. Papalambros. Combined optimal design and control with application to an electric dc motor. J. of Mechanical Design, 124(2):183–191, 2002.
184
+
185
+ Martin Riedmiller. Neural fitted Q iteration-first experiences with a data efficient neural reinforcement learning method. In Proc. European Conf. on Machine Learning (ECML), volume 3720. Springer, 2005.
186
+
187
+ Sebastian Risi and Julian Togelius. Neuroevolution in games: State of the art and open challenges. IEEE Trans. on Computational Intelligence and AI in Games, 9(1):25–41, 2017.
188
+
189
+ Tim Salimans, Jonathan Ho, Xi Chen, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864, 2017.
190
+ Charles Schaff, David Yunis, Ayan Chakrabarti, and Matthew R. Walter. Jointly optimizing placement and inference for beacon-based localization. In Proc. IEEE/RSJ Int’l Conf. on Intelligent Robots and Systems (IROS), September 2017.
191
+ Jurgen Schmidhuber, Daan Wierstra, Matteo Gagliolo, and Faustino Gomez. Training recurrent ¨ networks by evolino. Neural Computation, 19(3):757–779, 2007.
192
+ John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. arXiv preprint arXiv:1502.05477, 2015a.
193
+ John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
194
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
195
+ Frank Sehnke, Christian Osendorfer, Thomas Ruckstieß, Alex Graves, Jan Peters, and J ¨ urgen ¨ Schmidhuber. Parameter-exploring policy gradients. Neural Networks, 23(4):551–559, 2010.
196
+ Karl Sims. Evolving virtual creatures. In Proc. Int’l Conf. on Computer Graphics and Interactive Techniques (SIGGRAPH), pp. 15–22, 1994.
197
+ Andrew Spielberg, Brandon Araki, Cynthia Sung, Russ Tedrake, and Daniela Rus. Functional co-optimization of articulated robots. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), May 2017.
198
+ 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 (NIPS), 2000.
199
+ Yuval Tassa, Tom Erez, and Emanuel Todorov. Synthesis and stabilization of complex behaviors through online trajectory optimization. In Proc. IEEE/RSJ Int’l Conf. on Intelligent Robots and Systems (IROS), 2012.
200
+ Miguel G. Villarreal-Cervantes, Carlos A. Cruz-Villar, Jaime Alvarez-Gallegos, and Edgar A. Portilla-Flores. Robust structure-control design approach for mechatronic systems. Trans. on Mechatronics, 18(5):1592–1601, 2013.
201
+ Kevin Wampler, Jovan Popovic, and Zoran Popovi ´ c. Animal locomotion controllers from scratch. ´ In Computer Graphics Forum, volume 32, 2013.
202
+ Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in Neural Information Processing Systems (NIPS), 2015.
203
+ Paweł Wawrzynski. Real-time reinforcement learning by sequential actor-critics and experience ´ replay. Neural Networks, 22(10):1484–1497, 2009.
204
+ Paweł Wawrzynski and Ajay Kumar Tanwani. Autonomous reinforcement learning with experience ´ replay. Neural Networks, 41:156–167, 2013.
205
+ Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3–4), May 1992.
206
+
207
+ # 6 APPENDIX
208
+
209
+ The following provides further evaluation of our framework, including the behavior of the design distribution during training and the robustness of the learned designs to environment variations.
210
+
211
+ # 6.1 A - EVOLUTION OF GMM THROUGHOUT TRAINING
212
+
213
+ To provide insight into the training process of our algorithm, we evaluate the evolution of the Gaussian mixture model distribution throughout training of the best performing Hopper experiment. We initialize each component of the mixture model with random means and a diagonal covariance matrix chosen to cover the parameter space. The initial mixture weights are uniform. As shown in Figure 5 (left), roughly one third of the way through training, our algorithm converges to the most successful component. Additionally, we find that modes generally do not collapse (Figure 5 (right)). We find this behavior to be consistent across random seeds and different robots.
214
+
215
+ ![](images/31445f3810e5a39d1253d521aef51b22276ca400f4dae3d24e97f4bee29e0cef.jpg)
216
+ Figure 5: Plots of (left) the entropy of the mixture weights and (right) the marginal variance of each parameter throughout training. The curves are normalized such that all initial variances are one.
217
+
218
+ # 6.2 B - ROBUSTNESS OF LEARNED DESIGNS
219
+
220
+ It is often desirable for a robot to be able to operate in a variety of environments. In this section, we consider the robustness of a learned design to changes in friction. We conducted experiments on the Hopper in which we first learned the design and controller for one friction setting (0.8). We finetuned the controller in environments with different friction settings, while leaving the design fixed. We find the learned design to be reasonably robust with variability comparable to controllers finetuned for the default hand-crafted design (Fig. 6). Additionally, the learned design outperforms the hand-crafted one across the full range of friction values (although, for very low friction values, both designs essentially were unable to learn a successful gait).
221
+
222
+ Note that our framework can incorporate this goal of generalization by simply sampling from a diverse set of environments during training. But at the same time, it may be useful in some applications to seek out solutions that are specifically adapted to a relatively narrower set of environments, gaining better performance within this set at the cost of more general performance.
223
+
224
+ ![](images/6950886e33eae5aebfefebe1362c093a2ef2d79ce2a27d5c428bd80267a0f480.jpg)
225
+ Figure 6: A visualization of accumulated reward for different friction values. The controllers and learned design were trained in an environment with a friction value of 0.8. We finetuned the controllers (but not the designs) for both the learned and hand-crafted designs for 10M timesteps for each friction value. Rewards are reported as an average over 100 episodes.
md/train/Z7xSQ3SXLQU/Z7xSQ3SXLQU.md ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Manipulating SGD with Data Ordering Attacks
2
+
3
+ Zakhar Shumaylov University of Cambridge zs334@cam.ac.uk
4
+
5
+ Ilia Shumailov University of Cambridge & University of Toronto & Vector Institute ilia.shumailov@cl.cam.ac.uk
6
+
7
+ Dmitry Kazhdan University of Cambridge dk525@cam.ac.uk
8
+
9
+ Yiren Zhao University of Cambridge yiren.zhao@cl.cam.ac.uk
10
+
11
+ Nicolas Papernot University of Toronto & Vector Institute nicolas.papernot@utoronto.ca
12
+
13
+ Murat A. Erdogdu University of Toronto & Vector Institute erdogdu@cs.toronto.edu
14
+
15
+ Ross Anderson University of Cambridge & University of Edinburgh ross.anderson@cl.cam.ac.uk
16
+
17
+ # Abstract
18
+
19
+ Machine learning is vulnerable to a wide variety of attacks. It is now well understood that by changing the underlying data distribution, an adversary can poison the model trained with it or introduce backdoors. In this paper we present a novel class of training-time attacks that require no changes to the underlying dataset or model architecture, but instead only change the order in which data are supplied to the model. In particular, we find that the attacker can either prevent the model from learning, or poison it to learn behaviours specified by the attacker. Furthermore, we find that even a single adversarially-ordered epoch can be enough to slow down model learning, or even to reset all of the learning progress. Indeed, the attacks presented here are not specific to the model or dataset, but rather target the stochastic nature of modern learning procedures. We extensively evaluate our attacks on computer vision and natural language benchmarks to find that the adversary can disrupt model training and even introduce backdoors.
20
+
21
+ # 1 Introduction
22
+
23
+ The data-driven nature of modern machine learning (ML) training routines puts pressure on data supply pipelines, which become increasingly more complex. It is common to find separate disks or whole content distribution networks dedicated to servicing massive datasets. Training is often distributed across multiple workers. This emergent complexity gives a perfect opportunity for an attacker to disrupt ML training, while remaining covert. In the case of stochastic gradient descent (SGD), it assumes uniform random sampling of items from the training dataset, yet in practice this randomness is rarely tested or enforced. Here, we focus on adversarial data sampling.
24
+
25
+ It is now well known that malicious actors can poison data and introduce backdoors, forcing ML models to behave differently in the presence of triggers [12]. While such attacks have been shown to pose a real threat, they have so far required the attacker to perturb the dataset used for training.
26
+
27
+ We now show that by simply changing the order in which batches or data points are supplied to a model during training, an attacker can affect model behaviour. More precisely, we show that it is possible to perform integrity and availability attacks without adding or modifying any data points. For integrity, an attacker can reduce model accuracy or arbitrarily control its predictions in the presence of particular triggers. For availability, an attacker can increase the amount of time it takes for the model to train, or even reset the learning progress, forcing the model parameters into a meaningless state.
28
+
29
+ <table><tr><td>Attack</td><td></td><td></td><td></td><td>Dataset knowledgeModel knowledgeModelspecificChangingdatasetAdding dataAddingperturbations</td><td></td><td></td></tr><tr><td>Batch Reorder</td><td></td><td></td><td></td><td></td><td>X</td><td></td></tr><tr><td>Batch Reshuffle</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Batch Replace</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Adversarial initialisation [11]</td><td></td><td>×</td><td>√</td><td>X</td><td>X</td><td></td></tr><tr><td>BadNets [12]</td><td>X</td><td></td><td>X</td><td></td><td>X</td><td>×</td></tr><tr><td>Dynamic triggers [28]</td><td>√</td><td>√</td><td>X</td><td></td><td>X</td><td>√</td></tr><tr><td>Poisoned frogs [32]</td><td></td><td>√</td><td>X</td><td>√</td><td>X</td><td>√</td></tr></table>
30
+
31
+ Table 1: Taxonomy of training time attacks. In green, we highlight our attacks.
32
+
33
+ We present three different types of attacks that exploit Batch Reordering, Reshuffling and Replacing – naming them BRRR attacks. We show that an attacker can significantly change model performance by (i) changing the order in which batches are supplied to models during training; (ii) changing the order in which individual data points are supplied to models during training; and (iii) replacing datapoints from batches with other points from the dataset to promote specific data biases. Furthermore, we introduce Batch-Order Poison (BOP) and Batch-Order Backdoor (BOB), the first techniques that enable poisoning and backdooring of neural networks using only clean data and clean labels; an attacker can control the parameter update of a model by appropriate choice of benign datapoints. Importantly, BRRR attacks require no underlying model access or knowledge of the dataset. Instead, they focus on the stochasticity of gradient descent, disrupting how well individual batches approximate the true distribution that a model is trying to learn.
34
+
35
+ To summarise, we make the following contributions in this paper:
36
+
37
+ • We present a novel class of attacks on ML models that target the data batching procedure used during training, affecting their integrity and availability. We present a theoretical analysis explaining how and why these attacks work, showing that they target fundamental assumptions of stochastic learning, and are therefore model and dataset agnostic1. • We evaluate these attacks on a set of common computer vision and language benchmarks, using a range of different hyper-parameter configurations, and find that an attacker can slow the progress of training, as well as reset it, with just a single epoch of intervention. • We show that data order can poison models and introduce backdoors, even in a blackbox setup. For a whitebox setup, we find that the adversary can introduce backdoors almost as well as if they used perturbed data. While a baseline CIFAR10 VGG16 model that uses perturbed data gets ${ \bar { 9 } } 9 \%$ trigger accuracy, the whitebox BOB attacker gets $9 1 \% \pm 1 3$ and the blackbox BOB attacker achieves $6 8 \% \pm 1 9$ .
38
+
39
+ # 2 Related Work
40
+
41
+ Attacks on integrity: Szegedy et al. [34] and Biggio et al. [6] concurrently discovered the existence of adversarial examples. These samples, containing human imperceptible perturbations, cause models to output incorrect results during inference. The original whitebox attacks require the adversary to access the models and use gradient information to perform conditioned optimisation to maximise the model loss [34, 6, 10, 22]. The attack later generalised to blackbox setups, where the adversary trains a surrogate model and hopes the generated adversarial samples transfer to the target model [24].
42
+
43
+ The data-poisoning attack aims at using data manipulation to cause DNNs to fail on specific test-time instances [17]. Chen et al. demonstrated that manipulation of the labels of around 50 training samples is enough to trigger failure [8]. Gu et al. showed that attackers can associate adversarial patterns with labelled images and cause DNNs to overfit to this pattern [12]. Shafahi et al. launched a poisoning attack using instances with clean labels [29]. A number of other works have since created more efficient triggers [28]. It was a common belief that poisoning attacks on DNNs have to contain a certain level of malicious manipulation of whether the data or label at train time. However, this paper shows how poisoning is possible with clean data and clean labels, with the only manipulation being of the batching process at training time.
44
+
45
+ Attacks on availability: Shumailov et al. first attacked the availability of computer vision and natural language processing models at inference time with sponge examples [30]. They pessimized over energy utilisation and inference latency to target hardware and internal model optimisations. By contrast, this paper targets availability at training time. We show that the attacker can reset or slow down training progress by reordering or reshuffling natural batches. Finally, we note that unlike Shumailov et al., our attacks do not target specific optimisations in hardware or individual models, but instead break the fundamental stochastic assumption of training.
46
+
47
+ Note on terminology: As we study attacks on training, we use the terms integrity and availability in a slightly different sense from the rest of the literature. By availability, we mean the availability of a training procedure – the rate at which the model trains, as opposed to model performance on the task. By integrity attacks, we mean attacks that either stop the model from learning its intended task, or force it to learn an additional unrelated task.
48
+
49
+ # 3 Methodology
50
+
51
+ # 3.1 Threat model
52
+
53
+ ![](images/7350808cdc653df8e4d2f8c68bb3e0851adb28912ef8969280821c54c3a3fc85.jpg)
54
+ Figure 1: The attacker reorders the benign randomly supplied data based on the surrogate model outputs. Attacker co-trains the surrogate model with the data that is supplied to the source model.
55
+
56
+ We assume one of the strongest threat models currently described in the literature. In particular, our blackbox attacker assumes no access to the model and no prior knowledge of the training data, whereas a whitebox attacker has access to the model under attack and can compute its loss directly. The attack specifically focuses on the batching part of the ML pipeline as is depicted in Figure 1. We discuss the related work in Section 2.
57
+
58
+ This attack is realistic and can be instantiated in several ways. The attack code can be infiltrated into: the operating system handing file system requests; the disk handling individual data accesses; the software that determines the way random data sampling is performed; the distributed storage manager; or the machine learning pipeline itself handling prefetch operations. That is a substantial attack surface, and for large models these components may be controlled by different principals. The attack is also very stealthy. The attacker does not add any noise or perturbation to the data. There are no triggers or backdoors introduced into the dataset. All of the data points are natural. In two of four variants the attacker uses the whole dataset and does not oversample any given point, i.e. the sampling is without replacement. This makes it difficult to deploy simple countermeasures.
59
+
60
+ # 3.2 Primer on stochastic learning and batching
61
+
62
+ We assume that the defender is trying to train a deep neural network model with parameters $\theta$ operating over $X _ { i } \sim { \mathcal { X } } _ { \mathrm { t r a i n } }$ , solving a non-convex optimization problem with respect to parameters $\theta$ , corresponding to minimization of a given loss function $L ( \theta )$ . We will denote the training dataset $X \ = \ \{ X _ { i } \}$ . We assume a commonly-used loss function defined as the sample average of the loss per training data point $L _ { i } ( \theta ) \stackrel { \cdot } { = } \stackrel { \cdot } { L } ( X _ { i } , \theta )$ in $k$ -th batch over the training set, where $B$ is the batch size: $\begin{array} { r } { \hat { L } _ { k + 1 } ( \theta ) = \frac { 1 } { B } \sum _ { i = k B + 1 } ^ { k B + B } L _ { i } ( \theta ) } \end{array}$ . If we let $N \cdot B$ be the total number of items for training, then in a single epoch one aims to optimize: $\begin{array} { r } { \hat { L } ( \theta ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \hat { L } _ { i } ( \theta ) } \end{array}$ . Optimization with stochastic gradient descent (SGD) algorithm of $N \cdot B$ samples and a learning rate of $\eta$ leads to the following weight update rule over one epoch: $\theta _ { k + 1 } = \theta _ { k } + \eta \Delta \theta _ { k }$ ; $\Delta \theta _ { k } = - \nabla _ { \theta } \hat { L } _ { k } ( \theta _ { k } )$ . SGD is often implemented with momentum [25, 33], with $\mu$ and $v$ representing momentum and velocity respectively: $v _ { k + 1 } = \mu v _ { k } + \eta \Delta \theta _ { k }$ ; $\theta _ { k + 1 } = \theta _ { k } + v _ { k + 1 }$ .
63
+
64
+ Given data, SGD’s stochasticity comes from the batch sampling procedure. Mini-batched gradients approximate the true gradients of $\hat { L }$ and the quality of this approximation can vary greatly. In fact, assuming an unbiased sampling procedure, i.e. when the $k$ ’th gradient step corresponds to $i _ { k }$ ’th batch with $\mathbb { P } ( i _ { k } = i ) = 1 / N$ , in expectation the batch gradient matches the true gradient:
65
+
66
+ $$
67
+ \mathbb { E } [ \nabla \hat { L } _ { i _ { k } } ( \theta ) ] = \sum _ { i = 1 } ^ { N } \mathbb { P } ( i _ { k } = i ) \nabla \hat { L } _ { i } ( \theta ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \nabla \hat { L } _ { i } ( \theta ) = \nabla \hat { L } ( \theta ) .
68
+ $$
69
+
70
+ Although this happens in expectation, a given batch taken in isolation can be very far from the mean. This variation has been exploited in the literature to aid training: there exists a field responsible for variance reduction techniques for stochastic optimisation [18], active learning [9, 35], (anti-) curriculum learning [5, 20, 13] and core-set construction [2]. Each area looks at identifying and scheduling data subsets that aid training and give a better true gradient approximation. In this paper, we turn things round and investigate how an attacker can exploit data order to break training. The explicit stochastic assumption opens a new attack surface for the attacker to influence the learning process. In particular, let us consider the effect of $N$ SGD steps over one epoch [31]:
71
+
72
+ $$
73
+ \begin{array} { l } { \displaystyle \theta _ { N + 1 } = \theta _ { 1 } - \eta \nabla \hat { L } _ { 1 } ( \theta _ { 1 } ) - \eta \nabla \hat { L } _ { 2 } ( \theta _ { 2 } ) - \cdot \cdot \cdot - \eta \nabla \hat { L } _ { N } ( \theta _ { N } ) } \\ { \displaystyle \qquad = \theta _ { 1 } - \eta \sum _ { j = 1 } ^ { N } \nabla \hat { L } _ { j } ( \theta _ { 1 } ) + \eta ^ { 2 } \sum _ { j = 1 } ^ { N } \sum _ { k < j } \nabla \nabla \hat { L } _ { j } ( \theta _ { 1 } ) \nabla \hat { L } _ { k } ( \theta _ { 1 } ) + O ( N ^ { 3 } \eta ^ { 3 } ) . } \end{array}
74
+ $$
75
+
76
+ As we can see, in this case the second order correction term is dependent on the order of the batches provided. The attacker we describe in this paper focuses on manipulating it i.e. finding a sequence of updates such that the first and second derivatives are misaligned with the true gradient step. In Appendix C we prove that under equally-distributed loss gradients, a change in data order can lead to an increase in the expected value of the term which is dependent on data order. We also derive a condition on the gradient distribution given a model for which it is guaranteed. Finally, we derive an attack objective to target the upper bound on the rate of SGD convergence explicitly in Appendix A.
77
+
78
+ In this paper we assume the blackbox attacker has no access to the underlying model, and thus no way to monitor its errors or the progress of its training. Instead, we co-train a separate surrogate model, using the batches supplied to the target model. We find that in practice the losses produced by the surrogate model approximate the losses of the true model well enough to enable attacks on both integrity and availability. We empirically find that our blackbox reshuffle attacks perform as well as the whitebox one in Appendix D.
79
+
80
+ Finally, although the attacker can maximise the term dependent on data order directly, in practice it is expensive to do so. Therefore, in the attack we use the loss magnitudes directly rather than their gradient. Intuitively, large prediction errors correspond to large loss gradient norms, while correct predictions produce near-zero gradients. Although this assumption may not hold for all loss landscapes, for the loss landscapes incurred by real machine learning models, local minima often cluster around the global minima as the loss satisfies certain dissipativity properties [26, 36], and consequently loss magnitudes correlate with the gradient of the loss. We emphasize that we use this approximation only for computational advantage.
81
+
82
+ # 3.3 Taxonomy of batching attacks
83
+
84
+ In this section we describe the taxonomy of batching attacks as shown in Figure 2. The overall attack algorithm is shown in Algorithm 2 in the Appendix, and a shortened attack flow is shown in Algorithm 1. We highlight that our attacks are the first to successfully poison the underlying
85
+
86
+ ![](images/9ecad19d92ad1568ab77942a28d92ec253ae771264a960b96261a0566ccd5b9a.jpg)
87
+ Figure 2: Taxonomy of BRRR attacks. Normal batching assumes randomly distributed data points and batches. Batch reordering assumes the batches appear to the model in a different order, but internal contents stay in the original random order. Batch reshuffling assumes that the individual datapoints within batches change order, but appear only once and do not repeat across batches. Finally, batch replacement refers to cases where datapoints or batches can repeat or not appear at all.
88
+
89
+ # Algorithm 1: A high level description of the BRRR attack algorithm
90
+
91
+ /\* –– Attack preparation: collecting data \*/
92
+ do get a new batch and add it to a list of unseen datapoints; train surrogate model on a batch and pass it on to the model;
93
+ while first epoch is not finished
94
+ /\* Attack: reorder based on surrogate loss \*/
95
+ while training do rank each data point from epoch one with a surrogate loss; reorder the data points according to the attack strategy; pass batches to model and train the surrogate at the same time.
96
+
97
+ model without changing the underlying dataset. In this paper we use three attack policies – (1) batch reshuffling or changing the order of datapoints inside batches; (2) batch reordering or changing the order of batches; and (3) batch replacement or replacing both points and batches. We consider four reordering policies, motivated by research in the fields of curriculum learning [5] and core-set selection [2], which discovered that model training can be enhanced by scheduling how and what data is presented to the model. That can help the model to generalize and to avoid overfitting with memorization. This paper does the opposite – we promote memorization and overfitting, forcing the model to forget generalizable features. Anti-curriculum learning (e.g. [13]) is particularly close to our batch reordering setting.
98
+
99
+ ![](images/df105449880bbabdecd0854bc6cc57fd11ee600465a07e1058c5c441f8b34b55.jpg)
100
+ Figure 3: We use four different reorder and reshuffle policies based on the corresponding data point and batch losses. We color-code the loss values from bright to dark colors, to represent loss values from low to high. Low-high policy orders a sequence by the loss magnitude. High-low policy orders a sequence by the negative loss magnitude. Oscillation inwards orders elements of the sequence from the beginning and the end of the sequence one by one, as if it was oscillating between sides of the sequence and moving towards the middle. Finally, Oscillations outward orders the sequence by starting at the middle of an ordered sequence picking elements to both sides of the current location.
101
+
102
+ Figure 3 shows attack policies. Low to high orders sequence items by their loss. High to low is an inverse of Low to high. Oscillations inwards picks elements from both sides in sequence. Oscillations outwards inverts the halves of the sequence and then picks elements from both sides.
103
+
104
+ # 3.4 Batch-order poison and backdoor
105
+
106
+ Machine-learning poisoning and backdooring techniques aim to manipulate the training of a given model to control its behavior during inference. In the classical setting, both involve either appending adversarial datapoints $\hat { X }$ to natural dataset $X$ or changing natural datapoints $X + \delta$ so as to change model behaviour. This makes the attack easier to detect, and to prevent. For example, an adversary may add a red pixel above every tank in the dataset to introduce the red pixel trigger and cause other objects under red pixels to be classified as tanks.
107
+
108
+ We present batch-order poisoning (BOP) and batch-order backdooring (BOB) – the first poison and backdoor strategies that do not rely on adding adversarial datapoints or perturbations during training, but only on changing the order in which genuine data are presented. BOP and BOB are based on the idea that the stochastic gradient update rule used in DNN training is agnostic of the batch contents and is an aggregation. Indeed, consider a classical poison setting with an adversarial dataset $\hat { X }$ : $\theta _ { k + 1 } = \theta _ { k } \stackrel { \smile \sim } { + } \eta \bar { \Delta } \theta _ { k } ; \quad \Delta \theta _ { k } = - ( \nabla _ { \theta } \hat { L } ( X _ { k } , \theta _ { k } ) + \nabla _ { \theta } \hat { L } ( \hat { X } _ { k } , \theta _ { k } ) )$
109
+
110
+ Order-agnostic aggregation with a sum makes it hard to reconstruct the individual datapoints $X _ { k }$ from just observing $\Delta \theta _ { k }$ . Indeed, the stochastic nature of optimisation allows one to find a set of datapoints $X _ { j } \neq X _ { i }$ such that $\nabla _ { \boldsymbol { \theta } } \hat { L } ( X _ { i } , { \boldsymbol { \theta } } _ { k } ) \approx \nabla _ { \boldsymbol { \theta } } \hat { L } ( X _ { j } , { \boldsymbol { \theta } } _ { k } )$ . Given a model and a dataset such that the gradient covariance matrix is non-singular, an attacker can approximate the gradient update from an adversarial dataset $\hat { X }$ using natural datapoints from the genuine dataset $X$ , enabling poisoning without having to change of underlying dataset in any way:
111
+
112
+ $$
113
+ \theta _ { k + 1 } = \theta _ { k } + \eta \hat { \Delta } \theta _ { k } , \mathrm { w h e r e \ } \left\{ \begin{array} { l l } { \hat { \Delta } \theta _ { k } = - \nabla _ { \theta } \hat { L } ( X _ { i } , \theta _ { k } ) } \\ { \nabla _ { \theta } \hat { L } ( X _ { i } , \theta _ { k } ) \approx \nabla _ { \theta } \hat { L } ( \hat { X } _ { k } , \theta _ { k } ) . } \end{array} \right.
114
+ $$
115
+
116
+ This gives rise to a surprisingly powerful adversary, who can introduce arbitrary behaviors into any models learned with stochastic gradient descent without having to add or perturb training data. This attack becomes more effective as training datasets become larger, further improving the attacker’s ability to shape the gradient update. We discuss its fidelity in Appendix B.
117
+
118
+ ![](images/429f59afc50256e77aa3ccf6dba59f0766f7a0748716b19ea920ca86f94cc5c2.jpg)
119
+ Figure 4: Examples of batches shown in (a) and (b) with similar gradient updates. Images shown in (a) are natural and are coming from the training set, whereas image in (b) is the poison datapoint. Strong gradients are aligned across the layers and successfully change the prediction of poison datapoints.
120
+
121
+ We evaluated a number of different setups, and found that the attack works best when the attacker comprises the batch with $B - V$ natural data points and appends $V$ adversarially-chosen data points ${ \hat { X } } _ { i }$ to the batch. Aa larger $V$ is better for gradient approximation, but leads to more conflict with natural gradients; in the paper up to $30 \%$ of the batch is filled with natural datapoints to find a balance. Finding precise batch reconstruction is an intractable problem that scales with batch size and size of the dataset. However, we find that random sampling works well; even if mistakes are made, the network still learns the poison over the course of a few batches. Overall we try to minimize the following reconstruction error for a given poisoned batch $\hat { X _ { j } }$ :
122
+
123
+ $$
124
+ \operatorname* { m i n } _ { X _ { i } } \quad \left\| \nabla _ { \theta } \hat { L } ( \hat { X _ { j } } , \theta _ { k } ) - \nabla _ { \theta } \hat { L } ( X _ { i } , \theta _ { k } ) \right\| ^ { p } ; \quad \mathrm { s . t . } \quad X _ { i } \in X .
125
+ $$
126
+
127
+ Although more sophisticated approaches could help find better candidates, we discovered that random sampling works well enough for successful clean-data / clean-label poison and backdoor attacks. It also helps us strike a balance between speed of batch construction and impact on model performance. Figure 4 shows an example of natural data (a) that closely resembled the would-be update with batch in (b). Notably, such updates result in a prediction change towards the target class.
128
+
129
+ # 4 Evaluation
130
+
131
+ # 4.1 Experimental setup
132
+
133
+ We evaluate our attacks using two computer vision and one natural language benchmarks: the CIFAR-10, CIFAR-100 [19] and AGNews [37] datasets. We use ResNet-18 and ResNet-50 as source models [14], and LeNet-5 [21] and MobileNet [16] as surrogate models, to train CIFAR-10 and CIFAR-100 respectively. For AGNews we used sparse mean EmbeddingBag followed by three fully connected layer from torchtext as source model and one fully connected layer for surrogate. Note that the surrogate model is significantly less performant than its corresponding source model in all cases, and cannot learn the dataset to the same degree of accuracy, limiting attacker capabilities. Thus our results represent a lower bound on attack performance.
134
+
135
+ 4.2 Integrity attacks with reshuffling and reordering of natural data
136
+
137
+ <table><tr><td></td><td colspan="2">CIFAR-10</td><td></td><td colspan="2">CIFAR-100</td><td></td><td></td><td>AGNews</td><td></td></tr><tr><td>Attack</td><td>Train acc</td><td>Test acc</td><td>△</td><td>Train acc</td><td>Test acc</td><td>△</td><td>Train acc</td><td>Test acc</td><td>△</td></tr><tr><td>Baseline</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>None</td><td>95.51</td><td>90.51</td><td>-0.0%</td><td>99.96</td><td>75.56</td><td>-0.0%</td><td>93.13</td><td>90.87</td><td>-0.0%</td></tr><tr><td>Batch reshuffle</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Oscillation outward</td><td>17.44</td><td>26.13</td><td>-64.38%</td><td>99.80</td><td>18.00</td><td>-57.56%</td><td>97.72</td><td>65.85</td><td>-25.02%</td></tr><tr><td>Oscillation inward</td><td>22.85</td><td>28.94</td><td>-61.57%</td><td>99.92</td><td>31.38</td><td>-44.18%</td><td>94.06</td><td>89.23</td><td>-1.64%</td></tr><tr><td>High Low</td><td>23.39</td><td>31.04</td><td>-59.47%</td><td>99.69</td><td>21.15</td><td>−54.41%</td><td>94.38</td><td>56.54</td><td>-34.33%</td></tr><tr><td>Low High</td><td>20.22</td><td>30.09</td><td>-60.42%</td><td>96.07</td><td>20.48</td><td>-55.08%</td><td>98.94</td><td>59.28</td><td>-31.59%</td></tr><tr><td>Batch reorder</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Oscillation outward</td><td>99.37</td><td>78.65</td><td>-11.86%</td><td>100.00</td><td>53.05</td><td>-22.51%</td><td>95.37</td><td>90.92</td><td>+0.05%</td></tr><tr><td>Oscillation inward</td><td>99.60</td><td>78.18</td><td>-12.33%</td><td>100.00</td><td>51.78</td><td>-23.78%</td><td>96.29</td><td>91.10</td><td>+0.93%</td></tr><tr><td>High Low</td><td>99.44</td><td>79.65</td><td>-10.86%</td><td>100.00</td><td>51.48</td><td>-24.08%</td><td>96.16</td><td>91.80</td><td>+0.05%</td></tr><tr><td>Low High</td><td>99.58</td><td>79.07</td><td>−11.43%</td><td>100.00</td><td>54.04</td><td>-21.52%</td><td>94.02</td><td>90.35</td><td>-0.52%</td></tr></table>
138
+
139
+ Table 2: A shortened version of Table 4. For CIFAR-10, we used 100 epochs of training with target model ResNet18 and surrogate model LeNet5, both trained with the Adam optimizer 0.1 learning rate and $\beta = ( 0 . 9 9 , 0 . 9 )$ . For CIFAR-100, we used 200 epochs of training with target model ResNet50 and surrogate model Mobilenet, trained with SGD with 0.1 learning rate, 0.3 moment and Adam respectively for real and surrogate models. We highlight models that perform best in terms of test dataset loss. AGNews were trained with SGD learning rate 0.1, 0 moments for 50 epochs with sparse mean EmbeddingBags. Numbers here are from best-performing model test loss-wise. Incidentally, best performance of all models for Batch reshuffle listed in the table happen at epoch number one, where the attacker is preparing the attack and is collecting the training dataset. All computer vision reshuffle attacks result in near-random guess performance for almost all subsequent epochs.
140
+
141
+ Table 2 presents the results (a much more detailed version is shown in Table 4). Batch reordering disrupts normal model training and introduces from zero to $1 5 \%$ performance degradation (refer to extended results and discussion in Appendix E). Note that the attacker does nothing beyond changing the order of the batches; their internal composition is the same. This shows the potency of this attack. Indeed, when we extend the attack to batch reshuffling – where batches get re-arranged internally – for computer vision, performance degrades to that of random guessing. In each, the best-performing models stay at the first epoch, where the attacker still accumulates the dataset used in training. Here, the degradation in performance is maximum – all models with all attack types failed to perform better than random guessing, having reached their top performance only in the first epoch, when the attacker was observing the dataset.
142
+
143
+ We additionally report a large number of different hyperparameter variations for the attacks in Appendix I. This hyperparameter search suggests that the attacks work well as long as the surrogate models learn, do not converge to a minimum straight away, and have sufficient learning rate.
144
+
145
+ Overall, we find that:
146
+
147
+ • An attacker can affect the integrity of model training by changing the order of individual data items and natural batches. • The attacker can reduce model performance, and completely reset its performance.
148
+
149
+ ![](images/83116d09b53f241c612497de545c89588202c5abe0bace04f5ffb29e51d6e056.jpg)
150
+ Figure 5: Availability attacks at epoch 10, ResNet-18 attacked with a LeNet-5 surrogate. Error bars show per-batch accuracy standard deviation.
151
+
152
+ While the previous section discused integrity attacks, this section’s focus is on availability. This refers to the amount of time and effort required to train a model, and an availability attack can involve an adversary using BRRR attacks to slow down training without disrupting the overall learning procedure. It is worth noting that there are other possible definitions of availability; it can also mean a model’s ability to reach original accuracy, but this case is already included in the integrity attacks we discussed in the last section.
153
+
154
+ Availability attacks follow a similar scenario to Section 4.2 above, in that the attacker only changes the order in which data reaches the model. Here we at the 10th epoch, an arbitrary attack point, and all other training is done with randomly ordered data. We find that by feeding the model with a few BRRR batches, its training progress can be reset significantly – progress that may take a surprisingly large number of epochs to recover. The red line shows the worst scenario, where each batch has only data points of a single class. It can be seen that the attack manages to reset training, degrading performance for more than 90 epochs – low-high batch reordering at epoch ten results in $- 3 \%$ performance at epoch 100.
155
+
156
+ In this section we showed that the attacker can perform availability attacks using both batch reordering and reshuffling and leave an impact on a model long after they have been launched; even a single attack epoch can degrade training progress significantly. Overall, we find that:
157
+
158
+ • An attacker can cause disruption to model training by changing the order of data in just a single epoch of training. • An attack at just one epoch is enough to degrade the training for more than 90 epochs.
159
+
160
+ # 4.4 Backdoors with batch replacement
161
+
162
+ We find that the attacker can backdoor models by changing the data order. Here, we apply a trigger to images from the training dataset and then supply untriggered data to the model that result in a similar gradient shape. We find that our method enables the attacker to control the decision of a model when it makes a mistake i.e. when the model is making a decision about data far from the training-set distribution. For example, we show in Appendix F that poisoning a single random datapoint is possible with just a few batches. We hypothesise that the limitation comes from the fact that as only natural data are sampled for each BOP and BOB batch, natural gradients are present and learning continues; so forgetting does not happen and generalisation is not disrupted.
163
+
164
+ ![](images/e758fbe033d2bbfde84cfbfaeb34b96eb5fd07f34e65cf30fde4d1eac166b47a.jpg)
165
+ Figure 6: Triggers used in the paper: both are the same magnitude-wise, affecting $30 \%$ of the image.
166
+
167
+ We evaluate two triggers shown in Figure 6, a white lines trigger, which clears the top part of an image, or flag-like trigger that spans all of the image. We report results from injecting up to 20 adversariallyordered batches every 50000 natural datapoints for 10 epochs. We then inject 80 adversarially-ordered batches. The training procedure here is similar to the one used for BadNets [12]. We find that 80 batches are not necessary, as most models end up converging after 3–5 adversarially-ordered batches. For reconstruction we randomly sample 300 batches, balancing search efficiency and attack cost as is noted in Appendix H, and use $p = 2$ . As we discuss in Appendix L, similar attacks work against language tasks.
168
+
169
+ <table><tr><td>Trigger</td><td>Batch size</td><td>Train acc [%]</td><td>Test acc [%]</td><td>Trigger acc [%]</td><td>Error with trigger [%]</td></tr><tr><td>Baselines</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="4">Random natural data</td><td>32</td><td>88.43 ± 7.26</td><td>79.60 ± 1.49</td><td>10.91 ± 1.53</td><td>30.70 ± 2.26</td></tr><tr><td>64</td><td>95.93 ± 2.11</td><td>81.31 ± 2.01</td><td>9.78 ± 1.25</td><td>27.38 ± 1.20</td></tr><tr><td>128</td><td>94.92 ± 2.04</td><td>81.69 ± 1.17</td><td>10.00 ± 2.26</td><td>27.91 ± 1.41</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Data with trigger perturbation</td><td>32</td><td>96.87± 2.79</td><td>73.28±2.93</td><td>99.65±0.22</td><td>89.68 ±0.21</td></tr><tr><td>64</td><td>98.12 ± 1.53</td><td>79.45 ± 1.39</td><td>99.64±0.21</td><td>89.64± 0.21</td></tr><tr><td>128</td><td>98.67±0.99</td><td>80.51 ± 1.10</td><td>99.67 ± 0.40</td><td>89.65 ±0.39</td></tr><tr><td>Only reordered natural data</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">9 white lines trigger</td><td>32</td><td>88.43±6.09</td><td>78.02 ±1.50</td><td>33.93 ± 7.37</td><td>40.78 ± 5.70</td></tr><tr><td>64 128</td><td>95.15 ± 2.65</td><td>82.75±0.86</td><td>25.02 ±3.78</td><td>33.91 ± 2.28</td></tr><tr><td></td><td>95.23± 2.24</td><td>82.90 ± 1.50</td><td>21.75 ± 4.49</td><td>31.75 ± 3.68</td></tr><tr><td rowspan="4">Blackbox 9 white lines trigger</td><td>32</td><td>88.43 ± 4.85</td><td>80.84±1.20</td><td>17.55 ± 3.71</td><td>33.64 ± 2.83</td></tr><tr><td>64</td><td>93.59 ± 3.15</td><td>82.64 ± 1.64</td><td>16.59 ± 4.80</td><td>30.90±3.08</td></tr><tr><td>128</td><td>94.84± 2.24</td><td>81.12 ± 2.49</td><td>16.19 ± 4.01</td><td>31.33 ±3.73</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="4">Flag-like trigger</td><td>32</td><td>90.93 ± 3.81</td><td>78.46 ± 1.04</td><td>91.03 ± 12.96</td><td>87.08 ± 2.71</td></tr><tr><td>64</td><td>96.87 ± 1.21</td><td>82.95±0.72</td><td>77.10 ± 16.96</td><td>82.92 ±3.89</td></tr><tr><td>128</td><td>95.54 ± 1.88</td><td>82.28 ± 1.50</td><td>69.49 ± 20.66</td><td>82.09 ±3.78</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Blackbox flag-like trigger</td><td>32</td><td>86.25 ± 4.00</td><td>80.16 ± 1.91</td><td>56.31 ± 19.57</td><td>78.78± 3.51</td></tr><tr><td>64</td><td>95.00 ± 2.18</td><td>83.41± 0.94</td><td>48.75± 23.28</td><td>78.11 ± 4.40</td></tr><tr><td>128</td><td>93.82 ± 2.27</td><td>81.54 ± 1.94</td><td>68.07 ± 18.55</td><td>81.23 ± 3.80</td></tr></table>
170
+
171
+ Table 3: Network is VGG16 that has been trained normally on CIFAR10 for 10 epochs and then gets attacked with 10 BOB trigger batches. Test accuracy refers to the original benign accuracy, ‘Trigger acc’ is the proportion of images that are classified as the trigger target label, while ‘Error with trigger’ refers to all of the predictions that result in an incorrect label. Standard deviations are calculated over different target classes. Blackbox results use a ResNet-18 surrogate.
172
+
173
+ Table 3 shows BOB trigger performance for both whitebox and blackbox setups. We present two baselines, one for normal training without any triggers, and one where triggers are added to the underlying data, i.e. training with perturbed data and labels. Trigger accuracy refers to the proportion of test set that ends up getting the target trigger label, whereas error with triggers shows the proportion of misclassifications that trigger introduces, i.e. when the model makes a mistake, but does not predict the trigger target class. As expected, we observe that for normal training, trigger accuracy stays at random guessing, and the trigger does not dominate errors it introduces, whereas adding perturbed data manipulates the model to predict the target class almost perfectly.
174
+
175
+ We find that in a whitebox setup for a flag-like trigger we are capable of getting a similar order of performance for a batch of size 32 as if the attack was performed with injected adversarial data. In a blackbox setup with a flag-like trigger we lost around $30 \%$ of trigger performance, yet the trigger still remains operational. A trigger of nine white lines outperforms the baseline only marginally; in a whitebox setup it gets from $2 0 { - } 4 0 \%$ performance, whereas in a blackbox one it ranges between zero and $20 \%$ performance. We show the training progress of each individual trigger in Appendix K.
176
+
177
+ Overall, we find that:
178
+
179
+ • An attacker can poison an individual datapoint, change its label and increase its prediction confidence, without ever actually training the model on an adversarially-crafted datapoint.
180
+
181
+ • An attacker can introduce backdoors into the model by introducing a few reordered batches during training, without ever injecting adversarial data or labels. Here, trigger performance differs, yet an adversary can perform BOB attacks on a par with attacks that inject perturbations into datasets explicitly.
182
+
183
+ # 5 Conclusion
184
+
185
+ We presented a novel class of attacks that manipulate the integrity and availability of training by changing the order of batches, or the order of datapoints within them. Careful reordering of a model’s training data allows it to be poisoned or backdoored without changing the training data at all. The attacks we presented are fully blackbox; they do not rely on knowledge of the target model or on prior knowledge of the data. Most surprisingly, we find that an attacker can introduce backdoors without disruption of generalisation, even though only natural data is used. We are the first to show that the sampling procedure can be manipulated deterministically to control the model’s behavior.
186
+
187
+ This paper reminds us that stochastic gradient descent, like cryptography, depends on randomness. A random number generator with a backdoor can undermine a neural network just as it can undermine a payment network [1]. Developers who wish to ensure secure, robust, fair optimization during learning must therefore be able to inspect their assumptions and, in case of SGD, show the provenance of randomness used to select batches and datapoints.
188
+
189
+ Future work may also explore the implications of our findings to fairness. Recent work has highlighted that ML models can suffer from a large taxonomy of different biases, including sampling bias, with outcomes including sexism and racism [3, 23]. This leads directly to questions of inductive bias and the practical contribution of pseudorandom sampling. Hooker has explained that bias in ML is not just a data problem, but depends on algorithms in subtle ways [15]; this paper shows how to exploit that dependency.
190
+
191
+ # Acknowledgements
192
+
193
+ We thank the reviewers for their insightful feedback. This work was supported by DARPA (through the GARD program), CIFAR (through a Canada CIFAR AI Chair), Bosch Forschungsstiftung im Stifterverband, by NSERC (under the Discovery Program, and COHESA strategic research network), and by a gift from Intel. We also thank the Vector Institute’s sponsors.
194
+
195
+ # References
196
+
197
+ [1] R. Anderson. Security Engineering. John Wiley & Sons, 2020.
198
+ [2] O. Bachem, M. Lucic, and A. Krause. Practical coreset constructions for machine learning, 2017.
199
+ [3] R. Baeza-Yates. Bias on the web. Commun. ACM, 61(6):54–61, May 2018.
200
+ [4] R. R. Bahadur. A Note on Quantiles in Large Samples. The Annals of Mathematical Statistics, 37(3):577 – 580, 1966.
201
+ [5] Y. Bengio, J. Louradour, R. Collobert, and J. Weston. Curriculum learning. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, page 41–48, New York, NY, USA, 2009. Association for Computing Machinery.
202
+ [6] B. Biggio, I. Corona, D. Maiorca, B. Nelson, N. Šrndic, P. Laskov, G. Giacinto, and F. Roli. ´ Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pages 387–402. Springer, 2013.
203
+ [7] H. Chen. Chapter 2. order statistics. http://www.math.ntu.edu.tw/\~hchen/teaching/ LargeSample/notes/noteorder.pdf.
204
+ [8] X. Chen, C. Liu, B. Li, K. Lu, and D. Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017.
205
+ [9] D. A. Cohn, Z. Ghahramani, and M. I. Jordan. Active learning with statistical models. CoRR, cs.AI/9603104, 1996.
206
+ [10] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples, 2015.
207
+ [11] K. Grosse, T. A. Trost, M. Mosbach, M. Backes, and D. Klakow. On the security relevance of initial weights in deep neural networks. In I. Farkaš, P. Masulli, and S. Wermter, editors, Artificial Neural Networks and Machine Learning – ICANN 2020, pages 3–14, Cham, 2020. Springer International Publishing.
208
+ [12] T. Gu, B. Dolan-Gavitt, and S. Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017.
209
+ [13] G. Hacohen and D. Weinshall. On the power of curriculum learning in training deep networks. In K. Chaudhuri and R. Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2535– 2544. PMLR, 09–15 Jun 2019.
210
+ [14] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770– 778, 2016.
211
+ [15] S. Hooker. Moving beyond “algorithmic bias is a data problem”. Patterns, 2(4):100241, 2021.
212
+ [16] A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
213
+ [17] M. Jagielski, A. Oprea, B. Biggio, C. Liu, C. Nita-Rotaru, and B. Li. Manipulating machine learning: Poisoning attacks and countermeasures for regression learning. In 2018 IEEE Symposium on Security and Privacy (SP), pages 19–35. IEEE, 2018.
214
+ [18] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Advances in neural information processing systems, 26:315–323, 2013.
215
+ [19] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. 2009.
216
+ [20] M. Kumar, B. Packer, and D. Koller. Self-paced learning for latent variable models. In J. Lafferty, C. Williams, J. Shawe-Taylor, R. Zemel, and A. Culotta, editors, Advances in Neural Information Processing Systems, volume 23. Curran Associates, Inc., 2010.
217
+ [21] 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.
218
+ [22] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks, 2019.
219
+ [23] N. Mehrabi, F. Morstatter, N. Saxena, K. Lerman, and A. Galstyan. A survey on bias and fairness in machine learning. CoRR, abs/1908.09635, 2019.
220
+ [24] N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, Z. B. Celik, and A. Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pages 506–519, 2017.
221
+ [25] B. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
222
+ [26] M. Raginsky, A. Rakhlin, and M. Telgarsky. Non-convex learning via stochastic gradient langevin dynamics: a nonasymptotic analysis, 2017.
223
+ [27] H. Robbins and S. Monro. A stochastic approximation method. The annals of mathematical statistics, pages 400–407, 1951.
224
+ [28] A. Salem, R. Wen, M. Backes, S. Ma, and Y. Zhang. Dynamic backdoor attacks against machine learning models, 2020.
225
+ [29] A. Shafahi, W. R. Huang, M. Najibi, O. Suciu, C. Studer, T. Dumitras, and T. Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. arXiv preprint arXiv:1804.00792, 2018.
226
+ [30] I. Shumailov, Y. Zhao, D. Bates, N. Papernot, R. Mullins, and R. Anderson. Sponge examples: Energy-latency attacks on neural networks. In 6th IEEE European Symposium on Security and Privacy (EuroS&P), 2021.
227
+ [31] S. L. Smith, B. Dherin, D. G. T. Barrett, and S. De. On the origin of implicit regularization in stochastic gradient descent, 2021.
228
+ [32] M. Sun, S. Agarwal, and J. Z. Kolter. Poisoned classifiers are not only backdoored, they are fundamentally broken, 2020.
229
+ [33] I. Sutskever, J. Martens, G. Dahl, and G. Hinton. On the importance of initialization and momentum in deep learning. In S. Dasgupta and D. McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pages 1139–1147, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR.
230
+ [34] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
231
+ [35] S. Tong and D. Koller. Support vector machine active learning with applications to text classification. J. Mach. Learn. Res., 2:45–66, Mar. 2002.
232
+ [36] L. Yu, K. Balasubramanian, S. Volgushev, and M. A. Erdogdu. An analysis of constant step size sgd in the non-convex regime: Asymptotic normality and bias, 2020.
233
+ [37] X. Zhang, J. J. Zhao, and Y. LeCun. Character-level convolutional networks for text classification. In NIPS, 2015.
md/train/ZPa2SyGcbwh/ZPa2SyGcbwh.md ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING WITH FEATURE-DEPENDENT LABEL NOISE:A PROGRESSIVE APPROACH
2
+
3
+ Yikai $\mathbf { Z h a n g ^ { 1 * } }$ , Songzhu Zheng2∗, Pengxiang $\mathbf { W _ { u } } ^ { 1 * }$ , Mayank Goswami3, Chao Chen2
4
+
5
+ 1Rutgers University, $\{ \mathtt { y z 4 2 2 } , \mathtt { p w 2 4 1 } \}$ @cs.rutgers.edu
6
+ 2Stony Brook University, {zheng.songzhu,chao.chen.1}@stonybrook.edu
7
+ 3City University of New York, mayank.isi@gmail.com
8
+
9
+ # ABSTRACT
10
+
11
+ Label noise is frequently observed in real-world large-scale datasets. The noise is introduced due to a variety of reasons; it is heterogeneous and feature-dependent. Most existing approaches to handling noisy labels fall into two categories: they either assume an ideal feature-independent noise, or remain heuristic without theoretical guarantees. In this paper, we propose to target a new family of featuredependent label noise, which is much more general than commonly used i.i.d. label noise and encompasses a broad spectrum of noise patterns. Focusing on this general noise family, we propose a progressive label correction algorithm that iteratively corrects labels and refines the model. We provide theoretical guarantees showing that for a wide variety of (unknown) noise patterns, a classifier trained with this strategy converges to be consistent with the Bayes classifier. In experiments, our method outperforms SOTA baselines and is robust to various noise types and levels.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Addressing noise in training set labels is an important problem in supervised learning. Incorrect annotation of data is inevitable in large-scale data collection, due to intrinsic ambiguity of data/class and mistakes of human/automatic annotators (Yan et al., 2014; Andreas et al., 2017). Developing methods that are resilient to label noise is therefore crucial in real-life applications.
16
+
17
+ Classical approaches take a rather simplistic i.i.d. assumption on the label noise, i.e., the label corruption is independent and identically distributed and thus is feature-independent. Methods based on this assumption either explicitly estimate the noise pattern (Reed et al., 2014; Patrini et al., 2017; Dan et al., 2019; Xu et al., 2019) or introduce extra regularizer/loss terms (Natarajan et al., 2013; Van Rooyen et al., 2015; Xiao et al., 2015; Zhang & Sabuncu, 2018; Ma et al., 2018; Arazo et al., 2019; Shen & Sanghavi, 2019). Some results prove that the commonly used losses are naturally robust against such i.i.d. label noise (Manwani & Sastry, 2013; Ghosh et al., 2015; Gao et al., 2016; Ghosh et al., 2017; Charoenphakdee et al., 2019; Hu et al., 2020).
18
+
19
+ Although these methods come with theoretical guarantees, they usually do not perform as well as expected in practice due to the unrealistic i.i.d. assumption on noise. This is likely because label noise is heterogeneous and feature-dependent. A cat with an intrinsically ambiguous appearance is more likely to be mislabeled as a dog. An image with poor lighting or severe occlusion can be mislabeled, as important visual clues are imperceptible. Methods that can combat label noise of a much more general form are very much needed to address real-world challenges.
20
+
21
+ To adapt to the heterogeneous label noise, state-of-the-arts (SOTAs) often resort to a data-recalibrating strategy. They progressively identify trustworthy data or correct data labels, and then train using these data (Tanaka et al., 2018; Wang et al., 2018; Lu et al., 2018; Li et al., 2019). The models gradually improve as more clean data are collected or more labels are corrected, eventually converging to models of high accuracy. These data-recalibrating methods best leverage the learning power of deep neural nets and achieve superior performance in practice. However, their underlying mechanism remains a mystery. No methods in this category can provide theoretical insights as to why the model can converge to an ideal one. Thus, these methods require careful hyperparameter tuning and are hard to generalize.
22
+
23
+ In this paper, we propose a novel and principled method that specifically targets the heterogeneous, feature-dependent label noise. Unlike previous methods, we target a much more general family of noise, called Polynomial Margin Diminishing (PMD) label noise. In this noise family, we allow arbitrary noise level except for data far away from the true decision boundary. This is consistent with the real-world scenario; data near the decision boundary are harder to distinguish and more likely to be mislabeled. Meanwhile, a datum far away from the decision boundary is a typical example of its true class and should have a reasonably bounded noise level.
24
+
25
+ Assuming this new PMD noise family, we propose a theoretically-guaranteed data-recalibrating algorithm that gradually corrects labels based on the noisy classifier’s confidence. We start from data points with high confidence, and correct the labels of these data using the predictions of the noisy classifier. Next, the model is improved using cleaned labels. We continue alternating the label correction and model improvement until it converges. See Figure 1 for an illustration. Our main theorem shows that with a theory-informed criterion for label correction at each iteration, the improvement of the label purity is guaranteed. Thus the model is guaranteed to improve with sufficient rate through iterations and eventually becomes consistent with the Bayes optimal classifier.
26
+
27
+ Beside the theoretical strength, we also demonstrate the power of our method in practice. Our method outperforms others on CIFAR-10/100 with various synthetic noise patterns. We also evaluate our method against SOTAs on three real-world datasets with unknown noise patterns.
28
+
29
+ To the best of our knowledge, our method is the first data-recalibrating method that is theoretically guaranteed to converge to an ideal model. The PMD noise family encompasses a broad spectrum of heterogeneous and feature-dependent noise, and better approximates the real-world scenario. It also provides a novel theoretical setting for the study of label noise.
30
+
31
+ Related works. We review works that do not assume an i.i.d. label noise. Menon et al. (2018) generalized the work of (Ghosh et al., 2015) and provided an elegant theoretical framework, showing that loss functions fulfilling certain conditions naturally resist instance-dependent noise. The method can achieve even better theoretical properties (i.e., Bayes-consistency) with stronger assumption on the clean posterior probability $\eta$ . In practice, this method has not been extended to deep neural networks. Cheng et al. (2020) proposed an active learning method for instance-dependent label noise.
32
+
33
+ ![](images/e1c5bd95d246a39360bb9537b3313db61b0fbc917271c8e5928ac07345e50890.jpg)
34
+ Figure 1: Illustration of the algorithm using synthetic data. (a) Gaussian blob with clean label $( \eta ^ { * } ( \pmb { x } ) )$ . (b) Data with corrupted labels. (c) Final corrected data. Black dots are the data that have their clean labels. Red dots are the noisy data. Points that remain un-corrected are closer to the decision boundary. Our algorithm corrects most of the noise only using noisy classifier’s confidence. (d) Data after label correction. (e)-(h) We show the intermediate results at different iterations. Gray region is the area where the classifier has high confidence. Labels within this region are corrected.
35
+
36
+ The algorithm iteratively queries clean labels from an oracle on carefully selected data. However, this approach is not applicable to settings where kosher annotations are unavailable. Another contemporary work (Chen et al., 2021) showed that the noise in real-world dataset is unlikely to be i.i.d., and proposed to fix the noisy labels by averaging the network predictions on each instance over the whole training process. While being effective, their method lacks theoretical guarantees. Chen et al. (2019) showed by regulating the topology of a classifier’s decision boundary, one can improve the model’s robustness against label noise.
37
+
38
+ Data-recalibrating methods use noisy networks’ predictions to iteratively select/correct data and improve the models. Tanaka et al. (2018) introduced a joint training framework which simultaneously enforces the network to be consistent with its own predictions and corrects the noisy labels during training. Wang et al. (2018) identified noisy labels as outliers based on their label consistencies with surrounding data. Lu et al. (2018) used a curriculum learning strategy where the teacher net is trained on a small kosher dataset to determine if a datum is clean; then the learnt curriculum that gives the weight to each datum is fed into the student net for the training and inference. (Yu et al., 2019; Bo et al., 2018) trained two synchronized networks; the confidence and consistency of the two networks are utilized to identify clean data. Wu et al. (2020) selected the clean data by investigating the topological structures of the training data in the learned feature space. For completeness, we also refer to other methods of similar design (Li et al., 2017; Vahdat, 2017; Andreas et al., 2017; Ma et al., 2018; Thulasidasan et al., 2019; Arazo et al., 2019; Shu et al., 2019; Yi & Wu, 2019).
39
+
40
+ As for theoretical guarantees, Ren et al. (2018) proposed an algorithm that iteratively re-weights each data point by solving an optimization problem. They proved the convergence of the training, but provided no guarantees that the model converges to an ideal one. Amid et al. (2019b) generalized the work of (Amid et al., 2019a) and proposed a tempered matching loss. They showed that when the final softmax layer is replaced by the bi-tempered loss, the resulting classifier will be Bayes consistent. Zheng et al. (2020) proved a one-shot guarantee for their data-recalibrating method; but the convergence of the model is not guaranteed. Our method is the first data-recalibrating method which is guaranteed to converge to a well-behaved classifier.
41
+
42
+ # 2 METHOD
43
+
44
+ We start by introducing the family of Poly-Margin Diminishing (PMD) label noise. In Section 2.2, we present our main algorithm. Finally, we prove the correctness of our algorithm in Section 3.
45
+
46
+ Notations and preliminaries. Although the noise setting and algorithm naturally generalize to multiclass, for simplicity we focus on binary classification. Let the feature space be $\mathcal { X }$ . We assume the data $( { \pmb x } , y )$ is sampled from an underlying distribution $D$ on $\mathcal { X } \times \{ 0 , 1 \}$ . Define the posterior probability $\eta ( \pmb { x } ) = \mathbb { P } [ y = 1 \mid \pmb { x } ]$ . Let $\tau _ { 0 , 1 } ( \pmb { x } ) = \mathbb { P } [ \widetilde { y } = 1 \ | \ y = 0 , \pmb { x } ]$ and $\bar { \tau _ { 1 , 0 } } ( \pmb { x } ) = \mathbb { P } [ \widetilde { y } = 0 \ | \ y = 1 , \pmb { x } ]$ be the noise functions, where $\widetilde { y }$ e e denotes the corrupted label. For example, if a datum $_ { \textbf { \em x } }$ has true label $y = 0$ , it has $\tau _ { 0 , 1 } ( \pmb { x } )$ echance to be corrupted to 1. Similarly, it has $\tau _ { 1 , 0 } ( \pmb { x } )$ chance to be corrupted from 1 to 0. Let $\boldsymbol { \widetilde { \eta } } ( \boldsymbol { \dot { \mathbf { x } } } ) = \mathbb { P } [ \boldsymbol { \widetilde { y } } = 1 \mid \boldsymbol { \mathbf { x } } ]$ be the noisy posterior probability of $\widetilde y = 1$ given feature $_ { \textbf { \em x } }$ . Let $\eta ^ { * } ( \pmb { x } ) = \mathbb { I } _ { \{ \eta ( \pmb { x } ) \geq \frac { 1 } { 2 } \} }$ ebe the (clean) Bayes optimal classifier, where $\mathbb { I } _ { A }$ eequals 1 if $A$ is true, and 0 otherwise. Finally, let $f ( \pmb { x } ) : \mathcal { X } [ 0 , 1 ]$ be the classifier scoring function (the softmax output of a neural network in this paper).
47
+
48
+ # 2.1 POLY-MARGIN DIMINISHING NOISE
49
+
50
+ We first introduce the family of noise functions $\tau$ this paper will address. We introduce the concept of polynomial margin diminishing noise (PMD noise), which only upper bounds the noise $\tau$ in a certain level set of $\eta ( { \pmb x } )$ , thus allowing $\tau$ to be arbitrarily high outside the restricted domain. This formulation not only covers the feature-independent scenario but also generalizes scenarios proposed by (Du & Cai, 2015; Menon et al., 2018; Cheng et al., 2020).
51
+
52
+ Definition 1 (PMD noise). $A$ pair of noise functions $\tau _ { 0 , 1 } ( \pmb { x } )$ and $\tau _ { 1 , 0 } ( \pmb { x } )$ are polynomial-margin diminishing (PMD), if there exist constants $t _ { 0 } \in ( 0 , \frac { 1 } { 2 } )$ , and $c _ { 1 } , c _ { 2 } > 0$ such that:
53
+
54
+ $$
55
+ \begin{array} { c l l } { \displaystyle \tau _ { 1 , 0 } ( { \pmb x } ) \leq c _ { 1 } [ 1 - \eta ( { \pmb x } ) ] ^ { 1 + c _ { 2 } } ; \forall \eta ( { \pmb x } ) \geq \displaystyle \frac { 1 } { 2 } + t _ { 0 } , a n d } \\ { \displaystyle \tau _ { 0 , 1 } ( { \pmb x } ) \leq c _ { 1 } \eta ( { \pmb x } ) ^ { 1 + c _ { 2 } } ; \forall \eta ( { \pmb x } ) \leq \displaystyle \frac { 1 } { 2 } - t _ { 0 } . } \end{array}
56
+ $$
57
+
58
+ We abuse notation by referring to $t _ { 0 }$ as the “margin” of $\tau$ . Note that the PMD condition only requires the upper bound on $\tau$ to be polynomial and monotonically decreasing in the region where the Bayes classifier is fairly confident. For the region $\begin{array} { r } \{ \pmb { x } : | \eta ( \pmb { x } ) - \frac { 1 } { 2 } \} < t _ { 0 } \} \end{array}$ , we allow both $\tau _ { 0 , 1 } ( \pmb { x } )$ and $\tau _ { 1 , 0 } ( \pmb { x } )$ to be arbitrary. Figure 2(d) illustrates the upper bound (orange curve) and a sample noise function (blue curve). We also show the corrupted data according to this noise function (black points are the clean data whereas red points are the data with corrupted labels).
59
+
60
+ The PMD noise family is much more general than existing noise assumptions. For example, the boundary consistent noise (BCN) (Du & Cai, 2015; Menon et al., 2018) assumes a noise function that monotonically decreases as the data are moving away from the decision boundary. See Figure 2(c) for an illustration. This noise is much more restrictive compared to our PMD noise which (1) only requires a monotonic upper bound, and (2) allows arbitrary noise strength in a wide buffer near the decision boundary. Figure 2(b) shows a traditional feature-independent noise pattern (Reed et al., 2014; Patrini et al., 2017), which assumes $\tau _ { 0 , 1 } ( \pmb { x } )$ (resp. $\tau _ { 1 , 0 } ( \pmb { x } ) )$ ) to be a constant independent of $_ { \textbf { \em x } }$ .
61
+
62
+ ![](images/9dade37a8bec0e5a6be0825212c7aaf748d14562d66b3b8371b3b613d5ff59f3.jpg)
63
+ Figure 2: Illustration of different noise functions. (a) The original data: Gaussian blob with clean labels (by clean label, we refer to the prediction of the Bayes optimal classifier $\eta ^ { * } ( \pmb { x } )$ , not $y$ ). Confident region of $\eta$ (and thus $f$ ) in this case is the place where $\eta ( { \pmb x } )$ is close to 0 or 1. Blue and green dots correspond to different classes. (b) Uniform label noise: each point has an equal probability to be flipped. Red dots are data with corrupted labels; black dots correspond to data that are not corrupted. (c) BCN noise: the level of noise is decreasing as $\eta ^ { * } ( \pmb { x } )$ becomes confident. (d) PMD noise: noise level (blue) is only upper bounded by diminishing polynomial function when $\eta ( { \pmb x } )$ is higher or lower than certain threshold. The upper bound is shown in solid orange curve. The dashed orange curve means the noise level near the decision boundary is unbounded.
64
+
65
+ # 2.2 THE PROGRESSIVE CORRECTION ALGORITHM
66
+
67
+ Our algorithm iteratively trains a neural network and corrects labels. We start with a warm-up period, in which we train the neural network (NN) with the original noisy data. This allows us to attain a reasonable network before it starts fitting noise (Zhang et al., 2017). After the warm-up period, the classifier can be used for label correction. We only correct a label on which the classifier $f$ has a very high confidence. The intuition is that under the noise assumption, there exists a “pure region” in which the prediction of the noisy classifier $f$ is highly confident and is consistent with the clean Bayes optimal classifier $\eta ^ { * }$ . Thus the label correction gives clean labels within this pure region. In particular, we select a high threshold $\theta$ . If $f$ predicts a different label than $\tilde { y }$ and its confidence is above the threshold, $| f ( \bar { \pmb { x } } ) - 1 / 2 | > \theta$ , we flip the label $\tilde { y }$ to the prediction of $f$ . We repeatedly correct labels and improve the network until no label is corrected. Next, we slightly decrease the threshold $\theta$ , use the decreased threshold for label correction, and improve the model accordingly. We continue the process until convergence. For convenience in theoretical analysis, in the algorithm, we define a continuous increasing threshold $T$ and let $\theta = 1 / 2 - T$ . Our algorithm is summarized in Algorithm 1. We term our algorithm as PLC (Progressive Label Correction). In Section 3, we will show that this iterative algorithm will converge to be consistent with clean Bayes optimal classifier $\eta ^ { * } ( \pmb { x } )$ for most of the input instances.
68
+
69
+ # Algorithm 1 Progressive Label Correction
70
+
71
+ Input: Dataset $\tilde { S } = \{ ( \pmb { x } _ { 1 } , \widetilde { y } _ { 1 } ^ { 0 } ) , \cdot \cdot \cdot , ( \pmb { x } _ { n } , \widetilde { y } _ { n } ^ { 0 } ) \}$ , initial NN $f ( { \pmb x } )$ , step size $\beta$ ,
72
+ einitial and end thresholds $( T _ { 0 } , T _ { e n d } )$ e, warm-up $m$ , total round $N$
73
+ Output: $f _ { f i n a l } ( \cdot )$
74
+ 1: $T \gets T _ { 0 }$
75
+ 2: $\theta 1 / 2 - T _ { 0 }$
76
+ 3: for $t \gets 1 , \cdots , N$ do
77
+ 4: Train $f ( { \pmb x } )$ on $\tilde { S }$
78
+ 5: for all $( { \pmb x } _ { i } , \widetilde { { y } } _ { i } ^ { t - 1 } ) \in \tilde { S }$ and $\begin{array} { r } { | f ( \pmb { x } _ { i } ) - \frac { 1 } { 2 } | \geq \theta } \end{array}$ do
79
+ 6: y ti ← I{f (xi)≥ 1 }
80
+ 7: end for
81
+ 8: if $t \geq m$ then
82
+ 9: $\theta 1 / 2 - T$
83
+ 10: $\mathbf { f } \forall i \in [ 1 , \cdot \cdot \cdot , n ] , \widetilde { y } _ { i } ^ { t } = \widetilde { y } _ { i } ^ { t - 1 } \mathbf { t h }$ en
84
+ 11: $T \gets \operatorname* { m i n } ( T ( 1 + \beta ) , \bar { T _ { e n d } } )$
85
+ 12: end if
86
+ 13: end if
87
+ 14: $\tilde { S } \gets \{ ( { \pmb x } _ { 1 } , \widetilde { y } _ { 1 } ^ { t } ) , \cdot \cdot \cdot , ( { \pmb x } _ { n } , \widetilde { y } _ { n } ^ { t } ) \}$
88
+ 15: end for
89
+
90
+ Generalizing to the multi-class scenario. In multi-class scenario, denote by $f _ { i } ( { \pmb x } )$ the classifier’s prediction probability of label $i$ . Let $h _ { x }$ be the classifier’s class prediction, i.e., $h _ { \pmb { x } } = \arg \operatorname* { m a x } _ { i } f _ { i } ( \pmb { x } )$ . We change the $\begin{array} { r } { | f ( \pmb { x } ) - \frac { 1 } { 2 } | } \end{array}$ term to the gap between the highest confidence $f _ { h _ { x } } ( \pmb { x } )$ and the confidence on $\widetilde { y }$ , $f _ { \widetilde { y } } ( { \pmb x } )$ . If the absolute difference between these two confidences is larger than certain threshold $\theta$ e e, then we correct $\widetilde { y }$ to $h _ { x }$ . In practice, we find using the difference of logarithms will be more robust.
91
+
92
+ # 3 ANALYSIS
93
+
94
+ Our analysis focuses on the asymptotic case and answers the following question: Given infinitely many data with corrupted labels, is it possible to learn a reasonably good classifier? We show that if the noise satisfies the arguably-general PMD condition, the answer is yes. Assuming mild conditions on the hypothesis class of the machine learning model and the distribution $D$ , we prove that Algorithm 1 obtains a nearly clean classifier. This reduces the challenge of noisy label learning from a realizable problem into a sample complexity problem. In this work we only focus on the asymptotic case, and leave the sample complexity for future work.
95
+
96
+ # 3.1 ASSUMPTIONS
97
+
98
+ Our first assumption restricts the model to be able to at least approximate the true Bayes classifier $\eta ( { \pmb x } )$ . This condition assumes that given a hypothesis class $\mathcal { H }$ with sufficient complexity, the approximation gap between a classifier $f ( { \pmb x } )$ in this class and $\eta ( { \pmb x } )$ is determined by the inconsistency between the noisy labels and the Bayes optimal classifier.
99
+
100
+ Definition 2 (Level set $( \alpha , \epsilon )$ -consistency). Suppose data are sampled as $( { \pmb x } , \tilde { y } ) \sim D ( { \pmb x } , \tilde { \eta } ( { \pmb x } ) )$ and $f ( \pmb { x } ) = \arg \operatorname* { m i n } _ { h \in \mathcal { H } } E _ { ( \pmb { x } , \tilde { y } ) \sim D ( \pmb { x } , \tilde { \eta } ( \pmb { x } ) ) } L o s s ( h ( \pmb { x } ) , \tilde { y } )$ . Given $\varepsilon < \textstyle { \frac { 1 } { 2 } }$ , we call $\mathcal { H }$ is $( \alpha , \epsilon )$ -consistent $i f$ :
101
+
102
+ $$
103
+ | f ( \pmb { x } ) - \eta ( \pmb { x } ) | \leq \alpha \mathbb { E } _ { ( \pmb { z } , \bar { \pmb { y } } ) \sim D ( \pmb { z } , \bar { \eta } ( \pmb { z } ) ) } [ 1 _ { \{ \bar { \pmb { y } } _ { \pmb { z } } \neq \eta ^ { * } ( \pmb { z } ) \} } ( \pmb { z } ) | | \eta ( \pmb { z } ) - \frac { 1 } { 2 } | \geq | \eta ( \pmb { x } ) - \frac { 1 } { 2 } | ] + \epsilon .
104
+ $$
105
+
106
+ For two input instances $_ { z }$ and $_ { \textbf { \em x } }$ such that $\eta ( z ) ~ > ~ \eta ( \pmb { x } )$ (and hence the clean Bayes optimal classifier $\eta ^ { \ast } ( \pmb { x } )$ has higher confidence at $_ z$ than it does at $_ { \textbf { \em x } }$ ), the indicator function $\begin{array} { r } { \mathbb { 1 } _ { \{ \tilde { y } _ { z } \neq \eta ^ { * } ( z ) \} } \left( z : \left| \eta ( z ) - \frac { 1 } { 2 } \right| \ge \left| \eta ( \pmb { x } ) - \frac { 1 } { 2 } \right| \right) } \end{array}$ equals to 1 if the label of the more confident point $_ z$ is inconsistent with $\eta ^ { * } ( \pmb { x } )$ . This condition says that the approximation error of the classifier at $_ { \textbf { \em x } }$ should be controlled by the risk of $\eta ^ { * } ( \cdot )$ at points $_ z$ where $\eta ^ { * } ( \cdot )$ is more confident than it is at $_ { \textbf { \em x } }$ .
107
+
108
+ We next define a regularity condition of data distribution which describes the continuity of the level set density function.
109
+
110
+ Definition 3 (Level set bounded distribution). Define the margin $\begin{array} { r } { t ( { \pmb x } ) = | \eta ( { \pmb x } ) - \frac { 1 } { 2 } | } \end{array}$ and $G ( t )$ be the cdf of $t$ : $G ( t ) = \mathbb { P } _ { \mathbf { x } \sim D } ( | \eta ( \mathbf { x } ) - \frac { 1 } { 2 } | \leq t )$ . Let $g ( t ) = G ^ { \prime } ( t )$ be the density function of $t$ . We say the distribution $D$ is $( c _ { * } , c ^ { * } )$ -bounded if for all $0 \leq t \leq 1 / 2$ , $0 < c _ { * } \leq g ( t ) \leq c ^ { * }$ . If $D$ is $( c _ { * } , c ^ { * } )$ -bounded, we define the worst-case density-imbalance ratio of $D$ by $\begin{array} { r } { \ell _ { D } . = \frac { c ^ { * } } { c _ { * } } } \end{array}$
111
+
112
+ The above condition enforces the continuity of level set density function. This is crucial in the analysis since such a continuity allows one to borrow information from its neighborhood region so that a clean neighbor can help correct the corrupted label. To simplify the notation, we will omit $D$ in the subscript when we mention $\ell$ . From now on, we will assume:
113
+
114
+ Assumption 1. There exist constants $\alpha , \epsilon , c _ { * } , c ^ { * }$ such that the hypothesis class $\mathcal { H }$ is $( \alpha , \epsilon )$ -consistent and the unknown distribution $D$ is $( c _ { * } , c ^ { * } )$ -bounded.
115
+
116
+ # 3.2 MAIN RESULT AND PROOF SKETCH
117
+
118
+ In this section we first state our main result, and then present the supporting claims. Complete proofs can be found in the appendix. Our main result below states that if our starting function is trained correctly, i.e., $f ( \pmb { x } ) = \arg \operatorname* { m i n } _ { h \in \mathcal { H } } E _ { ( \pmb { x } , \tilde { y } ) \sim D ( \pmb { x } , \tilde { \eta } ( \pmb { x } ) ) } L o s s ( h ( \pmb { x } ) , \tilde { y } )$ , then Algorithm 1 terminates with most of the final labels matching the Bayes optimal classifier labels. In practice, minimizing true risk is not achievable. Instead, the empirical risk is used to estimate true risk, approaching true risk asymptotically. For a scoring function $f$ , we will denote by $y _ { f ( \pmb { x } ) } : = \mathbb { I } ( f ( \pmb { x } ) \breve { \geq } 1 / 2 )$ the label predicted by $f$ .
119
+
120
+ Theorem 1. Under Assumption $\begin{array} { r } { m a x ( t _ { 0 } , \frac { \alpha + \varepsilon } { 1 + 2 \alpha } ) } \end{array}$ . Then for the output of Algorithm $^ { l }$ , for any noise $^ { l }$ $\tau$ with which is PMD with margin $f$ as above and with the following initial- $t _ { 0 }$ , define $e _ { 0 } =$ izations: $( l ) T _ { 0 } < { \frac { 1 } { 2 } } - e _ { 0 }$ , (2) $\begin{array} { r } { m \geq \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ , (3) $\begin{array} { r } { N \ge m + \frac { 1 } { \beta } \log ( \frac { T _ { 0 } } { 3 \varepsilon } ) , } \end{array}$ , (4) $T _ { e n d } \leq 3 \epsilon$ and (5) $\begin{array} { r } { \frac { \varepsilon } { \alpha \ell } \le \beta \le \frac { 2 \varepsilon } { \alpha \ell } } \end{array}$ , we have:
121
+
122
+ $$
123
+ \mathbb { P } _ { \pmb { x } \sim D } \big [ y _ { f _ { f i n a l } ( \pmb { x } ) } = \eta ^ { * } ( \pmb { x } ) \big ] \geq 1 - 3 c ^ { * } \epsilon .
124
+ $$
125
+
126
+ In the remainder of this section we shall assume that the noise $\tau$ is PMD with margin $t _ { 0 }$ . To prove our result we first define a “pure” level set.
127
+
128
+ Definition 4 (Pure $( e , f , \eta )$ -level set). $A$ set $L ( e , \eta ) : = \{ \pmb { x } | | \eta ( \pmb { x } ) - \frac { 1 } { 2 } | \geq e \}$ is pure for $f$ if $y _ { f ( \pmb { x } ) } =$ $\eta ^ { * } ( \pmb { x } )$ for all $\pmb { x } \in L ( e , \eta )$ .
129
+
130
+ We now state a lemma that forms the foundation of our progressive correction algorithm. We show that given a tiny region where the model is reliable, we can move one step forward by trusting the model. Although the improvement is slight in a single round, it empowers a conservatively recursive step in the Algorithm 1.
131
+
132
+ Lemma 1 (One round purity improvement). Suppose Assumption $^ { l }$ is satisfied, and assume an $f$ such that there exists a pure $( e , f , \eta )$ -level set with $\begin{array} { r } { 3 \dot { \epsilon } \le e < \frac { 1 } { 2 } } \end{array}$ . Let $\widetilde { \eta } _ { n e w } ( \pmb { x } ) = y _ { f ( \pmb { x } ) } i f \vert f ( \pmb { x } ) - 1 / 2 \vert \geq e$ and $\tilde { \eta } ( \pmb { x } ) i f | f ( \pmb { x } ) - 1 / 2 | < e$ , and assume $f _ { n e w } = \arg \operatorname* { m i n } _ { h \in \mathcal { H } } E _ { ( \pmb { x } , \tilde { y } ) \sim D ( \pmb { x } , \tilde { \eta } _ { n e w } ( \pmb { x } ) ) } L o s s ( h ( \pmb { x } ) , \tilde { y } )$ . Let $e _ { n e w } = \operatorname* { m i n } \{ e | e > 0$ , $L ( e , \eta )$ is pure for $f _ { n e w } \}$ . Then $\begin{array} { r } { \frac { 1 } { 2 } - e _ { n e w } \geq ( 1 + \frac { \varepsilon } { \alpha \ell } ) ( \frac { 1 } { 2 } - e ) . } \end{array}$ .
133
+
134
+ The above lemma states that the cleansed region will be enlarged by at least a constant factor. In the following lemma, we justify the functionality of the first $m$ warm-up rounds. Since the initial neural network can behave badly, the region where we can trust the classifier can be very limited. Before starting the flipping procedure in a relatively larger level set, one first needs to expand the initial tiny region $\mathbf { \frac { 1 } { 2 } } - e _ { 0 }$ to a constant $T _ { 0 }$ .
135
+
136
+ Lemma 2 is pure for arm-up r. Given uppose for a given function , after running Algorithm $f _ { 0 }$ thor $L ( e _ { 0 } , \eta )$ which, there $f _ { 0 }$ $T _ { 0 } < 1 / 2$ $\begin{array} { r } { m \geq \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ exists a level set $L ( \frac { 1 } { 2 } - T _ { 0 } , \eta )$ that is pure for $f _ { 0 }$ .
137
+
138
+ Next we present our final lemma that combines the previous two lemmata.
139
+
140
+ Lemma 3. Suppose Assumption $I$ is satisfied, and for a given function $f _ { 0 }$ there exists a level set $L ( e _ { 0 } , \eta )$ h is , (2) $f _ { 0 }$ ns A, (3) $I$ $f _ { 0 }$ an(4) ons:and $( l )$ $T _ { 0 } < \frac { 1 } { 2 } - e _ { 0 }$ $\begin{array} { r } { m \ge \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ $\begin{array} { r } { N \ge m + \frac { 1 } { \beta } \log ( \frac { 1 - 6 \varepsilon } { 2 T _ { 0 } } ) } \end{array}$ $T _ { e n d } \leq { \textstyle \frac { 1 } { 2 } } - 3 \epsilon$ $\begin{array} { r } { \frac { \varepsilon } { \alpha \ell } \le \beta \le \frac { 2 \varepsilon } { \alpha \ell } } \end{array}$ , then we have $\mathbb { P } _ { \mathbf { x } \sim D } [ y _ { f _ { f i n a l } ( \mathbf { x } ) } = \eta ^ { * } ( \pmb { x } ) ] \geq 1 - 3 c ^ { * } \epsilon$ .
141
+
142
+ This lemma states that given an initial model that has a reasonably pure super level set, one can manage to progressively correct a large fraction of corrupted labels by running Algorithm 1 for a sufficient long time with carefully chosen parameters. The limit of Algorithm 1 will depend on the approximation ability of the neural network, which is characterized by parameter $\varepsilon$ in Definition 2. To prove Theorem 1 using Lemma 3, it suffices to get a model which has a reliable region. This is provably achievable by training with a family of good scoring functions on PMD noisy data.
143
+
144
+ # 4 EXPERIMENTS
145
+
146
+ We evaluate our method on both synthetic and real-world datasets. We first conduct synthetic experiments on two public datasets CIFAR-10 and CIFAR-100 (Krizhevsky et al., 2009). To synthesize the label noise, we first approximate the true posterior probability $\eta$ using the confidence prediction of a clean neural network (trained with the original clean labels). We call these original labels raw labels. Then we sample $y _ { \pmb { x } } \sim \eta ( \pmb { x } )$ for each instance $_ { \textbf { \em x } }$ . Instead of using raw labels, we use these sampled labels $y _ { x }$ as the clean labels, whose posterior probabilities are exactly $\eta ( { \pmb x } )$ ; and therefore the neural network is the Bayes optimal classifier $\eta ^ { * } : \mathcal { X } \{ 1 , \cdot \cdot , C \}$ , where $C$ is the number of classes. Note that in multi-class setting, $\eta ( { \pmb x } )$ has a vector output and $\dot { \eta _ { i } } ( \pmb { x } )$ is the $i$ -th element of this vector.
147
+
148
+ Noise generation. We consider a generic family of noise. We consider not only feature-dependent noise, but also hybrid noise that consists of both feature-dependent noise and i.i.d. noise.
149
+
150
+ For feature-dependent noise, we use three types of noise functions within the PMD noise family. To make the noise challenging enough, for input $_ { \textbf { \em x } }$ we always corrupt label from the most confident category $u _ { x }$ to the second confident category ${ s } _ { x }$ , according to $\eta ( { \pmb x } )$ . Because $s _ { x }$ is the class that confuses $\eta ^ { * } ( \pmb { x } )$ the most, this noise will hurt the network’s performance the most. Note that $y _ { x }$ is sampled from $\eta ( { \pmb x } )$ , which has quite an extreme confidence. Thus we generally assume $y _ { x }$ is $u _ { x }$ . For each datum $_ { \textbf { \em x } }$ , we only flip it to $s _ { x }$ or keep it as $u _ { x }$ . The three noise functions are as follows:
151
+
152
+ $$
153
+ \begin{array} { r l } & { \mathrm { T y p e - I : } \tau _ { u _ { \alpha } , s _ { \alpha } } = - \cfrac { 1 } { 2 } \left[ \eta _ { u _ { \alpha } } ( { \pmb x } ) - \eta _ { s _ { \alpha } } ( { \pmb x } ) \right] ^ { 2 } + \cfrac { 1 } { 2 } , \quad \mathrm { T y p e - I I : } \tau _ { u _ { \alpha } , s _ { \alpha } } = 1 - \left[ \eta _ { u _ { \alpha } } ( { \pmb x } ) - \eta _ { s _ { \alpha } } ( { \pmb x } ) \right] ^ { 3 } , } \\ & { \mathrm { T y p e - I I I : } \tau _ { u _ { \alpha } , s _ { \alpha } } = 1 - \cfrac { 1 } { 3 } \left[ \left[ \eta _ { u _ { \alpha } } ( { \pmb x } ) - \eta _ { s _ { \alpha } } ( { \pmb x } ) \right] ^ { 3 } + \left[ \eta _ { u _ { \alpha } } ( { \pmb x } ) - \eta _ { s _ { \alpha } } ( { \pmb x } ) \right] ^ { 2 } + \left[ \eta _ { u _ { \alpha } } ( { \pmb x } ) - \eta _ { s _ { \alpha } } ( { \pmb x } ) \right] \right] . } \end{array}
154
+ $$
155
+
156
+ Notice that the noise level is determined by the $\eta ( { \pmb x } )$ naturally and we cannot control it directly. To change the noise level, we multiply $\tau _ { u _ { x } , s _ { x } }$ by a certain constant factor such that the final proportion of noise matches our requirement. For PMD noise only, we test noise levels $3 5 \%$ and $70 \%$ , meaning that $3 5 \%$ and $70 \%$ of the data are corrupted due to the noise, respectively.
157
+
158
+ For i.i.d. noise we follow the convention and adopt the commonly used uniform noise and asymmetric noise (Patrini et al., 2017). We artificially corrupt the labels by constructing the noise transition matrix $T$ , where $T _ { i j } = P ( \widetilde { y } = j | y = i ) = \tau _ { i j }$ defines the probability that a true label $y = i$ is flipped to $j$ e. Then for each sample with label $i$ , we replace its label with the one sampled from the probability distribution given by the $i$ -th row of matrix $T$ . We consider two kinds of i.i.d. noise in this work. (1) Uniform noise: the true label $i$ is corrupted uniformly to other classes, i.e., $T _ { i j } = \tau / ( C - 1 )$ for $i \neq j$ , and $T _ { i i } = 1 - \tau$ , where $\tau$ is the constant noise level; (2) Asymmetric noise: the true label $i$ is flipped to $j$ or stays unchanged with probabilities $T _ { i j } = \tau$ and $T _ { i i } = 1 - \tau$ , respectively.
159
+
160
+ Baselines. We compare our method with several recently proposed approaches. (1) GCE (Zhang & Sabuncu, 2018); (2) Co-teaching $^ +$ (Yu et al., 2019); (3) SL (Wang et al., 2019); (4) LRT (Zheng et al., 2020). All these methods are generic and handle the label noise without assuming the noise structures. Finally, we also provide the results by standard method, which simply trains the deep network on noisy datasets in a standard manner.
161
+
162
+ During training, we use a batch size of 128 and train the network for 180 epochs to ensure the convergence of all methods. We train the network with SGD optimizer, with initial learning rate 0.01. We randomly repeat the experiments 3 times, and report the mean and standard deviation values. Our code is available at https://github.com/pxiangwu/PLC.
163
+
164
+ Results. Table 1 lists the performance of different methods under three types of feature-dependent noise at noise levels $3 5 \%$ and $70 \%$ . We observe that our method achieves the best performance across different noise settings. Moreover, notice that some of the baseline methods’ performances are inferior to the standard approach. Possible reasons are that these methods behave too conservatively in dealing with noise. Thus they only make use of a small subset of the original training set, which is not representative enough to grant the model good discriminative ability.
165
+
166
+ In Table 2 we show the results on datasets corrupted with a combination of feature-dependent noise and i.i.d. noise, which ends up to real noise levels ranging from $50 \%$ to $70 \%$ (in terms of the proportion of corrupted labels). I.i.d. noise is overlayed on the feature-dependent noise. Our method outperforms baselines under these more complicated noise patterns. In contrast, when the noise level is high like the cases where we further apply additional $30 \%$ and $60 \%$ uniform noise, performances of a few baselines deteriorate and become worse than the standard approach.
167
+
168
+ We carry out the ablation studies on hyper-parameters $\theta _ { 0 }$ (determining the initial confidence threshold for label correction, see Algorithm 1) and $\beta$ (the step size). In Tables 3 and 4, we show that our method is robust against the choice of $\theta _ { 0 }$ and $\beta$ up to a wide range. Notice that to compare against the threshold $\theta _ { 0 }$ , here we are calculating the absolute difference of $\log f _ { \widetilde { y } } ( { \pmb x } )$ and $\log f _ { h _ { x } } ( x )$ . As mentioned in Section 2.2, this operation gives a good performance in practice.
169
+
170
+ Table 1: Test accuracy $( \% )$ on CIFAR-10 and CIFAR-100 under different feature-dependent noise types and levels. The average accuracy and standard deviation over 3 trials are reported.
171
+
172
+ <table><tr><td>Dataset</td><td>Noise</td><td>Standard</td><td>Co-teaching+</td><td>GCE</td><td>SL</td><td>LRT</td><td>PLC (ours)</td></tr><tr><td rowspan="5">CIFAR-10</td><td>Type-I(35%)</td><td>78.11 ± 0.74</td><td>79.97 ± 0.15</td><td>80.65 ±0.39</td><td>79.76 ± 0.72</td><td>80.98 ±0.80</td><td>82.80±0.27</td></tr><tr><td>Type-I(70%)</td><td>41.98 ± 1.96</td><td>40.69 ± 1.99</td><td>36.52 ± 1.62</td><td>36.29 ±0.66</td><td>41.52 ± 4.53</td><td>42.74± 2.14</td></tr><tr><td>Type-II(35%)</td><td>76.65±0.57</td><td>77.34 ± 0.44</td><td>77.60± 0.88</td><td>77.92 ±0.89</td><td>80.74±0.25</td><td>81.54± 0.47</td></tr><tr><td>Type-II(70%)</td><td>45.57 ± 1.12</td><td>45.44 ± 0.64</td><td>40.30 ± 1.46</td><td>41.11 ± 1.92</td><td>44.67 ± 3.89</td><td>46.04±2.20</td></tr><tr><td>Type-III (35%)</td><td>76.89±0.79</td><td>78.38 ±0.67</td><td>79.18 ± 0.61</td><td>78.81 ±0.29</td><td>81.08 ± 0.35</td><td>81.50±0.50</td></tr><tr><td rowspan="6">CIFAR-100</td><td>Type-III(70%)</td><td>43.32 ± 1.00</td><td>41.90 ± 0.86</td><td>37.10 ± 0.59</td><td>38.49 ± 1.46</td><td>44.47 ± 1.23</td><td>45.05 ±1.13</td></tr><tr><td>Type-I(35%)</td><td>57.68 ±0.29</td><td>56.70 ±0.71</td><td>58.37 ±0.18</td><td>55.20±0.33</td><td>56.74 ±0.34</td><td>60.01±0.43</td></tr><tr><td>Type-I(70%)</td><td>39.32 ± 0.43</td><td>39.53 ± 0.28</td><td>40.01 ± 0.71</td><td>40.02 ±0.85</td><td>45.29 ± 0.43</td><td>45.92 ± 0.61</td></tr><tr><td>Type-II (35%)</td><td>57.83 ± 0.25</td><td>56.57 ± 0.52</td><td>58.11 ± 1.05</td><td>56.10±0.73</td><td>57.25 ±0.68</td><td>63.68±0.29</td></tr><tr><td>Type-II(70%)</td><td>39.30± 0.32</td><td>36.84± 0.39</td><td>37.75 ± 0.46</td><td>38.45 ± 0.45</td><td>43.71 ± 0.51</td><td>45.03 ±0.50</td></tr><tr><td>Type-III (35%) Type-II(70%)</td><td>56.07 ± 0.79 40.01 ± 0.18</td><td>55.77 ± 0.98 35.37 ± 2.65</td><td>57.51 ± 1.16 40.53 ±0.60</td><td>56.04 ± 0.74 39.94 ± 0.84</td><td>56.57 ±0.30 44.41 ± 0.19</td><td>63.68 ± 0.29 44.45 ± 0.62</td></tr></table>
173
+
174
+ Table 2: Test accuracy $( \% )$ on CIFAR-10 and CIFAR-100 under different hybrid noise types and levels. The average accuracy and standard deviation over 3 trials are reported.
175
+
176
+ <table><tr><td>Dataset</td><td>Noise</td><td>Standard</td><td>Co-teaching+</td><td>GCE</td><td>SL</td><td>LRT</td><td>PLC (ours)</td></tr><tr><td rowspan="9">CIFAR-10</td><td>Type-I+30% Uniform</td><td>75.26 ± 0.32</td><td>78.72± 0.53</td><td>78.08±0.66</td><td>77.79± 0.46</td><td>75.97± 0.27</td><td>79.04±0.50</td></tr><tr><td>Type-I+ 60% Uniform</td><td>64.25 ±0.78</td><td>55.49 ± 2.11</td><td>67.43 ± 1.43</td><td>67.63 ± 1.36</td><td>59.22 ± 0.74</td><td>72.21 ± 2.92</td></tr><tr><td>Type-I+ 30% Asymmetric</td><td>75.21 ± 0.64</td><td>75.43 ± 2.96</td><td>76.91 ± 0.56</td><td>77.14± 0.70</td><td>76.96 ± 0.45</td><td>78.31 ± 0.41</td></tr><tr><td>Type-II +30% Uniform</td><td>74.92 ± 0.63</td><td>75.19 ± 0.54</td><td>75.69 ± 0.21</td><td>75.08± 0.47</td><td>75.94 ± 0.58</td><td>80.08±0.37</td></tr><tr><td>Type-II+ 60% Uniform</td><td>64.02 ±0.66</td><td>59.89 ±0.63</td><td>66.39 ± 0.29</td><td>66.76 ± 1.60</td><td>58.99 ± 1.43</td><td>71.21 ± 1.46</td></tr><tr><td>Type-II+ 30% Asymmetric</td><td>74.28 ± 0.39</td><td>73.37 ± 0.83</td><td>75.30 ± 0.81</td><td>75.43 ± 0.42</td><td>77.03 ± 0.62</td><td>77.63± 0.30</td></tr><tr><td>Type-III+30%Uniform</td><td>74.00 ± 0.38</td><td>77.31 ± 0.11</td><td>77.00 ± 0.12</td><td>76.22 ± 0.12</td><td>75.66 ± 0.57</td><td>80.06 ± 0.47</td></tr><tr><td>Type-III+ 60% Uniform</td><td>63.96 ±0.69</td><td>56.78± 1.56</td><td>67.53 ± 0.51</td><td>67.79 ± 0.54</td><td>59.36 ± 0.93</td><td>73.48 ±1.84</td></tr><tr><td>Type-III+ 30% Asymmetric</td><td>75.31 ± 0.34</td><td>74.62 ± 1.71</td><td>75.70 ± 0.91</td><td>76.09 ±0.10</td><td>77.19 ± 0.74</td><td>77.54±0.70</td></tr><tr><td rowspan="11">CIFAR-100</td><td>Type-I+30%Uniform</td><td>48.86±0.56</td><td>52.33±0.64</td><td>52.90±0.53</td><td>51.34±0.64</td><td>45.66 ± 1.60</td><td>60.09±0.15</td></tr><tr><td>Type-I+ 60% Uniform</td><td>35.97 ± 1.12</td><td>27.17 ± 1.66</td><td>38.62 ± 1.65</td><td>37.57 ± 0.43</td><td>23.37 ± 0.72</td><td>51.68± 0.10</td></tr><tr><td>Type-I+ 30% Asymmetric</td><td>45.85 ± 0.93</td><td>51.21 ± 0.31</td><td>52.69 ± 1.14</td><td>50.18 ± 0.97</td><td>52.04± 0.15</td><td></td></tr><tr><td>Type-II+30%Uniform</td><td>49.32± 0.36</td><td>51.99 ± 0.75</td><td>53.61± 0.46</td><td></td><td>43.86 ± 1.31</td><td>56.40±0.34</td></tr><tr><td>Type-II + 60% Uniform</td><td>35.16 ±0.05</td><td>25.91 ± 0.64</td><td>39.58 ±3.13</td><td>50.58± 0.25 37.93± 0.22</td><td>23.05 ±0.99</td><td>60.01±0.63</td></tr><tr><td>Type-II + 30% Asymmetric</td><td>46.50 ± 0.95</td><td>51.07 ± 1.44</td><td>51.98 ± 0.37</td><td>49.46 ± 0.23</td><td>52.11 ± 0.46</td><td>49.35 ±1.53</td></tr><tr><td>Type-III +30% Uniform</td><td>48.94± 0.61</td><td>49.94± 0.44</td><td>52.07±0.35</td><td>50.18±0.54</td><td>42.79 ± 1.78</td><td>61.43±0.33 60.14±0.97</td></tr><tr><td>Type-III + 60% Uniform</td><td>34.67± 0.16</td><td>22.89 ± 0.75</td><td>36.82 ±0.49</td><td>37.65 ± 1.42</td><td>22.81 ± 0.72</td><td>50.73±2.16</td></tr><tr><td>Type-III + 30% Asymmetric</td><td>45.70 ± 0.12</td><td>49.38 ±0.86</td><td>50.87 ± 1.12</td><td>48.15±0.90</td><td>50.31±0.39</td><td>54.56±1.11</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
177
+
178
+ Table 3: The effect of $\theta _ { 0 }$ on the performance. We use CIFAR-10 with $3 5 \%$ feature-dependent noise, and set $\beta = 0 . 1$ .
179
+
180
+ <table><tr><td>exp(00)</td><td>0.2</td><td>0.3</td><td>0.4</td><td>0.5</td></tr><tr><td>Type-INoise</td><td>83.33</td><td>83.04</td><td>82.66</td><td>82.94</td></tr><tr><td>Type-II Noise</td><td>81.84</td><td>81.18</td><td>81.09</td><td>81.24</td></tr><tr><td>Type-III Noise</td><td>81.79</td><td>81.75</td><td>81.98</td><td>82.06</td></tr></table>
181
+
182
+ Table 4: The effect of $\beta$ on the performance. We use CIFAR-10 with $3 5 \%$ feature-dependent noise, and set ex $) ( \theta _ { 0 } ) = 0 . 3$ .
183
+
184
+ <table><tr><td>β</td><td>0.05</td><td>0.1</td><td>0.2</td><td>0.3</td></tr><tr><td>Type-I Noise</td><td>83.58</td><td>83.04</td><td>83.28</td><td>83.31</td></tr><tr><td>Type-II Noise</td><td>80.94</td><td>81.18</td><td>80.98</td><td>80.86</td></tr><tr><td>Type-III Noise</td><td>81.91</td><td>81.75</td><td>82.13</td><td>82.39</td></tr></table>
185
+
186
+ Results on real-world noisy datasets. To test the effectiveness of the proposed method under realworld label noise, we conduct experiments on the Clothing1M dataset (Xiao et al., 2015). This dataset contains 1 million clothing images obtained from online shopping websites with 14 categories. The labels in this dataset are quite noisy with an unknown underlying structure. This dataset provides $5 0 k$ ,
187
+
188
+ $1 4 k$ and $1 0 k$ manually verified clean data for training, validation and testing, respectively. Following (Tanaka et al., 2018; Yi & Wu, 2019), in our experiment we discard the $5 0 k$ clean training data and evaluate the classification accuracy on the $1 0 k$ clean data. Also, following (Yi & Wu, 2019), we use a randomly sampled pseudo-balanced subset as the training set, which includes about $2 6 0 k$ images. We set the batch size 32, learning rate 0.001, and adopt SGD optimizer and use ResNet-50 with weights pre-trained on ImageNet, as in (Tanaka et al., 2018; Yi & Wu, 2019).
189
+
190
+ We compare our method with the following baselines. (1) Standard; (2) Forward Correction (Patrini et al., 2017); (3) D2L (Ma et al., 2018); (4) JO (Tanaka et al., 2018); (5) PENCIL (Yi & Wu, 2019); (6) DY (Arazo et al., 2019); (7) GCE (Zhang & Sabuncu, 2018); (8) SL (Wang et al., 2019); (9) MLNT (Li et al., 2019); (10) LRT (Zheng et al., 2020). In Table 5 we observe that our method achieves the best performance, suggesting the applicability of our label correction strategy in real-world scenarios.
191
+
192
+ Apart from Clothing1M, we also test our method on another smaller dataset, Food-101N (Lee et al., 2018). Food-101N is a dataset for food classification, and consists of 310k training images collected from the web. The estimated label purity is $80 \%$ . Following (Lee et al., 2018), the classification accuracy is evaluated on the Food-101 (Bossard et al., 2014) testing set, which contains 25k images with curated annotations. We use ResNet-50 pre-trained on ImageNet. We train the network for 30 epochs with SGD optimizer. The batch size is 32 and the initial learning rate is 0.005, which is divided by 10 every 10 epochs. We also adopt simple data augmentation procedures, including random horizontal flip, and resizing the image with a short edge of 256 and then randomly cropping a $2 2 4 \mathbf { x } 2 2 4$ patch from the resized image. We repeat the experiments with 3 random trials and report the mean value and standard deviation. The results are shown in Table 6. Our method much improves upon the previous approaches.
193
+
194
+ Finally, we test our method on a recently proposed real-world dataset, ANIMAL-10N (Song et al., 2019). This dataset contains human-labeled online images for 10 animals with confusing appearance. The estimated label noise rate is $8 \%$ . There are 50,000 training and 5,000 testing images. Following (Song et al., 2019), we use VGG-19 with batch normalization. The SGD optimizer is employed. Also following (Song et al., 2019), we train the network for 100 epochs and use an initial learning rate of 0.1, which is divided by 5 at $50 \%$ and $7 5 \%$ of the total number of epochs. We repeat the experiments with 3 random trials and report the mean value and standard deviation. As is shown in Table 7, our method outperforms the existing baselines.
195
+
196
+ Table 5: Test accuracy $( \% )$ on Clothing1M.
197
+
198
+ <table><tr><td>Method</td><td>Standard</td><td>Forward</td><td>D2L</td><td>JO</td><td>PENCIL</td><td>DY</td><td>GCE</td><td>SL</td><td>MLNT</td><td>LRT</td><td>PLC (ours)</td></tr><tr><td>Accuracy</td><td>68.94</td><td>69.84</td><td>69.47</td><td>72.23</td><td>73.49</td><td>71.00</td><td>69.75</td><td>71.02</td><td>73.47</td><td>71.74</td><td>74.02</td></tr></table>
199
+
200
+ Table 6: Test accuracy $( \% )$ on Food-101N.
201
+
202
+ <table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Standard</td><td>81.67</td></tr><tr><td>CleanNet (Lee et al., 2018)</td><td>83.95</td></tr><tr><td>PLC (ours)</td><td>85.28 ± 0.04</td></tr></table>
203
+
204
+ Table 7: Test accuracy $( \% )$ on ANIMAL-10N.
205
+
206
+ <table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Standard</td><td>79.4 ± 0.14</td></tr><tr><td>SELFIE (Song et al., 2019)</td><td>81.8 ± 0.09</td></tr><tr><td>PLC (ours)</td><td>83.4±( 0.43</td></tr></table>
207
+
208
+ # 5 CONCLUSION
209
+
210
+ We propose a novel family of feature-dependent label noise that is much more general than the traditional i.i.d. noise pattern. Building upon this noise assumption, we propose the first datarecalibrating method that is theoretically guaranteed to converge to a well-behaved classifier. On the synthetic datasets, we show that our method outperforms various baselines under different featuredependent noise patterns subject to our assumption. Also, we test our method on different real-world noisy datasets and observe superior performances over existing approaches. The proposed noise family offers a new theoretical setting for the study of label noise.
211
+
212
+ Acknowledgement. The authors acknowledge support from US National Science Foundation (NSF) awards CRII-1755791, CCF-1910873, CCF-1855760. This effort was partially supported by the Intelligence Advanced Research Projects Agency (IARPA) under the contract W911NF20C0038. The content of this paper does not necessarily reflect the position or the policy of the Government, and no official endorsement should be inferred.
213
+
214
+ # REFERENCES
215
+
216
+ Ehsan Amid, Manfred K Warmuth, and Sriram Srinivasan. Two-temperature logistic regression based on the tsallis divergence. In AISTATS, pp. 2388–2396, 2019a.
217
+
218
+ Ehsan Amid, Manfred K. K Warmuth, Rohan Anil, and Tomer Koren. Robust bi-tempered logistic loss based on bregman divergences. In NeurIPS, pp. 15013–15022, 2019b.
219
+
220
+ Veit Andreas, Alldrin Neil, Chechik Gal, Krasin Ivan, Gupta Abhinav, and J. Belongie Serge. Learning from noisy large-scale datasets with minimal supervision. In CVPR, pp. 6575–6583, 2017.
221
+
222
+ Eric Arazo, Diego Ortego, Paul Albert, Noel E O’Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. In ICML, 2019.
223
+
224
+ Han Bo, Yao Quanming, Yu Xingrui, Niu Gang, Xu Miao, Hu Weihua, W. Tsang Ivor, and Sugiyama Masashi. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, pp. 8536–8546, 2018.
225
+
226
+ Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In ECCV, pp. 446–461, 2014.
227
+
228
+ Nontawat Charoenphakdee, Jongyeong Lee, and Masashi Sugiyama. On symmetric losses for learning from corrupted labels. In ICML, pp. 961–970, 2019.
229
+
230
+ Chao Chen, Xiuyan Ni, Qinxun Bai, and Yusu Wang. A topological regularizer for classifiers via persistent homology. In AISTATS, pp. 2573–2582, 2019.
231
+
232
+ Pengfei Chen, Junjie Ye, Guangyong Chen, Jingwei Zhao, and Pheng-Ann Heng. Beyond classconditional assumption: A primary attempt to combat instance-dependent label noise. In AAAI, 2021.
233
+
234
+ Jiacheng Cheng, Tongliang Liu, Kotagiri Ramamohanarao, and Dacheng Tao. Learning with bounded instance- and label-dependent label noise. In ICML, pp. 1789–1799, 2020.
235
+
236
+ Hendrycks Dan, Lee Kimin, and Mazeika Mantas. Using pre-training can improve model robustness and uncertainty. In ICML, pp. 2712–2721, 2019.
237
+
238
+ Jun Du and Zhihua Cai. Modelling class noise with symmetric and asymmetric distributions. In AAAI, pp. 2589–2595, 2015.
239
+
240
+ Wei Gao, Bin-Bin Yang, and Zhi-Hua Zhou. On the resistance of nearest neighbor to random noisy labels. arXiv preprint arXiv:1607.07526, 2016.
241
+
242
+ Aritra Ghosh, Naresh Manwani, and P.S. Sastry. Making risk minimization tolerant to label noise. Neurocomput, 160:93–107, 2015.
243
+
244
+ Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In AAAI, 2017.
245
+
246
+ Wei Hu, Zhiyuan Li, and Dingli Yu. Simple and effective regularization methods for training on noisily labeled data with generalization guarantee. In ICLR, 2020.
247
+
248
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. URL https://www.cs.toronto.edu/˜kriz/learning-features-2009-TR. pdf.
249
+
250
+ Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. Cleannet: Transfer learning for scalable image classifier training with label noise. In CVPR, pp. 5447–5456, 2018.
251
+
252
+ Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S Kankanhalli. Learning to learn from noisy labeled data. In CVPR, pp. 5051–5059, 2019.
253
+
254
+ Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In ICCV, pp. 1928–1936, 2017.
255
+
256
+ Jiang Lu, Zhou Zhengyuan, Leung Thomas, Li Li-Jia, and Fei-Fei Li. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In ICML, pp. 2309–2318, 2018.
257
+
258
+ Xingjun Ma, Yisen Wang, Michael E. Houle, Shuo Zhou, Sarah M. Erfani, Shu-Tao Xia, Sudanthi N. R. Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In ICML, pp. 3361–3370, 2018.
259
+
260
+ Naresh Manwani and PS Sastry. Noise tolerance under risk minimization. IEEE transactions on cybernetics, 43(3):1146–1151, 2013.
261
+
262
+ Aditya Krishna Menon, Brendan Van Rooyen, and Nagarajan Natarajan. Learning from binary labels with instance-dependent noise. Machine Learning, 107(8):1561–1595, 2018.
263
+
264
+ Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In NeurIPS, pp. 1196–1204, 2013.
265
+
266
+ Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, pp. 2233–2241, 2017.
267
+
268
+ Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. In ICLR Workshop, 2014.
269
+
270
+ Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In ICML, pp. 4331–4340, 2018.
271
+
272
+ Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In ICML, pp. 5739–5748, 2019.
273
+
274
+ Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Metaweight-net: Learning an explicit mapping for sample weighting. In NeurIPS, pp. 1917–1928, 2019.
275
+
276
+ Hwanjun Song, Minseok Kim, and Jae-Gil Lee. Selfie: Refurbishing unclean samples for robust deep learning. In ICML, pp. 5907–5915, 2019.
277
+
278
+ Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, pp. 5552–5560, 2018.
279
+
280
+ Sunil Thulasidasan, Tanmoy Bhattacharya, Jeff Bilmes, Gopinath Chennupati, and Jamal Mohd-Yusof. Combating label noise in deep learning using abstention. In ICML, pp. 6234–6243, 2019.
281
+
282
+ Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In NeurIPS, pp. 5596–5605, 2017.
283
+
284
+ Brendan Van Rooyen, Aditya Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. In NeurIPS, pp. 10–18, 2015.
285
+
286
+ Yisen Wang, Weiyang Liu, Xingjun Ma, James Bailey, Hongyuan Zha, Le Song, and Shu-Tao Xia. Iterative learning with open-set noisy labels. In CVPR, pp. 8688–8696, 2018.
287
+
288
+ Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In CVPR, pp. 322–330, 2019.
289
+
290
+ Pengxiang Wu, Songzhu Zheng, Mayank Goswami, Dimitris Metaxas, and Chao Chen. A topological filter for learning with label noise. In NeurIPS, 2020.
291
+
292
+ Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In CVPR, pp. 2691–2699, 2015.
293
+
294
+ Yilun Xu, Peng Cao, Yuqing Kong, and Yizhou Wang. L dmi: A novel information-theoretic loss function for training deep nets robust to label noise. In NeurIPS, pp. 6222–6233, 2019.
295
+
296
+ Yan Yan, Romer Rosales, Glenn Fung, Ramanathan Subramanian, and Jennifer Dy. Learning from ´ multiple annotators with varying expertise. Machine learning, 95(3):291–327, 2014.
297
+
298
+ Kun Yi and Jianxin Wu. Probabilistic end-to-end noise correction for learning with noisy labels. In CVPR, pp. 7017–7025, 2019.
299
+
300
+ Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In ICML, pp. 7164–7173, 2019.
301
+
302
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017.
303
+
304
+ Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, pp. 8778–8788, 2018.
305
+
306
+ Songzhu Zheng, Pengxiang Wu, Aman Goswami, Mayank Goswami, Dimitris Metaxas, and Chao Chen. Error-bounded correction of noisy labels. In ICML, pp. 11447–11457, 2020.
307
+
308
+ # A APPENDIX
309
+
310
+ Lemma 1 (One round purity improvement). Suppose Assumption $^ { l }$ is satisfied, and assume an $f$ such that there exists a pure $( e , f , \eta )$ -level set with $\begin{array} { r } { 3 \dot { \epsilon } \le e < \frac { 1 } { 2 } } \end{array}$ . Let $\tilde { \eta } _ { n e w } ( { \pmb x } ) = y _ { f ( { \pmb x } ) } i f | f ( { \pmb x } ) - 1 / 2 | \ge e$ and $\tilde { \eta } ( \pmb { x } ) i f | f ( \pmb { x } ) - 1 / 2 | < e$ , and assume $f _ { n e w } = \arg \operatorname* { m i n } _ { h \in \mathcal { H } } E _ { ( \pmb { x } , \tilde { y } ) \sim D ( \pmb { x } , \tilde { \eta } _ { n e w } ( \pmb { x } ) ) } L o s s ( h ( \pmb { x } ) , \tilde { y } )$ . Let $e _ { n e w } = \operatorname* { m i n } \{ e | e > 0$ , $L ( e , \eta )$ is pure for $f _ { n e w } \}$ . Then $\begin{array} { r } { \frac { 1 } { 2 } - e _ { n e w } \geq ( 1 + \frac { \varepsilon } { \alpha \ell } ) ( \frac { 1 } { 2 } - e ) . } \end{array}$ .
311
+
312
+ Proof: We analyze the case where $\begin{array} { r } { \eta ( \pmb { x } ) > \frac { 1 } { 2 } } \end{array}$ . The analysis on the other side can be derived similarly. Due to the fact that there exists a level set $L ( e , \eta )$ pure to $f$ , we have $\begin{array} { r } { e \leq | \eta ( \pmb { x } ) - \frac { 1 } { 2 } | , \forall \pmb { x } } \end{array}$ :
313
+
314
+ $$
315
+ \mathbb { E } _ { ( z , \tilde { y } ) \sim ( D , \tilde { \eta } _ { n e w } ( z ) ) } \left[ \mathbb { 1 } _ { \{ \tilde { y } _ { z } \neq \eta ^ { * } ( z ) \} } ( z ) \bigg | \bigg | \eta ( z ) - \frac { 1 } { 2 } \bigg | \ge \bigg | \eta ( x ) - \frac { 1 } { 2 } \bigg | \right] = 0 .
316
+ $$
317
+
318
+ Now consider $_ { \textbf { \em x } }$ where $e - \gamma \leq | \eta ( \pmb { x } ) - \frac { 1 } { 2 } |$ . Since the distribution $D$ is $( c _ { * } , c ^ { * } )$ -bounded, we have:
319
+
320
+ $$
321
+ \begin{array} { r l } & { \mathbb { E } _ { ( z \sim \hat { y } ) \sim ( D , \hat { y } \sim \alpha ( z ) ) } [ \hat { 1 } ( s _ { z \sim \hat { y } } , \hat { x } ) ( z ) ] \lVert ( z ( z ) - \frac { 1 } { 2 } \vert \geq | y | ( x ) - \frac { 1 } { 2 } \vert ] } \\ & { = \mathbb { E } _ { ( \hat { z } ) \sim } f ( \hat { x } ) \lVert ( z ) - \frac { 1 } { 2 } [ \hat { y } \langle x \rangle - \frac { 1 } { 2 } ] } \\ & { \frac { \mathbb { E } _ { ( \hat { z } ) \sim } f ( \hat { x } ) \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) \cdot \frac { 1 } { 2 } } { \lVert \mathcal { Z } \rVert ( z ) ^ { 2 } - \frac { 1 } { 2 } } [ \frac { \mathbb { E } _ { \hat { z } } \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) } { 1 - \frac { 1 } { 2 } } ] } \\ & { \leq \frac { \mathbb { E } _ { ( \hat { z } ) \sim } f ( \hat { x } ) \cdot \mathcal { Y } ( z ) \cdot \frac { 1 } { 2 } + \epsilon - \epsilon - \mathbb { E } _ { z } \cdot \mathcal { Z } ( \hat { z } ) \cdot \frac { \mathbb { E } _ { \hat { z } } } { 2 } + \epsilon } { \mathcal { Z } \cdot { \mathcal { Z } } ( z ) ^ { 2 } - \frac { \mathbb { E } _ { z } \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) \cdot \mathcal { Z } ( z ) \cdot \frac { 1 } { 2 } - \frac { \epsilon } { 2 } } [ \mathcal { Z } \cdot \mathcal { Y } ( z ) \leq \frac { \frac { 1 } { 2 } } { 2 } - \epsilon + \frac { \mathbb { E } _ { z } } { 1 } ] } } \\ & \quad + \frac \mathbb { E } _ { ( \hat { z } ) \sim } f ( \hat { x } ) \cdot \mathcal { Z } ( z ) \cdot \frac { 1 } { 2 } + \epsilon \mathcal { Z } ( \hat { z } ) \cdot \frac { \mathbb { E } _ { z } \cdot \mathcal { Y } ( z ) \cdot \mathcal { Y } ( z ) \cdot \mathcal { Z } ( z ) \cdot \mathcal { Z } ( z ) } \epsilon - \frac \mathbb { E } _ { z } \cdot \{ { y } \cdot \mathcal { Z } \} \cdot \mathcal { Y } ( z ) \cdot \mathcal { Z } \cdot \mathcal { Y } ( z \end{array}
322
+ $$
323
+
324
+ If $\begin{array} { r } { \frac { \varepsilon } { \ell \alpha } ( \frac { 1 } { 2 } - e ) \le \gamma \le \frac { 2 \varepsilon } { \ell \alpha } ( \frac { 1 } { 2 } - e ) } \end{array}$ , the impurity in super level set $\begin{array} { r } { \frac { 1 } { 2 } + e - \gamma } \end{array}$ is at most $\frac { 2 \epsilon } { \alpha }$ . The level set $( \alpha , \varepsilon )$ -consistency condition implies $| f _ { n e w } ( \pmb { x } ) - \eta ( \pmb { x } ) | \le 3 \epsilon$ for $_ { \textbf { \em x } }$ s.t. $\begin{array} { r } { e - \gamma \le | \eta ( \pmb { x } ) - \frac { 1 } { 2 } | } \end{array}$ . If $e \geq 3 \epsilon$ , ${ \dot { f } } _ { n e w } ( { \pmb x } )$ will give the same label as $\eta ^ { * } ( \pmb { x } )$ and thus $( e - \gamma , \eta )$ -level set becomes pure for $f$ . Meanwhile, the choice of $\gamma$ ensures that $\begin{array} { r } { \frac { 1 } { 2 } - e _ { n e w } \geq ( 1 + \frac { \varepsilon } { \ell \alpha } ) ( \frac { 1 } { 2 } - e ) } \end{array}$ . □
325
+
326
+ Lemma 2 is pure for arm-up r. Given uppose for a given function, after running Algorithm $f _ { 0 }$ thor $L ( e _ { 0 } , \eta )$ which, there $f _ { 0 }$ $T _ { 0 } < 1 / 2$ $^ { l }$ $\begin{array} { r } { m \ge \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ exists a level set $L ( \frac { 1 } { 2 } - T _ { 0 } , \eta )$ that is pure for $f _ { 0 }$ .
327
+
328
+ Proof: The proof follows from the fact that each round of label flipping improves the purity by a factor of $\textstyle { \left( { 1 + { \frac { \varepsilon } { \ell \alpha } } } \right) }$ . To obtain an at least $T _ { 0 }$ pure region, it suffices to repeat the flipping step for m ≥ \`αε log( T01−2e ) rounds. □
329
+
330
+ Lemma 3. Suppose Assumption $I$ is satisfied, and for a given function $f _ { 0 }$ there exists a level set $L ( e _ { 0 } , \eta )$ h is p, (2) $f _ { 0 }$ ns A, (3) $I$ $f _ { 0 }$ an(4) ons:and $( l )$ $T _ { 0 } < \frac { 1 } { 2 } - e _ { 0 }$ $\begin{array} { r } { m \ge \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ $\begin{array} { r } { N \ge m + \frac { 1 } { \beta } \log ( \frac { 1 - 6 \varepsilon } { 2 T _ { 0 } } ) , } \end{array}$ $T _ { e n d } \leq { \textstyle \frac { 1 } { 2 } } - 3 \epsilon$ $\begin{array} { r } { \frac { \varepsilon } { \alpha \ell } \le \beta \le \frac { 2 \varepsilon } { \alpha \ell } } \end{array}$ , then we have $\mathbb { P } _ { \pmb { x } \sim D } \big [ y _ { f _ { f i n a l } ( \pmb { x } ) } = \eta ^ { * } ( \pmb { x } ) \big ] \geq 1 - 3 c ^ { * } \epsilon$ .
331
+
332
+ Proof: The proof can be done by combining Lemma 1 and Lemma 2. In the first $m$ iterations, by Lemma 2, we can guarantee a level set $\bigl ( \frac { 1 } { 2 } - T _ { 0 } , \eta \bigr )$ pure to $f$ . In the rest of the iterations we ensure the level set $\begin{array} { r } { | \eta ( \pmb { x } ) - \frac 1 2 | \geq \frac 1 2 - T } \end{array}$ is pure. We increase $T$ by a reasonable factor of $\beta$ to avoid incurring too many corrupted labels while ensuring enough progress in label purification, i.e., $\begin{array} { r } { \frac { \varepsilon } { \alpha \ell } \le \beta \le \frac { 2 \varepsilon } { \alpha \ell } } \end{array}$ such that in the level set $\begin{array} { r } { | \eta ( { \pmb x } ) - \frac 1 2 | \geq \frac 1 2 - T } \end{array}$ we have $| f ( { \pmb x } ) - \eta ( { \pmb x } ) | \leq 3 \varepsilon$ . This condition ensures the correctness of flipping when $T \leq { \frac { 1 } { 2 } } - 3 \varepsilon$ . The purity cannot be improved once $\begin{array} { r } { T \ge \frac { 1 } { 2 } - 3 \varepsilon = T _ { e n d } } \end{array}$ since there is no guarantee that $f ( { \pmb x } )$ has consistent label with $\eta ( { \pmb x } )$ when $| \eta ( \pmb { x } ) - \frac { 1 } { 2 } | < 3 \varepsilon$ and $| \eta ( { \pmb x } ) - f ( { \pmb x } ) | \leq \bar { 3 } \varepsilon$ . By $( c _ { * } , c ^ { * } )$ -bounded assumption on $D$ , its mass of impure $3 \varepsilon$ level set region is at most $3 c ^ { * } \epsilon$ . □
333
+
334
+ Theorem 1. Under assumption $I$ , for any noise $\tau$ which is PMD with margin $t _ { 0 }$ , define $e _ { 0 } =$ $\begin{array} { r } { m a x ( t _ { 0 } , \frac { \alpha + \varepsilon } { 1 + 2 \alpha } ) } \end{array}$ . Then for the output of Algorithm $^ { l }$ with $f$ as above and with the following initializations: $( I ) T _ { 0 } < { \textstyle \frac { 1 } { 2 } } - e _ { 0 } $ , (2) $\begin{array} { r } { m \geq \frac { \ell \alpha } { \varepsilon } \log \bigl ( \frac { 2 T _ { 0 } } { 1 - 2 e _ { 0 } } \bigr ) } \end{array}$ , (3) $\begin{array} { r } { N \ge m + \frac { 1 } { \beta } \log \bigl ( \frac { T _ { 0 } } { 3 \varepsilon } \bigr ) , } \end{array}$ , (4) $T _ { e n d } \leq 3 \epsilon$ and (5) $\begin{array} { r } { \frac { \varepsilon } { \alpha \ell } \le \beta \le \frac { 2 \varepsilon } { \alpha \ell } } \end{array}$ , we have:
335
+
336
+ $$
337
+ \mathbb { P } _ { \pmb { x } \sim D } \big [ y _ { f _ { f i n a l } ( \pmb { x } ) } = \eta ^ { * } ( \pmb { x } ) \big ] \geq 1 - 3 c ^ { * } \epsilon .
338
+ $$
339
+
340
+ Proof: The proof is based on Lemma 3 plus a verification of the existence of $f _ { 0 }$ for which there exists a pure $( e _ { 0 } , f , \eta )$ -level set. Let:
341
+
342
+ $$
343
+ \tau ( { \pmb x } ) = \left\{ \begin{array} { l l } { \tau _ { 1 0 } ( { \pmb x } ) } & { \eta ( { \pmb x } ) \geq 1 / 2 } \\ { \tau _ { 0 1 } ( { \pmb x } ) } & { \eta ( { \pmb x } ) < 1 / 2 } \end{array} \right. .
344
+ $$
345
+
346
+ In the level set $\begin{array} { r } { | \eta ( \pmb { x } ) - \frac { 1 } { 2 } | \geq e _ { 0 } , \mathbb { P } _ { z } [ \tilde { y } _ { z } \neq \eta ^ { * } ( z ) | | \eta ( z ) - \frac { 1 } { 2 } | \geq e _ { 0 } ] \leq \frac { 1 } { 2 } - e _ { 0 } + \tau ( z ) } \end{array}$ . By level set $( \alpha , \varepsilon )$ -consistency, it suffices to satisfy $\alpha ( \textstyle { \frac { 1 } { 2 } } - e _ { o } + \tau ) + \varepsilon \le e _ { 0 }$ to ensure that $f ( { \pmb x } )$ has the same prediction with $\eta ( { \pmb x } )$ when $| \eta ( \pmb { x } ) - \frac { 1 } { 2 } | \geq \overline { { e } } _ { 0 }$ . By polynomial level set diminishing noise, we have $\tau ( \pmb { x } ) \leq { \frac { 1 } { 2 } } - e _ { 0 }$ if $e _ { 0 } > t _ { 0 }$ , and thus by choosing $\begin{array} { r } { e _ { 0 } = m a x ( t _ { 0 } , \frac { \alpha + \varepsilon } { 1 + 2 \alpha } ) } \end{array}$ one can ensure that initial $f _ { 0 }$ has a pure $( e _ { 0 } , f _ { 0 } , \eta )$ -level set. The rest of the proof follows from Lemma 3. □
md/train/_IY3_4psXuf/_IY3_4psXuf.md ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Decoupling the Depth and Scope of Graph Neural Networks
2
+
3
+ Hanqing Zeng USC zengh@usc.edu
4
+
5
+ Muhan Zhang Peking University, BIGAI muhan@pku.edu.cn
6
+
7
+ Yinglong Xia Facebook AI yxia@fb.com
8
+
9
+ Ajitesh Srivastava USC ajiteshs@usc.edu
10
+
11
+ # Rajgopal Kannan
12
+
13
+ Andrey Malevich Facebook AI amalevich@fb.com
14
+
15
+ US ARL
16
+
17
+ Viktor Prasanna USC prasanna@usc.edu
18
+
19
+ rajgopal.kannan.civ@mail.mil
20
+
21
+ Long Jin
22
+ Facebook AI
23
+ longjin@fb.com
24
+ Ren Chen
25
+ Facebook AI
26
+ renchen@fb.com
27
+
28
+ # Abstract
29
+
30
+ State-of-the-art Graph Neural Networks (GNNs) have limited scalability with respect to the graph and model sizes. On large graphs, increasing the model depth often means exponential expansion of the scope (i.e., receptive field). Beyond just a few layers, two fundamental challenges emerge: 1. degraded expressivity due to oversmoothing, and 2. expensive computation due to neighborhood explosion. We propose a design principle to decouple the depth and scope of GNNs – to generate representation of a target entity (i.e., a node or an edge), we first extract a localized subgraph as the bounded-size scope, and then apply a GNN of arbitrary depth on top of the subgraph. A properly extracted subgraph consists of a small number of critical neighbors, while excluding irrelevant ones. The GNN, no matter how deep it is, smooths the local neighborhood into informative representation rather than oversmoothing the global graph into “white noise”. Theoretically, decoupling improves the GNN expressive power from the perspectives of graph signal processing (GCN), function approximation (GraphSAGE) and topological learning (GIN). Empirically, on seven graphs (with up to 110M nodes) and six backbone GNN architectures, our design achieves significant accuracy improvement with orders of magnitude reduction in computation and hardware cost.
31
+
32
+ # 1 Introduction
33
+
34
+ Graph Neural Networks (GNNs) have now become the state-of-the-art models for graph mining [48, 13, 58], facilitating applications such as social recommendation [35, 52, 37], knowledge understanding [40, 38, 59] and drug discovery [43, 32]. With the numerous architectures proposed [22, 12, 44, 49], it still remains an open question how to effectively scale up GNNs with respect to both the model size and graph size. There are two fundamental obstacles when we increase the number of GNN layers:
35
+
36
+ • Expressivity challenge (i.e., oversmoothing [30, 36, 39, 17]): iterative mixing of neighbor features collapses embedding vectors of different nodes into a fixed, low-dimensional subspace.
37
+
38
+ • Scalability challenge (i.e., neighbor explosion [7, 8, 9, 55]): recursive expansion of multi-hop neighborhood results in exponentially growing receptive field size (and thus computation cost).
39
+
40
+ To address the expressivity challenge, most remedies focus on neural architecture exploration: [44, 12, 49, 29] propose more expressive aggregation functions when propagating neighbor features. [50, 28, 18, 34, 1, 33, 31] use residue-style design components to construct flexible and dynamic receptive fields. Among them, [50, 28, 18] use skip-connection across multiple GNN layers, and [34, 1, 33, 31] encourage multi-hop message passing within each single layer. As for the scalability challenge, sampling methods have been explored to improve the training speed and efficiency. Importance based layer-wise sampling [8, 7, 61] and subgraph-based sampling [54, 9, 55] alleviate neighbor explosion, while preserving training accuracy. Unfortunately, such sampling methods cannot be naturally generalized to inference without accuracy loss (see also Section 4).
41
+
42
+ The above lines of research have only guided us to partial solutions. Yet what is the root cause of both the expressivity and scalability challenges? Setting aside the design of GNN architectures or sampling schemes, we provide an alternative perspective by interpretting the data in a different way.
43
+
44
+ Two views on the graph. Given an input graph $\mathcal { G }$ with node set $\nu$ , the most straightforward way to understand $\mathcal { G }$ is by viewing it as a single global graph. So any two nodes $u$ and $v$ belong to the same $\mathcal { G }$ , and if $u$ and $v$ lie in the same connected component, they will ultimately see each other in their own neighborhood no matter how far away $u$ and $v$ are. Alternative to the above global view, we can take a local view on $\mathcal { G }$ . For each node $v$ , there is a latent $\mathcal { G } _ { [ v ] }$ surrounding it which captures the characteristics of just $v$ itself. The full $\mathcal { G }$ is observed (by the data collection process) as the union of all such $\mathcal { G } _ { [ v ] }$ . Consequently, $\nu _ { [ v ] }$ rather than $\nu$ defines $v$ ’s neighborhood: if $u \notin \mathcal { V } _ { [ v ] }$ , $v$ will never consider $u$ as a neighbor. Our “decoupling” design is based on the local view.
45
+
46
+ Scope of GNNs. Both the expressivity and scalability challenges are closely related to the enlargement of the GNN’s scope (i.e., receptive field). More importantly, how we define the scope is determined by how we view $\mathcal { G }$ . With the global view above, an $L$ -layer GNN has the scope of the full $L$ -hop neighborhood. With the local view, the GNN scope is simply $\nu _ { [ v ] }$ regardless of the GNN depth. The two existing lines of research, one on architectural exploration and the other on sampling, both take the global view. Consequently, the depth (i.e., number of layers) and scope of such GNNs are tightly coupled. Such coupling significantly limits the design space exploration of GNNs with various depths [53]. Consider the example of ogbn-products, a medium-scale graph in Open Graph Benchmark [16]. The average number of 4-hop neighbors is around $0 . 6 \mathbf { M }$ , corresponding to $2 5 \%$ of the full graph size. To generate representation of a single target node, a 4-layer coupled GNN needs to propagate features from the $0 . 6 \mathbf { M }$ neighbors. Such propagation can be inefficient or even harmful since most nodes in the huge neighborhood would be barely relevant to the target node.
47
+
48
+ Decoupling the GNN depth and scope. Taking the local view on $\mathcal { G }$ , we propose a general design principle to decouple the GNN depth and scope. To generate the representation of the target node $v$ , we first extract from $\mathcal { G }$ a small subgraph $\mathcal { G } _ { [ v ] }$ surrounding $v$ . On top of $\mathcal { G } _ { [ v ] }$ , we apply a GNN whose number of layers and message passing functions can be flexibly chosen. “Decoupling” means we treat the scope extraction function and GNN depth as two independently tuned parameters – effectively we introduce a new dimension in the GNN design space. We intuitively illustrate the benefits of decoupling by an example GNN construction, where the scope is the $L$ -hop neighborhood and depth is $L ^ { \prime }$ $L ^ { \prime } > L )$ ). When we use more layers $( L ^ { \prime } )$ than hops $( L )$ , each pair of subgraph nodes may exchange messages multiple times. The extra message passing helps the GNN better absorb and embed the information within scope, and thus leads to higher expressivity. We further justify the above intuition with multifaceted theoretical analysis. From the graph signal processing perspective, we prove that decoupled-GCN performs local-smoothing rather than oversmoothing, as long as the scopes of different target nodes are different. From the function approximation perspective, we construct a linear target function on neighbor features and show that decoupling the GraphSAGE model reduces the function approximation error. From the topological learning perspective, we apply deep GIN-style message passing to differentiate non-regular subgraphs of a regular graph. As a result, our model is more powerful than the 1-dimensional Weisfeiler-Lehman test [41].
49
+
50
+ Practical implementation: SHADOW-GNN. The decoupling principle leads to a practical implementation, SHADOW-GNN: Decoupled GNN on a shallow subgraph. In SHADOW-GNN, the scope is a shallow yet informative subgraph, only containing a fraction of the 2- or 3-hop neighbors of $\mathcal { G }$ (see Section 5). On the other hand, the model of SHADOW-GNN is deeper (e.g., $L ^ { \prime } = 5$ ). To efficiently construct the shallow scope on commodity hardware, we propose various subgraph extraction functions. To better utilize the subgraph node embeddings after deep message passing, we propose neural architecture extensions such as pooling and ensemble. Empirically, our “decoupling” design improves both the accuracy and scalability. On seven benchmarks (including the largest ogbn-papers100M graph with 111M nodes) and across two graph learning tasks, SHADOW-GNNs achieve significant accuracy gains compared to the original models. Meanwhile, the computation and hardware costs are reduced by orders of magnitude. Our code is available at https://github.com/facebookresearch/shaDow_GNN
51
+
52
+ # 2 Preliminaries
53
+
54
+ Let $\mathcal { G } \left( \mathcal { V } , \mathcal { E } , \boldsymbol { X } \right)$ be an undirected graph, with node set $\nu$ , edge set $\mathcal { E } \subseteq \mathcal { V } \times \mathcal { V }$ and node feature matrix $\pmb { X } \in \mathbb { R } ^ { | \mathcal { V } | \times d }$ . Let $\mathcal { N } _ { v }$ denote the set of $v$ ’s direct neighbors in $\mathcal { G }$ . The $u ^ { \mathrm { t h } }$ row of $\boldsymbol { X }$ corresponds to the length- $d$ feature of node $u$ . Let $\pmb { A }$ be the adjacency matrix of $\mathcal { G }$ where $A _ { u , v } = 1$ if edge $( u , v ) \in \mathcal { E }$ and $A _ { u , v } = 0$ otherwise. Let $_ { D }$ be the diagonal degree matrix of $\pmb { A }$ . Denote $\widetilde { A } = D _ { * } ^ { - \frac 1 2 } A _ { * } D _ { * } ^ { - \frac 1 2 }$ as the adjacency matrix after symmetric normalization ( $\cdot _ { * } , *$ means augmented with self-edges), and $\stackrel { \frown } { A } = D ^ { \stackrel { - 1 } { - } } A$ (or $D _ { * } ^ { - 1 } A _ { * , }$ ) as the one after random walk normalization. Let subscript “ $[ u ] ^ { \dag }$ mark the quantities corresponding to a subgraph surrounding node $u$ . For example, the subgraph itself is $\mathcal { G } _ { [ u ] }$ . Subgraph matrices $X _ { [ v ] }$ and $\boldsymbol { A } _ { [ v ] }$ have the same dimension as the original $\boldsymbol { X }$ and $\pmb { A }$ . Yet, row vector $\left[ \boldsymbol { X } _ { [ v ] } \right] _ { u } = \mathbf { 0 }$ for $u \notin \mathcal { V } _ { [ v ] }$ . Element $\left[ { \pmb A } _ { [ v ] } \right] _ { u , w } = 0$ if either $u \notin \mathcal { V } _ { [ v ] }$ or $w \notin \mathcal { V } _ { [ v ] }$ For an $L$ -layer GNN, let superscript “ $( \ell ) ^ { \dag }$ denote the layer- $\ell$ quantities. Let $d ^ { ( \ell ) }$ be the number of channels for layer $\ell$ ; $\pmb { H } ^ { ( \ell - 1 ) } \in \mathbb { R } ^ { | \mathcal { V } | \times d ^ { ( \ell - 1 ) } }$ and $H ^ { ( \ell ) } \in \mathbb { R } ^ { | \mathcal { V } | \times d ^ { ( \ell ) } }$ be the input and output features. So $H ^ { ( 0 ) } = X$ and $d ^ { ( 0 ) } = d$ . Further, let $\sigma$ be the activation and $\mathbf { \boldsymbol { W } } ^ { ( \ell ) }$ be the learnable weight. For example, a GCN layer performs $\pmb { H } ^ { ( \ell ) } = \sigma \left( \widetilde { A } \pmb { H } ^ { ( \ell - 1 ) } \pmb { W } ^ { ( \ell ) } \right)$ . A GraphSAGE layer performs $\begin{array} { r } { \pmb { H } ^ { ( \ell ) } = \sigma \left( \pmb { H } ^ { ( \ell - 1 ) } \pmb { W } _ { 1 } ^ { ( \ell ) } + \widehat { \pmb { A } } \pmb { H } ^ { ( \ell - 1 ) } \pmb { W } _ { 2 } ^ { ( \ell ) } \right) . } \end{array}$
55
+
56
+ Our analysis in Section 3 mostly focuses on the node classification task. Yet our design can be generalized to the link prediction task, as demonstrated by our experiments in Section 5.
57
+
58
+ Definition 2.1. (Depth of subgraph) Assume the subgraph $\mathcal { G } _ { [ v ] }$ is connected. The depth of $\mathcal { G } _ { [ v ] }$ is defined as $\mathrm { m a x } _ { u \in \mathcal { V } _ { [ v ] } } d ( u , v ) ;$ , where $d ( u , v )$ denotes the shortest path distance from u to v.
59
+
60
+ The above definition enables us to make comparison such as “the GNN is deeper than the subgraph”.
61
+ For “decoupling the depth and scope”, we refer to the model depth rather than the subgraph depth.
62
+
63
+ # 3 Decoupling the Depth and Scope of GNNs
64
+
65
+ “Decoupling the depth and scope of GNNs” is a design principle to improve the expressivity and scalability of GNNs without modifying the layer architecture. We name a GNN after decoupling a SHADOW-GNN (see Section 3.6 for explanation of the name). Compared with a normal GNN, SHADOW-GNN contains an additional component: the subgraph extractor EXTRACT. To generate embedding of a target node $v$ , SHADOW-GNN proceeds as follows: 1. We use EXTRACT $( v , { \mathcal { G } } )$ to return a connected $\mathcal { G } _ { [ v ] }$ , where $\mathcal { G } _ { [ v ] }$ is a subgraph containing $v$ , and the depth of $\mathcal { G } _ { [ v ] }$ is $L$ . 2. We build an $L ^ { \prime }$ -layer GNN on $\mathcal { G } _ { [ v ] }$ by treating $\mathcal { G } _ { [ v ] }$ as the new full graph and by ignoring all nodes / edges not in $\mathcal { G } _ { [ v ] }$ . So $\mathcal { G } _ { [ v ] }$ is the scope of SHADOW-GNN. The key point reflecting “decoupling” is that $L ^ { \prime } > L$
66
+
67
+ A normal GNN is closely related to a SHADOW-GNN. Under the normal setup, an $L$ -layer GNN operates on the full $\mathcal { G }$ and propagates the influence from all the neighbors up to $L$ hops away from $v$ Such a GNN is equivalent to a model where EXTRACT returns the full $L$ -hop subgraph and $L ^ { \prime } = L$ .
68
+
69
+ We theoretical demonstrate how SHADOW-GNN improves expressivity from three different angles. On SHADOW-GCN (Section 3.1), we come from the graph signal processing perspective. The GCN propagation can be interpreted as applying filtering on the node signals [47]. Deep models correspond to high-pass filters. Filtering the local graph $\mathcal { G } _ { [ v ] }$ preserves richer information than the global $\mathcal { G }$ . On SHADOW-SAGE (Section 3.2), we view the GNN as a function approximator. We construct a target function and study how decoupling reduces the approximation error. On SHADOW-GIN (Section 3.3), we focus on learning topological information. We show that decoupling helps capture local graph structure which the 1D Weisfeiler-Lehman test fails to capture.
70
+
71
+ # 3.1 Expressivity Analysis on SHADOW-GCN: Graph Signal Processing Perspective
72
+
73
+ GCNs [22] suffer from “oversmoothing” [30] – Each GCN layer smooths the features of the direct (i.e., 1-hop) neighbors, and many GCN layers smooths the features of the full graph. Eventually, such repeated smoothing process propagates to any target node just the averaged feature of all $\nu$ . “Oversmoothing” thus incurs significant information loss by wiping out all local information.
74
+
75
+ Formally, suppose the original features $\boldsymbol { X }$ reside in a high-dimensional space $\mathbb { R } ^ { | \nu | \times d }$ . Oversmoothing pushes $\boldsymbol { X }$ towards a low-dimensional subspace $\mathbb { R } ^ { | \nu | \times d ^ { \prime } }$ , where $d ^ { \prime } < d$ . Corresponding analysis comes from two perspectives: oversmoothing by a deep $G C N$ , and oversmoothing by repeated GCNstyle propagation. The former considers the full neural network with non-linear activation, weight and bias. The later characterizes the aggregation matrix $M = \operatorname* { l i m } _ { L \to \infty } \widetilde { A } ^ { L } X$ . It is shown that even with the vanilla architecture, a deep GCN with bias parameters does not oversmooth [17]. In addition, various tricks [60, 39, 34] can prevent oversmoothing from the neural network perspective. However, a deep GCN still suffers from accuracy drop, indicating that the GCN-style propagation (rather than other GCN components like activation and bias) may be the fundamental reason causing difficulty in learning. Therefore, we study the asymptotic behavior of the aggregation matrix $M$ under the normal and SHADOW design. In other words, here in Section 3.1, we ignore the non-linear activation and bias parameters. Such setup is consistent with many existing literature such as [30, 33, 34, 60].
76
+
77
+ Proposition 3.1. $\infty$ number of feature propagation by SHADOW-GCN leads to
78
+
79
+ $$
80
+ \pmb { m } _ { [ v ] } = \left[ e _ { [ v ] } \right] _ { v } \cdot \left( e _ { [ v ] } ^ { \top } \pmb { X } _ { [ v ] } \right)
81
+ $$
82
+
83
+ where $e _ { [ v ] }$ is defined by $\begin{array} { r } { \left[ e _ { [ v ] } \right] _ { u } = \sqrt { \frac { \delta _ { [ v ] } ( u ) } { \sum _ { w \in \mathcal { V } _ { [ v ] } } \delta _ { [ v ] } ( w ) } } } \end{array}$ ; $\delta _ { [ v ] } \left( u \right)$ returns the degree of u in $\mathcal { G } _ { [ v ] } p l u s ~ l$
84
+
85
+ Oversmoothing by normal GCN propagation. With a large enough $L$ , the full $L$ -hop neighborhood becomes $\nu$ (assuming connected $\mathcal { G }$ ). So $\forall ~ u , v$ , we have $\mathcal { G } _ { [ u ] } = \mathcal { G } _ { [ v ] } = \mathcal { G }$ , implying $e _ { [ u ] } = e _ { [ v ] }$ and $X _ { [ u ] } = X _ { [ v ] } = X$ . From Proposition 3.1, the aggregation converges to a point where $n o$ feature and little structural information of the target is preserved. The only information in $m _ { [ v ] }$ is $v$ ’s degree.
86
+
87
+ Local-smoothing by SHADOW-GCN propagation. With a fixed subgraph, no matter how many times we aggregate using $\widetilde { A } _ { [ v ] }$ , the layers will not include the faraway irrelevant nodes. From Proposition 3.1, $m _ { [ v ] }$ is a linear combination of the neighbor features $X _ { [ v ] }$ . Increasing the number of layers only pushes the coefficients of each neighbor features to the stationary values. The domain $X _ { [ v ] }$ of such linear transformation is solely determined by EXTRACT and is independent of the model depth. Intuitively, if EXTRACT picks non-identical subgraphs for two nodes $u$ and $v$ , the aggregations should be different due to the different domains of the linear transformation. Therefore, SHADOW-GCN preserves local feature information whereas normal GCN preserves none. For structural information in $m _ { [ v ] }$ , note that $e _ { [ v ] }$ is a normalized degree distribution of the subgraph around $v$ , and -e[v]v indicates the role of the target node in the subgraph. By simply letting EXTRACT return the 1-hop subgraph, $\left[ e _ { [ v ] } \right] _ { v }$ alone already contains all the information preserved by a normal GCN, which is $v$ ’s degree in $\bar { \mathcal { G } }$ . For the general EXTRACT, $e _ { [ v ] }$ additionally reflects $v$ ’s ego-net structure. Thus, a deep SHADOW-GCN preserves more structural information than a deep GCN.
88
+
89
+ Theorem 3.2. Let $\overline { { \pmb { m } } } _ { [ v ] } = \phi _ { \mathcal { G } } \left( v \right) \cdot \pmb { m } _ { [ v ] }$ where $\phi _ { \mathcal { G } }$ is any non-zero function only depending on the structural property of $v$ . Let $\mathcal { M } = \mathrm { \large ~ \left\{ ~ \overline { { ~ } } m _ { [ v ] } ~ \lvert ~ v ~ \in ~ \mathcal { V } \right\} ~ }$ . Given $\mathcal { G }$ , EXTRACT and some continuous probability distribution in $\mathbb { R } ^ { | \nu | \times d }$ to generate $\boldsymbol { X }$ , then $\overline { { \pmb { m } } } _ { [ v ] } \neq \overline { { \pmb { m } } } _ { [ u ] }$ if $\mathcal { V } _ { [ u ] } \neq \mathcal { V } _ { [ v ] }$ , almost surely.
90
+
91
+ Corollary 3.2.1. Consider EXTRA $C T _ { 1 }$ , where $\forall v \in \mathcal { V }$ , $| \nu _ { [ v ] } | \leq n$ . Then $\begin{array} { r } { | \mathcal { M } | \geq \left\lceil \frac { | \mathcal { V } | } { n } \right\rceil } \end{array}$ a.s.
92
+
93
+ Corollary 3.2.2. Consider EXTRA $C T _ { 2 }$ , where $\forall u , v \in \mathcal { V }$ , $\mathcal { V } _ { [ v ] } \neq \mathcal { V } _ { [ u ] }$ . Then $| \mathcal { M } | = | \mathcal { V } | a . s$
94
+
95
+ Theorem 3.2 proves SHADOW-GCN does not oversmooth: 1. A normal GCN pushes the aggregation of same-degree nodes to the same point, while SHADOW-GCN with $\mathtt { E X T R A C T } _ { 2 }$ ensures any two nodes (even with the same degree) have different aggregation. 2. A normal GCN wipes out all information in $\boldsymbol { X }$ after many times of aggregation, while SHADOW-GCN always preserves feature information. Particularly, with φG (v) = δ[v](v)−1/2, a normal GCN generates only one unique value of for all $v$ . By contrast, SHADOW-GNN generates $| \nu |$ different values for any $\phi _ { \mathcal { G } }$ function.
96
+
97
+ We compare the expressivity by showing 1. SHADOW-SAGE can express all functions GraphSAGE can, and 2. SHADOW-SAGE can express some function GraphSAGE cannot. Recall, a GraphSAGE layer performs the following: $\begin{array} { r } { \dot { \overline { { h _ { v } ^ { ( \ell ) } } } } = \sigma \left( \left( W _ { 1 } ^ { ( \ell ) } \right) ^ { \top } h _ { v } ^ { ( \ell - 1 ) } + \left( W _ { 2 } ^ { ( \ell ) } \right) ^ { \top } \left( \frac { 1 } { | \mathcal { N } _ { v } | } \sum _ { u \in \mathcal { N } _ { v } } \dot { h _ { u } ^ { ( \ell - 1 ) } } \right) \right) . } \end{array}$ We can prove Point 1 by making an $L ^ { \prime }$ -layer SHADOW-SAGE identical to an $L$ -layer GraphSAGE with the following steps: 1. let EXTRACT return the full $L$ -hop neighborhood, and 2. set $\bar { \boldsymbol { W } } _ { 1 } ^ { ( \ell ) } = \boldsymbol { I }$ , $W _ { 2 } ^ { ( \ell ) } = { \bf 0 }$ for $L + 1 \leq \ell \leq L ^ { \prime }$ . For point 2, we consider a target function: $\tau \left( \boldsymbol { X } , \boldsymbol { \mathcal { G } } _ { [ v ] } \right) =$ $\begin{array} { r } { C \cdot \sum _ { u \in \mathcal { V } _ { [ v ] } } \delta _ { [ v ] } \left( u \right) \cdot \pmb { x } _ { u } } \end{array}$ for some neighborhood $\mathcal { G } _ { [ v ] }$ , scaling constant $C$ and $\delta _ { [ v ] } \left( u \right)$ as defined in Proposition 3.1. An expressive model should be able to learn well this simple linear function $\tau$ .
98
+
99
+ GraphSAGE cannot learn $\tau$ accurately, while SHADOW-SAGE can. We first show the GraphSAGE case. Let the depth of $\mathcal { G } _ { [ v ] }$ be $L$ . Firstly, we need GraphSAGE to perform message passing for exactly $L$ times (where such a model can be implemented by, e.g., $L$ layers or $L ^ { \prime }$ layers with $W _ { 2 } = \mathbf { 0 }$ for $L ^ { \prime } - L$ layers). Otherwise, the extra $L ^ { \prime } - L$ message passings will propagate influence from nodes $v ^ { \prime } \notin \mathcal { V } _ { [ v ] }$ , violating the condition that $\tau$ is independent of $v ^ { \prime }$ . Next, suppose GraphSAGE can learn a function $\zeta$ such that on some $\mathcal { G } _ { [ v ] } ^ { \prime }$ , we have $\zeta \left( \mathcal { G } _ { [ v ] } ^ { \prime } \right) = \tau \left( \mathcal { G } _ { [ v ] } ^ { \prime } \right)$ . We construct another $\mathcal { G } _ { [ v ] } ^ { \prime \prime }$ by adding an extra edge $e$ connecting two depth- $L$ nodes in $\mathcal { G } _ { [ v ] } ^ { \prime }$ . Edge $e$ changes the degree distribution $\delta _ { [ v ] } \left( \cdot \right)$ , and thus $\tau \left( \mathcal { G } _ { [ v ] } ^ { \prime } \right) \neq \tau \left( \mathcal { G } _ { [ v ] } ^ { \prime \prime } \right)$ . On the other hand, there is no way for GraphSAGE to propagate the influence of edge $e$ to the target $v$ , unless the model performs at least $L + 1$ message passings. So $\zeta \left( \mathcal { G } _ { [ v ] } ^ { \prime } \right) = \zeta \left( \bar { \mathcal { G } } _ { [ v ] } ^ { \prime \prime } \right)$ regardless of the activation function and weight parameters. Therefore, $\zeta \neq \tau$ . For SHADOW-SAGE, let EXTRACT return $\mathcal { G } _ { [ v ] }$ . Then the model can output $\zeta ^ { \prime } = \left[ \widehat { \cal A } _ { [ v ] } ^ { L ^ { \prime } } { \cal X } \right] _ { v , }$ after we 1. set $W _ { 1 } ^ { ( \ell ) } = \mathbf { 0 }$ and $W _ { 2 } ^ { ( \ell ) } = I$ for all layers, and 2. either remove the non-linear activation or bypass ReLU by shifting $\boldsymbol { X }$ with bias. With known results in Markov chain convergence theorem [27], we derive the following theorem by analyzing the convergence of $\widehat { A } _ { [ v ] } ^ { L ^ { \prime } }$ when $L ^ { \prime } \to \infty$ .
100
+
101
+ Theorem 3.3. SHADOW-SAGE can approximate $\tau$ with error decaying exponentially with depth.
102
+
103
+ We have the following conclusions from above: 1. SHADOW-SAGE is more expressive than GraphSAGE. 2. appropriate EXTRACT function improves SHADOW-GNN expressivity, 3. There exists cases where it may be desirable to set the SHADOW-GNN depth much larger than the subgraph depth.
104
+
105
+ # 3.3 Expressivity Analysis on SHADOW-GIN: Topological Learning Perspective
106
+
107
+ While GCN and GraphSAGE are popular architectures in practice, they are not the theoretically most discriminative ones. The work in [49] establishes the relation in discriminativeness between GNNs and 1-dimensional Weisfeiler-Lehman test (i.e., 1-WL). And GIN [49] is an example architecture achieving the same discriminativeness as 1-WL. We show that applying the decoupling principle can further improve the discriminativeness of such GNNs, making them more powerful than 1-WL.
108
+
109
+ 1-WL is a graph isomorphism test aiming at distinguishing graphs of different structures. A GNN as expressive as 1-WL thus well captures the topological property of the target node. While 1-WL is already very powerful, it may still fail in some cases. e.g., it cannot distinguish certain non-isomorphic, regular graphs. To understand why SHADOW-GNN works, we first need to un
110
+
111
+ ![](images/0fd819a2beeeba3fca87a30aa3012f69f2b800a51d7754d5d403f4ebe7ed94bb.jpg)
112
+ Figure 1: Example 3-regular graph and the 1-hop subgraphs of the target nodes $u$ and $v$ .
113
+
114
+ derstand why 1-WL fails. In a regular graph, all nodes have the same degree, and thus the “regular” property describes a global topological symmetry among nodes. Unfortunately, 1-WL (and the corresponding normal GNN) also operates globally on $\mathcal { G }$ . Intuitively, on two different regular graphs, there is no way for 1-WL (and the normal GNN) to assign different labels by breaking such symmetry.
115
+
116
+ On the other hand, SHADOW-GNN can break such symmetry by applying decoupling. In Section 1, we have discussed how SHADOW-GNN is built from the local perspective on the full graph. The key property benefiting SHADOW-GNN is that a subgraph of a regular graph may not be regular. Thus, SHADOW-GNN can distinguish nodes in a regular graph with the non-regular subgraphs as the scope. We illustrate the intuition with the example in Figure 1. The graph $\mathcal { G }$ is 3-regular and we assume all nodes have identical features. Our goal is to discriminate nodes $u$ and $v$ since their neighborhood structures are different. No matter how many iterations 1-WL runs, or how many layers the normal GNN has, they cannot distinguish $u$ and $v$ . On the other hand, a SHADOW-GNN with 1-hop EXTRACT and at least 2 layers can discriminate $u$ and $v$ .
117
+
118
+ Theorem 3.4. Consider GNNs whose layer function is defined by
119
+
120
+ $$
121
+ \pmb { h } _ { v } ^ { ( \ell ) } = f _ { 1 } ^ { ( \ell ) } \left( \pmb { h } _ { v } ^ { ( \ell - 1 ) } , \ \sum _ { u \in \mathcal { N } _ { v } } f _ { 2 } ^ { ( \ell ) } \left( \pmb { h } _ { v } ^ { ( \ell - 1 ) } , \pmb { h } _ { u } ^ { ( \ell - 1 ) } \right) \right) ,
122
+ $$
123
+
124
+ where $f _ { 1 } ^ { ( \ell ) }$ and $f _ { 2 } ^ { ( \ell ) }$ are the update and message functions of layer- $\ell ,$ , implemented as MLPs. Then, such SHADOW-GNN is more discriminative than the -dimensional Weisfeiler-Lehman test.
125
+
126
+ The theorem also implies that SHADOW-GIN is more discriminative than a normal GIN due to the correspondence between GIN and 1-WL. See Appendix A for the proof of all theorems in Section 3.
127
+
128
+ # 3.4 Subgraph Extraction Algorithms
129
+
130
+ Our decoupling principle does not rely on specific subgraph extraction algorithms. Appropriate EXTRACT can be customized given the characteristic of $\mathcal { G }$ , and different EXTRACT leads to different implementation of our decoupling principle. In general, we summarize three approaches to design EXTRACT: 1. heuristic based, where we pick graph metrics that reflect neighbor importance and then design EXTRACT by such metrics; 2. model based, where we assume a generation process on $\mathcal { G }$ and set EXTRACT as the reverse process, and 3. learning based, where we integrate the design of EXTRACT as part of the GNN training. In the following, we present several examples on heuristic based EXTRACT, which we also empirically evaluate in Section 5. We leave detailed evaluation on the model based and learning based EXTRACT as future work. See also Appendix C for details.
131
+
132
+ Example heuristic based EXTRACT. The algorithm is derived from the selected graph metrics. For example, with the metric being shortest path distance, we design a $L$ -hop extractor. i.e., EXTRACT returns the full set or randomly selected subset of the target node’s $L$ -hop neighbors in $\mathcal { G }$ . Picking the random walk landing probability as the metric, we can design a PPR-based extractor. i.e., we first run the Personalized PageRank (PPR) algorithm on $\mathcal { G }$ to derive the PPR score of other nodes relative to the target node. Then EXTRACT define $\nu _ { [ v ] }$ by picking the top- $K$ nodes with the highest PPR scores. The subgraph $\mathcal { G } _ { [ v ] }$ is the node-induced subgraph1 of $\mathcal { G }$ from $\nu _ { [ v ] }$ . One can easily extend this approach by using other metrics such as Katz index [20], SimRank [19] and feature similarity.
133
+
134
+ # 3.5 Architecture
135
+
136
+ Subgraph pooling. For a normal GNN performing node classification, the multi-layer message passing follows a “tree structure”. The nodes at level $L$ of the tree correspond to the $L$ -hop neighborhood. And the tree root outputs the final embedding of the target node. Thus, there is no way to apply subgraph pooling or READOUT on the final layer output, since the “pool” only contains a single vector. For a SHADOW-GNN, since we decouple the $\bar { L } ^ { \mathrm { t h } }$ layer from the $L$ -hop neighborhood, it is natural to let each layer (including the final layer) output embeddings for all subgraph nodes. This leads to the design to READOUT all the subgraph node embeddings as the target node embedding.
137
+
138
+ We can understand the pooling for SHADOW-GNN from another perspective. In a normal GNN, the target node at the final layer receives messages from all neighbors, but two neighbor nodes may not have a chance to exchange any message to each other (e.g., two nodes $L$ -hop away from the target may be $2 L$ -hop away from each other). In our design, a SHADOW-GNN can pass messages between any pair of neighbors when the model depth is large enough. Therefore, all the subgraph node embeddings at the final layer capture meaningful information of the neighborhood.
139
+
140
+ In summary, the power of the decoupling principle lies in that it establishes the connection between the node- / link-level task and the graph-level task. e.g., to classify a node is seen as to classify the subgraph surrounding the node. From the neural architecture perspective, we can apply any subgraph pooling / READOUT operation originally designed for graph classification (e.g., [57, 24, 4]) to enhance the node classification / link prediction of SHADOW-GNN. In particular, in the vanilla SHADOW-GNN, we can implement a trivial READOUT as “discarding all neighbor embeddings”, corresponding to performing center pooling. See Appendix D and F.3 for algorithm and experiments.
141
+
142
+ Subgraph ensemble. It may be challenging in practice to design a single EXTRACT capturing all meaningful characteristics of the neighborhood. We can use multiple EXTRACT to jointly define the receptive field, and then ensemble multiple SHADOW-GNN at the subgraph level. Consider $R$ candidates $\{ \mathtt { E X T R A C T } _ { i } \}$ , each returning $\mathcal { G } _ { [ v ] } ^ { i }$ . To generate $v$ ’s embedding, we first use $R$ branches of $L ^ { \prime }$ -layer GNN to obtain intermediate embeddings for each $\mathcal { G } _ { v } ^ { i }$ , and then aggregate the $R$ embeddings by some learnable function $g$ . In practice, we design $g$ as an attention based aggregation function (see Appendix D.2). Subgraph ensemble is useful both when $\{ \mathtt { E X T R A C T } _ { i } \}$ consists of different algorithms and when each EXTRA $\Omega { \mathrm { T } } _ { i }$ performs the same algorithm under different parameters.
143
+
144
+ CASE STUDY Consider PPR-based $\mathtt { E X T R A C T } _ { i }$ with different threshold $\theta _ { i }$ on the neighbor PPR score. A SHADOW-GNN-ensemble can approximate PPRGo [6]. PPRGo generates embedding as: ${ \pmb { \xi } } _ { v } =$ $\sum _ { u \in \mathcal { V } _ { [ v ] } } \pi _ { u } h _ { v }$ , where $\pi _ { u }$ is $u$ ’s PPR score and $\begin{array} { r } { h _ { v } = \mathtt { M L P } \left( \pmb { x } _ { v } \right) } \end{array}$ . We can partition $\begin{array} { r } { \mathcal { V } _ { [ v ] } = \bigcup _ { i = 1 } ^ { R } \mathcal { V } _ { [ v ] } ^ { i } } \end{array}$ s.t. nodes in $\mathcal { V } _ { [ v ] } ^ { i }$ have similar PPR scores denoted by $\widetilde { \pi } _ { i }$ , and $\widetilde { \pi } _ { i } \leq \widetilde { \pi } _ { i + 1 }$ . $\begin{array} { r } { \mathrm { S o } \xi _ { v } = \sum _ { i = 1 } ^ { R } \rho _ { i } \left( \sum _ { u \in \mathcal { V } _ { i } ^ { ' } } \pmb { h } _ { u } \right) } \end{array}$ , where $\begin{array} { r } { \rho _ { i } = \widetilde { \pi } _ { i } - \sum _ { j < i } \widetilde { \pi } _ { j } } \end{array}$ and $\begin{array} { r } { \mathcal { V } _ { i } ^ { \prime } = \bigcup _ { k = i } ^ { R } \mathcal { V } _ { [ v ] } ^ { k } } \end{array}$ . Now for each branch of SHADOW-GNN-ensemble, elet parameter $\theta _ { i } = \widetilde { \pi } _ { i }$ eso that $\mathtt { E X T R A C T } _ { i }$ returns $\mathcal { V } _ { i } ^ { \prime }$ . The GNN on $\mathcal { V } _ { i } ^ { \prime }$ can then learn $\sum _ { u \in \mathcal { V } _ { i } ^ { \prime } } \boldsymbol { h } _ { u }$ (e.g., by a simple “mean” READOUT). Finally, set the ensemble weight as $\rho _ { i }$ . SHADOW-GNN-ensemble learns $\xi _ { v }$ . As EXTRACT also preserves graph topology, our model can be more expressive than PPRGo.
145
+
146
+ # 3.6 Practical Design: SHADOW-GNN
147
+
148
+ We now discuss the practical implementation of decoupled GNN – SHADOW-GNN. As the name suggests, in SHADOW-GNN, the scope is a shallow subgraph (i.e., with depth often set to 2 or 3).
149
+
150
+ In many realistic scenarios (e.g., citation networks, social networks, product recommendation graphs), a shallow neighborhood is both necessary and sufficient for the GNN to learn well. On “sufficiency”, we consider the social network example: the friend of a friend of a friend may share little commonality with you, and close friends may be at most 2 hops away. Formally, by the $\gamma$ -decaying theorem [56], a shallow neighborhood is sufficient to accurately estimate various graph metrics. On “necessity”, since the neighborhood size may grow exponentially with hops, a deep neighborhood would be dominated by nodes irrelevant to the target. The corresponding GNN would first need to differentiate the many useless nodes from the very few useful ones, before it can extract meaningful features from the useful nodes. Finally, a shallow subgraph ensures scalability by avoiding ���neighborhood explosion”.
151
+
152
+ Remark on decoupling. So far we have defined a decoupled model as having the model depth $L ^ { \prime }$ larger than the subgraph depth $L$ . Strictly speaking, a decoupled model also admits $L ^ { \prime } = \bar { L }$ . For example, suppose in the full $L$ -hop neighborhood, there are $70 \%$ nodes $L$ hops away. Applying decoupling, the EXTRACT excludes most of the $L$ -hop neighbors, and the resulting subgraph $\mathcal { G } _ { [ v ] }$ contains only $20 \%$ nodes $L$ hops away. Then it is reasonable to consider an $L$ -layer model on such a depth- $L$ subgraph as also a decouple model. Compared with an $L$ -layer model on the full $L$ -hop neighborhood, an $L$ -layer model on such a depth- $L$ $\mathcal { G } _ { [ v ] }$ propagates much less information from nodes $L$ hops away. So the $L$ message passings are indeed decoupled from the full $L$ -hop neighborhood.
153
+
154
+ Remark on neighborhood. The “sufficiency” and “necessity” in shallow neighborhood are not universal. In many other applications, long-range dependencies can be critical, as studied in [2]. In such cases, our practical implementation of SHADOW-GNN would incur accuracy loss. However, our decoupling principle in general may still be beneficial – “shallow subgraph” is a practical guideline rather than a theoretical requirement. We leave the study on such applications as future work.
155
+
156
+ # 4 Related Work
157
+
158
+ Deep GNNs. To improve the GNN performance while increasing the model depth, various layer architectures have been proposed. AS-GCN [18], DeepGCN [28], JK-net [50], MixHop [1], Snowball [33], DAGNN [31] and GCNII [34] all include some variants of residue connection, either across multiple layers or within a single layer. In principle, such architectures can also benefit the feature propagation of a deep SHADOW-GNN, since their design does not rely on a specific neighborhood (e.g., $L$ -hop). In addition to architectures, DropEdge [39] and Bayesian-GDC [14] propose regularization techniques by adapting dropout [42] to graphs. Such techniques are only applied during training, and inference may still suffer from issues such as oversmoothing.
159
+
160
+ Sampling based methods. Neighbor or subgraph sampling techniques have been proposed to improve training efficiency. FastGCN [8], VR-GCN [7], AS-GCN [18], LADIES [61] and MVSGNN [10] sample neighbor nodes per GNN layer. Cluster-GCN [9] and GraphSAINT [55] sample a subgraph as the training minibatch. While sampling also changes the receptive field, all the above methods are fundamentally different from ours. The training samplers aim at estimating the quantities related to the full graph (e.g., the aggregation of the full $L$ -hop neighborhood), and so the inference model still operates on the full neighborhood to avoid accuracy loss. For SHADOW-GNN, since the decoupling principle is derived from a local view on $\mathcal { G }$ , our EXTRACT does not estimate any full neighborhood quantities. Consequently, the sampling based methods only improve the training efficiency, while SHADOW-GNN addresses the computation challenge for both training and inference.
161
+
162
+ Re-defining the neighborhood. Various works reconstruct the original graph and apply the GNN on the re-defined neighborhood. GDC [23] views the reconstructed adjacency matrix as the diffusion matrix. SIGN [11] applies reconstruction for customized graph operators. AM-GCN [46] utilizes the reconstruction to separate feature and structure information. The above work re-define the neighborhood. However, they still have tightly coupled depth and scope. SHADOW-GNN can also work with the reconstructed graph $\mathcal { G } ^ { \prime }$ by simply applying EXTRACT on $\mathcal { G } ^ { \prime }$ .
163
+
164
+ # 5 Experiments
165
+
166
+ Setup. We evaluate SHADOW-GNN on seven graphs. Six of them are for the node classification task: Flickr [55], Reddit [12], Yelp [55], ogbn-arxiv, ogbn-products and ogbn-papers100M [16]. The remaining is for the link prediction task: ogbl-collab [16]. The sizes of the seven graphs range from 9K nodes (Flickr) to 110M nodes (ogbn-papers100M). Flickr, Reddit and Yelp are under the inductive setting. ogbn-arxiv, ogbn-products and ogbn-papers100M are transductive. Consistent with the original papers, for the graphs on node classification, we measure “F1-micro” score for Yelp and “accuracy” for the remaining five graphs. For the link prediction task, we use “Hits $@ 5 0 ^ { \circ }$ as the metric. See Appendix E.1 for details. We use W&B [5] for experiment tracking.
167
+
168
+ We construct SHADOW with six backbone models: GCN [22], GraphSAGE [12], GAT [44], JK-Net [50], GIN [49], SGC [47]. The first five are representatives of the state-of-the-art GNN architectures, jointly covering various message aggregation functions as well as the skip connection design. SGC simplifies normal GCN by moving all the neighbor propagation to the pre-processing step. Therefore, SGC is suitable for evaluating oversmoothing. The non-SHADOW models are trained with both full-batch and GraphSAINT-minibatch [55]. Due to the massive size of the full $L$ -hop neighborhood, we need to perform sampling when training normal GNNs in order to make the computation time tractable. GraphSAINT is suitable for our purpose since 1. it is the state-of-the-art minibatch method which achieves high accuracy, and 2. it supports various GNN architectures and scales well to large graphs. On the other hand, for SHADOW-GNN, both training and inference are always executed in minibatches. One advantage of SHADOW-GNN is that the decoupling enables straightforward minibatch construction: each target just independently extracts the small subgraph on its own.
169
+
170
+ We implement two EXTRACT described in Section 3.4: 1. “PPR”, where we set the node budget $K$ as $\{ 2 0 0 , 4 0 0 \}$ for the largest ogbn-papers100M and $K \leq 2 0 0$ for all other graphs; 2. “ $L$ -hop”, where we set the depth as $\{ 1 , 2 \}$ . We implement various subgraph pooling functions: “mean” and “max” evaluated in this section and others evaluated in Appendix F.3. For the model depth, since $L ^ { \prime } = 3$ is the standard setting in the literature (e.g., see the benchmarking in OGB [16]), we start from $L ^ { \prime } = 3$ and further evaluate a deeper model of $L ^ { \prime } = 5$ . All accuracy are measured by 5 runs without fixing random seeds. Hyperparameter tuning and architecture configurations are in Appendix E.4.
171
+
172
+ SHADOW-GNN neighborhood. For both normal and SHADOW GNNs, Figure 2 shows on average how many neighbors are $L$ hops away from the target. For a normal GNN, the size of the neighborhood grows rapidly with respect to $L$ , and the nodes 4 hops away dominate the neighborhood. For SHADOW-GNN using the Table 1 EXTRACT, most neighbors concentrate within 2 hops. A small number of nodes are 3 hops away. Almost no nodes are 4 or more hops away. Importantly, not only does the composition of the two kinds of neighborhood differ significantly, but also the size of SHADOW-GNN scope is much smaller (see also Table 1). Such small subgraphs are essential to high computation efficiency. Finally, we can ignore the very few distant neighbors $ { \left( L \geq 4 \right) }$ , and regard the (effective) depth of SHADOW-GNN subgraph as $L = 2$ (or at most 3). Under such practical value of $L$ , a model with $L ^ { \prime } \geq 3$ is indeed a SHADOW-GNN (see “Remark on decoupling” in Section 3.6).
173
+
174
+ ![](images/3ff0d72768a180365177f62556e21fbfcee94cfc5f872b8f2a83346e32c2987c.jpg)
175
+ Figure 2: Neighborhood composition
176
+
177
+ ![](images/0d3040806271ed912e8436ec3211d9ba63a3ac476cee9100cccc0c4712716703.jpg)
178
+ Figure 3: SGC oversmoothing
179
+
180
+ Table 1: Comparison on test accuracy / F1-micro score and inference cost (tuned with DropEdge)
181
+
182
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Layers</td><td colspan="2">Flickr</td><td colspan="2">Reddit</td><td colspan="2">Yelp</td><td colspan="2">ogbn-arxiv</td><td colspan="2">ogbn-products</td></tr><tr><td>Accuracy</td><td>Cost</td><td>Accuracy</td><td>Cost</td><td>F1-micro</td><td>Cost</td><td>Accuracy</td><td>Cost</td><td>Accuracy</td><td>Cost</td></tr><tr><td rowspan="3">GCN</td><td>3 5</td><td>0.5159±0.0017</td><td>2E0</td><td>0.9532±0.0003</td><td>6E1</td><td>0.4028±0.0019</td><td>2E1</td><td>0.7170±0.0026</td><td>1E1</td><td>0.7567±0.0018</td><td>5E0</td></tr><tr><td></td><td>0.5217±0.0016</td><td>2E2</td><td>0.9495±0.0012</td><td>1E3</td><td>OOM</td><td>1E3</td><td>0.7186±0.0017</td><td>1E3</td><td>OOM</td><td>9E2</td></tr><tr><td>3</td><td>0.5155±0.0027</td><td>2E0</td><td>0.9523±0.0003</td><td>6E1</td><td>0.5110±0.0012</td><td>2E1</td><td>0.7093±0.0003</td><td>1E1</td><td>0.8003±0.0024</td><td>5E0</td></tr><tr><td>GCN-SAINT</td><td>5</td><td>0.5165±0.0026</td><td>2E2</td><td>0.9523±0.0012</td><td>1E3</td><td>0.5012±0.0021</td><td>1E3</td><td>0.7039±0.0020</td><td>1E3</td><td>0.7992±0.0021</td><td>9E2</td></tr><tr><td>SHADOW-GCN</td><td>3</td><td>0.5234±0.0009</td><td>(1</td><td>0.9576±0.0005</td><td>1</td><td>0.5291±0.0020</td><td>(1</td><td>0.7180±0.0024</td><td>1</td><td>0.7742±0.0037</td><td>1)</td></tr><tr><td>(PPR)</td><td>5</td><td>0.5268±0.0008</td><td>1E0</td><td>0.9564±0.0004</td><td>1E0</td><td>0.5323±0.0020</td><td>2E0</td><td>0.7206±0.0025</td><td>2E0</td><td>0.7821±0.0043</td><td>2E0</td></tr><tr><td>+Pooling</td><td>3/5</td><td>0.5286±0.0013</td><td>1E0</td><td>0.9624±0.0002</td><td>1E0</td><td>0.5393±0.0036</td><td>2E0</td><td>0.7223±0.0018</td><td>2E0</td><td>0.7914±0.0044</td><td>2E0</td></tr><tr><td rowspan="3">GraphSAGE</td><td>3</td><td>0.5140±0.0014</td><td>3E0</td><td>0.9653±0.0002</td><td>5E1</td><td>0.6178±0.0033</td><td>2E1</td><td>0.7192±0.0027</td><td>1E1</td><td>0.7858±0.0013</td><td>4E0</td></tr><tr><td>5</td><td>0.5154±0.0052</td><td>2E2</td><td>0.9626±0.0004</td><td>1E3</td><td>0OM</td><td>2E3</td><td>0.7193±0.0037</td><td>1E3</td><td>0OM</td><td>1E3</td></tr><tr><td>3</td><td>0.5176±0.0032</td><td>3E0</td><td>0.9671±0.0003</td><td>5E1</td><td>0.6453±0.0011</td><td>2E1</td><td>0.7107±0.0003</td><td>1E1</td><td>0.7923±0.0023</td><td>4E0</td></tr><tr><td>SAGE-SAINT</td><td>5</td><td>0.5201±0.0032</td><td>2E2</td><td>0.9670±0.0010</td><td>1E3</td><td>0.6394±0.0003</td><td>2E3</td><td>0.7013±0.0021</td><td>1E3</td><td>0.7964±0.0022</td><td>1E3</td></tr><tr><td>SHADOW-SAGE</td><td>3</td><td>0.5312±0.0019</td><td>1E0</td><td>0.9672±0.0003</td><td>1E0</td><td>0.6542±0.0002</td><td>1E0</td><td>0.7163±0.0028</td><td>1E0</td><td>0.7935±0.0031</td><td>1E0</td></tr><tr><td>(2-hop)</td><td>5</td><td>0.5335±0.0015</td><td>2E0</td><td>0.9675±0.0005</td><td>2E0</td><td>0.6525±0.0003</td><td>2E0</td><td>0.7180±0.0030</td><td>2E0</td><td>0.7995±0.0022</td><td>2E0</td></tr><tr><td> SHADOW-SAGE</td><td>3</td><td>0.5356±0.0013</td><td>(1)</td><td>0.9688±0.0002</td><td>(1)</td><td>0.6538±0.0003</td><td>(1)</td><td>0.7227±0.0012</td><td>(1)</td><td>0.7905±0.0026</td><td>(1)</td></tr><tr><td>(PPR)</td><td>5</td><td>0.5417±0.0006</td><td>2E0</td><td>0.9692±0.0007</td><td>2E0</td><td>0.6518±0.0002</td><td>2E0</td><td>0.7238±0.0007</td><td>2E0</td><td>0.8005±0.0040</td><td>2E0</td></tr><tr><td>+Pooling</td><td>3/5</td><td>0.5395±0.0013</td><td>2E0</td><td>0.9703±0.0003</td><td>2E0</td><td>0.6564±0.0004</td><td>1E0</td><td>0.7258±0.0017</td><td>2E0</td><td>0.8067±0.0037</td><td>1E0</td></tr><tr><td rowspan="3">GAT</td><td>3</td><td>0.5070±0.0032</td><td>2E1</td><td>0OM</td><td>3E2</td><td>0OM</td><td>2E2</td><td>0.7201±0.0011</td><td>1E2</td><td>0OM</td><td>3E1</td></tr><tr><td>5</td><td>0.5164±0.0033</td><td>2E2</td><td>OOM</td><td>2E3</td><td>OOM</td><td>2E3</td><td>OOM</td><td>3E3</td><td>OOM</td><td>2E3</td></tr><tr><td>3</td><td>0.5225±0.0053</td><td>2E1</td><td>0.9671±0.0003</td><td>3E2</td><td>0.6459±0.0002</td><td>2E2</td><td>0.6977±0.0003</td><td>1E2</td><td>0.8027±0.0028</td><td>3E1</td></tr><tr><td>GAT-SAINT</td><td>5</td><td>0.5153±0.0034</td><td>2E2</td><td>0.9651±0.0024</td><td>2E3</td><td>0.6478±0.0012</td><td>2E3</td><td>0.6954±0.0013</td><td>3E3</td><td>0.7990±0.0072</td><td>2E3</td></tr><tr><td>SHADOW-GAT</td><td></td><td>0.5349±0.0023</td><td>(1)</td><td>0.9707±0.0004</td><td>(1)</td><td>0.6575±0.0004</td><td>(1)</td><td>0.7235±0.0020</td><td>(1)</td><td>0.8006±0.0014</td><td>(1)</td></tr><tr><td>(PPR)</td><td>3</td><td>0.5352±0.0028</td><td>2E0</td><td>0.9713±0.0004</td><td>2E0</td><td>0.6559±0.0002</td><td>2E0</td><td>0.7274±0.0022</td><td>2E0</td><td>0.8071±0.0004</td><td>2E0</td></tr><tr><td>+Pooling</td><td>3/5</td><td>0.5364±0.0026</td><td>1E0</td><td>0.9710±0.0004</td><td>2E0</td><td>0.6566±0.0005</td><td>1E0</td><td>0.7265±0.0028</td><td>2E0</td><td>0.8142±0.0031</td><td>1E0</td></tr></table>
183
+
184
+ Comparison with baselines. Table 1 shows the performance comparison of SHADOW-GNN with the normal GNNs. All models on all datasets have uniform hidden dimension of 256. We define the metric “inference cost” as the average amount of computation to generate prediction for one test node. Inference cost is a measure of computation complexity (see Appendix B for the calculation) and is independent of hardware / implementation factors such as parallelization strategy, batch processing, etc. For cost of SHADOW-GNN, we do not include the overhead on computing EXTRACT, since it is hard to calculate such cost analytically. Empirically, subgraph extraction is much cheaper than model computation (see Figure 8, 9 for time evaluation on CPU and GPU). During training, we apply DropEdge [39] to both the baseline and SHADOW models. DropEdge helps improve the baseline accuracy by alleviating oversmoothing, and benefits SHADOW-GNN due to its regularization effects. See Appendix F.2 for results on other architectures including GIN and JK-Net.
185
+
186
+ ACCURACY We aim at answering the following questions: 1. Can we improve accuracy by decoupling a baseline model? 2. What architecture components can we tune to improve accuracy of a decoupled model? 3. What EXTRACT can we tune to improve the accuracy of a decoupled model? To answer Q1, we fix the backbone architecture and remove pooling. Then we inspect “3-layer normal GNN vs. 3-layer SHADOW-GNN” and “5-layer normal GNN vs. 5-layer SHADOW-GNN”. Clearly, SHADOW-GNNs (with scope size no more than 200) in general achieve significantly higher accuracy than the normal GNNs. This indicates that a shallow neighborhood contains sufficient information, and customizing the scope can benefit accuracy even without architecture changes (from Figure 2, a depth-3 $\mathcal { G } _ { [ v ] }$ differs significantly from the 3-hop neighborhood). To answer Q1, we focus on the PPR EXTRACT and thus compare the rows in blue background. We use the 3-layer SHADOW-GNN without pooling as the baseline and analyze the effects of 1. increasing the GNN depth without expanding scope, and 2. adding subgraph pooling. Comparing among the rows in light blue background, we observe that in many cases, simply increasing the depth from 3 to 5 leads to significant accuracy gain. Comparing the ligh blue rows with the dark blue rows, we observe that sometimes pooling can further improve the accuracy of a SHADOW-GNN. In conclusion, both types of architecture tuning are effective ways of optimizing a SHADOW-GNN. Finally, to answer Q3, we compare the light blue rows with the light yellow rows. In general, PPR EXTRACT leads to higher accuracy than 2-hop EXTRACT, demonstrating the importance of designing a good EXTRACT.
187
+
188
+ INFERENCE COST Inference cost of SHADOW-GNN is orders of magnitude lower than the normal GNNs (a 5-layer SHADOW-GNN is still much cheaper than a 3-layer normal GNN). The high cost of the baselines is due to the “neighborhood explosion” with respect to more layers. SHADOW-GNN is efficient and scalable as the cost only grows linearly with the model depth. Note that GraphSAINT only improves efficiency during training since its inference operates on the full $L$ -hop neighborhood.
189
+
190
+ Table 2: Leaderboard comparison on papers100M
191
+
192
+ <table><tr><td>Method</td><td>Test accuracy</td><td>Val accuracy</td><td>Neigh size</td></tr><tr><td>GraphSAGE+incep</td><td>0.6706±0.0017</td><td>0.7032±0.0011</td><td>4E5</td></tr><tr><td>SIGN-XL</td><td>0.6606±0.0019</td><td>0.6984±0.0006</td><td>&gt;4E5</td></tr><tr><td>SGC</td><td>0.6329±0.0019</td><td>0.6648±0.0020</td><td>&gt;4E5</td></tr><tr><td>SHADOW-GAT200</td><td>0.6681±0.0016</td><td>0.7019±0.0011</td><td>2E2</td></tr><tr><td>SHADOW-GAT400</td><td>0.6708±0.0017</td><td>0.7073±0.0011</td><td>3E2</td></tr></table>
193
+
194
+ Scaling to 100 million nodes. We further scale SHADOW-GNN to ogbn-papers100M, one of the largest public dataset. Even through the full graph size is at least two orders of magnitude larger than the graphs in Table 1, the localized scope of SHADOW-GNN barely needs to increase. Since SHADOW-GNN performs
195
+
196
+ minibatch computation, a low-end GPU with limited memory capacity can compute SHADOW-GNN on ogbn-papers100M efficiently. We show in Appendix F.1 that we can train and inference our model with as little as 4GB GPU memory consumption. This is infeasible using normal GNNs. Table 2 summarizes our comparison with the top leaderboard methods [45, 11, 47]. We only include those methods that do not use node labels as the model input (i.e., the most standard setup). We achieve at least 3 orders of magnitude reduction in neighborhood size without sacrificing accuracy. For SIGN-XL and SGC, their neighborhood is too large to count the exact size. Also, their preprocessing consumes $5 \times$ more CPU memory than SHADOW-GNN (Appendix F.1).
197
+
198
+ Table 3: Leaderboard comparison on collab
199
+
200
+ <table><tr><td>Method</td><td>Test Hits @50</td><td>Val Hits @50</td></tr><tr><td>SEAL</td><td>0.5371±0.0047</td><td>0.6389±0.0049</td></tr><tr><td>DeeperGCN</td><td>0.5273±0.0047</td><td>0.6187±0.0045</td></tr><tr><td>LRGA+GCN</td><td>0.5221±0.0072</td><td>0.6088±0.0059</td></tr><tr><td>SHADOW-SAGE</td><td>0.5492±0.0022</td><td>0.6524±0.0017</td></tr></table>
201
+
202
+ Extending to link-level task. We further show that SHADOW-GNN is general and can be extended to the link prediction task. There are two settings of ogbl-collab. We follow the one where validation edges cannot be used in training updates. This is the setting which most leaderboard methods follow. Table 3 shows the comparison with the top GNN models under the same setting. SHADOW-SAGE outperforms the rank-1 model with significant margin.
203
+
204
+ Oversmoothing. To validate Theorem 3.2, we pick SGC as the backbone architecture. SGC with power $L$ is equivalent to $L$ -layer GCN without activation. Performance comparison between SGC and SHADOW-SGC thus reveals the effect of oversmoothing without introducing other factors due to optimizing deep neural networks (e.g., vanishing gradients). In Figure 3, we vary the power of SGC and SHADOW-SGC from 1 to 40 (see Appendix E.5 for details). While SGC gradually collapses local information into global “white noise”, accuracy of SHADOW-SGC does not degrade. This validates our theory that extracting local subgraphs prevents oversmoothing.
205
+
206
+ # 6 Conclusion
207
+
208
+ We have presented a design principle to decouple the depth and scope of GNNs. Applying such a principle on various GNN architectures simultaneously improves expressivity and computation scalability of the corresponding models. We have presented thorough theoretical analysis on expressivity from three different perspectives, and also rich design components (e.g., subgraph extraction functions, architecture extensions) to implement such design principle. Experiments show significant performance improvement over a wide range of graphs, GNN architectures and learning tasks.
209
+
210
+ References
211
+ [1] Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. arXiv preprint arXiv:1905.00067, 2019.
212
+ [2] Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. In International Conference on Learning Representations, 2021.
213
+ [3] Reid Andersen, Fan Chung, and Kevin Lang. Local graph partitioning using pagerank vectors. In 2006 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS’06), pages 475–486. IEEE, 2006.
214
+ [4] Filippo Maria Bianchi, Daniele Grattarola, and Cesare Alippi. Spectral clustering with graph neural networks for graph pooling. In International Conference on Machine Learning, pages 874–883. PMLR, 2020.
215
+ [5] Lukas Biewald. Experiment tracking with weights and biases, 2020. Software available from wandb.com.
216
+ [6] Aleksandar Bojchevski, Johannes Klicpera, Bryan Perozzi, Amol Kapoor, Martin Blais, Benedek Rózemberczki, Michal Lukasik, and Stephan Günnemann. Scaling graph neural networks with approximate pagerank. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’20, page 2464–2473, New York, NY, USA, 2020. Association for Computing Machinery.
217
+ [7] Jianfei Chen, Jun Zhu, and Le Song. Stochastic training of graph convolutional networks with variance reduction, 2017.
218
+ [8] Jie Chen, Tengfei Ma, and Cao Xiao. FastGCN: Fast learning with graph convolutional networks via importance sampling. In International Conference on Learning Representations, 2018.
219
+ [9] Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-gcn: An efficient algorithm for training deep and large graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’19, page 257–266, New York, NY, USA, 2019. Association for Computing Machinery.
220
+ [10] Weilin Cong, Rana Forsati, Mahmut Kandemir, and Mehrdad Mahdavi. Minimal variance sampling with provable guarantees for fast training of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’20, page 1393–1403, New York, NY, USA, 2020. Association for Computing Machinery.
221
+ [11] Fabrizio Frasca, Emanuele Rossi, Davide Eynard, Ben Chamberlain, Michael Bronstein, and Federico Monti. SIGN: Scalable inception graph neural networks, 2020.
222
+ [12] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pages 1024–1034, 2017.
223
+ [13] William L Hamilton, Rex Ying, and Jure Leskovec. Representation learning on graphs: Methods and applications. arXiv preprint arXiv:1709.05584, 2017.
224
+ [14] Arman Hasanzadeh, Ehsan Hajiramezanali, Shahin Boluki, Mingyuan Zhou, Nick Duffield, Krishna Narayanan, and Xiaoning Qian. Bayesian graph neural networks with adaptive connection sampling, 2020.
225
+ [15] Kurt Hornik, Maxwell Stinchcombe, Halbert White, et al. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359–366, 1989.
226
+ [16] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs, 2020.
227
+ [17] Wenbing Huang, Yu Rong, Tingyang Xu, Fuchun Sun, and Junzhou Huang. Tackling oversmoothing for general Graph Convolutional Networks, 2020.
228
+ [18] Wenbing Huang, Tong Zhang, Yu Rong, and Junzhou Huang. Adaptive sampling towards fast graph representation learning. In Advances in neural information processing systems, pages 4558–4567, 2018.
229
+ [19] Glen Jeh and Jennifer Widom. Simrank: a measure of structural-context similarity. In Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 538–543, 2002.
230
+ [20] Leo Katz. A new status index derived from sociometric analysis. Psychometrika, 18(1):39–43, 1953.
231
+ [21] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
232
+ [22] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
233
+ [23] Johannes Klicpera, Stefan Weißenberger, and Stephan Günnemann. Diffusion improves graph learning, 2019.
234
+ [24] Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In International Conference on Machine Learning, pages 3734–3743. PMLR, 2019.
235
+ [25] Jure Leskovec and Christos Faloutsos. Sampling from large graphs. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, page 631–636, New York, NY, USA, 2006. Association for Computing Machinery.
236
+ [26] Jure Leskovec, Jon Kleinberg, and Christos Faloutsos. Graph evolution: Densification and shrinking diameters. ACM Trans. Knowl. Discov. Data, 1(1):2–es, March 2007.
237
+ [27] David A Levin and Yuval Peres. Markov chains and mixing times, volume 107. American Mathematical Soc., 2017.
238
+ [28] Guohao Li, Matthias Müller, Ali Thabet, and Bernard Ghanem. DeepGCNs: Can GCNs go as deep as CNNs? In The IEEE International Conference on Computer Vision (ICCV), 2019.
239
+ [29] Guohao Li, Chenxin Xiong, Ali Thabet, and Bernard Ghanem. DeeperGCN: All you need to train deeper gcns, 2020.
240
+ [30] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into Graph Convolutional Networks for semi-supervised learning. arXiv preprint arXiv:1801.07606, 2018.
241
+ [31] Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Aug 2020.
242
+ [32] Yu-Chen Lo, Stefano E Rensi, Wen Torng, and Russ B Altman. Machine learning in chemoinformatics and drug discovery. Drug discovery today, 23(8):1538–1546, 2018.
243
+ [33] Sitao Luan, Mingde Zhao, Xiao-Wen Chang, and Doina Precup. Break the ceiling: Stronger multi-scale deep graph convolutional networks. In Advances in Neural Information Processing Systems 32, pages 10945–10955. Curran Associates, Inc., 2019.
244
+ [34] Zhewei Wei Ming Chen, Bolin Ding Zengfeng Huang, and Yaliang Li. Simple and deep graph convolutional networks. 2020.
245
+ [35] Federico Monti, Michael Bronstein, and Xavier Bresson. Geometric matrix completion with recurrent multi-graph neural networks. In Advances in Neural Information Processing Systems, pages 3697–3707, 2017.
246
+ [36] Kenta Oono and Taiji Suzuki. Graph Neural Networks exponentially lose expressive power for node classification. In International Conference on Learning Representations, 2020.
247
+
248
+ [37] Aditya Pal, Chantat Eksombatchai, Yitong Zhou, Bo Zhao, Charles Rosenberg, and Jure Leskovec. PinnerSage: Multi-modal user embedding framework for recommendations at Pinterest. Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Aug 2020.
249
+
250
+ [38] Namyong Park, Andrey Kan, Xin Luna Dong, Tong Zhao, and Christos Faloutsos. Estimating node importance in knowledge graphs using graph neural networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 596–606, 2019.
251
+ [39] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. DropEdge: Towards deep Graph Convolutional Networks on node classification. In International Conference on Learning Representations, 2020.
252
+ [40] 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, pages 593–607. Springer, 2018.
253
+ [41] Nino Shervashidze, Pascal Schweitzer, Erik Jan Van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(9), 2011.
254
+ [42] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
255
+ [43] Jonathan M Stokes, Kevin Yang, Kyle Swanson, Wengong Jin, Andres Cubillos-Ruiz, Nina M Donghia, Craig R MacNair, Shawn French, Lindsey A Carfrae, Zohar Bloom-Ackerman, et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
256
+ [44] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph Attention Networks. In International Conference on Learning Representations, 2018.
257
+ [45] Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, Tianjun Xiao, Tong He, George Karypis, Jinyang Li, and Zheng Zhang. Deep graph library: A graph-centric, highly-performant package for graph neural networks, 2020.
258
+ [46] Xiao Wang, Meiqi Zhu, Deyu Bo, Peng Cui, Chuan Shi, and Jian Pei. AM-GCN: Adaptive multichannel graph convolutional networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’20, page 1243–1253, New York, NY, USA, 2020. Association for Computing Machinery.
259
+ [47] Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q Weinberger. Simplifying graph convolutional networks. arXiv preprint arXiv:1902.07153, 2019.
260
+ [48] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2020.
261
+ [49] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
262
+ [50] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks, 2018.
263
+ [51] Rex Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. GNNExplainer: Generating explanations for graph neural networks, 2019.
264
+ [52] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 974–983, 2018.
265
+ [53] Jiaxuan You, Zhitao Ying, and Jure Leskovec. Design space for graph neural networks. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 17009–17021. Curran Associates, Inc., 2020.
266
+ [54] Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Accurate, efficient and scalable graph embedding. In 2019 IEEE International Parallel and Distributed Processing Symposium (IPDPS), pages 462–471, 2019.
267
+ [55] Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. GraphSAINT: Graph sampling based inductive learning method. In International Conference on Learning Representations, 2020.
268
+ [56] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pages 5165–5175, 2018.
269
+ [57] Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
270
+ [58] 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.
271
+ [59] Yuyu Zhang, Xinshi Chen, Yuan Yang, Arun Ramamurthy, Bo Li, Yuan Qi, and Le Song. Efficient probabilistic logic reasoning with graph neural networks, 2020.
272
+ [60] Lingxiao Zhao and Leman Akoglu. PairNorm: Tackling oversmoothing in gnns. In International Conference on Learning Representations, 2020.
273
+ [61] Difan Zou, Ziniu Hu, Yewen Wang, Song Jiang, Yizhou Sun, and Quanquan Gu. Layerdependent importance sampling for training deep and large graph convolutional networks. 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
+
275
+ # Checklist
276
+
277
+ 1. For all authors...
278
+
279
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
280
+ (b) Did you describe the limitations of your work? [Yes]
281
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A]
282
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
283
+
284
+ 2. If you are including theoretical results...
285
+
286
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] See append
287
+
288
+ 3. If you ran experiments...
289
+
290
+ (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 the released code.
291
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See the released code. It contains all configurations.
292
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
293
+ (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)? [No]
294
+
295
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
296
+
297
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See citation after each dataset.
298
+ (b) Did you mention the license of the assets? [N/A]
299
+ (c) Did you include any new assets either in the supplemental material or as a URL? [No]
300
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
301
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
302
+
303
+ 5. If you used crowdsourcing or conducted research with human subjects...
304
+
305
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
306
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
307
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/b8Kl8mcK6tb/b8Kl8mcK6tb.md ADDED
@@ -0,0 +1,357 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bellman Eluder Dimension: New Rich Classes of RL Problems, and Sample-Efficient Algorithms
2
+
3
+ Chi Jin Princeton University chij@princeton.edu
4
+
5
+ Qinghua Liu Princeton University qinghual@princeton.edu
6
+
7
+ Sobhan Miryoosefi Princeton University miryoosefi@cs.princeton.edu
8
+
9
+ # Abstract
10
+
11
+ Finding the minimal structural assumptions that empower sample-efficient learning is one of the most important research directions in Reinforcement Learning (RL). This paper advances our understanding of this fundamental question by introducing a new complexity measure—Bellman Eluder (BE) dimension. We show that the family of RL problems of low BE dimension is remarkably rich, which subsumes a vast majority of existing tractable RL problems including but not limited to tabular MDPs, linear MDPs, reactive POMDPs, low Bellman rank problems as well as low Eluder dimension problems. This paper further designs a new optimization-based algorithm—GOLF, and reanalyzes a hypothesis eliminationbased algorithm—OLIVE [proposed in 1]. We prove that both algorithms learn the near-optimal policies of low BE dimension problems in a number of samples that is polynomial in all relevant parameters, but independent of the size of state-action space. Our regret and sample complexity results match or improve the best existing results for several well-known subclasses of low BE dimension problems.
12
+
13
+ # 1 Introduction
14
+
15
+ Modern Reinforcement Learning (RL) commonly engages practical problems with an enormous number of states, where function approximation must be deployed to approximate the true value function using functions from a prespecified function class. Function approximation, especially based on deep neural networks, lies at the heart of the recent practical successes of RL in domains such as Atari [2], Go [3], robotics [4], and dialogue systems [5].
16
+
17
+ Despite its empirical success, RL with function approximation raises a new series of theoretical challenges when comparing to the classic tabular RL: (1) generalization, to generalize knowledge from the visited states to the unvisited states due to the enormous state space. (2) limited expressiveness, to handle the complicated issues where true value functions or intermediate steps computed in the algorithm can be functions outside the prespecified function class. (3) exploration, to address the tradeoff between exploration and exploitation when above challenges are present.
18
+
19
+ Consequently, most existing theoretical results on efficient RL with function approximation rely on relatively strong structural assumptions. For instance, many require that the MDP admits a linear approximation [6–8], or that the model is precisely Linear Quadratic Regulator (LQR) [9–11]. Most of these structural assumptions rarely hold in practical applications. This naturally leads to one of the most fundamental questions in RL.
20
+
21
+ ![](images/77c926de0e00917b5f40e684448ed4d632520e6ebd7f236362d3c5c22bd1676f.jpg)
22
+ Figure 1: A schematic summarizing relations among families of RL problems1
23
+
24
+ # What are the minimal structural assumptions that empower sample-efficient RL?
25
+
26
+ We advance our understanding of this grand question via the following two steps: (1) identify a rich class of RL problems (with weak structural assumptions) that cover many practical applications of interests; (2) design sample-efficient algorithms that provably learn any RL problem in this class.
27
+
28
+ The attempts to find weak or minimal structural assumptions that allow statistical learning can be traced in supervised learning where VC dimension [12] or Rademacher complexity [13] is proposed, or in online learning where Littlestone dimension [14] or sequential Rademacher complexity [15] is developed.
29
+
30
+ In the area of reinforcement learning, there are two intriguing lines of recent works that have made significant progress in this direction. To begin with, Jiang et al. [1] introduces a generic complexity notion—Bellman rank, which can be proved small for many RL problems including linear MDPs [7], reactive POMDPs [16], etc. [1] further propose an hypothesis elimination-based algorithm— OLIVE for sample-efficient learning of problems with low Bellman rank. On the other hand, recent work by Wang et al. [17] considers general function approximation with low Eluder dimension [18], and designs a UCB-style algorithm with regret guarantee. Noticeably, generalized linear MDPs [6] and kernel MDPs (see Appendix C) are subclasses of low Eluder dimension problems, but not low Bellman rank.
31
+
32
+ In this paper, we make the following three contributions.
33
+
34
+ • We introduce a new complexity measure for RL—Bellman Eluder (BE) dimension. We prove that the family of RL problems of low BE dimension is remarkably rich, which subsumes both low Bellman rank problems and low Eluder dimension problems—two arguably most generic tractable function classes so far in the literature (see Figure 1). The family of low BE dimension further includes new problems such as kernel reactive POMDPs (see Appendix C) which were not known to be sample-efficiently learnable. We design a new optimization-based algorithm—GOLF, which provably learns nearoptimal policies of low BE dimension problems in a number of samples that is polynomial in all relevant parameters, but independent of the size of state-action space. Our regret or sample complexity guarantees match [8] which is minimax optimal when specified to the linear setting. Our rates further improve upon [1, 17] in low Bellman rank and low Eluder dimension settings, respectively. We reanalyze the hypothesis elimination based algorithm—OLIVE proposed in [1]. We show it can also learn RL problems with low BE dimension sample-efficiently, under slightly weaker assumptions but with worse sample complexity comparing to GOLF.
35
+
36
+ # 1.1 Related works
37
+
38
+ This section reviews prior theoretical works on RL, under Markov Decision Process (MDP) models.
39
+
40
+ We remark that there has been a long line of research on function approximation in the batch RL setting [see, e.g., 19–22]. In this setting, agents are provided with exploratory data or simulator, so that they do not need to explicitly address the challenge of exploration. In this paper, we do not make such assumption, and attack the exploration problem directly. In the following we focus exclusively on the RL results in the general setting where exploration is required.
41
+
42
+ Tabular RL. Tabular RL concerns MDPs with a small number of states and actions, which has been thoroughly studied in recent years [see, e.g., 23–30]. In the episodic setting with non-stationary dynamics, the best regret bound $\tilde { \mathcal { O } } ( \sqrt { H ^ { 2 } | \boldsymbol { S } | | \boldsymbol { A } | T } )$ is achieved by both model-based [27] and modelfree [30] algorithms. Moreover, the bound is proved to be minimax-optimal [29, 31]. This minimax bound suggests that when the state-action space is enormous, RL is information-theoretically hard without further structural assumptions.
43
+
44
+ RL with linear function approximation. A recent line of work studies RL with linear function approximation [see, e.g., 7, 6, 32, 8, 33–36] These papers assume certain completeness conditions, as well as the optimal value function can be well approximated by linear functions. Under one√ formulation of linear approximation, the minimax regret bound $\tilde { \mathcal { O } } ( \dot { d } \sqrt { T } )$ is achieved by algorithm ELEANOR [8], where $d$ is the ambient dimension of the feature space.
45
+
46
+ RL with general function approximation. Beyond the linear setting, there is a flurry line of research studying RL with general function approximation [see, e.g., 37, 1, 36, 38, 17, 39, 40]. Among them, [1] and [17] are the closest to our work.
47
+
48
+ Jiang et al. [1] propose a complexity measure named Bellman rank and design an algorithm OLIVE with PAC guarantees for problems with low Bellman rank. We note that low Bellman rank is a special case of low BE dimension. When specialized to the low Bellman rank setting, our result for OLIVE exactly matches the guarantee in [1]. Our result for GOLF requires an additional completeness assumption, but provides sharper sample complexity guarantee.
49
+
50
+ Wang et al. [17] propose a UCB-type algorithm with a regret guarantee under the assumption that the function class has a low eluder dimension. Again, we will show that low Eluder dimension is a special case of low BE dimension. Comparing to [17], our algorithm GOLF works under a weaker completeness assumption, with a better regret guarantee.
51
+
52
+ Finally, we remark that the algorithms proposed in [1, 33, 41] and this paper are all computationally inefficient in general. We notice several existing works [e.g., 7, 17] can be computationally efficient given suitable regression oracles but they require stronger representation conditions and also achieve worse regret guarantees.
53
+
54
+ Relation to bilinear classes Concurrent to this work, Du et al. [41] propose a new general tractable class of RL problems—bilinear class with low effective dimension (also known as low critical information gain in Du et al. [41]). We comment on the similarities and differences between two works as follows.
55
+
56
+ In terms of algorithms, both Algorithm 2 in this paper and the algorithm proposed in Du et al. [41] are based on OLIVE originally proposed in Jiang et al. [1]. The two algorithms share similar guarantees in terms of assumptions and complexity results. More importantly, our work further develops a new type of algorithm for general function approximation—GOLF, a natural and clean algorithm which can be viewed as an optimistic version of classical algorithm—Fitted Q-Iteration [42]. GOLF gives much sharper sample complexity guarantees compared to [41] for various settings, and is minimaxoptimal when applied to the linear setting [8].
57
+
58
+ In terms of richness of new classes identified, it depends on (a) what structure of MDP the complexity measures are applied to, and (b) what complexity measures are used. For (a), BE dimension applies to the Bellman error, while the bilinear class allows general surrogate losses of the Bellman error. For (b), this paper uses Eluder dimension while Du et al. [41] uses effective dimension. It can be shown that low effective dimension always implies low Eluder dimension (see Appendix C.2). In short, Du et al. [41] is more general in (a), while our work is more general in (b). As a result, neither work fully captures the other.
59
+
60
+ In particular, our BE framework covers a majority of the examples identified in Du et al. [41] including low occupancy complexity, linear $Q ^ { \star } / V ^ { \star }$ , $Q ^ { \star }$ state aggregation, feature selection/FLAMBE.
61
+
62
+ Nevertheless, our work can not address examples with model-based function approximation (e.g., low witness rank [36]) while [41] can. On the other hand, Du et al. [41] can not address the class of RL problems with low Eluder dimension [17] while our work can. Moreover, for several classes of RL problems that both works cover, our complexity measure is sharper. For example, in the setting of function approximation with generalized linear functions, the BE dimension is ${ \tilde { O } } ( d )$ where $d$ is the ambient dimension of the feature vectors, while the effective dimension under the generalized bilinear framework of Du et al. [41] is at least $\tilde { \Omega } ( d ^ { 2 } )$ .
63
+
64
+ # 1.2 Paper organization
65
+
66
+ We present preliminaries in Section 2, the definition of Bellman-Eluder dimension as well as its relations to existing complexity notions in Section 3. We present the results for algorithm GOLF in Section 4, and conclude in Section 5. Due to space limit, we postpone the results for algorithm OLIVE to Appendix A. Further discussions on Q-type versus V-type variants of BE dimension, as well as the practical examples will be provided in Appendix B and C. All the proofs are postponed to the appendix.
67
+
68
+ # 2 Preliminaries
69
+
70
+ We consider episodic Markov Decision Process (MDP), denoted by $\mathcal { M } = ( \mathcal { S } , \mathcal { A } , H , \mathbb { P } , r )$ , where $s$
71
+ is the state space, $\mathcal { A }$ is the action space, $H$ is the number of steps in each episode, $\mathbb { P } = \left\{ \mathbb { P } _ { h } \right\} _ { h \in [ H ] }$
72
+ is the collection of transition measures with $\mathbb { P } _ { h } ( s ^ { \prime } \mid s , a )$ equal to the probability of transiting to
73
+ $s ^ { \prime }$ after taking action $a$ at state $s$ at the $h ^ { \mathrm { t h } }$ step, and $r ~ { = } ~ \bar { \{ } r _ { h } \} _ { h \in \{ H \} }$ is the collection of reward
74
+ funthe for ns with step. 2 possible $r _ { h } ( s , a )$ eoue stic reward received after takinme reward is non-negative, and . $a$ $s$ $h ^ { \mathrm { t h } }$ $\begin{array} { r } { \sum _ { h = 1 } ^ { H } r _ { h } ( s _ { h } , a _ { h } ) \le 1 } \end{array}$ $( s _ { 1 } , a _ { 1 } , \dotsc , s _ { H } , a _ { H } )$
75
+
76
+ In each episode, the agent starts at a fixed initial state $s _ { 1 }$ . Then, at each step $h \in [ H ]$ , the agent observes its current state $s _ { h }$ , takes action $a _ { h }$ , receives reward $r _ { h } ( s _ { h } , a _ { h } )$ , and causes the environment to transit to $s _ { h + 1 } \sim \mathbb { P } _ { h } ( \cdot \mid s _ { h } , a _ { h } )$ . Without loss of generality, we assume there is a terminating state $s _ { \mathrm { e n d } }$ which the environment will always transit to at step $H + 1$ , and the episode terminates when $s _ { \mathrm { e n d } }$ is reached.
77
+
78
+ Policy and value functions A (deterministic) policy $\mathcal { A } \} _ { h = 1 } ^ { H }$ . We denote ed sum of th $V _ { h } ^ { \pi } : { \cal S } \mathbb { R }$ as the value function at step ewards received under policy is a collection of $h$ for policy , starting f $\pi$ $H$ , sm functions $V _ { h } ^ { \pi } ( s )$ $\{ \pi _ { h } : { \mathcal { S } } \to$ gives thehe end of $\pi$ $s _ { h } = s$ the episode. In symbol,
79
+
80
+ $$
81
+ V _ { h } ^ { \pi } ( s ) : = \mathbb { E } _ { \pi } [ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } ( s _ { h ^ { \prime } } , a _ { h ^ { \prime } } ) \mid s _ { h } = s ] .
82
+ $$
83
+
84
+ Similarly, we denote $Q _ { h } ^ { \pi } : \mathcal { S } \times \mathcal { A } \mathbb { R }$ as the $Q$ -value function at step $h$ for policy $\pi$ , where
85
+
86
+ $$
87
+ Q _ { h } ^ { \pi } ( s , a ) : = \mathbb { E } _ { \pi } [ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } ( s _ { h ^ { \prime } } , a _ { h ^ { \prime } } ) \ | \ s _ { h } = s , a _ { h } = a ] .
88
+ $$
89
+
90
+ There exists an optimal policy $\pi ^ { \star }$ , which gives the optimal value function for all states [43], in the sense, $\begin{array} { r } { V _ { h } ^ { \pi ^ { \star } } ( s ) = \operatorname* { s u p } _ { \pi } \bar { V } _ { h } ^ { \pi } ( s ) } \end{array}$ for all $h \in [ H ]$ and $s \in S$ . For notational simplicity, we abbreviate $V ^ { \pi ^ { \star } }$ as $V ^ { \star }$ . We similarly define the optimal $Q$ -value function as $Q ^ { \star }$ . Recall that $Q ^ { \star }$ satisfies the Bellman optimality equation:
91
+
92
+ $$
93
+ Q _ { h } ^ { \star } ( s , a ) = ( { \cal T } _ { h } Q _ { h + 1 } ^ { \star } ) ( s , a ) : = r _ { h } ( s , a ) + \mathbb { E } _ { s ^ { \prime } \sim \mathbb { P } _ { h } ( \cdot \vert s , a ) } \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q _ { h + 1 } ^ { \star } ( s ^ { \prime } , a ^ { \prime } ) .
94
+ $$
95
+
96
+ for all $( s , a , h ) \in \mathcal { S } \times \mathcal { A } \times [ H ]$ . We also call $\mathcal { T } _ { h }$ the Bellman operator at step $h$ .
97
+
98
+ $\epsilon$ -optimality and regret We say a policy $\pi$ is $\epsilon$ -optimal if $V _ { 1 } ^ { \pi } ( s _ { 1 } ) \geq V _ { 1 } ^ { \star } ( s _ { 1 } ) - \epsilon$ . Suppose an agent interacts with the environment for $K$ episodes. Denote by $\pi ^ { k }$ the policy the agent follows in episode $k \in [ K ]$ . The (accumulative) regret is defined as
99
+
100
+ $$
101
+ \mathrm { R e g } ( K ) : = \sum _ { k = 1 } ^ { K } [ V _ { 1 } ^ { \star } ( s _ { 1 } ) - V _ { 1 } ^ { \pi ^ { k } } ( s _ { 1 } ) ] .
102
+ $$
103
+
104
+ The objective of reinforcement learning is to find an $\epsilon$ -optimal policy within a small number of interactions or to achieve sublinear regret.
105
+
106
+ # 2.1 Function approximation
107
+
108
+ In this paper, we consider reinforcement learning with value function approximation. Formally, the learner is given a function class $\mathcal { F } = \mathcal { F } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { F } _ { H }$ , where ${ \mathcal { F } } _ { h } \subseteq ( S \times { \mathcal { A } } \to [ 0 , 1 ] )$ offers a set of candidate functions to approximate $Q _ { h } ^ { \star }$ —the optimal $Q$ -value function at step $h$ . Since no reward is collected in the $( H + 1 ) ^ { \mathrm { t h } }$ steps, we always set $f _ { H + 1 } = 0$ .
109
+
110
+ Reinforcement learning with function approximation in general is extremely challenging without further assumptions (see, e.g., hardness results in [16, 44]). Below, we present two assumptions about function approximation that are commonly adopted in the literature.
111
+
112
+ Assumption 1 (Realizability). $Q _ { h } ^ { \star } \in \mathcal { F } _ { h }$ for all $h \in [ H ]$ .
113
+
114
+ Realizability requires the function class is well-specified, i.e., function class $\mathcal { F }$ in fact contains the optimal $Q$ -value function $Q ^ { \star }$ with no approximation error.
115
+
116
+ Assumption 2 (Completeness). $\mathcal T _ { h } \mathcal F _ { h + 1 } \subseteq \mathcal F _ { h }$ for all $h \in [ H ]$ .
117
+
118
+ Note $\mathcal { T } _ { h } \mathcal { F } _ { h + 1 }$ is defined as $\{ T _ { h } f _ { h + 1 } : f _ { h + 1 } \in \mathcal { F } _ { h + 1 } \}$ . Completeness requires the function class $\mathcal { F }$ to be closed under the Bellman operator.
119
+
120
+ When function class $\mathcal { F }$ has finite elements, we can use its cardinality $| \mathcal F |$ to measure the “size” of function class $\mathcal { F }$ . When addressing function classes with infinite elements, we need a notion similar to cardinality. We use the standard $\epsilon$ -covering number.
121
+
122
+ Definition 3 ( $\epsilon$ -covering number). The $\epsilon$ -covering number of a set $\nu$ under metric $\rho ,$ , denoted as $\mathcal { N } ( \mathcal { V } , \epsilon , \rho )$ , is the minimum integer $n$ such that there exists a subset $\mathcal { V } _ { o } \subset \mathcal { V }$ with $| \nu _ { o } | = n$ , and for any $x \in \nu$ , there exists $y \in \mathcal { V } _ { o }$ such that $\rho ( x , y ) \le \epsilon$ .
123
+
124
+ We refer readers to standard textbooks [see, e.g., 45] for further properties of covering number. In this paper, we will always apply the covering number on function class $\mathcal { F } = \mathcal { F } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { F } _ { H }$ , and use metric $\rho ( f , g ) = \operatorname* { m a x } _ { h } \| f _ { h } - g _ { h } \| _ { \infty }$ . For notational simplicity, we omit the metric dependence and denote the covering number as $\mathcal { N } _ { \mathcal { F } } ( \epsilon )$ .
125
+
126
+ # 2.2 Eluder dimension
127
+
128
+ One class of functions highly related to this paper is the function class of low Eluder dimension [18].
129
+
130
+ Definition 4 ( $\epsilon$ -independence between points). Let $\mathcal { G }$ be a function class defined on $\mathcal { X }$ , and $z , x _ { 1 } , x _ { 2 }$ $\textstyle , \ldots , x _ { n } \in { \mathcal { X } }$ . We say $z$ is $\epsilon$ -independent of $\{ x _ { 1 } , x _ { 2 } , \ldots , x _ { n } \}$ with respect to $\mathcal { G }$ if there exist $g _ { 1 } , g _ { 2 } \in \mathcal { G }$ such that $\begin{array} { r } { \sqrt { \sum _ { i = 1 } ^ { n } ( g _ { 1 } ( x _ { i } ) - g _ { 2 } ( x _ { i } ) ) ^ { 2 } } \le \epsilon } \end{array}$ , but $g _ { 1 } ( z ) - g _ { 2 } ( z ) > \epsilon .$ .
131
+
132
+ Intuitively, $z$ is independent of $\{ x _ { 1 } , x _ { 2 } , \ldots , x _ { n } \}$ means if that there exist two “certifying” functions $g _ { 1 }$ and $g _ { 2 }$ , so that their function values are similar at all points $\{ x _ { i } \} _ { i = 1 } ^ { n }$ , but the values are rather different at $z$ . This independence relation naturally induces the following complexity measure.
133
+
134
+ Definition 5 (Eluder dimension). Let $\mathcal { G }$ be a function class defined on $\mathcal { X }$ . The Eluder dimension $\mathrm { d i m } _ { \mathrm { E } } ( \mathcal { G } , \epsilon )$ is the length of the longest sequence $\{ x _ { 1 } , \ldots , x _ { n } \} \subset { \mathcal { X } }$ such that there exists $\epsilon ^ { \prime } \geq \epsilon$ where $x _ { i }$ is $\epsilon ^ { \prime }$ -independent of $\{ x _ { 1 } , \dots , x _ { i - 1 } \}$ for all $i \in [ n ]$ .
135
+
136
+ Recall that a vector space has dimension $d$ if and only if $d$ is the length of the longest sequence of elements $\{ x _ { 1 } , \ldots , x _ { d } \}$ such that $x _ { i }$ is linearly independent of $\{ x _ { 1 } , \dotsc , x _ { i - 1 } \}$ for all $i \in [ n ]$ . Eluder dimension generalizes the linear independence relation in standard vector space to capture both nonlinear independence and approximate independence, and thus is more general.
137
+
138
+ # 3 Bellman Eluder Dimension
139
+
140
+ In this section, we introduce our new complexity measure—Bellman Eluder (BE) dimension. As one of its most important properties, we will show that the family of problems with low BE dimension contains the two existing most general tractable problem classes in RL—problems with low Bellman rank, and problems with low Eluder dimension (see Figure 1).
141
+
142
+ We start by developing a new distributional version of the original Eluder dimension proposed by Russo and Van Roy [18] (see Section 2.2 for more details).
143
+
144
+ Definition 6 ( $\epsilon$ -independence between distributions). Let $\mathcal { G }$ be a function class defined on $\mathcal { X }$ , and $\nu , \mu _ { 1 } , \ldots , \mu _ { n }$ be probability measures over $\mathcal { X }$ . We say $\nu$ is $\epsilon$ -independent of $\{ \mu _ { 1 } , \mu _ { 2 } , \ldots , \mu _ { n } \}$ with respect to $\mathcal { G }$ if there exists $g \in { \mathcal { G } }$ such that $\begin{array} { r } { \sqrt { \sum _ { i = 1 } ^ { n } ( { \mathbb E } _ { \mu _ { i } } [ g ] ) ^ { 2 } } \le \epsilon } \end{array}$ , but $\begin{array} { r } { \left| \mathbb { E } _ { \nu } [ g ] \right| > \epsilon } \end{array}$ .
145
+
146
+ Definition 7 (Distributional Eluder (DE) dimension). Let $\mathcal { G }$ be a function class defined on $\mathcal { X }$ , and $\Pi$ be a family of probability measures over $\mathcal { X }$ . The distributional Eluder dimension $\dim _ { \mathrm { D E } } ( { \mathcal { G } } , \Pi , \epsilon )$ is the length of the longest sequence $\{ \rho _ { 1 } , \ldots , \rho _ { n } \} \subset \Pi$ such that there exists $\epsilon ^ { \prime } \geq \epsilon$ where $\rho _ { i }$ is $\epsilon ^ { \prime }$ -independent of $\{ \rho _ { 1 } , . . . , \rho _ { i - 1 } \}$ for all $i \in [ n ]$ .
147
+
148
+ Definition 6 and Definition 7 generalize Definition 4 and Definition 5 to their distributional versions, by inspecting the expected values of functions instead of the function values at points, and by restricting the candidate distributions to a certain family $\Pi$ . The main advantage of this generalization is exactly in the statistical setting, where estimating the expected values of functions with respect to a certain distribution family can be easier than estimating function values at each point (which is the case for RL in large state spaces).
149
+
150
+ It is clear that the standard Eluder dimension is a special case of the distributional Eluder dimension, because if we choose $\Pi = \{ \delta _ { x } ( \cdot ) \mid x \in \mathcal { X } \}$ where $\delta _ { x } ( \cdot )$ is the dirac measure centered at $x$ , then $\dim _ { \operatorname { E } } ( { \mathcal { G } } , \epsilon ) = \dim _ { \operatorname { D E } } ( { \mathcal { G } } - { \mathcal { G } } , \Pi , \epsilon )$ where ${ \mathcal { G } } - { \mathcal { G } } = \{ g _ { 1 } - g _ { 2 } : g _ { 1 } , g _ { 2 } \in { \mathcal { G } } \}$ .
151
+
152
+ Now we are ready to introduce the key notion in this paper—Bellman Eluder dimension.
153
+
154
+ Definition 8 (Bellman Eluder (BE) dimension). Let $( I - \mathcal { T } _ { h } ) \mathcal { F } { : = } \{ f _ { h } - \mathcal { T } _ { h } f _ { h + 1 } : \mathrm { ~ } f \in \mathcal { F } \}$ be the set of Bellman residuals induced by $\mathcal { F }$ at step $h$ , and $\dot { \Pi } = \{ \Pi _ { h } \} _ { h = 1 } ^ { H }$ be a collection of $H$ probability measure families over $s \times { \mathcal { A } }$ . The $\epsilon$ -Bellman Eluder of $\mathcal { F }$ with respect to $\Pi$ is defined as
155
+
156
+ $$
157
+ \dim _ { \mathrm { B E } } ( { \mathcal F } , \Pi , \epsilon ) : = \operatorname* { m a x } _ { h \in [ H ] } \dim _ { \mathrm { D E } } \big ( ( I - { \mathcal T } _ { h } ) { \mathcal F } , \Pi _ { h } , \epsilon \big ) .
158
+ $$
159
+
160
+ Remark 9 (Q-type v.s. V-type). Definition 8 is based on the Bellman residuals functions that take a state-action pair as input, thus referred to as $Q$ -type $B E$ dimension. Alternatively, one can define $V -$ type BE dimension using a different set of Bellman residual functions that depend on states only (see Appendix $B$ ). We focus on $Q$ -type in the main paper, and present the results for $V .$ -type in Appendix B. Both variants are important, and they include different sets of examples (see Appendix B, C).
161
+
162
+ In short, Bellman Eluder dimension is simply the distributional Eluder dimension on the function class of Bellman residuals, maximizing over all steps. In addition to function class $\mathcal { F }$ and error $\epsilon$ , Bellman Eluder dimension also depends on the choice of distribution family $\Pi$ . For the purpose of this paper, we focus on the following two specific choices.
163
+
164
+ 1. $\mathcal { D } _ { \mathcal { F } } : = \{ \mathcal { D } _ { \mathcal { F } , h } \} _ { h \in [ H ] }$ , where $\mathcal { D } _ { \mathcal { F } , h }$ denotes the collection of all probability measures over $\boldsymbol { S } \times \boldsymbol { A }$ at the $h ^ { \mathrm { t h } }$ step, which can be generated by executing the greedy policy $\pi _ { f }$ induced by any $f \in { \mathcal { F } }$ , i.e., $\bar { \pi } _ { f , h } ( \cdot ) = \mathrm { a r g m a } \bar { \mathrm { x } } _ { a \in \mathcal { A } } f _ { h } ( \cdot , \bar { a } )$ for all $h \in [ H ]$ . 2. $\mathcal { D } _ { \Delta } : = \{ \mathcal { D } _ { \Delta , h } \} _ { h \in [ H ] }$ , where ${ \mathcal { D } } _ { \Delta , h } = \{ \delta _ { ( s , a ) } ( \cdot ) | s \in S , a \in { \mathcal { A } } \}$ , i.e., the collections of probability measures that put measure 1 on a single state-action pair.
165
+
166
+ We say a RL problem has low BE dimension if $\begin{array} { r } { \operatorname* { m i n } _ { \Pi \in \{ \mathcal { D } _ { \mathcal { F } } , \mathcal { D } _ { \Delta } \} } \mathrm { d i m } _ { \mathrm { B E } } ( \mathcal { F } , \Pi , \epsilon ) \mathrm { i s ~ s m a } } \end{array}$ ll.
167
+
168
+ # 3.1 Relations with known tractable classes of RL problems
169
+
170
+ Known tractable problem classes in RL include but not limited to tabular MDPs, linear MDPs [7], linear quadratic regulators [9], generalized linear MDPs [6], kernel MDPs (Appendix C), reactive POMDPs [16], reactive PSRs [46, 1]. There are two existing generic tractable problem classes that jointly contain all the examples mentioned above: the set of RL problems with low Bellman rank, and the set of RL problems with low Eluder dimension. However, for these two generic sets, one does not contain the other.
171
+
172
+ In this section, we will show that our new class of RL problems with low BE dimension in fact contains both low Bellman rank problems and low Eluder dimension problems (see Figure 1). That is, our new problem class covers almost all existing tractable RL problems, and to our best knowledge, is the most generic tractable function class so far.
173
+
174
+ Relation with low Bellman rank The seminal paper by Jiang et al. [1] proposes the complexity measure—Bellman rank, and shows that a majority of RL examples mentioned above have low Bellman rank. They also propose a hypothesis elimination based algorithm—OLIVE, that learns any low Bellman rank problem within polynomial samples. Formally,
175
+
176
+ Definition 10 (Bellman rank). The Bellman rank is the minimum integer $d$ so that there exists $\phi _ { h }$ : $\mathcal { F } \mathbb { R } ^ { d }$ and $\psi _ { h } : \mathcal { F } \mathbb { R } ^ { d }$ for each $h \in [ H ]$ , such that for any $f , f ^ { \prime } \in \mathcal { F }$ , the average Bellman error.
177
+
178
+ $$
179
+ \mathcal { E } ( f , \pi _ { f ^ { \prime } } , h ) : = \mathbb { E } _ { \pi _ { f ^ { \prime } } } [ ( f _ { h } - \mathcal { T } _ { h } f _ { h + 1 } ) ( s _ { h } , a _ { h } ) ] = \langle \phi _ { h } ( f ) , \psi _ { h } ( f ^ { \prime } ) \rangle ,
180
+ $$
181
+
182
+ where $\| \phi _ { h } ( f ) \| _ { 2 } \cdot \| \psi _ { h } ( f ^ { \prime } ) \| _ { 2 } \leq \zeta$ , and $\zeta$ is the normalization parameter.
183
+
184
+ We remark that similar to Bellman Eluder dimension, Bellman rank also has two variants—Q-type (Definition 10) and $\mathrm { V } .$ -type (see Appendix B). Recall that we use $\pi _ { f }$ to denote the greedy policy induced by value function $f$ . Intuitively, a problem with Bellman rank says its average Bellman error can be decomposed as the inner product of two $d$ -dimensional vectors, where one vector depends on the roll-in policy $\pi _ { f ^ { \prime } }$ , while the other vector depends on the value function $f$ . At a high level, it claims that the average Bellman error has a linear inner product structure.
185
+
186
+ Proposition 11 (low Bellman rank $\subset$ low BE dimension). If an MDP with function class $\mathcal { F }$ has Bellman rank $d$ with normalization parameter $\zeta ,$ , then
187
+
188
+ $$
189
+ \dim _ { \mathrm { B E } } ( \mathcal { F } , \mathcal { D } _ { \mathcal { F } } , \epsilon ) \leq \mathcal { O } ( 1 + d \log ( 1 + \zeta / \epsilon ) ) .
190
+ $$
191
+
192
+ Proposition 11 claims that problems with low Bellman rank also have low BE dimension, with a small multiplicative factor that is only logarithmic in $\zeta$ and $\epsilon ^ { - 1 }$ .
193
+
194
+ Relation with low Eluder dimension Wang et al. [17] study the setting where the function class $\mathcal { F }$ has low Eluder dimension, which includes generalized linear functions. They prove that, when the completeness assumption is satisfied,3 low Eluder dimension problems can be efficiently learned in polynomial samples.
195
+
196
+ Proposition 12 (low Eluder dimension $\subset$ low BE dimension). Assume $\mathcal { F }$ satisfies completeness (Assumption 2). Then for all $\epsilon > 0$ ,
197
+
198
+ $$
199
+ \dim _ { \mathrm { B E } } \left( { \mathcal { F } } , { \mathcal { D } } _ { \Delta } , \epsilon \right) \leq \operatorname* { m a x } _ { h \in \left[ H \right] } \dim _ { \mathrm { E } } ( { \mathcal { F } } _ { h } , \epsilon ) .
200
+ $$
201
+
202
+ Proposition 12 asserts that problems with low Eluder dimension also have low BE dimension, which is a natural consequence of completeness and the fact that Eluder dimension is a special case of distributional Eluder dimension.
203
+
204
+ Finally, we show that the set of low BE dimension problems is strictly larger than the union of low Eluder dimension problems and low Bellman rank problems.
205
+
206
+ Proposition 13 (low BE dimension $\nless$ low Eluder dimension ∪ low Bellman rank). For any $m ~ \in ~ \mathbb { N } ^ { + }$ , there exists an MDP and a function class $\mathcal { F }$ so that for all $\epsilon ~ \in ~ ( 0 , 1 ]$ , we have $\dim _ { \mathrm { B E } } ( { \mathcal F } , { \mathcal D } _ { { \mathcal F } } , \epsilon ) = \dim _ { \mathrm { B E } } ( { \mathcal F } , { \mathcal D } _ { \Delta } , \epsilon ) \ \leq \ 5 ,$ , but ${ \mathrm { m i n } } \{ { \mathrm { m i n } } _ { h \in [ H ] }$ $\dim _ { \operatorname { E } } ( { \mathcal { F } } _ { h } , \epsilon )$ , Bellman $\mathrm { r a n k } \} \geq$ $m$ .
207
+
208
+ In particular, the family of low BE dimension includes new examples such as kernel reactive POMDPs (Appendix C), which can not be addressed by the framework of either Bellman rank or Eluder dimension.
209
+
210
+ 1: Initialize: $\mathcal { D } _ { 1 } , . . . , \mathcal { D } _ { H } \emptyset$ , $B ^ { 0 } { \mathcal { F } }$ .
211
+ 2: for episode $k$ from 1 to $K$ do
212
+ 3: Choose policy $\pi ^ { k } = \pi _ { f ^ { k } }$ , where $f ^ { k } = \operatorname { a r g m a x } _ { f \in { \mathcal { B } } ^ { k - 1 } } f { \big ( } s _ { 1 } , \pi _ { f } { \big ( } s _ { 1 } { \big ) } { \big ) }$ .
213
+ 4: Collect a trajectory $\left( s _ { 1 } , a _ { 1 } , r _ { 1 } , \dots , s _ { H } , a _ { H } , r _ { H } , s _ { H + 1 } \right)$ by following $\pi ^ { k }$ .
214
+ 5: Augment $\mathcal { D } _ { h } = \mathcal { D } _ { h } \cup \left\{ \left( s _ { h } , a _ { h } , r _ { h } , s _ { h + 1 } \right) \right\}$ for all $h \in [ H ]$ .
215
+ 6: Update
216
+ $\begin{array} { r l } & { \mathbf { \Phi } ^ { \mathrm { t e } } } \\ & { \quad \mathcal { B } ^ { k } = \left\{ f \in \mathcal { F } : \mathcal { L } _ { \mathcal { D } _ { h } } ( f _ { h } , f _ { h + 1 } ) \leq \displaystyle \operatorname* { i n f } _ { g \in \mathcal { G } _ { h } } \mathcal { L } _ { \mathcal { D } _ { h } } ( g , f _ { h + 1 } ) + \beta \mathrm { ~ f o r ~ a l l ~ } h \in [ H ] \right\} , } \\ & { \quad \quad \mathrm { w h e r e ~ } \mathcal { L } _ { \mathcal { D } _ { h } } ( \xi _ { h } , \zeta _ { h + 1 } ) = \displaystyle \sum _ { ( s , a , r , s ^ { \prime } ) \in \mathcal { D } _ { h } } \left[ \xi _ { h } ( s , a ) - r - \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } \zeta _ { h + 1 } ( s ^ { \prime } , a ^ { \prime } ) \right] ^ { 2 } . } \end{array}$
217
+
218
+ 7: Output $\pi ^ { \mathrm { { o u t } } }$ sampled uniformly at random from $\{ \pi ^ { k } \} _ { k = 1 } ^ { K }$
219
+
220
+ # 4 Algorithm GOLF
221
+
222
+ Section 3 defines a new class of RL problems with low BE dimension, and shows that the new class is rich, containing almost all the existing known tractable RL problems so far. In this section, we propose a new simple optimization-based algorithm—Global Optimism based on Local Fitting (GOLF). We prove that, low BE dimension problems are indeed tractable, i.e., GOLF can find nearoptimal policies for these problems within a polynomial number of samples.
223
+
224
+ At a high level, GOLF can be viewed as an optimistic version of the classic algorithm—Fitted QIteration (FQI) [42]. GOLF generalizes the ELEANOR algorithm [8] from the special linear setting to the general setting with arbitrary function classes.
225
+
226
+ The pseudocode of GOLF is given in Algorithm 1. GOLF initializes datasets $\{ \mathcal { D } _ { h } \} _ { h = 1 } ^ { H }$ to be empty sets, and confidence set $B ^ { 0 }$ to be $\mathcal { F }$ . Then, in each episode, GOLF performs two main steps:
227
+
228
+ • Line 3 (Optimistic planning): compute the most optimistic value function $f ^ { k }$ from the confidence set $B ^ { k - 1 }$ constructed in the last episode , and choose $\pi ^ { k }$ to be its greedy policy. • Line 4-6 (Execute the policy and update the confidence set): execute policy $\pi ^ { k }$ for one episode, collect data, and update the confidence set using the new data.
229
+
230
+ At the heart of GOLF is the way we construct the confidence set $B ^ { k }$ . For each $h \in [ H ]$ , GOLF maintains a local regression constraint using the collected transition data $\mathcal { D } _ { h }$ at this step
231
+
232
+ $$
233
+ \mathcal { L } _ { \mathcal { D } _ { h } } ( f _ { h } , f _ { h + 1 } ) \leq \operatorname* { i n f } _ { g \in \mathcal { G } _ { h } } \mathcal { L } _ { \mathcal { D } _ { h } } ( g , f _ { h + 1 } ) + \beta ,
234
+ $$
235
+
236
+ where $\beta$ is a confidence parameter, and $\mathcal { L } _ { \mathcal { D } _ { h } }$ is the squared loss defined in (2), which can be viewed as a proxy to the squared Bellman error at step $h$ . We remark that FQI algorithm [42] simply updates $\begin{array} { r } { \dot { f _ { h } } \gets \operatorname * { a r g m i n } _ { \phi \in \mathcal { F } _ { h } } \mathcal { L } _ { \mathcal { D } _ { h } } ( \phi , f _ { h + 1 } ) } \end{array}$ . Our constraint (3) can be viewed as a relaxed version of this update, which allows $f _ { h }$ to be not only the minimizer of the loss $\mathcal { L } _ { \mathcal { D } _ { h } } ( \cdot , f _ { h + 1 } )$ , but also any function whose loss is only slightly larger than the optimal loss over the auxiliary function class $\mathcal { G } _ { h }$ .
237
+
238
+ We remark that in general, the optimization problem in Line 3 of GOLF can not be solved computationally efficiently.
239
+
240
+ # 4.1 Theoretical guarantees
241
+
242
+ In this subsection, we present the theoretical guarantees for GOLF, which hold under Assumption 1 (realizability) and the following generalized completeness assumption introduced in [47, 21]. Let $\mathcal { G } = \mathcal { G } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { G } _ { H }$ be an auxiliary function class provided to the learner where each ${ \mathcal { G } } _ { h } \subseteq ( S \times { \mathcal { A } } \to$ $[ 0 , 1 ] )$ . Generalized completeness requires the auxiliary function class $\mathcal { G }$ to be rich enough so that applying Bellman operator to any function in the primary function class $\mathcal { F }$ will end up in $\mathcal { G }$ .
243
+
244
+ Assumption 14 (Generalized completeness). $\mathcal T _ { h } \mathcal F _ { h + 1 } \subseteq \mathcal G _ { h }$ for all $h \in [ H ]$ .
245
+
246
+ If we choose $\mathcal { G } = \mathcal { F }$ , then Assumption 14 is equivalent to the standard completeness assumption (Assumption 2). Now, we are ready to present the main theorem for GOLF.
247
+
248
+ Theorem 15 (Regret of GOLF). Under Assumption $^ { l }$ , 14, there exists an absolute constant c such that for any $\delta \in ( 0 , 1 ]$ , $K \in \mathbb N$ , if we choose parameter $\beta = c \log [ \mathcal { N _ { F \cup \mathcal { G } } } ( 1 / K ) \cdot K H / \delta ]$ in GOLF, then with probability at least $1 - \delta$ , for all $k \in [ K ]$ , we have
249
+
250
+ $$
251
+ \mathrm { R e g } ( k ) = \sum _ { t = 1 } ^ { k } \Big [ V _ { 1 } ^ { \star } \big ( s _ { 1 } \big ) - V _ { 1 } ^ { \pi ^ { t } } \big ( s _ { 1 } \big ) \Big ] \leq \mathcal { O } ( H \sqrt { d k \beta } ) ,
252
+ $$
253
+
254
+ where $\begin{array} { r } { d = \operatorname* { m i n } _ { \Pi \in \{ \mathcal { D } _ { \Delta } , \mathcal { D } _ { \mathcal { F } } \} } \mathrm { d i m } _ { \mathrm { B E } } \left( \mathcal { F } , \Pi , 1 / \sqrt { K } \right) } \end{array}$ is the BE dimension.
255
+
256
+ Theorem 15 asserts that, under the realizability and completeness assumptions, the general class of RL problems with low BE dimension is indeed tractable: there exists an algorithm (GOLF) that can achieve $\sqrt { K }$ regret, whose multiplicative factor depends only polynomially on the horizon of MDP $H$ , the BE dimension $d$ , and the log covering number of the two function classes. Most importantly, the regret is independent of the number of the states, which is crucial for dealing with practical RL problems with function approximation, where the state spaces are typically exponentially large.
257
+
258
+ We remark that when function class ${ \mathcal { F } } \cup { \mathcal { G } }$ has finite number of elements, its covering number is upper bounded by its cardinality $| { \mathcal { F } } \cup { \mathcal { G } } |$ . For a wide range of function classes in practice, the log $\epsilon ^ { \prime }$ -covering number has only logarithmic dependence on $\epsilon ^ { \prime }$ . Informally, we denote the log covering number as $\log \mathcal { N } _ { \mathcal { F } \cup \mathcal { G } }$ and omit its $\epsilon ^ { \prime }$ dependency for clean presentation. Theorem 15 claims that the regret scales as $\tilde { \mathcal { O } } ( H \sqrt { d K \log \mathcal { N _ { F \cup \mathcal { G } } } } )$ , where $\bar { \tilde { \mathcal { O } } } ( \cdot )$ omits absolute constants and logarithmic terms.4
259
+
260
+ By the standard online-to-batch argument, we also derive the sample complexity of GOLF.
261
+
262
+ Corollary 16 (Sample Complexity of GOLF). Under Assumption 1, 2, there exists an absolute constant c such that for any $\epsilon \in ( 0 , 1 ] ,$ , if we choose $\beta = c \log [ \mathcal { N _ { F \cup \mathcal { G } } } ( \epsilon ^ { 2 } / ( d H ^ { 2 } ) ) \cdot H K ]$ in GOLF, then the output policy $\pi ^ { o u t }$ is $\mathcal { O } ( \epsilon )$ -optimal with probability at least $1 / 2 , i f$
263
+
264
+ $$
265
+ K \geq \Omega \left( \frac { H ^ { 2 } d } { \epsilon ^ { 2 } } \cdot \log \left[ \mathcal { N } _ { \mathcal { F } \cup \mathcal { G } } \left( \frac { \epsilon ^ { 2 } } { H ^ { 2 } d } \right) \cdot \frac { H d } { \epsilon } \right] \right) ,
266
+ $$
267
+
268
+ where $\begin{array} { r } { d = \operatorname* { m i n } _ { \Pi \in \{ \mathcal { D } _ { \Delta } , \mathcal { D } _ { \mathcal { F } } \} } \mathrm { d i m } _ { \mathrm { B E } } \left( \mathcal { F } , \Pi , \epsilon / H \right) } \end{array}$ is the BE dimension.
269
+
270
+ Corollary 16 claims that $\tilde { \mathcal { O } } ( H ^ { 2 } d \log ( \mathcal { N } _ { \mathcal { F } \cup \mathcal { G } } ) / \epsilon ^ { 2 } )$ samples are enough for GOLF to learn a nearoptimal policy of any low BE dimension problem. Our sample complexity scales linear in both the BE dimension $d$ , and the log covering number $\log ( \mathcal { N } _ { \mathcal { F } \cup \mathcal { G } } )$ .
271
+
272
+ To showcase the sharpness of our results, we compare them to the previous results when restricted to the corresponding settings. (1) For linear function class with ambient dimension $d _ { \mathrm { l i n } }$ , we have√ BE dimension $d = \mathcal { \tilde { O } } ( d _ { \mathrm { l i n } } )$ and $\log ( \mathcal { N _ { F \cup \mathcal { G } } } ) = \tilde { \mathcal { O } } ( d _ { \mathrm { l i n } } )$ . Our regret bound becomes $\tilde { \mathcal { O } } ( H d _ { \mathrm { l i n } } \sqrt { K } )$ which matches the best known result [8] up to logarithmic factors; (2) For function class with low Eluder dimension [17], our results hold under weaker completeness assumptions. Our regret scales√ with $\sqrt { d _ { \mathrm { E } } }$ in terms of dependency on Eluder dimension $d _ { \mathrm { E } }$ , which improves the linear $d _ { \mathrm { E } }$ scaling in the regret of [17]; (3) Finally, for low Bellman rank problems, our sample complexity scales linearly with Bellman rank, which improves upon the quadratic dependence in [1]. We remark that all results mentioned above assume (approximate) realizability. All except [1] assume (approximate) completeness.
273
+
274
+ # 4.2 Key ideas in proving Theorem 15
275
+
276
+ In this subsection, we present a brief proof sketch for the regret bound of GOLF. We defer all the details to Appendix E. For simplicity, we only discuss the case of choosing $\mathcal { D } _ { \mathcal { F } }$ as the distribution family $\Pi$ in the definition of Bellman Eluder dimension (Definition 8). The proof for using $\mathcal { D } _ { \Delta }$ as the distribution family follows from similar arguments.
277
+
278
+ Our proof strategy consists of three main steps.
279
+
280
+ Step 1: Prove optimism. We firstly show that, with high probability, the optimal value function $Q ^ { \star }$ indeed lies in the confidence set $B ^ { k }$ for all $k \in [ K ]$ (Lemma 40 in Appendix E.1), which is a natural consequence of martingale concentration and the properties of the confidence set we designed. Because of $Q ^ { \star } \in B ^ { k }$ , the optimistic planning step (Line 3) in GOLF guarantees that $V _ { 1 } ^ { \star } ( \mathsf { \bar { s } } _ { 1 } ) \leq \operatorname* { m a x } _ { a } f _ { 1 } ^ { k } ( s _ { 1 } , \mathsf { \bar { a } } )$ for every episode $k$ . This optimism allows the following upper bound on regret
281
+
282
+ $$
283
+ \mathrm { R e g } ( K ) \leq \sum _ { k = 1 } ^ { K } \left( \operatorname* { m a x } _ { a } f _ { 1 } ^ { k } ( s _ { 1 } , a ) - V _ { 1 } ^ { \pi ^ { k } } ( s _ { 1 } ) \right) = \sum _ { h = 1 } ^ { H } \sum _ { k = 1 } ^ { K } \mathbb { E } _ { \pi ^ { k } } \left[ ( f _ { h } ^ { k } - \mathcal { T } f _ { h + 1 } ^ { k } ) ( s _ { h } , a _ { h } ) \right] ,
284
+ $$
285
+
286
+ where the right equality follows from the standard policy loss decomposition (see, e.g., Lemma 1 in [1]), and $\mathbb { E } _ { \pi }$ denotes the expectation taken over sequence $( s _ { 1 } , a _ { 1 } , \dotsc , s _ { H } , a _ { H } )$ when executing policy $\pi$ .
287
+
288
+ Step 2: Utilize the sharpness of our confidence set. Recall that our construction of the confidence set in Line 6 of GOLF forces $f ^ { k }$ computed in episode $k$ to have a small loss $\mathcal { L } _ { \mathcal { D } _ { h } }$ , which is a proxy for empirical squared Bellman error under data $\mathcal { D } _ { h }$ . Since data $\mathcal { D } _ { h }$ in episode $k$ are collected by executing each $\pi ^ { i }$ for one episode for all $i < k$ , by standard martingale concentration arguments and the completeness assumption, we can show that with high probability (Lemma 39 in Appendix E.1)
289
+
290
+ $$
291
+ \sum _ { i = 1 } ^ { k - 1 } \mathbb { E } _ { \pi ^ { i } } \left[ ( f _ { h } ^ { k } - \mathcal { T } f _ { h + 1 } ^ { k } ) ( s _ { h } , a _ { h } ) \right] ^ { 2 } \leq \mathcal { O } ( \beta ) , \mathrm { ~ f o r ~ a l l ~ } ( k , h ) \in [ K ] \times [ H ] .
292
+ $$
293
+
294
+ Step 3: Establish relations between (4) and (5). So far, we want to upper-bound (4), while we know (5). We note that the RHS of (4) is very similar to the LHS of (5), except that the latter is the squared Bellman error, and the expectation is taken under previous policy $\pi ^ { i }$ for $i < k$ . To establish the connection between these two, it turns out that we need the Bellman Eluder dimension to be small. Concretely, we have the following lemma.
295
+
296
+ Lemma 17. Given a function class $\Phi$ defined on $\mathcal { X }$ with $| \phi ( x ) | \le 1$ for all $( \phi , x ) \in \Phi \times \mathcal { X }$ , and $a$ family of probability measures $\Pi$ over $\mathcal { X }$ . Suppose sequence $\{ \phi _ { k } \} _ { k = 1 } ^ { K } \subset \dot { \Phi }$ and $\{ \mu _ { k } \} _ { k = 1 } ^ { K } \subset \Pi$ satisfy that for all $k \in [ K ] ,$ , $\begin{array} { r } { \sum _ { i = 1 } ^ { k - 1 } ( \mathbb { E } _ { \mu _ { i } } [ \phi _ { k } ] ) ^ { 2 } \ : \leq \ : \beta } \end{array}$ . Then for all $k \in [ K ]$ , $\begin{array} { r } { \sum _ { i = 1 } ^ { k } | \mathbb { E } _ { \mu _ { i } } [ \phi _ { i } ] | \ \leq } \end{array}$ $\mathcal { O } ( \sqrt { \mathrm { d i m } _ { \mathrm { D E } } ( \Phi , \Pi , 1 / k ) \beta k } )$ .
297
+
298
+ Lemma 17 is a simplification of Lemma 41 in Appendix E, which is a modification of Lemma 2 in [18]. Intuitively, Lemma 17 can be viewed as an analogue of the pigeon-hole principle for DE dimension. Choose $\Phi$ to be the function class of Bellman residuals, and $\mu _ { k }$ to be the distribution under policy $\pi ^ { k }$ , we finish the proof.
299
+
300
+ # 5 Conclusion
301
+
302
+ In this paper, we propose a new complexity measure—Bellman Eluder (BE) dimension for reinforcement learning with function approximation. Our new complexity measure identifies a new rich class of RL problems that subsumes a majority of existing tractable problem classes in RL. We design a new optimization-based algorithm—GOLF, and provide a new analysis for algorithm OLIVE. Both algorithms show that the new rich class of RL problems we identified in fact can be learned within a polynomial number of samples. We hope our results shed light on the future research in finding the minimal structural assumptions that allow sample-efficient reinforcement learning.
303
+
304
+ # Acknowledgement
305
+
306
+ This work was partial supported by National Science Foundation Grant NSF-IIS-2107304.
307
+
308
+ References
309
+ [1] Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pages 1704–1713. PMLR, 2017.
310
+ [2] 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.5602, 2013.
311
+ [3] 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.
312
+ [4] Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013.
313
+ [5] 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.
314
+ [6] Yining Wang, Ruosong Wang, Simon S Du, and Akshay Krishnamurthy. Optimism in reinforcement learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019.
315
+ [7] Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pages 2137– 2143, 2020.
316
+ [8] Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error. arXiv preprint arXiv:2003.00153, 2020.
317
+ [9] Brian DO Anderson and John B Moore. Optimal control: linear quadratic methods. Courier Corporation, 2007.
318
+ [10] Maryam Fazel, Rong Ge, Sham Kakade, and Mehran Mesbahi. Global convergence of policy gradient methods for the linear quadratic regulator. In International Conference on Machine Learning, pages 1467–1476. PMLR, 2018.
319
+ [11] Sarah Dean, Horia Mania, Nikolai Matni, Benjamin Recht, and Stephen Tu. On the sample complexity of the linear quadratic regulator. Foundations of Computational Mathematics, pages 1–47, 2019.
320
+ [12] Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
321
+ [13] 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.
322
+ [14] Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm. Machine learning, 2(4):285–318, 1988.
323
+ [15] Alexander Rakhlin, Karthik Sridharan, and Ambuj Tewari. Online learning: Random averages, combinatorial parameters, and learnability. 2010.
324
+ [16] Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Pac reinforcement learning with rich observations. arXiv preprint arXiv:1602.02722, 2016.
325
+ [17] Ruosong Wang, Ruslan Salakhutdinov, and Lin F Yang. Provably efficient reinforcement learning with general value function approximation. arXiv preprint arXiv:2005.10804, 2020.
326
+ [18] Daniel Russo and Benjamin Van Roy. Eluder dimension and the sample complexity of optimistic exploration. In Advances in Neural Information Processing Systems, pages 2256–2264, 2013.
327
+ [19] Csaba Szepesvari and R ´ emi Munos. Finite time bounds for sampling based fitted value it- ´ eration. In Proceedings of the 22nd international conference on Machine learning, pages 880–887, 2005.
328
+ [20] Remi Munos and Csaba Szepesv ´ ari. Finite-time bounds for fitted value iteration. ´ Journal of Machine Learning Research, 9(May):815–857, 2008.
329
+ [21] Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. arXiv preprint arXiv:1905.00360, 2019.
330
+ [22] Tengyang Xie and Nan Jiang. Batch value-function approximation with only realizability. arXiv preprint arXiv:2008.04990, 2020.
331
+ [23] Ronen I Brafman and Moshe Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research, 3(Oct):213–231, 2002.
332
+ [24] Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(4), 2010.
333
+ [25] Christoph Dann and Emma Brunskill. Sample complexity of episodic fixed-horizon reinforcement learning. In Advances in Neural Information Processing Systems, pages 2818–2826, 2015.
334
+ [26] Shipra Agrawal and Randy Jia. Optimistic posterior sampling for reinforcement learning: worst-case regret bounds. In Advances in Neural Information Processing Systems, pages 1184– 1194, 2017.
335
+ [27] Mohammad Gheshlaghi Azar, Ian Osband, and Remi Munos. Minimax regret bounds for ´ reinforcement learning. arXiv preprint arXiv:1703.05449, 2017.
336
+ [28] Andrea Zanette and Emma Brunskill. Tighter problem-dependent regret bounds in reinforcement learning without domain knowledge using value function bounds. arXiv preprint arXiv:1901.00210, 2019.
337
+ [29] Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is q-learning provably efficient? In Advances in Neural Information Processing Systems, pages 4863–4873, 2018.
338
+ [30] Zihan Zhang, Yuan Zhou, and Xiangyang Ji. Almost optimal model-free reinforcement learning via reference-advantage decomposition. arXiv preprint arXiv:2004.10019, 2020.
339
+ [31] Omar Darwiche Domingues, Pierre Menard, Emilie Kaufmann, and Michal Valko. Episodic ´ reinforcement learning in finite mdps: Minimax lower bounds revisited. In Algorithmic Learning Theory, pages 578–598. PMLR, 2021.
340
+ [32] Qi Cai, Zhuoran Yang, Chi Jin, and Zhaoran Wang. Provably efficient exploration in policy optimization. arXiv preprint arXiv:1912.05830, 2019.
341
+ [33] Andrea Zanette, Alessandro Lazaric, Mykel J Kochenderfer, and Emma Brunskill. Provably efficient reward-agnostic navigation with linear value iteration. Advances in Neural Information Processing Systems, 33, 2020.
342
+ [34] Alekh Agarwal, Sham Kakade, Akshay Krishnamurthy, and Wen Sun. Flambe: Structural complexity and representation learning of low rank mdps. Advances in Neural Information Processing Systems, 33, 2020.
343
+ [35] Gergely Neu and Ciara Pike-Burke. A unifying view of optimism in episodic reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
344
+ [36] Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Modelbased rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on Learning Theory, pages 2898–2933, 2019.
345
+ [37] Ian Osband and Benjamin Van Roy. Model-based reinforcement learning and the eluder dimension. In Advances in Neural Information Processing Systems, pages 1466–1474, 2014.
346
+ [38] Kefan Dong, Jian Peng, Yining Wang, and Yuan Zhou. Root-n-regret for learning in markov decision processes with function approximation and low bellman rank. In Conference on Learning Theory, pages 1554–1557. PMLR, 2020.
347
+ [39] Zhuoran Yang, Chi Jin, Zhaoran Wang, Mengdi Wang, and Michael I Jordan. Bridging exploration and general function approximation in reinforcement learning: Provably efficient kernel and neural value iterations. arXiv preprint arXiv:2011.04622, 2020.
348
+ [40] Dylan J Foster, Alexander Rakhlin, David Simchi-Levi, and Yunzong Xu. Instance-dependent complexity of contextual bandits and reinforcement learning: A disagreement-based perspective. arXiv preprint arXiv:2010.03104, 2020.
349
+ [41] Simon S Du, Sham M Kakade, Jason D Lee, Shachar Lovett, Gaurav Mahajan, Wen Sun, and Ruosong Wang. Bilinear classes: A structural framework for provable generalization in rl. arXiv preprint arXiv:2103.10897, 2021.
350
+ [42] Csaba Szepesvari. Algorithms for reinforcement learning. ´ Synthesis lectures on artificial intelligence and machine learning, 4(1):1–103, 2010.
351
+ [43] Martin L Puterman. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
352
+ [44] Gellert Weisz, Philip Amortila, and Csaba Szepesvari. Exponential lower bounds for ´ planning in mdps with linearly-realizable optimal action-value functions. arXiv preprint arXiv:2010.01374, 2020.
353
+ [45] Martin J Wainwright. High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge University Press, 2019.
354
+ [46] Satinder Singh, Michael James, and Matthew Rudary. Predictive state representations: A new theory for modeling dynamical systems. arXiv preprint arXiv:1207.4167, 2012.
355
+ [47] Andras Antos, Csaba Szepesv ´ ari, and R ´ emi Munos. Learning near-optimal policies with ´ bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89–129, 2008.
356
+ [48] Christoph Dann, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. On oracle-efficient pac rl with rich observations. In Advances in neural information processing systems, pages 1422–1432, 2018.
357
+ [49] Alekh Agarwal, Daniel Hsu, Satyen Kale, John Langford, Lihong Li, and Robert Schapire. Taming the monster: A fast and simple algorithm for contextual bandits. In International Conference on Machine Learning, pages 1638–1646, 2014.
md/train/cAvgPMAA3hb/cAvgPMAA3hb.md ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GRF: LEARNING A GENERAL RADIANCE FIELD FOR 3D SCENE REPRESENTATION AND RENDERING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We present a simple yet powerful implicit neural function that can represent and render arbitrarily complex 3D scenes in a single network only from 2D observations. The function models 3D scenes as a general radiance field, which takes a set of 2D images with camera poses and intrinsics as input, constructs an internal representation for each 3D point of the scene, and renders the corresponding appearance and geometry of any 3D point viewing from an arbitrary angle. The key to our approach is to explicitly integrate the principle of multi-view geometry to obtain the internal representations from observed 2D views, such that the learned implicit representations empirically remain multi-view consistent. In addition, we introduce an effective neural module to learn general features for each pixel in 2D images, allowing the constructed internal 3D representations to be general as well. Extensive experiments demonstrate the superiority of our approach.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Understanding the precise 3D structure of a real-world environment and realistically re-rendering it from free viewpoints is a key enabler for many critical tasks, ranging from robotic manipulation and navigation to augmented reality. Classic approaches to recover the 3D scene geometry mainly include the structure from motion (SfM) (Ozyesil et al., 2017) and simultaneous localization and mapping (SLAM) (Cadena et al., 2016) pipelines. However, they are limited to reconstruct sparse and discrete 3D point clouds which are unable to contain geometric details.
12
+
13
+ The recent advances in deep neural networks have yielded rapid progress in 3D modeling and understanding. Most of them focus on the explicit 3D shape representations such as voxel grids (Choy et al., 2016), point clouds (Fan et al., 2017), or triangle meshes (Wang et al., 2018). However, these representations are discrete and sparse, limiting the recovered 3D structures to extremely low spatial resolution. In addition, these networks usually require large-scale 3D shapes for supervision, resulting in the trained models being over-fitting particular datasets and unable to generalize to novel scenes. In fact, it is also costly and even infeasible to collect high-quality 3D labels.
14
+
15
+ Encoding geometries into multilayer perceptrons (MLPs) (Mescheder et al., 2019; Park et al., 2019) recently emerges as a promising direction in 3D reconstruction and understanding from 2D images. Its key advantage is the ability to model 3D structures in a continuous way instead of discrete, and therefore it has the potential to achieve unlimited spatial resolution in theory. However, most methods of this pipeline focus on individual objects. In addition, many of them require 3D geometry for supervision to learn the 3D shapes from images. By introducing a recurrent neural network based renderer, SRNs (Sitzmann et al., 2019) is among the early work to learn implicit surface representations only from 2D images, but it fails to capture complicated scene geometries and renders over-smoothed images. Alternatively, by leveraging the volume rendering to synthesize new views for 2D supervision, the very recent NeRF (Mildenhall et al., 2020) directly encodes the radiance fields of complex 3D scenes within the weights of MLPs, achieving an unprecedented level of fidelity for challenging 3D scenes. Nevertheless, it has two major limitations: 1) since each 3D scene is encoded into all the weights of MLPs, the trained network (i.e., a learned radiance field) can only represent a single scene, and is unable to generalize across novel scenarios; 2) because the shape and appearance of each spatial 3D location along a light ray is only optimized by the available pixel RGBs, the learned implicit representations of that location are lack of the general geometric patterns, resulting in the synthesized images being less photo-realistic.
16
+
17
+ In this paper, we propose a general radiance field (GRF), a simple yet powerful implicit function that can represent and render complex 3D scenes where there may be multiple objects with cluttered background. Our GRF takes a set of 2D images with camera poses and intrinsics, a 3D query point and its query viewpoint (i.e., the camera location $x y z )$ as input, and predicts the RGB value and volumetric density of that query point. Basically, this neural function learns to represent a 3D scene from sparse 2D observations, and infers the shape and appearance of that scene from previously unobserved viewing angles. Note that, the inferred shape and appearance of any particular 3D query point explicitly take into account its local geometric patterns from the available 2D observations. In particular, the proposed GRF consists of four components:
18
+
19
+ • Extracting the general 2D visual features for every light ray from the input 2D observations;
20
+ • Reprojecting the corresponding 2D features back to the query 3D point using the principle of multi-view geometry;
21
+ • Selecting and aggregating all the reprojected features for the query 3D point, while the visual occlusions are implicitly considered;
22
+ • Rendering the aggregated features of the query 3D point along a particular query viewpoint, and producing the corresponding RGB and volumetric density.
23
+
24
+ These four components enable our GRF to be significantly different from all existing 3D scene representation approaches. 1) Compared with the classic SfM/SLAM systems, our GRF can represent the 3D scene structure with smooth and continuous surfaces. 2) Compared with the neural approaches based on explicit voxel grids, point clouds and meshes, our GRF learns continuous 3D representations without requiring 3D data for training. 3) Compared with the existing implicit representation methods such as SDF (Park et al., 2019), SRNs (Sitzmann et al., 2019) and NeRF (Mildenhall et al., 2020), our GRF can represent arbitrarily complicated 3D scenes and has remarkable generalization to novel scenarios. In addition, the learned 3D representations carefully consider the general geometric patterns for every 3D spatial location, allowing the rendered views to be exceptionally realistic with fine-grained details. Our key contributions are:
25
+
26
+ • We propose a general radiance field to implicitly represent the 3D scene structure and appearance purely from 2D images. It has remarkable generalization to novel scenes in a single forward pass. • We explicitly integrate the principle of multi-view geometry to learn geometric details for each 3D query point along every query light ray. This allows the synthesized 2D views to be superior. • We demonstrate significant improvement over baselines on three large-scale datasets and provide intuition behind our design choices through extensive ablation studies.
27
+
28
+ # 2 RELATED WORK
29
+
30
+ Classic Multi-view Geometry. Classic approaches to reconstruct 3D geometry from images mainly include SfM and SLAM systems, which firstly extract and match hand-crafted geometric local features and then apply bundle adjustment for both shape and camera motion estimation (Hartley & Zisserman, 2004). Although they can recover visually satisfactory 3D models, the reconstructed shapes are usually sparse, discrete point clouds. In contrast, our GRF learns an implicit function to represent the continuous 3D structures from images. Notably, however, the principle of classic multi-view geometry is explicitly integrated into our GRF to learn accurate and general features for every spatial location.
31
+
32
+ Geometric Deep Learning. The recent advances of deep neural nets have yielded impressive progress in recovering explicit 3D shapes from either single or multiple images, including the voxel grid (Choy et al., 2016; Yang et al., 2019), octree (Riegler et al., 2017; Christian et al., 2017), point cloud (Fan et al., 2017; Qi et al., 2017) and triangle mesh (Wang et al., 2018; Groueix et al., 2018; Nash et al., 2020) based approaches. However, most of these methods only focus on individual 3D objects, whilst only few pipelines (Song et al., 2017; Tulsiani et al., 2018; Gkioxari et al., 2019) attempt to learn the structures for complex 3D scenes. Although these neural networks can predict realistic 3D structures of objects and scenes, they have two limitations. First, almost all of them require ground truth 3D labels to supervise the networks, resulting in the learned representations being unable to generalize to novel real-world scenes. Second, since the recovered 3D shapes are discrete, they are unable to preserve high-resolution geometric details. Being quite different, our GRF learns to infer continuous 3D shapes only from a set of 2D images with camera poses and intrinsics, which can be cheaply acquired and also allow better generalization across real-world scenes.
33
+
34
+ Neural Implicit 3D Representations. The implicit representation of 3D shapes recently emerges as a promising direction to recover 3D geometries. It is initially formulated as level sets by optimizing neural nets which map xyz locations to an occupancy field (Mescheder et al., 2019; Saito et al., 2019) or a distance function (Park et al., 2019). The subsequent work (Niemeyer et al., 2020; Sitzmann et al., 2019; Liu et al., 2019b; Atzmon & Lipman, 2020a;b) introduce differentiable rendering functions, allowing 2D images or raw 3D point clouds to supervise the networks, but only producing decent results on individual objects. Using neural radiance fields instead, the latest NeRF (Mildenhall et al., 2020) and the succeeding NSVF (Liu et al., 2020), NeRF-wild (Martin-Brualla et al., 2020), GRAF (Schwarz et al., 2020) demonstrate impressive results to represent complex 3D scenes. However, they do not take into account the local geometric patterns for spatial locations, thereby the rendered 2D images being less realistic and sub-optimal. Additionally, both NeRF and NeRF-wild can only represent a single scene, and are unable to generalize to novel scenarios. Uniquely, our GRF maps any set of images to the corresponding 3D scene structure with geometric details.
35
+
36
+ Novel View Synthesis and Neural Rendering. Novel view synthesis involves generating unseen views of a scene captured by multiple images. Existing methods usually learn an embedding of a scene and then estimate a new image given a viewing angle, including GAN based methods (Goodfellow et al., 2014; Radford et al., 2016), variational auto-encoders (Kingma & Welling, 2014), autoregressive models (Oord et al., 2016), and other generative frameworks (Eslami et al., 2018). Although photo-realistic single images can be generated, these methods tend to learn the manifold of 2D images, instead of exploiting the underlying 3D geometry for consistent multi-view synthesis.
37
+
38
+ Neural rendering techniques (Fried et al., 2020; Kato et al., 2020) have recently been actively investigated and integrated into 3D reconstruction pipelines, where there are no ground truth 3D data available but only 2D images for supervision. To render the discrete voxel grids (Yan et al., 2016; Rezende et al., 2016; Tulsiani et al., 2017), point clouds (Insafutdinov & Dosovitskiy, 2018), meshes (Kato et al., 2018; Chen et al., 2019; Liu et al., 2019a), and implicit surfaces (Liu et al., 2019b; Remelli et al., 2020), most of these techniques are designed with differentiable and approximate functions, but sacrifice the sharpness of synthesized images and the accuracy of estimated 3D shapes. By contrast, our GRF leverages the existing volume rendering method (Mildenhall et al., 2020) which is naturally differentiable and can accurately render the RGB per light ray.
39
+
40
+ # 3 GRF
41
+
42
+ # 3.1 OVERVIEW
43
+
44
+ Our GRF models the complex 3D scenes including the geometry and appearance as a neural function $f _ { \mathbf { W } }$ where W represent learnable parameters. This function takes a set of $M$ images together with their camera poses and intrinsics $\{ ( \mathcal { T } _ { 1 } , \pmb { \xi } _ { 1 } , \pmb { K } _ { 1 } ) \cdot \cdot \cdot ( \mathcal { T } _ { m } , \pmb { \xi } _ { m } , \pmb { K } _ { m } ) \cdot \cdot \cdot ( \mathcal { T } _ { M } , \pmb { \xi } _ { M } , \pmb { K } _ { M } ) \} _ { \{ \pmb { \xi } _ { 1 } , \pmb { \xi } _ { 1 } , \pmb { K } _ { 1 } \} }$ , which are sampled from a complex 3D scene, a query 3D point $p = \{ x _ { p } , y _ { p } , z _ { p } \}$ , and its query viewpoint $\mathcal { V } _ { p } = \{ x _ { p } ^ { v } , y _ { p } ^ { v } , z _ { p } ^ { v } \}$ as input, and then predicts the RGB value $\{ r _ { p } , g _ { p } , b _ { p } \}$ and the volumetric density $d _ { p }$ of that query 3D point $p$ observed from the query viewpoint $\gamma _ { p }$ . Formally, it is defined as below:
45
+
46
+ $$
47
+ ( r _ { p } , g _ { p } , b _ { p } , d _ { p } ) = f _ { \mathbf { W } } \left( \Big \{ ( \mathcal { T } _ { 1 } , \pmb { \xi } _ { 1 } , K _ { 1 } ) \cdot \cdot \cdot ( \mathcal { T } _ { M } , \pmb { \xi } _ { M } , K _ { M } ) \Big \} , \{ x _ { p } , y _ { p } , z _ { p } \} , \{ x _ { p } ^ { v } , y _ { p } ^ { v } , z _ { p } ^ { v } \} \right)
48
+ $$
49
+
50
+ Basically, this function is a general radiance field (GRF) which parameterizes arbitrary 3D scenes observed by the input $M$ images. In the meantime, it returns both the appearance and geometry, when being queried at any location $p$ from any viewpoint $\nu$ in 3D space.
51
+
52
+ As illustrated in Figure 1, the proposed GRF firstly extracts general features for each light ray hitting through every pixel, and then reprojects those features back to the query 3D point $p$ . After that, the corresponding RGB value and volumetric density of $p$ are inferred from those features given a specific query viewpoint. This simple design of GRF follows the principle of classic multi-view geometry (Hartley & Zisserman, 2004), therefore driving the learned implicit representations to be multi-view consistent. In particular, for any query 3D point in space, its features are always the same when being viewing from different angles. Hence, its rendered RGBs and volumetric densities are more likely to be consistent from different viewpoints. To realize our neural function $f _ { \mathbf { W } }$ , we introduce four components: 1) A feature extractor for every 2D pixel; 2) A reprojector to transform 2D features to 3D space; 3) An aggregator to obtain general features for a 3D point; and 4) A neural renderer to infer the appearance and geometry for that 3D point. All these components are connected and trained end-to-end with arbitrary scenes.
53
+
54
+ ![](images/56d1944f4d23a0a0a15e2089b674d2311f3342f1b49f441d770342b7eecce36d.jpg)
55
+ Figure 1: Overview of the proposed general radiance field.
56
+
57
+ # 3.2 EXTRACTING GENERAL FEATURES FOR 2D PIXELS
58
+
59
+ The whole input set of observed 2D images together describes the geometry and appearance of a 3D scene, while each pixel of those images describes a specific point of that scene. This module aims to extract the general features of each pixel, so to learn the regional description and geometric patterns for each light ray. A naive approach is to directly use the raw rgb values as the pixel features. However, this is sub-optimal because the raw rgb values are sensitive to lighting conditions, environmental noise, etc. In order to learn more general and robust patterns for each pixel, we turn to use a more powerful encoder-decoder based convolutional neural network (CNN). As shown in Figure 2, our CNN module is designed with the follow two features:
60
+
61
+ ![](images/b2e9605ba008f372de37a5ed751410ac325144fee0bb3ce35aceec07022d20bd.jpg)
62
+ Figure 2: The CNN module to extract pixel features.
63
+
64
+ • Instead of directly feeding raw RGB images into the CNN module, we stack (duplicate) the corresponding viewpoint, i.e., the xyz location of the camera, to each pixel of the image. This allows the learned pixel features to be explicitly aware of its relative position in the 3D scene space. Note that, we empirically find that stacking the additional camera rotation and intrinsics to each pixel does not noticeably improve the performance, especially for scenes centered at the origin. • We use skip connections between the encoder and decoder to preserve high frequency local features for each pixel, while optionally integrating a couple of fully connected (fc) layers in the middle of the CNN module to learn global features. The mixture of hierarchical features tends to to be more general and representative, effectively aiding the network in practice.
65
+
66
+ Details of the CNN module is presented in the appendix and all input images share the same CNN module. Note that, there are many ways to construct a pixel feature extractor, but identifying an optimal CNN module here is out the scope of this paper.
67
+
68
+ # 3.3 REPROJECTING 2D FEATURES TO 3D SPACE
69
+
70
+ Considering the extracted pixel features are a compact description of the light ray emitting from the camera center up to the 3D scene surface, we naturally reproject the pixel features back to the 3D space along the light ray. Since there are no depth scans paired with RGB images, it is impossible to determine which particular 3D surface point the pixel features belong to. In this module, we preliminarily regard the pixel features as the representation of every location along the light ray in 3D space. With this simple formulation, every 3D point can theoretically have a copy of its corresponding 2D pixel features from each 2D image. Formally, given a 3D point $p$ , an observed 2D view $\mathcal { I } _ { m }$ together with the camera pose $\xi _ { m }$ and the intrinsics $K _ { m }$ , the corresponding 2D pixel features $\mathbf { F } _ { p } ^ { m }$ is retrieved by the reprojection operation below:
71
+
72
+ $$
73
+ \mathbf { F } _ { p } ^ { m } = \mathcal { P } \Big ( \{ \boldsymbol { \mathcal { T } } _ { k } , \boldsymbol { \xi } _ { m } , K _ { m } \} , \{ x _ { p } , y _ { p } , z _ { p } \} , \mathbf { I } _ { m } \Big )
74
+ $$
75
+
76
+ where the function $\mathcal { P } ( )$ follows the principle of multi-view geometry (Hartley & Zisserman, 2004) and ${ \mathbf I } _ { m }$ represents the image features extracted by the CNN module in Section 3.2. However, since the pixels of 2D images are discrete and bounded within a certain spatial size, while the 3D points are continuous in the scene space, after the 3D point $p$ is projected to the plane of image $\mathcal { T } _ { m }$ , we apply two approximations to deal with the following issues.
77
+
78
+ • If the point lies inside of the image, we simply select the nearest pixel and duplicate its features to the 3D point. Note that, more advanced techniques may be applied to address the discretization issue, such as linear interpolation or designing a kernel function. • If the point lies outside of the image, we assign a zero vector to the 3D point, which means there is no information observed. In fact, we empirically find that the nearest interpretation can also achieve good performance, but it is only applicable for relatively small-scale scenes.
79
+
80
+ Overall, the above simple reprojection operation explicitly retains the extracted 2D pixel features back to 3D space via the principle of geometry, and the module is naturally differentiable.
81
+
82
+ # 3.4 OBTAINING GENERAL FEATURES FOR 3D POINTS
83
+
84
+ Given a query 3D point $p$ , it is able to retrieve a feature vector from each input image. However, given a set of input images, it is challenging to obtain a final feature vector for the point $p$ , because:
85
+
86
+ • The total number of input images for each 3D scene is variable and there is no order for images. As a consequence, the retrieved feature vectors are also unordered and have arbitrary size. • Since there are no depth scans paired with the input RGB images, it is unable to decide which feature vectors are the true descriptions of the query point due to visual occlusions. Ideally, these features can be aware of the relative distance to the query point and then selected automatically.
87
+
88
+ To tackle these critical issues, we formulate this problem as an attention aggregation process. In particular, given the query 3D point $p$ , its query viewpoint $\nu _ { p }$ , and the set of retrieved pixel features $\{ \mathbf { F } _ { p } ^ { 1 } \cdot \cdot \cdot \mathbf { F } _ { p } ^ { m } \cdot \cdot \cdot \mathbf { F } _ { p } ^ { M } \}$ :
89
+
90
+ • For each retrieved feature vector $\mathbf { F } _ { p } ^ { m }$ , we firstly use shared MLPs to integrate the information of query point $p$ , generating a new feature vector $\hat { \mathbf { F } } _ { p } ^ { m }$ which is aware of the relative distance to the query point $p$ . Formally, it is defined as: $\hat { \mathbf { F } } _ { p } ^ { m } = M L P s ( \mathbf { F } _ { p } ^ { m } \oplus [ x _ { p } , y _ { p } , z _ { p } ] ) , \quad ( \oplus \mathrm { m e a n s ~ c o n c a t e n a t i o n ~ i n ~ n e u r a l ~ n e t s } )$ (3)
91
+ • After obtaining the new set of position-aware features $\{ \hat { \mathbf { F } } _ { p } ^ { 1 } \cdot \cdot \cdot \hat { \mathbf { F } } _ { p } ^ { m } \cdot \cdot \cdot \hat { \mathbf { F } } _ { p } ^ { M } \}$ , we use the existing attention aggregation methods such as AttSets (Yang et al., 2020) and Slot Attention (Locatello et al., 2020) to compute a unique feature vector $\bar { \mathbf { F } } _ { p }$ for the query 3D point $p$ . Basically, the attention mechanism learns a unique weight for all input features and then aggregates them together. According to the theoretical analysis in (Yang et al., 2020) and (Locatello et al., 2020), the selected attention mechanisms are permutation invariant with regard to the input set of feature vectors and can process an arbitrary number of elements. Formally, it is defined as:
92
+
93
+ $$
94
+ \bar { \mathbf { F } } _ { p } = \mathcal { A } \big ( \hat { \mathbf { F } } _ { p } ^ { 1 } \cdot \cdot \cdot \hat { \mathbf { F } } _ { p } ^ { m } \cdot \cdot \cdot \hat { \mathbf { F } } _ { p } ^ { M } \big ) , \quad \mathrm { ( \mathcal { A } ~ i s ~ a n ~ e x i s t i n g ~ a t t e n t i o n ~ f u n c t i o n ) }
95
+ $$
96
+
97
+ Above all, for every query 3D point $p$ , its final features $\bar { \mathbf { F } } _ { p }$ explicitly preserve the general geometric patterns retrieved from the input 2D observations and are also made aware of the particular 3D point location within the scene space. This allows the 3D point features $\bar { \mathbf { F } } _ { p }$ to be general and representative for its own geometry and appearance.
98
+
99
+ # 3.5 RENDERING 3D FEATURES
100
+
101
+ With the learned features $\bar { \mathbf { F } } _ { p }$ for any query 3D point $p$ , this module aims to infer its volumetric density $d _ { p }$ in 3D space and the corresponding RGB values $\{ r _ { p } , g _ { p } , b _ { p } \}$ given the query viewpoint $\nu _ { p }$ . In particular, we exactly follow the simple MLP-based design of NeRF (Mildenhall et al., 2020) in the rendering process. As illustrated in Equation 5, the volumetric density $d _ { p }$ is modeled as a function of the point features $\bar { \mathbf { F } } _ { p }$ only. This allows the estimated density $d _ { p }$ at the query point $p$ to remain unchanged under different query viewpoints, thus maintaining consistent geometry for each point. The RGB is modeled as a function of both point features and the query viewpoint. Details of these MLPs refers to NeRF (Mildenhall et al., 2020).
102
+
103
+ $$
104
+ d _ { p } = M L P s ( \bar { \mathbf { F } } _ { p } ) , \qquad \quad ( r _ { p } , g _ { p } , b _ { p } ) = M L P s \Bigl ( \bar { \mathbf { F } } _ { p } , \{ x _ { p } ^ { v } , y _ { p } ^ { v } , z _ { p } ^ { v } \} \Bigr )
105
+ $$
106
+
107
+ To render the color of any query ray passing through the 3D scene, the classic volume rendering (Kajiya & Herzen, 1984) is applied and the integral is estimated by sampling a discrete set of 3D points along the query ray. In particular, we exactly follow the formulation of ray marching and the hierarchical sampling strategy in NeRF (Mildenhall et al., 2020). Eventually, novel 2D images can be directly synthesized from our GRF by querying light rays. This allows the entire network to be trainable only with a set of 2D images, without requiring 3D data.
108
+
109
+ # 3.6 IMPLEMENTATION
110
+
111
+ The proposed four modules are connected and trained end-to-end. In the implementation, details of the CNN module and the attention module for different experiments are presented in the appendix. In the neural rendering module, all the designs of neural layers and other settings simply follow NeRF (Mildenhall et al., 2020). In our network, all the 3D locations and RGB values are processed by the positional encoding proposed by NeRF (Mildenhall et al., 2020). The L2 loss between the rendered RGB and the ground truth is used to optimize the whole neural network. All these details are presented in the appendix.
112
+
113
+ # 4 EVALUATION
114
+
115
+ # 4.1 EXPERIMENTS ON SHAPENETV2 DATASET
116
+
117
+ Following the experimental settings of SRNs (Sitzmann et al., 2019), we firstly evaluate our GRF on the chair and car classes of ShapeNetv2. Particularly, the chair has 4612 objects for training, 662 for validation and 1317 for testing, while the car has 2151 objects for training, 352 for validation and 704 for testing. Each training object has randomly sampled 50 images with a resolution of $1 2 8 \times 1 2 8$ pixels. We conduct the following three groups of experiments.
118
+
119
+ • Group 1: Novel-view synthesis of seen objects in the training split of the same category. In particular, we train two separate models on the training split of chairs and cars, and these two models are separately tested on the trained objects to generate completely novel views. During testing, the model is fed with 50 trained views and infers another 251 novel views for evaluation. • Group 2: Novel-view synthesis of unseen objects in the testing split of the same category. The trained two models in Group 1 are tested on novel objects of the same category. During testing, the model is fed with 2 novel views of each novel object, inferring 251 novel views for evaluation. • Group 3: Similar to Group 2, but only 1 novel view is fed into the model for novel view synthesis.
120
+
121
+ Basically, the experiments of Group 1, 2 and 3 are exactly the same as in SRNs (Sitzmann et al., 2019) which is also the state of the art on this ShapeNetv2 dataset. Table 1 compares the quantitative results of our GRF and four baselines. Note that, the recent NeRF and NSVF are not scalable to learn large number of scenes simultaneously because each scene is encoded into the network parameters.
122
+
123
+ Analysis. 1) Our method outperforms SRNs on 50-view reconstruction, demonstrating the strong capability of our GRF for 3D scene representation. Figure 3 shows the qualitative results. 2) Our GRF lags behind SRNs for novel scene reconstruction in both Group 2 and 3. Fundamentally, this is because our GRF solves a much harder problem than SRNs. In particular, our network directly infers the novel scene representation in a single forward pass, while SRNs needs to be retrained on all novel scenes to optimize the latent code. As a result, the experiments of Group 2 and 3 are significantly in favour of SRNs. 3) To further demonstrate the advantage of GRF over SRNs, we directly evaluate the trained SRNs model on unseen objects (of the same category) without retraining. For comparison, we also directly evaluate the trained GRF model on the same novel objects. Figure 4 shows the qualitative results. It can be seen that if not retrained, SRNs completely fails to reconstruct unseen car instances, but randomly generates similar cars from learned prior knowledge, primarily because its latent code has not been updated from the unseen objects. In contrast, by learning pixel local patterns, our GRF generalizes well to novel objects directly. This highlights the superiority of the simple formulation of our GRF.
124
+
125
+ Table 1: Comparison of the PSNR (in dB) and SSIM of reconstructed images in the ShapeNetv2 dataset by our GRF, the deterministic GQN (Eslami et al., 2018), TCO (Tatarchenko et al., 2015), WRL (Worrall et al., 2017) and SRNs (Sitzmann et al., 2019). The higher the scores, the better the synthesized novel views. Note that, our GRF solves a harder problem than SRNs, because GRF infers the novel scene representation in a single forward pass, while SRNs cannot.
126
+
127
+ <table><tr><td rowspan="3"></td><td colspan="2">50 Images (Group 1)</td><td colspan="2">2 Images (Group 2)</td><td colspan="2">1 Image (Group 3)</td></tr><tr><td>Chairs</td><td>Cars</td><td>Chairs</td><td>Cars</td><td>Chairs</td><td>Cars</td></tr><tr><td>TCO</td><td>24.31/ 0.92</td><td>20.38/0.83</td><td>21.33/ 0.88</td><td>18.41 /0.80</td><td>21.27 / 0.88</td><td>18.15/0.79</td></tr><tr><td>WRL</td><td>24.57 / 0.93</td><td>19.16 /0.82</td><td>22.28/0.90</td><td>17.20 /0.78</td><td>22.11/0.90</td><td>16.89 / 0.77</td></tr><tr><td>dGQN</td><td>22.72/0.90</td><td>19.61 /0.81</td><td>22.36 /0.89</td><td>18.79 /0.79</td><td>21.59 / 0.87</td><td>18.19 /0.78</td></tr><tr><td>SRNs</td><td>26.23 / 0.95</td><td>26.32 /0.94</td><td>24.48 / 0.92</td><td>22.94 / 0.88</td><td>22.89 / 0.91</td><td>20.72 / 0.85</td></tr><tr><td>GRF (Ours)</td><td>27.10 / 0.95</td><td>27.21 / 0.94</td><td>22.65/0.88</td><td>22.06 /0.86</td><td>21.25/0.86</td><td>19.84/ 0.81</td></tr></table>
128
+
129
+ ![](images/2df62752b06cd043c2e56bd864bd2c55fce00ed1bd7adfe827095d12d01968ae.jpg)
130
+ Figure 3: Qualitative results of SRNs and our GRF for 50-view reconstruction of chairs and cars.
131
+ or on par with the state-of-the-art NSVF on all metrics. Figure 6 shows the qualitative results.
132
+
133
+ ![](images/ce6817cec552833df65cb0e59da8ce2a23b611b88d65539290d9ff8fca51274d.jpg)
134
+ Figure 4: Qualitative results of SRNs (without retraining) and our GRF for 50-view reconstruction of unseen cars. SRNs fails to recover faithful shapes for unseen cars without retraining.
135
+
136
+ # 4.2 EXPERIMENTS ON SYNTHETIC-NERF DATASET
137
+
138
+ We further evaluate our approach on the more complex dataset Synthetic-NeRF (Mildenhall et al., 2020). It consists of pathtraced images of 8 synthetic scenes with much more complicated geometry and realistic non-Lambertian materials. Each scene has 100 views for training and 200 novel views for testing. Each image has a high resolution of $8 0 0 \times 8 0 0$ pixels.
139
+
140
+ Single-scene Learning. To demonstrate the representational capability of our GRF, we train a single model for each synthetic scene, following the same experimental settings of NSVF (Liu et al., 2020). Table 2 compares the quantitative results. Our method is better
141
+
142
+ Table 2: The average scores of PSNR, SSIM and LPIPS (Zhang et al., 2018) for our GRF, SRNs (Sitzmann et al., 2019), NV (Lombardi et al., 2019), LLFF (Mildenhall et al., 2019), NeRF (Mildenhall et al., 2020) and NSVF (Liu et al., 2020) on the Synthetic-NeRF dataset for single-scene learning.
143
+
144
+ <table><tr><td></td><td>PSNR↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>SRNs</td><td>22.26</td><td>0.846</td><td>0.170</td></tr><tr><td>NV</td><td>26.05</td><td>0.893</td><td>0.160</td></tr><tr><td>LLFF</td><td>24.88</td><td>0.911</td><td>0.114</td></tr><tr><td>NeRF</td><td>31.01</td><td>0.947</td><td>0.081</td></tr><tr><td>NSVF</td><td>31.74</td><td>0.953</td><td>0.047</td></tr><tr><td>GRF(Ours)</td><td>32.06</td><td>0.960</td><td>0.048</td></tr></table>
145
+
146
+ Novel-scene Generalization. To evaluate the generalization of GRF on complex scenes, we train a single model simultaneously from randomly selected 4 scenes of Synthetic-NeRF, i.e., Chair, Mic, Ship, and Hotdog, and then conduct the following two groups of experiments.
147
+
148
+ Group 1: The trained model is directly tested on the remaining 4 novel scenes of Synthetic-NeRF dataset, i.e., Drums, Lego, Materials, and Ficus. Fundamentally, this experiment is to evaluate whether the learned limited features can truly generalize to new scenarios. This is extremely challenging because there are only 4 training scenes and the overall shapes of the 4 novel scenes are dramatically different from the trained ones.
149
+
150
+ Group 2: The trained model is further finetuned on each of the four novel scenes with 100, 1k, and 10k iterations separately. In total, we obtain $4 \times 3 = 1 2$ new models. For comparison, we also train NeRF on each of the four novel scenes with 100, 1k, 10k iterations from scratch. This group of experiments evaluates how the initially-learned general features of our GRF improve novel scene learning.
151
+
152
+ Analysis. Table 3 compares the quantitative results. We can see that: 1) In Group 1, our GRF can indeed generalize to novel scenes with complex and completely different overall geometries, demonstrating the effectiveness of learning point local features in GRF. As shown in Figure 5, the overall shape and appearance of Lego can be satisfactorily recovered, though it has never been seen before. 2) In Group 2, our GRF can quickly learn high-quality scene representations given a sparse number of training pix
153
+
154
+ Table 3: The average scores of PSNR, SSIM and LPIPS for GRF and NeRF on four novel scenes of Synthetic-NeRF in Group 1&2.
155
+
156
+ <table><tr><td>PSNR↑ SSIM↑LPIPS↓</td></tr><tr><td>GRF (Group 1) 13.62 0.763 0.246</td></tr><tr><td>NeRF(Group 2, 100 iters) 15.15 0.752 0.359 NeRF(Group 2,1k iters) 19.81 0.809 0.228 NeRF(Group 2,10k iters) 23.35 0.875 0.137</td></tr><tr><td>GRF (Group 2, 100 iters) 19.69 0.835 0.169 GRF (Group 2, 1k iters) 22.00 0.876 0.128 GRF (Group 2,10k iters) 25.10 0.916 0.089</td></tr></table>
157
+
158
+ els, thanks to the initially learned general features. Compared with the NeRF trained from scratch, the learned GRF significantly improves novel scene learning, achieving much better results given the same amount of training signals of new scenes. Figure 5 qualitatively shows the generalization of GRF and more results are presented in appendix.
159
+
160
+ ![](images/2b33473f8cad83e6fc6ade9aac3c829b58988eea96b3c91c1071bdc0382ad409.jpg)
161
+ Figure 5: Qualitative results of our GRF for novel scene generalization.
162
+
163
+ 4.3 EXPERIMENTS ON REAL-WORLD COMPLEX SCENES
164
+
165
+ We evaluate the novel view synthesis on complex real-world scenes captured by cellphones. There are 8 scenes, 5 from LLFF (Mildenhall et al., 2019) and 3 from NeRF. Each scene has 20 to 62 images, 1/8 of which for testing. All images have high resolution of $1 0 0 8 \times 7 5 6$ pixels.
166
+
167
+ Single-scene Learning. We train a single model for each real-world scene, following the same experimental settings of NeRF. Table 4 compares the quantitative results. Note that, the recent
168
+
169
+ Table 4: Comparison of the average PSNR, SSIM and LPIPS scores of our GRF, SRNs, LLFF and NeRF in the challenging real-world dataset for single-scene learning.
170
+
171
+ <table><tr><td></td><td>PSNR↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>SRNs</td><td>22.84</td><td>0.668</td><td>0.378</td></tr><tr><td>LLFF</td><td>24.13</td><td>0.798</td><td>0.212</td></tr><tr><td>NeRF</td><td>26.50</td><td>0.811</td><td>0.250</td></tr><tr><td>GRF(Ours)</td><td>26.64</td><td>0.837</td><td>0.178</td></tr></table>
172
+
173
+ NSVF (Liu et al., 2020) is unable to process these forward-facing scenes because the predefined voxels cannot represent the unbounded 3D space.
174
+
175
+ Analysis. Our method surpasses the state of the art by large margins, especially over the SSIM and LPIPS metrics. Compared with PSNR which only measures the average per-pixel accuracy, the metrics SSIM and LPIPS favor high quality of photorealism, highlighting the superiority of our GRF to generate truly realistic images. Figure 6 shows the qualitative results. As highlighted by the red circles, our GRF can generate fine-grained and natural geometries in pixel level, while NeRF produces many artifacts. This clearly demonstrates our GRF indeed learns general and precise pixel features from the observed 2D images for 3D scene representation and rendering.
176
+
177
+ Compared with Synthetic-NeRF, this dataset is much harder because of the complicated geometries and the inaccuracy of estimated camera poses. Therefore, it is non-trivial to conduct real-world experiments for novel-scene generalization or large-scale scene reconstruction on ScanNet (Dai et al., 2017) or “Tanks and Temples” (Knapitsch et al., 2017). We leave these for future exploration.
178
+
179
+ ![](images/d2dd827b02e584e3f576cc7940a4fd39cb69b473fd797cdb28c8a8cf51466e19.jpg)
180
+ NeRF GRF (Ours) Ground Truth Figure 6: Qualitative results on Synthetic-NeRF (1st row) and real-world datasets (2nd row).
181
+
182
+ # 4.4 ABLATION STUDY
183
+
184
+ To evaluate the effectiveness of the key components of our GRF, we conduct 3 groups of ablation experiments on the car category in ShapeNetv2 dataset. In particular, we train on the entire training split then randomly select 500 objects from the training split for testing. During testing, the model infers 50 novel views for each of these 500 objects for evaluation. Basically, this setting is similar to the experiment of Group 1 in Section 4.1.
185
+
186
+ Table 5: The average scores of PSNR and SSIM for ablated GRF in the subset of car category.
187
+
188
+ <table><tr><td></td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>(1)Remove Input Viewpoints</td><td>20.13</td><td>0.807</td></tr><tr><td>(2) Remove Pixel Local Features</td><td>20.23</td><td>0.818</td></tr><tr><td>(3) Replace Attention by Maxpool</td><td>24.88</td><td>0.914</td></tr><tr><td>(4) The Full Model</td><td>27.16</td><td>0.942</td></tr></table>
189
+
190
+ • Group 1: The viewpoints of the input images are removed from the CNN module. The CNN module is not explicitly aware of the relative position of the pixel features. • Group 2: The decoder of the CNN module is removed and each input image is encoded as a global feature vector. For any 3D query point which is rightly projected into the image boundary, that global feature vector is retrieved and reprojected to the query point. Fundamentally, this modified CNN module can be regarded as a hyper-network that learns a conditional embedding from input images and then feed it into NeRF, but it sacrifices the precise pixel local features. • Group 3: The advanced attention module is replaced by max-pooling to aggregate the pixel features, aiming to investigate how the visual occlusion can be better addressed using soft attention. • Group 4: The full model is trained and tested with the same settings for comparison.
191
+
192
+ Analysis. Table 5 compares the performance of all ablated models. We can see that: 1) The greatest impact is caused by the removal of image viewpoints from the CNN module and the lack of local pixel features to represent 3D points. It highlights that obtaining the position-aware and precise pixel features is crucial to represent 3D scenes from 2D images, while learning a simple hyper-network for NeRF cannot achieve comparable performance. 2) Using max-pooling to select the reprojected pixel features is sub-optimal to address the visual occlusions from different viewing angles.
193
+
194
+ To further investigate the attention module, the maximal attention scores are retrieved and visualized (detailed in appendix). It shows that the attention module can truly drive the network to focus on the visible pixel local features among the multiple intersected light rays. We also conduct additional ablation experiments (detailed in appendix), demonstrating that our GRF can indeed generalize well to novel scenes with severe visual occlusions and is robust to a variable number of input images.
195
+
196
+ # 5 CONCLUSION
197
+
198
+ The proposed method models complex 3D scenes as a general radiance field. We demonstrated that it can learn general and robust 3D point features from a set of 2D observations. By using the principle of multi-view geometry to precisely map 2D pixel features back to 3D space and leveraging the attention mechanism to implicitly address the visual occlusions, our GRF can synthesize truly realistic 2D novel views. However, there are still limitations that lead to the future work. (1) More advanced CNN modules can be designed to learn better pixel features. (2) Depth scans can be integrated into the network to explicitly address visual occlusions.
199
+
200
+ # REFERENCES
201
+
202
+ Matan Atzmon and Yaron Lipman. SAL: Sign Agnostic Learning of Shapes from Raw Data. IEEE Conference on Computer Vision and Pattern Recognition, 2020a.
203
+
204
+ Matan Atzmon and Yaron Lipman. SALD: Sign Agnostic Learning with Derivatives. arXiv, 2020b.
205
+
206
+ Cesar Cadena, Luca Carlone, Henry Carrillo, Yasir Latif, Davide Scaramuzza, Jose Neira, Ian D. Reid, and John J. Leonard. Past, Present, and Future of Simultaneous Localization and Mapping: Towards the Robust-Perception Age. IEEE Transactions on Robotics, 32(6):1309–1332, 2016.
207
+
208
+ Wenzheng Chen, Jun Gao, Huan Ling, Edward J. Smith, Jaakko Lehtinen, Alec Jacobson, and Sanja Fidler. Learning to Predict 3D Objects with an Interpolation-based Differentiable Renderer. Advances in Neural Information Processing Systems, pp. 9609–9619, 2019.
209
+
210
+ Christopher B. Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3D-R2N2: A Unified Approach for Single and Multi-view 3D Object Reconstruction. European Conference on Computer Vision, pp. 628–644, 2016.
211
+
212
+ H Christian, Shubham Tulsiani, and Jitendra Malik. Hierarchical Surface Prediction for 3D Object Reconstruction. International Conference on 3D Vision, pp. 412–420, 2017.
213
+
214
+ Angela Dai, Angel X. Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. ScanNet: Richly-annotated 3D Reconstructions of Indoor Scenes. IEEE Conference on Computer Vision and Pattern Recognition, pp. 5828–5839, 2017.
215
+
216
+ S.M. Ali Eslami, Danilo Jimenez Rezende, Frederic Besse, Fabio Viola, Ari S. Morcos, Marta Garnelo, Avraham Ruderman, Andrei A. Rusu, Ivo Danihelka, Karol Gregor, David P. Reichert, Lars Buesing, Theophane Weber, Oriol Vinyals, Dan Rosenbaum, Neil Rabinowitz, Helen King, Chloe Hillier, Matt Botvinick, Daan Wierstra, Koray Kavukcuoglu, and Demis Hassabis. Neural Scene Representation and Rendering. Science, 360(6394):1204–1210, 2018.
217
+
218
+ Haoqiang Fan, Hao Su, and Leonidas Guibas. A Point Set Generation Network for 3D Object Reconstruction from a Single Image. IEEE Conference on Computer Vision and Pattern Recognition, pp. 605–613, 2017.
219
+
220
+ A Tewari O Fried, J Thies V Sitzmann, S Lombardi K Sunkavalli, and R Martin-brualla T Simon J Saragih. State of the Art on Neural Rendering. Computer Graphics Forum, 39(2):701–727, 2020.
221
+
222
+ Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh R-CNN. IEEE International Conference on Computer Vision, pp. 9785–9795, 2019.
223
+
224
+ Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative Adversarial Nets. Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
225
+
226
+ Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A PapierMache Approach to Learning 3D Surface Generation. IEEE Conference on Computer Vision and Pattern Recognition, pp. 216–224, 2018.
227
+
228
+ Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, 2004.
229
+
230
+ Eldar Insafutdinov and Alexey Dosovitskiy. Unsupervised Learning of Shape and Pose with Differentiable Point Clouds. Advances in Neural Information Processing Systems, pp. 2802–2812, 2018.
231
+
232
+ James T. Kajiya and Brian P Von Herzen. Ray tracing volume densities. ACM SIGGRAPH Computer Graphics, 18(3), 1984.
233
+
234
+ Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3D Mesh Renderer. IEEE Conference on Computer Vision and Pattern Recognition, pp. 3907–3916, 2018.
235
+
236
+ Hiroharu Kato, Deniz Beker, Mihai Morariu, Takahiro Ando, Toru Matsuoka, Wadim Kehl, and Adrien Gaidon. Differentiable Rendering: A Survey. arXiv:2006.12057, 2020.
237
+
238
+ Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. International Conference on Learning Representations, 2014.
239
+
240
+ Arno Knapitsch, Jaesik Park, Qian Yi Zhou, and Vladlen Koltun. Tanks and temples: Benchmarking large-scale scene reconstruction. ACM Transactions on Graphics, 36(4), 2017. ISSN 15577368. doi: 10.1145/3072959.3073599.
241
+
242
+ Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural Sparse Voxel Fields. Advances in Neural Information Processing Systems, 2020.
243
+
244
+ Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning. IEEE International Conference on Computer Vision, pp. 7708–7717, 2019a.
245
+
246
+ Shichen Liu, Shunsuke Saito, Weikai Chen, and Hao Li. Learning to Infer Implicit Surfaces without 3D Supervision. Advances in Neural Information Processing Systems, pp. 8293–8304, 2019b.
247
+
248
+ Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-Centric Learning with Slot Attention. Advances in Neural Information Processing Systems, 2020.
249
+
250
+ Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. ACM Transactions on Graphics, 38(4), 2019. ISSN 15577368. doi: 10.1145/3306346.3323020.
251
+
252
+ Ricardo Martin-Brualla, Noha Radwan, Mehdi S. M. Sajjadi, Jonathan T. Barron, Alexey Dosovitskiy, and Daniel Duckworth. NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections. arXiv:2008.02268, 2020.
253
+
254
+ Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy Networks: Learning 3D Reconstruction in Function Space. IEEE Conference on Computer Vision and Pattern Recognition, pp. 4455–4465, 2019.
255
+
256
+ Ben Mildenhall, Pratul Srinivasan, Rodrigo Ortiz-Cayon, Nima Khademi Kalantari, Ravi Ramamoorthi, Ren Ng, and Abhishek Kar. Local light field fusion: Practical view synthesis with prescriptive sampling guidelines. SIGGRAPH, 2019.
257
+
258
+ Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. European Conference on Computer Vision, 2020.
259
+
260
+ Charlie Nash, Yaroslav Ganin, S. M. Ali Eslami, and Peter W. Battaglia. PolyGen: An Autoregressive Generative Model of 3D Meshes. International Conference on Machine Learning, 2020.
261
+
262
+ Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision. IEEE Conference on Computer Vision and Pattern Recognition, pp. 3504–3515, 2020.
263
+
264
+ Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional Image Generation with PixelCNN Decoders. Advances in Neural Information Processing Systems, pp. 4790–4798, 2016. ISSN 10495258.
265
+
266
+ Onur Ozyesil, Vladislav Voroninski, Ronen Basri, and Amit Singer. A Survey of Structure from Motion. Acta Numerica, 26:305–364, 2017.
267
+
268
+ Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation. IEEE Conference on Computer Vision and Pattern Recognition, pp. 165–174, 2019.
269
+
270
+ Charles R. Qi, Hao Su, Kaichun Mo, and Leonidas J. Guibas. PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017.
271
+
272
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. International Conference on Learning Representations, 2016.
273
+
274
+ Edoardo Remelli, Artem Lukoianov, Stephan R. Richter, Benoˆıt Guillard, Timur Bagautdinov, Pierre Baque, and Pascal Fua. MeshSDF: Differentiable Iso-Surface Extraction. arXiv:2006.03997, 2020.
275
+
276
+ Danilo Jimenez Rezende, S. M. Ali Eslami, Shakir Mohamed, Peter Battaglia, Max Jaderberg, and Nicolas Heess. Unsupervised Learning of 3D Structure from Images. Advances in Neural Information Processing Systems, pp. 4996–5004, 2016.
277
+
278
+ Gernot Riegler, Ali Osman Ulusoy, and Andreas Geiger. OctNet: Learning Deep 3D Representations at High Resolutions. IEEE Conference on Computer Vision and Pattern Recognition, pp. 3577– 3586, 2017.
279
+
280
+ Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization. IEEE International Conference on Computer Vision, pp. 2304–2314, 2019.
281
+
282
+ Katja Schwarz, Yiyi Liao, Michael Niemeyer, and Andreas Geiger. GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis. arXiv:2007.02442, 2020.
283
+
284
+ Vincent Sitzmann, Michael Zollhofer, and Gordon Wetzstein. Scene Representation Networks: Con- ¨ tinuous 3D-Structure-Aware Neural Scene Representations. Advances in Neural Information Processing Systems, pp. 1119–1130, 2019.
285
+
286
+ Shuran Song, Fisher Yu, Andy Zeng, Angel X. Chang, Manolis Savva, and Thomas Funkhouser. Semantic Scene Completion from a Single Depth Image. IEEE Conference on Computer Vision and Pattern Recognition, pp. 1746–1754, 2017.
287
+
288
+ Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Single-view to Multi-view: Reconstructing Unseen Views with a Convolutional Network. arXiv:1511.06702, 2015.
289
+
290
+ Shubham Tulsiani, Tinghui Zhou, Alexei A. Efros, and Jitendra Malik. Multi-view Supervision for Single-view Reconstruction via Differentiable Ray Consistency. IEEE Conference on Computer Vision and Pattern Recognition, pp. 2626–2634, 2017.
291
+
292
+ Shubham Tulsiani, Saurabh Gupta, David Fouhey, Alexei A. Efros, and Jitendra Malik. Factoring Shape, Pose, and Layout from the 2D Image of a 3D Scene. IEEE Conference on Computer Vision and Pattern Recognition, pp. 302–310, 2018.
293
+
294
+ Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2Mesh: Generating 3D Mesh Models from Single RGB Images. European Conference on Computer Vision, pp. 52–67, 2018.
295
+
296
+ Daniel E. Worrall, Stephan J. Garbin, Daniyar Turmukhambetov, and Gabriel J. Brostow. Interpretable transformations with encoder-decoder networks. IEEE International Conference on Computer Vision, pp. 5726–5735, 2017.
297
+
298
+ Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision. Advances in Neural Information Processing Systems, pp. 1696–1704, 2016.
299
+
300
+ Bo Yang, Stefano Rosa, Andrew Markham, Niki Trigoni, and Hongkai Wen. Dense 3D Object Reconstruction from a Single Depth View. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(12):2820 – 2834, 2019.
301
+
302
+ Bo Yang, Sen Wang, Andrew Markham, and Niki Trigoni. Robust Attentional Aggregation of Deep Feature Sets for Multi-view 3D Reconstruction. International Journal of Computer Vision, 128: 53–73, 2020.
303
+
304
+ Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The Unreasonable Effectiveness of Deep Features as a Perceptual Metric. IEEE Conference on Computer Vision and Pattern Recognition, pp. 586–595, 2018.
305
+
306
+ # A APPENDIX
307
+
308
+ A.1 DETAILS OF NETWORK ARCHITECTURE
309
+
310
+ Table 6: The CNN Module for Experiments on ShapeNetv2 Dataset.
311
+
312
+ <table><tr><td>Type Size/Channels Activation Stride</td></tr><tr><td>Input: embedding of RGB and viewpoint</td></tr><tr><td>1 - 64 ReLU 2</td></tr><tr><td>Li: Conv 7 × 7 L2: Conv 3 × 3 128 ReLU 2</td></tr><tr><td>L3: Conv 3 × 3 256 ReLU 2</td></tr><tr><td></td></tr><tr><td>L4: Conv 3 × 3 512 ReLU 2</td></tr><tr><td>L5: Conv 4 × 4 128 ReLU 4</td></tr><tr><td>L6: Flatten /Tile - 1</td></tr><tr><td>L7: Concat (L6,L4) - 1</td></tr><tr><td>L8:Dilated Conv 3×3 256 ReLU 4</td></tr><tr><td>L8: Concat (L8,L3) 1 1 =</td></tr><tr><td>L9:Dilated Conv 3 × 3 128 ReLU 8</td></tr><tr><td>L9: Concat (L9,L2) = 一 =</td></tr><tr><td>L10: Dilated Conv 3 × 3 64 ReLU 16</td></tr><tr><td>L10: Concat (L10, L1) - ■ = L11: Dilated Conv 3 × 3 128 ReLU 32</td></tr></table>
313
+
314
+ Table 7: The CNN Module for Experiments on Synthetic-NeRF Dataset. The average pooling is added to aggressively downsample the feature maps.
315
+
316
+ <table><tr><td>Type Size/Channels Activation Stride</td></tr><tr><td>Input: embedding of RGB and viewpoint - -</td></tr><tr><td>L1: Conv 7 × 7 64 ReLU 2</td></tr><tr><td>L2: Conv 3 × 3 128 ReLU 2</td></tr><tr><td>L3: Conv 3 × 3 256 ReLU 2</td></tr><tr><td>L4: Conv 3 × 3 512 ReLU 2</td></tr><tr><td>L4: AveragePooling 5 × 5</td></tr><tr><td>= =</td></tr><tr><td>L5: Conv 5 × 5 128 ReLU 5</td></tr><tr><td>L6:Flatten /Tile - 1</td></tr><tr><td>L7: Concat (L6,L4) 1 1</td></tr><tr><td>L8: Deconv 3× 3 256 ReLU 2</td></tr><tr><td>L8: Concat (L8, L3) 1 1</td></tr><tr><td>L9: Deonv 3 × 3 128 ReLU 2</td></tr><tr><td>L9: Concat (L9,L2) 1 1</td></tr><tr><td>L10: Deconv 3×3 64 ReLU 2</td></tr><tr><td>L10: Concat (L10,L1) - 1 L11: Deconv 3 × 3 128 ReLU 2</td></tr></table>
317
+
318
+ Table 8: The CNN Module for Experiments on the real-world Dataset. The average pooling is added to aggressively downsample the feature maps.
319
+
320
+ <table><tr><td>Type Size/Channels Activation Stride</td></tr><tr><td>Input: embedding of RGB and viewpoint 1 1</td></tr><tr><td>L1: Conv 7 × 7 64 ReLU</td></tr><tr><td>22 L2: Conv 3 × 3 128 ReLU</td></tr><tr><td>L3: Conv 3 × 3 256 ReLU 2</td></tr><tr><td>L4: Conv 3 × 3 512 ReLU 2</td></tr><tr><td></td></tr><tr><td>L4: AveragePooling 8 × 8 1 =</td></tr><tr><td>L5: Conv 4 × 4 128 ReLU 4</td></tr><tr><td>L6: Flatten /Tile 1 1</td></tr><tr><td>L7: Concat (L6,L4) 1 1</td></tr><tr><td>L8: Deconv 3 × 3 256 ReLU 2</td></tr><tr><td>L8: Concat (L8,L3) - 1</td></tr><tr><td>L9: Deconv 3 × 3 128 ReLU</td></tr><tr><td>L9: Concat (L9,L2) 1 =</td></tr><tr><td>L10: Deconv 3×3 64 ReLU 2</td></tr><tr><td>L10: Concat (L10, L1) - =</td></tr><tr><td>L11: Deconv 3 × 3 128 ReLU 2</td></tr></table>
321
+
322
+ Table 9: The Attention Module, AttSets (Yang et al., 2020), for Experiments on the ShapeNetv2 Dataset. The simple AttSets is computationally efficient and we choose it to train the large-scale ShapeNetv2 dataset.
323
+
324
+ <table><tr><td>Type</td><td>Size/Channels Activation</td><td></td></tr><tr><td>Input: Concat(K × 128,embedding of viewpoint)</td><td>=</td><td>=</td></tr><tr><td>L1: fc</td><td>256</td><td>ReLU</td></tr><tr><td>L2: fc</td><td>256</td><td>ReLU</td></tr><tr><td>L3: fc</td><td>256</td><td>ReLU</td></tr><tr><td>L4: fc</td><td>512</td><td>ReLU</td></tr><tr><td>L5: fc</td><td>512</td><td>ReLU</td></tr><tr><td>L6: softmax(L5)</td><td>1</td><td>1</td></tr><tr><td>L7: sum(L6*L5,axis=-2)</td><td>1</td><td>1</td></tr><tr><td>L8: fc</td><td>512</td><td>ReLU</td></tr></table>
325
+
326
+ We use Slot Attention as the pixel feature aggregation module for experiments on the SyntheticNeRF and real-world datasets. In particular, we use two slots, two iterations, and the hidden size is 128. The final output two slots are flattened and a 256 dimensional vector is obtained. For details of Slot Attention refer to the paper (Locatello et al., 2020).
327
+
328
+ Details of the neural rendering layers and the volume rendering can be found in NeRF (Mildenhall et al., 2020). We set the positional embedding length $L = 5$ for all inputs to the CNN module, except the rotation, which we convert to quaternion and embed at $L = 4$ .
329
+
330
+ During training, we feed the models between 2 and 6 views of each scene at each gradient step. We set the learning rate for the ShapeNetv2 models at 1e-4. We set the learning rate for leaves and orchids in the real-world dataset at 7e-5, and for the rest, we use 1e-4. For Synthetic-NeRF dataset, we use a learning rate of 1e-4. We use the Adam optimizer for all models, and train for $2 0 0 \mathbf { k } { - } 3 0 0 \mathbf { k }$ iterations. At each gradient step, we take 1000 rays for ShapeNetv2 with 32 coarse samples and 64 fine samples, and 800 rays for the real-world and Synthetic-NeRF datasets with 64 coarse samples and 192 fine samples. We train each model on a single Nvidia-V100 GPU with 32GB VRAM.
331
+
332
+ During testing for the ShapeNetv2 reconstruction from 50 images, we feed the model the 5 closest views to the desired novel view by cosine similarity from the 50 training images. During testing for single-scene reconstruction, we feed the model the 4 closest views by cosine similarity to the desired novel view.
333
+
334
+ # A.2 DETAILS OF EXPERIMENTAL RESULTS ON THE SYNTHETIC-NERF DATASET
335
+
336
+ Table 10: Comparison of the PSNR (in dB), SSIM and LPIPS (Zhang et al., 2018) scores of our GRF, SRNs (Sitzmann et al., 2019), NV (Lombardi et al., 2019), NeRF (Mildenhall et al., 2020) and NSVF (Liu et al., 2020) in the Synthetic-NeRF dataset for single-scene learning.
337
+
338
+ <table><tr><td></td><td>Chair</td><td>Drums</td><td>Lego</td><td>Mic</td><td>Materials</td><td>Ship</td><td>Hotdog</td><td>Ficus</td><td>Mean</td></tr><tr><td colspan="10">PSNR↑</td></tr><tr><td>SRNs</td><td>26.96</td><td>17.18</td><td>20.85</td><td>26.85</td><td>18.09</td><td>20.60</td><td>26.81</td><td>20.73</td><td>22.26</td></tr><tr><td>NV</td><td>28.33</td><td>22.58</td><td>26.08</td><td>27.78</td><td>24.22</td><td>23.93</td><td>30.71</td><td>24.79</td><td>26.05</td></tr><tr><td>NeRF</td><td>33.00</td><td>25.01</td><td>32.54</td><td>32.91</td><td>29.62</td><td>28.65</td><td>36.18</td><td>30.13</td><td>31.01</td></tr><tr><td>NSVF</td><td>33.19</td><td>25.18</td><td>32.29</td><td>34.27</td><td>32.68</td><td>27.93</td><td>37.14</td><td>31.23</td><td>31.74</td></tr><tr><td>GRF(Ours)</td><td>34.51</td><td>25.83</td><td>32.92</td><td>33.94</td><td>30.91</td><td>30.12</td><td>37.47</td><td>30.75</td><td>32.06</td></tr><tr><td colspan="10">SSIM↑</td></tr><tr><td>SRNs</td><td>0.910</td><td>0.766</td><td>0.809</td><td>0.947</td><td>0.808</td><td>0.757</td><td>0.923</td><td>0.849</td><td>0.846</td></tr><tr><td>NV</td><td>0.916</td><td>0.873</td><td>0.880</td><td>0.946</td><td>0.888</td><td>0.784</td><td>0.944</td><td>0.910</td><td>0.893</td></tr><tr><td>NeRF</td><td>0.967</td><td>0.925</td><td>0.961</td><td>0.980</td><td>0.949</td><td>0.856</td><td>0.974</td><td>0.964</td><td>0.947</td></tr><tr><td>NSVF</td><td>0.968</td><td>0.931</td><td>0.960</td><td>0.987</td><td>0.973</td><td>0.854</td><td>0.980</td><td>0.973</td><td>0.953</td></tr><tr><td>GRF(Ours)</td><td>0.981</td><td>0.937</td><td>0.967</td><td>0.987</td><td>0.963</td><td>0.891</td><td>0.983</td><td>0.969</td><td>0.960</td></tr><tr><td colspan="10">LPIPS↓</td></tr><tr><td>SRNs</td><td>0.106</td><td>0.267</td><td>0.200</td><td>0.063</td><td>0.174</td><td>0.299</td><td>0.100</td><td>0.149</td><td>0.170</td></tr><tr><td>NV</td><td>0.109</td><td>0.214</td><td>0.175</td><td>0.107</td><td>0.130</td><td>0.276</td><td>0.109</td><td>0.162</td><td>0.160</td></tr><tr><td>NeRF</td><td>0.046</td><td>0.091</td><td>0.050</td><td>0.028</td><td>0.063</td><td>0.206</td><td>0.121</td><td>0.044</td><td>0.081</td></tr><tr><td>NSVF</td><td>0.043</td><td>0.069</td><td>0.029</td><td>0.010</td><td>0.021</td><td>0.162</td><td>0.025</td><td>0.017</td><td>0.047</td></tr><tr><td>GRF(Ours)</td><td>0.021</td><td>0.068</td><td>0.042</td><td>0.013</td><td>0.041</td><td>0.141</td><td>0.028</td><td>0.032</td><td>0.048</td></tr></table>
339
+
340
+ Table 11: The PSNR, SSIM and LPIPS scores of our GRF simultaneously trained on 4 scenes of the Synthetic-NeRF dataset for multi-scene learning. The scores of SRNs, NeRF and NSVF trained on single scenes are included for comparison.
341
+
342
+ <table><tr><td></td><td>Chair</td><td>Mic</td><td>Ship</td><td>Hotdog</td></tr><tr><td colspan="5">PSNR↑</td></tr><tr><td>SRNs (Single-scene)</td><td>26.96</td><td>26.85</td><td>20.60</td><td>26.81</td></tr><tr><td>NeRF (Single-scene)</td><td>33.00</td><td>32.91</td><td>28.65</td><td>36.18</td></tr><tr><td>NSVF (Single-scene)</td><td>33.19</td><td>34.27</td><td>27.93</td><td>37.14</td></tr><tr><td>GRF (Multi-scene)</td><td>32.49</td><td>32.02</td><td>27.76</td><td>34.92</td></tr><tr><td colspan="5">SSIM↑</td></tr><tr><td>SRNs (Single-scene)</td><td>0.910</td><td>0.947</td><td>0.757</td><td>0.923</td></tr><tr><td>NeRF (Single-scene)</td><td>0.967</td><td>0.980</td><td>0.856</td><td>0.974</td></tr><tr><td>NSVF (Single-scene)</td><td>0.968</td><td>0.987</td><td>0.854</td><td>0.980</td></tr><tr><td>GRF (Multi-scene)</td><td>0.971</td><td>0.982</td><td>0.866</td><td>0.975</td></tr><tr><td colspan="5">LPIPS↓</td></tr><tr><td>SRNs (Single-scene)</td><td>0.106</td><td>0.063</td><td>0.299</td><td>0.100</td></tr><tr><td>NeRF (Single-scene)</td><td>0.046</td><td>0.028</td><td>0.206</td><td>0.121</td></tr><tr><td>NSVF (Single-scene)</td><td>0.043</td><td>0.010</td><td>0.162</td><td>0.025</td></tr><tr><td>GRF (Multi-scene)</td><td>0.032</td><td>0.019</td><td>0.167</td><td>0.040</td></tr></table>
343
+
344
+ Table 12: The PSNR, SSIM and LPIPS scores of our GRF and NeRF on four novel scenes of Synthetic-NeRF in Group 1&2 experiments.
345
+
346
+ <table><tr><td colspan="4">Drums</td></tr><tr><td></td><td>Lego PSNR↑</td><td>Materials</td><td>Ficus</td></tr><tr><td colspan="2"></td></tr><tr><td>GRF (Group 1) 13.23 13.53</td><td>12.26 15.47 15.42 15.72</td></tr><tr><td>NeRF( F(Group2,100 iters) 14.54 14.92</td><td>20.04 20.40 20.81</td></tr><tr><td>NeRF( (Group2,1k iters) 18.01</td><td>19.81 23.36 23.47</td></tr><tr><td>NeRF (Group 2,10k iters) 21.57 24.99</td><td>23.35</td></tr><tr><td>GRF (Group 2,100 iters) 18.70 20.24</td><td>18.81 21.03 19.69</td></tr><tr><td>GRF (Group2,1k iters) 20.49 23.64</td><td>21.87 22.02 22.00</td></tr><tr><td>GRF (Group2,10k iters) 23.11 27.07</td><td>25.11 25.11 25.10</td></tr><tr><td colspan="2">SSIM↑</td></tr><tr><td>F (Group 1) 0.762</td><td>0.736 0.703 0.849</td></tr><tr><td>NeRF(Group 2,100 iters)</td><td>0.769 0.717 0.716</td></tr><tr><td>NeRF(Group 2,1k iters) 0.793 0.775</td><td>0.812 0.857 0.809 0.877 0.896 0.875</td></tr><tr><td>NeRF F(Group2,10k iters) 0.865</td><td>0.862</td></tr><tr><td>GRF(Group 2,100 iters) 0.822 0.813</td><td>0.829 0.878 0.835</td></tr><tr><td>GRF (Group2,1k iters) 0.856</td><td>0.877 0.878 0.894 0.876 0.916</td></tr><tr><td>GRF F(Group2,10k iters) 0.901</td><td>0.924 0.913 0.923</td></tr><tr><td colspan="2">LPIPS↓</td></tr><tr><td></td><td>0.256 0.273 0.301 0.150</td></tr><tr><td>GRF (Group 1) NeRF(Group 2,100 iters)</td><td>0.332 0.395 0.314</td></tr><tr><td>NeRF(Group 2,1k iters) 0.254 0.264</td><td>0.393 0.359 0.229 0.164 0.228 0.137</td></tr><tr><td>NeRF (Group2,10k iters) 0.157</td><td>0.154 0.128 0.110</td></tr><tr><td>GRF (Group 2,100 iters) 0.196</td><td>0.203 0.159 0.117 0.169 0.128</td></tr><tr><td>GRF F(Group2,1k iters) 0.154 GRF (Group 2,10k iters) 0.104</td><td>0.138 0.123 0.097 0.090 0.090 0.071</td></tr></table>
347
+
348
+ A.3 DETAILS OF EXPERIMENTAL RESULTS ON THE REAL-WORLD DATASET
349
+
350
+ Table 13: Comparison of the PSNR, SSIM and LPIPS scores of our GRF, SRNs (Sitzmann et al., 2019), LLFF (Mildenhall et al., 2019) and NeRF (Mildenhall et al., 2020) in the real-world dataset for single-scene learning.
351
+
352
+ <table><tr><td></td><td>Room</td><td>Fern</td><td>Leaves</td><td>Fortress</td><td>Orchids</td><td>Flower</td><td>T-Rex</td><td>Horns</td><td>Mean</td></tr><tr><td colspan="10">PSNR↑</td></tr><tr><td>SRNs</td><td>27.29</td><td>21.37</td><td>18.24</td><td>26.63</td><td>17.37</td><td>24.63</td><td>22.87</td><td>24.33</td><td>22.84</td></tr><tr><td>LLFF</td><td>28.42</td><td>22.85</td><td>19.52</td><td>29.40</td><td>18.52</td><td>25.46</td><td>24.15</td><td>24.70</td><td>24.13</td></tr><tr><td>NeRF</td><td>32.70</td><td>25.17</td><td>20.92</td><td>31.16</td><td>20.36</td><td>27.40</td><td>26.80</td><td>27.45</td><td>26.50</td></tr><tr><td>GRF(Ours)</td><td>31.74</td><td>25.72</td><td>21.16</td><td>31.28</td><td>20.88</td><td>27.83</td><td>27.01</td><td>27.50</td><td>26.64</td></tr><tr><td colspan="10">SSIM↑</td></tr><tr><td>SRNs</td><td>0.883</td><td>0.611</td><td>0.520</td><td>0.641</td><td>0.449</td><td>0.738</td><td>0.761</td><td>0.742</td><td>0.668</td></tr><tr><td>LLFF</td><td>0.932</td><td>0.753</td><td>0.697</td><td>0.872</td><td>0.588</td><td>0.844</td><td>0.857</td><td>0.840</td><td>0.798</td></tr><tr><td>NeRF</td><td>0.948</td><td>0.792</td><td>0.690</td><td>0.881</td><td>0.641</td><td>0.827</td><td>0.880</td><td>0.828</td><td>0.811</td></tr><tr><td>GRF(Ours)</td><td>0.951</td><td>0.827</td><td>0.727</td><td>0.898</td><td>0.667</td><td>0.852</td><td>0.901</td><td>0.873</td><td>0.837</td></tr><tr><td colspan="10">LPIPS↓</td></tr><tr><td>SRNs</td><td>0.240</td><td>0.459</td><td>0.440</td><td>0.453</td><td>0.467</td><td>0.288</td><td>0.298</td><td>0.376</td><td>0.378</td></tr><tr><td>LLFF</td><td>0.155</td><td>0.247</td><td>0.216</td><td>0.173</td><td>0.313</td><td>0.174</td><td>0.222</td><td>0.193</td><td>0.212</td></tr><tr><td>NeRF</td><td>0.178</td><td>0.280</td><td>0.316</td><td>0.171</td><td>0.321</td><td>0.219</td><td>0.249</td><td>0.268</td><td>0.250</td></tr><tr><td>GRF(Ours)</td><td>0.104</td><td>0.191</td><td>0.238</td><td>0.127</td><td>0.275</td><td>0.176</td><td>0.146</td><td>0.169</td><td>0.178</td></tr></table>
353
+
354
+ # A.4 ANALYSIS OF ATTENTION MECHANISM(Generalizat
355
+
356
+ The attention mechanism in our GRF aims to automatically select the correct pixel patch from multiple pixel patches where the light rays intersect at the same query 3D point in space.
357
+
358
+ In order to investigate how the attention mechanism learns to select the useful information, we retrieve the maximal attention score from the observed multiple pixel patches for analysis. Intuitively, the higher the attention score is assigned to a particular pixel patch, the more important that patch for inferring the novel pixel RGB. In particular, we conduct the following experiment using our GRF model trained on ShapeNetv2 Cars. In this case, the AttSets attention module is used (details are in Table 9). Given a query light ray, multiple 3D points are sampled to query the network.
359
+
360
+ We firstly try to find the 3D point which is near the surface according to the predicted volume density for points along the ray through a given pixel, if they exist. Otherwise, we ignore such pixels, making them white.
361
+ Then we compute the M feature vectors from the input M views for these surface points. Thirdly, the attention masks for those M feature vectors are computed. We identify the view whose sum of the attention mask along the feature axis is greatest as the main contributor for inferring the novel pixel RGB.
362
+ After querying light rays for each pixel, we obtain a rendered RGB image. At the same time, for each pixel of that image, we select the most important view from the M input views for the surfaceintersection point along the ray from the viewpoint through that pixel, according to the maximal attention score. Eventually, we obtain a Max Attention Map corresponding to the rendered RGB image.
363
+
364
+ Figure 7 shows the qualitative results of the above experiment. In particular, we feed the three images (#1,#2,#3) of an unseen car into our GRF model which is well-trained on car category, and then render a new image (e.g., the 5th image in Figure 7). Note that, we carefully select the input 3 images and the rendered image with very large viewing baselines. In the mean time, we obtain and visualize the Max Attention Map corresponding to the rendered image.
365
+
366
+ For each pixel of the rendered image, we retrieve the input image pixel that has the highest attention score. Specifically, the rendered pixels with purple color correspond to the input image #1, the green pixels correspond to the input image #2, while the blue pixels correspond to the input image #3.
367
+
368
+ Analysis. It can be seen that, when inferring a new image, the attention module of our GRF focuses on the most informative pixel patch from the multiple input pixel patches. In addition, it is able to truly deal with the visual occlusion. For example, when inferring the windshield of the car, the attention module focuses on the input image #2 where the windshield is visible, while ignoring the image #1 and #3 where the windshield is self-occluded.
369
+
370
+ ![](images/20f93eecb76196ee8f164adc09b398e9f5dbb82c10a34c1453af75819e8f5736.jpg)
371
+ Figure 7: Visualization of Max Attention Map from Multiple Input Images of a Novel Object for Inferring a Novel View.
372
+
373
+ A.5 GENERALIZATION TO VISUAL OCCLUSIONS AND VARIABLE INPUT IMAGES
374
+
375
+ We carefully select the attention module, i.e., either AttSets or SlotAtt, to aggregate the features from an arbitrary number of input views. In order to evaluate how our GRF is able to generalize with a variable number of input views, especially when there is a very sparse number of views with severe visual occlusions, we conduct the following four groups of experiments.
376
+
377
+ • 1-view Reconstruction. We feed the a single image of a novel car into our GRF model which is well-trained on car category (trained with 5 images per object), and then render 9 new images from vastly different viewing angles. This is the extreme case where the majority of the object is self-occluded.
378
+
379
+ • 2-view Reconstruction. Similarly, we feed only two images of the novel car into the same model and render the same 9 novel views. In this case, more information is given to the network, but there are still many parts occluded.
380
+
381
+ • 5-view / 10-view Reconstruction. The same GRF model is fed with 5 and 10 views of the novel object, rendering the same set of new images.
382
+
383
+ Analysis. Figure 8 shows the qualitative results. It can be seen that: 1) In the extreme case, i.e., 1-view reconstruction, our GRF is still able to recover the general 3D shape of the unseen object, including the visually occluded parts, primarily because our CNN model learns the hierarchical features including the high-level shapes. 2) Given more input views, the originally occluded parts tend to be observed from some viewing angles, and then these parts can be reconstructed better and better. This shows that our GRF is indeed able to effectively identify the corresponding useful pixel features for more accurately recovering shape and appearance.
384
+
385
+ ![](images/452fb2908ba7c814b8da50727c0309cbd16427f8d4f7072fd5be8f665d791d99.jpg)
386
+ Figure 8: Qualitative results of our GRF when being fed with a variable number of views of a novel object. The red circle highlights that the tail of the car is able to be recovered given more visual cues from more input images.
387
+
388
+ ![](images/5e585a9c6f55e0f762c826bccc3ad70554c0e9a9023da31e86706efd23ce1569.jpg)
389
+ Figure 9: Qualitative results of SRNs and our GRF for 50-view reconstruction of chairs and cars.
390
+
391
+ ![](images/720b1b3f0a109fae40aade5f250bbe18fc1e9ff6bc9faf69eda08923c27ddadc.jpg)
392
+ Figure 10: Qualitative results of our GRF for novel view depth and RGB estimation on the SyntheticNeRF dataset.
393
+
394
+ ![](images/cadef3a36c5e380d2f99cc5b827f2e4ca75d2c8175fcc3a245639772f579210d.jpg)
395
+ Figure 11: Qualitative results of our GRF for novel view depth and RGB estimation on the SyntheticNeRF dataset.
396
+
397
+ ![](images/453a93119d60769e89c2b0a65f9b43d42efc589faba79975733f9e58b7782c58.jpg)
398
+ Figure 12: Qualitative results of our GRF for novel view depth and RGB estimation on the SyntheticNeRF dataset.
399
+
400
+ ![](images/beeb4046890bf5004b0f81769e12fa68b175541b587410c51e428be01d998227.jpg)
401
+ Figure 13: Qualitative results of our GRF for novel view depth and RGB estimation on the SyntheticNeRF dataset.
402
+
403
+ ![](images/f8157646fde3d77d5203c0f15aa9ddd82767ee191425ac2129cfeb332f153e56.jpg)
404
+ Figure 14: Qualitative results of our GRF for novel view depth and RGB estimation on the real-world dataset.
405
+
406
+ ![](images/88f1544d6d632c9c8a99ef63ec61bd9fd14e5db337eb9260544d7c69beee1ad9.jpg)
407
+ Figure 15: Qualitative results of our GRF for novel view depth and RGB estimation on the real-world dataset.
408
+
409
+ ![](images/caf80e9622eb47880990dde4703304c939c21246832958437a9bef0ab4ca34d0.jpg)
410
+ Figure 16: Qualitative results of our GRF for novel view depth and RGB estimation on the real-world dataset.
411
+
412
+ ![](images/e60781d9d56ccf57a254173588c4ff5552b76267158d5a3703af27473667497f.jpg)
413
+ Figure 17: Qualitative results of our GRF for novel view depth and RGB estimation on the real-world dataset.
md/train/e8WWUBeafM/e8WWUBeafM.md ADDED
@@ -0,0 +1,377 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bellman-consistent Pessimism for Offline Reinforcement Learning
2
+
3
+ Tengyang Xie UIUC tx10@illinois.edu
4
+
5
+ Ching-An Cheng Microsoft Research chinganc@microsoft.com
6
+
7
+ Nan Jiang UIUC nanjiang@illinois.edu
8
+
9
+ Paul Mineiro Microsoft Research pmineiro@microsoft.com
10
+
11
+ Alekh Agarwal Google Research alekhagarwal@google.com
12
+
13
+ # Abstract
14
+
15
+ The use of pessimism, when reasoning about datasets lacking exhaustive exploration, has recently gained prominence in offline reinforcement learning. Despite the robustness it adds to the algorithm, overly pessimistic reasoning can be equally damaging in precluding the discovery of good policies, which is an issue for the popular bonus-based pessimism. In this paper, we introduce the notion of Bellmanconsistent pessimism for general function approximation: instead of calculating a point-wise lower bound for the value function, we implement pessimism at the initial state over the set of functions consistent with the Bellman equations. Our theoretical guarantees only require Bellman closedness as standard in the exploratory setting, in which case bonus-based pessimism fails to provide guarantees. Even in the special case of linear function approximation where stronger expressivity assumptions hold, our result improves upon a recent bonus-based approach by $\mathcal O ( d )$ in its sample complexity when the action space is finite and small. Remarkably, our algorithms automatically adapt to the best bias-variance tradeoff in the hindsight, whereas most prior approaches require tuning extra hyperparameters a priori.
16
+
17
+ # 1 Introduction
18
+
19
+ Using past experiences to learn improved behavior for future interactions is a critical capability for a Reinforcement Learning (RL) agent. However, robustly extrapolating knowledge from a historical dataset for sequential decision making is highly challenging, particularly in settings where function approximation is employed to generalize across related observations. In this paper, we provide a systematic treatment of such scenarios with general function approximation, and devise algorithms that can provably leverage an arbitrary historical dataset to discover the policy that obtains the largest guaranteed rewards, amongst all possible scenarios consistent with the dataset.
20
+
21
+ The problem of learning a good policy from historical datasets, typically called batch or offline RL, has a long history [see e.g., Precup et al., 2000; Antos et al., 2008; Levine et al., 2020, and references therein]. Many prior works [e.g., Precup et al., 2000; Antos et al., 2008; Chen and Jiang, 2019] make the so-called coverage assumptions on the dataset, requiring the dataset to contain any possible state, action pair or trajectory with a lower bounded probability. These assumptions are evidently prohibitive in practice, particularly for problems with large state and/or action spaces. Furthermore, the methods developed under these assumptions routinely display unstable behaviors such as lack of convergence or error amplification, when coverage assumptions are violated [Wang et al., 2020, 2021].
22
+
23
+ Driven by these instabilities, a growing body of recent literature has pursued a so-called best effort style of guarantee instead. The key idea is to replace the stringent assumptions on the dataset with a dataset-dependent performance bound, which gracefully degrades from guaranteeing a near-optimal policy under standard coverage assumptions to offering no improvement over the data collection policy in the most degenerate case. Algorithmically, these works all leverage the principle of pessimistic extrapolation from offline data and aim to maximize the rewards the trained agent would obtain in the worst possible MDP that is consistent with the observed dataset. These methods have been shown to be typically more robust to the violation of coverage assumptions in practice, and their theoretical guarantees often provide non-trivial conclusions in settings where the previous results did not apply.
24
+
25
+ Even though many such best-effort methods have now been developed, very few works provide a comprehensive theory for using generic function approximation, unlike the setting where the dataset satisfies the coverage assumptions [Antos et al., 2008; Munos, 2003; Szepesvári and Munos, 2005; Munos and Szepesvári, 2008; Farahmand et al., 2010; Chen and Jiang, 2019; Xie and Jiang, 2020]. For example, [Kidambi et al., 2020] provides a partial theory under the assumption of an uncertainty quantification oracle, which however is highly nontrivial to obtain for general function approximation. [Fujimoto et al., 2019; Kumar et al., 2020] develop sound theoretical arguments in the tabular setting, which were only heuristically extended to the function approximation setting. The works that explicitly consider function approximation in their design either use an ad-hoc truncation of Bellman backups [Liu et al., 2020] or strongly rely on particular parameterizations such as linear function approximation [Jin et al., 2021]. In particular, [Liu et al., 2020] additionally requires the ability to approximate stationary distribution of the behavior policy, which is a challenging density estimation problem for complex state spaces and cannot be provably performed in the standard linear MDP setting (see Section 3.1).
26
+
27
+ Our paper takes an important step in this direction. We provide a systematic way to encode pessimism compatible with an arbitrary function approximation class and MDP and give strong theoretical guarantees without requiring any coverage assumptions on the dataset. Our first contribution is an information theoretic algorithm that returns a policy with a small regret to any comparator policy, for which coverage assumptions (approximately) hold with respect to the data collection policy. This regret bound is identical to what can be typically obtained when the coverage assumptions hold for all policies [Antos et al., 2008; Chen and Jiang, 2019]. But our algorithm requires neither the coverage assumptions, nor additional assumptions such as reliable density estimation for the data generating distribution used by existing best-effort approaches [Liu et al., 2020]. We furthermore instantiate these results in the special case of linear parameterization; under the linear MDP assumption, our sample complexity bound leads to a factor of $\mathcal O ( d )$ improvement for a $d$ -dimensional linear MDP, compared with the best known result translated to our discounted setting [Jin et al., 2021], when the action set is small in size. In addition to the information theoretic algorithm, we also develop a computationally practical version of our algorithm using a Lagrangian relaxation combined with recent advances in soft policy iteration [Even-Dar et al., 2009; Geist et al., 2019; Agarwal et al., 2019]. We show that this algorithm can be executed efficiently by querying a (regularized) loss minimization oracle over the value function class, although it has slightly worse theoretical guarantees than the information theoretic version. Both our algorithms display an adaptive property in selecting the best possible form of a bias-variance decomposition, where most prior approaches had to commit to a particular point through their choice of hyperparameters (see the discussion following Theorem 3.1).
28
+
29
+ # 2 Preliminaries
30
+
31
+ Markov Decision Processes We consider dynamical systems modeled as Markov Decision Processes (MDPs). An MDP is specified by $( S , \mathcal { A } , P , R , \gamma , s _ { 0 } )$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $P : \mathcal { S } \times \mathcal { A } \Delta ( \mathcal { S } )$ is the transition function with $\Delta ( \cdot )$ being the probability simplex, $R : \mathcal { S } \times \mathcal { A } [ 0 , R _ { \mathrm { m a x } } ]$ is the reward function, $\gamma \in [ 0 , 1 )$ is the discount factor, and $s _ { 0 }$ is a deterministic initial state, which is without loss of generality. We assume the state and the action spaces are finite but can be arbitrarily large. A (stochastic) policy $\pi : { \mathcal { S } } \Delta ( { \mathcal { A } } )$ specifies a decision-making strategy, and induces a random trajectory $s _ { 0 } , a _ { 0 } , r _ { 0 } , s _ { 1 } , a _ { 1 } , r _ { 1 } , . . . _$ , where $a _ { t } \sim \pi ( \cdot | s _ { t } ) , r _ { t } = R ( \bar { s _ { t } } , a _ { t } ) , \bar { s _ { t + 1 } } \sim P ( \cdot | s _ { t } , a _ { t } ) ,$ $\forall t \geq 0$ . We denote the expected discounted return of a policy $\pi$ as $\begin{array} { r } { J ( \pi ) : = \mathbb { E } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } | \pi ] } \end{array}$ , and the learning goal is to find the maximizer of this value: $\pi ^ { \star } : = \operatorname { a r g m a x } _ { \pi } J ( \pi )$ . A related concept is the policy-specific $Q$ -function, $Q ^ { \pi } : S \times \mathcal { A } \mathbb { R }$ $Q ^ { \pi } ( s , a )$ is the discounted return when the trajectory starts with $( s , a )$ and all remaining actions are taken according to $\pi$ . $Q ^ { \pi }$ is the unique fixed point of the (policy-specific) Bellman operator $\mathcal { T } ^ { \pi } : \mathbb { R } ^ { S \times A } \mathbb { R } ^ { S \times A }$ , defined as:
32
+
33
+ $$
34
+ \forall f , \quad ( T ^ { \pi } f ) ( s , a ) = R ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a ) } [ f ( s ^ { \prime } , \pi ) ] ,
35
+ $$
36
+
37
+ where $f ( s ^ { \prime } , \pi )$ is a shorthand for $\mathbb { E } _ { a ^ { \prime } \sim \pi ( \cdot | s ^ { \prime } ) } [ f ( s ^ { \prime } , a ^ { \prime } ) ]$ .
38
+
39
+ Another important concept is the notion of discounted state-action occupancy, $d _ { \pi } \in \Delta ( S \times \mathcal { A } )$ , defined as $\begin{array} { r } { \hat { d } _ { \pi } ( s , a ) : = ( \hat { 1 ^ { ' } } - \gamma ) \mathbb { E } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { 1 } [ s _ { t } = s , a _ { t } = a ] | \pi ] } \end{array}$ , which characterizes the states and actions visited by a policy $\pi$ .
40
+
41
+ Offline RL In the offline setting, the learner only has access to a pre-collected dataset and cannot directly interact with the environment. We assume the standard i.i.d. data generation protocol in our theoretical derivations, that the offline dataset $\mathcal { D }$ consists of $n$ i.i.d. $( s , a , r , s ^ { \prime } )$ tuples generated as $( s , a ) \sim \mu , r = R ( s , a ) , s ^ { \prime } \sim P ( \cdot | s , a )$ for some data distribution $\mu$ . We will also use $\mathbb { E } _ { \mu } [ \cdot ]$ for taking expectation with respect to $\mu$ . We will frequently use the data-weighted 2-norm (squared) $\| f \| _ { 2 , \mu } : =$ $\mathbb { E } _ { \mu } [ f ^ { 2 } ]$ , and the definition extends when we replace $\mu$ with any other state-action distribution $\nu$ . The empirical approximation of $\| f \| _ { 2 , \mu } ^ { 2 }$ is $\begin{array} { r } { \| f \| _ { 2 , \mathcal { D } } ^ { 2 } : = \frac { 1 } { n } \sum _ { ( s , a , r , s ^ { \prime } ) \in \mathcal { D } } f ( s , a ) ^ { 2 } . } \end{array}$ .
42
+
43
+ Function Approximation Function approximation is crucial to generalizing over large and complex state and action spaces. In this work, we search for a good policy in a policy class $\Pi \subset ( \bar { S } $ $\Delta ( \mathcal { A } ) )$ with the help of a value-function class ${ \mathcal { F } } \subset ( S \times { \mathcal { A } } [ 0 , V _ { \operatorname* { m a x } } ] )$ to model $Q ^ { \pi }$ , where $V _ { \mathrm { m a x } } = R _ { \mathrm { m a x } } / ( 1 - \gamma )$ . Such a combination is commonly found in approximate policy iteration and actor-critic algorithms [e.g., Bertsekas and Tsitsiklis, 1996; Konda and Tsitsiklis, 2000]. For most part of the paper we do not make any structural assumptions on $\Pi$ and $\mathcal { F }$ , making our approach and guarantees applicable to generic function approximators. For simplicity we will assume that these function classes are finite but exponentially large, and use log-cardinality to measure their statistical complexities in the generic results (Section 3 and Section 4). These guarantees easily extend to continuous function classes where log-cardinalities are replaced by the appropriate notions of covering numbers, which we demonstrate when we instantiate our results in the linear function approximation setting and work with continuous linear classes (Section 3.1).
44
+
45
+ We now recall two standard expressivity assumptions on $\mathcal { F }$ [e.g., Antos et al., 2008]. To our knowledge, no existing works on offline RL with insufficient data coverage have provided guarantees under these standard assumptions for general function approximation, and they often require stronger or tweaked assumptions (see Section 1).
46
+
47
+ Assumption 1 (Realizability). For any $\pi \in \Pi$ , we have
48
+
49
+ $$
50
+ \operatorname* { i n f } _ { f \in \mathcal { F } } \operatorname* { s u p } _ { a d m i s s i b l e \nu } \| f - \mathcal { T } ^ { \pi } f \| _ { 2 , \nu } ^ { 2 } \leq \varepsilon _ { \mathcal { F } } ,
51
+ $$
52
+
53
+ where an admissible distribution $\nu$ means that $\nu \in \{ d _ { \pi ^ { \prime } } : \pi ^ { \prime } \in \Pi \}$ .
54
+
55
+ Assumption 1 requires that for every $\pi \in \Pi$ , there exists $f \in { \mathcal { F } }$ that well-approximates $Q ^ { \pi }$ . This assumption is often called realizability.1 Technically this is asserted by requiring $f$ to have small Bellman error w.r.t. $\mathcal { T } ^ { \pi }$ under all possible admissible distributions. As a sufficient condition, we have $\varepsilon _ { \mathcal { F } } = 0$ if $Q ^ { \pi } \in { \mathcal { F } } , \forall \pi \in \Pi$ .
56
+
57
+ Assumption 2 (Completeness). For any $\pi \in \Pi$ , we have
58
+
59
+ $$
60
+ \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \operatorname* { i n f } _ { f ^ { \prime } \in \mathcal { F } } \left. f ^ { \prime } - \mathcal { T } ^ { \pi } f \right. _ { 2 , \mu } ^ { 2 } \leq \varepsilon _ { \mathcal { F } , \mathcal { F } } .
61
+ $$
62
+
63
+ Assumption 2 asserts that $\mathcal { F }$ is approximately closed under $\tau ^ { \pi }$ .2 Such an assumption is widely used in RL theory and can be only avoided in some rare cases [Xie and Jiang, 2021], and the hardness of learning with realizability alone has been established in various settings (e.g., [Weisz et al., 2021; Zanette, 2021]). We also emphasize that we only measure the violation of completeness under $\mu$ and do not need to reason about all admissible distributions.
64
+
65
+ Distribution shift A unique challenge in RL is that the learned policy may induce a state (and action) distribution that is different from the data distribution $\mu$ , and the issue is particularly salient when we do not impose any coverage assumption on $\mu$ . Therefore, it is important to carefully characterize the distribution shift, which we measure using the following definition, which generalizes prior definitions specific to linear function approximation [Agarwal et al., 2019; Duan et al., 2020]:
66
+
67
+ Definition 1. We define $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi )$ as follows to measure the distribution shift from an arbitrary distribution $\nu$ to the data distribution $\mu$ , w.r.t. $\mathcal { F }$ and $\pi$ ,
68
+
69
+ $$
70
+ \mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi ) : = \operatorname* { m a x } _ { f \in \mathcal { F } } \frac { \| f - \mathcal { T } ^ { \pi } f \| _ { 2 , \nu } ^ { 2 } } { \| f - \mathcal { T } ^ { \pi } f \| _ { 2 , \mu } ^ { 2 } } .
71
+ $$
72
+
73
+ Intuitively, $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi )$ measures how well Bellman errors under $\pi$ transfer between the distributions $\nu$ and $\mu$ . For instance, a small value of $\mathcal { C } ( d _ { \pi } ; \mu , \mathcal { F } , \pi )$ enables accurate policy evaluation for $\pi$ using data collected under $\mu$ . More generally, we observe that
74
+
75
+ $$
76
+ \mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi ) \leq \| \nu / \mu \| _ { \infty } : = \operatorname* { s u p } _ { s , a } \frac { \nu ( s , a ) } { \mu ( s , a ) } , \quad \mathrm { f o r ~ a n y } \pi , \mathcal { F } .
77
+ $$
78
+
79
+ and the RHS is a classical notion of bounded distribution ratio for error transfer (e.g., [Munos and Szepesvári, 2008; Chen and Jiang, 2019; Xie and Jiang, 2020]). Moreover, our measure can be tighter than $\| \nu / \mu \| _ { \infty }$ : Even two distributions $\nu$ and $\mu$ that are sufficiently disparate might admit a reasonable transfer, so long as this difference is not detected by $\pi$ and $\mathcal { F }$ . To this end, our definition better captures the crucial role of function approximation in generalizing across different states. As an example, in the special case of linear MDPs, full coverage under our definition (i.e., boundedness of $\mathcal { C }$ for all admissible $\nu$ ) can be implied from the standard coverage assumption for linear MDPs that considers the spectrum of the feature covariance matrix under $\mu$ ; see Section 3.1 for more details.
80
+
81
+ # 3 Information-Theoretic Results with Bellman-consistent Pessimism
82
+
83
+ In this section, we provide our first theoretical result which is information-theoretic, in that it uses a computationally inefficient algorithm. The approach uses the offline dataset to first compute a lower bound on the value of each policy $\pi \in \Pi$ , and then returns the policy with the highest pessimistic value estimate. While this high-level template is at the heart of many recent approaches [e.g., Fujimoto et al., 2019; Kumar et al., 2019; Liu et al., 2020; Kidambi et al., 2020; Yu et al., 2020; Kumar et al., 2020], our main novelty is in the design and analysis of Bellman-consistent pessimism for general function approximation.
84
+
85
+ For a policy $\pi$ , we first form a version space of all the functions $f \in { \mathcal { F } }$ which have a small Bellman error under the evaluation operator $\tau ^ { \pi }$ . We then return the predicted value of $\pi$ in the initial state $s _ { 0 }$ by the functions in this version space. The use of pessimism at the initial state, while maintaining Bellman consistency (by virtue of having a small Bellman error) limits over pessimism, which is harder to preclude in the pointwise pessimistic penalties used in some other works [Jin et al., 2021]. More formally, given a dataset $\mathcal { D }$ , let us define
86
+
87
+ $$
88
+ \mathcal { L } ( f ^ { \prime } , f , \pi ; \mathcal { D } ) : = \frac { 1 } { n } \sum _ { ( s , a , r , s ^ { \prime } ) \in \mathcal { D } } \left( f ^ { \prime } ( s , a ) - r - \gamma f ( s ^ { \prime } , \pi ) \right) ^ { 2 } ,
89
+ $$
90
+
91
+ and an empirical estimate of the Bellman error $\mathcal { E } ( f , \pi ; \mathcal { D } )$ is
92
+
93
+ $$
94
+ \mathcal { E } ( f , \pi ; \mathcal { D } ) : = \mathcal { L } ( f , f , \pi ; \mathcal { D } ) - \operatorname* { m i n } _ { f ^ { \prime } \in \mathcal { F } } \mathcal { L } ( f ^ { \prime } , f , \pi ; \mathcal { D } ) .
95
+ $$
96
+
97
+ Our algorithm. With this notation, our information-theoretic approach finds a policy by optimizing:
98
+
99
+ $$
100
+ \widehat { \pi } = \underset { \pi \in \Pi } { \operatorname { a r g m a x } } \ \underset { f \in \mathcal { F } _ { \pi , \varepsilon } } { \operatorname* { m i n } } f ( s _ { 0 } , \pi ) , \quad \mathrm { w h e r e } \ \mathcal { F } _ { \pi , \varepsilon } = \big \{ f \in \mathcal { F } : \mathcal { E } ( f , \pi ; \mathcal { D } ) \leq \varepsilon \big \} ,
101
+ $$
102
+
103
+ In the formulation above, $\mathcal { F } _ { \pi , \varepsilon }$ is the version space of policy $\pi$ . To better understand the intuition behind the estimator in Equation 3.2, let us define
104
+
105
+ $$
106
+ { \bf \Pi } _ { \pi , \mathrm { m i n } } ^ { \mathrm { r } } : = \operatorname * { a r g m i n } _ { f \in \mathcal { F } _ { \pi , \epsilon } } f ( s _ { 0 } , \pi ) , f _ { \pi , \mathrm { m a x } } : = \operatorname * { a r g m a x } _ { f \in \mathcal { F } _ { \pi , \epsilon } } f ( s _ { 0 } , \pi ) , \mathrm { a n d } \Delta f _ { \pi } ( s , a ) : = f _ { \pi , \mathrm { m a x } } ( s , a ) - f _ { \pi , \mathrm { m i n } } ( s , a ) .
107
+ $$
108
+
109
+ Intuitively, if the parameter $\varepsilon$ is defined to ensure that $Q ^ { \pi }$ (or its best approximation in $\mathcal { F }$ ) is in $\mathcal { F } _ { \pi , \varepsilon }$ , we easily see that $\Delta f _ { \pi } ( s _ { 0 } , \pi )$ is an upper bound on the error in our estimate of $J ( \pi )$ for any $\pi \in \Pi$ . In fact, an easy argument in our analysis shows that if $Q ^ { \pi } \in { \mathcal { F } } _ { \pi , \varepsilon }$ for all $\pi \in \Pi$ , then $\Delta f ( s _ { 0 } , \pi )$ is an upper bound on the regret $J ( \pi ) - J ( \widehat { \pi } )$ of our estimator relative to any $\pi$ we wish to compete with.
110
+
111
+ Theoretical analysis. To leverage this observation, we first define the a critical threshold $\varepsilon _ { r }$ which ensures that (the best approximation of) $Q ^ { \pi }$ is indeed contained in our version spaces for all $\pi$ :
112
+
113
+ $$
114
+ \varepsilon _ { r } : = \frac { 1 3 9 V _ { \mathrm { m a x } } ^ { 2 } \log \frac { | \mathcal { F } | | \Pi | } { \delta } } { n } + 3 9 \varepsilon _ { \mathcal { F } } .
115
+ $$
116
+
117
+ With this definition, we now give a more refined bound on the regret of our algorithm (3.2) by further splitting the error estimate $\Delta f _ { \pi } ( s _ { 0 } , \pi )$ which is random owing to its dependence on the version space, and analyze it through a novel decomposition into on-support and off-support components. While we bound the on-support error using standard techniques, the off-support error is akin to a bias term which captures the interplay between the data collection distribution and function approximation in the quality of the final solution. Also note that our choice of $\varepsilon _ { r }$ requires the knowledge of $\varepsilon { \mathcal { F } }$ , which is a common characteristic of version-space-based algorithms [e.g., Jiang et al., 2017]. The challenge of unknown $\varepsilon _ { F }$ can be possibly addressed using model-selection techniques in practice and we leave further investigation to future work.
118
+
119
+ Theorem 3.1. Let $\varepsilon = \varepsilon _ { r }$ where is $\varepsilon _ { r }$ defined in Eq.(3.3) and $\widehat { \pi }$ be obtained by Eq.(3.2). Then, for any policy $\pi \in \Pi$ and any constant $C _ { 2 } \geq 1$ b, with probability at least $1 - \delta$ ,
120
+
121
+ $$
122
+ \begin{array} { r l } & { I ( \pi ) - J ( \widehat \pi ) \leq \underbrace { \mathcal { O } \left( \displaystyle \frac { V _ { \operatorname* { m a x } } \sqrt { C _ { 2 } } } { 1 - \gamma } \sqrt { \frac { \log \frac { | \mathcal { F } | | \Pi | } { \delta } } { n } } + \frac { \sqrt { C _ { 2 } ( \varepsilon _ { \mathcal { F } , \mathcal { F } } + \varepsilon _ { \mathcal { F } } ) } } { 1 - \gamma } \right) } _ { \mathrm { e r r } _ { \operatorname* { m i n } } ( \pi ) : o n \cdot u p p o r t e r o r } } \\ & { \quad \quad \quad + \frac { 1 } { 1 - \gamma } \cdot \underset { \nu \cdot \mathcal { O } ( \nu ; \mu , \mathcal { F } , \pi ) \leq C _ { 2 } } { \operatorname* { m i n } } \underset { ( s , a ) \in S \times A } { \sum } ( d _ { \pi } \setminus \nu ) ( s , a ) \left[ \Delta f _ { \pi } ( s , a ) - \gamma ( \mathcal { P } ^ { \pi } \Delta f _ { \pi } ) ( s , a ) \right] , } \end{array}
123
+ $$
124
+
125
+ where $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi )$ is defined in Definition $I$ , $( d _ { \pi } \setminus \nu ) ( s , a ) : = \operatorname* { m a x } ( d _ { \pi } ( s , a ) - \nu ( s , a ) , 0 )$ and $( \mathcal P ^ { \pi } f ) ( s , a ) = \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot | s , a ) } [ f ( s ^ { \prime } , \pi ) ]$ for any $f$ .
126
+
127
+ Bias-variance decomposition. Note that decomposition of our error bound into on-support and off-support parts effectively achieves a bias-variance tradeoff. A small value of the concentrability threshold $C _ { 2 }$ requires the choice of the distribution $\nu$ closer to $\mu$ , which results in better estimation error guarantee (which is $\mathcal { O } ( \sqrt { C _ { 2 } / n } ) )$ when we transfer from $\mu$ to $\nu$ , but potentially pays a high bias due to the mismatch between $d _ { \pi }$ and $\nu$ . A larger threshold permits more flexibility in choosing $\nu$ similar to $d _ { \pi }$ for a smaller bias, but results in a larger variance and estimation error. Rather than commit to a particular tradeoff, our estimator automatically adapts to the best possible splitting (Figure 1 illustrates this concept) by allowing us to choose the best threshold $C _ { 2 }$ . The on-support part matches the $n$ rate (fast rate error bound) of API or AVI analysis (e.g., [Pires and Szepesvári, 2012; Lazaric et al., 2012; Chen and Jiang, 2019]). The dependency on horizon is only linear and matches the best previous result with concentrability assumption [Xie and Jiang, 2020]. For the off-support part, it depends on the off-support mass $d _ { \pi } \setminus \nu$ and the “quality” of the off-support estimation: if all value functions in the version space are close to each other in the off-support region for policy $\pi$ , the gap between $J ( \pi )$ and $J ( \widehat { \pi } )$ can still be small even with a large boff-support mass. The following corollary formally states this property.
128
+
129
+ ![](images/9efc325511f863aac091fd74b7ddb94076412c3673defbcfbbcbe122b0ea0604.jpg)
130
+ Figure 1: An example illustrating different on-support and off-support splittings (denoted by two different vertical lines). Different splitting has different $C _ { 2 }$ values, and further yields different bias-variance trade-offs.
131
+
132
+ Corollary 1 (“Double Robustness”). Under conditions of Theorem 3.1, for any $\pi$ and $C _ { 2 } \geq 0$ $\mathrm { e r r } _ { \mathrm { o f f } } ( \pi ) = 0$ when either (1) $\mathcal { C } ( d _ { \pi } ; \mu , \mathcal { F } , \pi ) \le C _ { 2 }$ , or, $( 2 ) \Delta f _ { \pi } - \gamma \mathcal { P } ^ { \pi } \Delta f _ { \pi } \equiv 0$ .
133
+
134
+ Adaptive guarantees by algorithm design. As mentioned above, Theorem 3.1 implicitly selects the best bias-variance decomposition through the best choice of $C _ { 2 }$ in hindsight, with this decomposition being purely a proof technique, not an knob in the algorithm. In contrast, many prior approaches [Liu et al., 2020; Fujimoto et al., 2019; Kumar et al., 2019] employ explicit thresholds to control density ratios in their algorithms, which makes the tradeoff a hyperparameter in their algorithms. Since choosing hyperparameters is particularly challenging in offline RL, where even policy evaluation can be unreliable, this novel axis of adaptivity is an extremely desirable property of our approach.
135
+
136
+ Comparison to guarantees in the exploratory setting. When a dataset with full coverage is given, classical analyses provide near-optimality guarantees that compete with the optimal policy $\pi ^ { \star }$ with a polynomial sample complexity, when $\pi ^ { \star } \in \Pi$ and both realizability and completeness hold for $\mathcal { F }$ ; see [Antos et al., 2008] for a representative analysis. As mentioned earlier, such analysis often requires boundedness of $\| \nu / \mu \| _ { \infty }$ for all admissible distributions $\nu \in \{ d _ { \pi } : \pi \in \Pi \}$ . On the other hand, it is easily seen that we can compete with $\pi ^ { \star }$ under much weaker conditions.
137
+
138
+ Corollary 2 (Competing with optimal policy). Under conditions of Theorem 3.1, if $\mathcal { C } ( d _ { \pi ^ { \star } } ; \mu , \mathcal { F } , \pi ^ { \star } ) \le C _ { 2 }$ , we have
139
+
140
+ $$
141
+ J ( \pi ^ { \star } ) - J ( \widehat \pi ) \leq \mathcal O \left( \frac { V _ { \operatorname* { m a x } } \sqrt { C _ { 2 } } } { 1 - \gamma } \sqrt { \frac { \log \frac { | \mathcal F | | \Pi | } { \delta } } { n } + \frac { \sqrt { C _ { 2 } ( \varepsilon _ { \mathcal F , \mathcal F } + \varepsilon _ { \mathcal F } ) } } { 1 - \gamma } } \right) .
142
+ $$
143
+
144
+ Notably, these milder coverage assumptions in Corollaries 1 and 2 provide offline RL counterparts to the benefits of policy-gradient-style methods with online access to the environment [Kakade and Langford, 2002; Scherrer, 2014; Agarwal et al., 2019].
145
+
146
+ Comparison with Liu et al. [2020]. The closest prior result to our work is that of [Liu et al., 2020], who develop a pessimistic estimator that truncates Bellman backups from state-action pairs infrequently visited by $\mu$ , and analyzes the resulting pessimistic policy and value iteration algorithms under general function approximation. For truncating Bellman backups, however, their work requires estimating the state-action distribution of data, which can be challenging in high-dimensions and they incur additional errors from density estimation which we avoid. Further, their algorithms only compete with policies $\pi$ where $\| d _ { \pi } / \mu \| _ { \infty }$ is bounded instead of the more general result that we provide, and makes their results vacuous in a linear MDP setting under typical feature coverage assumptions.
147
+
148
+ Safe Policy Improvement. Some prior works [e.g. Laroche et al., 2019; Liu et al., 2020] discuss the scenario where the dataset $\mathcal { D }$ is collected with a behavior policy $\pi _ { b }$ with $\mu = d _ { \pi _ { b } }$ , and demonstrate that their algorithms always return a policy competitive with $\pi _ { b }$ . In our setup, this is straightforward as $d _ { \pi _ { b } }$ is always covered, as shown next.
149
+
150
+ Corollary 3 (Bounded degradation from behavior policy). Under conditions of Theorem 3.1, if $\mu = d _ { \pi _ { b } }$ for some policy $\pi _ { b } \in \Pi$ , we have
151
+
152
+ $$
153
+ J ( \pi _ { b } ) - J ( \widehat { \pi } ) \leq \mathcal { O } \left( \frac { V _ { \operatorname* { m a x } } } { 1 - \gamma } \sqrt { \frac { \log \frac { | \mathcal { F } | | \Pi | } { \delta } } { n } } + \frac { \sqrt { \varepsilon _ { \mathcal { F } , \mathcal { F } } + \varepsilon _ { \mathcal { F } } } } { 1 - \gamma } \right) .
154
+ $$
155
+
156
+ Proof sketch of Theorem 3.1. We now briefly describe the core ideas in the proof. More detailed arguments are deferred to the full proof in Appendix B.1.
157
+
158
+ The key to prove Theorem 3.1 is to translate the $J ( \pi ) - J ( \widehat { \pi } )$ to the Bellman error of value functions in the version space $\mathcal { F } _ { \pi , \varepsilon }$ b. Our main proving strategies are as follows:
159
+
160
+ 1. As the selection of $\varepsilon = \varepsilon _ { r }$ ensures the accurate estimation $Q ^ { \pi }$ is contained in the version space $\mathcal { F } _ { \widehat { \pi } , \varepsilon }$ for any $\pi$ , we can obtain $\begin{array} { r } { J ( \pi ) - J ( \widehat \pi ) \leq \operatorname* { m a x } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) - \operatorname* { m i n } _ { f \in \mathcal { F } _ { \widehat \pi , \varepsilon } } f ( s _ { 0 } , \widehat \pi ) + } \end{array}$ bapproximation error. 2. By the optimality of $\widehat { \pi }$ , we have $\begin{array} { r } { \operatorname* { m i n } _ { f \in \mathcal { F } _ { \widehat { \pi } , \varepsilon } } f ( s _ { 0 } , \widehat { \pi } ) \geq \operatorname* { m i n } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) } \end{array}$ . This indicates that $\begin{array} { r } { J ( \pi ) - J ( \widehat { \pi } ) \leq \operatorname* { m a x } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) - \operatorname* { m i n } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) + \mathrm { a p p r o x i m a t i } } \end{array}$ ion error.
161
+
162
+ 3. By using a standard telescoping argument (e.g., [Xie and Jiang, 2020, Lemma 1]), $\begin{array} { r } { \operatorname* { m a x } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) \ - \ \operatorname* { m i n } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } \bar { f } ( s _ { 0 } , \pi ) } \end{array}$ can be upper bounded by the Bellman error of $\mathrm { a r g m a x } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f \mathopen { } \mathclose \bgroup \left( s _ { 0 } , \pi \aftergroup \egroup \right)$ and $\begin{array} { r } { \operatorname * { a r g m i n } _ { f \in \mathcal { F } _ { \pi , \varepsilon } } f ( s _ { 0 } , \pi ) } \end{array}$ over distribution $d _ { \pi }$ .
163
+
164
+ After combining all the three steps above together and considering the distribution shift effect, we complete the proof.
165
+
166
+ # 3.1 Results for Linear Function Approximation
167
+
168
+ Here we perform a case study in linear function approximation. We will show that our results—when instantiated under linear function approximation (with realizability and completeness assumptions)— automatically provides state-of-the-art guarantees, improving over existing results specialized to this setting by a factor of $\mathcal O ( d )$ [Jin et al., 2021] when the action space is finite and small.
169
+
170
+ We recall the linear function approximation setup (we set $R _ { \operatorname* { m a x } } = 1$ and $\begin{array} { r } { V _ { \mathrm { m a x } } = \frac { 1 } { 1 - \gamma } } \end{array}$ for consistency with literature).
171
+
172
+ Definition 2 (Linear Function Approximation). Let $\phi : S \times \mathcal { A } \mathbb { R } ^ { d }$ be a feature mapping. Without loss of generality, we assume $\| \bar { \phi ( s , a ) } \| _ { 2 } \le 1 , \forall ( s , a ) \in \mathcal { S } \times \mathcal { A }$ . We define the value-function class $\mathcal { F } _ { \Phi }$ as $\mathcal { F } _ { \Phi } : = \{ \phi ( \cdot , \cdot ) ^ { \top } \theta : \theta \in \mathbb { R } ^ { d } , \phi ( \cdot , \cdot ) ^ { \top } \theta \in [ 0 , V _ { \operatorname* { m a x } } ] \}$ , and the policy class $\Pi _ { \Phi }$ consists of the greedy policies of each value function in $\mathcal { F } _ { \Phi }$ .
173
+
174
+ Assumption 3 (Realizability and Completeness). $\varepsilon _ { \mathcal { F } , \mathcal { F } } = \varepsilon _ { \mathcal { F } } = 0$ .
175
+
176
+ Note that, when the feature mapping $\phi ( \cdot , \cdot )$ is the one induced by the linear MDP [Jin et al., 2020], it automatically ensure that $\pi ^ { \star } \in \Pi _ { \Phi }$ and $\mathcal { F } _ { \Phi }$ satisfies Assumptions 3. In contrast, we highlight that the standard linear function approximation or linear MDP setup does not entail all the assumptions needed by Liu et al. [2020] as mentioned earlier.
177
+
178
+ Below is our main result in the linear function approximation setting.
179
+
180
+ Theorem 3.2. Suppose the value-function class $\mathcal { F }$ is a linear function class that satisfies realizability and completeness (Definition 2 and Assumption $^ 3$ ) and $\widehat { \pi }$ is the output of Eq.(3.2) using valuefunction class $\mathcal { F } _ { \Phi }$ and policy class $\Pi _ { \Phi }$ . If we choose $\begin{array} { r } { \varepsilon = c V _ { \mathrm { m a x } } ^ { 2 } d \log { \frac { V _ { \mathrm { m a x } } | A | d } { \delta } } / n } \end{array}$ , then, for any policy $\pi : S \Delta ( { \mathcal { A } } )$ , we have
181
+
182
+ $$
183
+ J ( \pi ) - J ( \widehat { \pi } ) \leq \mathcal { O } \left( \frac { V _ { \operatorname* { m a x } } } { 1 - \gamma } \sqrt { \frac { d \log \frac { V _ { \operatorname* { m a x } } | A | d } { \delta } } { n } } \mathbb { E } _ { d _ { \pi } } \left[ \sqrt { \phi ( s , a ) ^ { \mathsf { T } } \Sigma _ { \mathcal { D } } ^ { - 1 } \phi ( s , a ) } \right] \right) ,
184
+ $$
185
+
186
+ where c is an absolute constant, and $\Sigma _ { \mathcal { D } } : = \mathbb { E } _ { \mathcal { D } } \left[ \phi ( s , a ) \phi ( s , a ) ^ { \mathsf { T } } \right]$ .
187
+
188
+ The detailed proof of Theorem 3.2 is provided in Appendix B.2. Our guarantee is structurally very similar to that of Jin et al. [2021, Theorem 4.4], except that we only need linear function approximation with realizability and completeness assumptions, and they consider the finite-horizon linear MDP setting. If we translate their result to the discounted setting by setting $H = \mathcal { O } ( 1 / ( 1 - \gamma ) )$ , we enjoy a net improvement of order $\mathcal O ( d )$ in sample complexity when the action space is finite and small. To make it concrete, that is $\mathcal { O } ( \sqrt { d ^ { 2 } \log ( d n / \delta ) / n } )$ vs. $\mathcal { O } ( \sqrt { d \log ( d \vert A \vert / \delta ) / n } )$ error bounds. The bound also shows that having a full-rank $\Sigma _ { \mathcal { D } }$ (which is ensured by a full-rank covariance under $\mu$ ) is sufficient for consistent offline RL in linear function approximation. Crucially, the full-rank covariance is an easily checkable condition on data, as opposed to unverifiable concentrability assumptions. As a caveat, our results do not imply a computationally efficient algorithm, as a naïve implementation involves evaluating each policy pessimistically to pick the best. We discuss a computationally efficient adaptation of our approach in the next section.
189
+
190
+ # 4 Practical Algorithm — Regularized Offline Policy Optimization
191
+
192
+ A major challenge using the proposed algorithm in Section 3 in practice is that searching the policy with the best pessimistic evaluation over the policy space $\Pi$ is not computationally tractable. In this section, we present a practical algorithm that is computationally efficient assuming access to a (regularized) loss minimization oracle over the value function class $\mathcal { F }$ , and also comes with rigorous theoretical guarantees.
193
+
194
+ Our practical algorithm is summarized in Algorithm 1. It has three key differences from the information-theoretic version in Eq.(3.2):
195
+
196
+ Algorithm 1 PSPI: Pessimistic Soft Policy Iteration
197
+
198
+ Input: Batch data $\mathcal { D }$ , regularization coefficient $\lambda$ .
199
+
200
+ 1: Initialize policy $\pi _ { 1 }$ as the uniform policy.
201
+ 2: for $t = 1 , 2 , \dots , T$ do
202
+ 3: Obtain the pessimistic estimation for $\pi _ { t }$ as $f _ { t }$ ,
203
+
204
+ $$
205
+ f _ { t } \gets \underset { f \in \mathcal { F } } { \mathrm { a r g m i n } } \left( f ( s _ { 0 } , \pi _ { t } ) + \lambda \mathcal { E } ( f , \pi _ { t } ; \mathcal { D } ) \right) ,
206
+ $$
207
+
208
+ where $\mathcal { E } ( f , \pi _ { t } ; \mathcal { D } )$ is defined in Eq.(3.1).
209
+
210
+ 4: Calculate $\pi _ { t + 1 }$ by,
211
+
212
+ $$
213
+ \pi _ { t + 1 } ( a | s ) \propto \pi _ { t } ( a | s ) \exp \left( \eta f _ { t } ( s , a ) \right) , \forall s , a \in \mathcal { S } \times \mathcal { A } .
214
+ $$
215
+
216
+ 5: end for
217
+
218
+ 6: Output $\bar { \pi } : = \mathsf { U n i f } ( \pi _ { [ 1 : T ] } )$
219
+
220
+ ▷ uniformly mix $\pi _ { 1 } , \ldots , \pi _ { T }$ at the trajectory level
221
+
222
+ 1. The pessimistic policy evaluation is now performed via regularization (Line 3) instead of constrained optimization.
223
+
224
+ 2. Instead of searching over an explicit policy space Π, we search over a policy class implicitly induced from $\mathcal { F }$ (defined in Eq.(4.2)) and therefore no longer have a policy class independent of $\mathcal { F }$ separately, which is a common practice in API-style algorithms [Munos, 2003; Antos et al., 2008; Lazaric et al., 2012].
225
+
226
+ 3. We optimize the policy using mirror descent updates, which yields computationally tractable optimization over the implicit policy class. This property has been leveraged in many prior works, although typically in online RL settings [Even-Dar et al., 2009; Agarwal et al., 2019; Geist et al., 2019; Cai et al., 2020; Shani et al., 2020].
227
+
228
+ Note that the use of a specific policy class above can be relaxed if a stronger structural assumption is made on the MDP (e.g., linear MDPs [Jin et al., 2020, 2021]).
229
+
230
+ # 4.1 Analysis of Algorithm 1
231
+
232
+ We now provide the analysis of Algorithm 1 in this section. For ease of presentation, we formally define the implicit policy class for this section:
233
+
234
+ $$
235
+ \Pi _ { \mathrm { S P I } } : = \{ \pi ^ { \prime } ( \cdot | s ) \propto \exp ( \eta \sum _ { i = 1 } ^ { t } f ^ { ( t ) } ( s , \cdot ) ) : 1 \le t \le T , f ^ { ( 1 ) } , \ldots , f ^ { ( i ) } \in \mathcal { F } \} ,
236
+ $$
237
+
238
+ which is the natural policy class for soft policy-iteration approaches. The following theorem describes the performance guarantee of $\bar { \pi }$ .
239
+
240
+ Theorem 4.1. Let $\begin{array} { r } { \lambda = \sqrt [ 3 ] { V _ { \mathrm { m a x } } \big / ( 1 - \gamma ) { } ^ { 2 } \varepsilon _ { r } ^ { 2 } } } \end{array}$ with $\varepsilon _ { r }$ in Eq.(3.3), $\begin{array} { r } { \eta = \sqrt { \frac { \log | \mathcal { A } | } { 2 V _ { \operatorname* { m a x } } ^ { 2 } T } } } \end{array}$ , and $\bar { \pi }$ be obtained from Algorithm 1. For any policy $\pi : S \Delta ( { \mathcal { A } } )$ we wish to compete with, suppose Assumptions 1 and 2 hold with respect to the policy class $\Pi _ { S P I } \cup \{ \pi \}$ . Then, for any constant $C _ { 2 } \geq 1$ , we have with probability at least $1 - \delta$ ,
241
+
242
+ $$
243
+ \begin{array} { r l } & { J ( \pi ) - J ( \overline { { \pi } } ) } \\ & { \leq \underbrace { \mathcal { O } \left( \sqrt { C _ { 2 } } \left( \frac { \sqrt { \varepsilon _ { \mathcal { F } , \mathcal { F } } + \varepsilon _ { \mathcal { F } } } } { 1 - \gamma } + \frac { V _ { \operatorname* { m a x } } } { 1 - \gamma } \sqrt [ 3 ] { \frac { T \log { \frac { | \mathcal { F } | } { \delta } } } { n } } + \sqrt [ 3 ] { \frac { V _ { \operatorname* { m a x } } \varepsilon _ { \mathcal { F } } } { ( 1 - \gamma ) ^ { 2 } } } \right) \right) } _ { \mathrm { e r r } _ { \operatorname* { m i n } } ( \pi ) : o n \cdot s u p p o r e r m r } + \underbrace { \mathcal { O } \left( \frac { V _ { \operatorname* { m a x } } } { 1 - \gamma } \sqrt { \frac { \log { | \mathcal { A } | } } { T } } \right) } _ { \displaystyle 1 - \gamma } } \\ & { + \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \left( \underset { \nu : \mathcal { C } ( \nu ; \mu , F , \pi _ { t } ) \leq C _ { 2 } } { \operatorname* { m i n } } \left| \underset { ( s , a ) \in S \times A } { \sum _ { m } } \frac { \left( d _ { \pi } \setminus \nu \right) ( s , a ) [ f _ { t } ( s , a ) - ( \mathcal { T } ^ { \pi _ { t } } f _ { t } ) ( s , a ) ] } { 1 - \gamma } \right| \right) , } \end{array}
244
+ $$
245
+
246
+ $\operatorname { e r r } _ { \mathrm { o f f } } ( \pi ) .$ {z: off-support error
247
+
248
+ where $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi _ { t } )$ is defined in Definition $^ { l }$ , $( d _ { \pi } \setminus \nu ) ( s , a ) : = \operatorname* { m a x } ( d _ { \pi } ( s , a ) - \nu ( s , a ) , 0 ) .$ .
249
+
250
+ We provide a proof sketch of Theorem 4.1 at the end of this section, and defer the full proof to Appendix C. We now make a few remarks about the results in Theorem 4.1.
251
+
252
+ Measurement of distribution shift effect. Compared with the information-theoretical result (provided in Theorem 3.1), the measurement of distribution shift in Theorem 4.1 depends on the optimization trajectory. That is, it measures the distance between two distribution $\nu$ and $\mu$ by $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi _ { t } )$ $( \pi _ { [ 1 : T ] }$ is the sequence of policies produced by the algorithm) whereas Theorem 3.1 uses $\mathcal { C } ( \nu ; \mu , \mathcal { F } , \pi )$ ( $\pi$ is the baseline policy we compete with). We remark that both of these two measurements are weaker then traditional density-ratio definitions (e.g., [Munos and Szepesvári, 2008; Chen and Jiang, 2019; Xie and Jiang, 2020]) as we demonstrated before, as the dependence of $\mathcal { C }$ on $\pi$ is relatively secondary.
253
+
254
+ Dependence on $T$ . The number of optimization rounds $T$ affects the bound in two opposite ways: as $T$ increases, the optimization error term decreases, whereas the second term of the on-support error increases. The latter increase is due to the complexity of the implicit policy class $\Pi$ growing exponentially with $T$ , which affects our concentration bounds. To optimize the bound, the optimal choice is $T = \mathcal { O } ( n ^ { 2 / 5 } )$ , leading to an overall $\mathcal { O } ( n ^ { - 1 / 5 } )$ rate. While such a rate is relatively slow, we remark that the complexity bound of $\Pi$ is conservative, and in certain cases it is possible to obtain much sharper bounds: for example, in linear function approximation (Section 3.1), $\Pi _ { \mathrm { S P I } }$ are a priori captured by the space of softmax policies, whose complexity has no dependence on $T$ (up to mild logarithmic dependence due to norms). That is, the $\operatorname { e r r } _ { \mathrm { o n } } ( \pi )$ term in Theorem 4.1 reduces to $\widetilde { \mathcal { O } } ( \frac { V _ { \mathrm { m a x } } } { 1 - \gamma } \sqrt [ 3 ] { d / n } )$ $( \varepsilon _ { \mathcal { F } , \mathcal { F } } = \varepsilon _ { \mathcal { F } } = 0$ in linear function approximation), and yields an overall $\mathcal { O } ( n ^ { - 1 / 3 } )$ rate.
255
+
256
+ Bias-variance decomposition. Similar to Theorem 3.1, Theorem 4.1 also allows arbitrary decomposition of the error bound into on-support and off-support components by setting the concentrability threshold $C _ { 2 }$ , which serves as a bias-variance tradeoff as before. In fact, the splitting can be done separately for each $\pi _ { t }$ in $1 \leq t \leq T$ and we omit such flexibility for readability. The optimization error does not depend on the splitting. Our performance guarantee naturally adapts to the best possible decomposition as before. As in Theorem 3.1, if the estimation on the off-support region is “highquality”, we can further simplify the performance guarantees, but the requirement of “high-quality” is different from that of Corollary 1. We make it formal in the following corollary.
257
+
258
+ Corollary 4 (“Double Robustness”). For any $\pi$ and $C _ { 2 } \geq 0$ , $\mathrm { e r r } _ { \mathrm { o f f } } ( \pi ) = 0$ when either (1) $\mathcal { C } ( d _ { \pi } ; \mu , \mathcal { F } , \pi _ { t } ) \le C _ { 2 }$ for all $t \in [ T ]$ , or, (2) $f _ { t } - \mathcal { T } ^ { \pi _ { t } } \Delta f _ { t } \equiv 0$ for all $t \in [ T ]$ .
259
+
260
+ We note that the conditions above depend on the optimization trajectory through their dependence on $\pi _ { t }$ , but can be made algorithm-independent by instead asserting the stronger requirement that $\mathcal { C } ( d _ { \pi } , \mu , \mathcal { F } , \pi ^ { \prime } ) \le C _ { 2 }$ for all $\pi ^ { \prime } \in \Pi _ { \mathrm { S P I } }$ in the first condition.
261
+
262
+ Competing with the optimal policy. As before, we can provide a guarantee for competing with the optimal policy, under coverage assumptions weaker than the typical batch RL literature, albeit slightly stronger than those of Corollary 2. We state the formal result below.
263
+
264
+ Corollary 5 (Competing with optimal policy). Under conditions of Theorem 4.1, if $\mathcal { C } ( d _ { \pi ^ { \star } } ; \mu , \mathcal { F } , \pi ) \le C _ { 2 }$ for all $\pi \in \Pi _ { S P I } ,$ , we have
265
+
266
+ $$
267
+ J ( \pi ^ { \star } ) - J ( \widehat \pi ) \leq \mathcal O \left( \frac { V _ { \operatorname* { m a x } } \sqrt { C _ { 2 } } } { 1 - \gamma } \left( \frac { \log \frac { | \mathcal F | } { \delta } \log | A | } { n } \right) ^ { 1 / 5 } + \frac { \sqrt { C _ { 2 } ( \varepsilon _ { \mathcal F } , \mathcal F + \varepsilon _ { \mathcal F } ) } } { 1 - \gamma } \right) .
268
+ $$
269
+
270
+ Note that the conditions of Corollary 5 are satisfied as before whenever $\| d _ { \pi ^ { \star } } / \mu \| _ { \infty } \leq C _ { 2 }$
271
+
272
+ Computationally-efficient implementation with linear function approximation We remark that our algorithm is computationally efficient when the value-function class $\mathcal { F }$ is linear, that is, $\mathcal { F } : = \{ \phi ( \cdot , \cdot ) ^ { \top } \theta : \theta \in \mathbb { R } ^ { d } \}$ . In this case, the objective of Eq.(4.1) has a closed-form expression which is quadratic in $\theta$ . In addition, under additional matrix invertibility conditions, Eq.(4.1) has a closed-form solution which generalizes LSTDQ [Lagoudakis and Parr, 2003; Sutton et al., 2009; Dann et al., 2014]. A similar connection has been made by Antos et al. [2008], but our derivation is more general. See Appendix Appendix D for further details.
273
+
274
+ We conclude the section with a proof sketch showing the key insights used in establishing the proof.
275
+
276
+ Proof sketch of Theorem 4.1. Our proof constructs a corresponding MDP $\mathcal { M } _ { t }$ for every $f _ { t } , \pi _ { t }$ pair. Each $\mathcal { M } _ { t }$ has the same dynamics as the ground-truth MDP, but chooses a different reward function, such that $f _ { t }$ is the $Q$ -function of $\pi _ { t }$ in $\mathcal { M } _ { t }$ , $Q _ { \mathcal { M } _ { t } } ^ { \pi _ { t } }$ (we use the subscript of $\mathcal { M } _ { t }$ to denote the corresponding value or operator in MDP $\mathcal { M } _ { t }$ ). Our proof relies on some key properties of $\mathcal { M } _ { t }$ , such as $Q ^ { \pi ^ { - } } - T _ { \mathcal { M } _ { t } } ^ { \pi ^ { } } \bar { Q } ^ { \pi } = f _ { t } - \bar { T } ^ { \pi _ { t } } f _ { t }$ . We decompose $J ( \pi ) - J ( \bar { \pi } )$ as follows.
277
+
278
+ $$
279
+ \begin{array} { r l } & { J ( \pi ) - J ( \bar { \pi } ) \le \underbrace { \cfrac { 1 } { T } \displaystyle \sum _ { t = 1 } ^ { T } \left( J _ { \mathcal M _ { t } } ( \pi ) - J _ { \mathcal M _ { t } } ( \pi _ { t } ) \right) } _ { \mathrm { o p t i m i z a t i o n ~ e r r o r ~ } } + \underbrace { \cfrac { 1 } { T } \displaystyle \sum _ { t = 1 } ^ { T } ( J ( \pi ) - J _ { \mathcal M _ { t } } ( \pi ) ) } _ { \mathrm { c o n t r o l e d b y ~ } \| Q ^ { \pi } - T _ { \mathcal M _ { t } } ^ { \pi } Q ^ { \pi } \| _ { 2 , d \pi } = \| f _ { t } - \mathcal T ^ { \pi } t f _ { t } \| _ { 2 , d \pi } } } \\ & { \quad \quad + \underset { \mathrm { a p p r o x i m a t i o n / s t a t i s t i c a l ~ e r r o r s . } } { \mathrm { c o n t r o l e x . } } } \end{array}
280
+ $$
281
+
282
+ The proof is completed by bounding $\| f _ { t } - T ^ { \pi _ { t } } f _ { t } \| _ { 2 , d _ { \pi } }$ on both on-support and off-support regions.
283
+
284
+ # 5 Conclusions
285
+
286
+ This paper investigates sample-efficient offline reinforcement learning without data coverage assumptions (e.g., concentrability). To achieve that goal, our paper contributes several crucial improvements to the literature. We introduce the concept of Bellman-consistent pessimism. It enables the sample-efficient guarantees with only the Bellman-completeness assumption which is standard in the exploratory setting, whereas the point-wise/bonus-based pessimism popularly adopted in the literature usually requires stronger and/or extra assumptions. Algorithmically, we demonstrate how to implicitly infer a policy value lower bound through a version space and provide a tractable implementation. A particularly important aspect of our results is the ability to adapt to the best bias-variance tradeoff in the hindsight, which no prior algorithms achieve to the best of our knowledge. When applying our results in linear function approximation, we attain an $\mathcal O ( d )$ improvement in sample complexity, compared with the best-known recent work of offline RL in linear MDPs, whenever the action space is finite and small.
287
+
288
+ As of limitations and future work, the sample complexity of our practical algorithm is worse than that of the information-theoretic approach, and it will be interesting to close this gap. Another future direction is to empirically evaluate PSPI on benchmarks and compare it to existing approaches.
289
+
290
+ # Acknowledgment
291
+
292
+ Part of this work was carried out while TX and AA worked at Microsoft Research. NJ acknowledges funding support from the ARL Cooperative Agreement W911NF-17-2-0196, NSF IIS-2112471, and Adobe Data Science Research Award.
293
+
294
+ # References
295
+
296
+ Doina Precup, Richard S Sutton, and Satinder P Singh. Eligibility traces for off-policy policy evaluation. In Proceedings of the Seventeenth International Conference on Machine Learning, pages 759–766, 2000.
297
+ András Antos, Csaba Szepesvári, and Rémi Munos. Learning near-optimal policies with bellmanresidual minimization based fitted policy iteration and a single sample path. Machine Learning, 71 (1):89–129, 2008.
298
+ Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
299
+ Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In International Conference on Machine Learning, pages 1042–1051, 2019.
300
+ Ruosong Wang, Dean Foster, and Sham M Kakade. What are the statistical limits of offline rl with linear function approximation? In International Conference on Learning Representations, 2020.
301
+ Ruosong Wang, Yifan Wu, Ruslan Salakhutdinov, and Sham M Kakade. Instabilities of offline rl with pre-trained neural representation. arXiv preprint arXiv:2103.04947, 2021.
302
+
303
+ Rémi Munos. Error bounds for approximate policy iteration. In Proceedings of the Twentieth International Conference on International Conference on Machine Learning, pages 560–567, 2003.
304
+
305
+ Csaba Szepesvári and Rémi Munos. Finite time bounds for sampling based fitted value iteration. In Proceedings of the 22nd international conference on Machine learning, pages 880–887, 2005.
306
+
307
+ Rémi Munos and Csaba Szepesvári. Finite-time bounds for fitted value iteration. Journal of Machine Learning Research, 9(5), 2008.
308
+
309
+ Amir Massoud Farahmand, Rémi Munos, and Csaba Szepesvári. Error propagation for approximate policy and value iteration. In Advances in Neural Information Processing Systems, 2010.
310
+
311
+ Tengyang Xie and Nan Jiang. $\mathbf { Q } ^ { * }$ approximation schemes for batch reinforcement learning: A theoretical comparison. In Conference on Uncertainty in Artificial Intelligence, pages 550–559. PMLR, 2020.
312
+
313
+ Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, and Thorsten Joachims. Morel: Modelbased offline reinforcement learning. In NeurIPS, 2020.
314
+
315
+ Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pages 2052–2062, 2019.
316
+
317
+ Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
318
+
319
+ Yao Liu, Adith Swaminathan, Alekh Agarwal, and Emma Brunskill. Provably good batch reinforce ment learning without great exploration. arXiv preprint arXiv:2007.08202, 2020.
320
+
321
+ Ying Jin, Zhuoran Yang, and Zhaoran Wang. Is pessimism provably efficient for offline rl? In International Conference on Machine Learning, pages 5084–5096. PMLR, 2021.
322
+
323
+ Eyal Even-Dar, Sham M Kakade, and Yishay Mansour. Online markov decision processes. Mathematics of Operations Research, 34(3):726–736, 2009.
324
+
325
+ Matthieu Geist, Bruno Scherrer, and Olivier Pietquin. A theory of regularized markov decision processes. In International Conference on Machine Learning, pages 2160–2169. PMLR, 2019.
326
+
327
+ Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. On the theory of policy gradient methods: Optimality, approximation, and distribution shift. arXiv preprint arXiv:1908.00261, 2019.
328
+
329
+ Dimitri P. Bertsekas and John N. Tsitsiklis. Neuro-Dynamic Programming. Athena Scientific, 1st edition, 1996. ISBN 1886529108.
330
+
331
+ Vijay R Konda and John N Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pages 1008–1014. Citeseer, 2000.
332
+
333
+ Tengyang Xie and Nan Jiang. Batch value-function approximation with only realizability. In International Conference on Machine Learning, pages 11404–11413. PMLR, 2021.
334
+
335
+ Gellért Weisz, Philip Amortila, and Csaba Szepesvári. Exponential lower bounds for planning in mdps with linearly-realizable optimal action-value functions. In Algorithmic Learning Theory, pages 1237–1264. PMLR, 2021.
336
+
337
+ Andrea Zanette. Exponential lower bounds for batch reinforcement learning: Batch rl can be exponentially harder than online rl. In International Conference on Machine Learning, pages 12287–12297. PMLR, 2021.
338
+
339
+ Yaqi Duan, Zeyu Jia, and Mengdi Wang. Minimax-optimal off-policy evaluation with linear function approximation. In International Conference on Machine Learning, pages 2701–2709. PMLR, 2020.
340
+
341
+ Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. Advances in Neural Information Processing Systems, 32:11784–11794, 2019.
342
+
343
+ Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Y Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization. Advances in Neural Information Processing Systems, 33:14129–14142, 2020.
344
+
345
+ Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pages 1704–1713. PMLR, 2017.
346
+
347
+ Bernardo Ávila Pires and Csaba Szepesvári. Statistical linear estimation with penalized estimators: an application to reinforcement learning. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1755–1762, 2012.
348
+
349
+ Alessandro Lazaric, Mohammad Ghavamzadeh, and Rémi Munos. Finite-sample analysis of leastsquares policy iteration. Journal of Machine Learning Research, 13:3041–3074, 2012.
350
+
351
+ Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pages 267–274, 2002.
352
+
353
+ Bruno Scherrer. Approximate policy iteration schemes: a comparison. In International Conference on Machine Learning, pages 1314–1322. PMLR, 2014.
354
+
355
+ Romain Laroche, Paul Trichelair, and Remi Tachet Des Combes. Safe policy improvement with baseline bootstrapping. In International Conference on Machine Learning, pages 3652–3661, 2019.
356
+
357
+ Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pages 2137–2143. PMLR, 2020.
358
+
359
+ Qi Cai, Zhuoran Yang, Chi Jin, and Zhaoran Wang. Provably efficient exploration in policy optimization. In International Conference on Machine Learning, pages 1283–1294. PMLR, 2020.
360
+
361
+ Lior Shani, Yonathan Efroni, Aviv Rosenberg, and Shie Mannor. Optimistic policy optimization with bandit feedback. In International Conference on Machine Learning, pages 8604–8613. PMLR, 2020.
362
+
363
+ Michail G Lagoudakis and Ronald Parr. Least-squares policy iteration. The Journal of Machine Learning Research, 4:1107–1149, 2003.
364
+
365
+ Richard S Sutton, Hamid Reza Maei, Doina Precup, Shalabh Bhatnagar, David Silver, Csaba Szepesvári, and Eric Wiewiora. Fast gradient-descent methods for temporal-difference learning with linear function approximation. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 993–1000, 2009.
366
+
367
+ Christoph Dann, Gerhard Neumann, Jan Peters, et al. Policy evaluation with temporal differences: A survey and comparison. Journal of Machine Learning Research, 15:809–883, 2014.
368
+
369
+ Amit Daniely, Sivan Sabato, Shai Ben-David, and Shai Shalev-Shwartz. Multiclass learnability and the erm principle. In Proceedings of the 24th Annual Conference on Learning Theory, pages 207–232. JMLR Workshop and Conference Proceedings, 2011.
370
+
371
+ Shai Ben-David, Nicolo Cesa-Bianchi, David Haussler, and Philip M Long. Characterizations of learnability for classes of $\{ 0 , \ldots , n \}$ -valued functions. Journal of Computer and System Sciences, 50(1):74–86, 1995.
372
+
373
+ David Haussler and Philip M Long. A generalization of sauer’s lemma. Journal of Combinatorial Theory, Series A, 71(2):219–240, 1995.
374
+
375
+ David Haussler. Sphere packing numbers for subsets of the boolean n-cube with bounded vapnikchervonenkis dimension. Journal of Combinatorial Theory, Series A, 69(2):217–232, 1995.
376
+
377
+ Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018.
md/train/hGmrNwR8qQP/hGmrNwR8qQP.md ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # The Causal-Neural Connection: Expressiveness, Learnability, and Inference
2
+
3
+ Kevin Xia
4
+ CausalAI Lab
5
+ Columbia University
6
+ kmx2000@columbia.edu
7
+ Kai-Zhan Lee
8
+ Bloomberg L.P.
9
+ Columbia University
10
+ kl2792@columbia.edu
11
+ Yoshua Bengio
12
+ MILA
13
+ Université de Montréal
14
+ yoshua.bengio@mila.quebec
15
+
16
+ Elias Bareinboim CausalAI Lab Columbia University eb@cs.columbia.edu
17
+
18
+ # Abstract
19
+
20
+ One of the central elements of any causal inference is an object called structural causal model (SCM), which represents a collection of mechanisms and exogenous sources of random variation of the system under investigation (Pearl, 2000). An important property of many kinds of neural networks is universal approximability: the ability to approximate any function to arbitrary precision. Given this property, one may be tempted to surmise that a collection of neural nets is capable of learning any SCM by training on data generated by that SCM. In this paper, we show this is not the case by disentangling the notions of expressivity and learnability. Specifically, we show that the causal hierarchy theorem (Thm. 1, Bareinboim et al., 2020), which describes the limits of what can be learned from data, still holds for neural models. For instance, an arbitrarily complex and expressive neural net is unable to predict the effects of interventions given observational data alone. Given this result, we introduce a special type of SCM called a neural causal model (NCM), and formalize a new type of inductive bias to encode structural constraints necessary for performing causal inferences. Building on this new class of models, we focus on solving two canonical tasks found in the literature known as causal identification and estimation. Leveraging the neural toolbox, we develop an algorithm that is both sufficient and necessary to determine whether a causal effect can be learned from data (i.e., causal identifiability); it then estimates the effect whenever identifiability holds (causal estimation). Simulations corroborate the proposed approach.
21
+
22
+ # 1 Introduction
23
+
24
+ One of the most celebrated and relied upon results in the science of intelligence is the universality of neural models. More formally, universality says that neural models can approximate any function (e.g., boolean, classification boundaries, continuous valued) with arbitrary precision given enough capacity in terms of the depth and breadth of the network [14, 26, 47, 53]. This result, combined with the observation that most tasks can be abstracted away and modeled as input/output – i.e., as functions – leads to the strongly held belief that under the right conditions, neural networks can solve the most challenging and interesting tasks in AI. This belief is not without merits, and is corroborated by ample evidence of practical successes, including in compelling tasks in computer vision [43], speech recognition [22], and game playing [54]. Given that the universality of neural nets is such a compelling proposition, we investigate this belief in the context of causal reasoning.
25
+
26
+ To start understanding the causal-neural connection – i.e., the non-trivial and somewhat intricate relationship between these modes of reasoning – two standard objects in causal analysis will be instrumental. First, we evoke a class of generative models known as the Structural Causal Model (SCM, for short) [58, Ch. 7]. In words, an SCM $\mathcal { M } ^ { \ast }$ is a representation of a system that includes a collection of mechanisms and a probability distribution over the exogenous conditions (to be formally defined later on). Second, any fully specified SCM $\mathcal { M } ^ { * }$ induces a collection of distributions known as the Pearl Causal Hierarchy (PCH) [5, Def. 9]. The importance of the PCH is that it formally delimits distinct cognitive capabilities (also known as layers; not to be confused with neural nets layers) that can be associated with the human activities of “seeing” (layer 1), “doing” (2), and “imagining” (3) [59, Ch. 1]. 1 Each of these layers can be expressed as a distinct formal language and represents queries that can help to classify different types of inferences [5, Def. 8]. Together, these layers form a strict containment hierarchy [5, Thm. 1]. We illustrate these notions in Fig. 1(a) (left side), where SCM $\mathcal { M } ^ { * }$ induces layers $L _ { 1 } ^ { * } , L _ { 2 } ^ { * } , L _ { 3 } ^ { * }$ of the PCH.
27
+
28
+ Even though each possible statement within these capabilities has well-defined semantics given the true SCM $\mathcal { M } ^ { * }$ [58, Ch. 7], a challenging inferential task arises when one wishes to recover part of the PCH when $\mathcal { M } ^ { * }$ is only partially observed. This situation is typical in the real world aside from some special settings in physics and chemistry where the laws of nature are understood with high precision.
29
+
30
+ ![](images/417e07b98dd85f7bf0b05e787e7106da5014790d1dfe43d0bcf493f9e3609e8b.jpg)
31
+ Figure 1: The l.h.s. contains the unobserved true SCM $\mathcal { M } ^ { \ast }$ that induces the three layers of the PCH. The r.h.s. contains an NCM that is trained to match in layer 1. The matching shading indicates that the two models agree w.r.t. $L _ { 1 }$ while not necessarily agreeing w.r.t. layers 2 and 3.
32
+
33
+ For concreteness, consider the setting where one needs to make a statement about the effect of a new intervention (i.e., about layer 2), but only has observational data from layer 1, which is passively collected.2 Going back to the causalneural connection, one could try to learn a neural model $\mathcal { N }$ using the observational dataset (layer
34
+
35
+ 1) generated by the true SCM $\mathcal { M } ^ { * }$ , as illustrated in Fig. 1(b). Naturally, a basic consistency requirement is that $\mathcal { N }$ should be capable of generating the same distributions as $\mathcal { M } ^ { \ast }$ ; in this case, their layer 1 predictions should match (i.e., $L _ { 1 } = L _ { 1 } ^ { * }$ ). Given the universality of neural models, it is not hard to believe that these constraints can be satisfied in the large sample limit. The question arises of whether the learned model $\mathcal { N }$ can act as a proxy, having the capability of predicting the effect of interventions that matches the $L _ { 2 }$ distribution generated by the true (unobserved) SCM $\mathcal { M } ^ { * }$ . 3 The answer to this question cannot be ascertained in general, as will become evident later on (Corol. 1). The intuitive reason behind this result is that there are multiple neural models that are equally consistent w.r.t. the $L _ { 1 }$ distribution of $\mathcal { M } ^ { * }$ but generate different ${ \bar { L } } _ { 2 }$ -distributions. 4 Even though $\mathcal { N }$ may be expressive enough to fully represent $\mathcal { M } ^ { * }$ (as discussed later on), generating one particular parametrization of $\mathcal { N }$ consistent with $L _ { 1 }$ is insufficient to provide any guarantee regarding higher-layer inferences, i.e., about predicting the effects of interventions $\left( L _ { 2 } \right)$ or counterfactuals $( L _ { 3 } )$ .
36
+
37
+ The discussion above entails two tasks that have been acknowledged in the literature, namely, causal effect identification and estimation. The first – causal identification – has been extensively studied, and general solutions have been developed, such as Pearl’s celebrated do-calculus [57]. Given the impossibility described above, the ingredient shared across current non-neural solutions is to represent assumptions about the unknown $\mathcal { M } ^ { * }$ in the form of causal diagrams [58, 65, 7] or their equivalence classes [28, 60, 29, 71]. The task is then to decide whether there is a unique solution for the causal query based on such assumptions. There are no neural methods today focused on solving this task.
38
+
39
+ The second task – causal estimation – is triggered when effects are determined to be identifiable by the first task. Whenever identifiability is obtained through the backdoor criterion/conditional ignorability [58, Sec. 3.3.1], deep learning techniques can be leveraged to estimate such effects with impressive practical performance [63, 52, 48, 31, 69, 70, 35, 64, 15, 25, 37, 30]. For effects that are identifiable through causal functionals that are not necessarily of the backdoor-form (e.g., frontdoor, napkin), other optimization/statistical techniques can be employed that enjoy properties such as double robustness and debiasedness [32, 33, 34]. Each of these approaches optimizes a particular estimand corresponding to one specific target interventional distribution.
40
+
41
+ Despite all the great progress achieved so far, it is still largely unknown how to perform the tasks of causal identification and estimation in arbitrary settings using neural networks as a generative model, acting as a proxy for the true SCM $\mathcal { M } ^ { * }$ . It is our goal here to develop a general causal-neural framework that has the potential to scale to real-world, high-dimensional domains while preserving the validity of its inferences, as in traditional symbolic approaches. In the same way that the causal diagram encodes the assumptions necessary for the do-calculus to decide whether a certain query is identifiable, our method encodes the same invariances as an inductive bias while being amenable to gradient-based optimization, allowing us to perform both tasks in an integrated fashion (in a way, addressing Pearl’s concerns alluded to in Footnote 4). Specifically, our contributions are as follows:
42
+
43
+ 1. [Sec. 2] We introduce a special yet simple type of SCM that is amenable to gradient descent called a neural causal model (NCM). We prove basic properties of this class of models, including its universal expressiveness and ability to encode an inductive bias representing certain structural invariances (Thm. 1-3). Notably, we show that despite the NCM’s expressivity, it still abides by the Causal Hierarchy Theorem (Corol. 1).
44
+
45
+ 2. [Sec. 3] We formalize the problem of neural identification (Def. 8) and prove a duality between identification in causal diagrams and in neural causal models (Thm. 4). We introduce an operational way to perform inferences in NCMs (Corol. 2-3) and a sound and complete algorithm to jointly train and decide effect identifiability for an NCM (Alg. 1, Corol. 4).
46
+
47
+ 3. [Sec. 4] Building on these results, we develop a gradient descent algorithm to jointly identify and estimate causal effects (Alg. 2).
48
+
49
+ There are multiple ways of grounding these theoretical results. In Sec. 5, we perform experiments with one possible implementation which support the feasibility of the proposed approach. All appendices including proofs, experimental details, and examples can be found in the full technical report [68].
50
+
51
+ # 1.1 Preliminaries
52
+
53
+ In this section, we provide the necessary background to understand this work, following the presentation in [58]. An uppercase letter $X$ indicates a random variable, and a lowercase letter $x$ indicates its corresponding value; bold uppercase $\mathbf { X }$ denotes a set of random variables, and lowercase letter $\mathbf { x }$ its corresponding values. We use $\mathcal { D } _ { X }$ to denote the domain of $X$ and $\mathcal { D } _ { \mathbf { X } } = \mathcal { D } _ { X _ { 1 } } \times \cdot \cdot \cdot \times \mathcal { D } _ { X _ { k } }$ for $\mathbf { X } = \{ X _ { 1 } , \ldots , \bar { X } _ { k } \}$ . We denote $P ( \mathbf { X } )$ as a probability distribution over a set of random variables $\mathbf { X }$ and $P ( \mathbf { X } = \mathbf { x } )$ as the probability of $\mathbf { X }$ being equal to the value of $\mathbf { x }$ under the distribution $P ( \mathbf { X } )$ . For simplicity, we will mostly abbreviate $P ( \mathbf { X } = \mathbf { x } )$ as simply $P ( \mathbf { x } )$ . The basic semantic framework of our analysis rests on structural causal models (SCMs) [58, Ch. 7], which are defined below.
54
+
55
+ Definition 1 (Structural Causal Model (SCM)). An SCM $\mathcal { M }$ is a 4-tuple $\langle { \bf U } , { \bf V } , { \mathcal { F } } , P ( { \bf U } ) \rangle$ , where $\mathbf { U }$ is a set of exogenous variables (or “latents”) that are determined by factors outside the model; $\mathbf { V }$ is a set $\{ V _ { 1 } , V _ { 2 } , \ldots , V _ { n } \}$ of (endogenous) variables of interest that are determined by other variables in the model – that is, in $\mathbf { U } \cup \mathbf { V }$ ; $\mathcal { F }$ is a set of functions $\{ f _ { V _ { 1 } } , f _ { V _ { 2 } } , \ldots , f _ { V _ { n } } \}$ such that each $f _ { i }$ is a mapping from (the respective domains of) $\mathbf { U } _ { V _ { i } } \cup \mathbf { P a } _ { V _ { i } }$ to $V _ { i }$ , where $\mathbf { U } _ { V _ { i } } \subseteq \mathbf { U }$ , $\mathbf { P a } _ { V _ { i } } \subseteq \mathbf { V } \setminus V _ { i }$ , and the entire set $\mathcal { F }$ forms a mapping from $\mathbf { U }$ to $\mathbf { V }$ . That is, for $i = 1 , \ldots , n$ , each $f _ { i } \in \mathcal { F }$ is such that $v _ { i } \gets f _ { V _ { i } } ( \mathbf { p a } _ { V _ { i } } , \mathbf { u } _ { V _ { i } } )$ ; and $P ( \mathbf { u } )$ is a probability function defined over the domain of U. 
56
+
57
+ Each SCM $\mathcal { M }$ induces a causal diagram $G$ where every $V _ { i } \in \mathbf { V }$ is a vertex, there is a directed arrow $( V _ { j } \to V _ { i } )$ ) for every $V _ { i } \in \mathbf { V }$ and $V _ { j } \in P a ( V _ { i } )$ , and there is a dashed-bidirected arrow $( V _ { j } V _ { i } )$ for every pair $V _ { i } , V _ { j } \in \mathbf { V }$ such that $\mathbf { U } _ { V _ { i } }$ and $\mathbf { U } _ { V _ { j } }$ are not independent. For further details on this construction, see [5, Def. 13/16, Thm. 4]. The exogenous $\mathbf { U } _ { V _ { i } }$ ’s are not assumed independent (i.e. Markovianity does not hold). We will consider here recursive SCMs, which implies acyclic diagrams, and that the endogenous variables $( \mathbf { V } )$ are discrete and have finite domains.
58
+
59
+ We show next how an SCM $\mathcal { M }$ gives values to the PCH’s layers; for details on the semantics, see [5, Sec. 1.2]. Superscripts are omitted when unambiguous.
60
+
61
+ Definition 2 (Layers 1, 2 Valuations). An SCM $\mathcal { M }$ induces layer $L _ { 2 } ( \mathcal { M } )$ , a set of distributions over $\mathbf { V }$ , one for each intervention $\mathbf { x }$ . For each $\mathbf { Y } \subseteq \mathbf { V }$ ,
62
+
63
+ $$
64
+ P ^ { \mathcal M } ( \mathbf y _ { \mathbf x } ) = \sum _ { \{ \mathbf u | \mathbf Y _ { \mathbf x } ( \mathbf u ) = \mathbf y \} } P ( \mathbf u ) ,
65
+ $$
66
+
67
+ where ${ \bf Y _ { x } ( u ) }$ is the solution for $\mathbf { Y }$ after evaluating ${ \mathcal { F } } _ { \mathbf { x } } : = \{ f _ { V _ { i } } : V _ { i } \in \mathbf { V } \backslash \mathbf { X } \} \cup \{ f _ { X } x : X \in \mathbf { X } \}$ .
68
+ The specific distribution $P ( \mathbf { V } )$ , where $\mathbf { X }$ is empty, is defined as layer $L _ { 1 } ( \mathcal { M } )$ .
69
+
70
+ In words, an external intervention forcing a set of variables $\mathbf { X }$ to take values $\mathbf { x }$ is modeled by replacing the original mechanism $f _ { X }$ for each $X \in \mathbf { X }$ with its corresponding value in $\mathbf { x }$ . This operation is represented formally by the do-operator, $d o ( \mathbf { X } = \mathbf { x } )$ , and graphically as the mutilation procedure. For the definition of the third layer, $L _ { 3 } ( \mathcal { M } )$ , see Def. 9 in Appendix A or [5, Def. 7].
71
+
72
+ # 2 Neural Causal Models and the Causal Hierarchy Theorem
73
+
74
+ In this section, we aim to resolve the tension between expressiveness and learnability (Fig. 1). To that end, we define a special class of SCMs based on neural nets that is amenable to optimization and has the potential to act as a proxy for the true, unobserved SCM $\mathcal { M } ^ { \ast }$ .
75
+
76
+ Definition 3 (NCM). A Neural Causal Model (for short, NCM) $\widehat { M } ( \pmb \theta )$ over variables $\mathbf { V }$ with parameters $\pmb \theta = \{ \theta _ { V _ { i } } : V _ { i } \in \mathbf { V } \}$ is an SCM $\langle \widehat { \bf U } , { \bf V } , \widehat { \mathcal { F } } , P ( \widehat { \bf U } ) \rangle$ such that
77
+
78
+ • $\widehat { \mathbf { U } } \subseteq \{ \widehat { U } \mathbf { c } : \mathbf { C } \subseteq \mathbf { V } \}$ , where each $\widehat { U }$ is associated with some subset of variables $\mathbf { C } \subseteq \mathbf { V }$ , and $\mathcal { D } _ { \widehat { U } } = [ 0 , 1 ]$ for all $\widehat { U } \in \widehat { \mathbf { U } }$ . (Unobserved confounding is present whenever $| \mathbf { C } | > 1 .$ ) • $\widehat { \mathcal { F } } = \{ \widehat { f } _ { V _ { i } } : V _ { i } \in \mathbf { V } \}$ , where each $\hat { f } _ { V _ { i } }$ is a feedforward neural network parameterized bby $\theta _ { V _ { i } } ~ \in ~ \theta$ mapping values of $\mathbf { U } _ { V _ { i } } \cup \mathbf { P a } _ { V _ { i } }$ to values of $V _ { i }$ for some $\mathbf { P a } _ { V _ { i } } \subseteq \mathbf { V }$ and $\mathbf { U } _ { V _ { i } } = \{ \widehat { U } _ { \mathbf { C } } : \widehat { U } _ { \mathbf { C } } \in \widehat { \mathbf { U } } , V _ { i } \in \mathbf { C } \}$ ;
79
+ • $P ( { \widehat { \mathbf { U } } } )$ is defined s.t. $\widehat { U } \sim \mathrm { U n i f } ( 0 , 1 )$ for each $\widehat { U } \in \widehat { \mathbf { U } }$ .
80
+
81
+ There is a number of remarks worth making at this point.
82
+
83
+ 1. [Relationship $\mathbf { N C M } \to \mathbf { S C M } ]$ By definition, all NCMs are SCMs, which means NCMs have the capability of generating any distribution associated with the PCH’s layers.
84
+
85
+ 2. [Relationship $\mathbf { S C M } \not \to \mathbf { N C M } ]$ On the other hand, not all SCMs are NCMs, since Def. 3 dictates that $\widehat { \bf U }$ follows uniform distributions in the unit interval and $\widehat { \mathcal F }$ are feedforward neural networks.
86
+
87
+ 3. [Non-Markovianity] For any two endogenous variables $V _ { i }$ and $V _ { j }$ , it is the case that $\mathbf { U } _ { V _ { i } }$ and $\mathbf { U } _ { V _ { j } }$ might share an input from $\widehat { \bf U }$ , which will play a critical role in causality, not ruling out a priori the possibility of unobserved confounding and violations of Markovianity.
88
+
89
+ 4. [Universality of Feedforward Nets] Feedforward networks are universal approximators [14, 26] (see also [19]), and any probability distribution can be generated by the uniform one (e.g., see probability integral transform [1]). This suggests that the pair $\langle \widehat { \mathcal { F } } , P ( \widehat { \mathbf { U } } ) \rangle$ may be expressive enough for modeling $\mathcal { M } ^ { \ast }$ ’s mechanisms $\mathcal { F }$ and distribution $P ( \mathbf { U } )$ without loss of generality.
90
+
91
+ 5. [Generalizations / Other Model Classes] The particular modeling choices within the definition above were made for the sake of explanation, and the results discussed here still hold for other, arbitrary classes of functions and probability distributions, as shown in Appendix D.
92
+
93
+ To compare the expressiveness of NCMs and SCMs, we introduce the following definition.
94
+
95
+ Definition 4 $( \mathsf { P } ^ { ( L _ { i } ) }$ -Consistency). Consider two SCMs, $\mathcal { M } _ { 1 }$ and $\mathcal { M } _ { 2 }$ . $\mathcal { M } _ { 2 }$ is said to be $\mathsf { P } ^ { ( L _ { i } ) }$ consistent (for short, $L _ { i }$ -consistent) w.r.t. $\mathcal { M } _ { 1 }$ if $L _ { i } ( \mathcal { M } _ { 1 } ) = L _ { i } ( \mathcal { M } _ { 2 } )$ . 
96
+
97
+ This definition applies to NCMs since they are also SCMs. As shown below, NCMs can not only approximate the collection of functions of the true SCM $\mathcal { M } ^ { \ast }$ , but they can perfectly represent all the observational, interventional, and counterfactual distributions. This property is, in fact, special and not enjoyed by many neural models. (For examples and discussion, see Appendix C and D.1.)
98
+
99
+ Theorem 1 (NCM Expressiveness). For any SCM $\mathcal { M } ^ { \ast } = \langle \mathbf { U } , \mathbf { V } , \mathcal { F } , P ( \mathbf { U } ) \rangle$ , there exists an NCM $\widehat { M } ( \pmb { \theta } ) = \langle \widehat { \mathbf { U } } , \mathbf { V } , \widehat { \mathcal { F } } , P ( \widehat { \mathbf { U } } ) \rangle s . t .$ $\widehat { M }$ is $L _ { 3 }$ -consistent w.r.t. $\mathcal { M } ^ { * }$ . 
100
+
101
+ Thm. 1 ascertains that there is no loss of expressive power using NCMs despite the constraints imposed over its form, i.e., NCMs are as expressive as SCMs. One might be tempted to surmise, therefore, that an NCM can be trained on the observed data and act as a proxy for the true SCM $\mathcal { M } ^ { \ast }$ , and inferences about other quantities of $\mathcal { M } ^ { * }$ can be done through computation directly in $\widehat { \mathcal { M } }$ Unfortunately, this is almost never the case: 5
102
+
103
+ Corollary 1 (Neural Causal Hierarchy Theorem (N-CHT)). Let $\Omega ^ { * }$ and $\Omega$ be the sets of all SCMs and NCMs, respectively. We say that Layer $j$ of the causal hierarchy for NCMs collapses to Layer $i$ $( i < j ,$ ) relative to $\mathcal { M } ^ { \ast } \in \Omega ^ { \ast }$ if $L _ { i } ( \mathcal { M } ^ { * } ) = L _ { i } ( \widehat { M } )$ implies that $L _ { j } ( { \mathcal { M } } ^ { * } ) = L _ { j } ( { \widehat { M } } ) _ { \cdot }$ for all $\widehat { M } \in \Omega$ . Then, with respect to the Lebesgue measure over (a suitable encoding of $L _ { 3 }$ -equivalence classes of) SCMs, the subset in which Layer $j$ of NCMs collapses to Layer i has measure zero. 
104
+
105
+ This corollary highlights the fundamental challenge of performing inferences across the PCH layers even when the target object (NCM $\widehat { \mathcal { M } }$ ) is a suitable surrogate for the underlying SCM $\mathcal { M } ^ { * }$ , in terms of expressiveness and capability of generating the same observed distribution. That is, expressiveness does not mean that the learned object has the same empirical content as the generating model. For concrete examples of the expressiveness of NCMs and why it is insufficient for causal inference, see Examples 1 and 2 in Appendix C.1. Thus, structural assumptions are necessary to perform causal inferences when using NCMs, despite their expressiveness. We discuss next how to incorporate the necessary assumptions into an NCM to circumvent the limitation highlighted by Corol. 1.
106
+
107
+ # 2.1 A Family of Neural-Interventional Constraints (Inductive Bias)
108
+
109
+ In this section, we investigate constraints about $\mathcal { M } ^ { * }$ that will narrow down the hypothesis space and possibly allow for valid cross-layer inferences. One well-studied family of structural constraints comes in the form of a pair comprised of a collection of interventional distributions $\mathcal { P }$ and causal diagram $\mathcal { G }$ , known as a causal bayesian network (CBN) (Def. 15; see also [5, Thm. 4])). The diagram $\mathcal { G }$ encodes constraints over the space of interventional distributions $\mathcal { P }$ which are useful to perform cross-layer inferences (for details, see Appendix C.2). For simplicity, we focus on interventional inferences from observational data. To compare the constraints entailed by distinct SCMs, we define the following notion of consistency:
110
+
111
+ Definition 5 $\mathcal { G }$ -Consistency). Let $\mathcal { G }$ be the causal diagram induced by SCM $\mathcal { M } ^ { * }$ . For any $\mathbf { S C M } \mathcal { M }$ , we say that $\mathcal { M }$ is $\mathcal { G }$ -consistent (w.r.t. $\mathcal { M } ^ { * }$ ) if $\mathcal { G }$ is a CBN for $L _ { 2 } ( \mathcal { M } )$ . 
112
+
113
+ In the context of NCMs, this means that $\mathcal { M }$ would impose the same constraints over $\mathcal { P }$ as the true SCM $\mathcal { M } ^ { \ast }$ (since $\mathcal { G }$ is also a CBN for $L _ { 2 } ( \mathcal { M } ^ { * } )$ by [5, Thm. 4]). Whenever the corresponding diagram $\mathcal { G }$ is known, one should only consider NCMs that are $\mathcal { G }$ -consistent. 6 We provide below a systematic way of constructing $\mathcal { G }$ -consistent NCMs.
114
+
115
+ Definition 6 ( $C ^ { 2 }$ -Component). For a causal diagram $\mathcal { G }$ , a subset $\textbf { C } \subseteq \textbf { V }$ is a complete confounded component (for short, $C ^ { 2 }$ -component) if any pair $V _ { i } , V _ { j } \in \mathbf { C }$ is connected with a bidirected arrow in $\mathcal { G }$ and is maximal (i.e. there is no $C ^ { 2 }$ -component $\mathbf { C ^ { \prime } }$ for which $\mathbf { C } \subset \mathbf { C ^ { \prime } }$ .)
116
+
117
+ Definition 7 $\mathcal { G }$ -Constrained NCM (constructive)).
118
+
119
+ ![](images/d549737122648b37ce8730adf10b7c8c934b5678c6af01f6f02f214b74cbc9fd.jpg)
120
+ Figure 2: The l.h.s. contains the true SCM $\mathcal { M } ^ { \ast }$ that induces PCH’s three layers. The r.h.s. contains an NCM that is trained with layer 1 data. The matching shading indicates that the two models agree with respect to $L _ { 1 }$ while not necessarily agreeing in layers 2 and 3. The causal diagram $\mathcal { G }$ entailed by $\mathcal { M } ^ { * }$ is used as an inductive bias for $\widehat { M }$ .
121
+
122
+ Let $\mathcal { G }$ be the causal diagram induced by SCM $\mathcal { M } ^ { * }$ . Construct NCM $\widehat { M }$ as follows. (1) Choose $\widehat { \bf U }$ s.t. $\widehat { U } _ { \mathbf { C } } \in \widehat { \mathbf { U } }$ if and only if $\mathbf { C }$ is a $C ^ { 2 }$ -component in $\mathcal { G }$ . (2) For each variable $V _ { i } \in \mathbf { V }$ , choose $\mathbf { P a } _ { V _ { i } } \subseteq \mathbf { V }$ s.t. for every $V _ { j } \in \mathbf { V }$ , $V _ { j } \in { \bf P a } _ { V _ { i } }$ if and only if there is a directed edge from $V _ { j }$ to $V _ { i }$ in $\mathcal { G }$ . Any NCM in this family is said to be $\mathcal { G }$ -constrained. 
123
+
124
+ Note that this represents a family of NCMs, not a unique one, since $\pmb \theta$ (the parameters of the neural networks) are not yet specified by the construction, only the scope of the function and independence relations among the sources of randomness $( \widehat { \mathbf { U } } )$ . In contrast to SCMs where both $\langle \mathcal { F } , P ( { \bf u } ) \rangle$ can freely vary, the degrees of freedom within NCMs come from $\pmb { \theta }$ . 7
125
+
126
+ We show next that an NCM constructed following the procedure dictated by Def. 7 encodes all the constraints of the original causal diagram.
127
+
128
+ Theorem 2 (NCM $\mathcal { G }$ -Consistency). Any $\mathcal { G }$ -constrained NCM $\widehat { M } ( \pmb \theta )$ is $\mathcal { G }$ -consistent.
129
+
130
+ We show next the implications of imposing the structural constraints embedded in the causal diagram. Theorem 3 ( $L _ { 2 }$ -G Representation). For any SCM $\mathcal { M } ^ { * }$ that induces causal diagram $\mathcal { G }$ , there exists $a$ $\mathcal { G }$ -constrained NCM $\widehat { M } ( \pmb \theta ) = \langle \widehat { \mathbf { U } } , \mathbf { V } , \widehat { \mathcal { F } } , P ( \widehat { \mathbf { U } } ) \rangle$ that is $L _ { 2 }$ -consistent w.r.t. $\mathcal { M } ^ { * }$ . 
131
+
132
+ The importance of this result stems from the fact that despite constraining the space of NCMs to those compatible with $\mathcal { G }$ , the resultant family is still expressive enough to represent the entire Layer 2 of the original, unobserved SCM $\mathcal { M } ^ { \ast }$ .
133
+
134
+ Fig. 2 provides a mental picture useful to understand the results discussed so far. The true SCM $\mathcal { M } ^ { \ast }$ generates the three layers of the causal hierarchy (left side), but in many settings only observational data (layer 1) is visible. An NCM $\widehat { M }$ trained with this data is capable of perfectly representing $L _ { 1 }$ (right side). For almost any generating $\mathcal { M } ^ { \ast }$ sampled from the space $\Omega ^ { * }$ , there exists an NCM $\widehat { M }$ that exhibits the same behavior with respect to observational data ( $\widehat { M }$ is $L _ { 1 }$ -consistent) but exhibits a different behavior with respect to interventional data. In other words, $L _ { 1 }$ underdetermines $L _ { 2 }$ . (Similarly, $L _ { 1 }$ and $L _ { 2 }$ underdetermine $L _ { 3 }$ [5, Sec. 1.3].) Still, the true SCM $\mathcal { M } ^ { * }$ also induces a causal diagram $\mathcal { G }$ that encodes constraints over the interventional distributions. If we use this collection of constraints as an inductive bias, imposing $G$ -consistency in the construction of the NCM, $\widehat { M }$ may agree with those of the true $\mathcal { M } ^ { \ast }$ under some conditions, which we will investigate in the next section.
135
+
136
+ # 3 The Neural Identification Problem
137
+
138
+ We now investigate the feasibility of causal inferences in the class of $\mathcal { G }$ -constrained NCMs. 8 The first step is to refine the notion of identification [58, pp. 67] to inferences within this class of models.
139
+
140
+ Definition 8 (Neural Effect Identification). Consider any arbitrary SCM $\mathcal { M } ^ { * }$ and the corresponding causal diagram $\mathcal { G }$ and observational distribution $P ( \mathbf { V } )$ . The causal effect $P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ is said to be neural-identifiable from the set of $\mathcal { G }$ -constrained NCMs $\Omega ( { \mathcal { G } } )$ and observational distribution $P ( \mathbf { V } )$ if and only if $P ^ { \widehat { M _ { 1 } } } ( \mathbf { y } \mid d o ( \mathbf { x } ) ) = P ^ { \widehat { M _ { 2 } } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ for every pair of models $\widehat { M } _ { 1 } , \widehat { M } _ { 2 } \in \Omega ( \mathcal { G } )$ s.t. $P ^ { \mathcal { M } ^ { \ast } } ( \mathbf { V } ) = P ^ { \widehat { M } _ { 1 } } ( \mathbf { V } ) = P ^ { \widehat { M } _ { 2 } } ( \mathbf { V } )$ . 
141
+
142
+ In the context of graphical identifiability [58, Def. 3.2.4] and do-calculus, an effect is identifiable if any SCM in $\Omega ^ { * }$ compatible with the observed causal diagram and capable of generating the observational distribution matches the interventional query. If we constrain our attention to NCMs, identification in the general class would imply identification in NCMs, naturally, since it needs to hold for all SCMs. On the other hand, it may be insufficient to constrain identification within the NCM class, like in Def. 8, since it is conceivable that the effect could match within the class (perhaps in a not very expressive neural architecture) while there still exists an SCM that generates the same observational distribution and induces the same diagram, but does not agree in the interventional query; see Example 7 in Appendix C. The next result shows that this is never the case with NCMs, and there is no loss of generality when deciding identification through the NCM class.
143
+
144
+ ![](images/e9fc0048d2f2171a623be409b2e7bd46af6fcf18938f4a284e79f8ff4abfd6ad.jpg)
145
+ Figure 3: $P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ is identifiable from $P ( \mathbf { V } )$ and $\Omega ( { \mathcal { G } } )$ if for any SCM $\mathcal { M } ^ { \ast } \in \Omega ^ { \ast }$ and NCMs $\widehat { M } _ { 1 } , \widehat { M } _ { 2 } \in \Omega$ (top left), $\widehat { M } _ { 1 } , \widehat { M } _ { 2 } , { M } ^ { \ast }$ match in $P ( \mathbf { V } )$ (bottom left) and $\mathcal { G }$ (top right), then the NCMs $\widehat { M } _ { 1 } , \widehat { M } _ { 2 }$ also match in $P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ (bottom right).
146
+
147
+ Theorem 4 (Graphical-Neural Equivalence (Dual ID)). Let $\Omega ^ { * }$ be the set of all SCMs and $\Omega$ the set of NCMs. Consider the true SCM $\mathcal { M } ^ { * }$ and the corresponding causal diagram $\mathcal { G }$ . Let $Q = P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ be the query of interest and $P ( \mathbf { V } )$ the observational distribution. Then, $Q$ is neural identifiable from $\Omega ( { \mathcal { G } } )$ and $P ( \mathbf { V } )$ if and only if it is identifiable from $\mathcal { G }$ and $P ( \mathbf { V } )$ . 
148
+
149
+ In words, Theorem 4 relates the solution space of these two classes of models, which means that the identification status of a query is preserved across settings. For instance, if an effect is identifiable from the combination of a causal graph $\mathcal { G }$ and $P ( \mathbf { v } )$ , it will also be identifiable from $\mathcal { G }$ -constrained NCMs (and the other way around). This is encouraging since our goal is to perform inferences directly through neural causal models, within $\Omega ( { \mathcal { G } } )$ , avoiding the symbolic nature of do-calculus computation; the theorem guarantees that this is achievable in principle.
150
+
151
+ Corollary 2 (Neural Mutilation (Operational ID)). Consider the true SCM $\mathcal { M } ^ { \ast } \in \Omega ^ { \ast }$ , causal diagram $\mathcal { G }$ , the observational distribution $P ( \mathbf { V } )$ , and a target query $Q$ equal to $P ^ { \mathcal { M } ^ { \ast } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ . Let ${ \widehat { \mathcal { M } } } \in \Omega ( \mathcal { G } )$ be a $\mathcal { G }$ -constrained NCM that is $L _ { 1 }$ -consistent with $\mathcal { M } ^ { \ast }$ . If $Q$ is identifiable from $\mathcal { G }$ and $P ( \mathbf { V } )$ , then $Q$ is computable through a mutilation process on a proxy NCM $\widehat { \mathcal { M } }$ , i.e., for each $X \in \mathbf { X }$ , replacing the equation $f _ { x }$ with a constant $x$ $Q =$ PROC-MUTILATION $\widehat { M } ; { \mathbf { X } } = { \mathbf { x } } , { \mathbf { Y } } ) .$ ). 
152
+
153
+ Following the duality stated by Thm. 4, this result provides a practical, operational way of evaluating queries in NCMs: inferences may be carried out through the process of mutilation, which gives semantics to queries in the generating SCM $\mathcal { M } ^ { * }$ (via Def. 2). What is interesting here is that the proposition provides conditions under which this process leads to valid inferences, even when $\mathcal { M } ^ { * }$ is unknown, or when the mechanisms $\mathcal { F }$ and exogenous distribution $P ( \mathbf { U } )$ of $\mathcal { M } ^ { * }$ and the corresponding functions and distribution of the proxy NCM $\widehat { M }$ do not match. (For concreteness, refer to example 5 in Appendix. C.) In words, inferences using mutilation on $\widehat { M }$ would work as if they were on $\mathcal { M } ^ { \ast }$ itself, and they would be correct so long as certain stringent properties were satisfied – $L _ { 1 }$ -consistency, $\mathcal { G }$ -constraint, and identifiability. As shown earlier, if these properties are not satisfied, inferences within a proxy model will almost never be valid, likely bearing no relationship with the ground truth. (For fully worked out instances of this situation, refer to examples 2, 3, or 4 in Appendix C).
154
+
155
+ Still, one special class of SCMs in which any interventional distribution is identifiable is called Markovian, where all $U _ { i }$ are assumed independent and affect only one endogenous variable $V _ { i }$ .
156
+
157
+ Corollary 3 (Markovian Identification). Whenever the $\mathcal { G }$ -constrained NCM $\widehat { \mathcal { M } }$ is Markovian, $P ( \mathbf { y } \mid$ $d o ( \mathbf { x } ) ) ,$ ) is always identifiable through the process of mutilation in the proxy NCM (via Corol. 2).
158
+
159
+ This is obviously not the case for general nonMarkovian models, which leads to the very problem of identification. In these cases, we need to decide whether the mutilation procedure (Corol. 2) can, in principle, produce the correct answer. We show in Alg. 1 a learning procedure that decides whether a certain effect is identifiable from observational data. Intuitively, the procedure searches for two models that respectively minimize and maximize the target query while maintaining $L _ { 1 }$ -consistency with the data distribution. If the $L _ { 2 }$ query values induced by
160
+
161
+ Input : causal query $Q = P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ , $L _ { 1 }$ data $P ( \mathbf { V } )$ , and causal diagram $\mathcal { G }$ Output : $P ^ { \mathcal { M } ^ { \ast } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ if identifiable, FAIL otherwise.
162
+ 1 ${ \widehat { M } } \gets \mathbb { N C M } ( \mathbf { V } , { \mathcal { G } } )$ // from Def. 7
163
+ 2 $\pmb { \theta } _ { \mathrm { m i n } } ^ { * } \mathrm { a r g } \mathrm { m i n } _ { \pmb { \theta } } P ^ { \hat { M } ( \pmb { \theta } ) } ( \mathbf { y } | d o ( \mathbf { x } ) )$ s.t. $L _ { 1 } ( \widehat { M } ( \pmb \theta ) ) = P ( \mathbf { V } )$
164
+ 3 $\pmb { \theta } _ { \mathrm { m a x } } ^ { * } \arg \operatorname* { m a x } _ { \pmb { \theta } } P ^ { \widehat { M } ( \pmb { \theta } ) } ( \mathbf { y } | d o ( \mathbf { x } ) )$ s.t. $L _ { 1 } ( \widehat { M } ( \pmb \theta ) ) = P ( \mathbf { V } )$
165
+ 4 $\mathbf { f } P ^ { \widehat { M } ( \pmb { \theta } _ { \operatorname* { m i n } } ^ { * } ) } ( \mathbf { y } \mid d o ( \mathbf { x } ) ) \neq P ^ { \widehat { M } ( \pmb { \theta } _ { \operatorname* { m a x } } ^ { * } ) } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ then
166
+ 5 return FAIL
167
+ 6 else
168
+ 7 return P Mc(θ∗min)(y | do(x)) // choose min or max arbitrarily
169
+
170
+ the two models are equal, then the effect is identifiable, and the value is returned; otherwise, the effect is non-identifiable. Remarkably, the procedure is both necessary and sufficient, which means that all, and only, identifiable effects are classified as such by our procedure. This implies that, theoretically, deep learning could be as powerful as the do-calculus in deciding identifiability. (For a more nuanced discussion of symbolic versus optimization-based approaches for identification, see Appendix C.4. For non-identifiability examples and further discussion, see C.3.)
171
+
172
+ Corollary 4 (Soundness and Completeness). Let $\Omega ^ { * }$ be the set of all SCMs, $\mathcal { M } ^ { \ast } \in \Omega ^ { \ast }$ be the true SCM inducing causal diagram $\mathcal { G }$ , $Q = P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ be a query of interest, and $\widehat { Q }$ be the result from running Alg. 1 with inputs $P ^ { * } ( \mathbf { V } ) = L _ { 1 } ( \mathcal { M } ^ { * } ) > 0 , \mathcal { G } ,$ , and $Q$ . Then $Q$ is identifiable from $\mathcal { G }$ and $P ^ { * } ( \mathbf { V } )$ if and only $i f \widehat { Q }$ is not FAIL. Moreover, if $\widehat { Q }$ is not FAIL, then $\widehat { Q } = P ^ { \mathcal { M } ^ { \ast } } \left( \mathbf { y } \mid d o ( \mathbf { x } ) \right)$ . 
173
+
174
+ # 4 The Neural Estimation Problem
175
+
176
+ While identifiability is fully solved by the asymptotic theory discussed so far (i.e., it is both necessary and sufficient), we now consider the problem of estimating causal effects in practice under imperfect optimization and finite samples and computation. For concreteness, we discuss next the discrete case with binary variables, but our construction extends naturally to categorical and continuous variables (see Appendix B). We propose next a construction of a $\mathcal { G }$ -constrained NCM ${ \widehat { M } } ( { \mathcal { G } } ; \theta ) =$ $\langle \widehat { \bf U } , { \bf V } , \widehat { \mathcal { F } } , P ( \widehat { \bf U } ) \rangle$ , which is a possible instantiation of Def. 7:
177
+
178
+ $$
179
+ \begin{array} { r } { \{ \begin{array} { l l } { \mathbf { V } } & { : = \mathbf { V } , \widehat { \mathbf { U } } : = \{ U _ { \mathbf { C } } : \mathbf { C } \in C ^ { 2 } ( \mathcal { G } ) \} \cup \{ G _ { V _ { i } } : V _ { i } \in \mathbf { V } \} , } \\ { \widehat { \mathcal { F } } } & { : = \{ f _ { V _ { i } } : = \arg \operatorname* { m a x } _ { j \in \{ 0 , 1 \} } g _ { j , V _ { i } } + \{ \log \sigma ( \phi _ { V _ { i } } ( \mathbf { p a } _ { V _ { i } } , \mathbf { u } _ { V _ { i } } ^ { c } ; \theta _ { V _ { i } } ) ) } & { j = 1 } \\ { P ( \widehat { \mathbf { U } } ) } & { : = \{ U _ { \mathbf { C } } \sim \mathrm { U n i f } ( 0 , 1 ) : U _ { \mathbf { C } } \in \mathbf { U } \} \cup } \\ & { \{ G _ { j , V _ { i } } \sim \mathrm { G u m b e l } ( 0 , 1 ) : V _ { i } \in \mathbf { V } , j \in \{ 0 , 1 \} \} , } \end{array} } \end{array}
180
+ $$
181
+
182
+ where $\mathbf { V }$ are the nodes of $\mathcal { G }$ ; $\sigma : \mathbb { R } ( 0 , 1 )$ is the sigmoid activation function; $C ^ { 2 } ( { \mathcal { G } } )$ is the set of $C ^ { 2 }$ -components of $\mathcal { G }$ ; each $G _ { j , V _ { i } }$ is a standard Gumbel random variable [24]; each $\dot { \phi _ { V _ { i } } } ( \cdot ; \theta _ { V _ { i } } )$ is a neural net parameterized by $\theta _ { V _ { i } } \in \pmb \theta$ ; $\mathbf { p a } _ { V _ { i } }$ are the values of the parents of $V _ { i }$ ; and ${ \bf { u } } _ { V _ { i } } ^ { c }$ are the values of $\mathbf { U } _ { V _ { i . } } ^ { c } : = \{ U _ { \mathbf { C } } : U _ { \mathbf { C } } \in \mathbf { U }$ s.t. $V _ { i } \in \mathbf { C } \}$ . The parameters $\pmb { \theta }$ are not yet specified and must be learned through training to enforce $L _ { 1 }$ -consistency (Def. 4).
183
+
184
+ Let ${ \bf U } ^ { c }$ and $\mathbf { G }$ denote the latent $C ^ { 2 }$ -component variables and Gumbel random variables, respectively. To estimate $P ^ { \widehat { M } } ( \mathbf { v } )$ and $P ^ { \widehat { M } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ given Eq. 2, we may compute the probability mass of a datapoint $\mathbf { v }$ with intervention $d o ( \mathbf { X } = \mathbf { x } )$ ( $\mathbf { X }$ is empty when observational) as:
185
+
186
+ $$
187
+ P ^ { \widehat M ( \mathcal G ; \pmb \theta ) } ( \mathbf v \mid d o ( \mathbf x ) ) = \underset { P ( \mathbf u ^ { c } ) } { \mathbb { E } } \left[ \prod _ { V _ { i } \in \mathbf V \backslash \mathbf X } \tilde { \sigma } _ { v _ { i } } \right] \approx \frac { 1 } { m } \sum _ { j = 1 } ^ { m } \prod _ { V _ { i } \in \mathbf V \backslash \mathbf X } \tilde { \sigma } _ { v _ { i } } ,
188
+ $$
189
+
190
+ where $\tilde { \sigma } _ { v _ { i } } : = \left\{ \begin{array} { l l } { \sigma ( \phi _ { i } ( \mathbf { p a } _ { V _ { i } } , \mathbf { u } _ { V _ { i } } ^ { c } ; \boldsymbol { \theta } _ { V _ { i } } ) ) } & { v _ { i } = 1 } \\ { 1 - \sigma ( \phi _ { i } ( \mathbf { p a } _ { V _ { i } } , \mathbf { u } _ { V _ { i } } ^ { c } ; \boldsymbol { \theta } _ { V _ { i } } ) ) } & { v _ { i } = 0 } \end{array} \right.$ and $\{ \mathbf { u } _ { j } ^ { c } \} _ { j = 1 } ^ { m }$ are samples from $P ( \mathbf { U } ^ { c } )$ . Here, we assume $\mathbf { v }$ is consistent with $\mathbf { x }$ (the values of $X \in \mathbf { X }$ in $\mathbf { v }$ match the corresponding ones of $\mathbf { x }$ ). Otherwise, $P ^ { \widehat { M } ( \mathcal { G } ; \pmb { \theta } ) } ( \mathbf { v } \mid d o ( \mathbf { x } ) ) = 0 .$ . For numerical stability of each $\phi _ { i } ( \cdot )$ , we work in log-space and use the log-sum-exp trick.
191
+
192
+ Alg. 1 (lines 2-3) requires non-trivial evaluations of expressions like arg maxθ $P ^ { \widehat { M } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ while enforcing $L _ { 1 }$ -consistency. Whenever only finite samples are available $\{ \mathbf { v } _ { k } \} _ { k = 1 } ^ { n } \sim P ^ { * } ( \mathbf { V } )$ , the parameters of an $L _ { 1 }$ -consistent NCM may be estimated by minimizing data negative log-likelihood:
193
+
194
+ $$
195
+ \begin{array} { r l } & { \pmb \theta \in \arg \underset { \pmb \theta } { \mathrm { m i n } } \frac { \mathbb { E } _ { P ^ { * } ( \mathbf { v } ) } } { \pmb \theta } \left[ - \log P ^ { \widehat { M } ( \mathcal { G } ; \pmb \theta ) } ( \mathbf { v } ) \right] } \\ & { \quad \approx \arg \underset { \pmb \theta } { \mathrm { m i n } } \frac { 1 } { n } \sum _ { k = 1 } ^ { n } - \log \widehat { P } _ { m } ^ { \widehat { M } ( \mathcal { G } ; \pmb \theta ) } ( \mathbf { v } _ { k } ) . } \end{array}
196
+ $$
197
+
198
+ Input : Data $\{ \mathbf { v } _ { k } \} _ { k = 1 } ^ { n }$ , variables $\mathbf { v }$ , $\mathbf { X } \subseteq \mathbf { V }$ , $\mathbf { x } \in { \mathcal { D } } _ { \mathbf { x } } , \mathbf { Y } \subseteq \mathbf { V } , \mathbf { y } \in { \mathcal { D } } \mathbf { x }$ , causal diagram $\mathcal { G }$ , number of Monte Carlo samples $_ m$ , regularization constant $\lambda$ , learning rate $\eta$ 1 $\widehat { M } \gets \mathbb { N } \mathbf { C } \mathbb { M } ( \mathbf { V } , \mathcal { G } )$ // from Def. 7 c2 Initialize parameters $\theta _ { \mathrm { m i n } }$ and $\theta _ { \mathrm { m a x } }$ 3 for $k \gets 1$ to $_ n$ do // Estimate from Eq. 3 4 $\hat { p } _ { \mathrm { m i n } } \gets$ Estimate $( \widehat { M } ( \pmb { \theta } _ { \operatorname* { m i n } } ) , \mathbf { V } , \mathbf { v } _ { k } , \emptyset , \emptyset , m )$ 5 $\hat { p } _ { \mathrm { m a x } } \gets$ Estimate $\widehat { ( M } ( \pmb { \theta } _ { \operatorname* { m a x } } ) , \mathbf { V } , \mathbf { v } _ { k } , \emptyset , \emptyset , m )$ 6 $\hat { q } _ { \mathrm { m i n } } \gets 0$ 7 $\hat { q } _ { \mathrm { m a x } } \gets 0$ 8 for $\mathbf { v } \in { \mathcal { D } } \mathbf { v }$ do 9 if Consistent $( \mathbf { v } , \mathbf { y } )$ then 10 $\hat { q } _ { \mathrm { m i n } } \gets \hat { q } _ { \mathrm { m i n } } +$ Estimate(M(θmin), V, v, X, x, m) 11 ˆqmax ← ˆqmax+ Estimate(M(θmax), V, v, X, x, m) // $\mathcal { L }$ from Eq. 5 12 ${ \mathcal { L } } _ { \operatorname* { m i n } } \gets - \log \hat { p } _ { \operatorname* { m i n } } - \lambda \log ( 1 - \hat { q } _ { \operatorname* { m i n } } )$ 13 min Lmax ← − log ˆpmax − λ log ˆqmax 14 θmin ← θmin + η∇Lmin 15 θmax ← θmax + η∇Lmax
199
+
200
+ To simultaneously maximize $P ^ { \widehat { M } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ , we subtract a weighted second term $\log \widehat { P _ { m } ^ { M } } ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ resulting in the objective $\mathcal { L } ( \{ \mathbf { v } _ { k } \} _ { k = 1 } ^ { n } )$ equal to
201
+
202
+ $$
203
+ \frac { 1 } { n } \sum _ { k = 1 } ^ { n } - \log \widehat { P } _ { m } ^ { \widehat { M } } ( { \mathbf v } _ { k } ) - \lambda \log \widehat { P } _ { m } ^ { \widehat { M } } ( { \mathbf y } \mid d o ( { \mathbf x } ) ) ,
204
+ $$
205
+
206
+ where $\lambda$ is initially set to a high value and decreases during training. To minimize, we instead subtract $\lambda \log ( 1 - \widehat { P } _ { m } ^ { \widehat { M } } ( \mathbf { y } \mid d o ( \mathbf { x } ) ) )$ from the log-likelihood.
207
+
208
+ ![](images/0101da8162c6b73d420c98d91e7796716ddf09cd2b4f8f5ed6c781ef70fd9992.jpg)
209
+ Figure 4: Experimental results on deciding identifiability with NCMs. Top: Graphs from left to right: (ID cases) back-door, front-door, M, napkin; (not ID cases) bow, extended bow, IV, bad M. Middle: Classification accuracy over 3,000 training epochs from running hypothesis test on Eq. 6 with $\tau = 0 . 0 1$ (blue), 0.03 (green), 0.05 (red). Bottom: (1, 5, 10, 25, 50, 75, 90, 95, 99)-percentiles for max-min gaps over 3000 training epochs.
210
+
211
+ Alg. 2 is one possible way of optimizing the parameters $\pmb \theta$ required in lines 2,3 of Alg. 1. Eq. 5 is amenable to optimization through standard gradient descent tools, e.g., [38, 51, 50]. 9 10
212
+
213
+ One way of understanding Alg. 1 is as a search within the $\Omega ( { \mathcal { G } } )$ space for two NCM parameterizations, $\theta _ { \mathrm { m i n } } ^ { * }$ and $\theta _ { \mathrm { m a x } } ^ { * }$ , that minimizes/maximizes the interventional distribution, respectively. Whenever the optimization ends, we can compare the corresponding $P ( \mathbf { y } \mid d o ( \mathbf { x } ) )$ and determine whether an effect is identifiable. With perfect optimization and unbounded resources, identifiability entails the equality between these two quantities. In practice, we rely on a hypothesis testing step such as
214
+
215
+ $$
216
+ \vert f ( \widehat { M } ( \pmb { \theta } _ { \mathrm { m a x } } ) ) - f ( \widehat { M } ( \pmb { \theta } _ { \mathrm { m i n } } ) ) \vert < \tau
217
+ $$
218
+
219
+ for quantity of interest $f$ and a certain threshold $\tau$ . This threshold is somewhat similar to a significance level in statistics and can be used to control certain types of errors. In our case, the threshold $\tau$ can be determined empirically. For further discussion, see Appendix B.
220
+
221
+ # 5 Experiments
222
+
223
+ We start by evaluating NCMs (following Eq. 2) in their ability to decide whether an effect is identifiable through Alg. 2. Observational data is generated from 8 different SCMs, and their corresponding causal diagrams are shown in Fig. 4 (top part), and Appendix B provides further details of the parametrizations. Since the NCM does not have access to the true SCM, the causal diagram and generated datasets are passed to the algorithm to decide whether an effect is identifiable. The target effect is $P ( Y \mid d o ( X ) )$ , and the quantity we optimize is the average treatment effect (ATE) of $X$ on $Y$ , A $\Im T E _ { \mathcal { M } } ( X , Y ) = \mathbb { E } _ { \mathcal { M } } [ Y \mid d o ( X = 1 ) ] - \mathbb { E } _ { \mathcal { M } } [ Y \mid d o ( X = 0 ) ] .$ Note that if the outcome $Y$ is binary, as in our examples, $\mathbb { E } [ Y \mid d o ( X = x ) ] = P ( Y = 1 | d o ( X = x ) )$ . The effect is identifiable through do-calculus in the settings represented by Fig. 4 in the left part, and not identifiable in right.
224
+
225
+ The bottom row of Fig. 4 shows the max-min gaps, the l.h.s of Eq. 6 with $f ( \mathcal { M } ) = \mathrm { A T E } _ { \mathcal { M } } ( X , Y )$ , over 3000 training epochs. The parameter $\lambda$ is set to 1 at the beginning, and decreases logarithmically over each epoch until it reaches 0.001 at the end of training. The max-min gaps can be used to classify the quantity as “ID” or “non-ID” using the hypothesis testing procedure described in Appendix B. The classification accuracies per training epoch are shown in Fig. 4 (middle row). Note that in identifiable settings, the gaps slowly reduce to 0, while the gaps rapidly grow and stay high throughout training in the unidentifiable ones. The classification accuracy for ID cases then gradually increases as training progresses, while accuracy for non-ID cases remain high the entire time (perfect in the bow and IV cases).
226
+
227
+ In the identifiable settings, we also evaluate the performance of the NCM at estimating the correct causal effect, as shown in Fig. 5. As a generative model, the NCM is capable of generating samples from both $P ( \mathbf { V } )$ and identifiable $L _ { 2 }$ distributions like $P ( Y \mid d o ( X ) )$ . We compare the NCM to a naïve generative model trained via likelihood maximization fitted on $P ( \mathbf { V } )$ without using the inductive bias of the NCM. Since the naïve model is not defined to sample from $P ( y \mid d o ( x ) )$ , this shows the implications of arbitrarily choosing $P ( y \mid d o ( x ) ) = P ( y \mid x )$ . Both models improve at fitting $P ( \mathbf { V } )$ with more samples, but the naïve model fails to learn the correct ATE except in case (c), where $P ( y \mid d o ( x ) ) = P ( y \mid x )$ Further, the NCM is competitive with WERM [33], a state-of-the-art estimation method that directly targets estimating the causal effect without generating samples.
228
+
229
+ ![](images/83343d5d268ecdd2047bcbc8dde185b1594541f6ce61d239a4fff784f684782b.jpg)
230
+ Figure 5: NCM estimation results for ID cases. Columns a, b, c, d correspond to the same graphs as a, b, c, d in Fig. 4. Top: KL divergence of $P ( \mathbf { V } )$ induced by naïve model (blue) and NCM (orange) compared to $P ^ { M ^ { * } } ( \mathbf { V } )$ . Bottom: MAE of ATE of naïve model (blue), NCM (orange), and WERM (green). Plots in log-log scale.
231
+
232
+ # 6 Conclusions
233
+
234
+ In this paper, we introduced neural causal models (NCMs) (Def. 3, 18), a special class of SCMs trainable through gradient-based optimization techniques. We showed that despite being as expressive as SCMs (Thm. 1), NCMs are unable to perform cross-layer inferences in general (Corol. 1). Disentangling expressivity and learnability, we formalized a new type of inductive bias based on nonparametric, structural properties of the generating SCM, accompanied with a constructive procedure that allows NCMs to represent constraints over the space of interventional distributions akin to causal diagrams (Thm. 2). We showed that NCMs with this bias retain their full expressivity (Thm. 3) but are now empowered to solve canonical tasks in causal inference, including the problems of identification and estimation (Thm. 4). We grounded these results by providing a training procedure that is both sound and complete (Alg. 1, 2, Cor. 4). Practically speaking, different neural implementations – combination of architectures, training algorithms, loss functions – can leverage the framework results introduced in this work (Appendix D.1). We implemented one of such alternatives as a proof of concept, and experimental results support the feasibility of the proposed approach. After all, we hope the causal-neural framework established in this paper can help develop more principled and robust architectures to empower the next generation of AI systems. We expect these systems to combine the best of both worlds by (1) leveraging causal inference capabilities of processing the structural invariances found in nature to construct more explainable and generalizable decision-making procedures, and (2) leveraging deep learning capabilities to scale inferences to handle challenging, high dimensional settings found in practice.
235
+
236
+ # Acknowledgements
237
+
238
+ We thank Judea Pearl, Richard Zemel, Yotam Alexander, Juan Correa, Sanghack Lee, and Junzhe Zhang for their valuable feedback. Kevin Xia and Elias Bareinboim were supported in part by funding from the NSF, Amazon, JP Morgan, and The Alfred P. Sloan Foundation. Yoshua Bengio was supported in part by funding from CIFAR, NSERC, Samsung, and Microsoft.
239
+
240
+ # References
241
+
242
+ [1] Angus, J. E. (1994). The probability integral transform and related results. SIAM Review, 36(4):652–654. [2] Appel, L. J., Moore, T. J., Obarzanek, E., Vollmer, W. M., Svetkey, L. P., Sacks, F. M., Bray, G. A., Vogt, T. M., Cutler, J. A., Windhauser, M. M., and et al. (1997). A clinical trial of the effects of dietary patterns on blood pressure. New England Journal of Medicine, 336(16):1117–1124.
243
+
244
+ [3] Balke, A. and Pearl, J. (1994). Counterfactual Probabilities: Computational Methods, Bounds, and Applications. In de Mantaras, R. L. and D.˜Poole, editors, Uncertainty in Artificial Intelligence 10, pages 46–54. Morgan Kaufmann, San Mateo, CA.
245
+ [4] Bareinboim, E., Brito, C., and Pearl, J. (2012). Local Characterizations of Causal Bayesian Networks. In Croitoru, M., Rudolph, S., Wilson, N., Howse, J., and Corby, O., editors, Graph Structures for Knowledge Representation and Reasoning, pages 1–17, Berlin, Heidelberg. Springer Berlin Heidelberg.
246
+ [5] Bareinboim, E., Correa, J. D., Ibeling, D., and Icard, T. (2020). On Pearl’s Hierarchy and the Foundations of Causal Inference. Technical Report R-60, Causal AI Lab, Columbia University, Also, In “Probabilistic and Causal Inference: The Works of Judea Pearl” (ACM Turing Series), in press.
247
+ [6] Bareinboim, E., Forney, A., and Pearl, J. (2015). Bandits with unobserved confounders: A causal approach. In Advances in Neural Information Processing Systems, pages 1342–1350.
248
+ [7] Bareinboim, E. and Pearl, J. (2016). Causal inference and the data-fusion problem. In Shiffrin, R. M., editor, Proceedings of the National Academy of Sciences, volume 113, pages 7345–7352. National Academy of Sciences.
249
+ [8] Bengio, Y., Deleu, T., Rahaman, N., Ke, R., Lachapelle, S., Bilaniuk, O., Goyal, A., and Pal, C. (2020). A meta-transfer objective for learning to disentangle causal mechanisms. In Proceedings of the International Conference on Learning Representations (ICLR).
250
+ [9] Blei, D. M., Kucukelbir, A., and McAuliffe, J. D. (2017). Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877.
251
+ [10] Brouillard, P., Lachapelle, S., Lacoste, A., Lacoste-Julien, S., and Drouin, A. (2020). Differentiable causal discovery from interventional data. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 21865–21877. Curran Associates, Inc.
252
+ [11] Casella, G. and Berger, R. (2001). Statistical Inference, pages 54–55. Duxbury Resource Center.
253
+ [12] Chen, T. and Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pages 785–794, New York, NY, USA. ACM.
254
+ [13] Correa, J. and Bareinboim, E. (2020). General transportability of soft interventions: Completeness results. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 10902–10912, Vancouver, Canada. Curran Associates, Inc.
255
+ [14] Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems (MCSS), 2(4):303–314.
256
+ [15] Du, X., Sun, L., Duivesteijn, W., Nikolaev, A., and Pechenizkiy, M. (2021). Adversarial balancing-based representation learning for causal effect inference with observational data. Data Mining and Knowledge Discovery.
257
+ [16] Falcon, W. and Cho, K. (2020). A framework for contrastive self-supervised learning and designing a new approach. arXiv preprint arXiv:2009.00104.
258
+ [17] Forney, A., Pearl, J., and Bareinboim, E. (2017). Counterfactual Data-Fusion for Online Reinforcement Learners. In Proceedings of the 34th International Conference on Machine Learning.
259
+ [18] Germain, M., Gregor, K., Murray, I., and Larochelle, H. (2015). Made: Masked autoencoder for distribution estimation. In Bach, F. and Blei, D., editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 881–889, Lille, France. PMLR.
260
+ [19] Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep Learning. MIT Press.
261
+ [20] Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. In Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N., and Weinberger, K. Q., editors, Advances in Neural Information Processing Systems, volume 27, pages 2672–2680. Curran Associates, Inc.
262
+ [21] Goudet, O., Kalainathan, D., Caillou, P., Lopez-Paz, D., Guyon, I., and Sebag, M. (2018). Learning Functional Causal Models with Generative Neural Networks. In Explainable and Interpretable Models in Computer Vision and Machine Learning, Springer Series on Challenges in Machine Learning. Springer International Publishing.
263
+ [22] Graves, A. and Jaitly, N. (2014). Towards end-to-end speech recognition with recurrent neural networks. In Xing, E. P. and Jebara, T., editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1764–1772, Bejing, China. PMLR.
264
+ [23] Gretton, A., Borgwardt, K., Rasch, M., Schölkopf, B., and Smola, A. (2007). A kernel method for the two-sample-problem. In Schölkopf, B., Platt, J., and Hoffman, T., editors, Advances in Neural Information Processing Systems, volume 19, pages 513–520. MIT Press.
265
+ [24] Gumbel, E. (1954). Statistical Theory of Extreme Values and Some Practical Applications: A Series of Lectures. Applied mathematics series. U.S. Government Printing Office.
266
+ [25] Guo, R., Cheng, L., Li, J., Hahn, P. R., and Liu, H. (2020). A survey of learning causality with data. ACM Computing Surveys, 53(4):1–37.
267
+ [26] Hornik, K. (1991). Approximation capabilities of multilayer feedforward networks. Neural Networks, 4(2):251 – 257.
268
+ [27] Jaber, A., Kocaoglu, M., Shanmugam, K., and Bareinboim, E. (2020). Causal discovery from soft interventions with unknown targets: Characterization and learning. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 9551–9561, Vancouver, Canada. Curran Associates, Inc.
269
+ [28] Jaber, A., Zhang, J., and Bareinboim, E. (2018). Causal identification under Markov equivalence. In Proceedings of the 34th Conference on Uncertainty in Artificial Intelligence, pages 978–987. AUAI Press.
270
+ [29] Jaber, A., Zhang, J., and Bareinboim, E. (2019). Causal identification under Markov equivalence: Completeness results. In Chaudhuri, K. and Salakhutdinov, R., editors, Proceedings of the 36th International Conference on Machine Learning, volume 97, pages 2981–2989. PMLR.
271
+ [30] Johansson, F. D., Shalit, U., Kallus, N., and Sontag, D. (2021). Generalization bounds and representation learning for estimation of potential outcomes and causal effects.
272
+ [31] Johansson, F. D., Shalit, U., and Sontag, D. (2016). Learning representations for counterfactual inference. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, page 3020–3029. JMLR.org.
273
+ [32] Jung, Y., Tian, J., and Bareinboim, E. (2020a). Estimating causal effects using weighting-based estimators. In Proceedings of the 34th AAAI Conference on Artificial Intelligence, New York, NY. AAAI Press.
274
+ [33] Jung, Y., Tian, J., and Bareinboim, E. (2020b). Learning causal effects via weighted empirical risk minimization. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 12697–12709, Vancouver, Canada. Curran Associates, Inc.
275
+ [34] Jung, Y., Tian, J., and Bareinboim, E. (2021). Estimating identifiable causal effects through double machine learning. In Proceedings of the 35th AAAI Conference on Artificial Intelligence, number R-69, Vancouver, Canada. AAAI Press.
276
+ [35] Kallus, N. (2020). DeepMatch: Balancing deep covariate representations for causal inference using adversarial training. In III, H. D. and Singh, A., editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 5067–5077. PMLR.
277
+ [36] Karpathy, A. (2018). pytorch-made. https://github.com/karpathy/pytorch-made [Source Code].
278
+ [37] Kennedy, E. H., Balakrishnan, S., and Wasserman, L. (2021). Semiparametric counterfactual density estimation.
279
+ [38] Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In Bengio, Y. and LeCun, Y., editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.
280
+ [39] Kingma, D. P. and Welling, M. (2014). Auto-encoding variational bayes. In Bengio, Y. and LeCun, Y., editors, 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings.
281
+ [40] Kocaoglu, M., Jaber, A., Shanmugam, K., and Bareinboim, E. (2019). Characterization and learning of causal graphs with latent variables from soft interventions. In Wallach, H., Larochelle, H., Beygelzimer, A., d’Alché Buc, F., Fox, E., and Garnett, R., editors, Advances in Neural Information Processing Systems 32, pages 14346–14356, Vancouver, Canada. Curran Associates, Inc.
282
+ [41] Kocaoglu, M., Shanmugam, K., and Bareinboim, E. (2017a). Experimental design for learning causal graphs with latent variables. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems 30, pages 7018–7028. Curran Associates, Inc.
283
+ [42] Kocaoglu, M., Snyder, C., Dimakis, A. G., and Vishwanath, S. (2017b). Causalgan: Learning causal implicit generative models with adversarial training.
284
+ [43] Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Pereira, F., Burges, C. J. C., Bottou, L., and Weinberger, K. Q., editors, Advances in Neural Information Processing Systems, volume 25, pages 1097–1105. Curran Associates, Inc.
285
+ [44] Lee, S. and Bareinboim, E. (2018). Structural causal bandits: Where to intervene? In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R., editors, Advances in Neural Information Processing Systems 31, pages 2568–2578, Montreal, Canada. Curran Associates, Inc.
286
+ [45] Lee, S. and Bareinboim, E. (2020). Characterizing optimal mixed policies: Where to intervene and what to observe. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 8565–8576, Vancouver, Canada. Curran Associates, Inc.
287
+ [46] Lee, S., Correa, J. D., and Bareinboim, E. (2019). General Identifiability with Arbitrary Surrogate Experiments. In Proceedings of the Thirty-Fifth Conference Annual Conference on Uncertainty in Artificial Intelligence, Corvallis, OR. AUAI Press, in press.
288
+ [47] Leshno, M., Lin, V. Y., Pinkus, A., and Schocken, S. (1993). Multilayer feedforward networks with a nonpolynomial activation function can approximate any function. Neural Networks, 6(6):861 – 867.
289
+ [48] Li, S. and Fu, Y. (2017). Matching on balanced nonlinear representations for treatment effects estimation. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 30, pages 929–939. Curran Associates, Inc.
290
+ [49] Liu, Q., Lee, J., and Jordan, M. (2016). A kernelized stein discrepancy for goodness-of-fit tests. In Balcan, M. F. and Weinberger, K. Q., editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 276–284, New York, New York, USA. PMLR.
291
+ [50] Loshchilov, I. and Hutter, F. (2017). 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. OpenReview.net.
292
+ [51] Loshchilov, I. and Hutter, F. (2019). Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net.
293
+ [52] Louizos, C., Shalit, U., Mooij, J., Sontag, D., Zemel, R., and Welling, M. (2017). Causal effect inference with deep latent-variable models. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 6449–6459, Red Hook, NY, USA. Curran Associates Inc.
294
+ [53] Lu, Z., Pu, H., Wang, F., Hu, Z., and Wang, L. (2017). The expressive power of neural networks: A view from the width. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 30, pages 6231–6239. Curran Associates, Inc.
295
+ [54] Mnih, V., Kavukcuoglu, K., Silver, D., Graves, A., Antonoglou, I., Wierstra, D., and Riedmiller, M. (2013). Playing atari with deep reinforcement learning. In NIPS Deep Learning Workshop.
296
+ [55] Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A. (2017). Automatic differentiation in pytorch.
297
+ [56] Pearl, J. (1988). Probabilistic Reasoning in Intelligent Systems. Morgan Kaufmann, USA.
298
+ [57] Pearl, J. (1995). Causal diagrams for empirical research. Biometrika, 82(4):669–688.
299
+ [58] Pearl, J. (2000). Causality: Models, Reasoning, and Inference. Cambridge University Press, New York, NY, USA, 2nd edition.
300
+ [59] Pearl, J. and Mackenzie, D. (2018). The Book of Why. Basic Books, New York.
301
+ [60] Perkovic, E., Textor, J., Kalisch, M., and H. Maathuis, M. (2018). Complete Graphical ´ Characterization and Construction of Adjustment Sets in Markov Equivalence Classes of Ancestral Graphs. Journal of Machine Learning Research, 18.
302
+ [61] Peters, J., Janzing, D., and Schlkopf, B. (2017). Elements of Causal Inference: Foundations and Learning Algorithms. The MIT Press.
303
+ [62] Rezende, D. and Mohamed, S. (2015). Variational inference with normalizing flows. In Bach, F. and Blei, D., editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1530–1538, Lille, France. PMLR.
304
+ [63] Shalit, U., Johansson, F. D., and Sontag, D. (2017). Estimating individual treatment effect: generalization bounds and algorithms. In Precup, D. and Teh, Y. W., editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3076–3085, International Convention Centre, Sydney, Australia. PMLR.
305
+ [64] Shi, C., Blei, D. M., and Veitch, V. (2019). Adapting neural networks for the estimation of treatment effects. In Wallach, H. M., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E. B., and Garnett, R., 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 2503–2513.
306
+ [65] Spirtes, P., Glymour, C. N., and Scheines, R. (2000). Causation, Prediction, and Search. MIT Press, Cambridge, MA, 2nd edition.
307
+ [66] Sutton, R. S. and Barto, A. G. (2018). Reinforcement Learning: An Introduction. The MIT Press, second edition.
308
+ [67] Tian, J. and Pearl, J. (2002). A General Identification Condition for Causal Effects. In Proceedings of the Eighteenth National Conference on Artificial Intelligence (AAAI 2002), pages 567–573, Menlo Park, CA. AAAI Press/The MIT Press.
309
+ [68] Xia, K., Lee, K.-Z., Bengio, Y., and Bareinboim, E. (2021). The Causal-Neural Connection: Expressiveness, Learnability, Inference. Technical Report Technical Report R-80, Causal AI Lab, Columbia University, USA.
310
+ [69] Yao, L., Li, S., Li, Y., Huai, M., Gao, J., and Zhang, A. (2018). Representation learning for treatment effect estimation from observational data. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 31, pages 2633–2643. Curran Associates, Inc.
311
+ [70] Yoon, J., Jordon, J., and van der Schaar, M. (2018). GANITE: Estimation of individualized treatment effects using generative adversarial nets. In International Conference on Learning Representations.
312
+ [71] Zhang, J. (2008). On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16-17):1873–1896.
313
+ [72] Zhang, J. and Bareinboim, E. (2021). Non-Parametric Methods for Partial Identification of Causal Effects. Technical Report Technical Report R-72, Columbia University, Department of Computer Science, New York.
md/train/nkap3LV7t7O/nkap3LV7t7O.md ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SIMPLE AND EFFECTIVE VAE TRAINING WITH CALIBRATED DECODERS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Variational autoencoders (VAEs) provide an effective and simple method for modeling complex distributions. However, training VAEs often requires considerable hyperparameter tuning to determine the optimal amount of information retained by the latent variable. We study the impact of calibrated decoders, which learn the uncertainty of the decoding distribution and can determine this amount of information automatically, on the VAE performance. While many methods for learning calibrated decoders have been proposed, many of the recent papers that employ VAEs rely on heuristic hyperparameters and ad-hoc modifications instead. We perform the first comprehensive comparative analysis of calibrated decoder and provide recommendations for simple and effective VAE training. Our analysis covers a range of datasets and several single-image and sequential VAE models. We further propose a simple but novel modification to the commonly used Gaussian decoder, which computes the prediction variance analytically. We observe empirically that using heuristic modifications is not necessary with our method.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep density models based on the variational autoencoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) have found ubiquitous use in probabilistic modeling and representation learning as they are both conceptually simple and are able to scale to very complex distributions and large datasets. These VAE techniques are used for tasks such as future frame prediction (Castrejon et al., 2019), image segmentation (Kohl et al., 2018), generating speech (Chung et al., 2015) and music (Dhariwal et al., 2020), as well as model-based reinforcement learning (Hafner et al., 2019a). However, in practice, many of these approaches require careful manual tuning of the balance between two terms that correspond to distortion and rate from information theory (Alemi et al., 2017). This balance trades off fidelity of reconstruction and quality of samples from the model: a model with low rate would not contain enough information to reconstruct the data, while allowing the model to have high rate might lead to unrealistic samples from the prior as the KL-divergence constraint becomes weaker (Alemi et al., 2017; Higgins et al., 2017). While a proper variational lower bound does not expose any free parameters to control this tradeoff, many prior works heuristically introduce a weight on the prior KL-divergence term, often denoted $\beta$ . Usually, $\beta$ needs to be tuned for every dataset and model variant as a hyperparameter, which slows down development and can lead to poor performance as finding the optimal value is often prohibitively computationally expensive. Moreover, using $\beta \neq 1$ precludes the appealing interpretation of the VAE objective as a bound on the data likelihood, and is undesirable for applications like density modeling.
12
+
13
+ While many architectures for calibrating decoders have been proposed in the literature (Kingma & Welling, 2014; Kingma et al., 2016; Dai & Wipf, 2019), more applied work typically employs VAEs with uncalibrated decoding distributions, such as Gaussian distributions without a learned variance, where the decoder only outputs the mean parameter (Castrejon et al., 2019; Denton & Fergus, 2018; Lee et al., 2019; Babaeizadeh et al., 2018; Lee et al., 2018; Hafner et al., 2019b; Pong et al., 2019; Zhu et al., 2017; Pavlakos et al., 2019), or uses other ad-hoc modifications to the objective (Sohn et al., 2015; Henaff et al., 2019). Indeed, it is well known that attempting to learn the variance in a Gaussian decoder may lead to numerical instability (Rezende & Viola, 2018; Dai & Wipf, 2019), and na¨ıve approaches often lead to poor results. As a result, it remains unclear whether practical empirical performance of VAEs actually benefits from calibrated decoders or not.
14
+
15
+ To rectify this, our first contribution is a comparative analysis of various calibrated decoder architectures and practical recommendations for simple and effective VAE training. We find that, while na¨ıve calibrated decoders often lead to worse results, a careful choice of the decoder distribution can work very well, and removes the need to tune the additional parameter $\beta$ . Indeed, we note that the entropy of the decoding distribution controls the mutual information $I ( x ; z )$ . Calibrated decoders allow the model to control $I ( x ; z )$ automatically, instead of relying on manual tuning. Our second contribution is a simple but novel technique for optimizing the decoder variance analytically, without requiring the decoder network to produce it as an additional output. We call the resulting approach to learning the Gaussian variance the $\sigma$ -VAE. In our experiments, the $\sigma$ -VAE outperforms the alternative of learning the variance through gradient descent, while being simpler to implement and extend. We validate our results on several VAE and sequence VAE models and a range of image and video datasets.
16
+
17
+ # 2 RELATED WORK
18
+
19
+ Prior work on variational autoencoders has studied a number of different decoder parameterizations. Kingma & Welling (2014); Rezende et al. (2014) use the Bernoulli distribution for the binary MNIST data and Kingma & Welling (2014) use Gaussian distributions with learned variance parameter for grayscale images. However, modeling images with continuous distributions is prone to instability as the variance can converge to zero (Rezende & Viola, 2018; Mattei & Frellsen, 2018; Dai & Wipf, 2019). Some work has attempted to rectify this problem by using dequantization (Gregor et al., 2016), which is theoretically appealing as it is tightly related to the log-likelihood of the original discrete data (Theis et al., 2016), optimizing the variance in a two-stage procedure (Arvanitidis et al., 2017), or training a post-hoc prior (Ghosh et al., 2019). Takahashi et al. (2018); Barron (2019) proposed more expressive distributions. Additionally, different choices for representing such variance exist, including diagonal covariance (Kingma & Welling, 2014; Sønderby et al., 2016; Rolfe, 2016), or a single shared parameter (Kingma et al., 2016; Dai & Wipf, 2019; Edwards & Storkey, 2016; Rezende & Viola, 2018). We analyze these and notice that learning a single variance parameter shared across images leads to stable training and good performance, without the use of dequantization or even clipping the variance, although these techniques can be used with our decoders; and further improve the estimation of this variance with an analytic solution.
20
+
21
+ Early work on discrete VAE decoders for color images modeled them with the Bernoulli distribution, treating the color intensities as probabilities (Gregor et al., 2015). Further work has explored various parameterizations based on discretized continuous distributions, such as discretized logistic (Kingma et al., 2016). More recent work has improved expressivity of the decoder with a mixture of discretized logistics (Chen et al., 2016; Maaløe et al., 2019). However, these models also employ powerful autoregressive decoders (Chen et al., 2016; Gulrajani et al., 2016; Maaløe et al., 2019), and the latent variables in these models may not represent all of the significant factors of variation in the data, as some factors can instead be modeled internally by the autoregressive decoder (Alemi et al., 2017).1
22
+
23
+ While many calibrated decoders have been proposed, outside the core generative modeling community uncalibrated decoders are ubiquitous. They are used in work on video prediction (Denton & Fergus, 2018; Castrejon et al., 2019; Lee et al., 2018; Babaeizadeh et al., 2018), image segmentation (Kohl et al., 2018), image-to-image translation (Zhu et al., 2017), 3D human pose (Pavlakos et al., 2019), as well as model-based reinforcement learning (Henaff et al., 2019; Hafner et al., 2019b;a), and representation learning (Lee et al., 2019; Watter et al., 2015; Pong et al., 2019). Most of these works utilize the heuristic hyperparameter $\beta$ instead, which is undesirable both as the resulting objective is no longer a bound on the likelihood, and as $\beta$ usually requires extensive tuning. In this work, we analyze the common pitfalls of using calibrated decoders that may have prevented the practitioners from using them, propose a simple and effective analytic way of learning such calibrated distribution, and provide a comprehensive experimental evaluation of different decoding distributions.
24
+
25
+ Alternative discussions of the hyperparameter $\beta$ are presented by Zhao et al. (2017); Higgins et al. (2017); Alemi et al. (2017); Achille & Soatto (2018), who show that it controls the amount of information in the latent variable, $I ( x ; z )$ . Peng et al. (2018); Rezende & Viola (2018) further discuss constrained optimization objectives for VAEs, which also yield a similar hyperparameter. Here, we focus on $\beta$ -VAEs with Gaussian decoders with constant variance, as commonly used in recent work, and show that the hyperparameter $\beta$ can be incorporated in the decoding likelihood for these models.
26
+
27
+ # 3 ANALYSING DECODING DISTRIBUTIONS
28
+
29
+ The generative model of a VAE (Kingma & Welling, 2014; Rezende et al., 2014) with parameters $\theta$ is specified with a prior distribution over the latent variable $p _ { \theta } ( z )$ , commonly unit Gaussian, and a decoding distribution $p _ { \theta } ( x | z )$ , which for color images is commonly a conditional Gaussian parameterized with a neural network. We would like to fit this generative model to a given dataset by maximizing the evidence lower bound (ELBO (Neal & Hinton, 1998; Jordan et al., 1999; Kingma $\&$ Welling, 2014; Rezende et al., 2014)), which uses an approximate posterior distribution $q _ { \phi } ( z | x )$ , also commonly a conditional Gaussian specified with a neural network. In this work, we focus on the form of the decoding distribution $p _ { \theta } ( x | z )$ . To achieve the best results, we want a decoding distribution that represents the required probability $p ( x | z )$ accurately In this section, we will review and analyze various choices of decoding distributions that enable better decoder calibration, including expressive decoding distributions that can represent both the prediction of the image and the uncertainty about such prediction, or even multimodal predictions.
30
+
31
+ # 3.1 GAUSSIAN DECODERS
32
+
33
+ We first analyse the commonly used Gaussian decoders. We note that the commonly used MSE reconstruction loss between the reconstruction $\hat { x }$ and ground truth data $x$ is equivalent to the negative log-likelihood objective with a Gaussian decoding distribution with constant variance:
34
+
35
+ $$
36
+ - \ln p ( x | z ) = { \frac { 1 } { 2 } } | | { \hat { x } } - x | | ^ { 2 } + D \ln { \sqrt { 2 \pi } } = { \frac { 1 } { 2 } } | | { \hat { x } } - x | | ^ { 2 } + c = { \frac { D } { 2 } } \mathbf { M } \mathbf { S } \mathbf { E } ( { \hat { x } } , x ) + c ,
37
+ $$
38
+
39
+ where $p ( x | z ) \sim \mathcal { N } ( \hat { x } , I )$ , the prediction $\hat { x }$ is produced with a neural network $\hat { x } = \mu _ { \theta } ( z )$ , and $D$ is the dimensionality of $x$ .
40
+
41
+ This demonstrates a drawback of methods that rely simply on the MSE loss (Castrejon et al., 2019; Denton & Fergus, 2018; Lee et al., 2019; Hafner et al., 2019b; Pong et al., 2019; Zhu et al., 2017; Henaff et al., 2019), as it is equivalent to assuming a particular, constant variance of the Gaussian decoding distribution. By learning this variance, we can achieve much better performance due to better calibration of the decoder. There are several ways in which we can specify this variance. An expressive way to specify the variance is to specify a diagonal covariance matrix for the image, with one value per pixel (Kingma & Welling, 2014; Sønderby et al., 2016; Rolfe, 2016). This can be done, for example, by letting a neural network $\sigma _ { \theta }$ output the diagonal entries of the covariance matrix given a latent sample $z$ :
42
+
43
+ $$
44
+ p _ { \theta } ( x | z ) \sim \mathcal { N } \left( \mu _ { \theta } ( z ) , \sigma _ { \theta } ( z ) ^ { 2 } \right) .
45
+ $$
46
+
47
+ This parameterization of the decoding distribution outputs one variance value per each pixel and channel. While powerful, we observe in Section 5.3 that this approach attains suboptimal performance, and is moreover prone to numerical instability. Instead, we will find experimentally that a simpler parameterization, in which the covariance matrix is specified with a single shared (Kingma et al., 2016; Dai & Wipf, 2019; Edwards & Storkey, 2016; Rezende & Viola, 2018) parameter $\sigma$ as $\Sigma = \sigma I$ often works better in practice:
48
+
49
+ $$
50
+ p _ { \theta , \sigma } ( x | z ) \sim \mathcal { N } \left( \mu _ { \theta } ( z ) , \sigma ^ { 2 } I \right) .
51
+ $$
52
+
53
+ The parameter $\sigma$ can be optimized together with parameters of the neural network $\theta$ with gradient descent. Of particular interest is the interpretation of this parameter. Writing out the expression for the decoding likelihood, we obtain
54
+
55
+ $$
56
+ - \ln p ( x | z ) = { \frac { 1 } { 2 \sigma ^ { 2 } } } | | { \hat { x } } - x | | ^ { 2 } + D \ln \sigma { \sqrt { 2 \pi } } = { \frac { 1 } { 2 \sigma ^ { 2 } } } | | { \hat { x } } - x | | ^ { 2 } + D \ln \sigma + c = D \ln \sigma + { \frac { D } { 2 \sigma ^ { 2 } } } \mathrm { M S E } ( { \hat { x } } , x ) + c .
57
+ $$
58
+
59
+ The full objective of the resulting Gaussian $\sigma$ -VAE is:
60
+
61
+ $$
62
+ \mathcal { L } _ { \boldsymbol { \theta } , \boldsymbol { \phi } , \boldsymbol { \sigma } } = D \ln \sigma + \frac { D } { 2 \sigma ^ { 2 } } M S E ( \hat { x } , { x } ) + D _ { K L } ( q ( \boldsymbol { z } | { x } ) | | p ( \boldsymbol { z } ) ) .
63
+ $$
64
+
65
+ Note that $\sigma$ may be viewed as a weighting parameter between the MSE reconstruction term and the KL-divergence term in the objective. Moreover, this objective explicitly specifies how to select the optimal variance: the variance should be selected to minimize the (weighted) MSE loss while also minimizing the logarithm of the variance.
66
+
67
+ Decoder Calibration It is important that the decoder distribution be calibrated in the statistical sense, that is, the predicted probabilities should correspond to the frequencies of seeing a particular value of $x$ given that prediction (DeGroot & Fienberg, 1983; Dawid, 1982). The calibration of a neural network can be usually improved by estimating the uncertainty of that prediction (Guo et al., 2017), such as the variance of a Gaussian (Kendall & Gal, 2017). Since the naive MSE loss assumes a constant variance, it does not effectively represent the uncertainty of the prediction, and is often poorly calibrated. Instead, learning the variance as in Eq. 3 leads to better uncertainty estimation and better calibration. In Sec 5.1, we show that learning a good estimate of this uncertainty is crucial for the quality of the VAE generations.
68
+
69
+ Connection to $\beta$ -VAE. The $\beta$ -VAE objective (Higgins et al., 2017) for a Gaussian decoder with unit variance is:
70
+
71
+ $$
72
+ \mathcal { L } ^ { \beta } = \frac { D } { 2 } M S E ( \hat { x } , x ) + \beta D _ { K L } ( q ( z | x ) | | p ( z ) ) .
73
+ $$
74
+
75
+ We see that it can be interpreted as a particular case of the objective (3), where the variance is constant and the term $D \ln \sigma$ can be ignored during optimization. The $\beta$ -VAE objective is then equivalent to a $\sigma$ -VAE with a constant variance $\sigma = \sqrt { \beta / 2 }$ (for a particular learning rate setting). In recent work (Zhu et al., 2017; Denton $\&$ Fergus, 2018; Lee et al., 2019), $\beta$ -VAE models are often used in this exact regime. By tuning the $\beta$ term, practitioners are able to tune the variance of the decoder, manually producing a more calibrated decoder. However, by re-interpreting the $\beta$ -VAE objective as a special case of the VAE and introducing the missing $D \ln \sigma$ term, we can both obtain a valid evidence lower bound, and remove the need to manually select $\beta$ . Instead, the variance $\sigma$ can instead simply be learned end-to-end, reducing the need for hyperparameter tuning.
76
+
77
+ An alternative discussion of this connection in the context of linear VAEs is also presented by Lucas et al. (2019). While the $\beta$ term is not necessary for good performance if the decoder is calibrated, it can still be employed if desired, such as when the aim is to attain better disentanglement (Higgins et al., 2017) or a particular rate-distortion tradeoff (Alemi et al., 2017). However, we found that with calibrated decoders, the best sample quality is obtained when $\beta = 1$ .
78
+
79
+ Loss implementation details. For the correct evidence lower bound computation, it is necessary to add the values of the MSE loss and the KL divergence across the dimensions. We observe that common implementations of these losses (Denton & Fergus, 2018; Abadi et al., 2016; Paszke et al., 2019) use averaging instead, which will lead to poor results if the number of image dimensions is significantly different from the number of the latent dimensions. While this can be conveniently ignored in the $\beta$ -VAE regime, where the balance term is tuned manually anyway, for the $\sigma$ -VAE it is essential to compute the objective value correctly.
80
+
81
+ Variance implementation details. Since the variance is non-negative, we parameterize it logarithmically as $\sigma ^ { \hat { 2 } } = e ^ { 2 \lambda }$ , where $\lambda$ is the logarithm of the standard deviation. For some models, such as per-pixel variance decoders, we observed that it is necessary to restrict the variance range for numerical stability. We do so by using the soft clipping operations proposed by Chua et al. (2018):
82
+
83
+ $$
84
+ \lambda : = \lambda _ { \mathrm { m a x } } - \mathrm { s o f t p l u s } ( \lambda _ { \mathrm { m a x } } - \lambda ) ; \qquad \lambda : = \lambda _ { \mathrm { m i n } } + \mathrm { s o f t p l u s } ( \lambda - \lambda _ { \mathrm { m i n } } ) .
85
+ $$
86
+
87
+ We observe that setting $\lambda _ { \operatorname* { m i n } } = - 6$ to lower bound the standard deviation to be at least half of the distance between allowed color values works well in practice. We also observe that this clipping is unnecessary when learning a shared $\sigma$ value.
88
+
89
+ # 3.2 DISCRETE DECODERS
90
+
91
+ It is possible to use discrete decoding distributions to generate images, as color values are commonly restricted to a fixed set of integer pixel intensities (e.g. 0..255). Indeed, for discrete color values, discrete distributions are arguably more appropriate. In the most general case, a discrete decoding distribution factorized per each pixel and channel would be specified by a probability mass vector $\hat { x }$ with 256 entries, one per each possible intensity value, similarly to a per-pixel classifier of the intensity value. We can implement it with a soft-max layer, yielding the following log-likelihood loss (sometimes called the cross-entropy loss) for a true pixel with intensity $i$ :
92
+
93
+ $$
94
+ - \ln { p ( x | z ) } = - \ln { \frac { \exp ( \hat { x } _ { i } ) } { \sum _ { j } \exp ( \hat { x } _ { j } ) } } ,
95
+ $$
96
+
97
+ ![](images/a72014d3eeef3fb862e1ae0c45aecac5611320d625332b68e1f68646a77844f0.jpg)
98
+ Figure 1: Different types of calibrated decoders for Gaussian VAE, model parameters are denoted with enclosing squares. Left: both the mean $\mu$ and the variance $\sigma$ are output by a neural network with parameters $\theta$ . Center: $\sigma$ -VAE with shared variance, the mean is output by a neural network with parameters $\theta$ , but the variance it iself a global parameter. Right: the proposed optimal $\sigma$ -VAE, the mean is output by a neural network with parameters $\theta$ , and the variance is computed analytically from the training data $D$ .
99
+
100
+ We will evaluate these and further choices of discrete decoders, described in Appendix D. We recommend choosing the decoder distribution that best suits the structure of the data, such as discrete decoders for discrete data and continuous decoders for continuous data.
101
+
102
+ # 4 OPTIMAL VARIANCE ESTIMATION FOR CALIBRATED GAUSSIAN DECODERS
103
+
104
+ In this section, we propose a simple but novel analytic way of obtaining a calibrated decoder for continuous distributions that further improves performance. The Gaussian decoders with learned variance described in Section 3.1 are calibrated and work better than na¨ıve unit variance decoders. However, for $\sigma$ -VAE optimized with gradient descent or Adam (Kingma & Ba, 2015), we observe that careful learning rate tuning can yield significantly better performance, which is in line with prior work that reported poor performance of gradient descent for optimizing Gaussian distributions (Amari, 1998; Peters & Schaal, 2008). A smaller learning rate often produces better performance, but slows down the training, as the likelihood values $p ( x | z )$ will be very suboptimal in the beginning. Instead, here we propose an analytic solution for the value of $\sigma$ , which computes it analytically and does not require gradient descent.
105
+
106
+ The maximum likelihood estimate of the variance given a known mean is the average squared distance from the mean:
107
+
108
+ $$
109
+ \boldsymbol { \sigma } ^ { * } = \mathop { \arg \operatorname* { m a x } } _ { \boldsymbol { \sigma } } \mathcal { N } ( \boldsymbol { x } | \mu , \boldsymbol { \sigma } ^ { 2 } I ) = \mathbf { M } \mathbf { S } \mathbf { E } ( \boldsymbol { x } , \mu ) ,
110
+ $$
111
+
112
+ where $\begin{array} { r } { \mathbf { M S E } ( x , \mu ) = \frac { 1 } { D } \sum _ { i } ( x _ { i } - \mu _ { i } ) ^ { 2 } } \end{array}$ . Eq. 5 can be easily shown using manual differentiation, and is a generalization of the fact that the MLE estimate of the variance is the sample variance.
113
+
114
+ The optimal variance for the decoder distribution under the maximum likelihood criterion is then simply the average MSE loss over the data and the encoder distribution. We leverage this to create an optimal analytic solution for the variance. In the batch setting, the optimal variance would be simply the MSE loss, and can be updated after every gradient update for the other parameters of the decoder. In the mini-batch setting, we use a batchwise estimate of the variance computed for the current minibatch. We analyze these approximations in Appendix C. At test time, a running average of the variance over the training data is used. This method, which we call optimal $\sigma { - } V A E$ , allows us to learn very efficiently as we use the optimal variance estimate at every training step. It is also easier to implement, as no separate optimizer for the variance parameter is needed. If the variance is not needed at test time, it can also be simply discarded after training.
115
+
116
+ Per-image optimal $\sigma$ -VAE. Optimal $\sigma$ -VAE uses a single variance value shared across all data points. However, the optimal $\sigma$ -VAE also allows more powerful variance estimates, such as learning a variance value per each pixel, or even a variance value per each image, the difference in implementation simply being the dimensions across which the averaging in Equation 5 operates. This approach can be interpreted as variational variance prediction in the framework of Stirn & Knowles (2020).
117
+
118
+ ![](images/98cd3e3951801ba5ef1cb57dc92c0876982e83c4ca8bd2fc5f54c56668a9a4aa.jpg)
119
+ Figure 2: Images or videos (bottom right) sampled from the proposed optimal $\sigma$ -VAE and a unit variance Gaussian VAE models. The Gaussian VAE does not have a means to control the expressivity of the latent variable and produces suboptimal, blurry samples. The $\sigma$ -VAE controls the expressivity by learning a calibrated decoder, and produces higher quality sequences on all datasets.
120
+
121
+ We now provide an empirical analysis of different decoding distributions, and validate the benefits of our $\sigma$ -VAE approach. We use a small convolutional VAE model on SVHN (Netzer et al., 2011), a larger hierarchical HVAE model (Maaløe et al., 2019) on the CelebA (Liu et al., 2015) and CIFAR (Krizhevsky et al., 2009) datasets, and a sequence VAE model called SVG (Denton & Fergus, 2018) on the BAIR Pushing dataset (Finn & Levine, 2017). We evaluate the ELBO values as well as visual quality measured by the Frechet Inception Distance (FID, Heusel ´ et al. (2017)). Images are $2 8 \times 2 8$ for SVHN and $3 2 \times 3 2$ for CelebA and CIFAR, while video experiments were performed on $6 4 \times 6 4$ frames
122
+
123
+ following Denton & Fergus (2018). We do not use KL annealing as it did not improve the results in our experiments. Further experimental details are in App. B.
124
+
125
+ Table 1: Analysis of learned variance on SVHN. The parameter $\beta$ is tuned manually in $\beta$ -VAE and learned in $\sigma$ -VAE. $\sigma$ -VAE achieves better performance, while the value of $\beta$ (implicitly defined via the decoder variance) automatically converges close the value found by manual tuning.
126
+ 5.1 DO CALIBRATED DECODERS BALANCE THE VAE OBJECTIVE WITHOUT TUNING $\beta$ ?
127
+
128
+ <table><tr><td></td><td>β</td><td>-logp↓</td><td>FID↓</td></tr><tr><td>β-VAE</td><td>0.001</td><td>&lt;21.43</td><td>44.54</td></tr><tr><td>β-VAE</td><td>0.01</td><td>&lt;-3186</td><td>27.93</td></tr><tr><td>β-VAE</td><td>0.1</td><td>&lt;-1223</td><td>28.3</td></tr><tr><td>β-VAE</td><td>1</td><td>&lt;1381</td><td>70.39</td></tr><tr><td>β-VAE</td><td>10</td><td>&lt;4056</td><td>219.3</td></tr><tr><td>g-VAE</td><td>0.006</td><td>&lt; -3333</td><td>22.25</td></tr></table>
129
+
130
+ As detailed in Section 3.1, a $\beta$ -VAE with a unit variance Gaussian decoder commonly used in prior work is equivalent to a $\sigma$ -VAE with constant, manually tuned variance. There is a simple relationship between beta and the variance: $\sigma = \sqrt { \beta / 2 }$ . To compare the variance that the $\sigma$ -VAE learns to the manually tuned variance in the case of the $\beta$ -VAE, we compare the ELBO values and the corresponding values of $\beta$ in Table 1. We find that learning the variance produces similar values of $\beta$ to the manually tuned values in the $\beta$ -VAE case, indicating that the $\sigma$ -VAE is able to learn the balance between the two objective terms in a single training run, without hyperparameter tuning. Moreover, the $\sigma$ -VAE outperforms the best $\beta$
131
+
132
+ ![](images/ef9043d4e0936ecac83fd6dc61954fcd336bdf4307d4474053b1d64186d93d70.jpg)
133
+ Figure 3: Analysis of learned variance on SVHN. The parameter $\beta$ is tuned manually in $\beta$ -VAE and learned in $\sigma$ -VAE. Higher values of $\beta$ cause the images to lose detail, while lower values of $\beta$ might make samples unrealistic. The proposed optimal $\sigma$ -VAE is able to learn the balance end-to-end, here converging to an equivalent of $\beta$ -VAE with $\beta = 0 . 0 0 6$ .
134
+
135
+ -VAE run. This is because end-to-end learning produces better estimates of the variance than is possible with manual search, improving the likelihood (as measured by the lower bound) and the visual quality. Figure 3 shows the qualitative results from this experiment.
136
+
137
+ We further validate our results on both single-image and sequential VAE models on a range of datasets in Table 2 and Figure 2. Single-sample ELBO values are reported, and ELBO values on discretized data are reported for discrete distributions. We see that learning a shared variance in a Gaussian decoders (shared $\sigma$ -VAE) outperforms the na¨ıve unit variance decoder (Gaussian VAE) as well as tuning the $\beta$ constant for the Gaussian VAE manually. We also see that calibrated discrete decoders, such as full categorical distribution or mixture of discretized logistics, perform better than the na¨ıve Gaussian VAE. Using Bernoulli distribution by treating the color intensities as probabilities (Gregor et al., 2015; Watter et al., 2015) performs poorly. Our results further improve upon the sequence VAE method of Denton & Fergus (2018), which uses a unit variance Gaussian with the $\beta$ -VAE objective.
138
+
139
+ # 5.2 HOW DOES LEARNING CALIBRATED DECODERS IMPACT THE LATENT VARIABLE INFORMATION CONTENT?
140
+
141
+ We saw above that calibrated decoders result in higher log-likelihood bounds. Are calibrated decoders also beneficial for representation learning? We evaluate the mutual information $I _ { e } ( x ; z )$ between the data $p _ { d } ( x )$ and encoder samples $q ( z | x )$ , as well as the mismatch between the prior $p ( z )$ and the marginal encoder distribution $m ( z ) = E _ { p _ { d } ( x ) } q ( z | x )$ , measured by the marginal KL $D _ { K L } ( m ( z ) | | p ( z ) )$ . These terms are related to the rate term of the VAE objective as follows (Alemi et al., 2017):
142
+
143
+ $$
144
+ \begin{array} { r l } & { E _ { p _ { d } ( x ) } \left[ D _ { K L } ( q ( z | x ) | | p ( z ) ) \right] = E _ { p _ { d } ( x ) } \left[ D _ { K L } ( q ( z | x ) | | m ( z ) ) \right] + D _ { K L } ( m ( z ) | | p ( z ) ) } \\ & { \qquad = I _ { e } ( x ; z ) + D _ { K L } ( m ( z ) | | p ( z ) ) . } \end{array}
145
+ $$
146
+
147
+ That is, the rate term decomposes into the true mutual information and the marginal KL term. We want to learn expressive latent variables with high mutual information. However, doing so by tuning the $\beta$ value relaxes the constraint that the encoder and the prior distributions match, and leads to degraded quality of samples from the prior, which creates a trade-off between expressive representations and ability to generate good samples. To compare the $\beta$ -VAE and $\sigma$ - VAE in terms of these quantities, we estimate the marginal KL term via Monte Carlo sampling, as proposed by Rosca et al. (2018), and plot the results in Figure 4. As expected, we see that lower $\beta$ values lead to higher mutual information. However, after a certain point, lower values of $\beta$ also cause a significant mismatch between the marginal and the prior distributions. By calculating the “effective” $\beta$ for the $\sigma$ -VAE, as per Section 4, we can see that the $\sigma$ -VAE captures an inflection point in the $D _ { K L } ( m ( z ) | | p ( z ) )$ term, learning a representation with the highest possible MI, but without degrading sample quality. This explains the high visual quality of the optimal $\sigma$ -VAE samples: since the marginal and the prior distributions match, the samples from
148
+
149
+ ![](images/87d2b8a25eab2ea0c060438ee47de05935bf6fbb4219ca406dd0f69d64835ff7.jpg)
150
+ Figure 4: Comparison of $\beta$ -VAE and $\sigma$ -VAE on SVHN in terms of mutual information $I _ { e } ( x ; z )$ and marginal KL divergence $K L ( m ( z ) | | p ( z ) )$ (see Sec. 5.2). $I _ { e } ( x ; z )$ increases with lower $\beta$ , yielding expressive representations and better reconstruction. However, after a certain point, lowering $\beta$ leads to a rapid increase in the marginal $\mathrm { K L }$ , yielding poor samples from the prior. The $\sigma$ -VAE is able to automatically find the inflection point after which the marginal KL begins to increase, capturing as much information as possible while still producing good samples.
151
+
152
+ the prior look similar to reconstructions, while for a $\beta$ -VAE with low $\beta$ , the samples from the prior are poor. We see that, in contrast to the $\beta$ -VAE, where the mutual information is controlled by a hyperparameter, the $\sigma$ -VAE can adjust the appropriate amount of information automatically and is able to find the setting that produces both informative latents and high quality samples.
153
+
154
+ An alternative discussion of tuning $\beta$ is presented by Alemi et al. (2017), who show that $\beta$ controls the rate-distortion trade-off. Here, we show that the crucial trade-off also controlled by $\beta$ is the trade-off between two components of the rate itself, which control expressivity of representations and the match between the variational and the prior distributions, respectively.
155
+
156
+ Table 2: Generative modeling performance of the proposed $\sigma$ -VAE on different models and datasets. For SVG, we compare with the original method (Denton & Fergus, 2018), which uses $\beta$ -VAE. We see that uncalibrated decoders such as mean-only Gaussian perform poorly. $\beta$ -VAE allows to calibrate the decoder but needs careful hyperparameter tuning. Calibrated decoders such as categorical or $\sigma$ -VAE perform best. [1] Gregor et al. (2015), [2] Takahashi et al. (2018), [3] Higgins et al. (2017).
157
+
158
+ <table><tr><td rowspan="2"></td><td colspan="2">CelebA HVAE</td><td colspan="2">SVHN VAE</td><td colspan="2">CIFAR HVAE</td><td colspan="2">BAIR SVG</td></tr><tr><td>-logp↓</td><td>FID↓</td><td>-logp↓</td><td>FID↓</td><td>-logp↓</td><td>FID↓</td><td>-logp↓</td><td>FID↓</td></tr><tr><td>Bernoulli VAE[1]</td><td></td><td>177.6</td><td></td><td>43.26</td><td></td><td>284.5</td><td></td><td>122.6</td></tr><tr><td>Categorical VAE</td><td>&lt;6359</td><td>71.5</td><td>&lt;9179</td><td>46.13</td><td>&lt;7179</td><td>101.7</td><td>N/A</td><td>N/A</td></tr><tr><td>Bitwise-categorical VAE</td><td>&lt;9067</td><td>66.61</td><td>&lt;10800</td><td>33.84</td><td>&lt;9390</td><td>91.2</td><td>&lt;48744</td><td>46.13</td></tr><tr><td>Logistic mixture VAE</td><td>&lt;7932</td><td>65.3</td><td>&lt;9085</td><td>43.19</td><td>&lt;8443</td><td>143.1</td><td>&lt;40616</td><td>42.94</td></tr><tr><td>Gaussian VAE</td><td>&lt;7173</td><td>186.5</td><td>&lt;2184</td><td>112.5</td><td>&lt;7186</td><td>293.7</td><td>&lt;-10379</td><td>35.64</td></tr><tr><td>Per-pixel g-VAE</td><td>&lt;-7814</td><td>159.3</td><td>&lt;2184</td><td>114.7</td><td>&lt;-7222</td><td>131</td><td>&lt;-14051</td><td>41.98</td></tr><tr><td>Student-t VAE [2]</td><td>&lt;-8401</td><td>71.06</td><td>&lt;-3659</td><td>70.4</td><td>&lt;-7419</td><td>123.6</td><td></td><td>■</td></tr><tr><td>β-VAE [3]</td><td>&lt;-2713</td><td>61.6</td><td>&lt;-3186</td><td>27.93</td><td>&lt;-331</td><td>103</td><td>&lt;-13472</td><td>34.64</td></tr><tr><td>Shared g-VAE</td><td>&lt;-6374</td><td>60.7</td><td>&lt;-3349</td><td>22.25</td><td>&lt;-5435</td><td>116.1</td><td>&lt;-13974</td><td>34.24</td></tr><tr><td>Optimal g-VAE</td><td>&lt;-8446</td><td>60.3</td><td>&lt; (-3333</td><td>27.25</td><td>&lt;-5677</td><td>101.4</td><td>&lt;-14173</td><td>34.13</td></tr><tr><td>Opt. per-image g-VAE</td><td></td><td>66.01</td><td></td><td>26.28</td><td></td><td>104.0</td><td></td><td>33.21</td></tr></table>
159
+
160
+ # 5.3 WHAT ARE THE COMMON CHALLENGES IN LEARNING THE VARIANCE THAT PREVENTPRACTITIONERS FROM USING IT, AND HOW TO RECTIFY THEM?
161
+
162
+ If learning the decoder variance improves generation, why are learned variances not used more often? In this section, we discuss how the na¨ıve approach to learning variances, where the decoder outputs a variance for each pixel along with the mean, leads to poor results. First, we find that this method often diverges very quickly due to numerical instability, as the network is able to predict certain pixels with very high certainty, leading to degenerate variances. In contrast, learning a shared variance is always numerically stable in our experiments. We can rectify this numerical instability by bounding the output variance (Section 3.1). However, even with bounded variance, we observe that learning per-pixel variances leads to poor results in Table 2. While the per-pixel variance achieves a good ELBO value, it produces very poor samples, as measured by FID and visual inspection.
163
+
164
+ We see that the specific form of learned variance: a shared variance, a per-image variance, or a per-pixel variance, can lead to very different performance in practice. We hypothesize the per-pixel decoder performs poorly as it incentivizes the model to focus on particular pixels that can be predicted well, instead of focusing equally on all parts of the image. This is consistent with prior work on denoising diffusion models which noted that likelihood-based models place too much focus on imperceptible details, which leads to deteriorated results (Ho et al., 2020). The shared and per-image variance models mitigate this issue at the cost of introducing more bias, and work better in practice.
165
+
166
+ # 5.4 CAN AN ANALYTIC SOLUTION FOR OPTIMAL VARIANCE FURTHER IMPROVE LEARNING?
167
+
168
+ We evaluate the optimal $\sigma$ -VAE which uses an analytic solution for the variance (Section 4). Table 2 shows that it achieves superior results in terms of log-likelihood. We also note that the optimal $\sigma$ -VAE converges to a good variance estimate instantaneously, which speeds up learning (highlighted in Figure 9 in the Appendix). In addition, we evaluate the per-image optimal $\sigma$ -VAE, in which a single variance is computed per image. This model achieves significantly higher visual quality. While producing this per-image variance with a neural network would require additional architecture tuning, optimal $\sigma$ -VAE is extremely simple to implement (it can be implemented simply as changing the axes of summation), not requiring any new tunable parameters.
169
+
170
+ # 6 CONCLUSION
171
+
172
+ We presented a simple and effective method for learning calibrated decoders, as well as an evaluation of different decoding distributions with several VAE and sequential VAE models. The proposed method outperforms methods that use na¨ıve unit variance Gaussian decoders and tune a heuristic weight $\beta$ on the KL-divergence loss, as commonly done in prior work. Moreover, it does not use the heuristic weight $\beta$ , making it easier to train than this prior work. We expect that the simple techniques for learning calibrated decoders can allow practitioners to speed up the development cycle, obtain better results, and reduce the need for manual hyperparameter tuning.
173
+
174
+ # REFERENCES
175
+
176
+ Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} Symposium on Operating Systems Design and Implementation ({OSDI} 16), pp. 265–283, 2016.
177
+
178
+ Alessandro Achille and Stefano Soatto. Information dropout: Learning optimal representations through noisy computation. IEEE transactions on pattern analysis and machine intelligence, 40 (12):2897–2905, 2018.
179
+
180
+ Alexander A Alemi, Ben Poole, Ian Fischer, Joshua V Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken elbo. arXiv preprint arXiv:1711.00464, 2017.
181
+
182
+ Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998.
183
+
184
+ Georgios Arvanitidis, Lars Kai Hansen, and Søren Hauberg. Latent space oddity: on the curvature of deep generative models. arXiv preprint arXiv:1710.11379, 2017.
185
+
186
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. 2018.
187
+
188
+ Jonathan T Barron. A general and adaptive robust loss function. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4331–4339, 2019.
189
+
190
+ Lluis Castrejon, Nicolas Ballas, and Aaron Courville. Improved conditional vrnns for video prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 7608–7617, 2019.
191
+
192
+ Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016.
193
+
194
+ Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4754–4765, 2018.
195
+
196
+ Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. 2015.
197
+
198
+ Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019.
199
+
200
+ A Philip Dawid. The well-calibrated bayesian. Journal of the American Statistical Association, 77 (379):605–610, 1982.
201
+
202
+ Morris H DeGroot and Stephen E Fienberg. The comparison and evaluation of forecasters. Journal of the Royal Statistical Society: Series D (The Statistician), 32(1-2):12–22, 1983.
203
+
204
+ E. Denton and R. Fergus. Stochastic video generation with a learned prior. 2018.
205
+
206
+ Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:[TODO], 2020.
207
+
208
+ Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
209
+
210
+ Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. 2017.
211
+
212
+ Partha Ghosh, Mehdi SM Sajjadi, Antonio Vergari, Michael Black, and Bernhard Scholkopf. From ¨ variational to deterministic autoencoders. arXiv preprint arXiv:1903.12436, 2019.
213
+
214
+ Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015.
215
+
216
+ Karol Gregor, Frederic Besse, Danilo Jimenez Rezende, Ivo Danihelka, and Daan Wierstra. Towards conceptual compression. 2016.
217
+
218
+ Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
219
+
220
+ Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. arXiv preprint arXiv:1706.04599, 2017.
221
+
222
+ Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. arXiv preprint arXiv:1912.01603, 2019a.
223
+
224
+ Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. 2019b.
225
+
226
+ Mikael Henaff, Alfredo Canziani, and Yann LeCun. Model-predictive policy learning with uncertainty regularization for driving in dense traffic. arXiv preprint arXiv:1901.02705, 2019.
227
+
228
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pp. 6626–6637, 2017.
229
+
230
+ 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. 2017.
231
+
232
+ Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33, 2020.
233
+
234
+ Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999.
235
+
236
+ Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? In Advances in neural information processing systems, pp. 5574–5584, 2017.
237
+
238
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2015.
239
+
240
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. 2014.
241
+
242
+ Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
243
+
244
+ Simon Kohl, Bernardino Romera-Paredes, Clemens Meyer, Jeffrey De Fauw, Joseph R Ledsam, Klaus Maier-Hein, SM Ali Eslami, Danilo Jimenez Rezende, and Olaf Ronneberger. A probabilistic u-net for segmentation of ambiguous images. In Advances in Neural Information Processing Systems, pp. 6965–6975, 2018.
245
+
246
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
247
+
248
+ A. X. Lee, R. Zhang, F. Ebert, P. Abbeel, C. Finn, and S. Levine. Stochastic adversarial video prediction. arXiv:1804.01523, abs/1804.01523, 2018.
249
+
250
+ Alex X Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv preprint arXiv:1907.00953, 2019.
251
+
252
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
253
+
254
+ James Lucas, George Tucker, Roger B Grosse, and Mohammad Norouzi. Don’t blame the elbo! a linear vae perspective on posterior collapse. In Advances in Neural Information Processing Systems, pp. 9403–9413, 2019.
255
+
256
+ Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of ´ latent variables for generative modeling. In Advances in neural information processing systems, pp. 6548–6558, 2019.
257
+
258
+ Pierre-Alexandre Mattei and Jes Frellsen. Leveraging the exact likelihood of deep latent variable models. In Advances in Neural Information Processing Systems, pp. 3855–3866, 2018.
259
+
260
+ Radford M Neal and Geoffrey E Hinton. A view of the em algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models, pp. 355–368. Springer, 1998.
261
+
262
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
263
+
264
+ Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pp. 8024–8035, 2019.
265
+
266
+ Georgios Pavlakos, Vasileios Choutas, Nima Ghorbani, Timo Bolkart, Ahmed AA Osman, Dimitrios Tzionas, and Michael J Black. Expressive body capture: 3d hands, face, and body from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10975–10985, 2019.
267
+
268
+ Xue Bin Peng, Angjoo Kanazawa, Sam Toyer, Pieter Abbeel, and Sergey Levine. Variational discriminator bottleneck: Improving imitation learning, inverse rl, and gans by constraining information flow. arXiv preprint arXiv:1810.00821, 2018.
269
+
270
+ Jan Peters and Stefan Schaal. Reinforcement learning of motor skills with policy gradients. Neural networks, 21(4):682–697, 2008.
271
+
272
+ Vitchyr H Pong, Murtaza Dalal, Steven Lin, Ashvin Nair, Shikhar Bahl, and Sergey Levine. Skew-fit: State-covering self-supervised reinforcement learning. arXiv preprint arXiv:1903.03698, 2019.
273
+
274
+ Danilo Jimenez Rezende and Fabio Viola. Taming vaes. arXiv preprint arXiv:1810.00597, 2018.
275
+
276
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. 2014.
277
+
278
+ Jason Tyler Rolfe. Discrete variational autoencoders. arXiv preprint arXiv:1609.02200, 2016.
279
+
280
+ Mihaela Rosca, Balaji Lakshminarayanan, and Shakir Mohamed. Distribution matching in variational inference. arXiv preprint arXiv:1802.06847, 2018.
281
+
282
+ Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
283
+
284
+ Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. 2015.
285
+
286
+ Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016.
287
+
288
+ Andrew Stirn and David A Knowles. Variational variance: Simple and reliable predictive variance parameterization. arXiv preprint arXiv:2006.04910, 2020.
289
+
290
+ Hiroshi Takahashi, Tomoharu Iwata, Yuki Yamanaka, Masanori Yamada, and Satoshi Yagi. Student-t variational autoencoder for robust density estimation. In IJCAI, pp. 2696–2702, 2018.
291
+
292
+ ![](images/2b3ba81e785aa592ac00900595a968588fd2c1d64f9124ae200bbd89fc7e1eeb.jpg)
293
+ Figure 5: Samples from the $\sigma$ -VAE (left) and the Gaussian VAE (right) on the SVHN dataset. The Gaussian VAE produces blurry results with muted colors, while the $\sigma$ -VAE is able to produce accurate images of digits.
294
+
295
+ Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative ¨ models. ICLR, 2016.
296
+
297
+ Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in neural information processing systems, pp. 2746–2754, 2015.
298
+
299
+ Shengjia Zhao, Jiaming Song, and Stefano Ermon. Infovae: Information maximizing variational autoencoders. arXiv preprint arXiv:1706.02262, 2017.
300
+
301
+ 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.
302
+
303
+ # A ADDITIONAL EXPERIMENTAL RESULTS
304
+
305
+ In this section, we provide more qualitative results in Figures 7, 6, 8, 5 as well as a graph showing the convergence properties of the variance for different models in Fig. 9. In order to validate our method with a different architecture, we also report performance of different decoders with a small 5-layer convolutional architecture on the CelebA and CIFAR dataset in Table 3. We see that the ordering of the methods is consistent with this smaller architecture.
306
+
307
+ # B EXPERIMENTAL DETAILS
308
+
309
+ For the small convolutional network test on SVHN, the encoder has 3 convolutional layers followed by a fully connected layer, while the decoder has a fully connected layer followed by 3 convolutional layers. The $\beta$ was tuned from 100 to 0.0001 for $\beta$ -VAE. The number of channels in the convolutional layers starts with 32 and increases 2 times in every layer. The dimension of the latent variable is 20. Adam (Kingma & Ba, 2015) with learning rate of 1e-3 is used for optimization. Batch size of 128 was used and all models were trained for 10 epochs. We additionally evaluate this small convolutional network on CelebA, CIFAR, and Frey Face2 datasets in Table 3. Unit Gaussian prior and Gaussian posteriors with diagonal covariance were used. For the larger hierarchical VAE, we used the official pytorch implementation of (Maaløe et al., 2019). We use the baseline hierarchical VAE with 15 layers of latent variables, without the top-down and bottom-up connections. For the hierarchical VAE and the SVG-LP model, we use the default hyperparameters in the respective implementations. We use the standard train-val-test split for all datasets. All models were trained on a single high-end GPU. We use the official PyTorch implementation of the Inception network to compute FID. All methods are compared on the same hyperparameters.
310
+
311
+ ![](images/d38593657ca6b60d33ed0b9cdf75405e10302b180aabe801f09b58dd79319736.jpg)
312
+ Figure 6: Samples from the $\sigma$ -VAE (left) and the Gaussian VAE (right) on the CelebA dataset, images cropped to the face for clarity. The Gaussian VAE produces blurry results with indistinct face features, while the $\sigma$ -VAE is able to produce accurate images of faces.
313
+
314
+ Table 3: Generative modeling performance of the proposed $\sigma$ -VAE on CelebA, CIFAR, and Frey Face with a smaller model. We see that uncalibrated decoders such as mean-only Gaussian perform poorly. $\beta$ -VAE allows to calibrate the decoder but needs careful hyperparameter tuning. Calibrated decoders such as categorical or $\sigma$ -VAE perform best.
315
+
316
+ <table><tr><td rowspan="2"></td><td colspan="2">CelebA VAE</td><td colspan="2">CIFAR VAE</td><td colspan="2">Frey Face VAE</td></tr><tr><td>-logp↓</td><td>FID↓</td><td>-logp↓</td><td>FID↓</td><td>-logp↓</td><td>FID↓</td></tr><tr><td>Bernoulli VAE Gregor et al. (2015)</td><td></td><td>102.7</td><td></td><td>165.1</td><td></td><td>47.7</td></tr><tr><td>Categorical VAE</td><td>;10195</td><td>50.45</td><td>;10673</td><td>124.1</td><td>&lt;2454</td><td>50.16</td></tr><tr><td>bitwise-categorical VAE</td><td>11019</td><td>56.36</td><td>11604</td><td>99.65</td><td>&lt;3173</td><td>66.77</td></tr><tr><td>Logistic mixture VAE</td><td>;10154</td><td>61.81</td><td>;10648</td><td>100.2</td><td>&lt;2562</td><td>50.28</td></tr><tr><td>Gaussian VAE</td><td>&lt;2201</td><td>144.8</td><td>&lt;1409</td><td>205.8</td><td>&lt;726.4</td><td>80.17</td></tr><tr><td>β-VAE Higgins et al. (2017)</td><td>&lt;-1942</td><td>58.73</td><td>&lt;-1318</td><td>117.9</td><td>&lt; -420.0</td><td>37.61</td></tr><tr><td>Shared g-VAE (Ours)</td><td>&lt;-1939</td><td>73.27</td><td>&lt; (-1830</td><td>137.8</td><td>&lt; -49.78</td><td>42.86</td></tr><tr><td>Optimal g-VAE (Ours)</td><td>&lt;-1951</td><td>61.27</td><td>&lt; (-1832</td><td>80.9</td><td>&lt; -1622</td><td>53.36</td></tr><tr><td>Opt. per-image g-VAE (Ours)</td><td></td><td>53.13</td><td></td><td>89.88</td><td></td><td>56.07</td></tr></table>
317
+
318
+ ![](images/ca6fc2105698b7956e8b56b977c9c8da04a3379e8a83c6b66b469bc5cb64f51b.jpg)
319
+ Figure 7: Samples from the $\sigma$ -VAE (top) and the Gaussian VAE (bottom) on the BAIR dataset. Sampled sequences conditioned on two initial frames are shown, and the ground truth sequence is shown at the top. The Gaussian VAE produces blurry robot arm texture and the arm often disappears towards the end of the sequence, while the $\sigma$ -VAE is able to produce sequences with realistic motion and model the details of the arm texture, such as the gripper.
320
+
321
+ ![](images/37438c302fad1c82eb34bd451e5ebc5793a6d0778bfc657860781536da22714b.jpg)
322
+ Figure 8: Samples from the $\sigma$ -VAE (left) and the Gaussian VAE (right) on the challenging CIFAR dataset. The Gaussian VAE produces blurry results with muted colors, while the $\sigma$ -VAE models the distribution of shapes in the CIFAR data more faithfully.
323
+
324
+ ![](images/8469db8ea7a9237e00486921f5ccc4e7297db5670f610fba5908ade727026f74.jpg)
325
+ Figure 9: Variance convergence speed on SVHN. We see that the shared $\sigma$ -VAE which optimizes the variance with gradient descent has an initial period of convergence when the variance converges to the region of the optimal value. In contrast, $\sigma$ -VAE with analytical (optimal) variance quickly learns a good estimate of the variance, which leads to better performance. The unit variance Gaussian $\beta$ -VAE can be interpreted as having a constant variance determined by $\beta$ , shown here. Since the variance doesn’t change throughout training, it achieves suboptimal performance.
326
+
327
+ # C EMPIRICAL ANALYZIS OF APPROXIMATIONS FOR OPTIMAL $\sigma$ -VAE
328
+
329
+ The optimal $\sigma$ -VAE requires computing the following estimate of the variance
330
+
331
+ $$
332
+ \sigma ^ { * } = \underset { \sigma } { \arg \operatorname* { m a x } } \mathbb { E } _ { x \sim \mathrm { D a t a } } \mathbb { E } _ { q ( z | x ) } \left[ \ln p ( x | \mu _ { \theta } ( z ) , \sigma ^ { 2 } I ) \right] = \mathbb { E } _ { x \sim \mathrm { D a t a } } \mathbb { E } _ { q ( z | x ) } { \mathbf { M S E } } ( x , \mu _ { \theta } ( z ) ) .
333
+ $$
334
+
335
+ This requires computing two expectations, with respect to the data in the dataset, and with respect to the encoder distribution. We use MC sampling with one sample per data point to approximate both expectations. Inspired by common practices in VAEs, we use one sample per data point to approximate the inner expectation. On SVHN, the standard error of this approximation is $0 . 2 6 \%$ of the value of sigma. We further approximate the outer expectation with a single batch instead of the entire dataset. On SVHN, the standard error of this approximation is $2 \%$ of the value of sigma. We see that both approximations are accurate in practice. The second approximation yields a biased estimate of the evidence lower bound because the same batch is used to approximate the variance and compute the lower bound estimate. However, this bias can be corrected by using a different batch, or with a running average of the variance with an appropriate decay. This running average can also be used to reduce the variance of the estimate and to achieve convergence guarantees, but we did not find it necessary in our experiments.
336
+
337
+ # D ALTERNATIVE DECODER CHOICES
338
+
339
+ We describe the alternative decoders evaluated in Table 2: using the bitwise-categorical, and the logistic mixture distributions.
340
+
341
+ Bitwise-categorical VAE While the 256-way categorical decoder described in Section 3.2 is very powerful due to the ability to specify any possible intensity distribution, it suffers from high computational and memory requirements. Because 256 values need to be kept for each pixel and channel, simply keeping this distribution in memory for one 3-channel $1 0 2 4 \times 1 0 2 4$ image would require 3 GiB of memory, compared to 0.012 GiB for the Gaussian decoder. Therefore, training deep
342
+
343
+ Table 4: ELBO on discretized data. All distributions except categorical have scalar scale parameters. The $\sigma$ -VAE performs well on the discretized ELBO metric, performing similarly to a discrete distribution parametrized as a discretized Gaussian or discretized Logistic. Full categorical distribution attains highest likelihood due to having the most statistical power.
344
+
345
+ <table><tr><td rowspan="2"></td><td colspan="3">CIFAR VAE</td></tr><tr><td>- log pdf↓</td><td>-logp↓</td><td>FID↓</td></tr><tr><td>Categorical VAE</td><td></td><td>&lt;10673</td><td>137.6</td></tr><tr><td>Gaussian VAE</td><td>&lt;740.5</td><td>&lt;15131</td><td>212.7</td></tr><tr><td>Gaussianσ-VAE</td><td>&lt;-896.1</td><td>&lt;11120</td><td>136.7</td></tr><tr><td>Disc.Gaussian g-VAE</td><td></td><td>&lt;11117</td><td>136.9</td></tr><tr><td>Disc.Logistic g-VAE</td><td></td><td>&lt;11103</td><td>136.7</td></tr></table>
346
+
347
+ neural networks with this full categorical distribution is impractical for high-resolution images or videos. The bitwise-categorical VAE improves the memory complexity by defining the distribution over 256 values in a more compact way. Specifically, it defines a binary distribution over each bit in the pixel intensity value, requiring 8 values in total, one for each bit. This distribution can be thought of as a classifier that predicts the value of each bit in the image separately. In our implementation of the bitwise-categorical likelihood, we convert the image channels to binary format and use the standard binary cross-entropy loss (which reduces to binary log-likelihood since all bits in the image are deterministically either zero or one). While in our experiments the bitwise-categorical distribution did not outperform other choices, it often performs on par with our proposed method. We expect this distribution to be useful due to its generality as it is able to represent values stored in any digital format by converting them into binary.
348
+
349
+ Logistic mixture VAE For this decoder, we adapt the discretized logistic mixture from Salimans et al. (2017). To define a discrete 256-way distribution, it divides the corresponding continuous distribution into 256 bins, where the probability mass is defined as the integral of the PDF over the corresponding bin. (Kingma et al., 2016) uses the logistic distribution discretized in this manner for the decoder. Salimans et al. (2017) suggests to make all bins except the first and the last be of equal size, whereas the first and the last bin include, respectively, the intervals $( - \infty , 0 ]$ and $\lbrack 1 , \infty )$ . Salimans et al. (2017) further suggests using a mixture of discretized logistics for improved capacity. Our implementation largely follows the one in Salimans et al. (2017), however, we note that the original implementation is not suitable for learning latent variable models, as it generates the channels autoregressively. This will cause the latent variable to lose color information since it can be represented by the autoregressive decoder. We therefore adapt the mixture of discretized logistics to the pure latent variable setup by removing the mean-adjusting coefficients from (Salimans et al., 2017). In our experiments, the logistic mixture outperformed other discrete distributions.
md/train/qda7-sVg84/qda7-sVg84.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/r1G4z8cge/r1G4z8cge.md ADDED
@@ -0,0 +1,495 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MOLLIFYING NETWORKS
2
+
3
+ Caglar Gulcehre1, Marcin Moczulski2,∗, Francesco Visin3,∗ Yoshua Bengio1 1 University of Montreal, 2 University of Oxford, 3 Politecnico di Milano
4
+
5
+ # ABSTRACT
6
+
7
+ The optimization of deep neural networks can be more challenging than the traditional convex optimization problems due to highly non-convex nature of the loss function, e.g. it can involve pathological landscapes such as saddle-surfaces that can be difficult to escape from for algorithms based on simple gradient descent. In this paper, we attack the problem of optimization of highly non-convex neural networks objectives by starting with a smoothed – or mollified – objective function which becomes more complex as the training proceeds. Our proposition is inspired by the recent studies in continuation methods: similarly to curriculum methods, we begin by learning an easier (possibly convex) objective function and let it evolve during training until it eventually becomes the original, difficult to optimize objective function. The complexity of the mollified networks is controlled by a single hyperparameter that is annealed during training. We show improvements on various difficult optimization tasks and establish a relationship between recent works on continuation methods for neural networks and mollifiers.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ In the last few years, deep neural networks – i.e. convolutional networks (LeCun et al., 1989), LSTMs (Hochreiter & Schmidhuber, 1997a) or GRUs (Cho et al., 2014) – set the state of the art on a range of challenging tasks (Szegedy et al., 2014; Visin et al., 2015; Hinton et al., 2012; Sutskever et al., 2014; Bahdanau et al., 2014; Mnih et al., 2013; Silver et al., 2016). However when trained with variants of SGD (Bottou, 1998) deep networks can be difficult to optimize due to their highly non-linear and non-convex nature (Choromanska et al., 2014; Dauphin et al., 2014).
12
+
13
+ A number of approaches were proposed to alleviate the difficulty of optimization: addressing the problem of the internal covariate shift with Batch Normalization (Ioffe & Szegedy, 2015), learning with a curriculum (Bengio et al., 2009), recently an approach to train RNNs with diffusion process (Mobahi, 2016), and graduated optimization (Hazan et al., 2015). The impact of noise injection on the behavior of modern deep learning methods has been explored by Neelakantan et al. (2015a). Hazan et al. (2015) have shown that injecting a particular noise and scheduling it carefully, can guarantee the convergence in $O ( 1 / \sigma ^ { 2 } \epsilon ^ { 2 } )$ steps for $\epsilon$ -optimal and $\sigma$ -nice functions. Similar to our work graduated optimization optimizes a smoothed objective function without performing expensive convolutions. Injecting noise to the activation functions and scheduling it have been recently shown to improve the performance on a wide variety of tasks (Gulcehre et al., 2016).
14
+
15
+ We connect the ideas of curriculum learning and continuation methods with those arising from models with skip connections and using layers that compute near-identity transformations. Skip connections allow to train very deep residual and highway architectures (He et al., 2015; Srivastava et al., 2015) by skipping layers or block of layers. Similarly, it has been shown that stochastically changing the depth of a network during training (Huang et al., 2016b) does not prevent convergence and enables better generalization performance.
16
+
17
+ We discuss the idea of mollification for neural networks – a form of differentiable smoothing of the loss function connected to noisy activations – which in our case can be interpreted as a form of adaptive noise injection which is controlled by a single hyperparameter. Inspired by Huang et al. (2016b), we use a hyperparameter to stochastically control the depth of our network. This allows us to start the optimization from a convex objective function (as long as the optimized criterion is convex, e.g. linear or logistic regression) and to slowly introduce more complexity into the model by annealing the hyperparameter, thus making the network deeper and increasingly non-linear.
18
+
19
+ ![](images/a43e573759ef754c90bf6fbf3615df4808ea481cc1b4c0fe1226a5cfec94d678.jpg)
20
+ Figure 1: A sequence of optimization problems of increasing complexity, where the first ones are easy to solve but only the last one corresponds to the actual problem of interest. It is possible to tackle the problems in order, starting each time at the solution of the previous one and tracking the local minima along the way.
21
+
22
+ An important difference of our work compared to injecting noise to the gradients as it is explored in (Hazan et al., 2015; Neelakantan et al., 2015b) is that we inject the noise in the forward computation of the graph and we shape the cost function directly. As a result the cost function for the mollified network both at the test time and during the training are consistent and this makes the early-stopping much easier.
23
+
24
+ # 2 MOLLIFYING OBJECTIVE FUNCTIONS
25
+
26
+ # 2.1 CONTINUATION AND ANNEALING METHODS
27
+
28
+ Continuation methods and simulated annealing provide a general strategy to reduce the impact of local minima and deal with non-convex, continuous, but not necessarily everywhere differentiable objective functions by smoothing the original objective function and gradually reducing the amount of smoothing during training (Allgower & Georg, 1980) (see Fig. 1).
29
+
30
+ In machine learning, approaches based on curriculum learning (Bengio et al., 2009) are inspired by this principle and define a sequence of gradually more difficult training tasks (or training distributions) that eventually converge to the task of interest.
31
+
32
+ In the context of stochastic gradient descent, we use a stochastic estimation of the gradient for the smoothed objective function. This is convenient because it may not be analytically feasible to compute the smoothed function, but a Monte-Carlo estimate can often be obtained easily.
33
+
34
+ In this paper we construct a sequence of smoothed objective functions obtained with a form of mollification and we progressively optimize them. The training procedure iterates over the sequence of objective functions starting from the simpler ones – i.e. with a smoother loss surface – and moving towards more complex ones until the last, original, objective function is reached.1
35
+
36
+ # 2.2 MOLLIFIERS AND WEAK GRADIENTS
37
+
38
+ We smooth the loss function $\mathcal { L }$ , which is parametrized by $\boldsymbol \theta \in \mathbb { R } ^ { n }$ , by convolving it with another function $K ( \cdot )$ with stride $\tau \in \mathbb { R } ^ { n }$ :
39
+
40
+ $$
41
+ \mathscr { L } _ { K } ( \pmb { \theta } ) = ( \mathscr { L } * K ) ( \pmb { \theta } ) = \int _ { - \infty } ^ { + \infty } \mathscr { L } ( \pmb { \theta } - \pmb { \tau } ) K ( \pmb { \tau } ) d \pmb { \tau }
42
+ $$
43
+
44
+ Although there are many choices for the function $K ( \cdot )$ , we focus on those that satisfy the definition of a mollifier.
45
+
46
+ A mollifier is an infinitely differentiable function that behaves like an approximate identity in the group of convolutions of integrable functions. If $K ( \cdot )$ is an infinitely differentiable function, that converges to the Dirac delta function when appropriately rescaled and for any integrable function $\mathcal { L }$ , then it is a mollifier:
47
+
48
+ $$
49
+ \mathcal { L } ( \pmb \theta ) = \operatorname* { l i m } _ { \epsilon 0 } \int \epsilon ^ { - n } K ( \pmb \tau / \epsilon ) \mathcal { L } ( \pmb \theta - \pmb \tau ) d \pmb \tau .
50
+ $$
51
+
52
+ If we choose $K ( \cdot )$ to be a mollifier and obtain the smoothed loss function $\mathcal { L } _ { K }$ as in Eqn. 1, we can take its gradient with respect to $\pmb \theta$ using directly the result from Evans (1998):
53
+
54
+ $$
55
+ \nabla _ { \pmb { \theta } } \mathcal { L } _ { K } ( \pmb { \theta } ) = \nabla _ { \pmb { \theta } } ( \mathcal { L } \ast K ) ( \pmb { \theta } ) = ( \mathcal { L } \ast \nabla K ) ( \pmb { \theta } ) .
56
+ $$
57
+
58
+ To relate the resulting gradient $\nabla _ { \pmb { \theta } } \mathcal { L } _ { K }$ to the gradient of the original function $\mathcal { L }$ , we introduce the notion of weak gradient, i.e. an extension to the idea of weak/distributional derivatives to functions with multidimensional arguments, such as loss functions of neural networks.
59
+
60
+ For an integrable function $\mathcal { L }$ in space ${ \mathcal { L } } \in L ( [ a , b ] )$ , ${ \mathrm { ~ ~ g ~ } } \in \ L ( [ a , b ] ^ { n } )$ is a $n$ -dimensional weak gradient of $\mathcal { L }$ if it satisfies:
61
+
62
+ $$
63
+ \int _ { C } \mathbf { g } ( \pmb { \tau } ) K ( \pmb { \tau } ) d \pmb { \tau } = - \int _ { C } \mathcal { L } ( \pmb { \tau } ) \nabla K ( \pmb { \tau } ) d \pmb { \tau } ,
64
+ $$
65
+
66
+ where $K ( \tau )$ is an infinitely differentiable function vanishing at infinity, $C \in [ a , b ] ^ { n }$ and $\tau \in \mathbb { R } ^ { n }$
67
+
68
+ As long as the chosen $K ( \cdot )$ fulfills the definition of a mollifier we can use Eqn. 3 and Eqn. $4 ^ { 2 }$ to rewrite the gradient as:
69
+
70
+ $$
71
+ \begin{array} { r l r } { \nabla _ { \pmb { \theta } } \mathcal { L } _ { K } ( \pmb { \theta } ) = ( \mathcal { L } \ast \nabla K ) ( \pmb { \theta } ) } & { } & { \mathrm { b y ~ E q n . ~ 3 } } \\ { = \displaystyle \int _ { C } \mathcal { L } ( \pmb { \theta } - \pmb { \tau } ^ { } ) \nabla K ( \pmb { \tau } ^ { } ) d \pmb { \tau } } \\ { = - \displaystyle \int _ { C } \mathbf { g } ( \pmb { \theta } - \pmb { \tau } ^ { } ) K ( \pmb { \tau } ^ { } ) d \pmb { \tau } } & { } & { \mathrm { b y ~ E q n . ~ 4 } } \end{array}
72
+ $$
73
+
74
+ For a differentiable almost everywhere function $\mathcal { L }$ , the weak gradient $g ( \pmb \theta )$ is equal to $\nabla _ { \boldsymbol { \theta } } \mathcal { L }$ almost everywhere. With a slight abuse of notation we can therefore write:
75
+
76
+ $$
77
+ \nabla _ { \pmb { \theta } } \mathcal { L } _ { K } ( \pmb { \theta } ) = - \int _ { C } \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } - \pmb { \tau } ) K ( \pmb { \tau } ) d \pmb { \tau }
78
+ $$
79
+
80
+ # 2.3 GAUSSIAN MOLLIFIERS
81
+
82
+ It is possible to use the standard Gaussian distribution $\mathcal { N } ( 0 , \bf { I } )$ as a mollifier $K ( \cdot )$ , as it satisfies the desired properties: it is infinitely differentiable, a sequence of properly rescaled Gaussian distributions converges to the Dirac delta function and it vanishes in infinity. With such a $K ( \cdot )$ the gradient becomes:
83
+
84
+ $$
85
+ \begin{array} { r l } { { \nabla _ { \theta } \mathcal { L } _ { K = \mathcal { N } } ( \theta ) = - \int _ { C } \nabla _ { \theta } \mathcal { L } ( \theta - \tau ) p ( \tau ) d \tau } } \\ & { = \mathrm { E } _ { \tau } [ \nabla _ { \theta } \mathcal { L } ( \theta - \tau ) ] , \mathrm { w i t h } \ \tau \sim \mathcal { N } ( 0 , \ \mathbf { I } ) } \end{array}
86
+ $$
87
+
88
+ Exploiting the fact that a Gaussian distribution is a mollifier, we can focus on a sequence of mollifications indexed by scaling parameter $\epsilon$ introduced in Eqn. 2. A single element of this sequence takes the following form:
89
+
90
+ $$
91
+ \begin{array} { r l } & { \nabla _ { \boldsymbol { \theta } } \mathcal { L } _ { \mathcal { N } , \epsilon } ( \boldsymbol { \theta } ) = - \displaystyle \int _ { C } \nabla _ { \boldsymbol { \theta } } \mathcal { L } ( \boldsymbol { \theta } - \boldsymbol { \tau } ) \epsilon ^ { - 1 } p ( \boldsymbol { \tau } / \epsilon ) d \boldsymbol { \tau } } \\ & { ~ = \mathrm { E } _ { \boldsymbol { \tau } } [ \nabla _ { \boldsymbol { \theta } } \mathcal { L } ( \boldsymbol { \theta } - \boldsymbol { \tau } ) ] , \mathrm { w i t h } \boldsymbol { \tau } \sim \mathcal { N } ( 0 , \epsilon ^ { 2 } \mathbf { I } ) } \end{array}
92
+ $$
93
+
94
+ Replacing $\epsilon$ with $\sigma$ yields a sequence of mollifications indexed by $\sigma$
95
+
96
+ $$
97
+ \nabla _ { \pmb { \theta } } \mathcal { L } _ { \mathcal { N } , \sigma } ( \pmb { \theta } ) = \mathrm { E } _ { \pmb { \tau } } [ \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } - \pmb { \tau } ) ] , \mathrm { w i t h } \ \pmb { \tau } \sim \mathcal { N } ( 0 , \ \sigma ^ { 2 } \mathbf { I } )
98
+ $$
99
+
100
+ with the following property (by Eqn. 2):
101
+
102
+ $$
103
+ \operatorname* { l i m } _ { \sigma \to 0 } \nabla _ { \pmb { \theta } } \mathcal { L } _ { \mathcal { N } , \sigma } ( \pmb { \theta } ) = \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } )
104
+ $$
105
+
106
+ An intuitive interpretation of the result is that $\sigma$ determines the standard deviation of a mollifying Gaussian and is annealed in order to construct a sequence of gradually less "blurred" and closer approximations to $\mathcal { L }$ . This is consistent with the property that when $\sigma$ is annealed to zero we are optimizing the original function $\mathcal { L }$ .
107
+
108
+ So far we obtained the mollified version $\mathcal { L } _ { K } ( \pmb { \theta } )$ of the cost function $\mathcal { L } ( \pmb { \theta } )$ by convolving it with a mollifier $K ( \pmb \theta )$ . The kernel $K ( \pmb \theta )$ corresponds to the average effect of injecting noise $\bar { \xi }$ sampled from standard Normal distribution. The amount of noise controls the amount of smoothing. Gradually reducing the noise during training is related to a form of simulated annealing (Kirkpatrick et al., 1983). Similarly to the analysis in Mobahi (2016), we can write a Monte-Carlo estimate of $\begin{array} { r } { \mathcal { L } _ { K } ( \pmb { \theta } ) = ( \mathcal { L } * K ) ( \pmb { \theta } ) \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( \pmb { \theta } - \pmb { \xi } ^ { ( i ) } ) } \end{array}$ . We provide the derivation and the gradient of this equation in Appendix A.
109
+
110
+ The Monte-Carlo estimators of the mollifiers can be easily implemented with neural networks, where the layers typically have the form:
111
+
112
+ $$
113
+ \mathbf { h } ^ { l } = \mathbf { f } ( \mathbf { W } ^ { l } \mathbf { h } ^ { l - 1 } )
114
+ $$
115
+
116
+ with $\mathbf { h } ^ { l - 1 }$ a vector of activations from the previous layer in the hierarchy, $\mathbf { W } ^ { l }$ a matrix representing a linear transformation and f an element-wise non-linearity of choice.
117
+
118
+ A mollification of such a layer can be formulated as:
119
+
120
+ $$
121
+ \mathbf { h } ^ { l } = \mathbf { f } ( ( \mathbf { W } ^ { l } - \boldsymbol { \xi } ^ { l } ) \mathbf { h } ^ { l - 1 } ) , \mathrm { w h e r e \ } \boldsymbol { \xi } ^ { l } \sim \mathcal { N } ( \mu , \boldsymbol { \sigma } ^ { 2 } )
122
+ $$
123
+
124
+ From Eqn. 16, it is easy to see that both weight noise methods proposed by Hinton $\&$ van Camp (1993) and Graves (2011) can be seen as a variation of Monte-Carlo estimate of mollifiers.
125
+
126
+ # 2.4 GENERALIZED AND NOISY MOLLIFIERS
127
+
128
+ We introduce a generalization of the concept of mollifiers that encompasses the approach we explored here and that is targeted during optimization via a continuation method using stochastic gradient descent.
129
+
130
+ Definition 2.1. (Generalized Mollifier). A generalized mollifier is an operator, where $T _ { \sigma } ( f )$ defines a mapping between two functions, such that $T _ { \sigma } : f \to f ^ { * }$ .
131
+
132
+ $$
133
+ \operatorname* { l i m } _ { \sigma \to 0 } T _ { \sigma } f = f ,
134
+ $$
135
+
136
+ $$
137
+ \begin{array} { r l } { { f ^ { 0 } = \displaystyle \operatorname* { l i m } _ { \sigma \to \infty } T _ { \sigma } f \quad } } & { { \mathrm { ~ i s ~ \ a n ~ i d e n t i t y ~ f u n c t i o n ~ } } } \\ { { \frac { \partial ( T _ { \sigma } f ) ( x ) } { \partial x } \quad } } & { { \mathrm { e x i s t s ~ } \forall x , \sigma > 0 } } \end{array}
138
+ $$
139
+
140
+ In addition, we consider noisy mollifiers which can be defined as an expected value of a stochastic function $\phi ( x , \xi )$ under some noise source $\xi$ with variance $\sigma$ :
141
+
142
+ $$
143
+ ( T _ { \sigma } f ) ( x ) = E _ { \xi } [ \phi ( x , \xi _ { \sigma } ) ]
144
+ $$
145
+
146
+ Definition 2.2. (Noisy Mollifier). We call a stochastic function $\phi ( x , \xi _ { \sigma } )$ with input $x$ and noise $\xi$ a noisy mollifier if its expected value corresponds to the application of a generalized mollifier $T _ { \sigma }$ , as per Eqn. 20.
147
+
148
+ The composition of two noisy mollifiers sharing the same $\sigma$ is also a noisy mollifier, since the three properties in the definition (Eqns. 17,18,19) are still satisfied. When $\sigma = 0$ no noise is injected and therefore the original function will be optimized. If $\sigma \to \infty$ instead, the function will become an identity function. Thus, for instance, if we mollify each layer of a feed-forward network except the output layer, when $\sigma \to \infty$ all the mollified layers will become identity function and the objective function of the network with respect to its inputs will be convex.
149
+
150
+ Consequently, corrupting separately the activation function of each level of a deep neural network (but with a shared noise level $\sigma$ ) and annealing $\sigma$ yields a noisy mollifier for the objective function. This is related to the work of Mobahi (2016), who recently introduced a way of analytically smoothing of the non-linearities to help the training of recurrent networks. The differences of that approach from our algorithm is two-fold: we use a noisy mollifier (rather than an analytic smoothing of the network’s non-linearities) and we introduce (in the next section) a particular form of the noisy mollifier that empirically proved to work well.
151
+
152
+ Shaping the cost function to define a sequence of costs that are progressing from easier to more difficult ones can be related to the reward shaping $\mathrm { N g }$ et al., 1999; $\bar { \bf N } \mathrm { \bf g }$ , 2003) algorithms. In our algorithm, we shape the cost and the model architecture itself, rather than rewards or the targets in order to make the optimization easier. In that sense, reward shaping can be considered to be more closer to curriculum learning.
153
+
154
+ # 3 METHOD
155
+
156
+ We propose an algorithm to mollify the cost of a neural network which also addresses an important drawback of the previously proposed noisy training procedures: as the noise gets larger, it can dominate the learning process and lead the algorithm to perform a random walk on the energy landscape of the objective function. Conversely in our algorithm, as the noise gets larger gradient descent minimizes a simpler (e.g. convex) but still meaningful objective function.
157
+
158
+ We define the desired behavior of the network in the limit cases where the noise is very large or very small, and modify the model architecture accordingly. Specifically, during training we minimize a sequence of increasingly complex noisy objectives $\bar { \mathrm { L } } = ( \bar { \mathcal { L } } ^ { 1 } ( \pmb { \theta } ; \xi _ { \sigma _ { 1 } } ) , \bar { \mathcal { L } } ^ { 2 } ( \pmb { \theta } ; \xi _ { \sigma _ { 2 } } ) , \cdots , \bar { \mathcal { L } } ^ { k } ( \pmb { \theta } ; \xi _ { \sigma _ { k } } ) )$ that we obtain by annealing the scale (variance) of the noise $\sigma _ { i }$ . Let us note that our algorithm satisfies the fundamental properties of the generalized and noisy mollifiers that we introduced earlier.
159
+
160
+ We use a noisy mollifier based on our definition in Section 2.4. Instead of convolving the objective function with a kernel:
161
+
162
+ 1. We start the training by optimizing a convex objective function that is obtained by configuring all the layers between the input and the last cost layer to compute an identity function, i.e., by skipping both the affine transformations and the blocks followed by nonlinearities. 2. During training, the magnitude of noise which is proportional to $p$ is annealed, allowing to gradually evolve from identity transformations to linear transformations between the layers. 3. Simultaneously, as we decrease the $p$ , the noisy mollification procedure allows the element-wise activation functions to gradually change from linear to be nonlinear.
163
+
164
+ # 4 SIMPLIFYING THE OBJECTIVE FUNCTION FOR FEEDFORWARD NETWORKS
165
+
166
+ For every unit of each layer, we either copy the activation (output) of the corresponding unit of the previous layer (the identity path in Figure 2) or output a noisy activation $\tilde { \mathbf { h } } ^ { l }$ of a non-linear transformation of it $\psi ( \mathbf { h } ^ { l - 1 } , \boldsymbol { \xi } ; \bar { \mathbf { W } } ^ { l } )$ , where $\boldsymbol { \xi }$ is noise, $\bar { \mathbf { W } } ^ { l }$ is a weight matrix applied on $\mathbf { h } ^ { l - 1 }$ and $\pi$ is a vector of binary decisions for each unit (the convolutional path in Figure 2):
167
+
168
+ $$
169
+ \begin{array} { c } { { \tilde { \mathbf { h } } ^ { l } = \psi ( \mathbf { h } ^ { l - 1 } , \pmb { \xi } ; \mathbf { W } ^ { l } ) } } \\ { { \phi ( \mathbf { h } ^ { l - 1 } , \pmb { \xi } , \pi ^ { l } ; \mathbf { W } ^ { l } ) = \pi ^ { l } \odot \mathbf { h } ^ { l - 1 } + ( 1 - \pi ^ { l } ) \odot \tilde { \mathbf { h } ^ { l } } } } \\ { { \mathbf { h } ^ { l } = \phi ( \mathbf { h } ^ { l - 1 } , \pmb { \xi } , \pi ^ { l } ; \mathbf { W } ^ { l } ) . } } \end{array}
170
+ $$
171
+
172
+ To decide which path to take, for each unit in the network, a binary stochastic decision is taken by drawing from a Bernoulli distribution with probability dependent on the decaying value of $p ^ { l }$ :
173
+
174
+ $$
175
+ \pi ^ { l } \sim \mathrm { B e r n o u l l i } ( p ^ { l } )
176
+ $$
177
+
178
+ If the number of hidden units of layer $l - 1$ and layer $l + 1$ is not the same, we can either zero-pad layer $l - 1$ before feeding it into the next layer or apply a linear projection to obtain the right dimensionality.
179
+
180
+ For $p ^ { l } = 1$ , the layer computes the identity function leading to a convex objective. If $p ^ { l } = 0$ the layer computes the original non-linear transformation unfolding the full capacity of the model. We call the connections that are introduced this way as unitwise stochastic skip connections(USSC).
181
+
182
+ In DropIn layers (Smith et al., 2016) a binary random vector is sampled from a Bernoulli distribution to decide whether to introduce skip a connection from the layer below $l - 1$ for each layer $l$ and they use this as a regularization. As opposed to the USSC, DropIn layers do not necessarily do not necessarily achieve a convex objective function as the DropIn ratio $( \hat { p ^ { l } } )$ increases.
183
+
184
+ The pseudo-code for the mollified activations is reported in Algorithm 1.
185
+
186
+ ![](images/80eecd4ac991add0cb642b20c46377ca05f8af859e791101be6113b09d06839f.jpg)
187
+ Figure 2: Top: Stochastic depth. Bottom: mollifying network. The dashed line represents the optional residual connection. In the top path, the input is processed with a convolutional block followed by a noisy activation function, while in the bottom path the original activation of the layer $l - 1$ is propagated untouched. For each unit, one of the two paths in picked according to a binary stochastic decision $\pi$ .
188
+
189
+ # Algorithm 1 Activation of a unit $i$ at layer $l$
190
+
191
+ 1: $x _ { i } \gets \mathbf { w } _ { i } ^ { \top } \mathbf { h } ^ { l - 1 } + b _ { i }$ . an affine transformation of hl−1
192
+ 2: $\Delta _ { i } \gets \mathbf { u } ( x _ { i } ) - \mathbf { f } ( x _ { i } )$ $\mathsf { D } \Delta _ { i }$ is a measure of a saturation of a unit
193
+ 3: $\sigma ( x _ { i } ) \gets ( \mathrm { s i g m o i d } ( a _ { i } \Delta _ { i } ) - 0 . 5 ) ^ { 2 }$ . std of the injected noise depends on $\Delta _ { i }$
194
+ 4: $\xi _ { i } \sim \mathcal { N } ( 0 , 1 )$ . sampling the noise from a basic Normal distribution
195
+ 5: $s _ { i } \gets p ^ { l } c \sigma ( x _ { i } ) | \xi _ { i } |$ . Half-Normal noise controlled by $\sigma ( x _ { i } )$ , const. $c$ and prob-ty $p ^ { l }$
196
+ 6: $\psi ( x _ { i } , \xi _ { i } ) \gets \mathrm { s g n } ( \mathbf { u } ^ { * } ( x _ { i } ) ) \mathrm { m i n } ( | \mathbf { u } ^ { * } ( x _ { i } ) |$ , $| \mathbf { f } ^ { * } ( x _ { i } ) + \mathrm { s g n } ( \mathbf { u } ^ { * } ( x _ { i } ) ) | \hat { s _ { i } } | | ) + \bar { \mathbf { u } } ( 0 )$ $\triangleright$ noisy activation
197
+ 7: $\pi _ { i } ^ { l } \sim { \bf B e r n o u l l i } ( p ^ { l } ) \qquad \triangleright p ^ { l }$ controls the variance of the noise AND the prob of skipping a unit
198
+ 8: $\ddot { h } _ { i } ^ { l } = \psi ( x _ { i } , \xi _ { i } )$ . $\tilde { h } _ { i } ^ { l }$ is a noisy activation candidate
199
+ 9: $\phi ( \mathbf { h } ^ { l - 1 } , \xi _ { i } , \pi _ { i } ^ { l } ; \mathbf { w } _ { i } ) = \pi _ { i } ^ { l } h _ { i } ^ { l - 1 } + ( 1 - \pi _ { i } ^ { l } ) \tilde { h } _ { i } ^ { l }$ . make a HARD decision between $h _ { i } ^ { l - 1 }$ and $\tilde { h } _ { i } ^ { l }$
200
+
201
+ # 5 LINEARIZING THE NETWORK
202
+
203
+ In Section 2, we show that convolving the objective function with a particular kernel can be approximated by adding noise to the activation function. This method may suffer from excessive random exploration when the noise is very large.
204
+
205
+ We address this issue by bounding the element-wise activation function $\operatorname { f } ( \cdot )$ with its linear approximation when the variance of the noise is very large, after centering it at the origin. The resulting function $\mathrm { f } ^ { \ast } ( \cdot )$ is bounded and centered around the origin.
206
+
207
+ Note that centering the sigmoid or hard-sigmoid will make them symmetric with respect to the origin. With a proper choice of the standard deviation $\sigma ( \mathbf { h } )$ , the noisy activation function becomes a linear function of the input when $\mathfrak { p }$ is large, as illustrated by Figure 10.
208
+
209
+ Let $\mathbf { u } ^ { * } ( x ) = \mathbf { u } ( x ) - \mathbf { u } ( 0 )$ , where ${ \bf u } ( 0 )$ is the offset of the function from the origin, and $x _ { i }$ the $i$ -th dimension of an affine transformation of the output of the previous layer $\mathbf { h } ^ { l - 1 }$ : $x _ { i } = \mathbf { w } _ { i } ^ { \top } \mathbf { h } ^ { l - 1 } + b _ { i }$ . Then:
210
+
211
+ $$
212
+ \psi ( x _ { i } , \xi _ { i } ; \mathbf { w } _ { i } ) = \mathrm { s g n } ( \mathbf { u } ^ { * } ( x _ { i } ) ) \mathrm { m i n } ( | \mathbf { u } ^ { * } ( x _ { i } ) | , | \mathbf { f } ^ { * } ( x _ { i } ) + \mathrm { s g n } ( \mathbf { u } ^ { * } ( x _ { i } ) ) | s _ { i } | | ) + \mathbf { u } ( 0 )
213
+ $$
214
+
215
+ The noise is sampled from a Normal distribution with mean 0 and whose standard deviation depends on $c$ :
216
+
217
+ $$
218
+ s _ { i } \sim \mathcal { N } ( 0 , p c \sigma ( x _ { i } ) )
219
+ $$
220
+
221
+ # 5.1 LINEARIZING RELU ACTIVATION FUNCTION
222
+
223
+ We have a simpler form of the equations to linearize ReLU (Nair & Hinton, 2010) activation function when $p ^ { l } \to \infty \quad$ . Instead of the complicated Eqn. 23. We can use a simpler equation as in Eqn. 26 to
224
+
225
+ ![](images/644f80b2c2d62505206241eaafd9d373597c1578b8fc6d71a55ea6c773a2d3d5.jpg)
226
+ Figure 3: The figures show how to evolve the model to make it closer to a linear network. Arrows denote the direction of the noise pushing the activation function towards the linear function. a) The quasi-convex envelope established by a $| \mathrm { { s i g m o i d } ( \cdot ) | }$ around $| 0 . 2 5 x |$ . b) A depiction of how the noise pushes the sigmoid to become a linear function.
227
+
228
+ achieve the linearization of the activation function when we have a very large noise in the activation function:
229
+
230
+ $$
231
+ \begin{array} { c } { s _ { i } = \underset { \mathbf { \sigma } } { \mathrm { m i n i m u m } } ( | x _ { i } | , p \sigma ( x _ { i } ) | \boldsymbol { \xi } | ) } \\ { \psi ( x _ { i } , \xi _ { i } , \mathbf { w } _ { i } ) = \mathbf { f } ( x _ { i } ) - s _ { i } } \end{array}
232
+ $$
233
+
234
+ # 6 MOLLIFYING LSTMS AND GRUS
235
+
236
+ In a similar vein it is possible to smooth the objective functions of LSTM and GRU networks by starting the optimization procedure with a simpler objective function such as optimizing a word2vec, BoW-LM or CRF objective function at the beginning of training and gradually increasing the difficulty of the optimization by increasing the capacity of the network.
237
+
238
+ For GRUs we set the update gate to $\textstyle { \frac { 1 } { t } }$ – where $t$ is the time-step index – and reset the gate to 1 if the noise is very large, using Algorithm 1. Similarly for LSTMs, we can set the output gate to 1 and input gate to $\textstyle { \frac { 1 } { t } }$ and forget gate to $\textstyle { 1 - { \frac { 1 } { t } } }$ when the noise is very large. The output gate is 1 or close to 1 when the noise is very large. This way the LSTM will behave like a BOW model. In order to achieve this behavior, the activations $\psi ( x _ { t } , \dot { \xi _ { i } } )$ of the gates can be formulated as:
239
+
240
+ $$
241
+ \boldsymbol { \psi } ( x _ { t } ^ { l } , \xi ) = \mathbf { f } ( x _ { t } ^ { l } + p ^ { l } \sigma ( x ) | \xi | )
242
+ $$
243
+
244
+ By using a particular formulation of $\sigma ( x )$ that constraints it to be in expectation over $\xi$ when $p ^ { l } = 1$ , we can obtain a function for $\gamma \in \mathbb { R }$ within the range of $\operatorname { f } ( \cdot )$ that is discrete in expectation, but still per sample differentiable:
245
+
246
+ $$
247
+ \sigma ( x _ { t } ^ { l } ) = \frac { \mathrm { f } ^ { - 1 } ( \gamma ) - x _ { t } ^ { l } } { \mathrm { E } _ { \xi } [ | \xi | ] }
248
+ $$
249
+
250
+ We provide the derivation of Eqn. 28 in Appendix B. The gradient of the Eqn. 28 will be a Monte-Carlo approximation to the gradient of $\bar { \bf f } ( { \bf x } _ { t } ^ { l } )$ .
251
+
252
+ # 7 ANNEALING SCHEDULES FOR $p$
253
+
254
+ We used a different schedule for each layer of the network, such that the noise in the lower layers will anneal faster. This is similar to the linearly decaying probability of layers in Huang et al. (2016b).
255
+
256
+ Exponential Decay In our experiments, we focused on using an annealing schedule similar to the inverse sigmoid rule in Bengio et al. (2015) with $p _ { t } ^ { l }$ ,
257
+
258
+ $$
259
+ p _ { t } ^ { l } = 1 - \mathrm { e } ^ { - \frac { k v _ { t } l } { t L } }
260
+ $$
261
+
262
+ with hyper-parameter model. We stop anne $k \geq 0$ at wh $t ^ { t h }$ update for the he expected de $l ^ { t h }$ $L$ is the number of layers reaches some threshold the. In $\begin{array} { r } { p _ { t } = \sum _ { i = 1 } ^ { L } p _ { t } ^ { l } } \end{array}$ $\delta$ our experiment we set $v _ { t }$ to be a moving average of the $\mathrm { l o s s } ^ { 3 }$ of the network, but for some of our experimnets that resulted unstable behaviors in the training and thus we have to fix $v _ { t }$ to 1. An advantage of using running average of loss for the $v _ { t }$ is because the behavior of the loss/optimization can directly influence the annealing behavior of the network. Because we will have:
263
+
264
+ $$
265
+ \operatorname* { l i m } _ { { \bf v } _ { t } \to \infty } p _ { t } ^ { l } = 1 \mathrm { ~ \ a n d , ~ } \operatorname* { l i m } _ { { \bf v } _ { t } \to 0 } p _ { t } ^ { l } = 0 .
266
+ $$
267
+
268
+ This has a desirable property: when the training-loss is high, the noise injected into the system will be large as well. As a result, the model is encouraged to do more exploration, while if the model converges the noise injected into the system by the mollification procedure will be zero.
269
+
270
+ Square-root Decay The square root decaying of the learning rate is very popular. In our experiments we have tried to decay the plt according to min(pmin, 1 − q $\begin{array} { r } { 1 - \sqrt { \frac { t } { N _ { e p o c h s } } } ) } \end{array}$ where $t$ is the index of the iteration/epoch over the data and $N _ { e p o c h s }$ corresponds to the total number of iterations that the model will do on the dataset. $p _ { m i n }$ is hyperparameter to define the lower bound on the $p _ { t } ^ { l }$ .
271
+
272
+ Linear Decay We have also experimented with linearly decaying the $p _ { t } ^ { l }$ via $\begin{array} { r } { \operatorname* { m i n } ( p _ { m i n } , 1 - \frac { t } { N _ { e p o c h s } } ) } \end{array}$ We have compared the plot of different annealing methods described in this paper as in Figure 4.
273
+
274
+ ![](images/0edec83fe7d1c958a8488792b79a2fed28b69de56bc31b6fc444f2b0511e2401.jpg)
275
+ Figure 4: We compare different annealing schedules with respect to the time in y-axis(iterations).
276
+
277
+ Furthermore, in our experiments we observe that training with noisy mollifiers can potentially be helpful for the generalization. This can be due to the noise induced to the backpropagation through the noisy mollification, that makes SGD more likely to converge to a flatter-minima (Hochreiter & Schmidhuber, 1997b) because the noise will help it escape from sharper local minima.
278
+
279
+ # 8 EXPERIMENTS
280
+
281
+ In this section we mainly focus on training of difficult to optimize models, in particular deep MLPs with sigmoid or tanh activation functions. The details of the experimental procedure is provided in Appendix C.
282
+
283
+ # 8.1 EXPLORATORY STUDY ON MNIST
284
+
285
+ We train a thin deep neural network on MNIST (LeCun & Cortes, 1998) dataset with 72 hidden layers and 100 hidden units. We train our model with Adam(Kingma & Ba, 2014) optimizer and fix the learning rate of all the models to $3 e { - 4 }$ . We have used the same learning-rate for all the models in order to factor out the possibility that a model converges faster, due to the fact of using a larger learning rate.
286
+
287
+ Firstly, in Figure 5, we investigate the effect of using different annealing schedules. Exponential decay converges faster compared to linear decay and square root decay of $p$ . We find it to be very unstable to train our model with linear and square root decay in particular for large $c$ values. Thus we have to use smaller $c$ value (20 instead of 100) to be able to train the model with causing it to diverge.
288
+
289
+ ![](images/be0d19fd9d12424b4a91c95146d3758bf25debfc209b87d8462abca2c20cfb26.jpg)
290
+ Figure 5: We compare the training performance of different types of annealing methods used with mollification procedure to anneal the parameter of the mollification $p$ . Decaying the $p$ exponentially achieves both better training and validation performance.
291
+
292
+ In Figure 6, we show the effect of using the noisy training procedure that we have introduced by sampling a mask from Bernoulli and Gaussian distributions versu using the deterministic approximation of this noisy procedure which we also use for the test time but during the training as well.
293
+
294
+ ![](images/4b8a3ac20b57ecaf26bfbb68e0f1deb19984fdd2b9a2d6ea11e3f0a10189a871.jpg)
295
+ Figure 6: We show the learning curves of the model where we don’t inject the noise during the training and instead use the deterministic approximation for the mollification during the training as well. The differerence in terms of speed of learning is very small.
296
+
297
+ In Figure 7, we compare the results obtained for the model using mollification obtained with or without batch normalization and feed-forward residual networks. The mollified model performs very closely to the MLP trained with residual connections and the batchnorm. However, using residual connections and batch-norm does not seem to improve the results.
298
+
299
+ We have tried to run experiment with the Monte-Carlo approximation of the mollification which is derived in Appendix A, however when we start with large noise and anneal the noise during the training, the model was very unstable and training was diverging. If we start with small noise and anneal the magnitude of the noise during the training, we could not observe any effect of it on the training.
300
+
301
+ ![](images/24f40f65392ee90e6386375192de3d2b7240bb6ad5b1529448614804c614f410.jpg)
302
+ Figure 7: We investigate the effect of using batch norm and residual connection for mollifcation and compare against to the network with residual connections and batch-norm. The effect of batch norm on this task for mollification seems to be very small and training convergence performance of the all the approaches are very close to each other.
303
+
304
+ ![](images/c41840e048fd609433dd3b430329544afc0d1b86c1b1c7b4544f1462c89c0e19.jpg)
305
+ Figure 8: The learning curves of a 6-layers MLP with sigmoid activation function on 40 bit parity task.
306
+
307
+ Table 1: CIFAR10 deep convolutional neural network.
308
+
309
+ <table><tr><td></td><td>Test Accuracy</td></tr><tr><td>Stochastic Depth</td><td>93.25</td></tr><tr><td>Mollified Convnet</td><td>92.45</td></tr><tr><td>ResNet</td><td>91.78</td></tr></table>
310
+
311
+ # 8.2 DEEP MLP EXPERIMENTS
312
+
313
+ Deep Parity Experiments Training neural networks on a high-dimensional parity problem can be challenging (Graves, 2016; Kalchbrenner et al., 2015). We experiment on forty dimensional (bits) parity problem with 6-layer MLP using sigmoid activation function. All the models are initialized with Glorot initialization Glorot et al. (2011) and trained with SGD with momentum. We compare an MLP with residual connections using batch normalization and a mollified network with sigmoid activation function. As can be seen in Figure 8, the mollified network converges faster.
314
+
315
+ Deep Pentomino Pentomino is a toy-image dataset where each image has 3 Pentomino blocks. The task is to predict whether if there is a different shape in the image or not (Gülçehre & Bengio, 2013). The best reported result on this task with MLPs is $6 8 . 1 5 \%$ accuracy (Gulcehre et al., 2014). The same model as ours trained without noisy activation function and vanilla residual connections scored $6 9 . 5 \%$ accuracy, while our mollified version scored $7 5 . 1 5 \%$ accuracy after 100 epochs of training on the $8 0 k$ dataset.
316
+
317
+ CIFAR10 We experimented with deep convolutional neural networks of 110-layers with residual blocks and residual connections comparing our model against ResNet and Stochastic depth. We adapted the hyperparameters of the Stochastic depth network from Huang et al. (2016a) and we used the same hyperparameters for our algorithm. We report the training and validation curves of the three models in Figure 10 and the best test accuracy obtained early stopping on validation accuracy over 500 epochs in Table 1. Our model achieves better generalization than ResNet. Stochastic depth achieves better generalization, but it might be possible to combine both and obtain better results.
318
+
319
+ ![](images/345e69a1318bab42ba15b8295abfbd900d2a22fb372d4cfae106a2e0cb0e9af6.jpg)
320
+ Figure 9: The training curve of a bidirectionalRNN that predicts the embedding corresponding to a sequence of characters.
321
+
322
+ Table 2: 3-layered LSTM network on word-level language modeling for PTB.
323
+
324
+ <table><tr><td></td><td>Test PPL</td></tr><tr><td>LSTM</td><td>119.4</td></tr><tr><td>Mollified LSTM</td><td>115.7</td></tr></table>
325
+
326
+ # 9 LSTM EXPERIMENTS
327
+
328
+ Predicting the Character Embeddings from Characters Learning the mapping from sequences of characters to the word-embeddings is a difficult problem. Thus one needs to use a highly non-linear function. We trained a word2vec model on Wikipedia with embeddings of size 500 (Mikolov et al., 2014) with a vocabulary of size 374557.
329
+
330
+ LSTM Language Modeling We evaluate our model on LSTM language modeling. Our baseline model is a 3-layer stacked LSTM without any regularization. We observed that mollified model converges faster and achieves better results. We provide the results for PTB language modeling in Table 2.
331
+
332
+ # 10 CONCLUSION
333
+
334
+ We propose a novel method for training neural networks inspired by an idea of continuation, smoothing techniques and recent advances in non-convex optimization algorithms. The method makes learning easier by starting from a simpler model, solving a well-behaved problem, and gradually transitioning to a more complicated setting. We show improvements on very deep models, difficult to optimize tasks and compare with powerful techniques such as batch-normalization and residual connections. We also show that the mollification procedure improves the generalization performance of the model on two tasks.
335
+
336
+ Our future work includes testing this method on large-scale language tasks that require long training time, e.g., machine translation and language modeling. Moreover, (Kaiser & Sutskever, 2015) observed that the training of Neural-GPU model can be improved significantly by using gradient noise which can be related to the smoothing of the loss surface, it would be interesting to try mollification on this model to see if the training of Neural GPU can be made easier by using mollification procedure.
337
+
338
+ # ACKNOWLEDGEMENTS
339
+
340
+ We thank Nicholas Ballas and Misha Denil for the valuable discussions and their feedback. We would like to also thank the developers of Theano 4, for developing such a powerful tool for scientific computing Theano Development Team (2016). We acknowledge the support of the following organizations for research funding and computing support: NSERC, Samsung, Calcul Québec, Compute Canada, the Canada Research Chairs and CIFAR.
341
+
342
+ # REFERENCES
343
+
344
+ E. L. Allgower and K. Georg. Numerical Continuation Methods. An Introduction. Springer-Verlag, 1980.
345
+
346
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
347
+
348
+ Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 1171–1179, 2015.
349
+
350
+ Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41–48. ACM, 2009.
351
+
352
+ Léon Bottou. Online algorithms and stochastic approximations. In David Saad (ed.), Online Learning in Neural Networks. Cambridge University Press, Cambridge, UK, 1998.
353
+
354
+ 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. arXiv preprint arXiv:1406.1078, 2014.
355
+
356
+ Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The loss surface of multilayer networks, 2014.
357
+
358
+ Yann Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In NIPS’2014, 2014.
359
+
360
+ Lawrence C Evans. Partial differential equations. Graduate Studies in Mathematics, 19:251–258, 1998.
361
+
362
+ Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In AISTATS, pp. 315–323, 2011.
363
+
364
+ Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pp. 2348–2356, 2011.
365
+
366
+ Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016.
367
+
368
+ Çaglar Gülçehre and Yoshua Bengio. Knowledge matters: Importance of prior information for ˘ optimization. arXiv preprint arXiv:1301.4083, 2013.
369
+
370
+ Caglar Gulcehre, Kyunghyun Cho, Razvan Pascanu, and Yoshua Bengio. Learned-norm pooling for deep feedforward and recurrent neural networks. In Machine Learning and Knowledge Discovery in Databases, pp. 530–546. Springer, 2014.
371
+
372
+ Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. Noisy activation functions. 2016.
373
+
374
+ Elad Hazan, Kfir Y Levy, and Shai Shalev-Shwartz. On graduated optimization for stochastic non-convex problems. arXiv preprint arXiv:1503.03712, 2015.
375
+
376
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
377
+
378
+ Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdel rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara Sainath, and Brian Kingsbury. Deep neural networks for acoustic modeling in speech recognition. Signal Processing Magazine, 2012.
379
+
380
+ Geoffrey E Hinton and Drew van Camp. Keeping neural networks simple. In ICANN’93, pp. 11–18. Springer, 1993.
381
+
382
+ S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997a.
383
+
384
+ Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997b.
385
+
386
+ Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochastic depth. arXiv preprint arXiv:1603.09382, 2016a.
387
+
388
+ Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q. Weinberger. Deep networks with stochastic depth. CoRR, abs/1603.09382, 2016b. URL http: //arxiv.org/abs/1603.09382.
389
+
390
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167, 2015. URL http://arxiv.org/abs/1502.03167.
391
+
392
+ Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015.
393
+
394
+ Nal Kalchbrenner, Ivo Danihelka, and Alex Graves. Grid long short-term memory. arXiv preprint arXiv:1507.01526, 2015.
395
+
396
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
397
+
398
+ S. Kirkpatrick, C. D. Gelatt Jr., , and M. P. Vecchi. Optimization by simulated annealing. 220: 671–680, 1983.
399
+
400
+ Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Comput., 1 (4):541–551, December 1989. ISSN 0899-7667. doi: 10.1162/neco.1989.1.4.541. URL http://dx.doi.org/10.1162/neco.1989.1.4.541.
401
+
402
+ Yann LeCun and Corinna Cortes. The mnist database of handwritten digits, 1998.
403
+
404
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. word2vec, 2014.
405
+
406
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, and Daan Wierstra. Playing atari with deep reinforcement learning. Technical report, arXiv:1312.5602, 2013.
407
+
408
+ Hossein Mobahi. Training recurrent neural networks by diffusion. arXiv preprint arXiv:1601.04114, 2016.
409
+
410
+ Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 807–814, 2010.
411
+
412
+ 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. CoRR, abs/1511.06807, 2015a. URL http://arxiv.org/abs/1511.06807.
413
+
414
+ 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, 2015b.
415
+
416
+ Andrew Y Ng. Shaping and policy search in reinforcement learning. PhD thesis, University of California, Berkeley, 2003.
417
+
418
+ Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, volume 99, pp. 278–287, 1999.
419
+
420
+ 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.
421
+
422
+ Leslie N Smith, Emily M Hand, and Timothy Doster. Gradual dropin of layers to train very deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4763–4771, 2016.
423
+
424
+ Rupesh K Srivastava, Klaus Greff, and Jürgen Schmidhuber. Training very deep networks. In Advances in Neural Information Processing Systems, pp. 2368–2376, 2015.
425
+
426
+ 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.
427
+
428
+ Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. Technical report, Google, 2014.
429
+
430
+ Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/1605.02688.
431
+
432
+ Francesco Visin, Kyle Kastner, Aaron Courville, Yoshua Bengio, Matteo Matteucci, and Kyunghyun Cho. Reseg: A recurrent neural network for object segmentation. arXiv preprint arXiv:1511.07053, 2015.
433
+
434
+ Wojciech Zaremba and Ilya Sutskever. Learning to execute. arXiv preprint arXiv:1410.4615, 2014.
435
+
436
+ # Appendix
437
+
438
+ # A MONTE-CARLO ESTIMATE OF MOLLIFICATION
439
+
440
+ ${ \mathcal L } _ { K } ( \pmb \theta ) = ( { \mathcal L } * K ) ( \pmb \theta ) = \int _ { C } { \mathcal L } ( \pmb \theta - \xi ) K ( \xi ) d \xi$ which can be estimated by a Monte Carlo: $\approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( \pmb { \theta } - \pmb { \xi } ^ { ( i ) } )$ , where $\xi ^ { ( i ) }$ is a realization of the noise random variable $\xi$ yielding $\frac { \partial \mathcal { L } _ { K } ( { \pmb \theta } ) } { \partial { \pmb \theta } }$ $\approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { \partial \mathcal { L } ( \pmb { \theta } - \pmb { \xi } ^ { ( i ) } ) } { \partial \pmb { \theta } } .$
441
+
442
+ Therefore introducing additive noise to the input of $\mathcal { L } ( \pmb \theta )$ is equivalent to mollification.
443
+
444
+ # B DERIVATION OF THE NOISY ACTIVATIONS FOR THE GATING
445
+
446
+ Assume that $z _ { t } ^ { l } = x _ { t } ^ { l } + p _ { t } ^ { l } \sigma ( x ) | \xi _ { t } ^ { l } |$ and $\mathrm { E } _ { \xi } [ \psi ( x _ { t } ^ { l } , \xi ) ] = t$ . Thus for all $z _ { t } ^ { l }$ ,
447
+
448
+ $$
449
+ \begin{array} { r l } & { \mathrm { E } _ { \xi } [ \psi ( x _ { t } ^ { l } , \xi _ { t } ^ { l } ) ] = \mathrm { E } _ { \xi } [ \mathrm { f } ( z _ { t } ^ { l } ) ] , } \\ & { \qquad t = \mathrm { E } _ { \xi } [ \mathrm { f } ( z _ { t } ^ { l } ) ] , \ \mathrm { a s s u m i n g ~ f ( \cdot ) ~ b e h a v e s ~ s i m i l a r ~ t o ~ a ~ l i n e a r ~ f u n c t i o n } ; } \\ & { \qquad \mathrm { E } _ { \xi } [ \mathrm { f } ( z _ { t } ^ { l } ) ] \approx \mathrm { f } ( \mathrm { E } _ { \xi } [ z _ { t } ^ { l } ] ) \ \mathrm { s i n c e ~ w e ~ u s e ~ h a r d - s i g m o i d ~ f o r ~ f ( \cdot ) ~ t h i s ~ w i l l ~ h o l d } . } \\ & { \qquad \mathrm { f } ^ { - 1 } ( t ) \approx \mathrm { E } _ { \xi } [ z _ { t } ^ { l } ] } \end{array}
450
+ $$
451
+
452
+ As in Eqn. 32, we can write the expectation of this equation as:
453
+
454
+ $$
455
+ \mathrm { f } ^ { - 1 } ( t ) \approx x _ { t } ^ { l } + p _ { t } ^ { l } \sigma ( x ) \mathrm { E } _ { \xi } [ \xi _ { t } ^ { l } ]
456
+ $$
457
+
458
+ Corollary, the value that $\sigma ( x _ { t } ^ { l } )$ should take in expectation for $p _ { t } ^ { l } = 1$ would be:
459
+
460
+ $$
461
+ \sigma ( x _ { t } ^ { l } ) \approx \frac { \mathrm { f } ^ { - 1 } ( t ) - x _ { t } ^ { l } } { \mathrm { E } _ { \xi } [ \xi _ { t } ^ { l } ] }
462
+ $$
463
+
464
+ In our experiments for $\operatorname { f } ( \cdot )$ we used the hard-sigmoid activation function. We used the following piecewise activation function in order to use it as $\mathrm { f } ^ { - 1 } ( x ) = 4 ( x - 0 . 5 )$ . During inference we use the expected value of random variables $\pi$ and $\xi$ .
465
+
466
+ # C EXPERIMENTAL DETAILS
467
+
468
+ # C.1 MNIST
469
+
470
+ The weights of the models are initialized with Glorot & Bengio initialization Glorot et al. (2011). We use the learning rate of $4 e - 4$ along with RMSProp. We initialize $a _ { i }$ parameters of mollified activation function by sampling it from a uniform distribution, $\mathrm { { U } [ - 2 , 2 ] }$ . We used 100 hidden units at each layer with a minibatches of size 500.
471
+
472
+ # C.2 PENTOMINO
473
+
474
+ We train a 6−layer MLP with sigmoid activation function using SGD and momentum. We used 200 units per layer with sigmoid activation functions. We use a learning rate of $1 e - 3$ .
475
+
476
+ # C.3 CIFAR10
477
+
478
+ We use the same model with the same hyperparameters for both ResNet, mollified network and the stochastic depth. We borrowed the hyperparameters of the model from Huang et al. (2016a). Our mollified convnet model has residual connections coming from its layer below.
479
+
480
+ ![](images/8dbf86661abcd350698fec3b04fd3a0769dbc7ba6ca3d6a790e7f74289b8e903.jpg)
481
+ Figure 10: Training and validation losses over 500 epochs of a mollified convolutional network composed by 110-layers. We compare against ResNet and Stochastic depth.
482
+
483
+ # C.4 PARITY
484
+
485
+ The n-dimensional parity task is the task to figure out whether the sum of n-bits in a binary vector is even or odd. We use SGD with Nesterov momentum and initialize the weight matrices by using Glorot&Bengio initializationGlorot et al. (2011). For all models, we use the learning rate of $1 e - 3$ and momentum of 0.92. $a _ { i }$ is the parameters of mollified activation function are initialized by sampling from uniform distribution, $\mathsf { \bar { U } } [ - 2 , 2 ]$ .
486
+
487
+ # C.5 LSTM LANGUAGE MODELING
488
+
489
+ We trained 2-layered LSTM language models on PTB word-level. We used the models with the same hyperparameters as in Zaremba & Sutskever (2014). We used the same hyperparameters for both the mollified LSTM language model and the LSTM. We use hard-sigmoid activation function for both the LSTM and mollified LSTM language model. We use hard-sigmoid activation function for the gates of the LSTM.
490
+
491
+ # C.6 PREDICTING THE CHARACTER EMBEDDINGS FROM CHARACTERS
492
+
493
+ We use $1 0 k$ of these words as a validation and another $1 0 k$ word embeddings as test set. We train a bidirectional-LSTM on top of each sequence of characters for each word and on top of the representation of bidirectional LSTM, we use a 5-layered tanh-MLP to predict the word-embedding.
494
+
495
+ We train our models using RMSProp and momentum with learning rate of $6 e - 4$ and momentum 0.92. The size of the minibatches, we used is 64. As seen in Figure 9, mollified LSTM network converges faster.
md/train/r1WUqIceg/r1WUqIceg.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IMPROVING STOCHASTIC GRADIENT DESCENT WITH FEEDBACK
2
+
3
+ Jayanth Koushik & Hiroaki Hayashi ∗
4
+
5
+ Language Technologies Institute
6
+ Carnegie Mellon University
7
+ Pittsburgh, PA 15213, USA
8
+ {jkoushik,hiroakih}@cs.cmu.edu
9
+
10
+ # ABSTRACT
11
+
12
+ In this paper we propose a simple and efficient method for improving stochastic gradient descent methods by using feedback from the objective function. The method tracks the relative changes in the objective function with a running average, and uses it to adaptively tune the learning rate in stochastic gradient descent. We specifically apply this idea to modify Adam, a popular algorithm for training deep neural networks. We conduct experiments to compare the resulting algorithm, which we call Eve, with state of the art methods used for training deep learning models. We train CNNs for image classification, and RNNs for language modeling and question answering. Our experiments show that Eve outperforms all other algorithms on these benchmark tasks. We also analyze the behavior of the feedback mechanism during the training process.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ Despite several breakthrough results in the last few years, the training of deep learning models remains a challenging problem. This training is a complex, high-dimensional, non-convex, stochastic optimization problem which is not amenable to many standard methods. Currently, the most common approach is to use some variant of stochastic gradient descent. Many extensions have been proposed to the basic gradient descent algorithm - designed to handle specific issues in the training of deep learning models. We review some of these methods in the next section.
17
+
18
+ Although variants of simple stochastic gradient descent work quite well in practice, there is still room for improvement. This is easily evidenced by the existence of numerous methods to simplify the optimization problem itself like weight initialization techniques and normalization methods.
19
+
20
+ In this work, we seek to improve stochastic gradient descent with a simple method that incorporates feedback from the objective function. The relative changes in the objective function indicate progress of the optimization algorithm. Our main hypothesis is that incorporating information about this change into the optimization algorithm can lead to improved performance - quantified in terms of the progress rate. We keep a running average of the relative changes in the objective function and use it to divide the learning rate. When the average relative change is high, the learning rate is reduced. This can improve the progress if, for example, the algorithm is bouncing around the walls of the objective function. Conversely, when the relative change is low, the learning rate is increased. This can help the algorithm accelerate through flat areas in the loss surface. As we discuss in the next section, such “plateaus” pose a significant challenge for first order methods and can create the illusion of local minima.
21
+
22
+ While our method is general i.e. independent of any particular optimization algorithm, in this work we specifically apply the method to modify Adam (Kingma & Ba, 2014), considered to be the state of the art for training deep learning models. We call the resulting algorithm Eve and design experiments to compare it with Adam, as well as other popular methods from the literature.
23
+
24
+ The paper is organized as follows. In Section 2, we review recent results related to the optimization of deep neural networks. We also discuss some popular algorithms and their motivations. Our general method, and the specific algorithm Eve are discussed in Section 3. Then in Section 4, we show that Eve consistently outperforms other methods in training convolutional neural networks (CNNs), and recurrent neural networks (RNNs). We also look in some detail, at the behavior of our method in the simple case of convex non-stochastic optimization. Finally we conclude in Section 5.
25
+
26
+ # 2 RELATED WORK
27
+
28
+ There has been considerable effort to understand the challenges in deep learning optimization. Intuitively, it seems that the non-convex optimization is made difficult by the presence of several poor local optima. However, this geometric intuition proves to be inadequate in reasoning about the high-dimensional case that arises with training deep learning models. Various empirical and theoretical results (Bray & Dean, 2007; Dauphin et al., 2014) have indicated that the problem in high dimensions arises not from local minima, but rather from saddle points. Moreover, a recent paper (Kawaguchi, 2016) proved (for deep linear networks, and under reasonable assumptions, also for deep non-linear networks) that all local minima in fact achieve the same value, and are optimal. The work also showed that all critical points which are not global minima are saddle points. Saddle points can seriously hamper the progress of both first and second order methods. Second order methods like Newton’s method are actually attracted to saddle points and are not suitable for high dimensional non-convex optimization. First order methods can escape from saddle points by following directions of negative curvature. However, such saddle points are usually surrounded by regions of small curvature - plateaus. This makes first order methods very slow near saddle points and can create the illusion of a local minimum.
29
+
30
+ To tackle the saddle point problem, Dauphin et al. (2014) propose a second order method that fixes the issue with Newton’s method. Their algorithm builds on considering the behavior of Newton’s method near saddle points. Newton’s method rescales gradients in each eigen-direction with the corresponding inverse eigenvalue. However, near a saddle point, negative eigenvalues can cause the method to move towards the saddle point. Based on this observation, the authors propose using the absolute values of the eigenvalues to rescale the gradients. This saddle-free Newton method is backed by theoretical justifications and empirical results; however due to the computational requirements, second order methods are not very suitable for training large scale models. So we do not compare with such approaches in this work.
31
+
32
+ We instead focus on first order methods which only rely on the gradient information. A key issue in training deep learning models is that of sparse gradients. To handle this, Adagrad (Duchi et al., 2011) adaptively changes the learning rate for each parameter, performing larger updates for infrequently updated parameters. However its update rule causes the learning rate to monotonically decrease, which eventually stalls the algorithm. Adadelta (Zeiler, 2012) and RMSProp (Tieleman & Hinton, 2012) are two extensions that try to fix this issue. Finally, a closely related method, and the base for our algorithm Eve (introduced in the next section), is Adam (Kingma & Ba, 2014). Adam incorporates the advantages of both Adagrad and RMSProp - and it has been found to work quite well in practice. Adam uses a running average of the gradient to determine the direction of descent, and scales the learning rate with a running average of the gradient squared. The authors of Adam also propose an extension based on the infinity norm, called Adamax. In our experiments, we compare Eve with both Adam and Adamax.
33
+
34
+ # 3 METHOD
35
+
36
+ # 3.1 ASSUMPTION
37
+
38
+ We do need to make an assumption about the objective function $f$ . We assume that the minimum value of $f$ over its domain is known. While this is true for loss functions encountered in machine learning (like mean squared error or cross entropy), it does not hold if the objective function also includes regularization terms $\boldsymbol { L } _ { 1 }$ , $L _ { 2 }$ etc.). In all our experiments, we used dropout for regularization which is not affected by this assumption. Finally, to simplify notation we assume that the minimum has been subtracted from the objective function i.e. the minimum has been made 0.
39
+
40
+ Algorithm 1 Eve: Adam with feedback. Parameters carried over from Adam have the same default values: $\alpha = 1 0 ^ { - 3 }$ , $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , $\epsilon = 1 0 ^ { - 8 }$ . For parameters specific to our method, we recommend default values $\beta _ { 3 } = 0 . 9 9 9$ , $k = 0 . 1$ , $K = 1 0$ . Wherever applicable, products are elementwise.
41
+
42
+ <table><tr><td>Require: α: learning rate</td></tr><tr><td>Require: β1, β2 ∈ [0,1): exponential decay rates for moment estimation in Adam</td></tr><tr><td>Require: β3 ∈ [0,1): exponential decay rate for computing relative change</td></tr><tr><td>Require: k,K: lower and upper threshold for relative change</td></tr><tr><td>Require: ε: fuzz factor</td></tr><tr><td>Require: f(θ): objective function</td></tr><tr><td>Require: Oo: initial value for parameters</td></tr><tr><td>mo = vo =0</td></tr><tr><td>do=1</td></tr><tr><td>f-1=t=0</td></tr><tr><td>while stopping condition is not reached do</td></tr><tr><td>t←t+1</td></tr><tr><td>gt←Vθf(0t-1)</td></tr><tr><td>mt←βimt-1+(1-β1)gt mt</td></tr><tr><td>mt←(1-β)</td></tr><tr><td>Ut←β2Ut-1+(1-β2)g² Ut</td></tr><tr><td>Ut←(1-)</td></tr><tr><td>if t&gt;1 then</td></tr><tr><td>if f(0t-1) ≥ft-2 then δt←k+1</td></tr><tr><td>△t←K+1</td></tr><tr><td>else 1</td></tr><tr><td></td></tr><tr><td>8t←K+</td></tr><tr><td>△t←</td></tr><tr><td>end if</td></tr><tr><td>ct ←min{max{δt, }}</td></tr><tr><td>Ft-1←ctft-2</td></tr><tr><td></td></tr><tr><td>Ft-1-ft-21 rt↑</td></tr><tr><td>min{ft-1,ft-2} dt←βgdt-1+(1-β)rt</td></tr><tr><td></td></tr><tr><td>else</td></tr><tr><td>ft-1←f(0t-1)</td></tr><tr><td>dt←1</td></tr><tr><td>end if</td></tr><tr><td>0t←0t-1-Qdv+e mt</td></tr></table>
43
+
44
+ # 3.2 ALGORITHM
45
+
46
+ The main component of our proposed method is a feedback term that captures the relative change in the objective value. Let $f _ { t - 2 }$ and $f _ { t - 1 }$ denote the values of the objective function at time steps $t - 2$ and t − 1 respectively. Then this change is computed as rt = ft−2−ft−1f $\begin{array} { r } { r _ { t } = { \frac { f _ { t - 2 } - \bar { \cdot } f _ { t - 1 } } { f _ { t - 1 } } } = { \frac { f _ { t - 2 } - f _ { t - 1 } } { f _ { t - 1 } } } } \end{array}$ ft−2−ft−1 if ft−2 ft−1, an d ft−1−ft−2f otherwise. Note that this value is always non-negative but it can be less than or greater than 1 i.e. it captures both relative increase and decrease. We compute a running average using these relative changes to get a smoother estimate. Specifically, we take $d _ { 1 } = 1$ , and for $t > 1$ define $d _ { t }$ as $d _ { t } = \beta d _ { t - 1 } + ( 1 - \beta ) r _ { t }$ . Here $\beta \in [ 0 , 1 )$ is a decay rate - large values correspond to a slowly changing $d _ { t }$ , and vice versa. This simple expression can, however, blow up and lead to instability. To handle this issue, we use a thresholding scheme. A simple thing to do would be to clip $d _ { t }$ as $\operatorname* { m i n } \{ \operatorname* { m a x } \{ k , d _ { t } \} , K \}$ for some suitable $0 < k < K$ . But we found this to not work very well in practice due to the abrupt nature of the clipping. Instead we indirectly clip $d _ { t }$ by smoothly tracking the objective function. Let $\widehat { f } _ { t - 2 }$ be the value of the smoothly tracked objective function at time $t - 2$ with ${ \widehat { f } } _ { 0 } = f _ { 0 }$ . For now, assume $f _ { t - 1 } \leq \widehat { f } _ { t - 2 }$ . We would like to have $k \leq r _ { t } \leq K$ which in this case requires $\begin{array} { r } { \frac { f _ { t - 1 } } { \widehat { f } _ { t - 2 } } \in \left[ \frac { 1 } { K + 1 } , \frac { 1 } { k + 1 } \right] } \end{array}$ . So we compute $\begin{array} { r } { c _ { t } = \operatorname* { m i n } \left\{ \operatorname* { m a x } \left\{ \frac { 1 } { K + 1 } , \frac { f _ { t } } { \widehat { f } _ { t - 1 } } \right\} , \frac { 1 } { k + 1 } \right\} } \end{array}$ and set $\widehat { f } _ { t - 1 } = c _ { t } \widehat { f } _ { t - 2 }$ . Finally $r _ { t }$ is $\frac { \widehat { f } _ { t - 2 } - \widehat { f } _ { t - 1 } } { \widehat { f } _ { t - 1 } }$ . Analogous expressions can also be derived for the case when $f _ { t - 1 } > \widehat { f } _ { t - 2 }$ . This smooth tracking has the additional advantage of making $d _ { t }$ less susceptible to the high variability that comes with training using minibatches.
47
+
48
+ ![](images/f97087fe23db1dc3a650ad1e44d6c838538276740c378a42457561cffa200ed7.jpg)
49
+ Figure 1: Training loss for convolutional neural networks on CIFAR10 and CIFAR100. The vertical axis is shown in log scale. In both cases, our proposed method achieves the best performance.
50
+
51
+ Once $d _ { t }$ has been computed, it can be used to modify any gradient descent algorithm by modifying the learning rate $\alpha$ as $\alpha _ { t } = \alpha / d _ { t }$ . Large values of $d _ { t }$ , caused by large changes in the objective function will lead to a smaller effective learning rate. Similarly, small values of $d _ { t }$ will lead to a larger effective learning rate. Since we start with $d _ { 0 } = 1$ , the initial updates will closely follow that of the base algorithm. In the next section, we will look at how $d _ { t }$ evolves during the course of an experiment to get a better understanding of how it affects the training.
52
+
53
+ We note again that our method is independent of any particular gradient descent algorithm. However, for this current work, we specifically focus on applying the method to Adam (Kingma & Ba, 2014). This modified algorithm, which we call Eve, is shown in Algorithm 1. We modify the final Adam update by multiplying the denominator $\sqrt { v _ { t } }$ with $d _ { t }$ . In addition to the hyperparameters in Adam, we introduce 3 new hyperparameters $\beta _ { 3 }$ , $k$ , and $K$ . In all our experiments we use the values $\beta _ { 3 } = 0 . 9 9 9$ , $k = 0 . 1$ , and $K = 1 0$ , which we found to work well in practice.
54
+
55
+ # 4 EXPERIMENTS
56
+
57
+ Now we evaluate our proposed method by comparing Eve with several state of the art algorithms for optimizing deep learning models.1. In all experiments, we used ReLU activations, and initialized weights according to the scheme proposed by Glorot & Bengio (2010). We used minibatches of size 128, and linear decay for the learning rate: $\alpha _ { t } = \alpha / ( 1 + \gamma t )$ $( \gamma$ is the decay rate, picked by searching over a range of values).
58
+
59
+ In the figures, SGD refers to vanilla stochastic gradient descent, and SGD Nesterov refers to stochastic gradient descent with Nesterov momentum (Nesterov, 1983) where we set the momentum to 0.9 in all experiments.
60
+
61
+ # 4.1 CONVOLUTIONAL NEURAL NETWORKS
62
+
63
+ We first trained a 5 layer convolutional neural network for 10-way classification of images from the CIFAR10 dataset (Krizhevsky & Hinton, 2009). The model consisted of 2 blocks of $3 \mathrm { x } 3$ convolutional layers each followed by $2 \mathbf { x } 2$ max pooling and 0.25 dropout (Srivastava et al., 2014). The first block contained 2 layers with 32 filters each, and the second block contained 2 layers with 64 filters each. The convolutional layers were followed by a fully connected layer with 512 units and a 10-way softmax layer. We trained this model for 500 epochs on the training split using various popular methods for training deep learning models, as well as Eve. For each algorithm, we tried learning rates $\{ 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } \}$ (for algorithms with suggested default learning rates, we also included them in the search), learning rate decays $\{ 0 , 1 0 ^ { - 2 } , 1 \breve { 0 } ^ { - 3 } , 1 0 ^ { - 4 } \}$ , and picked the pair of values that led to the smallest final training loss. The loss curves are shown in Figure 1a. Eve quickly surpasses all other methods and achieves the lowest final training loss. In the next section we will look at the behavior of the adaptive coefficient $d _ { t }$ to gain some intuition behind this improved performance.
64
+
65
+ ![](images/f3ff840fdc66fddf215a2fadd32bb8c3e7b6c2e863f57aeacf8c8f8ff6545987.jpg)
66
+ Figure 2: Behavior of the tuning coefficient $d _ { t }$ during the experiment shown in Figure 1a. There is an overall trend of acceleration followed by decay, but also more fine-grained behavior as indicated by the bottom-right plot.
67
+
68
+ ![](images/e2d88fee7e37f8eda5b9a8ded593e0c30bd16264ba4f39e6b5079d4508648bf8.jpg)
69
+ Figure 3: Minibatch losses for Eve during the CNN experiment on CIFAR10 (Figure 1a). The variance in the losses increases throughout the training.
70
+
71
+ We also trained a larger CNN model using the top-performing algorithms from the previous experiment. This model consisted of 3 blocks of $3 \mathrm { x } 3$ convolutional layers (3 layers per block, and 64, 128, 256 filters per layer in the first, second, and third block respectively) each followed by $2 \mathrm { x } 2 \mathrm { m a x }$ pooling and 0.5 dropout. Then we had 2 fully connected layers with 512 units, each followed by 0.5 dropout, and finally a 100-way softmax. We trained this model on the CIFAR100 (Krizhevsky & Hinton, 2009) dataset for 100 epochs. We again performed a grid search over the same learning rate and decay values as the last experiment. The results are shown in Figure 1b, and once again show that our proposed method improves over state of the art methods for training convolutional neural networks.
72
+
73
+ ![](images/27f3a9518a4468af14eaa22a22c033deb4cbfe6c54a5d76cf153c1895cc83be7.jpg)
74
+ Figure 4: Loss curves and tuning coefficient $d _ { t }$ for batch gradient descent training of a logistic regression model. For Eve, $d _ { t }$ continuously decreases and converges to the lower threshold 0.1.
75
+
76
+ ![](images/4b9980bf2139c08ee969e7d5bfc125a1ed4d0abbb8ea01e97cfe2b928fe37f6f.jpg)
77
+ Figure 5: The left plot shows Adam with different learning rates plotted with Eve (learning rate $1 0 ^ { - 2 }$ ). Although Adam with a larger learning rate can be almost identical to Eve, this is largely dependent on the initial values for Adam as shown in the plot on the right.
78
+
79
+ # 4.2 ANALYSIS OF TUNING COEFFICIENT
80
+
81
+ Before we consider the next set of experiments on recurrent neural networks, we will first look more closely at the behavior of the tuning coefficient $d _ { t }$ in our algorithm. We will specifically consider the results from the CNN experiment on CIFAR10. Figure 2 shows the progress of $d _ { t }$ throughout the training, and also in two smaller windows. A few things are worth noting here. First is that of the overall trend. There is an initial acceleration followed by a decay. This initial acceleration allows Eve to rapidly overtake other methods, and makes it proceed at a faster pace for about 100 epochs. This acceleration is not equivalent to simply starting with a larger learning rate - in all our experiments we search over a range of learning rate values. The overall trend for $d _ { t }$ can be explained by looking at the minibatch losses at each iteration (as opposed to the loss computed over the entire dataset after each epoch) in Figure 3. Initially, different minibatches achieve similar loss values which leads to $d _ { t }$ decreasing. But as training proceeds, the variance in the minibatch losses increases and $d _ { t }$ eventually increases. However, this overall trend does not capture the complete picture - for example, as shown in the bottom right plot of Figure 2, $d _ { t }$ can actually be decreasing in some regions of the training, adjusting to local structures in the error surface.
82
+
83
+ To further study the observed acceleration, and to also motivate the need for clipping, we consider a simpler experiment. We trained a logistic regression model on 1000 images from the MNIST dataset. We used batch gradient descent for training i.e. all 1000 samples were used for computing the gradient at each step. We trained this model using Eve, Adam, Adamax, and SGD Nesterov for 10000 iterations, searching over a large range of values for the learning rate and decay: $\alpha \in$ $\{ 1 0 ^ { - 1 } , 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } , 1 0 ^ { - 5 } \}$ , $\gamma \in \{ 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } , 1 0 ^ { - 5 } , 1 0 ^ { - 6 } , 0 \}$ . The results are shown in Figure 4. Eve again outperforms all other methods and achieves the lowest training loss. Also, since this is a smooth non-stochastic problem, the tuning coefficient $d _ { t }$ continuously decreases - this makes having a thresholding mechanism important since the learning rate would blow up otherwise.
84
+
85
+ ![](images/92c46efb82e34367ee757f4c1af8c5474272a094da2588de2dd44fab1ac2d3c6.jpg)
86
+ (c) Penn Treebank, Language modeling
87
+ Figure 6: Loss curves for experiments with recurrent neural networks. Eve consistently achieves better performance than other methods.
88
+
89
+ Although in the previous experiment the effect of our method is to increase the learning rate, it is not equivalent to simply starting with a larger learning rate. We will establish this with a couple simple experiments. First we note that in the previous experiment, the optimal decay rates for both Adam and Eve were 0 - no decay. The optimal learning rate for Eve was $\mathrm { \bar { 1 0 } ^ { - 2 } }$ . Since the tuning coefficient converges to 0.1, we trained Adam using no decay, and learning rates $i \times 1 0 ^ { - 2 }$ where $i$ varies from 1 to 10. The training loss curves are shown in the left plot of Figure 5. While increasing the learning rate with Adam does seem to close the gap with Eve, Eve does remain marginally faster. Moreover, and more importantly, this first plot represents the best-case situation for Adam. With larger learning rates, training becomes increasingly unstable and sensitive to the initial values of the parameters. This is illustrated in the right plot of Figure 5 where we used Eve (with learning rate $1 0 ^ { - 2 }$ ) and Adam (with learning rate $1 0 ^ { - 1 }$ ) 10 times with different random initializations. In some cases, Adam fails to converge whereas Eve always converges - even though Eve eventually reaches a learning rate of $1 0 ^ { - 1 }$ . This is because very early in the training, the model is quite sensitive at higher learning rates due to larger gradients. Depending on the initial values, the algorithm may or may not converge. So it is advantageous to slowly accelerate as the learning stabilizes rather than start with a larger learning rate.
90
+
91
+ # 4.3 RECURRENT NEURAL NETWORKS
92
+
93
+ Finally, we evaluated our method on recurrent neural networks (RNNs). We first trained a RNN for character-level language modeling on the Penn Treebank dataset (Marcus et al., 1993). Specifically, the model consisted of a 2-layer character-level Gated Recurrent Unit (Chung et al., 2014) with hidden layers of size 256, 0.5 dropout between layers, and sequences of 100 characters. We adopted $1 0 ^ { - 3 }$ as the initial learning rate for Adam, Eve, and RMSProp. For Adamax, we used $2 \times 1 0 ^ { - 3 }$ as the learning rate since it is the suggested value. We used $3 \times 1 0 ^ { - 4 }$ for the learning rate decay. We trained this model for 100 epochs using each of the algorithms. The results, plotted in Figure 6c, clearly show that our method achieves the best results. Eve optimizes the model to a lower final loss than the other models.
94
+
95
+ We trained another RNN-based model for the question & answering task. Specifically, we chose two question types among 20 types from the bAbI dataset (Weston et al., 2015), Q19 and Q14. The dataset consists of pairs of supporting story sentences and a question. Different types of pairs are said to require different reasoning schemes. For our test case, Q19 and Q14 correspond to Path Finding and Time Reasoning respectively. We picked Q19 since it is reported to have the lowest baseline score, and we picked Q14 randomly from the remaining questions. The model consisted of two parts, one for encoding story sentences and another for query. Both included an embedding layer with 256 hidden units, and 0.3 dropout. Next query word embeddings were fed into a GRU one token at a time, to compute a sentence representation. Both story and query sequences were truncated to the maximum sequence length of 100. Finally, the sequence of word embeddings from story sentences and the repeated encoded representation of a query were combined together to serve as input for each time step in another GRU, with 0.3 dropout. We searched for the learning rate and decay from a range of values, $\alpha \in \{ 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } \}$ and $\gamma \in \{ 1 0 ^ { - 2 } , 1 0 ^ { - 3 } , 1 0 ^ { - 4 } , 0 \}$ . The results, shown in Figures 6a, and 6b show that Eve again improves over all other methods.
96
+
97
+ # 5 CONCLUSION
98
+
99
+ We proposed a simple and efficient method for incorporating feedback in to stochastic gradient descent algorithms. We used this method to create Eve, a modified version of the Adam algorithm. Experiments with a variety of models showed that the proposed method can help improve the optimization of deep learning models.
100
+
101
+ For future work, we would look to theoretically analyze our method and its effects. While we have tried to evaluate our algorithm Eve on a variety of tasks, additional experiments on larger scale problems would further highlight the strength of our approach. We are making code for our method and the experiments publicly available to encourage more research on this method.
102
+
103
+ # REFERENCES
104
+
105
+ Alan J Bray and David S Dean. Statistics of critical points of gaussian fields on large-dimensional spaces. Physical review letters, 98(15):150201, 2007.
106
+
107
+ 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.
108
+
109
+ Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in neural information processing systems, pp. 2933–2941, 2014.
110
+
111
+ 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.
112
+
113
+ Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010.
114
+
115
+ Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems (NIPS), 2016. to appear.
116
+
117
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
118
+
119
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
120
+
121
+ Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
122
+
123
+ Yurii Nesterov. A method for unconstrained convex minimization problem with the rate of convergence o (1/k2). In Doklady an SSSR, volume 269, pp. 543–547, 1983.
124
+
125
+ 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.
126
+
127
+ 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(2), 2012.
128
+
129
+ Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merriënboer, Armand Joulin, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015.
130
+
131
+ Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
md/train/rJliMh09F7/rJliMh09F7.md ADDED
@@ -0,0 +1,414 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIVERSITY-SENSITIVE CONDITIONAL GENERATIVE ADVERSARIAL NETWORKS
2
+
3
+ Dingdong $\mathbf { Y a n g } ^ { * \dagger }$ , Seunghoon Hong∗ †, Yunseok Jang†, Tianchen Zhao†, Honglak Lee†,‡
4
+ † University of Michigan, Ann Arbor, MI, USA
5
+ ‡ Google Brain, Mountain View, CA, USA
6
+
7
+ # ABSTRACT
8
+
9
+ We propose a simple yet highly effective method that addresses the mode-collapse problem in the Conditional Generative Adversarial Network (cGAN). Although conditional distributions are multi-modal (i.e., having many modes) in practice, most cGAN approaches tend to learn an overly simplified distribution where an input is always mapped to a single output regardless of variations in latent code. To address such issue, we propose to explicitly regularize the generator to produce diverse outputs depending on latent codes. The proposed regularization is simple, general, and can be easily integrated into most conditional GAN objectives. Additionally, explicit regularization on generator allows our method to control a balance between visual quality and diversity. We demonstrate the effectiveness of our method on three conditional generation tasks: image-to-image translation, image inpainting, and future video prediction. We show that simple addition of our regularization to existing models leads to surprisingly diverse generations, substantially outperforming the previous approaches for multi-modal conditional generation specifically designed in each individual task.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ The objective of conditional generative models is learning a mapping function from input to output distributions. Since many conditional distributions are inherently ambiguous (e.g. predicting the future of a video from past observations), the ideal generative model should be able to learn a multi-modal mapping from inputs to outputs. Recently, Conditional Generative Adversarial Networks (cGAN) have been successfully applied to a wide-range of conditional generation tasks, such as image-to-image translation (Isola et al., 2017; Wang et al., 2018; Zhu et al., 2017a), image inpainting (Pathak et al., 2016; Iizuka et al., 2017), text-to-image synthesis (Huang et al., 2017; Hong et al., 2018), video generation (Villegas et al., 2017), etc.. In conditional GAN, the generator learns a deterministic mapping from input to output distributions, where the multi-modal nature of the mapping is handled by sampling random latent codes from a prior distribution.
14
+
15
+ However, it has been widely observed that conditional GANs are often suffered from the mode collapse problem (Salimans et al., 2016; Arjovsky & Bottou, 2017), where only small subsets of output distribution are represented by the generator. The problem is especially prevalent for highdimensional input and output, such as images and videos, since the model is likely to observe only one example of input and output pair during training. To resolve such issue, there has been recent attempts to learn multi-modal mapping in conditional generative models (Zhu et al., 2017b; Huang et al., 2018). However, they are focused on specific conditional generation tasks (e.g. image-toimage translation) and require specific network architectures and objective functions that sometimes are not easy to incorporate into the existing conditional GANs.
16
+
17
+ In this work, we introduce a simple method to regularize the generator in conditional GAN to resolve the mode-collapse problem. Our method is motivated from an observation that the mode-collapse happens when the generator maps a large portion of latent codes to similar outputs. To avoid this, we propose to encourage the generator to produce different outputs depending on the latent code, so as to learn a one-to-one mapping from the latent codes to outputs instead of many-to-one. Despite the simplicity, we show that the proposed method is widely applicable to various cGAN architectures and tasks, and outperforms more complicated methods proposed to achieve multi-modal conditional generation for specific tasks. Additionally, we show that we can control a balance between visual quality and diversity of generator outputs with the proposed formulation. We demonstrate the effectiveness of the proposed method in three representative conditional generation tasks, where most existing cGAN approaches produces deterministic outputs: Image-to-image translation, image inpainting and video prediction. We show that simple addition of the proposed regularization to the existing cGAN models effectively induces stochasticity from the generator outputs.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ Resolving the mode-collapse problem in GAN is an important research problem, and has been extensively studied in the standard GAN settings (Metz et al., 2017; Arjovsky et al., 2017; Gulrajani et al., 2017; Salimans et al., 2016; Miyato et al., 2018). These approaches include unrolling the generator gradient update steps (Metz et al., 2017), incorporating the minibatch statistics into the discriminator (Salimans et al., 2016), employing the improved divergence measure to smooth the loss landscape of the discriminator (Gulrajani et al., 2017; Arjovsky et al., 2017; Miyato et al., 2018), etc.. Although these approaches have been successful in modeling unconditional data distribution to some extent, recent studies have reported that it is still not sufficient to resolve a mode-collapse problem in many conditional generative tasks, especially for high-dimensional input and output.
22
+
23
+ Recently, some approaches have been proposed to address the mode-collapse issue in conditional GAN. Zhu et al. (2017b) proposed a hybrid model of conditional GAN and Variational Autoencoder (VAE) for multi-modal image-to-image translation task. The main idea is designing the generator to be invertible by employing an additional encoder network that predicts the latent code from the generated image. The similar idea has been applied to unsupervised image-to-image translation (Huang et al., 2018) and stochastic video generation (Lee et al., 2018) but with non-trivial task-specific modifications. However, these approaches are designed to achieve multi-modal generation in each specific task, and there has been no unified solution that addresses the mode-collapse problem for general conditional GANs. Recently, (Odena et al., 2018) proposed a method that regularizes the generator by clamping the generator Jacobian within a certain range. Our method shares the similar motivation with (Odena et al., 2018) but employs a different objective function that simply maximizes the norm of the generator gradient with an optional upper-bound, which we found that works much more stable over a wide range of tasks with less number of hyper-parameters.
24
+
25
+ # 3 METHOD
26
+
27
+ Consider a problem of learning a conditional mapping function $G : \mathcal { X } \mathcal { Y }$ , which generates an output $\textbf { y } \in \mathcal { V }$ conditioned on the input $\textbf { \em x } \in { \mathcal { X } }$ . Our goal is to learn a multi-modal mapping $G : \mathcal { X } \times \mathcal { Z } \mathcal { Y }$ , such that an input $_ { \textbf { \em x } }$ can be mapped to multiple and diverse outputs in $\mathcal { V }$ depending on the latent factors encoded in $z \in { \mathcal { Z } }$ . To learn such multi-modal mapping $G$ , we consider a conditional Generative Adversarial Network (cGAN), which learns both conditional generator $G$ and discriminator $D$ by optimizing the following adversarial objective:
28
+
29
+ $$
30
+ \displaystyle \operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathcal { L } _ { c G A N } ( G , D ) = \mathbb { E } _ { x , y } [ \log D ( { \pmb x } , { \pmb y } ) ] + \mathbb { E } _ { { \pmb x } , { \pmb z } } [ \log ( 1 - D ( { \pmb x } , G ( { \pmb x } , { \pmb z } ) ) ) ] .
31
+ $$
32
+
33
+ Although conditional GAN has been proved to work well for many conditional generation tasks, it has been also reported that optimization of Eq. (1) often suffers from the mode-collapse problem, which in extreme cases leads the generator to learn a deterministic mapping from $_ { \textbf { \em x } }$ to $\textbf { { y } }$ and ignore any stochasticity induced by $_ z$ . To address such issue, previous approaches encouraged the generator to learn an invertible mapping from latent code to output by $E \bar { ( } \bar { G } ( { \pmb x } , z ) ) = z$ (Zhu et al., 2017b; Huang et al., 2018). However, incorporating an extra encoding network $E$ into the existing conditional GANs requires non-trivial modification of network architecture and introduce the new training challenges, which limits its applicability to various models and tasks.
34
+
35
+ We introduce a simple yet effective regularization on the generator that directly penalizes its modecollapsing behavior. Specifically, we add the following maximization objective to the generator:
36
+
37
+ $$
38
+ \operatorname* { m a x } _ { G } \mathcal { L } _ { z } ( G ) = \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \operatorname* { m i n } \left( \frac { \| G ( \pmb { x } , z _ { 1 } ) - G ( \pmb { x } , z _ { 2 } ) \| } { \| z _ { 1 } - z _ { 2 } \| } , \tau \right) \right] ,
39
+ $$
40
+
41
+ where $\lVert \cdot \rVert$ indicates a norm and $\tau$ is a bound for ensuring numerical stability. The intuition behind the proposed regularization is very simple: when the generator collapses into a single mode and produces deterministic outputs based only on the conditioning variable $_ { \textbf { \em x } }$ , Eq. (2) approaches its minimum since $G ( \pmb { x } , z _ { 1 } ) \overset { \cdot } { \approx } G ( \pmb { x } , z _ { 2 } )$ for all $z _ { 1 } , z _ { 2 } \sim N ( \mathbf { 0 } , \mathbf { 1 } )$ . By regularizing generator to maximize Eq. (2), we force the generator to produce diverse outputs depending on latent code $_ z$ .
42
+
43
+ Our full objective function can be written as:
44
+
45
+ $$
46
+ \operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathcal { L } _ { c G A N } ( G , D ) - \lambda \mathcal { L } _ { z } ( G ) ,
47
+ $$
48
+
49
+ where $\lambda$ controls an importance of the regularization, thus, the degree of stochasticity in $G$ . If $G$ has bounded outputs through a non-linear output function (e.g. sigmoid), we remove the margin from Eq. (2) in practice and control its importance only with $\lambda$ . In this case, adding our regularization introduces only one additional hyper-parameter.
50
+
51
+ The proposed regularization is simple, general, and can be easily integrated into most existing conditional GAN objectives. In the experiment, we show that our method can be applied to various models under different objective functions, network architectures, and tasks. In addition, our regularization allows an explicit control over a degree of diversity via hyper-parameter $\lambda$ . We show that different types of diversity emerge with different $\lambda$ . Finally, the proposed regularization can be extended to incorporate different distance metrics to measure the diversity of samples. We show this extension using distance in feature space and for sequence data.
52
+
53
+ # 4 ANALYSIS OF THE PROPOSED REGULARIZATION
54
+
55
+ Connection to Generator Gradient. We show in Appendix A that the proposed regularization in Eq. (2) corresponds to a lower-bound of averaged gradient norm of $G$ over $[ z _ { 1 } , z _ { 2 } ]$ as:
56
+
57
+ $$
58
+ \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \frac { \| G ( \pmb { x } , z _ { 2 } ) - G ( \pmb { x } , z _ { 1 } ) \| } { \| z _ { 2 } - z _ { 1 } \| } \right] \leq \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \int _ { 0 } ^ { 1 } \| \nabla _ { z } G ( \pmb { x } , \gamma ( t ) ) \| d t \right]
59
+ $$
60
+
61
+ where $\gamma ( t ) = t z _ { 2 } + ( 1 - t ) z _ { 1 }$ is a straight line connecting $z _ { 1 }$ and $z _ { 2 }$ . It implies that optimizing our regularization (LHS of Eq. (4)) will increase the gradient norm of the generator $\Vert \nabla _ { z } \bar { G } \Vert$ .
62
+
63
+ It has been known that the GAN suffers from a gradient vanishing issue (Arjovsky & Bottou, 2017) since the gradient of optimal discriminator vanishes almost everywhere $\nabla D \approx 0$ except near the true data points. To avoid this issue, many previous works had been dedicated to smoothing out the loss landscape of $D$ so as to relax the vanishing gradient problem (Arjovsky et al., 2017; Miyato et al., 2018; Gulrajani et al., 2017; Kurach et al., 2018). Instead of smoothing $\nabla D$ by regularizing discriminator, we increase $\| \nabla _ { z } G \|$ to encourage $G ( { \pmb x } , z )$ to be more spread over the output space from the fixed $z _ { j } \sim p ( z )$ , so as to capture more meaningful gradient from $D$ .
64
+
65
+ Optimization Perspective. We provide another perspective to understand how the proposed method addresses the mode-collapse problem. For notational simplicity, here we omit the conditioning variable from the generator and focus on a mapping of latent code to output $G _ { \theta } : \mathcal { Z } \to \mathcal { V }$ .
66
+
67
+ Let a mode $\mathcal { M }$ denotes a set of data points in an output space $\mathcal { V }$ , where all elements of the mode have very small differences that are perceptually indistinguishable. We consider that the mode-collapse happens if the generator maps a large portion of latent codes to the mode $\mathcal { M }$ .
68
+
69
+ Under this definition, we are interested in a situation where the generator output $G _ { \theta } ( z _ { 1 } )$ for a certain latent code $z _ { 1 }$ moves closer to a mode $\mathcal { M }$ by a distance of $\epsilon$ via a single gradient update. Then we show in Appendix B that such gradient update at $z _ { 1 }$ will also move the generator outputs of neighbors in a neighborhood $ { \mathcal { N } } _ { r } ( z _ { 1 } )$ to the same mode $\mathcal { M }$ . In addition, the size of neighborhood $ { \mathcal { N } } _ { r } ( z _ { 1 } )$ can be arbitrarily large but is bounded by an open ball of a radius $\begin{array} { r } { r = \epsilon \cdot \left( 4 \operatorname* { i n f } _ { z } \left\{ \operatorname* { m a x } \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z ) \| } { \| z _ { 1 } - z \| } , \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z ) \| } { \| z _ { 1 } - z \| } \right) \right\} \right) ^ { - 1 } } \end{array}$ , where $\theta _ { t }$ and $\theta _ { t + 1 }$ denote the generator parameters before and after the gradient update, respectively.
70
+
71
+ Without any constraints on kG(z1)−G(z2)kkz −z k , a single gradient update can cause the generator outputs for a large amount of latent codes to be collapsed into a mode $\mathcal { M }$ . We propose to shrink the size of such neighborhood by constraining kG(z1)−G(z2)kk − k above some threshold τ > 0, therefore prevent the generator placing a large probability mass around a mode $\mathcal { M }$ .
72
+
73
+ Connection with BicycleGAN (Zhu et al., 2017b). We establish an interesting connection of our regularization with Zhu et al. (2017b). Recall that the objective of BicycleGAN is encouraging an invertibility of a generator by minimizing $\| z - E ( G ( z ) ) \| _ { 1 }$ . By taking derivative with respect to $_ z$ , it implies that optimal $E$ will satisfy $I = \nabla _ { G } E ( G ( z ) ) \nabla _ { z } G ( z )$ . Because an ideal encoder $E$ should be robust against spurious perturbations from inputs, we can naturally assume that the gradient norm of
74
+
75
+ $E$ should not be very large. Therefore, to maintain invertibility, we expect the gradient of $G$ should not be zero, i.e. $\| \nabla _ { z } G ( z ) \| > \tau$ for some $\tau > 0$ , which prevents a gradient of the generator being vanishing. It is related to our idea that penalizes a vanishing gradient of the generator. Contrary to BicycleGAN, however, our method explicitly optimizes a generator gradient to have a reasonably high norm. It also allows us to control a degree of diversity with a hyper-parameter $\lambda$ .
76
+
77
+ # 5 EXPERIMENTS
78
+
79
+ In this section, we demonstrate the effectiveness of the proposed regularization in three representative conditional generation tasks that most existing methods suffer from mode-collapse: imageto-image translation, image inpainting and future frame prediction. In each task, we choose an appropriate cGAN baseline from the previous literature, which produces realistic but deterministic outputs, and apply our method by simply adding our regularization to their objective function. We denote our method as DSGAN (Diversity-Sensitive GAN). Note that both cGAN and DSGAN use the exactly the same networks. Throughout the experiments, we use the following objective:
80
+
81
+ $$
82
+ \operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathcal { L } _ { c G A N } ( G , D ) + \beta \mathcal { L } _ { r e c } ( G ) - \lambda \mathcal { L } _ { z } ( G ) ,
83
+ $$
84
+
85
+ where $\mathcal { L } _ { r e c } ( G )$ is a regression (or reconstruction) loss to ensure similarity between a prediction $\hat { y }$ and ground-truth $\textbf { { y } }$ , which is chosen differently by each baseline method. Unless otherwise stated, we use $l _ { 1 }$ distance for $\mathcal { L } _ { r e c } ( G ) = \| G ( \pmb { x } , \pmb { z } ) - \pmb { y } \|$ and $l _ { 1 }$ norm for ${ \mathcal { L } } _ { z } ( G ) ^ { 1 }$ . We provide additional video results at anonymous website: https://sites.google.com/view/iclr19-dsgan/.
86
+
87
+ # 5.1 IMAGE-TO-IMAGE TRANSLATION
88
+
89
+ In this section, we consider a task of image-to-image translation. Given a set of training data $( { \pmb x } , { \pmb y } ) \in ( { \pmb x } , { \pmb y } )$ , the objective of the task is learning a mapping $G$ that transforms an image in domain $\mathcal { X }$ to another image in domain $\mathcal { V }$ (e.g. sketch to photo image).
90
+
91
+ As a baseline cGAN model, we employ the generator and discriminator architectures from BicycleGAN (Zhu et al., 2017b) for a fair comparison. We evaluate the results on three datasets: label image (Radim Tylecek, 2013), ˇ edge photo (Zhu et al., 2016; Yu & Grauman, 2014), map image (Isola et al., 2017). For evaluation, we measure both the quality and the diversity of generation using two metrics from the previous literature. We employed Learned Perceptual Image Path Similarity (LPIPS) (Zhang et al., 2018) to measure the diversity of samples, which computes the distance between generated samples using features extracted from the pretrained CNN. Higher LPIPS score indicates more perceptual differences in generated images. In addition, we use Frechet ´ Inception Distance (FID) (Heusel et al., 2017) to measure the distance between training and generated distributions using the features extracted by the inception network (Szegedy et al., 2015). The lower FID indicates that the two distributions are more similar. To measure realism of the generated images, we also present human evaluation results using Amazon Mechanical Turk (AMT). Detailed evaluation protocols are described in Appendix D.1.
92
+
93
+ ![](images/b2531f85b977b01f565310f2011d1c47a61239ad55b0a0378dc15fc900262dec.jpg)
94
+ Figure 1: Impact of our regularization on multi-modal conditional generation.
95
+
96
+ Impact of the Proposed Regularization. To analyze the impact of our regularization on learning a multi-modal mapping, we first conduct an ablation study by varying the weights $( \lambda )$ for our regularization. We choose labe $ $ image dataset for this experiment, and summarize the results in Figure 1. From the figure, it is clearly observed that the baseline cGAN $\lambda = 0$ ) experiences a severe mode-collapse and produces deterministic outputs. By adding our regularization $( \lambda > 0 )$ , we observe that the diversity emerges from the generator outputs. Increasing the $\lambda$ increases LPIPS scores and lower the FID, which means that the generator learns a more diverse mapping from input to output, and the generated distribution is getting closer to the actual distribution. If we impose too strong constraints on diversity with high $\lambda$ , the diversity keeps increasing, but generator outputs become less realistic and deviate from the actual distribution as shown in high FID (i.e. we got $\mathrm { { F I D } = 1 9 1 }$ and $\mathrm { L P I P S = 0 . 2 0 }$ for $\lambda = 2 0$ ). It shows that there is a natural trade-off between realism and diversity, and our method can control a balance between them by controlling $\lambda$ .
97
+
98
+ Comparison with BicycleGAN (Zhu et al., 2017b). Next, we conduct comparison experiments with BicycleGAN (Zhu et al., 2017b), which is proposed to achieve multi-modal conditional generation in image-to-image translation. In this experiment, we fix $\lambda = 8$ for our method across all datasets and compare it against BicycleGAN with its optimal settings. Table 1 summarizes the results. Compared to the cGAN baseline, both our method and BicycleGAN are effective to learn multi-modal output distributions as shwon in higher LPIPS scores. Compared to BicycleGAN, our method still generates much diverse outputs and distributions that are generally more closer to actual ones as shown in lower FID score. In human evaluation on perceptual realism, we found that there is no clear winning method over others. It indicates that outputs from all three methods are in similar visual quality. Note that applying BicycleGAN to baseline cGAN requires non-trivial modifications in network architecture and obejctive function, while the proposed regularization can be simply integrated into the objective function without any modifications. Figure 2 illustrates generation results by our method. See Appendix D.1.3 for qualitative comparisons to BicycleGAN and cGAN.
99
+
100
+ We also conducted an experiment by varying a length of latent code $_ z$ . Table 2 summarizes the results. As discussed in Zhu et al. (2017b), generation quality of BicycleGAN degrades with highdimensional $_ z$ due to the difficulties in matching the encoder distribution $E ( { \pmb x } )$ with prior distribution $p ( z )$ . Compared to BicycleGAN, our method is less suffered from such issue by sampling $_ { z }$ from the prior distribution, thus exhibits consistent performance over various latent code sizes.
101
+
102
+ <table><tr><td>Method</td><td>label→image FID</td><td>LPIPS</td><td>map→image FID</td><td>LPIPS</td><td>edge→photo FID</td><td>LPIPS</td></tr><tr><td>cGAN</td><td>85.07</td><td>0.01</td><td>90.08</td><td>0.02</td><td>31.80</td><td>0.02</td></tr><tr><td>BicycleGAN</td><td>62.95</td><td>0.15</td><td>55.53</td><td>0.11</td><td>20.27</td><td>0.11</td></tr><tr><td>DSGAN</td><td>57.20</td><td>0.18</td><td>49.92</td><td>0.13</td><td>23.06</td><td>0.12</td></tr></table>
103
+
104
+ Table 1: Comparisons of cGAN baseline, BicycleGAN and DSGAN (ours).
105
+
106
+ ![](images/eba1c680628684dcfef37a75156fe8ee89111673cffbdf77e0ca64966b820dfb.jpg)
107
+ Figure 2: Diverse outputs generated by DSGAN. The first and second column shows ground-truth and input images, while the rest columns are generated images with different latent codes.
108
+
109
+ Table 2: Comparisons of BicycleGAN and DSGAN (ours) using various lengths of latent code.
110
+
111
+ <table><tr><td></td><td colspan="2">2 =8</td><td colspan="2">|2 =32</td><td colspan="2">2 =64</td><td colspan="2">2 =256</td></tr><tr><td></td><td>FID</td><td>LPIPS</td><td>FID</td><td>LPIPS</td><td>FID</td><td>LPIPS</td><td>FID</td><td>LPIPS</td></tr><tr><td>BicycleGAN</td><td>62.95</td><td>0.15</td><td>79.31</td><td>0.16</td><td>94.47</td><td>0.17</td><td>111.45</td><td>0.17</td></tr><tr><td>DSGAN</td><td>57.20</td><td>0.18</td><td>58.34</td><td>0.18</td><td>59.81</td><td>0.18</td><td>60.79</td><td>0.18</td></tr></table>
112
+
113
+ Table 3: Comparisons of high-resolution image synthesis results in Cityscape dataset.
114
+
115
+ <table><tr><td></td><td>FID</td><td>LPIPS</td><td>Segmentation acc (%)</td></tr><tr><td>cGAN (pix2pixHD)</td><td>48.85</td><td>0.00</td><td>0.93</td></tr><tr><td>BicycleGAN</td><td>89.42</td><td>0.16</td><td>0.72</td></tr><tr><td>DSGAN (pix2pixHD)</td><td>28.80</td><td>0.12</td><td>0.92</td></tr></table>
116
+
117
+ ![](images/1c761002908b2d77ec4d8178d8ac0bdc976b26d266cd85040e08a357f8a7ea61.jpg)
118
+ Figure 3: Qualitative comparison for high-resolution image synthesis $( 1 0 2 4 \times 5 1 2 \ : \mathrm { p x } . )$ .
119
+
120
+ Extension to High-Resolution Image Synthesis. The proposed regularization is agnostic to the choice of network architecture and loss, therefore can be easily applicable to various methods. To demonstrate this idea, we apply our regularization to the network of pix2pixHD (Wang et al., 2018), which synthesizes a photo-realistic image of $1 0 2 4 \times 5 1 2$ resolution from a segmentation label. In addition to the network architectures, Wang et al. (2018) incorporates a feature matching loss based on the discriminator as a reconstruction loss in Eq. (5). Therefore, this experiment also demonstrates that our regularization is compatible with other choices of $\mathcal { L } _ { r e c }$ .
121
+
122
+ Table 3 shows the comparison results on Cityscape dataset (Cordts et al., 2016). In addition to FID and LPIPS scores, we compute the segmentation accuracy to measure the visual quality of the generated images. We compare the pixel-wise accuracy between input segmentation label and the predicted one from the generated image using DeepLab V3. (Chen et al., 2018). Since applying BicycleGAN to this baseline requires non-trivial modifications, we compared against the original BicycleGAN. As shown in the table, applying our method to the baseline effectively increases the output diversity with a cost of slight degradation in quality. Compared to BicycleGAN, our method generates much more visually plausible images. Figure 3 illustrates the qualitative comparison.
123
+
124
+ # 5.2 IMAGE INPAINTING
125
+
126
+ In this section, we demonstrate an application of our regularization to image inpainting task. The objective of this task is learning a generator $G : \mathcal { X } \mathcal { Y }$ that takes an image with missing regions $\mathbf { \boldsymbol { x } } \in \mathcal { X }$ and generates a complete image $\mathbf { \boldsymbol { y } } \in \mathcal { V }$ by inferring the missing regions.
127
+
128
+ For this task, we employ generator and discriminator networks from Iizuka et al. (2017) as a baseline cGAN model with minor modification (See Appendix for more details). To create a data for inpainting, we take $2 5 6 \times 2 5 6$ images of centered faces from the celebA dataset (Liu et al., 2015) and remove center pixels of size $1 2 8 \times 1 2 8$ which contains most parts of the face. Similar to the image-to-image task, we employ FID and LPIPS to measure the generation performance. Please refer Appendix D.2 for more details about the network architecture and implementation details.
129
+
130
+ In this experiment, we also test with an extension of our regularization using a different sample distance metric. Instead of computing sample distances directly from the generator output as in Eq. (2), we use the encoder features that capture more semantically meaningful distance between samples. Similar to feature matching loss (Wang et al., 2018), we use the features from a discriminator to compute our regularization as follow:
131
+
132
+ $$
133
+ \mathcal { L } _ { z } ( G ) = \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \frac { \frac { 1 } { L } \sum _ { l = 1 } ^ { L } \left\| D ^ { l } ( \pmb { x } , z _ { 1 } ) - D ^ { l } ( \pmb { x } , z _ { 2 } ) \right\| } { \left\| z _ { 1 } - z _ { 2 } \right\| } \right] ,
134
+ $$
135
+
136
+ where $D ^ { l }$ indicates a feature extracted from $l _ { \mathrm { t h } }$ layer of the discriminator $D$ . We denote our methods based on Eq. (2) and Eq. (6) as $\mathrm { D S G A N _ { R G B } }$ and $\mathrm { D S G A N _ { F M } }$ , respectively. Since there is no prior work on stochastic image inpainting to our best knowledge, we present comparisons of cGAN baseline along with our variants.
137
+
138
+ Analysis on Regularization. We conduct both quantitative and qualitative comparisons of our methods and summarize the results in Table 4 and Figure 4, respectively. As we observed in the previous section, adding our regularization induces multi-modal outputs from the baseline cGAN. See Figure F for qualitative impact of $\lambda$ . Interestingly, we can see that sample variations in DSGANRGB tend to be in a low-level (e.g. global skin-color). We believe that sample difference in color may not be appropriate for faces, since human reacts more sensitively to the changes in semantic features (e.g. facial landmarks) than just color. Employing perceptual distance metric in our regularizationOurs-FM leads to semantically more meaningful variations, such as expressions, identity, etc..
139
+
140
+ <table><tr><td></td><td>FID</td><td>LPIPS</td></tr><tr><td>cGAN</td><td>13.99</td><td>0.00</td></tr><tr><td>DSGANRGB</td><td>13.95</td><td>0.01</td></tr><tr><td>DSGANFM</td><td>13.94</td><td>0.05</td></tr></table>
141
+
142
+ Table 4: Quantitative comparisons of our variants.
143
+
144
+ ![](images/0e8d433247dd14ff6afa30f8bef53be4de8b1458932ae7a89dec03cbe3d1c50e.jpg)
145
+ Figure 4: Qualitative comparisons of our variants. We present one example for baseline as it produces deterministic outputs.
146
+
147
+ Analysis on Latent Space. To further understand if our regularization encourages $_ { z }$ to encode meaningful features, we conduct qualitative analysis on $_ z$ . We employ $\mathrm { D S G A N _ { F M } }$ for this experiments. We generate multiple samples across various input conditions while fixing the latent codes $_ { z }$ . Figure 5 illustrates the results. We observe that our method generates outputs which are realistic and diverse depending on $_ z$ . More interestingly, the generator outputs given the same $_ z$ exhibit similar attributes (e.g. gaze direction, smile) but also context-specific characteristics that match the input condition (e.g. skin color, hairs). It shows that our method guides the generator to learn meaningful latent factors in $_ z$ , which are disentangled from the input context to some extent.
148
+
149
+ ![](images/c85ff1a8b8d5996a9b6e2fcc0b98bed8c40a9aea502435f7dc0d9c6430fd5827.jpg)
150
+ Figure 5: Stochastic image inpainting results. Given an input image with missing region (first row), we generate multiple faces by sampling different $_ { z }$ (second–fifth rows). Each row is generated from the same $_ { z }$ , and exhibits similar face attributes.
151
+
152
+ # 5.3 VIDEO PREDICTION
153
+
154
+ In this section, we apply our method to a conditional sequence generation task. Specifically, we consider a task of anticipating $T$ future frames $\left\{ { \pmb x } _ { K + 1 } , { \pmb x } _ { K + 2 } , . . . , { \pmb x } _ { K + T } \right\} \in \mathcal { V }$ conditioned on $K$ previous frames $\left\{ { \pmb x } _ { 1 } , { \pmb x } _ { 2 } , . . . , { \pmb x } _ { K } \right\} \in { \mathcal { X } }$ . Since both the input and output of the generator are sequences in this task, we simply modify our regularization by
155
+
156
+ $$
157
+ \mathcal { L } _ { z } ( G ) = \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \frac { \frac { 1 } { T } \sum _ { t = K } ^ { K + T } \left\| G ( \pmb { x } _ { 1 : t } , z _ { 1 } ) - G ( \pmb { x } _ { 1 : t } , z _ { 2 } ) \right\| _ { 1 } } { \left\| z _ { 1 } - z _ { 2 } \right\| _ { 1 } } \right] ,
158
+ $$
159
+
160
+ ![](images/2f60cff28bb565c10cb2c65d082deb963ec52496bc25d8876c4ec75fb26bbdd5.jpg)
161
+ Figure 6: Stochastic video prediction results. Given two input frames, we present three random samples generated by each method. Compared to the baseline that produces deterministic outputs and SAVP that has limited diversity in KTH, our method generates diverse futures in both datasets.
162
+ Table 5: Comparisons of cGAN, SAVP, and DSGAN (ours). Diversity: pixel-wise distance among the predicted videos. $S i m _ { m a x }$ : largest cosine similarity between the predicted video and the ground truth. $D i s t _ { m i n }$ : closest pixel-wise distance between the predicted video and the ground truth.
163
+
164
+ (Base: 1.0 × 10−3)
165
+
166
+ <table><tr><td rowspan="2">Method</td><td colspan="3">BAIR</td><td colspan="3">KTH</td></tr><tr><td>Diversity</td><td>Simmax</td><td>Distmin</td><td>Diversity</td><td>Simmax</td><td>Distmin</td></tr><tr><td>cGAN</td><td>2.48</td><td>861.92</td><td>22.46</td><td>0.04</td><td>802.79</td><td>5.00</td></tr><tr><td>SAVP</td><td>18.93</td><td>869.58</td><td>20.44</td><td>0.51</td><td>777.70</td><td>5.48</td></tr><tr><td>DSGAN</td><td>26.75</td><td>874.12</td><td>18.46</td><td>3.96</td><td>855.10</td><td>3.84</td></tr></table>
167
+
168
+ where $\pmb { x } _ { 1 : t }$ represents a set of frames from time step 1 to $t$
169
+
170
+ We compare our method against SAVP (Lee et al., 2018), which also addresses the multi-modal video prediction task. Similar to Zhu et al. (2017b), it employs a hybrid model of conditional GAN and VAE, but using the recurrent generator designed specifically for future frame prediction. We take only GAN component (generator and discriminator networks) from SAVP as a baseline cGAN model and apply our regularization with $\lambda = 5 0$ to induce stochasticity. We use $| z | = 8$ for all compared methods. See Appendix D.3.2 for more details about the network architecture.
171
+
172
+ We conduct experiments on two datasets from the previous literature: the BAIR action-free robot pushing dataset (Ebert et al., 2017) and the KTH human actions dataset (Schuldt et al., 2004). To measure both the diversity and the quality, we generate 100 random samples of 28 future frames for each test video and compute the (a) Diversity (pixel-wise distance among the predicted videos) and the (b) $D i s t _ { m i n }$ (minimum pixel-wise distance between the predicted videos and the ground truth). Also, for a better understanding of quality, we additionally measured the (c) $S i m _ { m a x }$ (largest cosine similarity metric between the predicted video and the ground truth on VGGNet (Simonyan & Zisserman, 2015) feature space). An ideal stochastic video prediction model may have higher Diversity, while having lower $D i s t _ { m i n }$ with higher $S i m _ { m a x }$ so that a model still can predict similar to the ground truth as a candidate. More details about evaluation metric are described in Appendix D.3.3.
173
+
174
+ We present both quantitative and qualitative comparison results in Table 5 and Figure 6, respectively. As illustrated in the results, both our method and SAVP can predict diverse futures compared to the baseline cGAN that produces deterministic outputs. As shown in Table 5, our method generates more diverse and realistic outputs than SAVP with much less number of parameters and simpler training procedures. Interestingly, as shown in KTH results, SAVP still suffers from a mode-collapse problem when the training videos have limited diversity, whereas our method generally works well in both cases. It shows that our method generalizes much better to various videos despite its simplicity.
175
+
176
+ # 6 CONCLUSION
177
+
178
+ In this paper, we investigate a way to resolve a mode-collapsing in conditional GAN by regularizing generator. The proposed regularization is simple, general, and can be easily integrated into existing conditional GANs with broad classes of loss function, network architecture, and data modality. We apply our regularization for three conditional generation tasks and show that simple addition of our regularization to existing cGAN objective effectively induces the diversity. We believe that achieving an appropriate balance between realism and diversity by learning $\lambda$ and $\tau$ such that the learned distribution matches an actual data distribution would be an interesting future work.
179
+
180
+ Acknowledgement This work was supported in part by ONR N00014-13-1-0762, NSF CAREER IIS-1453651, DARPA Explainable AI (XAI) program #313498, and Sloan Research Fellowship.
181
+
182
+ # REFERENCES
183
+
184
+ Mart´ın Arjovsky and Leon Bottou. Towards Principled Methods for Training Generative Adversarial ´ Networks. In ICLR, 2017.
185
+
186
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein Generative Adversarial Net- ´ works. In ICML, 2017.
187
+
188
+ Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. EncoderDecoder with Atrous Separable Convolution for Semantic Image Segmentation. In ECCV, 2018.
189
+
190
+ Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The Cityscapes Dataset for Semantic Urban Scene Understanding. In CVPR, 2016.
191
+
192
+ Emily Denton and Rob Fergus. Stochastic Video Generation with a Learned Prior. In ICML, 2018.
193
+
194
+ Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-Supervised Visual Planning with Temporal Skip Connections. In CoRL, 2017.
195
+
196
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved Training of Wasserstein GANs. In NIPS, 2017.
197
+
198
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Gunter Klambauer, and ¨ Sepp Hochreiter. GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium. In NIPS, 2017.
199
+
200
+ Seunghoon Hong, Dingdong Yang, Jongwook Choi, and Honglak Lee. Inferring Semantic Layout for Hierarchical Text-to-Image Synthesis. In CVPR, 2018.
201
+
202
+ Xun Huang, Yixuan Li, Omid Poursaeed, John Hopcroft, and Serge Belongie. Stacked generative adversarial networks. In CVPR, 2017.
203
+
204
+ Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal Unsupervised Image-toImage Translation. In ECCV, 2018.
205
+
206
+ Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and Locally Consistent Image Completion. In SIGGRAPH, 2017.
207
+
208
+ Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-Image Translation with Conditional Adversarial Networks. In CVPR, 2017.
209
+
210
+ Yunseok Jang, Gunhee Kim, and Yale Song. Video Prediction with Appearance and Motion Conditions. In ICML, 2018.
211
+
212
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In NIPS, 2012.
213
+
214
+ Karol Kurach, Mario Lucic, Xiaohua Zhai, Marcin Michalski, and Sylvain Gelly. The GAN Landscape: Losses, Architectures, Regularization, and Normalization. arXiv:1807.04720, 2018.
215
+
216
+ Alex X. Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic Adversarial Video Prediction. arXiv:1804.01523, 2018.
217
+
218
+ Chuan Li and Michael Wand. Precomputed Real-Time Texture Synthesis with Markovian Generative Adversarial Networks. In ECCV, 2016.
219
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep Learning Face Attributes in the Wild. In ICCV, 2015.
220
+ Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled Generative Adversarial Networks. In ICLR, 2017.
221
+ Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral Normalization for Generative Adversarial Networks. In ICLR, 2018.
222
+ Augustus Odena, Jacob Buckman, Catherine Olsson, Tom B Brown, Christopher Olah, Colin Raffel, and Ian Goodfellow. Is generator conditioning causally related to gan performance? arXiv preprint arXiv:1802.08768, 2018.
223
+ Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context Encoders: Feature Learning by Inpainting. In CVPR, 2016.
224
+ Radim Sˇ ara Radim Tyle ´ cek. Spatial Pattern Templates for Recognition of Objects with Regular ˇ Structure. In GCPR, 2013.
225
+ Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation. In MICCAI, 2015.
226
+ Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved Techniques for Training GANs. In NIPS, 2016.
227
+ Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing Human Actions: A Local SVM Approach. In ICPR, 2004.
228
+ Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. In ICLR, 2015.
229
+ Akash Srivastava, Lazar Valkoz, Chris Russell, Michael U Gutmann, and Charles Sutton. VEEGAN: Reducing Mode Collapse in GANs using Implicit Variational Learning. In NIPS, 2017.
230
+ 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, 2015.
231
+ Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing Motion and Content for Natural Video Sequence Prediction. In ICLR, 2017.
232
+ Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. HighResolution Image Synthesis and Semantic Manipulation with Conditional GANs. In CVPR, 2018.
233
+ Tom White. Sampling Generative Networks. arXiv:1609.04468, 2016.
234
+ SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting. In NIPS, 2015.
235
+ Aron Yu and Kristen Grauman. Fine-Grained Visual Comparisons with Local Learning. In CVPR, 2014.
236
+ Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The Unreasonable Effectiveness of Deep Features as a Perceptual Metric. In CVPR, 2018.
237
+ Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A Efros. Generative Visual Manipu- ¨ lation on the Natural Image Manifold. In ECCV, 2016.
238
+ Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks. In ICCV, 2017a.
239
+ Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward Multimodal Image-to-Image Translation. In NIPS, 2017b.
240
+
241
+ # APPENDIX
242
+
243
+ # A DERIVATION OF LOWER-BOUND OF GRADIENT NORM
244
+
245
+ In this section, we provide a derivation of our regularization term from a true gradient norm of the generator. Given arbitrary latent samples $z _ { 1 } , z _ { 2 }$ , from gradient theorem we have
246
+
247
+ $$
248
+ \begin{array} { r l } { \| G ( x , z _ { 2 } ) - G ( x , z _ { 1 } ) \| } & { = \frac { \| \int _ { \gamma [ z _ { 1 } , z _ { 2 } ] } \nabla _ { z } G ( x , z ) \cdot d z \| } { \| z _ { 2 } - z _ { 1 } \| } } \\ & { = \frac { \| \int _ { 0 } ^ { 1 } \nabla _ { z } G ( x , \gamma ( l ) ) \cdot \gamma ^ { \prime } ( l ) d l \| } { \| z _ { 2 } - z _ { 1 } \| } } \\ & { = \frac { \| \int _ { 0 } ^ { 1 } \nabla _ { z } G ( x , \gamma ( l ) ) \cdot ( z _ { 2 } - z _ { 1 } ) d l \| } { \| z _ { 2 } - z _ { 1 } \| } } \\ & { \leq \frac { \int _ { 0 } ^ { 1 } \| \nabla _ { z } G ( x , \gamma ( l ) ) \| \| z _ { 2 } - z _ { 1 } \| d l } { \| z _ { 2 } - z _ { 1 } \| } } \\ & { = \int _ { 0 } ^ { 1 } \| \nabla _ { z } G ( x , \gamma ( l ) ) \| d l , } \end{array}
249
+ $$
250
+
251
+ where $\gamma$ is a straight line connecting $z _ { 1 }$ and $z _ { 2 }$ , where $\gamma ( 0 ) = z _ { 1 }$ and $\gamma ( 1 ) = z _ { 2 }$ .
252
+
253
+ Apply expectation on both sides of (8) with respect to $z _ { 1 } , z _ { 2 }$ from standard Gaussian distribution gives Eqn. 4:
254
+
255
+ $$
256
+ \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \frac { \| G ( x , z _ { 2 } ) - G ( { \pmb x } , z _ { 1 } ) \| } { \| z _ { 2 } - z _ { 1 } \| } \right] \leq \mathbb { E } _ { z _ { 1 } , z _ { 2 } } \left[ \int _ { 0 } ^ { 1 } \| \nabla _ { z } G ( { \pmb x } , \gamma ( t ) ) \| d t \right] \ .
257
+ $$
258
+
259
+ # B COLLAPSING TO A MODE AS A GROUP
260
+
261
+ For notational simplicity, we omit the conditioning variable from the generator and focus on a mapping of latent code to output $G _ { \theta } : \mathcal { Z } \mathcal { V }$ where $\mathcal { V }$ is the image space.
262
+
263
+ Definition B.1. A mode $\mathcal { M }$ is a subset of $\mathcal { V }$ satisfying $\operatorname* { m a x } _ { { \pmb y } \in \mathcal { M } } \| { \pmb y } - { \pmb y } ^ { * } \| < \alpha$ for some image $\boldsymbol { y } ^ { * }$ and $\alpha > 0$ . Let $z _ { 1 }$ be a sample in latent space, we say $z _ { 1 }$ is attracted to a mode $\mathcal { M }$ by $\epsilon$ from a gradient step if $\| \pmb { y } ^ { * } - G _ { \theta _ { t + 1 } } ( \bar { z } _ { 1 } ) \| + \epsilon < \| \bar { \pmb { y } } ^ { * } - G _ { \theta _ { t } } ( \bar { z _ { 1 } } ) \|$ , where ${ \boldsymbol { \mathbf { \mathit { y } } } } ^ { * } \in { \mathcal { M } }$ is an image in a mode, $\theta _ { t }$ and $\theta _ { t + 1 }$ are the generator parameters before and after the gradient updates respectively.
264
+
265
+ In other words, we define modes as sets consisting of images that are close to some real images, and we consider a situation where the generator output $G _ { \theta _ { t } } ( \bar { z } _ { 1 } )$ at certain $z _ { 1 }$ is attracted to a mode $\mathcal { M }$ by a single gradient update.
266
+
267
+ With Definition B.1, we are now ready to state and prove the following proposition.
268
+
269
+ Proposition B.1. Suppose $z _ { 1 }$ is attracted to the mode $\mathcal { M }$ by $\epsilon$ , then there exists a neighborhood $\bar { \mathcal { N } } _ { r } ( z _ { 1 } )$ of $z _ { 1 }$ such that $z _ { 2 }$ is attracted to $\mathcal { M }$ by $\epsilon / 2$ , for all $z _ { 2 } \doteq \mathcal { N } _ { r } ( z _ { 1 } )$ . The size of $\bar { \mathcal { N } } _ { r } ( z _ { 1 } )$ can be arbitrarily large but is bounded by an open ball of radius $r$ where
270
+
271
+ $$
272
+ r = \epsilon \cdot \left( 4 \operatorname* { i n f } _ { z } \left. \operatorname* { m a x } \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z ) \| } { \| z _ { 1 } - z \| } , \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z ) \| } { \| z _ { 1 } - z \| } \right) \right. \right) ^ { - 1 } .
273
+ $$
274
+
275
+ Proof. Consider the following expansion.
276
+
277
+ $$
278
+ \begin{array} { r l } & { \| y ^ { * } - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| \leq \| y ^ { * } - \bar { G } _ { \theta _ { t + 1 } } ( z _ { 1 } ) \| + \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| } \\ & { \qquad < \| y ^ { * } - G _ { \theta _ { t } } ( z _ { 1 } ) \| + \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| - \epsilon } \\ & { \qquad \leq \| y ^ { * } - G _ { \theta _ { t } } ( z _ { 2 } ) \| + \| G _ { \theta _ { t } } ( z _ { 2 } ) - G _ { \theta _ { t } } ( z _ { 1 } ) \| + \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| - \epsilon } \\ & { \qquad = \| y ^ { * } - G _ { \theta _ { t } } ( z _ { 2 } ) \| } \\ & { \qquad + \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z _ { 2 } ) \| } { \| z _ { 1 } - z _ { 2 } \| } + \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| } { \| z _ { 1 } - z _ { 2 } \| } \right) \| z _ { 1 } - z _ { 2 } \| - \epsilon . } \end{array}
279
+ $$
280
+
281
+ Eq. (11) implies that
282
+
283
+ $$
284
+ \lVert \pmb { y } ^ { * } - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \rVert + \frac { \epsilon } { 2 } < \lVert \pmb { y } ^ { * } - G _ { \theta _ { t } } ( z _ { 2 } ) \rVert ,
285
+ $$
286
+
287
+ for all $z _ { 2 }$ that satisfies
288
+
289
+ $$
290
+ \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z _ { 2 } ) \| } { \| z _ { 1 } - z _ { 2 } \| } + \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z _ { 2 } ) \| } { \| z _ { 1 } - z _ { 2 } \| } \right) \| z _ { 1 } - z _ { 2 } \| \leq \frac { \epsilon } { 2 } .
291
+ $$
292
+
293
+ Define $\begin{array} { r } { \mathcal { N } _ { \tau } ( z _ { 1 } ) = \Big \{ z : \operatorname* { m a x } \Big ( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z ) \| } { \| z _ { 1 } - z \| } , \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z ) \| } { \| z _ { 1 } - z \| } \Big ) \leq \tau \Big \} } \end{array}$ , then Eq. (13) holds for any $z _ { 2 } \in \bigcup _ { \tau > 0 } \left\{ B _ { \epsilon / 4 \tau } ( z _ { 1 } ) \cap \mathcal { N } _ { \tau } ( z _ { 1 } ) \right\} = \mathcal { N } _ { r } ( z _ { 1 } )$ . We have $\mathcal { N } _ { r } ( z _ { 1 } ) \neq \emptyset$ since $z _ { 1 } \in \mathcal { N } _ { r } ( z _ { 1 } )$ .
294
+
295
+ The size of $ { \mathcal { N } } _ { r } ( z _ { 1 } )$ can be arbitrarily large if $B _ { \epsilon / 4 \tau } ( z _ { 1 } ) \subseteq { \mathcal { N } } _ { \tau } ( z _ { 1 } )$ for arbitrarily small $\tau$ . And for any $\tau > 0$ such that $\begin{array} { r } { \tau \leq \operatorname* { m a x } \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z ) \| } { \| z _ { 1 } - z \| } , \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z ) \| } { \| z _ { 1 } - z \| } \right) } \end{array}$ for all $_ z$ , we have $\mathcal { N } _ { r } ( z _ { 1 } ) \subseteq B _ { \epsilon / 4 \tau } ( z _ { 1 } )$ . In particular, pick the largest $\tau$ possible yields the bound $\mathcal { N } _ { r } ( z _ { 1 } ) \subseteq B _ { r } ( z _ { 1 } )$ ,
296
+
297
+ $$
298
+ r = \epsilon \cdot \left( 4 \operatorname* { i n f } _ { z } \left. \operatorname* { m a x } \left( \frac { \| G _ { \theta _ { t } } ( z _ { 1 } ) - G _ { \theta _ { t } } ( z ) \| } { \| z _ { 1 } - z \| } , \frac { \| G _ { \theta _ { t + 1 } } ( z _ { 1 } ) - G _ { \theta _ { t + 1 } } ( z ) \| } { \| z _ { 1 } - z \| } \right) \right. \right) ^ { - 1 } .
299
+ $$
300
+
301
+ # C ABLATION STUDY
302
+
303
+ # C.1 APPLICATION TO UNCONDITIONAL GAN
304
+
305
+ Since the proposed regularization is not only limited to conditional GAN, we further analyze its impact on unconditional GAN. To this end, we adopt synthetic datasets from (Srivastava et al., 2017; Metz et al., 2017), a mixture of eight 2D Gaussian distributions arranged in a ring. For unconditional generator and discriminator, we adopt the vanilla GAN implementation from (Srivastava et al., 2017), and train the model with and without our regularization $\lambda = 0 . 1$ ). We follow the same evaluation protocols used in (Srivastava et al., 2017). It generates 2,500 samples by the generator, and counts a sample as high-quality if it is within three standard deviations of the nearest mode. Then the performance is reported by 1) counting the number of modes containing at least one high-quality sample and 2) computing the portion of high-quality samples from all generated ones. We summarize the qualitative and quantitative results (10-run average) in Figure A and Table A, respectively.
306
+
307
+ As illustrated in Figure A, we observe that vanilla GAN experiences a severe mode collapse, which puts a significant probability mass around a single output mode. Contrary to results reported in (Srivastava et al., 2017), we observed that the mode captured by the generator is still not close enough to the actual mode, resulted in 0 high-quality samples as shown in Table A. On the other hand, applying our regularization effectively alleviates the mode-collapse problem by encouraging the generator to efficiently explore the data space, enabling the generator to capture much more modes compared to vanilla GAN setting.
308
+
309
+ ![](images/78004cb91c3e538c538fe66b3644b8f0597f4ac38a27ee58fa930973a01799ce.jpg)
310
+ Figure A: Density plots of ground-truth, vanilla GAN and DSGAN.
311
+ Step 0k Step 8k SteTable A: Quantitative evaluation results ( $^ *$ 16k Step 24k Step 32k Step 40k denotes the results reported in Srivastava et al. (2017)).
312
+
313
+ <table><tr><td>Method</td><td colspan="2">2D Ring Modes High Quality</td></tr><tr><td>Vanilla GAN</td><td>(Max 8) 0(1*)</td><td>Samples (%) 0.0 (99.3*)</td></tr><tr><td>Unrolled GAN</td><td>7.6</td><td>35.6</td></tr><tr><td>VEEGAN</td><td>8</td><td>52.9</td></tr><tr><td>DSGAN</td><td>8</td><td>81.4</td></tr></table>
314
+
315
+ # C.2 IMPACT ON UNBALANCED CGAN
316
+
317
+ In principle, our regularization can help the generator to cope with vanishing gradient from the discriminator to some extent, as it spreads out the generator landscape thus increases the chance to capture useful gradient signals around true data points. To verify its impact, we simulate the vanishing gradient problem by training the baseline cGAN until it converges and retraining the model with our regularization while initializing the discriminator with the pre-trained weights. Empirically we observed that the pre-trained discriminator can distinguish the real data and generated samples from the randomly initialized generator almost perfectly, and the generator experiences a severe vanishing gradient problem at the beginning of the training. We use the image-to-image translation model on label image dataset for this experiment.
318
+
319
+ In the experiment, we found that the generator converges to the FID and LPIPS scores of 52.32 and 0.16, respectively, which are close to the ones we achieved with the balanced discriminator (FID: 57.20, LPIPS: 0.18). We observed that our regularization loss goes down very quickly in the early stage of training, which helps the generator to efficiently explorer its output space when the discriminator gradients are vanishing. Together with the reconstruction loss, we found that it helps the generator to capture useful learning signals from the discriminator and learn both realistic and diverse modes in the conditional distribution.
320
+
321
+ # D ADDITIONAL EXPERIMENT RESULTS
322
+
323
+ This section provides additional experiment details and results that could not be accommodated in the main paper due to space restriction. We are going to release the code and datasets upon the acceptance of the paper.
324
+
325
+ # D.1 IMAGE-TO-IMAGE TRANSLATION
326
+
327
+ # D.1.1 BASELINE MODELS
328
+
329
+ BicycleGAN’s Generator and Discriminator. We use BicycleGAN’s generator and discriminator structures as a baseline cGAN. The baseline model has exactly the same hyperparameters as BicycleGAN including the weight of pixel-wise L1 loss and GAN loss. The baseline model setting then basically becomes a pix2pix image-to-image translation setting (Isola et al., 2017). The generator architecture is a U-Net style network (Ronneberger et al., 2015) and the discriminator is a two-scale patchGAN-style (Li & Wand, 2016) network.
330
+
331
+ Pix2pixHD Baseline. In this setting, we adopt the generator and discriminator networks from pix2pixHD (Wang et al., 2018) as a baseline cGAN. Compared to the original pix2pixHD network that employs two nested generators, we use only one generator for simplicity. Since the original generator does not contain stochastic component, we modified the generator network by injecting the latent code after the downsampling layers by spatial tiling and depth-wise concatenation. The discriminator is a two-scale patchGAN-style (Li & Wand, 2016) network. Following the original setting, we employ feature matching loss based on discriminator (Wang et al., 2018) and perceptual loss based on the pre-trained VGGNet (Simonyan & Zisserman, 2015) as a reconstruction loss in Eq. (5).
332
+
333
+ # D.1.2 EVALUATION METRICS
334
+
335
+ Here we provide a detailed descriptions for evaluation metrics and evaluation protocols.
336
+
337
+ Learned Perceptual Image Patch Similarity, LPIPS (Zhang et al., 2018). LPIPS score measures the diversity of the generated samples using the L1 distance of features extracted from pretrained AlexNet (Krizhevsky et al., 2012). We generate 20 samples for each validation image, and compute the average of pairwise distances between all samples generated from the same input. Then we report the average of LPIPS scores over all validation images.
338
+
339
+ Frechet Inception Distance, FID (Heusel et al., 2017). ´ For each method, we compute FID score on the validation dataset. For each input from the validation dataset, we sample 20 randomly generated output. We take the generated images as a generated dataset and compute the FID score between the generated dataset and training dataset. If the size of an image is different between the training dataset and generated dataset, we resize training images to the size of generated images. We use the features from the final average pooling layer of the InceptionV3 (Szegedy et al., 2015) network to compute Frechet Distance. ´
340
+
341
+ Human Evaluation via Amazon Mechanical Turk (AMT). To compare the perceptual quality of generations among different methods, we conduct human evaluation via AMT. We conduct sideby-side comparisons between our method and a competitor (i.e. baseline cGAN and BicycleGAN). Specifically, we present two sets of images generated by each compared method given the same input condition, and ask turkers to choose the set that is visually more plausible and matches the input condition. Each set has 6 randomly sampled images. We collect answers over 100 examples for each dataset, where each question is answered by 5 unique turkers.
342
+
343
+ # D.1.3 QUALITATIVE RESULTS
344
+
345
+ Qualitative Comparison. We present the qualitative comparisons of various methods presented in Table 1 and Table 3 in the main paper. Figure B illustrates the qualitative comparison results of DSGAN (ours), baseline cGAN and BicycleGAN in Table 1. In the example of edges photo dataset, the input edge images miss some of the features in the ground-truth images (e.g. shoelace). While both DSGAN and baseline cGAN are able to capture such missing parts in an input, we observe that some of BicycleGAN’s outputs are missing it. Also in the example of maps images dataset, both DSGAN and baseline cGAN can generate natural and variable vegetation in the corresponding area while BicycleGAN tends to generate plain texture with global color variations in such area. These two examples show how our regularization can help cGAN to learn more visually reasonable and diverse results. We additionally present the qualitative comparison results of Table 3. We observe that the generation results from BicycleGAN suffers from low-visual quality, while our method is able to generate fine details of the objects and scene by exploiting the network for high-resolution image synthesis.
346
+
347
+ ![](images/6f85e831bc3179da703baf0e33640eabbff0739081bf1bf456f04fbf0eb9f9d8.jpg)
348
+ Figure B: Qualitative comparisons of Table 1.
349
+
350
+ ![](images/386b0b5836c17e10260e6fa03b30bcd218631629eb300626202a6c1d74d8143c.jpg)
351
+ Figure C: Qualitative comparisons of Table 3.
352
+
353
+ Analysis on Latent Space. To better understand the latent space learned with the proposed regularization, we generate images in Cityscape dataset by interpolating two randomly sampled latent vectors by spherical linear interpolation (White, 2016). Figure D illustrates the interpolation results. As shown in the figure, the intermediate generation results are all reasonable and exhibit smooth transitions, which implies that the learned latent space has a smooth manifold.
354
+
355
+ ![](images/bbe33f85a9e4d2a0089f85be65748624f98ffdd9f572d9c57d39f1b34db17af3.jpg)
356
+ Figure D: Interpolation in latent space of DSGAN on Cityscapes dataset.
357
+
358
+ We also present the comparison of interpolation results between DSGAN and BicycleGAN on maps images dataset. As shown in Figure E, DSGAN generates meaningful and diverse predictions on ambiguous regions (e.g. forest on a map) and has a smooth transition from one latent code to another. On contrary, the BicyceGAN does not show meaningful changes within the interpolations and sometimes has a sudden changes on its output (e.g. last generated image). We also observe similar patterns across many examples in this dataset. It shows an example that DSGAN learns better latent space than BicycleGAN.
359
+
360
+ ![](images/048dcb30854f78689edff7a15874db32807030bd3a67df036c4288b5317fc73d.jpg)
361
+ Figure E: Comparison of latent space interpolation results between DSGAN and BicycleGAN.
362
+
363
+ # D.2 IMAGE INPAINTING
364
+
365
+ In this section, we provide details of image inpainting experiment.
366
+
367
+ Network Architecture. We employ the generator and discriminator networks from Iizuka et al. (2017) as baseline conditional GAN. Our generator takes $2 5 6 \times 2 5 6$ image with the masked region $_ { \textbf { \em x } }$ as an input and produces $2 5 6 \times 2 5 6$ prediction of the missing region $\hat { \pmb { y } }$ as an output. Then we combine the predicted image with the input by $\pmb { y } = ( 1 - M ) \odot \pmb { x } + M \odot \hat { \pmb { y } }$ as an output of the network, where $M$ is a binary mask indicating the missing region. Then the combined output $\textbf { { y } }$ is passed as an input to the discriminator. We apply two modifications to the baseline model to achieve better generation quality. First, compared to the original model that employs the Mean Squared Error (MSE) as a reconstruction loss $\mathcal { L } _ { r e c } ( G )$ in Eq. (5), we apply the feature matching loss based on the discriminator (Wang et al., 2018). Second, compared to the original model that employs two discriminators applied independently to the inpainted region and entire image, we employ only one discriminator on the inpainted region but using patchGAN-style discriminator (Li & Wand, 2016). Please note that these modifications are to achieve better image quality but irrelevant to our regularization.
368
+
369
+ Analysis on Regularization. First, we conduct qualitative analysis on how the proposed regularization controls a diversity of the generator outputs. To this end, we train the model $( \mathrm { D S G A N _ { F M } } )$ ) by varying the weights for our regularization, and present the results in Figure F. As already observed in Section 5.1, imposing stronger constraints on the generator by our regularization indeed increases the diversity in the generator outputs. With small weights (e.g. $\lambda = 2$ ), we observe limited visual differences among samples, such as subtle changes in facial expressions or makeup. By increasing $\lambda$ (e.g. $\lambda = 5$ ), we can see that more meaningful diversity emerges such as hair-style, age, and even identity while maintaining the visual quality and alignment to input condition. It shows more intuitively how our regularization can effectively help the model to discover more meaningful modes in the output space.
370
+
371
+ ![](images/42903023a7455349dffb384506ff773c8d0f51a8869158a87b54c9ac268e0f77.jpg)
372
+ Figure F: Image inpainting results with different $\lambda$ . We observe more diversity emerges from the genrator outputs as we increase the weights for our regularization.
373
+
374
+ Analysis on Latent Space. We further conduct a qualitative analysis on the learned latent space. To verify that the model learns a continuous conditional distribution with our regularization, we conduct the interpolation experiment similar to the previous section. Specifically, we sample two random latent codes from the prior distribution and generate images by linearly interpolating the latent code between two samples. Figure G illustrates the results. As it shows, the generator outputs exhibit a smooth transition between two samples, while most intermediate samples also look realistic.
375
+
376
+ ![](images/f3f9f4aa234e3fe1f4cffd6f065fc336dd2c0130dbf58860aad055a762e324b2.jpg)
377
+ Figure G: Interpolation results on image inpainting task. For each row, we sample the two latent codes (leftmost and rightmost images), and generate the images from the interpolated latent codes from one latent code to another.
378
+
379
+ # D.3 VIDEO PREDICTION
380
+
381
+ In this section, we provide more details on network architecture, datasets and evaluation metrics on the video prediction task.
382
+
383
+ # D.3.1 DATASET
384
+
385
+ We measure the effectiveness of our method based on two real-world datasets: the BAIR action-free robot pushing dataset (Ebert et al., 2017) and the KTH human actions dataset (Schuldt et al., 2004). For both of the dataset, we provide two frames as the condition and train the model to predict 10 future frames ( $k = 2$ , $T = 1 0$ in Eq. (7)). In testing time, we run each model to predict 28 frames $k = 2$ , $T = 2 8$ ). Following Lee et al. (2018), we used $6 4 \times 6 4$ frames for both datasets. The details of data pre-processing are described in below.
386
+
387
+ BAIR Action-Free (Ebert et al., 2017). This dataset contains randomly moving robot arms on a table with a static background. This dataset contains the diverse movement of a robot arm with a diverse set of objects. We downloaded the pre-processed data provided by the authors (Lee et al., 2018) and used it directly for our experiment.
388
+
389
+ KTH (Schuldt et al., 2004). Each video in this dataset contains a single person in a static background performing one of six activities: walking, jogging, running, boxing, hand waving, and hand clapping. We download the pre-processed videos from Villegas et al. (2017); Denton & Fergus (2018), which contains the frames with reasonable motions. Following Jang et al. (2018), we added a diversity to videos by randomly skipping frames in a range of [1,3].
390
+
391
+ # D.3.2 NETWORK ARCHITECTURE
392
+
393
+ We compare our method against SAVP (Lee et al., 2018) which is proposed to achieve stochastic video prediction. SAVP addresses a mode-collapse problem using the hybrid model of conditional GAN and VAE. For a fair comparison, we construct our baseline cGAN by taking GAN component from SAVP (the generator and discriminator networks). In below, we provide more details of the generator and discriminator architectures used in our baseline cGAN model.
394
+
395
+ The generator is based on the encoder-decoder network with convolutional LSTM (Xingjian et al., 2015). At each step, it takes a frame together with a latent code as inputs and produces the next frame as an output. Contrary to the original SAVP that takes a latent code at each step to encode framewise stochasticity, we modified the generator to take one latent code per sequence that encodes the global dynamics of a video. Then the discriminator takes the entire video as an input and produces a prediction on real or fake through 3D convolution operations.
396
+
397
+ # D.3.3 EVALUATION METRICS
398
+
399
+ We provide more details about the evaluation metrics used in our experiment. For each test video, we generate 100 random samples with a length of 28 frames and evaluate the performance based on the following metrics:
400
+
401
+ • Diversity: To measure the degree of diversity of the generated samples, we computed the frame-wise distance between each pair of the generated videos based on Mean Squared Error (MSE). Then we reported the average distance over all pairs as a result. $D i s t _ { m i n }$ : Following Lee et al. (2018), we evaluate the quality of generations by measuring the distance of the closest sample among the all generated ones to the ground-truth. Specifically, for each test video, we computed the minimum distance between the generated samples and the ground-truth based on MSE and reported the average of the distances over the entire test videos.
402
+ • $S i m _ { m a x }$ : As another measure for the generation quality, we compute the similarity of the closest sample to the ground-truth similar to $D i s t _ { m i n }$ but using the cosine similarity of features extracted from VGGNet (Simonyan & Zisserman, 2015). We report the average of the computed similarity for entire test videos.
403
+
404
+ # D.3.4 MORE EXAMPLES
405
+
406
+ We present more video prediction results on both BAIR and KTH datasets in Figure H, which corresponds to Figure 6 in the main paper. As discussed in the main paper, the baseline cGAN produces realistic but deterministic outputs, whereas both SAVP and our method generate far more diverse future predictions. SAVP fails to generate the diverse outputs in KTH datasets, mainly because the dataset contains many examples with small motions. On the contrary, our method generates diverse outputs in both datasets, since our regularization directly penalizes the mode-collapsing behavior and force the model to discover various modes. Interestingly, we found that our model sometimes generates actions different from the input video when the motion in input frames are ambiguous (e.g. hand-clapping to hand-waving in the highlighted example). It shows that our method can generate diverse and meaningful futures.
407
+
408
+ Figure I presents more detailed qualitative comparison in BAIR robot arm dataset. Both baseline cGAN and SAVP often suffer from the noise predictions in the background, since they fail to predict the correct motion of foreground objects. On the other hand, our method can generate more clear outputs and sometimes even an interaction between foreground and background objects by predicting more meaningful dynamics of videos from latent code $_ z$ . See captions of Figure I for more detailed discussions.
409
+
410
+ ![](images/c0e0efdaf1656a28fe410a3d79c715f0b813d66f48b8d2a43403b375a1650b22.jpg)
411
+ Figure H: Stochastic video prediction results. In both datasets, our method presents diverse prediction, whereas SAVP generate less diverse result especially in the KTH dataset. Interestingly, as you can see from the dotted orange box, our model can explore not only the original condition (hand clapping) but also other cases (hand waving) if the context is not too strong. Please check our web page to see the videos: https://sites.google.com/view/iclr19-dsgan/
412
+
413
+ ![](images/f0b3c8d2c4b1e86afd67587bef06de9f02d476043fd5abc967bf0814f3cd3f97.jpg)
414
+ Figure I: Qualitative comparison of various video prediction methods. Both baseline cGAN and SAVP exhibit some noises in the predicted videos due to the failures in separating the moving foreground object from the background clutters (red arrow). Compared to this, our method tends to generate more clear predictions on both foreground and background. Interestingly, SAVP sometimes fail to predict interaction between objects (magenta arrows). For instance, the objects on a table stay in the same position even after pushed by the robot arm. On the other hand, our method is able to capture such interactions more precisely (blue arrows).
md/train/rJrTwxbCb/rJrTwxbCb.md ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EMPIRICAL ANALYSIS OF THE HESSIAN OF OVERPARAMETRIZED NEURAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We study the properties of common loss surfaces through their Hessian matrix. In particular, in the context of deep learning, we empirically show that the spectrum of the Hessian is composed of two parts: (1) the bulk centered near zero, (2) and outliers away from the bulk. We present numerical evidence and mathematical justifications to the following conjectures laid out by Sagun et al. (2016): Fixing data, increasing the number of parameters merely scales the bulk of the spectrum; fixing the dimension and changing the data (for instance adding more clusters or making the data less separable) only affects the outliers. We believe that our observations have striking implications for non-convex optimization in high dimensions. First, the flatness of such landscapes (which can be measured by the singularity of the Hessian) implies that classical notions of basins of attraction may be quite misleading. And that the discussion of wide/narrow basins may be in need of a new perspective around over-parametrization and redundancy that are able to create large connected components at the bottom of the landscape. Second, the dependence of a small number of large eigenvalues to the data distribution can be linked to the spectrum of the covariance matrix of gradients of model outputs. With this in mind, we may reevaluate the connections within the data-architecturealgorithm framework of a model, hoping that it would shed light on the geometry of high-dimensional and non-convex spaces in modern applications. In particular, we present a case that links the two observations: small and large batch gradient descent appear to converge to different basins of attraction but we show that they are in fact connected through their flat region and so belong to the same basin.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ In this paper, we study the geometry of the loss surface of supervised learning problems through the lens of their second order properties. To introduce the framework, suppose we are given data in the form of input-label pairs, $\mathbf { \dot { \mathcal { D } } } = \{ ( x ^ { i } , y ^ { i } ) \} _ { i = 1 } ^ { N }$ where $x \in \mathbb { R } ^ { d }$ and $y \in \mathbb R$ that are sampled i.i.d. from a possibly unknown distribution $\nu$ , a model that is parametrized by $w \in \mathbb { R } ^ { M }$ ; so that the number of examples is $N$ and the number of parameters of the system is $M$ . Suppose also that there is a predictor $f ( w , x )$ . The supervised learning process aims to solve for $w$ so that $f ( w , x ) \approx y$ . To make the $\cdot \approx$ precise, we use a non-negative loss function that measures how close the predictor is to the true label, $\ell ( f ( w , x ) , y )$ . We wish to find a parameter $w ^ { * }$ such that $w ^ { * } = \arg \operatorname* { m i n } \mathcal { L } ( w )$ where,
12
+
13
+ $$
14
+ \mathcal { L } ( w ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \ell ( f ( w , x ^ { i } ) , y ^ { i } ) .
15
+ $$
16
+
17
+ In particular, one is curious about the relationship between $\mathcal { L } ( w )$ and $\begin{array} { r } { \hat { \mathcal { L } } ( w ) : = \int \ell d ( \nu ) } \end{array}$ . By the law of large numbers, at a given point $w$ , $\mathcal { L } _ { w } \to \hat { \mathcal { L } } _ { w }$ almost surely as $N \infty$ for fixed $M$ . However in modern applications, especially in deep learning, the number of parameters $M$ is comparable to the number of examples $N$ (if not much larger). And the behaviour of the two quantities may be drastically different (for a recent analysis on provable estimates see (Mei et al., 2016)).
18
+
19
+ A classical algorithm to find $w ^ { * }$ is gradient descent (GD), in which the optimization process is carried out using the gradient of $\mathcal { L }$ . A new parameter is found iteratively by taking a step in the direction of the negative gradient whose size is scaled with a constant step size $\eta$ that is chosen from line-search minimization. Two problems emerge: (1) Gradient computation can be expensive, (2) Line-search can be expensive. More involved algorithms, such as Newton-type methods, make use of second-order information (Nocedal & Wright, 2006). Under sufficient regularity conditions we may observe: $\mathcal { L } ( w + \Delta w ) \approx \mathcal { L } ( w ) + \Delta w \nabla \mathcal { L } ( \bar { w } ) + \Delta w ^ { T } \nabla ^ { 2 } \mathcal { L } ( w ) \Delta w$ . A third problem emerges beyond an even more expansive computational cost of the Hessian: (3) Most methods require the Hessian to be non-degenerate to a certain extent.
20
+
21
+ When the gradients are computationally expensive, one can alternatively use its stochastic version (SGD) that replaces the above gradient with the gradient of averages of losses over subsets (such a subset will be called the mini-batch) of $\mathcal { D }$ (see (Bottou, 2010) for a classical reference). The benefit of SGD on real-life time limits is obvious, and GD may be impractical for practical purposes in many problems. In any case, the stochastic gradient can be seen as an approximation to the true gradient, and hence it is important to understand how the two directions are related to one another. Therefore, the discussion around the geometry of the loss surface can be enlightening in the comparison of the two algorithms: Does SGD locate solutions of a different nature than GD? Do they follow different paths? If so, which one is better in terms of generalization performance?
22
+
23
+ For the second problem of expensive line-search, there are two classical solutions: using a small, constant step size, or scheduling the step size according to a certain rule. In practice, in the context of deep learning, the values for both approaches are determined heuristically, by trial and error. More involved optimal step size choices involve some kind of second-order information that can be obtained from the Hessian of the loss function (Schaul et al., 2013). From a computational point of view, obtaining the Hessian is extremely expensive, however obtaining some of its largest and smallest eigenvalues and eigenvectors are not that expensive. Is it enough to know only those eigenvalues and eigenvectors that are large in magnitude? How do they change through training? Would such a method work in SGD as well as it would on GD?
24
+
25
+ For the third problem, let’s look at the Hessian a little closer. A critical point is defined by $w$ such that $| | \nabla \mathcal { L } ( w ) | | = 0$ and the nature of it can be determined by looking at the signs of its Hessian matrix. If all eigenvalues are positive the point is called a local minimum, if $r$ of them are negative and the rest are positive, then it is called a saddle point with index $r$ . At the critical point, the eigenvectors indicate the directions in which the value of the function locally changes. Moreover, the changes are proportional to the corresponding -signed- eigenvalue. Under sufficient regularity conditions, it is rather straightforward to show that gradient-based methods converge to points where the gradient is zero. Recently Lee et al. (2016) showed that they indeed converge to minimizers. However, a significant and untested assumption to establish these convergence results is that the Hessian of the loss is non-degenerate. A relaxation of the above convergence to the case of non-isolated critical points can be found in (Panageas & Piliouras, 2016). What about the critical points of machine learning loss functions? Do they satisfy the non-degeneracy assumptions? If they don’t, can we still apply the results of provable theorems to gain intuition?
26
+
27
+ # 1.1 A HISTORICAL OVERVIEW
28
+
29
+ One of the first instances of the comparison of GD and SGD in the context of neural networks dates back to the late eighties and early nineties. Bottou (1991) points out that large eigenvalues of the Hessian of the loss can create the illusion of the existence of local minima and GD can get stuck there, it further claims that the help of the inherent noise in SGD may help to get out of this obstacle. The origin of this observation is due to Bourrely (1989), as well as numerical justifications. However, given the computational limits of the time, these experiments relied on low-dimensional neural networks with few hidden units. The picture may be drastically different in higher dimensions. In fact, provable results in statistical physics tell us that, in certain real-valued non-convex functions, the local minima concentrate at an error level near that of the global minima. A theoretical review on this can be found in (Auffinger et al., 2013), while Sagun et al. (2014) and Ballard et al. (2017) provide an experimental simulation as well as a numerical study for neural networks. They notably find that high error local minima traps do not appear when the model is over-parametrized.
30
+
31
+ These concentration results can help explain why we find that the solutions attained by different optimizers like GD and SGD often have comparable training accuracies. However, while these methods find comparable solutions in terms of training error there is no guarantee they generalize equally. A recent work in this direction compares the generalization performance of small batch and large batch methods (Keskar et al., 2016). They demonstrate that the large batch methods always generalize a little bit worse even when they have similar training accuracies. The paper further makes the observation that the basins found by small batch methods are wider, thereby contributing to the claim that wide basins, as opposed to narrow ones, generalize better.
32
+
33
+ The final part of the historical account is devoted to the observation of flatness of the landscape in neural networks and its consequences through the lens of the Hessian. In the early nineties, Hochreiter & Schmidhuber (1997) remarks that there are parts of the landscape in which the weights can be perturbed without significantly changing the loss value. Such regions at the bottom of the landscape are called the flat minima, which can be considered as another way of saying a very wide minima. It is further noted that such minima have better generalization properties and a new loss function that makes use of the Hessian of the loss function has been proposed that targets the flat minima. The computational complexity issues have been attempted to be resolved using the $R$ -operator of Pearlmutter (1994). However, the new loss requires all the entries of the Hessian, and even with the $R$ -operator, it is unimaginably slow for today’s large networks. More recently, an exact numerical calculation of the Hessian has been carried out by Sagun et al. (2016). It turns out that the Hessian can have near zero eigenvalues even at a given random initial point, and that the spectrum of it is composed of two parts: (1) the bulk, and (2) the outliers. The bulk is mostly full of zero eigenvalues with a fast decaying tail, and the outliers are only a handful which appears to depend on the data. This implies that, locally, most directions in the weight space are flat, and leads to little or no change in the loss value, except for the directions of eigenvectors that correspond to the large eigenvalues of the Hessian.
34
+
35
+ # 1.2 OVERVIEW OF RESULTS
36
+
37
+ In this work, we present a phenomenological study in which we provide various observations on the local geometry at the bottom of the landscape and discuss their implications on certain features of solution spaces: Connectedness of basins found by large and small batch methods.
38
+
39
+ 1. Flatness at the bottom of the landscape: At the bottom, most of the eigenvalues in the spectrum of the Hessian are near zero, except for a small number of relatively larger ones.
40
+ 2. A possible explanation through over-parametrization: The decomposition of the Hessian as a sum of two matrices, where the first one is the sample covariance matrix of the gradients of model outputs and the second one is the Hessian of the function that describes the model outputs. We argue that the second term can be ignored as training progress which leaves us with the covariance term which leads to degeneracy in the Hessian when there are more parameters than samples.
41
+ 3. Dependence of eigenvalues to model-data-algorithm: We empirically examine the spectrum to uncover intricate dependencies within the data-architecture-algorithm triangle: (1) more complex data produce more outliers, (2) increasing the network size doesn’t affect the density of large eigenvalues, (3) large batch methods produce the same number of outliers that are larger in magnitude, and finally (4) there are negative eigenvalues even after the training process appears to show no further progress but their magnitude is much smaller than the outliers.
42
+ 4. A new interpretation of basins: It has been a common practice to discuss certain features of basins found by various algorithms. Some recent examples, such as Keskar et al. (2016); Chaudhari et al. (2016); Jastrz˛ebski et al. (2017), appear to draw the big-picture of isolated basins at the bottom of the landscape. One tool that is commonly used to demonstrate such claims is to evaluate the loss on a line that connects two solutions found by different methods. First of all, the notion of the basin itself can be misleading given the negative eigenvalues pointed out in the previous item. Moreover, we claim that this idea of isolated basins may be misleading based on the above observations of the dramatic level of flatness of the local geometry. In particular, we show that two solutions with different qualities can be shown to be in the same basin even with a loss evaluation on a straight line connecting the two.
43
+
44
+ Remark 1: Throughout this paper we use the notions of data complexity and over-parametrization vaguely. The complexity of data can be defined in various ways and further research is required to determine the precise notion that is required that would link complexity to the spectrum. Overparametrization, similarly, can be defined in various ways: $M > > N$ , $M \to \infty$ for fixed $N$ , or $\bar { M } / N \to c$ for a certain constant, etc... However, more realistic notions of both complexity of the data and the over-parametrization should take the architecture into account, and detailed treatment of this should follow another work.
45
+
46
+ Remark 2: The notion of the basin, also, can be defined precisely. However, it is unclear whether any algorithm used in practice actually locates the bottom of a basin described in classical ways. For instance, the norm of the gradients are small but not at the machine precision, and the eigenvalues of the Hessian still has a negative part even after SGD continues a long while without a meaningful decrease in the loss value. This is presumably the fault of the algorithm itself, however, it requires a further study, and hence such notions of sharp vs. wide minima in various recent work should be taken with a grain of salt.
47
+
48
+ Remark 3: Even when one has a way to measure the width of a ‘basin’, such ways of measuring the approximate width are all relative. In a recent study, Dinh et al. (2017) shows how ‘sharp minima’ can still generalize with proper modifications to the loss function. We note that it takes a non-linear transformation to deform relative widths of basins. And, in this work, we focus on relative values as opposed to absolute values to get a consistent comparison across different setups.
49
+
50
+ # 2 SOME PROPERTIES OF THE HESSIAN
51
+
52
+ # 2.1 A FIRST LOOK AT THE SPECTRUM
53
+
54
+ We begin by an exact calculation of the spectrum of the Hessian at a random initial point, and at the end of training. Note that the plots are arranged in a way that they show the eigenvalues in the $y$ -axis, and indicate the order of the eigenvalue in the $x$ -axis. This choice is necessary to indicate the scale of the degeneracy while still showing all the eigenvalues in the same plot. Figure 1 shows the full spectrum of the Hessian at the random initial point of training and after the final training point. The model of this example is a two hidden layer network with a total of $5 K$ parameters that is trained using gradient descent. Also note that, throughout the paper, the exact full Hessian is computed via the Hessian-vector products (Pearlmutter, 1994) up to the machine precision.
55
+
56
+ ![](images/a42ea3f545a3f89905e25602d5c37ba418bb503275e022376b20de2a029082c5.jpg)
57
+ Figure 1: Ordered eigenvalues at a random initial point, and at the final point of GD. $x$ -axis is the rank of the eigenvalue, and $y$ -axis the value of the eigenvalue.
58
+
59
+ # 2.2 GENERALIZED GAUSS-NEWTON DECOMPOSITION OF THE HESSIAN
60
+
61
+ In order to study its spectrum, we will describe how the Hessian can be decomposed into two meaningful matrices (LeCun et al., 1998; Martens, 2010). Suppose the loss function is given as a composition of two functions, the model function $f _ { \bullet } : \mathbb { R } ^ { M } \xrightarrow { \bullet \bullet } \mathbb { R }$ is the real-valued output of a network that depends on the parameters; and the loss function $\ell _ { \bullet } : \mathbb { R } \longrightarrow \mathbb { R } ^ { + }$ is a convex function.
62
+
63
+ Here, $\bullet$ refers to the given example. Examples include the regression: the mean-square loss composed with a real-valued output function, and classification: the negative log-likelihood loss composed with the dot product of the output of a softmax layer with the label vector.
64
+
65
+ For ease of reading, we indicate the dependencies of functions $\ell$ and $f$ to data by the index of the example, or omit it altogether in case it is not necessary, and unless noted otherwise the gradients are taken with respect to $w$ . The gradient and the Hessian of the loss for a given example are given by
66
+
67
+ $$
68
+ \begin{array} { r l } & { \nabla \ell ( f ( w ) ) = \ell ^ { \prime } ( f ( w ) ) \nabla f ( w ) } \\ & { \nabla ^ { 2 } \ell ( f ( w ) ) = \ell ^ { \prime \prime } ( f ( w ) ) \nabla f ( w ) \nabla f ( w ) ^ { T } + \ell ^ { \prime } ( f ( w ) ) \nabla ^ { 2 } f ( w ) } \end{array}
69
+ $$
70
+
71
+ where $\bullet ^ { T }$ denotes the transpose operation (here the gradient is a column-vector). Note that since $\ell$ is convex $\ell ^ { \prime \prime } ( s ) \geq 0$ and we can take its square root which allows us to rewrite the Hessian of the loss as follows:
72
+
73
+ $$
74
+ \nabla ^ { 2 } \mathcal { L } ( w ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ \sqrt { \ell _ { i } ^ { \prime \prime } ( f _ { i } ( w ) ) } \nabla f _ { i } ( w ) ] [ \sqrt { \ell _ { i } ^ { \prime \prime } ( f _ { i } ( w ) ) } \nabla f _ { i } ( w ) ] ^ { T } + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \ell _ { i } ^ { \prime } ( f _ { i } ( w ) ) \nabla ^ { 2 } f _ { i } ( w )
75
+ $$
76
+
77
+ In general, it isn’t straightforward to discuss the spectrum of the sums of matrices by looking at the individual ones. Nevertheless, looking at the decomposition, we can still infer what we should expect. At a point close to a local minimum, the average gradient is close to zero. However, this doesn’t necessarily imply that the gradients for individual samples are also zero. However, if $\ell ^ { \prime } ( f ( \hat { w } ) )$ and $\nabla ^ { 2 } f ( { \hat { w } } )$ are not correlated, then we can ignore the second term. And so the Hessian can be approximated by the first term:
78
+
79
+ $$
80
+ \nabla ^ { 2 } \mathcal { L } ( \hat { w } ) \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ \sqrt { \ell _ { i } ^ { \prime \prime } ( f _ { i } ( \hat { w } ) ) } \nabla f _ { i } ( \hat { w } ) ] [ \sqrt { \ell _ { i } ^ { \prime \prime } ( f _ { i } ( \hat { w } ) ) } \nabla f _ { i } ( \hat { w } ) ] ^ { T }
81
+ $$
82
+
83
+ Here, Equation 5 is the sum of rank one matrices (via the outer products of gradients of $f$ multiplied by some non-negative number), therefore, the sum can be written as a product of an $M \times N$ matrix with its transpose where the columns of the matrix are formed by the scaled gradients of $f$ . Immediately, this implies that there are at least $M - N$ many trivial eigenvalues of the right-hand side in Equation 5.
84
+
85
+ From a theoretical point of view, the tool that is required for the above problem should be a mapping of eigenvalues of the population matrix to the sample covariance matrix. Recent provable results on this can be found in Bloemendal et al. (2016) (please refer to the appendix for a review of this approach). We emphasize that this result require independent inputs, and extensions to correlated data appear to be unavailable to the best of our knowledge.
86
+
87
+ # 3 IMPLICATIONS OF FLATNESS FOR THE GEOMETRY OF THE ENERGY LANDSCAPE
88
+
89
+ In this section, we leave the decomposition behind and focus on experimental results of the spectrum of the full Hessian through the exact Hessian-vector products. We discuss how data, model, and algorithm affect the spectrum of the Hessian of the loss.
90
+
91
+ # 3.1 THE RELATION BETWEEN DATA AND EIGENVALUES
92
+
93
+ In many cases of practical interest, the data contains redundancies. In such cases, the number of non-trivial eigenvalues could be even smaller than $N$ . For instance, if one deals with a classification problem where the training data has $k$ classes with relatively small deviation among each of them, it is reasonable to expect that there will be an order of $k$ many non-trivial eigenvalues of the first term of the above decomposition of the Hessian in Equation 5. Then, if the second term is small (for instance when all the gradients per example are zero), we would expect to see $k$ many outliers in the spectrum of the Hessian of the loss. To test this idea, we used a feed-forward neural network with a 100- dimensional input layer, two hidden layers each of which with 30 hidden units, and a $k$ dimensional output layer that is combined with softmax for $k$ -class classification. We randomly sampled from $k$ Gaussian clusters in the input space and normalized the data globally. Then we carried out the training using SGD on ReLU network for the following number of clusters: $k : \{ 2 , 5 , 1 0 , 2 0 , 5 0 \}$ .
94
+
95
+ ![](images/4fbebe062090713f1dfd0f8b7475c18fe8b82c9d4cde1a97c8ab2996dc176580.jpg)
96
+ Figure 2: Ordered plot of eigenvalues with a visible gap. $x$ -axis is the rank of the eigenvalue, and $y$ -axis the value of the eigenvalue.
97
+
98
+ The number of large eigenvalues that are above the gap in Figure 2 match exactly the number of classes in the dataset. This experiment is repeated for various different setups. Please refer to Table 1 in the appendix for more experiments on this.
99
+
100
+ # .2 THE RELATION BETWEEN NUMBER OF PARAMETERS AND EIGENVALUE
101
+
102
+ We test the effect of growing the size of the network when data, architecture, and algorithm are fixed. In some sense, we make the system more and more over-parametrized. Based on the intutions developed above we should not observe a change in the size and number of the large eigenvalues of the Hessian at the bottom. To test this, we sample 1K examples from the MNIST dataset and fix them as the training set. Then we form four different networks each of which has a different number of nodes in its hidden layer $( n _ { \mathrm { h i d d e n } } \in \{ 1 0 , 3 0 , 5 0 , 7 0 \} )$ . All four networks are trained with the same step size and the same number of iterations and the exact Hessian is computed at the end. Figure 3 shows the largest 120 eigenvalues of each of the four Hessians ranked in an increasing order. For the right edge of the spectrum (that is, for the large positive eigenvalues), the shape of the plot remains invariant as the number of parameters increase (Figure 3).
103
+
104
+ # 3.3 THE RELATION BETWEEN THE ALGORITHM AND EIGENVALUES
105
+
106
+ Finally, we turn to describing the nature of solutions found by the large and small batch methods for the training landscape. We train a convnet that is composed of 2 convolution layers with relu-maxpool followed by two fully-connected layers. The training set is a subsampled MNIST with 1K training examples. The small batch method uses a mini-batch size of 10, and the large-batch one uses 512. A learning rate for which both algorithms converge is fixed for both LB and SB. Note that the stochastic gradients are averaged over the mini-batch. Therefore, fixing the learning rate allows the algorithms to take steps whose lengths are proportional to the norms of the corresponding stochastic gradients averaged over the mini-batch. This way we ensure that both methods are compared fairly when we look at them after a fixed number of iterations. We train until the same number of iterations have been reached. Then, we calculate the Hessian and the spectrum of the Hessian in Figure 4. The large batch method locates points with larger positive eigenvalues.
107
+
108
+ This observation is consistent with Keskar et al. (2016) as the way they measure flatness takes local rates of increase in a neighborhood of the solution into account which is intimately linked to the size of the large eigenvalues.
109
+
110
+ ![](images/f751607ab68bf5feee8f1c81ac1d411f8954d6dde92aa433b4a21923c88e66df.jpg)
111
+ Figure 3: Right edge of the spectrum of the Hessian of the loss for a fully connected network on MNIST with increasing dimensions. $x$ -axis is the rank of the eigenvalue, and $y$ -axis the value of the eigenvalue.
112
+
113
+ ![](images/fb42f773ad6f94809f91f414af482070514e830e20d01184d707a08d98f7fc5b.jpg)
114
+ Figure 4: Outlier eigenvalues of LB ( $\mathit { b s } = 5 1 2$ ) vs SB $b s = 1 0$ ). $x$ -axis is the rank of the eigenvalue, and $y$ -axis the value of the eigenvalue.
115
+
116
+ # 3.4 TRAILING NEGATIVE EIGENVALUES AFTER TRAINING
117
+
118
+ Lastly, we observe that the negative eigenvalues at the end of the training are orders of magnitude smaller than the large ones. The very existence of the negative eigenvalues indicates that the algorithm didn’t locate a local minimum, yet. Note that the stopping criterion in most practical cases is arbitrary. Training is stopped after there is no meaningful decrease in the loss value or increase in the test accuracy. In our experiments, the training ran well beyond the point of this saturation. In this time-scale, the loss decays in much smaller values. And we may expect convergence to a localminimum at large (possibly exponentially long) time-scales. However, from a practical point of view, it appears that the properties of the landscape at this fine-grained scale is less relevant in terms of its test performance. Anyhow, we observe that there are a number of negative eigenvalues but their magnitude is much smaller compared to the positive eigenvalues.
119
+
120
+ The reason we look at the ranked negative eigenvalues in percentages rather than the order is the result of the experiment in Section 3.2. Adding more weights to the system scale the small scale eigenvalues proportionally, the number of outliers remain unchanged whereas the ratio of negative $x$ -axis indicates the order of the eigenvalue in percentages, $y$ -axis indicates the eigenvalues.
121
+
122
+ ![](images/4406d2d101a4651dbf0ea934cdc919de22794f459db105c77b087176aaac1049.jpg)
123
+ Figure 5: Negative eigenvalues at the bottom when increasing the number of hidden nodes (compare with Figure 3).
124
+
125
+ ![](images/7dd126bf66a93a6e21f5ee37b57d65ff0d19fb71c8926a33bc4e8193b4bf60ae.jpg)
126
+ Figure 6: Negative eigenvalues at the bottom for LB-SB experiment on MNIST (compare with Figure 4).
127
+
128
+ eigenvalues remain the same. Moreover, they appear to be converging to have the same shape (Figure 6). Also, note that the negative eigenvalues can only come from the second term of the decomposition in Equation 5. Unless the second term contributes to the spectrum in an asymmetrical way, the observation that the negative eigenvalues are small confirms our previous suspicions that the effect of the ignored term in the decomposition is small.
129
+
130
+ # 4 DISCUSSION ON BASINS OF SOLUTIONS AND GENERALIZATION
131
+
132
+ Finally, we revisit the issue through the lens of the following question: What does overparametrization imply on the discussion around GD vs. SGD (or large batch vs small batch) especially for their generalization properties? In this final section, we will argue that, contrary to what is believed in Keskar et al. (2016) and Chaudhari et al. (2016) the two algorithms do not have to be falling into different basins.
133
+
134
+ As noted in the introduction, for a while the common sense explanation on why SGD works well (in fact better) than GD (or large batch methods) was that the non-convex landscape had local minima at high energies which would trap large-batch or full-batch methods. Something that SGD with small batch shouldn’t suffer due to the inherent noise in the algorithm. However, there are various experiments that have been carried out in the past that show that, for reasonable large systems, this is not the case. For instance, Sagun et al. (2014) demonstrate that a two hidden layer fully connected network on MNIST can be trained by GD to reach at the same level of loss values as SGD 1. In fact, when the step size is fixed to the same value for both of the algorithms, they reach the same loss value at the same number of iterations. The training accuracy for both algorithms are the same, and the gap between test accuracies diminish as the size of the network increase with GD falling ever so slightly behind. It is also shown in Keskar et al. (2016) that training accuracies for both large and small batch methods are comparably good. Furthermore, Zhang et al. (2016) demonstrates that training landscape is easy to optimize even when there is no clear notion of generalization. Such observations are consistent with our observations: over-parametrization (due to the architecture of the model) leads to flatness at the bottom of the landscape which is easy to optimize.
135
+
136
+ When we turn our attention to generalization, Keskar et al. (2016) note that LB methods find a basin that is different than the one found by SB methods, and they are characterized by how wide the basin is. As noted in Figure 4, indeed the large eigenvalues are larger in LB than in SB, but is it enough to justify that they are in different basins, especially given the fact that the number of flat directions are enormous.
137
+
138
+ 4.1 ARE THEY REALLY DIFFERENT BASINS? CASE OF CIFAR10 WITH LB VS SB
139
+
140
+ The observation that LB converges to sharper basins that are separated by wells from the wider basins found by SB has been an observation that triggered attention. In this section, we present two solutions with different qualities as measured by the generalization error and we show that they are in fact in the same ‘basin’ by showing that the evaluation of the loss doesn’t go through a barrier between the two solutions. We start by two common pitfalls that one may fall into in testing this:
141
+
142
+ The problem with epoch based time scales: A common way to plot training profiles in larger scale neural networks is to stop every epoch to reserve extra computational power to calculate various statistics of the model at its current position. This becomes problematic when one compares training with different batch sizes, primarily because the larger batch model takes fewer steps in a given epoch. Recall that the overall loss is averaged, therefore, for a fixed point in the weight space, the empirical average of the gradients is an unbiased estimator for the expected gradient. Hence it is reasonable to expect that the norms of the large batch methods match to the ones of the small batch. And for a fair comparison, one should use the same learning rate for both training procedures. This suggests that a better comparison between GD and SGD (or LB and SB) should be scaled with the number of steps, so that, on average both algorithms are able to take similar number of steps of comparable sizes. The experiments we present use the number of iterations as the time-scale.
143
+
144
+ The problem with line interpolations in the weight space: The architecture of typical neural networks have many internal symmetries, one of which is the flip symmetry: when one swaps two nodes (along with the weights connected to it) at a given layer, the resulting network is identical to the original one. Therefore, when one trains two systems to compare, it may well be possible that the two fall into different flip symmetrical configurations that may look more similar when they are reordered. Therefore, training two systems with levels of randomness (seed, batch-size, choice of the initial point, etc.) may result in two points in the weight space that present a barrier only because of such symmetries. In an attempt to partially alleviate this problem we switch dynamics of an already trained system.
145
+
146
+ 1. Part I: Train full CIFAR10 data for a bare AlexNet (bare meaning: no momentum, no dropout, and no batch normalization) with a batch-size of 1, 000. Record every 100 steps for 250 times.
147
+ 2. Part II: Continue training from the endpoint of the previous step with a smaller batch-size of 32. Everything else, including the constant learning rate is kept the same. And train another 250 periods each of which with 100 steps.
148
+
149
+ The key observation is the jump in the training and test losses, and a drop in the corresponding accuracies (Figure 8). Toward the end of Part II the small batch reaches to a slightly better accuracy (about $\sim 1 \%$ ). And this looks in line with the observations in Keskar et al. (2016), in that, it appears that the LB solution and SB solutions are separated by a barrier and that the latter of which generalizes better. Moreover, the line interpolations extending away from either endpoint appear to be confirming the sharpness of LB solution. However, we find the straight line interpolation connecting the endpoints of Part $I$ and Part $\boldsymbol { { I I } }$ turns out to not contain any barriers (Figure 9). This suggests that while the Part I and Part $\mathit { I I }$ converge to two solutions with different properties, these solutions have been in the same basin all along. This raises the striking possibility that those other seemingly different solutions may be similarly connected by a flat region to form a larger basin (modulo internal symmetries).
150
+
151
+ Another interpretation of this experiment, also, goes through the Gauss-Newton decomposition introduced in Equation 5. When we decrease the batch size, we increase the noise in the covariance of the gradients, and hence the first term starts to dominate. Even when the weight space has large flat regions, the fluctuations of the stochastic noise should be precisely in the directions of the large eigenvalues. Therefore, at the beginning of Part II, the loss increases because the point fluctuates in the directions corresponding to the large eigenvalues, and eventually settles at a point that lies at the interior of the same level set, essentially staying in the same basin.
152
+
153
+ ![](images/5c5f663577c8905a19568647d00c87c0e4a933a78191dbe2bb7d22018e7cb1d6.jpg)
154
+ Figure 8: Large batch training immediately followed by small batch training on the full dataset of CIFAR10 with a raw version of AlexNet. The accuracy increases by about $1 \%$ : Part $I$ and Part $\boldsymbol { { I I } }$ locate solutions with different generalization properties.
155
+
156
+ ![](images/00062df2c9db72157e87cfcfab556fa17a73ef0bc785e7112e2fbd5d668d050d.jpg)
157
+ Figure 9: Loss and accuracy evaluation on the straight line that contains LB and SB solutions. The accuracy of the SB solution is $\sim 1 \%$ better than the LB solution, but there is no barrier between the two points.
158
+
159
+ # 4.2 FURTHER DISCUSSIONS
160
+
161
+ One of the most striking implications of flatness may be the connected structure of the solution space. We may wonder whether two given solutions can be connected by a continuous path of solutions. This question has been explored in a recent work: in Freeman & Bruna (2016) it is shown that for one hidden layer rectified neural networks the solution space is connected which is consistent with the flatness of the landscape. The classical notion of basins of attractions may not be the suitable objects to study for neural networks. Rather, we may look at the exploration of interiors of level sets of the landscape. We may be tempted to speculate that such an exploration may indeed result in point that generalizes better. However, the flat space itself is very high dimensional which comes with its own computational issues.
162
+
163
+ The training curve can be seen as composed of two parts: (1) high gain part where the norm of the gradients are large, (2) noise of the gradients is larger relative to the size of the stochastic gradients (see (Shwartz-Ziv & Tishby, 2017) for a recent reference). We speculate that the first part is relatively easy and even a large batch method can locate a large level set that contains points that generalize better than what’s initially found. From a practical point of view, using larger batches with larger step sizes can, in fact, accelerate training. An example of this can be found in Goyal et al. (2017), where training Imagenet with a minibatch size of 8192 can match small batch performance. On a final note for further consideration, we remark that we used standard pre-processing and initialization methods that are commonly used in practice. Fixing these two aspects, we modified the data, model, and algorithm in order to study their relative effects. However, the effects of pre-processing and initialization on the Hessian is highly non-trivial and deserves a separate attention.
164
+
165
+ # 5 CONCLUSION
166
+
167
+ We have shown that the level of the singularity of the Hessian cannot be ignored from theoretical considerations. Furthermore, we use the generalized Gauss-Newton decomposition of the Hessian to argue the cluster of zero eigenvalues are to be expected in practical applications. This allows us to reconsider the division between initial fast decay and final slow progress of training. We see that even large batch methods are able to get to the same basin where small batch methods go. As opposed to the common intuition, the observed generalization gap between the two is not due to small batch finding a different, better, wider basin. Instead, the two solutions appear to be in the same basin. This lack of a barrier between solutions is demonstrated by finding paths between the two points that lie in the same level set. To conclude, we propose a major shift in perspective on considerations of the energy landscape in deep learning problems.
168
+
169
+ # REFERENCES
170
+
171
+ Antonio Auffinger, Gérard Ben Arous, and Jiˇrí Cern ˇ y. Random matrices and complexity of spin \` glasses. Communications on Pure and Applied Mathematics, 66(2):165–201, 2013.
172
+
173
+ Jinho Baik, Gérard Ben Arous, Sandrine Péché, et al. Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices. The Annals of Probability, 33(5):1643–1697, 2005.
174
+
175
+ Andrew J Ballard, Ritankar Das, Stefano Martiniani, Dhagash Mehta, Levent Sagun, Jacob D Stevenson, and David J Wales. Energy landscapes for machine learning. Physical Chemistry Chemical Physics, 2017.
176
+
177
+ Alex Bloemendal, Antti Knowles, Horng-Tzer Yau, and Jun Yin. On the principal components of sample covariance matrices. Probability Theory and Related Fields, 164(1-2):459–552, 2016.
178
+
179
+ Léon Bottou. Stochastic gradient learning in neural networks. Proceedings of Neuro-Nımes, 91(8), 1991.
180
+
181
+ Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pp. 177–186. Physica-Verlag HD, 2010.
182
+
183
+ J Bourrely. Parallelization of a neural network learning algorithm on a hypercube. Hypercube and distributed computers. Elsiever Science Publishing, 1989.
184
+
185
+ Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
186
+
187
+ Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv preprint arXiv:1703.04933, 2017.
188
+
189
+ C Daniel Freeman and Joan Bruna. Topology and geometry of deep rectified network optimization landscapes. arXiv preprint arXiv:1611.01540, 2016.
190
+
191
+ 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.
192
+
193
+ Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997.
194
+
195
+ Stanisław Jastrz˛ebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in sgd. arXiv preprint arXiv:1711.04623, 2017.
196
+
197
+ 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. arXiv preprint arXiv:1609.04836, 2016.
198
+ Yann LeCun, Léon Bottou, GB Orr, and K-R Müller. Efficient backprop. Lecture notes in computer science, pp. 9–50, 1998.
199
+ Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent converges to minimizers. University of California, Berkeley, 1050:16, 2016.
200
+ Vladimir A Marcenko and Leonid Andreevich Pastur. Distribution of eigenvalues for some sets of ˇ random matrices. Mathematics of the USSR-Sbornik, 1(4):457, 1967.
201
+ James Martens. Deep learning via hessian-free optimization. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 735–742, 2010.
202
+ Song Mei, Yu Bai, and Andrea Montanari. The landscape of empirical risk for non-convex losses. arXiv preprint arXiv:1607.06534, 2016.
203
+ Jorge Nocedal and Stephen J Wright. Numerical optimization, second edition. Numerical optimization, pp. 497–528, 2006.
204
+ Ioannis Panageas and Georgios Piliouras. Gradient descent only converges to minimizers: Nonisolated critical points and invariant regions. arXiv preprint arXiv:1605.00405, 2016.
205
+ Barak A Pearlmutter. Fast exact multiplication by the hessian. Neural computation, 6(1):147–160, 1994.
206
+ Levent Sagun, V. Ugur Güney, Gérard Ben Arous, and Yann LeCun. Explorations on high dimensional ˘ landscapes. ICLR 2015 Workshop Contribution, arXiv:1412.6615, 2014.
207
+ Levent Sagun, Léon Bottou, and Yann LeCun. Singularity of the hessian in deep learning. arXiv preprint arXiv:1611.07476, 2016.
208
+ Tom Schaul, Sixin Zhang, and Yann LeCun. No more pesky learning rates. ICML (3), 28:343–351, 2013.
209
+ Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
210
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
211
+
212
+ # A OUTLIER EIGENVALUES
213
+
214
+ In the subsequent experiments, we used a feed-forward neural network with a 100 dimensional input layer, two hidden layers each of which with 30 hidden units, and a $k$ dimensional output layer that is combined with softmax for $k$ -class classification. We sampled random $k$ Gaussian clusters in the input space and normalized the data globally. Then we carried out the training for the following sets of parameters: $k : \{ 2 , 5 , 1 0 , 2 0 , 5 0 \}$ , algorithm: {GD, SGD}, non-linearity: {tanh, ReLU}, initial multipler for the covariance of the input distribution: $\{ 1 , 1 0 \}$ . Then we counted the number of large eigenvalues according to three different cutoff methods: largest consecutive gap, largest consecutive ratio, and a heuristic method of determining the threshold by searching for the elbow in the scree plot (see Figure 2). In Table 1 we marked the ones that are off by $\pm 1$ .
215
+
216
+ <table><tr><td>alg-size</td><td>cov</td><td>mean&amp;std</td><td>nc</td><td>gap</td><td>ratio</td><td>heur</td><td>cutoff</td></tr><tr><td>GD tanh 4022</td><td>1.0</td><td>1.19e-05,1.19e-05</td><td>2</td><td>2</td><td>3</td><td>N/A</td><td>N/A</td></tr><tr><td>GD tanh 4115</td><td>1.0</td><td>2.52e-05,2.52e-05</td><td>5</td><td>2</td><td>17</td><td>N/A</td><td>N/A</td></tr><tr><td>GD tanh 4270</td><td>1.0</td><td>3.75e-05,3.75e-05</td><td>10</td><td>2</td><td>4</td><td>N/A</td><td>N/A</td></tr><tr><td>GD tanh 4580</td><td>1.0</td><td>5.37e-05, 5.37e-05</td><td>20</td><td>3</td><td>4</td><td>N/A</td><td>N/A</td></tr><tr><td>GDReLU4022</td><td>1.0</td><td>7.13e-06,7.13e-06</td><td>2</td><td>3</td><td>4</td><td>2</td><td>0.003</td></tr><tr><td>GD ReLU 4115</td><td>1.0</td><td>1.55e-05, 1.55e-05</td><td>5</td><td>6</td><td>7</td><td>5</td><td>0.003</td></tr><tr><td>GD ReLU4270</td><td>1.0</td><td>3.04e-05,3.04e-05</td><td>10</td><td>11</td><td>12</td><td>10</td><td>0.003</td></tr><tr><td>GD ReLU4580</td><td>1.0</td><td>5.65e-05,5.65e-05</td><td>20</td><td>4</td><td>21</td><td>21</td><td>0.003</td></tr><tr><td>GD ReLU5510</td><td>1.0</td><td>1.16e-04, 1.16e-04</td><td>50</td><td>50</td><td>51</td><td>49</td><td>0.003</td></tr><tr><td>SGD1 ReLU4022</td><td>1.0</td><td>8.96e-06, 8.96e-06</td><td>2</td><td>3</td><td>4</td><td>2</td><td>0.002</td></tr><tr><td>SGD ReLU 4115</td><td>1.0</td><td>1.62e-05, 1.62e-05</td><td></td><td>6</td><td>7</td><td>7</td><td>0.002</td></tr><tr><td>SGD ReLU4270</td><td>1.0</td><td>2.97e-05,2.97e-05</td><td></td><td>2</td><td>14</td><td>15</td><td>0.002</td></tr><tr><td>SGD ReLU 4580</td><td>1.0</td><td>4.53e-05,4.53e-05</td><td></td><td>2</td><td>3</td><td>21</td><td>0.002</td></tr><tr><td>SGD ReLU 5510</td><td>1.0</td><td>6.78e-05, 6.78e-05</td><td></td><td>50</td><td>51</td><td>49</td><td>0.002</td></tr><tr><td>SGD1 ReLU4022</td><td>10.0</td><td>9.49e-05,9.49e-05</td><td>2</td><td>2</td><td>4</td><td>2</td><td>0.015</td></tr><tr><td>SGD ReLU 4115</td><td>10.0</td><td>1.68e-04, 1.68e-04</td><td></td><td>5</td><td>6</td><td>5</td><td>0.015</td></tr><tr><td>SGD ReLU 4270</td><td>10.0</td><td>1.92e-04, 1.92e-04</td><td></td><td>2</td><td>11</td><td>9</td><td>0.015</td></tr><tr><td>SGD ReLU 4580</td><td>10.0</td><td>3.10e-04,3.10e-04</td><td>20</td><td>20</td><td>21</td><td>19</td><td>0.015</td></tr><tr><td>SGD ReLU 5510</td><td>10.0</td><td>1.67e-04, 1.67e-04</td><td>50</td><td>50</td><td>51</td><td>49</td><td>0.005</td></tr></table>
217
+
218
+ Table 1: Counting outliers for matching the number of blobs. Dictionary of table elements: {cov: scale of covariance for inputs, mean&std: of the eigenvalues, nc: number of clusters, gap: largest consecutive gaps, ratio: largest consecutive ratios, heur: heuristic threshold, cutoff: the value of the heur.}
219
+
220
+ # B THE SPECTRUM OF THE GENERALIZED GAUSS-NEWTON MATRIX
221
+
222
+ In this section, we will show that the spectrum of the Generalized Gauss-Newton matrix can be characterized theoretically under some conditions. Suppose that we can express the scaled gradient $( \sqrt { \ell _ { i } ^ { \prime \prime } ( f _ { i } ( \hat { w } ) ) } \nabla f _ { i } ( \hat { w } )$ from Equation 5) as $g = T x$ with the matrix $T \in M \times d$ depending only on the parameters $w$ - which is the case for linear models. Then we can write: $\begin{array} { r } { G = \frac { 1 } { N } \sum _ { i \in \mathcal { D } } g _ { i } g _ { i } ^ { T } = } \end{array}$ $\scriptstyle { \frac { 1 } { N } } T X X ^ { T } T ^ { T }$ , where at the e $X = \{ x ^ { 1 } , \ldots , x ^ { N } \}$ is an ized $d \times N$ matrix. Furthermhat the entries of e, without loss of generality,are independent with zero $X$
223
+ mean and unit variance. One of the first steps in studying $G$ goes through understanding its principle components. In particular, we would like to understand how the eigenvalues and eigenvectors of $G$ are related to the ones of $\Sigma$ where $\begin{array} { r } { \Sigma : = \mathbb { E } ( G ) = \frac { 1 } { N } T X X ^ { T } T ^ { T } = \breve { T } T ^ { T } } \end{array}$ .
224
+
225
+ In the simplest case, we have $\Sigma = I d$ so that the gradients are uncorrelated and the eigenvalues of $G$ are distributed according to the Marcenko-Pastur law in the limit where ˇ $N , M \to \infty$ and $\textstyle \alpha : = { \frac { M } { N } }$ . The result dates back to sixties and can be found in (Marcenko & Pastur, 1967). Note that ˇ if $M \stackrel { \_ } { > } N$ then there are $M - N$ trivial eigenvalues of $G$ at zero. Also, the width of the nontrivial distribution essentially depends on the ratio $\alpha$ . Clearly, setting the expected covariance to identity is very limiting. One of the earliest relaxations appear in (Baik et al., 2005). They prove a phase transition for the largest eigenvalues of the sample covariance matrix which has been known as the BBP phase transition. A case that may be useful for our setup is as follows:
226
+
227
+ Theorem 1 (Baik, Arous, Péché, et al., 2005). If $\Sigma = d i a g ( \ell , 1 , \dots , 1 )$ , $\ell > 1$ , and $M , N \to \infty$ with $\begin{array} { r } { \frac { M } { N } = \alpha \ge 1 } \end{array}$ . Let $c = 1 + \sqrt { \alpha }$ , and let’s call the top eigenvalue of the sample covariance matrix as $\lambda _ { m a x }$ then:
228
+
229
+ • If $\dot { \cdot } 1 \leq \ell < c$ then $\lambda _ { m a x }$ is at the right edge of the spectrum with Tracy-Widom fluctuations. • If $c < \ell$ then $\lambda _ { m a x }$ is an outlier that is away from bulk centered at $\textstyle { \ell ( 1 + { \frac { \alpha } { \ell - 1 } } ) }$ with Gaussian fluctuations.
230
+
231
+ Typically, due to the correlations in the problem we don’t have $\Sigma$ to be the identity matrix or a diagonal matrix with spikes. This makes the analysis of their spectrum a lot more difficult. A solution for this slightly more general case with non-trivial correlations has been provided only recently by Bloemendal et al. (2016). We will briefly review these results here see how they are related to the first term of the above decomposition.
232
+
233
+ Theorem 2 (Bloemendal, Knowles, Yau, and Yin, 2016). If $d = M$ , $\Sigma - I d$ has bounded rank, $\log N$ is comparable to $\log M$ , and entries of $X$ are independent with mean zero and variance one, then the spectrum of $\Sigma$ can be precisely mapped to the one of $G$ as $M , N \to \infty$ for fixed $\textstyle \alpha = { \frac { M } { N } }$ . Let $K = m i n \{ M , N \}$ , and the decomposition of the spectrum can be described as follows:
234
+
235
+ • Zeros: $M - K$ many eigenvalues located at zero (i $f M > N ,$ ).
236
+ • Bulk: Order $K$ many eigenvalues are distributed according to Marˇcenko-Pastur law.
237
+ • Right outliers: All eigenvalues of $\Sigma$ that exceed a certain value produce large-positive outlier eigenvalues to the right of the spectrum of $G$ .
238
+ • Left outliers: All eigenvalues of $\Sigma$ that are close to zero produce small outlier eigenvalues between 0 and the left edge of the bulk of $G$ .
239
+
240
+ Moreover, the eigenvectors of outliers of $G$ are close to the corresponding ones of $\Sigma$
241
+
242
+ This theorem essentially describes the way in which one obtains outlier eigenvalues in the sample covariance matrix assuming the population covariance is known. Here is an example:
243
+
244
+ ![](images/14fbcfe88d568ad1d54cf2c1514c70323512138de1ca1d350367672645843720.jpg)
245
+ Figure 10: Spectrum of the logistic regression loss with tanh unit: when data has a single Gaussian blob (left), when data has two Gaussian blobs (right). In the latter case, the spectrum has outlier eigenvalues at 454.4, 819.5, and 92.7 for $a l p h a = 1 , 2 , 0 . 0 2$ , respectively.
246
+
247
+ Example 1 (Logistic regression). Consider the log-loss $\begin{array} { r } { \ell ( s , y ) = - y \log { \frac { 1 } { 1 + e ^ { - s } } } - ( 1 - y ) \log ( 1 - } \end{array}$ 11+e−s ) and a single neuron with the sigmoid non-linearity. Note that \`(s, y) is convex in s for fixed $y$ , and we can apply the decomposition using $\ell$ and $f ( w , x ) = \langle w , x \rangle$ . In this case we have $M = d$ , also, note that the second part of the Hessian in Equation 4 is zero since $\nabla ^ { 2 } f ( w , x ) = 0$ . So the Hessian of the loss is just the first term. It is straightforward to calculate that the gradient per sample is of the form $g = c ( w , x ) I d _ { M } x$ for a positive constant $c = c ( w , x )$ that doesn’t depend on $y$ . This case falls into the classical Marchenko-Pastur law (left pane of Figure 10). ˇ
248
+
249
+ Example 2. Once we have more than one class this picture fails to hold. For, $\ell ( s ) = - \log ( s )$ , and $\begin{array} { r } { f ( w ; ( x , y ) ) = \frac { \exp ^ { - \langle w _ { y } , x \rangle } } { \sum _ { k } \exp ^ { - \langle w _ { y ^ { k } } , x \rangle } } } \end{array}$ the spectrum changes. It turns out that in that case the weights have one large outlier eigenvalue, and a bulk that’s close to zero (right pane of Figure 10).
md/train/rkZzY-lCb/rkZzY-lCb.md ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FEAT2VEC: DENSE VECTOR REPRESENTATION OF DATA WITH ARBITRARY FEATURES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Methods that calculate dense vector representations for features in unstructured data—such as words in a document—have proven to be very successful for knowledge representation. We study how to estimate dense representations when multiple feature types exist within a dataset for supervised learning where explicit labels are available, as well as for unsupervised learning where there are no labels. Feat2Vec calculates embeddings for data with multiple feature types enforcing that all different feature types exist in a common space. In the supervised case, we show that our method has advantages over recently proposed methods; such as enabling higher prediction accuracy, and providing a way to avoid the cold-start problem. In the unsupervised case, our experiments suggest that Feat2Vec significantly outperforms existing algorithms that do not leverage the structure of the data. We believe that we are the first to propose a method for learning unsupervised embeddings that leverage the structure of multiple feature types.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Informally, in machine learning a dense representation, or embedding of a vector $\vec { x } \in \mathbb { R } ^ { n }$ is another vector $\vec { y } \in \mathbb { R } ^ { r }$ that has much lower dimensionality $( r \ll n )$ than the original representation, and can be used to replace the original vector in downstream prediction tasks. Embeddings have multiple advantages, as they enable more efficient training (Mikolov et al., 2013), and unsupervised learning (Schnabel et al., 2015). For example, when applied to text, semantically similar words are mapped to nearby points.
12
+
13
+ We consider two kind of algorithms that use embeddings:
14
+
15
+ 1. Unsupervised methods (sometimes referred as self-supervised methods) like Word2Vec (Mikolov et al., 2013), are designed to provide embeddings that are useful for a wide-array of predictions tasks. For example, the loss function of the continuous bag of words (CBOW) algorithm of Word2Vec is tuned to predict the next word of a sequence; however, in practice, the embeddings produced are mostly used for other tasks, such as analogy solving (Mikolov et al., 2013), or sentiment analysis (Le & Mikolov, 2014). In the context of this paper, we refer to the embeddings of an unsupervised method that can be used for a variety of auxiliary prediction tasks as general-purpose.
16
+ 2. Supervised methods, like matrix factorization, produce embeddings that are highly tuned to a prediction task. These embeddings may be interpretable but do not usually generalize to other tasks. We refer to these embeddings as task-specific. Matrix factorization and Word2Vec are unable to calculate embeddings for items that are not available during training (“cold-start” problem). While recent work using n-gram features (Bojanowski et al., 2016) have addressed this limitation for supervised and unsupervised tasks, it can only be used for a single feature type—words.
17
+
18
+ In this paper we propose Feat2Vec as a novel method that allows calculating embeddings of arbitrary feature types from both supervised and unsupervised data. Our main contributions are:
19
+
20
+ • Unsupervised Feat2Vec. Existing general-purpose dense representation methods are largely restricted to one or two feature types. For example, the Word2Vec methods can only calculate embeddings for words, while follow-up work has enabled embeddings for both words and documents (Le & Mikolov, 2014). To our knowledge, Feat2Vec is the first algorithm that is able to calculate general-purpose embeddings that are not tuned for a single specific prediction task for arbitrary feature types.
21
+
22
+ • Supervised Feat2Vec. Task-specific methods can use arbitrary feature types, but are restricted in that embeddings must be calculated for each individual feature, while sometimes higher-level of abstractions may be desirable—for example, we may want to have embeddings of documents instead of simply words. This capability makes Supervised Feat2Vec extremely flexible. We demonstrate that our method can be used to calculate embeddings of unseen (cold-start) items when there is an alternative textual description.
23
+
24
+ # 2 PRELIMINARIES
25
+
26
+ Factorization Machine (Rendle, 2010) is one of the most successful methods for general-purpose factorization. Rendle (2010) formulated it as an extension to polynomial regression. Consider a degree-2 polynomial (quadratic) regression, where we want to predict a target variable $y$ from a vector of inputs ${ \vec { x } } \in \mathbb { R } ^ { n }$ :
27
+
28
+ $$
29
+ \hat { y } ( \vec { x } ; \vec { b } , \vec { w } ) = \omega \big ( b _ { 0 } + \sum _ { i } b _ { i } x _ { i } + \sum _ { i = 1 } ^ { n } \sum _ { j = i + 1 } ^ { n } w _ { i , j } \ x _ { i } x _ { j } \big )
30
+ $$
31
+
32
+ In words, $n$ is the total number of features, the term $b _ { 0 }$ is an intercept, $b _ { i }$ is the strength of the $i$ -th feature, and $w _ { i , j }$ is the interaction coefficient between the $i$ -th and $j$ -th feature. The function $\omega$ is an activation. Choices for $\omega$ include a linear link $\omega ( x ) = x ,$ ) for continuous outputs, or a logistic link $\begin{array} { r } { ( \omega ( x ) = \frac { \exp ( x ) } { \exp ( x ) + 1 } ) } \end{array}$ for binary outputs.
33
+
34
+ Factorization Machine replaces the two-way individual pairwise parameters $w _ { i , j }$ for each interaction with a vector of parameters $\vec { w } _ { i }$ for each feature. This is a rank- $r$ vector of latent factors—embeddings in the neural literature—that encode the interaction between features and replaces the quadratic regression model with the following:
35
+
36
+ $$
37
+ { \hat { y } } ( { \vec { x } } ; { \vec { b } } , { \vec { w } } ) = \omega { \big ( } b _ { 0 } + \sum _ { i } b _ { i } x _ { i } + \sum _ { i = 1 } ^ { n } \sum _ { j = i + 1 } ^ { n } ( x _ { i } { \vec { w _ { i } } } ) \cdot ( x _ { j } { \vec { w _ { j } } } ) { \big ) }
38
+ $$
39
+
40
+ Intuitively, the dot product $( \cdot )$ returns a scalar that measures the (dis)similarity between the latent factors of features $x _ { i }$ and $x _ { j }$ . Polynomial regression has $n ^ { 2 }$ interaction parameters, and Factorization Machine has $n \times r$ . While setting $r \ll n$ makes the model less expressive, factorization will typically exploit features having some shared latent structure. Factorization Machine may dramatically reduce the number of parameters to estimate. Rendle (2010) shows that when the feature vector x consists only of two categorical features in one-hot encoding, Factorization Machine is equivalent to the popular Matrix Factorization algorithm (Koren et al., 2009).
41
+
42
+ # 3 FEAT2VEC
43
+
44
+ We now describe how Feat2Vec extends the Factorization Machine model by allowing grouping of features, and enabling arbitrary feature extraction functions $( \ S \ 3 . 1 )$ . We also report a supervised method to learning Feat2Vec (§ 3.2), as well as a novel unsupervised training procedure (§ 3.3).
45
+
46
+ # 3.1 MODEL
47
+
48
+ We propose a framework for extending factorization machine with neural methods, by introducing structure into the feature interactions. Specifically, we do this by defining feature groups, \~κ, where each group contains features of a particular type. Explicitly, $\dot { \vec { \kappa } }$ is a partition of the set of feature columns in a dataset and each set within the partition is a feature group. The embeddings of a feature group are then learned via a feature extraction function, $\phi _ { i }$ , defined for each feature group. Feat2Vec will then extract features from each feature group, and build $r$ latent factors from them. In Factorization Machine, all the feature embeddings interact with each other, while in Feat2Vec, the interactions only occur between different feature groups.
49
+
50
+ Formally, the addition of deep extraction methods yields the following statistical model:
51
+
52
+ $$
53
+ { \hat { y } } ( { \vec { x } } , { \vec { b } } , { \vec { \phi } } ) = \omega \bigg ( b _ { 0 } + \sum _ { i = 1 } ^ { n } b _ { i } x _ { i } ~ + ~ \sum _ { i = 1 } ^ { | { \vec { \kappa } } | } \sum _ { j = i } ^ { | { \vec { \kappa } } | } \phi _ { i } ( { \vec { x } } _ { { \vec { \kappa } } _ { i } } ) \cdot \phi _ { j } ( { \vec { x } } _ { { \vec { \kappa } } _ { j } } ) \bigg )
54
+ $$
55
+
56
+ In this notation, $\vec { x } _ { \vec { \kappa } _ { i } }$ is a subvector that contains all of the features that belong to the group ${ \vec { \kappa } } _ { i }$ . Thus, $x _ { \vec { \kappa } _ { i } } = [ x _ { j } : j \in \vec { \kappa } _ { i } ]$ . The intuition is that by grouping (sub-)features as a single entity, we can can reason on a higher level of abstraction. Instead of individual sub-features interacting among each other, the embeddings of feature groups interact with those of other groups. $\phi _ { i }$ is a feature extraction that inputs the $i$ -th feature group of the instance, and returns an $r$ -dimensional embedding. The feature extraction function $\phi _ { i }$ can allow for an arbitrary processing of its subfeatures. Across groups, entities interact with each other via the output of $\phi$ only.
57
+
58
+ As a concrete example of an application of this grouping/feature extraction, we might group the individual words of a document into a “document” feature group, and allow this document embedding to then interact with learned embeddings of other document metadata (such as author id). We might expect the extraction function $\phi$ for the words in a document to extract features that characterize the attributes of the document taken as a whole, rather than simply the sum of its individual words.
59
+
60
+ Figure 1 compares existing factorization methods with our novel model. In this example, Feat2Vec is using two feature groups: the first group only has a single feature which is projected to an embedding (just like a regular Factorization Machine); the second group has multiple features, which are together projected to a single embedding.
61
+
62
+ ![](images/88cf493d4cacf4a87c6bcf9e8dec89a2e33aab3199b3a3b0c39e17d487871d57.jpg)
63
+ Figure 1: Network architectures for factorization models. The white clouds $( \bigcirc )$ represent deep layers, for example a convolutional network for text features.
64
+
65
+ The simplest implementation for $\phi _ { i }$ is a linear fully-connected layer, where the output of the $r$ -th entry is:
66
+
67
+ $$
68
+ \phi _ { i } \big ( \vec { x } _ { i } ; \vec { w } \big ) _ { r } = \sum _ { a = 1 } ^ { d _ { i } } w _ { r _ { a } } x _ { i _ { a } }
69
+ $$
70
+
71
+ Note that without loss of generality, we could define a model that is equivalent to a shallow Factorization Machine by allowing each feature group to be a singleton : $\vec { \kappa } \overset { \cdot } { = } \{ \{ x _ { 1 } \} , \{ x _ { 2 } \} \ldots \{ x _ { n } \} \}$ and the linear extraction function presented in Equation 4.
72
+
73
+ We can use Feat2Vec to both use large feature sets and overcome the cold-start problem. This is only possible when there is an alternative description of the item available (for example an image or a passage of text). In Figure 2, we show how we address this problem by treating the words as indexed features, but placed within a structured feature group $\kappa _ { w }$ , the group of word features. A feature extraction function $\phi$ acts on the features in $\kappa _ { w }$ , and the other features interact with the words only via the output of $\phi$ . Notice that this implies we can precompute and store the latent factors of the target task seen during training, so that predictions during inference can be sped-up. For example if we have two feature groups (e.g, a label and an item), first we compute the feature extraction function to the unseen items and their embeddings, and then we simply apply a dot product over the stored vectors of the labels.
74
+
75
+ ![](images/cc57b1066f59d22b82314167436fc6f203035c20cf16e8f70ec5112b69514f54.jpg)
76
+ Figure 2: Comparison of how factorization may use item descriptions features.
77
+
78
+ Figure 1c shows an approach of using neural networks within factorization machines that has been proposed multiple times (Dziugaite & Roy, 2015; Guo et al., 2017). It replaces the dot product of factors with a learned neural function, which has been shown to improve predictive accuracy for various tasks. In this case, fast inference for cold-start documents using pre-computed label embeddings is no longer possible. It needs to store the entire neural function that takes the embeddings as inputs. Another shortcoming of replacing the dot product with a neural function is that it would no longer be possible to interpret the embeddings as containing latent factors related to the target task; There may be highly complex mappings from the embeddings to the final output via this neural function. However, it would be straightforward to combine this approach with Feat2Vec. This is not explored in this work.
79
+
80
+ # 3.2 SUPERVISED LEARNING FROM DATA
81
+
82
+ We can learn the the parameters of a deep factorization model θ using training data by minimizing a loss function $\mathcal { L }$ :
83
+
84
+ $$
85
+ \arg \operatorname* { m i n } _ { \vec { \Theta } } \sum _ { x } \mathcal { L } \big ( y ( x ) , \hat { y } ( x ; \vec { \theta } ) \big ) + \gamma | | \Theta | | ^ { w }
86
+ $$
87
+
88
+ Here, $y ( x )$ is the true target value for $x$ obtained from training data, and ${ \hat { y } } ( x )$ is the one estimated by the model; the hyperparameter $\gamma$ controls the amount of regularization. For the labeling and classification tasks, we optimize the binary cross-entropy for $y \in \{ 0 , 1 \}$ :
89
+
90
+ $$
91
+ \mathcal { L } ( y , \hat { y } ) = - \big ( y \log ( \hat { y } ) \big ) - ( 1 - y ) \log ( 1 - \hat { y } ) \big )
92
+ $$
93
+
94
+ For the regression tasks where the target value is continuous, we optimize the mean squared error (MSE):
95
+
96
+ $$
97
+ \mathcal { L } ( y , \hat { y } ) = ( y - \hat { y } ) ^ { 2 }
98
+ $$
99
+
100
+ Neural models are typically learned using mini-batch updates, where the incremental descent is performed with respect to several instances at a time. For the implementation of this paper, we built our models using the Keras programming toolkit (Chollet et al., 2015), that is now part of Tensorflow (Abadi et al., 2015). It enables automatic differentiation, and is bundled with a generalpurpose optimization algorithm called ADAM (Kingma & Ba, 2014) that needs no tuning of gradient step sizes.
101
+
102
+ It is straightforward to optimize Equation 5 directly for multiclass or binary classification. However, when the number of labels is very large, it is common practice use a binary classifier and sample the negative examples (Dyer, 2014). For the multi-label classification tasks, we use Feat2Vec with a binary output. In this case we would have at least two feature groups—one of the feature groups is the label that we want to predict, and the other group(s) is the input from which we want to make the prediction. The output indicates whether the label is associated with the input $( y = + 1 )$ ), or not $( y = 0 )$ ). The datasets we use for our labeling experiments only contains positive labels, thus for each training example we sample a set of negative labels equal to the number of positive labels. It is typical to use one of the following sampling strategies according to the best validation error, in each case excluding the actual positive labels for each training example – (i) uniformly from all possible labels, or (ii) from the empirical distributions of positive labels. Other sampling strategies have been proposed (Rendle et al., 2009; Rendle & Freudenthaler, 2014).
103
+
104
+ # 3.3 UNSUPERVISED LEARNING FROM DATA
105
+
106
+ We now discuss how Feat2Vec can be used to learn embeddings in an unsupervised setting with no explicit target for prediction.
107
+
108
+ The training dataset for a Feat2Vec model consists of only the observed data. In natural language, these would be documents written by humans. Since Feat2Vec (Equation 3) requires positive and negative examples, we also need to supply unobserved data as negative examples. Consider a feature group $\vec { \mathsf { K } } _ { i }$ , that exists in very high dimensional space. For example, this could happen because we are modeling with one-hot encoding a categorical variable with large number of possible values. In such scenario, it is overwhelmingly costly to feed the model all negative labels, particularly if the model is fairly sparse.
109
+
110
+ A shortcut around this is a concept known as implicit sampling, where instead of using all of the possible negative labels, one simply samples a fixed number $( k )$ from the set of possible negative labels for each positively labelled record. Word2Vec makes use of an algorithm called Negative Sampling, that has little theoretical guarantees (Dyer, 2014). In short, their approach samples a negative observation from a noise distribution $\mathcal { Q } _ { w 2 v }$ , that is proportional to the empirical frequency of a word in the training data.
111
+
112
+ We introduce a new implicit sampling method that enables learning unsupervised embeddings for structured feature sets. We can learn the correlation of features within a dataset by imputing negative labels, simply by generating unobserved records as our negative samples. Unlike Word2Vec, we do not constraint features types to be words. Features groups can be individual columns in a data matrix, but they need not to be. By grouping subfeatures using the parameter $\boldsymbol { \mathsf { K } }$ in Equation 3, the model can reason on more abstract entities in the data. By entity, we mean a particular feature group value. For example, in our experiments on a movie dataset, we use a “genre” feature group, where we group non-mutually exclusive indicators for movie genres including comedy, action, and drama films.
113
+
114
+ We start with a dataset $S ^ { + }$ of records with |\~κ| feature groups. We then mark all observed records in the training set as positive examples. For each positive record, we generate $k$ negative labels using the following 2-step algorithm:
115
+
116
+ # Algorithm 1 Implicit sampling algorithm for unsupervised Feat2Vec: $\mathcal { Q }$
117
+
118
+ 1: function FEAT2VEC SAMPLE(S+, k, α1, α2)
119
+ 2: S − ← ∅
120
+ 3: for \~x + ∈ S+ do
121
+ 4: Draw a random feature group $\kappa _ { i } \sim \mathcal { Q } _ { 1 } ( \{ \mathrm { p a r a m s } ( \phi _ { i } ) \} _ { i = 1 } ^ { | \vec { \kappa } | } , \alpha _ { 1 } )$
122
+ 5: for $j \in \{ 1 , \ldots , k \}$ do
123
+ 6: \~x − ← \~x + $\triangleright$ set initially to be equal to the positive sample
124
+ 7: Draw a random feature group value $\tilde { x } \sim \mathcal { Q } _ { 2 } ( \mathrm { X } _ { \kappa _ { i } , \alpha _ { 2 } } )$
125
+ 8: $\begin{array} { l } { { { \vec { x } _ { \kappa _ { i } } ^ { - } \tilde { x } } } } \\ { { { S ^ { - } S ^ { - } + \{ \vec { x } ^ { - } \} } } } \end{array}$ $\triangleright$ substitute the $i$ -th feature type with the sampled one
126
+ 9:
127
+ 10: end for
128
+ 11: end for
129
+ 12: return $S ^ { - }$
130
+ 13: end function
131
+
132
+ Explained in words, our negative sampling method for unsupervised learning iterates over all of the observations of the training dataset. For each observation ${ \bar { x } } ^ { + }$ , it randomly selects the $i$ -th feature group from a noise distribution $\mathcal { Q } _ { 1 } ( \cdot )$ . Then, it creates a negative observation that is identical to ${ \vec { x } } ^ { + }$ , except that its $i$ -th feature group is replaced by a value sampled from a noise distribution $\mathcal { Q } _ { 2 } ( \cdot )$ . In our application, we use the same class of noise distributions (flattened multinomial) for both levels of sampling, but this need not necessarily be the case.
133
+
134
+ We now describe the two noise distributions that we use. We use $P _ { \mathcal { Q } } ( x )$ to denote the probability of $x$ under a distribution $\mathcal { Q }$ .
135
+
136
+ Sampling Feature Groups. The function params calculates the complexity of a feature extraction function $\phi _ { i }$ . To sample a feature group, we choose a feature group $\kappa _ { i }$ from a multinomial distribution with probabilities proportional a feature’s complexity. By complexity, we mean the number of parameters we need to learn that are associated with a particular feature group. This choice places more weight on features that have more parameters and thus are going to require more training iterations to properly learn. The sampling probabilities of each feature group are:
137
+
138
+ $$
139
+ P _ { \mathcal { Q } _ { 1 } } ( \kappa _ { i } | \operatorname { p a r a m s } ( \phi _ { i } ) \} _ { i = 1 } ^ { | \sharp | } , \alpha _ { 1 } ) = \frac { \operatorname { p a r a m s } ( \phi _ { i } ) ^ { \alpha _ { 1 } } } { \sum _ { j = 1 } ^ { | \sharp | } \operatorname { p a r a m s } ( \phi _ { j } ) ^ { \alpha _ { 1 } } } , \quad \alpha _ { 1 } \in [ 0 , 1 ]
140
+ $$
141
+
142
+ For categorical variables using a linear fully-connected layer, the complexity is simply proportional to the number of categories in the feature group. However, if we have multiple intermediate layers for some feature extraction functions (e.g., convolutional layers), these parameters should also be counted towards a feature group’s complexity. The hyper-parameter $\alpha _ { 1 }$ helps flatten the distribution. When $\alpha _ { 1 } = 0$ , the feature groups are sampled uniformly, and when $\alpha _ { 1 } = 1$ , they are sampled proportional to their complexity. Figure A.1 in the Appendix provides a visualization of how the feature sampling rate varies with the hyperparameter for features with differing levels of complexity.
143
+
144
+ Sampling Feature Group Values. To sample a value from within a feature groups $\kappa _ { i }$ , we use a similar strategy to Word2Vec and use the empirical distribution of values:
145
+
146
+ $$
147
+ P _ { \mathcal Q _ { 2 } } ( x | \mathrm X _ { \kappa _ { i } } , \alpha _ { 2 } ) = \frac { \mathrm { c o u n t } ( x ) ^ { \alpha _ { 2 } } } { \sum _ { x _ { \kappa _ { i } } ^ { \prime } \in S ^ { + } } \mathrm { c o u n t } ( x _ { \kappa _ { i } } ^ { \prime } ) ^ { \alpha _ { 2 } } } , \quad \alpha _ { 2 } \in [ 0 , 1 ]
148
+ $$
149
+
150
+ Here, $\operatorname { c o u n t } ( x )$ is the number of times a feature group value $x$ appeared in the training dataset $S ^ { + }$ , and $\alpha _ { 2 }$ is again a flattening hyperparameter.
151
+
152
+ This method will sometimes by chance generate negatively labeled samples that do exist in our sample of observed records. The literature offers two possibilities: in the Negative Sampling that Word2Vec follows, the duplicate negative samples are simply ignored (Dyer, 2014). Alternatively, it is possible to account for the probability of random negative labels that are identical to positively labeled data using Noise Contrastive Estimation (NCE) (Gutmann & Hyvarinen, 2010). ¨
153
+
154
+ # 3.3.1 THE LOSS FUNCTION FOR UNSUPERVISED LEARNING
155
+
156
+ For our unsupervised learning of embeddings, we optimize a NCE loss function, to adjust the structural statistical model $\hat { y } = p ( y = 1 | \vec { x } , \vec { \phi } , \Theta )$ , expressed in Equation 3 to account for the possibility of random negative labels that appear identical to positively labeled data. θ here represents the parameters learned in during training (i.e. the $b _ { i }$ terms and parameters associated with the extraction functions $\phi _ { i }$ in Equation 3). Since we only deal with a dichotomous label, indicating a positive or negative sample, for unsupervised learning, we restrict our attention to usage of Equation 3 with $\omega$ as a logistic link function.
157
+
158
+ An additional burden of NCE is that we need to calculate a partition function $Z _ { \vec { x } }$ for each unique record type $\vec { x }$ in the data that transforms the probability $\hat { y }$ of a positive or negative label into a wellbehaved distribution that integrates to 1. Normally, this would introduce an astronomical amount of computation and greatly increase the complexity of the model. As a work-around, we appeal to the work of Mnih & Teh (2012), who showed that in the context of language models that setting the $Z _ { \vec { x } } = 1$ in advance effectively does not change the performance of the model. The intuition is that if the underlying model has enough free parameters that it will effectively learn the probabilities itself. Thus, it does not over/under predict the probabilities on average (since that will result in penalties on the loss function).
159
+
160
+ Written explicitly, the new structural probability model is:
161
+
162
+ $$
163
+ \tilde { p } ( Y = 1 | \vec { x } , \vec { \phi } , \mathbf { \Theta } \Theta ) = \frac { \exp \bigl ( s ( \vec { x } , \vec { \phi } , \mathbf { \Theta } \Theta ) \bigr ) } { \exp ( s ( \vec { x } , \vec { \phi } , \mathbf { \Theta } \Theta ) \bigr ) + P _ { \mathcal { Q } } ( \vec { x } | \alpha _ { 1 } , \alpha _ { 2 } ) }
164
+ $$
165
+
166
+ where $s ( . )$ denotes the score of a record $\vec { x }$ given parameter values/extraction functions:
167
+
168
+ $$
169
+ s ( \vec { x } , \vec { \phi } , \Theta ) = b _ { 0 } + \sum _ { i = 1 } ^ { n } b _ { i } x _ { i } + \sum _ { i = 1 } ^ { | \vec { \kappa } | } \sum _ { j = i } ^ { | \vec { \kappa } | } \phi _ { i } ( \vec { x } _ { \vec { \kappa } _ { i } } ) \cdot \phi _ { j } ( \vec { x } _ { \vec { \kappa } _ { j } } )
170
+ $$
171
+
172
+ and $P _ { \mathcal { Q } } ( . )$ denotes the total probability of a record $\vec { x _ { i } }$ being drawn from our negative sampling algorithm, conditional on the positively labeled record ${ \vec { x } } ^ { + }$ the negative sample is drawn for:
173
+
174
+ $$
175
+ P _ { \mathcal { Q } } ( \vec { x } | \alpha _ { 1 } , \alpha _ { 2 } , \mathrm { X } , \vec { x } ^ { + } ) = P _ { \mathcal { Q } _ { 2 } } ( \vec { x } _ { \bf { \kappa } _ { i } } | \mathrm { X } _ { \bf { \kappa } _ { i } } , \alpha _ { 2 } ) P _ { \mathcal { Q } _ { 1 } } ( \kappa _ { i } | \mathrm { p a r a m s } ( \phi _ { i } ) \rbrace _ { i = 1 } ^ { n } , \alpha _ { 1 } )
176
+ $$
177
+
178
+ Our loss function $L$ optimizes $\theta$ , the parameters of the feature extraction functions $\vec { \phi }$ , while accounting for the probability of negative samples.
179
+
180
+ $$
181
+ L ( S ) = \arg \operatorname* { m i n } _ { \Theta } \frac { 1 } { | S ^ { + } | } \sum _ { \vec { x } ^ { + } \in S ^ { + } } \Big ( \log ( \tilde { p } ( y = 1 | \vec { x } ^ { + } , \vec { \phi } , \Theta ) ) \ + \sum _ { \vec { x } ^ { - } \sim \mathcal { Q } ( \cdot | \vec { x } ^ { + } ) } ^ { k } \log ( \tilde { p } ( y = 0 | \vec { x } ^ { - } , \vec { \phi } , \Theta ) ) \Big )
182
+ $$
183
+
184
+ Feat2Vec has interesting theoretical properties. For example, it is well known that Factorization Machines can be used as a multi-label classifier: with at least two features, one can use one of the feature as the target label, and the other as the input feature to make a prediction. In such setting, the output indicates whether the label is associated with the input $( y = + 1 )$ ), or not $( y = 0 )$ ), and therefore the input can be associated with more than one label. With $n$ feature types, Feat2Vec is equivalent to optimizing a convex combination of the loss functions from $n$ individual Factorization Machines. In other words, it optimizes $n$ multi-label classifiers, where each classifier is optimized for a different target (i.e.,a specific feature group). We show the proof of this in the Appendix 1.
185
+
186
+ # 4 EMPIRICAL RESULTS
187
+
188
+ # 4.1 SUPERVISED EMBEDDINGS
189
+
190
+ We now address our working hypotheses for evaluating supervised embeddings. For all our experiments we define a development set and a single test set which is $10 \%$ of the dataset, and a part of the development set is used for early stopping or validating hyper-parameters. Since these datasets are large and require significant time to train on an Nvidia K80 GPU cluster, we report results on only a single training-test split. For the multi-label classification task in 4.1.1 we predict a probability for each document-label pair and use an evaluation metric called Area Under the Curve (AUC) of the Receiver Operating Characteristic (ROC). Since we only observe positive labels, for each positive label in the test set we sample negative labels according to the label frequency. This ensures that if a model merely predicts the labels according to their popularity, it would have an AUC of 0.5. A caveat of our evaluation strategy is that we could be underestimating the performance of our models—there is a small probability that the sampled negatives labels are false negatives. However, since we apply the same evaluation strategy consistently across our methods and baselines, the relative difference of the AUC is meaningful. We choose the AUC as a metric because it is popular for both classification and ranking problems. For the regression task in 4.1.2, we use mean squared error (MSE) as the evaluation metric. In preliminary experiments we noticed that regularization slows down convergence with no gains in prediction accuracy, so we avoid overfitting only by using early stopping. We share most of the code for the experiments online1 for reproducibility.
191
+
192
+ For our feature extraction function $\phi$ for text, we use a Convolutional Neural Network (CNN) that has been shown to be effective for natural language tasks (Kalchbrenner et al., 2014; Weston et al., 2014). In Appendix B we describe this network and its hyper-parameters. Instead of tuning the hyper-parameters, we follow previously published guidelines (Zhang & Wallace, 2015).
193
+
194
+ # 4.1.1 IS Feat2Vec EFFECTIVE FOR COLD-START PREDICTIONS?
195
+
196
+ We compare Feat2Vec with an extension of matrix factorization that can generalize to unseen items for text documents, Collaborative Topic Regression (CTR– Wang & Blei (2011)), a method with an open-source Python implementation2. We evaluate them on the CiteULike dataset which consists of pairs of scientific articles and the users who have added them to their personal libraries, and it contains 16,980 unique articles and 5,551 unique users. We use the models to predict users who may have added a given article to their library. We compare the performance of Feat2Vec with CTR using pre-defined cross-validation splits3. We use $1 \%$ of the training set for early stopping.
197
+
198
+ Table 1: Yelp rating prediction
199
+
200
+ <table><tr><td></td><td>MSE</td><td>Improvement over Matrix Factorization</td></tr><tr><td>Matrix Factorization</td><td>1.561</td><td>=</td></tr><tr><td>Feat2Vec</td><td>0.480</td><td>69.2 %</td></tr><tr><td>DeepCoNN</td><td>1.441</td><td>19.6 %</td></tr></table>
201
+
202
+ For CTR we use the hyper-parameters reported by the authors as best, except for $r$ which we found had a significant impact on training time . We only consider $r \in \{ 5 , 1 0 , 1 5 \}$ and choose the value which gives the best performance for CTR (details in Appendix A.2). On the warm-start condition, CTR has an AUC of 0.9356; however, it shows significant degradation in performance for unseen documents and it only performs slightly better than random chance with an AUC of 0.5047. On the other hand, Feat2Vec achieves AUC of 0.9401 on the warm-start condition, and it only degrades to 0.9124 on unseen documents. Feat2Vec can also be trained over ten times faster, since it can leverage GPUs.4 We also note that we have not tuned the architecture or hyper-parameters of the feature extraction function $\phi$ and greater improvements are possible by optimizing them.
203
+
204
+ # 4.1.2 COMPARISON WITH ALTERNATIVE CNN-BASED TEXT FACTORIZATION
205
+
206
+ We now compare with a method called DeepCoNN, a deep network specifically designed for incorporating text into matrix factorization (Zheng et al., 2017)—which reportedly, is the state of the art for predicting customer ratings when textual reviews are available. For Feat2Vec we use the same feature extraction function (see Appendix B.1 for details) used by DeepCoNN. We evaluate on the Yelp dataset5, which consists of 4.7 million reviews of restaurants. For each user-item pair, DeepCoNN concatenates the text from all reviews for that item and all reviews by that user. The concatenated text is fed into a feature extraction function followed by a factorization machine. In contrast, for Feat2Vec, we build 3 feature groups: item identifiers (in this case, restaurants), users and review text.
207
+
208
+ Table 1 compares our methods to DeepCoNN’s published results because a public implementation is not available. We see that Feat2Vec provides a large performance increase when comparing the reported improvement, over Matrix Factorization, of the mean squared error. Our approach is more general, and we claim that it is also more efficient. Since DeepCoNN concatenates text, when the average reviews per user is $\bar { n _ { u } }$ and reviews per item is $\bar { n _ { i } }$ , each text is duplicated on average $\bar { n _ { i } } \times \bar { n _ { u } }$ times per training epoch. In contrast, for Feat2Vec each review is seen only once per epoch. Thus it can be 1-2 orders of magnitude more efficient for datasets where $\bar { n _ { i } } \times \bar { n _ { u } }$ is large.
209
+
210
+ # 4.2 GENERAL-PURPOSE EMBEDDINGS
211
+
212
+ # 4.2.1 DOES Feat2Vec ENABLE BETTER EMBEDDINGS?
213
+
214
+ Ex ante, it is unclear to us how to evaluate the performance of an unsupervised embedding algorithm, but we felt that a reasonable task would be a ranking task one might practically attempt using our datasets. This task will assess the similarity of trained embeddings using unseen records in a left-out dataset. In order to test the relative performance of our learned embeddings, we train our unsupervised Feat2Vec algorithm and compare its performance in a targeted ranking task to Word2Vec’s CBOW algorithm for learning embeddings. In our evaluation approach, we compare the cosine similarity of the embeddings of two entities where these entities are known to be associated with each other since they appear in the same observation in a test dataset. In particular, in the movie dataset we compare the similarity of movie directors to those of actors who were cast in the same film for a left-out set of films. For our educational dataset, we compare rankings of textbooks by evaluating the similarity of textbook and user embeddings. We evaluate the rankings according to their mean percentile rank (MPR):
215
+
216
+ $$
217
+ M P R = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { R _ { i } } { \operatorname* { m a x } R }
218
+ $$
219
+
220
+ where $R _ { i }$ is the rank of the entity under our evaluation procedure for observation $i$ . This measures on average how well we rank actual entities. A score of 0 would indicate perfect performance (i.e. top rank every test sample given), so a lower value is better under this metric. See the appendix $\ S \mathrm { A } . 1$ for further details on the experimental setup.
221
+
222
+ # 4.2.2 DATASETS
223
+
224
+ Movies The Internet Movie Database (IMDB) is a publicly available dataset6 of information related to films, television programs and video games. Though in this paper, we focus only on data on its 465,136 movies. Table A.1 in the appendix $( \ S \mathrm { A } . 1 )$ summarizes the feature types we use. It contains information on writers, directors, and principal cast members attached to each film, along with metadata.
225
+
226
+ Education We use a dataset from an anonymized leading technology company that provides educational services. In this proprietary dataset, we have 57 million observations and 9 categorical feature types which include textbook identifier, user identifier, school identifier, and course the book is typically used with, along with other proprietary features. Here, each observation is an “interaction” a user had with a textbook.
227
+
228
+ # 4.2.3 RESULTS
229
+
230
+ After training, we use the cast members associated with the movies of the test set and attempt to predict the actual director the film was directed. We take the sum of the cast member embeddings, and rank the directors by cosine similarity of their embeddings to the summed cast member vector. If there is a cast member in the test dataset who did not appear in the training data, we exclude them from the summation. For the educational dataset, we simply use the user embedding directly to get the most similar textbooks.
231
+
232
+ Table 2 presents the results from our evaluation. Feat2Vec sizably outperforms CBOW in the MPR metric. In fact, Feat2Vec predicts the actual director $2 . 4 3 \%$ of the times, while CBOW only does so $1 . 2 6 \%$ of the time, making our approach almost 2 times better in terms of Top-1 Precision metric. We explore in greater detail the distribution of the rankings in the appendix in $\ S \mathrm { A } . 2$ .
233
+
234
+ Table 2: Mean percentile rank
235
+
236
+ <table><tr><td>Dataset</td><td>Feat2Vec</td><td>CBOW</td></tr><tr><td>IMDB</td><td>19.36%</td><td>24.15%</td></tr><tr><td>Educational</td><td>25.2%</td><td>29.2%</td></tr></table>
237
+
238
+ # 4.3 UNSUPERVISED Feat2Vec PERFORMANCE WITH CONTINUOUS INPUTS
239
+
240
+ We now focus on how well Feat2Vec performs on a real-valued feature with a complex feature extraction function. We expect this task to highlight Feat2Vec’s advantage over token-based embedding learning algorithms, such as Word2Vec, since our rating embedding extraction function will require embeddings of numerically similar ratings to be close , while Word2Vec will treat two differing ratings tokens as completely different entities. We evaluate the prediction of the real-valued rating of movies in the test dataset by choosing the IMDB rating embedding most similar7 to the embedding of the movie’s director, and compute the Root Mean Squared Error (RMSE) of the predicted rating in the test dataset. We also vary $\alpha _ { 1 }$ , the flattening hyperparameter for feature group sampling, to see what effect this hyperparameter has on our performance. Intuitively, a low $\alpha _ { 1 }$ will greatly improve the quality of the ratings embeddings learned, since it has relatively few parameters and is otherwise sampled infrequently. At the same time, with low $\alpha _ { 1 }$ the director feature will be sampled less since it is one of the most complex features to learn, so the learned director embeddings may be of poorer quality. Figure 3 displays the results of our experiment, benchmarked against the performance of Word2Vec’s CBOW algorithm in the prediction task. We also show as a baseline the RMSE of a random uniform variable over the range of possible ratings (0 to 10). As is evident from the plot, CBOW performs a bit better than a random prediction, but is also handily outperformed by Feat2Vec across all hyper-parameter settings. The algorithm’s performance does not seem very sensitive to the hyperparameter choice.
241
+
242
+ ![](images/617543a6a2a807e0a383fe6a61bcbf4ec4eb3fbaf9fd269a94493f8b5ea3637d.jpg)
243
+ Figure 3: RMSE in Ratings Task as a Function of $\alpha _ { 1 }$
244
+
245
+ # 5 RELATION TO PRIOR WORK
246
+
247
+ The original Factorization Machine formulation has been extended for multiple contexts. For example, Field-Aware Factrorization Machine (Juan et al., 2016) allows different weights for some feature interactions, but does not allow feature groups or feature extraction functions like Feat2Vec does.
248
+
249
+ Algorithms that calculate continuous representations of entities other than words have been proposed for biological sequences (Abrahamsson & Plotkin, 2009), of vertices in network graphs (Perozzi et al., 2014) or in machine translation for embeddings of complete sentences (Kiros et al., 2015). Generative Adversarial Networks (Goodfellow et al., 2014)(GANs) have been used to produce unsupervised embeddings of images effective for classification (Radford et al., 2015) and for generating natural language (Press et al., 2017). To our knowledge, GANs have not been used for jointly embedding multiple feature types. Adversarial training could be an alternative to NCE for unsupervised learning, but we leave this for future study.
250
+
251
+ We recently discovered a promising direction for an algorithm still in development called StarSpace (Wu et al., 2017) with similar goals from ours. Even though they intend to be able to embed all types of features, at the time of the writing of this paper, their pre-print method was limited to only work for bag of words. While Feat2Vec can jointly learn embeddings for all feature values in a dataset, StarSpace samples a single arbitrary feature. Our preliminary experiments suggest that sampling a single feature does not produce embeddings that generalize well. Nonetheless, a limitation of our work is that we do not compare with StarSpace, which future work may decide to do.
252
+
253
+ # 6 CONCLUSION
254
+
255
+ Embeddings have proven useful in a wide variety of contexts, but they are typically built from datasets with a single feature type as in the case of Word2Vec, or tuned for a single prediction task as in the case of Factorization Machine. We believe Feat2Vec is an important step towards generalpurpose methods, because it decouples feature extraction from prediction for datasets with multiple feature types, it is general-purpose, and its embeddings are easily interpretable.
256
+
257
+ In the supervised setting, Feat2Vec is able to calculate embeddings for whole passages of texts, and we show experimental results outperforming an algorithm specifically designed for text—even when using the same feature extraction CNN. This suggests that the need for ad-hoc networks should be situated in relationship to the improvements over a general-purpose method.
258
+
259
+ In the unsupervised setting, Feat2Vec’s embeddings are able to capture relationships across features that can be twice as better as Word2Vec’s CBOW algorithm on some evaluation metrics. Feat2Vec exploits the structure of a datasets to learn embeddings in a way that is structurally more sensible than existing methods. The sampling method, and loss function that we use have interesting theoretical properties. To the extent of our knowledge, Unsupervised Feat2Vec is the first method able to calculate continuous representations of data with arbitrary feature types.
260
+
261
+ Future work could study how to reduce the amount of human knowledge our approach requires; for example by automatically grouping features into entities, or by automatically choosing a feature extraction function. These ideas can extend to our codebase that we make available 8. Overall, we evaluate supervised and unsupervised Feat2Vec on 2 datasets each. Though further experimentation is necessary, we believe that our results are an encouraging step towards general-purpose embedding models.
262
+
263
+ # REFERENCES
264
+
265
+ Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit ´ Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, ´ Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
266
+ Erik Abrahamsson and Steven S Plotkin. Biovec: a program for biomolecule visualization with ellipsoidal coarse-graining. Journal of Molecular Graphics and Modelling, 28(2):140–145, 2009.
267
+ Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. arXiv preprint arXiv:1607.04606, 2016.
268
+ Franc¸ois Chollet et al. Keras. https://github.com/fchollet/keras, 2015.
269
+ Chris Dyer. Notes on noise contrastive estimation and negative sampling. arXiv preprint arXiv:1410.8251, 2014.
270
+ Gintare Karolina Dziugaite and Daniel M. Roy. Neural network matrix factorization. CoRR, abs/1511.06443, 2015. URL http://arxiv.org/abs/1511.06443.
271
+ 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.
272
+ Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, and Xiuqiang He. Deepfm: A factorization-machine based neural network for ctr prediction. arXiv preprint arXiv:1703.04247, 2017.
273
+ Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle for unnor- ¨ malized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 297–304, 2010.
274
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing humanlevel performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
275
+ Yuchin Juan, Yong Zhuang, Wei-Sheng Chin, and Chih-Jen Lin. Field-aware factorization machines for ctr prediction. In Proceedings of the 10th ACM Conference on Recommender Systems, pp. 43–50. ACM, 2016.
276
+ Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for modelling sentences. CoRR, abs/1404.2188, 2014. URL http://arxiv.org/abs/1404.2188.
277
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Proceedings of the International Conference on Learning Representations (ICLR), abs/1412.6980, 2014. URL http://arxiv. org/abs/1412.6980.
278
+ Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Advances in neural information processing systems, pp. 3294–3302, 2015.
279
+ Yehuda Koren, Robert Bell, and Chris Volinsky. Matrix Factorization Techniques for Recommender Systems. Computer, 42(8):30–37, August 2009. ISSN 0018-9162. URL http://dx.doi.org/10.1109/MC. 2009.263.
280
+ Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1188–1196, 2014.
281
+ 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.
282
+ 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.
283
+ Andriy Mnih and Yee Whye Teh. A fast and simple algorithm for training neural probabilistic language models. In In Proceedings of the International Conference on Machine Learning, 2012.
284
+ Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’14, pp. 701–710, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2956-9. doi: 10.1145/ 2623330.2623732. URL http://doi.acm.org/10.1145/2623330.2623732.
285
+ Ofir Press, Amir Bar, Ben Bogin, Jonathan Berant, and Lior Wolf. Language generation with recurrent generative adversarial networks without pre-training. arXiv preprint arXiv:1706.01399, 2017.
286
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
287
+ Steffen Rendle. Factorization machines. In Data Mining (ICDM), 2010 IEEE 10th International Conference on, pp. 995–1000. IEEE, 2010.
288
+ Steffen Rendle and Christoph Freudenthaler. Improving pairwise learning for item recommendation from implicit feedback. In Proceedings of the 7th ACM International Conference on Web Search and Data Mining, WSDM ’14, pp. 273–282, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2351-2. doi: 10.1145/2556195.2556248. URL http://doi.acm.org/10.1145/2556195.2556248.
289
+ Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI ’09, pp. 452–461, Arlington, Virginia, United States, 2009. AUAI Press. ISBN 978-0- 9749039-5-8. URL http://dl.acm.org/citation.cfm?id $= 1$ 1795114.1795167.
290
+ Tobias Schnabel, Igor Labutov, David M Mimno, and Thorsten Joachims. Evaluation methods for unsupervised word embeddings. In EMNLP, pp. 298–307, 2015.
291
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1): 1929–1958, 2014.
292
+ Chong Wang and David M Blei. Collaborative topic modeling for recommending scientific articles. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 448–456. ACM, 2011.
293
+ Jason Weston, Sumit Chopra, and Keith Adams. #tagspace: Semantic embeddings from hashtags. In Alessandro Moschitti, Bo Pang, and Walter Daelemans (eds.), Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, EMNLP 2014, October 25-29, 2014, Doha, Qatar, A meeting of SIGDAT, a Special Interest Group of the ACL, pp. 1822–1827. ACL, 2014. ISBN 978-1-937284-96-1. URL http://aclweb.org/anthology/D/D14/D14-1194.pdf.
294
+ Ledell Wu, Adam Fisch, Sumit Chopra, Keith Adams, Antoine Bordes, and Jason Weston. Starspace: Embed all the things! arXiv preprint arXiv:1709.03856, 2017.
295
+ Ye Zhang and Byron Wallace. A sensitivity analysis of (and practitioners’ guide to) convolutional neural networks for sentence classification. arXiv preprint arXiv:1510.03820, 2015.
296
+ Lei Zheng, Vahid Noroozi, and Philip S. Yu. Joint deep modeling of users and items using reviews for recommendation. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM ’17, pp. 425–434, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-4675-7. doi: 10.1145/3018661.3018665. URL http://doi.acm.org/10.1145/3018661.3018665.
297
+
298
+ ![](images/bf34d4eebcb9f890edf4a4cbf4846f7ce55c933140f8d2fbbd7a590e3701c8c8.jpg)
299
+ Figure A.1: Feature Sampling Probabilities as a Function of $\alpha _ { 1 }$
300
+
301
+ Table A.1: IMDB dataset features
302
+
303
+ <table><tr><td>Feature Type Name</td><td>Type</td><td># of feats.</td><td>Example for an instance</td></tr><tr><td>Runtime (minutes)</td><td>Real-valued</td><td>1</td><td>116</td></tr><tr><td>IMDB rating (0-10)</td><td>Real-valued</td><td>1</td><td>7.8</td></tr><tr><td># of IMDB rating votes</td><td>Real-valued</td><td>1</td><td>435,682</td></tr><tr><td>Is adult film?</td><td>Boolean</td><td>2</td><td>False</td></tr><tr><td>Movie releaes year</td><td>Categorical</td><td>271</td><td>2001</td></tr><tr><td>Movie title</td><td>Text</td><td>165,471</td><td>“Ocean&#x27;s”,“Eleven”</td></tr><tr><td>Directors</td><td>Bag of categories</td><td>174,382</td><td>‘Steven Soderbergh”</td></tr><tr><td>Genres</td><td>Bag of categories</td><td>28</td><td>“Crime”,“Thriller”</td></tr><tr><td>Writers</td><td>Bag of categories</td><td>244,241</td><td>“George Johnson”,“Jack Russell&quot;</td></tr><tr><td>Principal cast members (actors)</td><td>Bag of categories</td><td>1,104,280</td><td>“George Clooney”,“Brad Pitt”,“Julia Roberts”</td></tr></table>
304
+
305
+ # A APPENDIXES
306
+
307
+ # A.1 UNSUPERVISED RANKING EXPERIMENT DETAILS
308
+
309
+ For our evaluation, we define a testing set that was not used to tune the parameters of the model. For the IMDB dataset, we randomly select a $10 \%$ sample of the observations that contain a director that appears at least twice in the database 9. We do this to guarantee that the set of directors in the left-out dataset appear during training at least once, so that each respective algorithm can learn something about the characteristics of these directors. For the educational dataset, our testing set only has observations of textbooks and users that appear at least 10 times in training.
310
+
311
+ For both Feat2Vec and CBOW, we perform cross-validation on the loss function, by splitting the $10 \%$ of the training data randomly into a validation set, to determine the number of epochs to train, and then train the full training dataset with this number of epochs. 10 While regularization of the embeddings during training is possible, this did not dramatically change results, so we ignore this dimension of hyperparameters.
312
+
313
+ We rank left-out entity pairs in the test dataset using the ordinal ranking of the cosine similarity of target and input embeddings. For the IMDB dataset, the target is the director embedding, and the input embedding is the sum of the cast member embeddings. For the educational dataset, the target is the textbook embedding, and the input embedding is the user embedding.
314
+
315
+ For training Feat2Vec we set $\alpha _ { 1 } = \alpha _ { 2 } = 3 / 4$ in the IMDB dataset; and $\alpha _ { 1 } = 0$ and $\alpha _ { 2 } = 0 . 5$ for the educational. In each setting, $\alpha _ { 2 }$ is set to the same flattening hyperparameter we use for CBOW to negatively sample words in a document. We learn $r = 5 0$ dimensional embeddings under both algorithms.
316
+
317
+ Below we describe how CBOW is implemented on our datasets for unsupervised experiments and what extraction functions are used to represent features in the IMDB dataset.
318
+
319
+ Word2Vec For every observation in each of the datasets, we create a document that tokenizes the same information that we feed into Feat2Vec. We prepend each feature value by its feature name, and we remove spaces from within features. In Figure A.2 we show an example document. Some features may allow multiple values (e.g., multiple writers, directors). To feed these features into the models, for convenience, we constraint the number of values, by truncating each feature to no more than 10 levels (and sometimes less if reasonable). This results in retaining the full set of information for well over $9 5 \%$ of the values. We pad the sequences with a “null” category whenever necessary to maintain a fixed length. We do this consistently for both Word2Vec and Feat2Vec. We use the CBOW Word2Vec algorithm and set the context window to encompass all other tokens in a document during training, since the text in this application is unordered.
320
+
321
+ ![](images/330946bb7dcbf02917794a98c168e5aef01780c17fee4188796103aa1971d0ff.jpg)
322
+ Figure A.2: Sample document for Word2Vec for the Ocean’s Eleven movie
323
+
324
+ Feat2Vec Feature representation in Feat2Vec requires a feature extraction function for each feature type. Here, we explain how we build these functions:
325
+
326
+ • Bag of categories, categorical, and boolean: For all of the categorical variables, we learn a unique $r$ -dimensional embedding for each entity using a linear fully-connected layer (Equation 4). We do not require one-hot encodings, and thus we allow multiple categories to be active; resulting in a single embedding for the group that is the sum of the embeddings of the subfeatures. This is ordering-invariant: the embedding of “Brad Pitt” would be the same when he appears in a movie as a principal cast member, regardless whether he was 1st or 2nd star. Though, if he were listed as a director it may result in a different embedding.
327
+
328
+ • Text: We preprocess the text by removing non alpha-numeric characters, stopwords, and stemming the remaining words. We then follow the same approach that we did for categorical variables, summing learned word embeddings to a “title embedding” before interacting. It would be easy to use more sophisticated methods (e.g, convolutions), but we felt this would not extract further information.
329
+
330
+ • Real-valued: For all real-valued features, we pass these features through a 3-layer feedforward fully connected neural network that outputs a vector of dimension $r$ , which we treat as the feature’s embedding. Each intermediate layer has $r$ units with $\mathtt { r e l u }$ activation functions. These real-valued features highlight one of the advantages of the Feat2Vec algorithm: using a numeric value as an input, Feat2Vec can learn a highly nonlinear relation mapping a real number to our high-dimensional embedding space. In contrast, Word2Vec would be unable to know ex ante that an IMDB rating of 5.5 is similar to 5.6.
331
+
332
+ # A.2 DISTRIBUTION OF IMDB DIRECTOR RANKINGS
333
+
334
+ Figure A.3 shows the full distribution of rankings of the IMDB dataset, rather than summary statistics, in the form of a Cumulative Distribution Function (CDF) of all rankings calculated in the test dataset. The graphic makes it apparent for the vast majority of the ranking space, the rank CDF of Feat2Vec is to the left of CBOW, indicating a greater probability of a lower ranking under Feat2Vec. This is not, however, the case at the upper tail of ranking space, where it appears CBOW is superior.
335
+
336
+ However, when we zoom-in on the absolute upper region of rankings (1 to 25), which might be a sensible length of ranks one might give as actual recommendatiosn, it is the case that up until rank 8 or so, Feat2Vec outperforms CBOW still. Intermediate rankings are still strong signals that our Feat2Vec algorithm is doing a better job of extracting information into embeddings, particularly those entities that appear sparsely in the training data and so are especially difficult to learn.
337
+
338
+ ![](images/fe8ebcf2f1729c2c77fccf48acc7e972098c21fdd9cc58b0c0592dc3fc7497e5.jpg)
339
+ Figure A.3: Cumulative Distribution Function of Director Rankings (With Zoom-in to Top 25 Ranks)
340
+
341
+ # A.3 PROOF TO THEOREM 1
342
+
343
+ Theorem 1. The gradient for learning embeddings with Feat2Vec is a convex combination of the gradient from n targeted Factorization Machines for each feature in the data when each feature group is a singleton, where n is the total number of features in the dataset.
344
+
345
+ Proof. Let $S _ { \kappa _ { i } } ^ { + }$ denote the positively labeled records whose corresponding negative samples resample feature $\kappa _ { i }$ . For convenience, suppress the inclusion of learned parameters θ in the notation in this section while understanding the feature extraction functions $\vec { \phi }$ implicitly include these parameters. We can express the loss function $L ( . )$ , the binary cross-entropy of the data given the Feat2Vec model, as follows:
346
+
347
+ $$
348
+ \begin{array} { r l } { L ( S ^ { + } | \vec { \phi } ) = \displaystyle \frac { 1 } { | S ^ { + } | } \sum _ { \tau ^ { \prime } \in S ^ { + } } \Big ( \log ( \tilde { \rho } ( y | \vec { \phi } - 1 | \vec { \phi } , \vec { x } ^ { + } ) ) + \underbrace { \sum _ { \tau ^ { \prime } \in S ^ { + } } ^ { \vec { K } } \log ( | \vec { \rho } ( y = 0 | | \vec { \phi } , \vec { x } ^ { - } ) ) } _ { \tau ^ { \prime } - \tau < 2 ( | \vec { x } ^ { + } - \vec { x } ^ { + } | ) ^ { \tilde { \phi } } ( \vec { x } ^ { + } ) } \Big . } & { } \\ { = \frac { 1 } { | S ^ { + } | } \sum _ { \tau ^ { \prime } \in S ^ { + } } \Big ( \log ( \tilde { \rho } ( y | \vec { \phi } - 1 | \vec { \phi } , \vec { x } ^ { + } ) , \vec { x } ^ { + } + S _ { \tau , y } ^ { + } ) \rho ( \vec { x } ^ { + } \in S _ { \tau , x } ^ { + } ) ) } \\ { + \underbrace { \sum _ { \tau ^ { \prime } \in S ^ { + } } ^ { \vec { K } } \log ( \tilde { \rho } ( y = 0 | \vec { \phi } , \vec { x } ^ { - } , \vec { x } ^ { + } \in S _ { \tau , y } ^ { + } ) \rho ( \vec { x } ^ { + } \in S _ { \tau , x } ^ { + } ) ) } _ { \tau ^ { \prime } - \tau ^ { \prime } ( | \vec { x } ^ { + } | ) ^ { \tilde { \phi } } ( \vec { x } ^ { + } \in S _ { \tau , x } ^ { + } ) } \Big ) } & { } \\ - \displaystyle \frac { 1 } { | S ^ { + } | } \sum _ { \tau ^ { \prime } \in S ^ { + } } ^ { \vec { K } } \log ( \log ( \frac { e ^ { - i ( \tau ^ { + } \cdot \vec { \phi } ) } p | \vec { x } ^ { \top } \in S _ { \tau , y } ^ { + } } { e ^ { i ( \tau ^ { + } \cdot \vec { \phi } ) } + P _ { 0 } ( | \vec { x } ^ { + } | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \tau , x } ^ { + } ) } \\ + \underbrace \sum _ { \tau ^ { \prime } \in S ^ { + } } ^ \vec \end{array}
349
+ $$
350
+
351
+ Note now that $P _ { \mathcal { Q } } ( \vec { x } | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + } )$ is simply the probability of the record’s feature value $\vec { x } _ { f }$ under the second step noise distribution $\mathcal { Q } _ { 2 } ( \mathrm { X } _ { \mathrm { f } } , \alpha _ { 2 } )$ : $P _ { \mathcal { Q } } ( \vec { x } | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + } ) = P _ { \mathcal { Q } _ { 2 } } ( \vec { x } _ { f } )$
352
+
353
+ $$
354
+ \begin{array} { r l } & { = \displaystyle \frac { 1 } { | S ^ { + } | } \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { \bar { x } ^ { + } \in S _ { \star _ { i } } ^ { + } } \Big ( \log ( \frac { e ^ { s ( \bar { x } ^ { + } , \bar { \phi } ) } p ( \bar { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + } ) } { e ^ { s ( \bar { x } ^ { + } , \bar { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { \kappa _ { i } } ^ { + } ) } ) + \frac { k } { \bar { x } ^ { - } \sim Q ( \cdot | \vec { x } ^ { + } , i \in S _ { \star _ { i } } ^ { + } ) } \log ( \frac { P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) p ( \bar { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + } ) } { e ^ { s ( \bar { x } ^ { - } , \bar { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) ) } \Big ) } \\ & { = \displaystyle \frac { 1 } { | S ^ { + } | } \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { \bar { x } ^ { + } \in S _ { \star _ { i } } ^ { + } } \Big ( \log ( \frac { e ^ { s ( \bar { x } ^ { + } , \bar { \phi } ) } } { e ^ { s ( \bar { x } ^ { + } , \bar { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { \kappa _ { i } } ^ { + } ) } ) + \log ( p ( \bar { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + } ) ^ { k + 1 } ) } \\ & { \quad + \left. \frac { k } { \bar { x } ^ { - } \sim Q ( \cdot | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \star _ { i } } ^ { + } ) } \log ( \frac { P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) } { e ^ { s ( \bar { x } ^ { - } , \bar { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) } ) \right) } \end{array}
355
+ $$
356
+
357
+ We now drop the term containing the probability of assignment to a feature group $p ( \vec { x } ^ { + } \in S _ { \kappa _ { i } } ^ { + }$ ) since it is outside of the learned model parameters $\vec { \phi }$ and fixed in advance:
358
+
359
+ $$
360
+ \begin{array} { c } \displaystyle \propto \displaystyle \frac { 1 } { | S ^ { + } | } \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { \vec { x } ^ { + } \in S _ { \mathbf { * } _ { i } } ^ { + } } \left( \log ( \frac { e ^ { s ( \vec { x } ^ { + } , \vec { \phi } ) } } { e ^ { s ( \vec { x } ^ { + } , \vec { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { \mathbf { * } _ { i } } ^ { + } ) } ) + \displaystyle \sum _ { \vec { x } ^ { - } \sim Q ( \cdot , | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \mathbf { * } _ { i } } ^ { + } ) } ^ { k } \log ( \frac { P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) } { e ^ { s ( \vec { x } ^ { - } , \vec { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { f } ^ { - } ) } ) \right) \nonumber _ { \vec { x } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { + } \sim \mathbb { S } _ { \mathbf { \ * } ^ { - } \mathbb { S } _ { \mathbf { \ * } ^ { - } \mathbb { S } _ { \mathbf { \ * } ^ { - } \mathbb { S } _ { \mathcal \delta } } } } } } } } } } } } \\ \displaystyle \xrightarrow [ { \vec { x } ^ { + } | \to \infty } ] { n } p ( \vec { x } ^ { + } \in S _ { \mathbf { \star } _ { i } } ^ { + } ) E \Big [ \log ( \frac { e ^ { s ( \vec { x } ^ { + } , \vec { \phi } ) } } { e ^ { s ( \vec { x } ^ { + } , \vec { \phi } ) } + P _ { Q _ { 2 } } ( \vec { x } _ { \mathbf { \star } _ { i } } ^ { + } ) } ) + \sum _ { \vec { x } ^ { - } \sim Q ( \cdot , | \vec { x } ^ { + } , \vec { x } ^ { + } \in S _ { \mathbf { \star } _ { i } } ^ { + } ) } ^ { k } \ \end{array}
361
+ $$
362
+
363
+ Thus, the loss function is just a convex combination of the loss functions of the targeted classifiers for each of the $p$ features, and by extension so is the gradient since:
364
+
365
+ $$
366
+ \frac { \partial } { \partial \phi } \sum _ { i = 1 } ^ { n } p ( \vec { x } ^ { + } \in S _ { \mathrm { \bf { k } } _ { i } } ^ { + } ) E \Big [ L ( \vec { x } | \vec { \phi } , \mathrm { t a r g e t } = f ) \Big ] = \sum _ { i = 1 } ^ { n } p ( \vec { x } ^ { + } \in S _ { \mathrm { \bf { k } } _ { i } } ^ { + } ) \frac { \partial } { \partial \phi } E \Big [ L ( \vec { x } | \vec { \phi } , \mathrm { t a r g e t } = f ) \Big ]
367
+ $$
368
+
369
+ Thus the algorithm will, at each step, learn a convex combination of the gradient for a targeted classifier on feature $f$ , with weights proportional to the feature group sampling probabilities in step 1 of
370
+
371
+ the sampling algorithm. Note that if feature groups are not singletons, the gradient from unsupervised Feat2Vec will analogously be a convex combination of $n$ gradients learned from supervised learning tasks on each of the $n$ feature groups. □
372
+
373
+ # B FEATURE EXTRACTION NETWORK FOR NATURAL LANGUAGE
374
+
375
+ ![](images/71766fd860ac992bd9f8f7e92e427018a951fd40442b3983d9ec580cd9dd0aa9.jpg)
376
+ Figure A.4: Feature extraction network used for labelling tasks. We use $\mathrm { f } { = } 1 0 0 0$ convolutional filters each of width 3 (words)
377
+
378
+ Here we describe the details of the feature extraction function $\phi$ used in our experiments for supervised tasks in $\ S 4 . 1$ . An overview of the network is given in Fig. A.4. We choose the most common words of each dataset to build a vocabulary of size $n$ , and convert the words of each document to a sequence of length $t$ of one-hot encodings of the input words. If the input text is shorter than $t$ , then we pad it with zeros; if the text is longer, we truncate it by discarding the trailing words. Therefore, for a vocabulary size $n$ , the input has dimensions $t \times n$ . These $t \times$ dimensional matrix is then passed through the following layers:
379
+
380
+ 1. We use an embedding layer to assign a $d$ -dimensional vector to each word in the input passage of text. This is done through a $d \times n$ -dimensional lookup table, which results in an $t \times d$ matrix.
381
+ 2. We extract features from the embeddings with functions called convolutional filters (LeCun et al., 1998) (also called feature maps). A convolutional filter is simply a matrix learned from an input. We learn $f$ filters that are applied on groups of $m$ adjacent word embeddings, thus each of our filters is a $d \times m$ matrix of learned parameters. Filters are applied by computing the element-wise dot product of the filter along a sliding window of the entire input. The resulting output for each filter is a vector of length $t - m + 1$ . We also apply a ReLU activation to the output of each filter.
382
+ 3. Consider the case of inputs of different lengths. For very short texts, the output of the filters will be mostly zero since the input is zero-padded. To enforce learning from the features of the text, and not just its length we apply a function called 1-max pooling to the output of the filters: from the $t - m + 1$ output vector of each filter, we select the maximum value. This yields a vector of length $F$ , a representation of the passage which is independent of its length.
383
+ 4. We learn higher-level features from the convolutional filters. For this, we use a fully connected layer with $p$ units and a ReLU activation,
384
+ 5. During training (not in inference), we prevent the units from co-adapting too much with a dropout layer (Srivastava et al., 2014). Dropout is a form of regularization that for each mini-batch randomly drops a specified percentage of units.
385
+ 6. the final embedding for $x _ { j }$ (that is used in the factorization) is computed by a dense layer with $r$ output units and an activation function, where $r$ is the embedding size of our indexable items.
386
+
387
+ We set the maximum vocabulary size $n$ to 100,000 words, and input embedding size $d$ to 50 for all experiments. We initialize the input word embeddings and the label embeddings using
388
+
389
+ Word2Vec(Mikolov et al., 2013) We have have not evaluated multiple architectures or hyperparameter settings and obtain good results on diverse datasets with the same architecture, which was designed followed recommendations from a large scale evaluation of CNN hyper parameters(Zhang & Wallace, 2015). We set the number of convolutional filters $f$ to 1,000, and the dropout rate to 0.1. The maximum sequence length $t$ was chosen according to the typical document length (350 words for CiteULike and 250 for Yelp). For the CTR dataset, because we use very small values of $r$ , due to the tendency of the ReLU units to‘die’ during training (output zero for all examples), which can have a significant impact, we used instead PReLU activations (He et al., 2015) for the final layer, since they do not suffer from this issue.
390
+
391
+ # B.1 FEATURE EXTRACTION FOR DEEPCONN COMPARISON
392
+
393
+ The CNN architecture used for DeepCoNN (Zheng et al., 2017) is similar to the previous section. It consists of a word embedding lookup table, convolutional layer, 1-max pooling and a fully connected layer. We use the hyper-parameters that the authors report as best - 100 convolution filters and 50 units for the fully connected layer. We set the word embedding size to 100, the vocabulary size to 100,000 and the maximum document length to 250.
394
+
395
+ # C HYPER-PARAMETERS FOR CTR
396
+
397
+ To compare Feat2Vec with Collaborative Topic Regression, we choose the embedding size $r \in$ $\{ 5 , 1 0 , { \bar { 1 } } 5 \}$ for which CTR performs best. The results are show in Table A.2.
398
+
399
+ Table A.2: Tuning embedding size for CTR
400
+
401
+ <table><tr><td></td><td>r=5</td><td>r=10</td><td>r=15</td><td>Time (mins.)</td></tr><tr><td>Matrix Fact.</td><td>0.8723</td><td>0.8911</td><td>0.9046</td><td>1</td></tr><tr><td>Feat2Vec</td><td>0.9081</td><td>0.9303</td><td>0.9401</td><td>133</td></tr><tr><td>C.T.R</td><td>0.8763</td><td>0.9234</td><td>0.9356</td><td>1425</td></tr></table>
md/train/ryeK6nNFDr/ryeK6nNFDr.md ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EFFECTIVE AND ROBUST DETECTION OF ADVER-SARIAL EXAMPLES VIA BENFORD-FOURIER COEFFI-CIENTS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Adversarial examples have been well known as a serious threat to deep neural networks (DNNs). To ensure successful and safe operations of DNNs on realworld tasks, it is urgent to equip DNNs with effective defense strategies. In this work, we study the detection of adversarial examples, based on the assumption that the output and internal responses of one DNN model for both adversarial and benign examples follow the generalized Gaussian distribution (GGD), but with different parameters (i.e., shape factor, mean, and variance). GGD is a general distribution family to cover many popular distributions (e.g., Laplacian, Gaussian, or uniform). It is more likely to approximate the intrinsic distributions of internal responses than any specific distribution. Besides, since the shape factor is more robust to different databases rather than the other two parameters, we propose to construct discriminative features via the shape factor for adversarial detection, employing the magnitude of Benford-Fourier coefficients (MBF), which can be easily estimated using responses. Finally, a support vector machine is trained as the adversarial detector through leveraging the MBF features. Through the Kolmogorov-Smirnov (KS) test (Massey Jr (1951)), We empirically verify that: 1) the posterior vectors of both adversarial and benign examples follow GGD; 2) the extracted MBF features of adversarial and benign examples follow different distributions. Extensive experiments in terms of image classification demonstrate that the proposed detector is much more effective and robust on detecting adversarial examples of different crafting methods and different sources, in contrast to state-of-the-art adversarial detection methods.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep neural networks (DNNs) have achieved a remarkable success in many important applications, such as image classification, face recognition, object detection, etc. In the meanwhile, DNNs have been shown to be very vulnerable to adversarial examples. However, many real-world scenarios have very restrictive requirements about the robustness of DNNs, such as face verification for login, or semantic segmentation in autonomous driving. Adversarial examples are a serious threat to the applications of DNNs to these important tasks. Since many kinds of adversarial attack methods have been proposed to fool DNNs, it is more urgent to equip effective defensive strategies to ensure the safety of deep models in real-world applications. However, defense seems to be more challenging than attack, as it has to face adversarial examples from unknown crafting methods and unknown data sources. Typical defensive strategies include adversarial training, adversarial de-noising, and adversarial detection. Compared to the former two strategies, adversarial detection is somewhat more cost-effective, as it often does not need to re-train or modify the original DNN model.
12
+
13
+ There are two main challenges for adversarial detection. (1) The adversarial examples are designed to camouflage themselves to be close to the corresponding benign examples in the input space. Then, where and how to extract the discriminative information to train the detector? (2) The data sources and the generating methods of adversarial examples are often inaccessible to the detector. In this case, the detector can be stably effective across different data sources and different attack methods? In other words, a good adversarial detector is required to be not only effective to distinguish adversarial and benign examples, but also robust to different data sources and attack methods.
14
+
15
+ To satisfy the first requirement of effectiveness, we utilize the other principle of crafting adversarial examples that the outputs between benign and adversarial examples should be large, to encourage the change of the final prediction. It means that the imperceptible difference between benign and adversarial examples in the input space is enlarged along the DNN model, leading to the significant difference in the output space. Inspired by this fact, we assume that the output or the responses of internal layers of the DNN model should include the discriminative information for benign and adversarial examples. A few works have attempted to extract different types of discriminative features from the output or the internal responses, such as kernel density (KD) (Feinman et al. (2017)) and the local intrinsic dimensionality (LID) (Ma et al. (2018)), etc. To achieve the robustness, the extracted discriminative features should model the intrinsic difference between adversarial and benign examples, rather than the difference from the changes of data sources or attack methods. Many existing methods have shown the effectiveness to some extent on detecting adversarial examples of specific data sources and attack methods. However, their robustness, especially across different data sources, has not been well studied and verified.
16
+
17
+ In this work, we propose a novel detection method based on the assumption that the internal responses of both adversarial and benign examples follow the generalized Gaussian distribution (GGD) (Varanasi & Aazhang (1989)), but with different parameters, including the shape factor, mean, and variance. The rationale behind this assumption is that GGD covers many popular distributions with varied shape factors (such as Laplacian, Gaussian, or uniform distribution), such that GGD is more likely to approximate the intrinsic response distributions rather than one specific distribution. Moreover, mean and variance of GGD may vary significantly with respect to different classes and data sources, even for benign examples, while the shape factor is more robust. For example, the mean and variance of two Gaussian distributions could be totally different, but their shape factors are the same (i.e., 2). Thus, we propose to use the shape factor as an effective and robust discrimination between adversarial and benign examples. However, it is difficult to exactly estimate the shape factor in practice. We resort to the magnitude of Benford-Fourier coefficients (Pasquini et al. (2014)), which is a function of the shape factor. It can be easily estimated using internal responses, according to the definition of Fourier transform. Then, the magnitudes estimated from internal responses of different convolutional layers are concatenated as a novel representation. Finally, a support vector machine (SVM) (Vapnik (2013)) is trained using the new representations as the adversarial detector. Extensive experiments carried out on several databases verify the effectiveness and robustness of the proposed detection method. To further verify the rationale of our assumption, we present the empirical analysis through the Kolmogorov-Smirnov test (KS test) (Massey Jr (1951)). The KS test verifies that 1) the posterior vectors of both adversarial and benign examples predicted by the CNN model follow the distribution of GGD, but with different parameters, and 2) the MBF features of adversarial and benign examples follow different distributions, and the MBF features of adversarial examples crafted from different attack methods follow the same distribution, as well as that the MBF features of adversarial/benign examples from different data sources follow the same distribution. Moreover, we visualize the statistics (i.e., mean $\pm$ standard deviation) of the extracted MBF features for adversarial and benign examples. The visualization reveals the distinct difference between adversarial and benign examples. These empirical analysis demonstrates the effectiveness and robustness of the proposed MBF detector.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ In this section we focus on reviewing existing works about adversarial detection, while those of other adversarial defensive strategies are out of scope of this work.
22
+
23
+ The general idea of most existing detection methods is learning or constructing a new representation to discriminate adversarial and benign examples, utilizing the outputs or immediate responses of an original classification network. Li & Li (2017) trained a cascading classifier based on the principal component analysis (PCA) (Pearson (1901)) statistics of responses from each convolutional layer of the defended convolutional neural network (CNN) model. An example is recognized as benign if all single classifiers of the cascade predict it as benign, otherwise adversarial. Lu et al. (2017) proposed SafetyNet by adding a RBF-SVM classifier to detect adversarial examples, at the end of the original classification network. Metzen et al. (2017) proposed a detection network along with an original classification network, which takes the internal responses of the original network as inputs. It shows effectiveness on detecting adversarial examples generated by simple attacks (such as FGSM (Goodfellow et al. (2014)) and JSMA (Papernot et al. (2016))), while performs much worse when facing more advanced attacks (such as C&W (Carlini & Wagner (2017a))). It tells that this method is sensitive to attack methods. Grosse et al. (2017) attempted to detect adversarial examples using the statistical test of maximum mean discrepancy (MMD). Although above detection methods show effectiveness on some attack methods and some databases, but a thorough evaluation presented in Carlini & Wagner (2017b) has shown that these methods are sensitive to attack methods or databases, and they can be somewhat easily invaded by new attacks.
24
+
25
+ Some recent works proposed to utilize neighboring samples in the same database to construct a better representation of a current sample. Feinman et al. (2017) defined two metrics based on the responses of the final hidden layer of the classification neural network, including kernel density estimation (KDE) and Bayesian neural network uncertainty (BU). If the metric score of KDE/BU is lower/higher than a pre-defined threshold, then the example is predicted as adversarial. Ma et al. (2018) utilized the local intrinsic dimensionality (LID) to measure the characterization of adversarial regions of DNNs. LID describes the distance between one example and its $k$ -nearest neighboring sample in the feature space of immediate responses of the original classification network. The distances computed from different layers are concatenated as the example representation, which is then used to train a shallow classifier to discriminate adversarial and benign examples. Zheng & Hong (2018) defined the intrinsic hidden state distribution (IHSD) of the responses of the original classification network to model different classes. The Gaussian mixture model (GMM) was used to approximate IHSD of each class. Then, the posterior probability of one sample assigned to GMM is computed as the metric. If the probability is lower than a pre-defined threshold, then it is recognized as adversarial. Lee et al. (2018) computed the class-conditional Gaussian distribution of the responses of the original classification network based on the whole training set. Then, the Mahalanobis distance between one sample and its nearest class-conditional Gaussian distribution is used as the metric for detection. If the distance is larger than a pre-defined threshold, then it is detected as adversarial. Compared to some aforementioned single-representation-based detection methods, these joint-representation-based methods showed better performances on some databases. However, the detection cost for each example is much higher, as the responses of its neighboring samples should also be computed. Besides, since the representation is highly dependent on the neighbors or all training examples, the detection performance may be sensitive to data sources, which will be studied in later experiments.
26
+
27
+ There are also some other approaches that do not construct representations from the responses of the original classification network. Hendrycks & Gimpel (2016) adopted PCA statistics to discriminate adversarial and benign images, independent of any DNN model. However, the study presented in Carlini & Wagner (2017b) has demonstrated that this method works for MNIST but not for CIFAR-10, and PCA statistics are not robust features to detect adversarial images. Pang et al. (2018) proposed a novel loss called reverse cross-entropy (RCE) to train the classification network, such that the distance measured by kernel density (Feinman et al. (2017)) between adversarial and benign examples could be enlarged. Samangouei et al. (2018) proposed Defense-GAN to model the distribution of benign examples using a generative adversarial network (GAN). If the Wasserstein distance between one example and its corresponding example generated by the GAN is larger than a pre-defined value, then it is detected as adversarial. However, these above three methods are much more costly than other detection methods.
28
+
29
+ # 3 PRELIMINARIES
30
+
31
+ # 3.1 GENERALIZED GAUSSIAN DISTRIBUTION
32
+
33
+ Assume that a random variable $\mathcal { X } ~ \in ~ \mathbb { R } ^ { d }$ follows the generalized Gaussian distribution (GGD) (Varanasi $\&$ Aazhang (1989)). Then, its probability density function (PDF) is formulated with two positive parameters, including the shape factor $c$ and the standard deviation $\sigma$ , as follows
34
+
35
+ $$
36
+ \mathcal { P } _ { \mathcal { X } } ( x ) = A \cdot e ^ { - \lvert \beta x \rvert ^ { c } } ,
37
+ $$
38
+
39
+ where β = 1σ Γ(3/c)Γ(1/c)  and $\begin{array} { r } { A = \frac { \beta c } { 2 \Gamma ( 1 / c ) } } \end{array}$ , with $\Gamma ( \cdot )$ being the Gamma function. Note that the mean parameter $\mu$ is omitted above, as $\mu$ has no relation with the shape of distribution and we set it as 0 without loss of generality. A nice characteristic of GGD is that it covers many popular distributions
40
+
41
+ with varied shape factors. For example, when $c = 1$ , then it becomes the Laplacian distribution; when $c = 2$ , then it is the Gaussian distribution with a variance of √ √ $\sigma ^ { 2 }$ ; when $c \to + \infty$ , then it is specified as a uniform distribution on $( - \sqrt { 2 } \sigma , \sqrt { 2 } \sigma )$ .
42
+
43
+ # 3.2 BENFORD-FOURIER COEFFICIENTS
44
+
45
+ Although generalized Gaussian distribution (GGD) is able to cover a bunch of distributions, it is hard to depict the exact forms of GGD precisely. To this end, we further define a random variable $\mathcal { Z } = \log _ { 1 0 } | \mathcal { X } |$ mod 1 for detecting and distinguishing different form of GGD, of which the PDF is formulated by means of Fourier Series as Perez-Gonz ´ alez et al. (2007), with the fundamental period ´ being fixed as $2 \pi$ ,
46
+
47
+ $$
48
+ \mathcal { P } _ { Z } ( z ) = 1 + 2 \sum _ { n = 1 } ^ { + \infty } \lfloor A _ { n } \cos { ( 2 \pi n z ) } + B _ { n } \sin { ( 2 \pi n z ) } \rfloor = 1 + 2 \sum _ { n = 1 } ^ { + \infty } \lfloor a _ { n } \rfloor \cos ( 2 \pi n z + \phi _ { n } ) ,
49
+ $$
50
+
51
+ where $z \in [ 0 , 1 )$ corresponds to the domain of random variable $\mathcal { Z }$ , the phase of Fourier Series is explained as $\begin{array} { r } { \phi _ { n } = \arctan \left( - \frac { B _ { n } } { A _ { n } } \right) } \end{array}$ , and the magnitude denotes $| a _ { n } | = \sqrt { A _ { n } ^ { 2 } + B _ { n } ^ { 2 } }$ . $a _ { n } = | a _ { n } | \cdot e ^ { j \phi _ { n } }$ denotes the $n$ -th Fourier coefficient of $\mathcal { P } _ { \mathcal { Z } } ( z )$ evaluated at $2 \pi n$ , and its definition is
52
+
53
+ $$
54
+ a _ { n } = \int _ { - \infty } ^ { + \infty } \mathcal { P } _ { \mathcal { Z } } ( z ) \cdot e ^ { - j 2 \pi n \log _ { 1 0 } z } d z = \frac { 2 A e ^ { \frac { j 2 \pi n \log \beta } { \log 1 0 } } } { \beta c } \cdot \Gamma \Bigg ( \frac { - j 2 \pi n + \log 1 0 } { c \log 1 0 } \Bigg ) .
55
+ $$
56
+
57
+ $a _ { n }$ is also called as Benford-Fourier coefficient. Note that $a _ { n }$ is a complex number, and its magnitude can be calculated as follows
58
+
59
+ $$
60
+ | a _ { n } | = \bigg ( \prod _ { k = 0 } ^ { + \infty } \bigg [ 1 + \big ( \frac { 2 \pi n } { \log 1 0 ( c k + 1 ) } \big ) ^ { 2 } \bigg ] ^ { - 1 } \bigg ) ^ { \frac { 1 } { 2 } } .
61
+ $$
62
+
63
+ Note that $\left| a _ { n } \right|$ gets smaller as $n \in \mathbb N$ increases. And, an interesting property of $\left| a _ { n } \right|$ is that it only depends on the shape factor $c$ , while is independent of the parameter $\sigma$ . Thus, one set of the absolute values of Benford-Fourier coefficients $\{ | a _ { n } | \} _ { n \in \mathbb { N } }$ correspond to one identical $c$ , i.e., one identical special distribution of GGD. In other words, we could use $\{ | a _ { n } | \} _ { n \in \mathbb { N } }$ as features or representations to discriminate different special distributions of GGD.
64
+
65
+ However, if it is often difficult to know or even estimate the shape factor $c$ , we cannot compute the value of $\left| a _ { n } \right|$ . But fortunately, recalling that $a _ { n }$ is the $n$ -th Fourier coefficient of $\mathcal { P } _ { \mathcal { Z } } ( z )$ evaluated at $2 \pi n$ , we can derive an easy estimation. Specifically, assume that $\mathbf { x } = \{ x _ { 1 } , \dots , x _ { M } \}$ is a set of $M$ i.i.d. points sampled from GGD with the same shape factor $c$ . Then, the corresponding BenfordFourier coefficients can be estimated as follows (Pasquini et al. (2014)):
66
+
67
+ $$
68
+ \hat { a } _ { n } = \frac { \sum _ { m = 1 } ^ { M } e ^ { - j 2 \pi n \log _ { 1 0 } | x _ { m } | } } { M } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \left[ \cos \left( 2 \pi n \log _ { 1 0 } | x _ { m } | \right) - j \sin \left( 2 \pi n \log _ { 1 0 } | x _ { m } | \right) \right] .
69
+ $$
70
+
71
+ The gap between $\hat { a } _ { n }$ and $a _ { n }$ is analyzed in Theorem 1. It tells that $\hat { a } _ { n }$ gets closer to $a _ { n }$ as $M$ increases. For clarity, we firstly introduce a few notations: $\mathcal { T } = e ^ { - j 2 \pi n \log _ { 1 0 } | \mathcal { X } | }$ is a random variable with $\mathcal { X }$ obeying the generalized Gaussian distribution, and $\hat { a } _ { n }$ is an observation of the random variable $\begin{array} { r } { \mathcal { Y } = \bar { \frac { 1 } { M } } \bar { \sum _ { m = 1 } ^ { M } } \mathcal { T } _ { m } } \end{array}$ . Due to the space limit, the proof will be presented in supplementary material.
72
+
73
+ Theorem 1 Assume that the estimation error $\varepsilon _ { n } = { \hat { a } } _ { n } - a _ { n }$ is an observation of the random variable $\mathcal { E } = \mathcal { V } - a _ { n }$ . $| \mathcal { E } |$ follows the Rayleigh distribution (Papoulis & Pillai (2001)), of which the probability density function $( P D F )$ is formulated as
74
+
75
+ $$
76
+ \mathcal { P } _ { | \mathcal { E } | } \left( r \right) = 2 M r e ^ { - M r ^ { 2 } } .
77
+ $$
78
+
79
+ And the expectation and variance are respectively shown as follows:
80
+
81
+ $$
82
+ E { \bigl ( } | { \mathcal { E } } | { \bigr ) } = { \frac { 1 } { 2 } } { \sqrt { \frac { \pi } { M } } } , D ( | { \mathcal { E } } | ) = { \frac { 4 - \pi } { 4 M } } ,
83
+ $$
84
+
85
+ which implies that the estimation error $\varepsilon _ { n }$ gets closer to $\boldsymbol { \theta }$ as the number of samples M increases.
86
+
87
+ # 4 ADVERSARIAL DETECTION VIA BENFORD-FOURIER COEFFICIENTS
88
+
89
+ # 4.1 TRAINING PROCEDURE OF ADVERSARIAL DETECTOR
90
+
91
+ There are three stages to train the proposed adversarial detector, including: 1) building a training set based on benign images; 2) extracting novel representations of the training set via Benford-Fourier coefficients; 3) training a SVM classifier as the adversarial detector. They will be explained in details sequentially. And, the overall training procedure is briefly summarized in Algorithm 1.
92
+
93
+ Build a training set. Firstly, we collect $N$ clean images $\left\{ \mathbf { x } _ { 1 } , \dotsc , \mathbf { x } _ { N } \right\}$ , which can be correctly predicted by $f _ { \theta }$ . Then, we adopt one adversarial attack method (e.g., C&W (Carlini & Wagner (2017a)) or BIM ( Kurakin et al. (2016))) to generate one adversarial image corresponding to each clean image. The crafted $N$ adversarial examples are denoted as $\big \{ \hat { \mathbf { x } } _ { 1 } , \dotsc , \hat { \mathbf { x } } _ { N } \big \}$ . Besides, to avoid that the noisy image (polluted by some kind of non-malicious noises but still can be correctly predicted by $f _ { \theta } )$ is incorrectly detected as adversarial, we also craft one noisy image by adding small random Gaussian noises onto each clean image. These $N$ noisy examples are denoted as $\left\{ bar { \mathbf { x } } _ { 1 } , \ldots , \bar { \mathbf { x } } _ { N } \right\}$ . Note that, hereafter benign examples include both clean and Gaussian noisy examples. Consequently, we obtain one training set with $3 N$ examples, denoted as $\mathcal { D } _ { t r } = \{ ( \mathbf { x } _ { i } , - 1 \bar { ) } , ( \bar { \mathbf { x } } _ { i } , \bar { { ~ - } 1 } ) , ( \hat { \mathbf { x } } _ { i } , + 1 \bar { ) } \} _ { i = 1 , \ldots , N }$ .
94
+
95
+ Extract novel representations. We firstly feed the $i$ -th training image from $\mathcal { D } _ { t r }$ into $f _ { \theta }$ . We concatenate all response entries of the $l$ -th layer in $f _ { \theta }$ to obtain one vector $\mathbf { r } _ { i } ^ { l }$ . Then, we estimate the corresponding Benford-Fourier coefficients according to Eq. (5), as follows
96
+
97
+ $$
98
+ ( \hat { a } _ { n } ) _ { i } ^ { l } = \frac { 1 } { M _ { i } ^ { l } } \sum _ { m = 1 } ^ { M _ { i } ^ { l } } e ^ { - j 2 \pi n \log _ { 1 0 } | ( r _ { m } ) _ { i } ^ { l } | } ,
99
+ $$
100
+
101
+ where $M _ { i } ^ { l }$ indicates the length of $\mathbf { r } _ { i } ^ { l }$ . The magnitude of $( \hat { a } _ { n } ) _ { i } ^ { l }$ is computed as follows
102
+
103
+ $$
104
+ | ( \hat { a } _ { n } ) _ { i } ^ { l } | = \frac { 1 } { M _ { i } ^ { l } } \sum _ { m = 1 } ^ { M _ { i } ^ { l } } \Bigg ( \cos ^ { 2 } \left( 2 \pi n \log _ { 1 0 } | ( r _ { m } ) _ { i } ^ { l } | \right) + \sin ^ { 2 } \left( 2 \pi n \log _ { 1 0 } | ( r _ { m } ) _ { i } ^ { l } | \right) \Bigg ) ^ { \frac { 1 } { 2 } } .
105
+ $$
106
+
107
+ Then, we extract one $T$ -dimensional feature vector $\mathbf { a } _ { i } ^ { l } = [ | ( \hat { a } _ { 1 } ) _ { i } ^ { l } | , \dots , | ( \hat { a } _ { T } ) _ { i } ^ { l } | ] \in \mathbb { R } _ { + } ^ { T }$ for the $i$ -th training image from the $l$ -th layer. We set $T = 1 6$ in experiments, as $| ( \hat { a } _ { n } ) _ { i } ^ { l } |$ of larger $n$ is too small for discrimination. Finally, we concatenate the feature vectors of all layers to form a long vector $\hat { \mathbf { a } } _ { i } = [ \hat { \mathbf { a } } _ { i } ^ { 1 } ; \hdots ; \hat { \mathbf { a } } _ { i } ^ { L } ] \in \mathbb { R } _ { + } ^ { T \check { L } }$ , with $L$ being the number of layers in $f _ { \theta }$ . Consequently, we obtain a novel representation of the training set $\mathcal { D } _ { t r }$ , denoted as $\hat { \mathcal { A } } _ { t r } = \{ ( \hat { \bf { a } } _ { i } , \pm 1 ) \} _ { i = 1 , \dots , 3 N }$ , where the label of ${ \bf a } _ { i }$ (i.e., $+ 1$ or $^ { - 1 }$ ) is directly obtained from $\mathcal { D } _ { t r }$ .
108
+
109
+ Train an adversarial detector. Finally, we train a binary SVM classifier based on $\hat { A } _ { t r }$ . The trained SVM classifier will serve as the adversarial detector for the CNN model $f _ { \theta }$ .
110
+
111
+ Testing. One novel testing example is firstly predicted as adversarial or not by the trained adversarial detector . If adversarial, then it is rejected; otherwise, it is fed into $f _ { \theta }$ to predict its class label.
112
+
113
+ Remark. Note that in the derivation of $a _ { n }$ (see Eq. (3)), the mean parameter of GGD is set to 0. In experiments, we calculate the mean values of internal-layer responses of all networks for every image, and find that mean parameters at most layers are close to 0, while the mean parameters at a few layers could be large. However, the mean value is subtracted from each response entry when we extract the MBF features in our experiments. Thus, the derived $a _ { n }$ is applicable to our task. Besides, according to Theorem 1, the estimation error of $( \hat { a } _ { n } ) _ { i } ^ { l }$ is inversely proportional to $M _ { i } ^ { l }$ . It tells that the coefficient estimated from the larger-sized layer is more accurate. In many neural networks (e.g., AlexNet (Krizhevsky et al. (2012))), the response sizes of high layers get smaller, which means the less accurate estimation. However, we believe that the discrimination between adversarial and benign examples in higher layers is more evident than that in lower layers. There is a trade-off between estimation accuracy and discrimination. This is why we concatenate the estimated magnitudes of all layers together to construct the novel representation.
114
+
115
+ # 4.2 EXPERIMENTAL SETTINGS
116
+
117
+ Databases and network architectures We conduct experiments on three databases, including CIFAR-10 (Krizhevsky et al. (2014)), SVHN (Netzer et al. (2011)), and a subset of ImageNet (Deng
118
+
119
+ Algorithm 1 Training the adversarial detector via the magnitude of Benford-Fourier coefficients.
120
+
121
+ Require: The trained CNN model $f _ { \theta }$ with $L$ layers, and the training set $\mathcal { D } _ { t r }$
122
+
123
+ 1: for $i = 1$ to $| \mathcal { D } _ { t r } |$ do:
124
+ 2: for $l = 1$ to $L$ do:
125
+ 3: Compute $| ( \hat { a } _ { n } ) _ { i } ^ { l } |$ as Eq. (8), with $n = 1 , \dots , T$ ;
126
+ 4: Concatenate $\{ | ( \hat { a } _ { n } ) _ { i } ^ { l } | \} _ { n = 1 , \dots , T }$ to obtain a vector $\hat { \mathbf { a } } _ { i } ^ { l }$ ;
127
+ 5: end for
128
+ 6: Concatenate $\{ \hat { \mathbf { a } } _ { i } ^ { l } \} _ { l = 1 , \dots , L }$ to obtain a long vector $\hat { \mathbf { a } } _ { i }$ ;
129
+ 7: end for
130
+ 8: Build a novel representation of the training set, denoted as $\hat { \mathcal { A } } _ { t r } = \{ ( \hat { \mathbf { a } } _ { i } , \pm 1 ) \} _ { i = 1 , \dots , | \mathcal { D } _ { t r } | }$ ;
131
+ 9: Train a binary SVM classifier based on $\hat { A } _ { t r }$ ;
132
+ return The trained binary SVM classifier.
133
+
134
+ et al. (2009)). In terms of CIFAR-10 and SVHN, we adopt the same settings as the compared method LID (Ma et al. (2018)). Specifically, a 33-layer network pre-trained on the training set of CIFAR-10 achieves $8 2 . 3 7 \%$ accuracy on the testing set with 10, 000 benign images; a 19-layer network pretrained on the training set of SVHN achieves $9 2 . 6 \%$ accuracy on the testing set with 26, 032 benign images. Then, we add a small noise drawn from ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } )$ on each testing image, with $\sigma$ being the similar level of the $\ell _ { 2 }$ norm of adversarial perturbations on the same database. If both the benign and its noisy image can be correctly predicted by the classification network, then it is picked out for training the detection. We finally collect 8, 175 and 23, 862 benign images from CIFATR-10 and SVHN, respectively. These images are randomly partitioned to the $8 0 \%$ training set and the $2 0 \%$ testing set, used for the training and testing of the detector. We also collect a subset from ImageNet, including 800 benign images of 8 classes (snowbird, spoonbill, bobtail, Leonberg, hamster, proboscis monkey, cypripedium calceolus, and earthstar). The 100 images of each class contain 50 testing images and 50 randomly selected training images. We fine-tune the checkpoints of both AlexNet and VGG pre-trained on ImageNet1 on these 800 images to achieve $1 0 0 \%$ accuracy. Then, 785 benign images are kept for detection, as both their noisy images and themselves can be correctly predicted by both the fine-tuned AlexNet and VGG models. These 785 images are then randomly partitioned to 400 training and 305 testing images used for detection. For each database, as described in Section 4.1, one noisy and one adversarial image are generated for each benign image; then, all of benign, noisy, and adversarial images are used for detection.
135
+
136
+ Attack methods We adopt four popular adversarial attack methods to craft adversarial examples, including basic iterative method (BIM (Kurakin et al. (2016))), CarliniWagnerL2Attack (CW-L2 (Carlini & Wagner (2017a))), DeepFool ( (Moosavi-Dezfooli et al. (2016))), and random projected gradient descent (R-PGD (Madry et al. (2017))). They are implemented by Foolbox2.
137
+
138
+ Compared detection methods We compare with three state-of-the-art and open-sourced adversarial detection methods, including $\mathrm { K D + B U } ^ { 3 }$ (Feinman et al. (2017)), Mahalanobis distance4 (M-D) (Lee et al. (2018)), and $\mathrm { L I D } ^ { 5 }$ (Ma et al. (2018)). Note that another recent work called I-defender (Zheng & Hong (2018)) is not compared, as its code is not available. To ensure the fair comparison, the SVM classifier is trained with all compared methods, implemented by the fitcsvm6 function in MATLAB. There are two important hyper-parameters in LID, i.e., the size of mini-batch and the number of neighbors. On CIFAR-10 and SVHN, they are respectively set as 100 and 20, as suggested in Ma et al. (2018); on ImageNet, as there are only 400 benign training images, they are respectively set as 50 and 20 in experiments. Moreover, we find that there are some unfair settings in the implementations of compared methods. For example, $\mathrm { K D + B U }$ utilizes the extra 50, 000 images of CIFAR-10 to compute the kernel density of each training and testing image; M-D also uses these extra images to compute the mean and co-variance of GMM. Since extra images of the similar distribution with the training images are often unavailable, we believe that extra images should not be used to ensure the fair comparison. Thus, extra images are not used for $\mathrm { K D + B U }$ and M-D in our experiments. Besides,
139
+
140
+ Table 1: Detection results in the non-transfer case.
141
+
142
+ <table><tr><td rowspan="2">database</td><td rowspan="2">Detector</td><td colspan="4">AUROC(%)</td><td colspan="4">Accuracy (%)</td></tr><tr><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td rowspan="4">CIFAR-10</td><td>KD+BU (Feinman et al. (2017))</td><td>79.0</td><td>82.8</td><td>80.6</td><td>77.7</td><td>74.2</td><td>73.0</td><td>71.7</td><td>72.6</td></tr><tr><td>M-D (Lee et al. (2018))</td><td>51.7</td><td>48.4</td><td>53.7</td><td>52.0</td><td>66.7</td><td>66.7</td><td>66.7</td><td>66.7</td></tr><tr><td>LID (Ma et al. (2018))</td><td>87.9</td><td>87.4</td><td>86.6</td><td>82.7</td><td>72.6</td><td>78.5</td><td>78.0</td><td>70.2</td></tr><tr><td>MBF</td><td>99.6</td><td>99.6</td><td>96.9</td><td>99.4</td><td>98.8</td><td>98.3</td><td>91.8</td><td>98.5</td></tr><tr><td rowspan="3">SVHN</td><td>KD+BU (Feinman et al. (2017)) M-D (Lee et al. (2018))</td><td>81.5</td><td>85.1</td><td>84.1</td><td>82.5</td><td>78.6</td><td>80.0</td><td>79.3</td><td>78.6</td></tr><tr><td>LID (Ma et al. (2018))</td><td>49.7</td><td>50.0</td><td>49.6</td><td>50.1</td><td>66.7</td><td>66.7</td><td>66.7</td><td>66.7</td></tr><tr><td></td><td>91.7</td><td>88.7</td><td>92.2</td><td>90.5</td><td>83.3</td><td>80.8</td><td>84.0</td><td>81.5</td></tr><tr><td rowspan="3">ImageNet- AlexNet</td><td>MBF KD+BU (Feinman et al. (2017))</td><td>99.7</td><td>99.9</td><td>99.3</td><td>99.5</td><td>98.8</td><td>98.3</td><td>91.8</td><td>98.5</td></tr><tr><td>M-D (Lee et al. (2018))</td><td>50.8</td><td>52.6 60.1</td><td>51.1</td><td>51.5</td><td>34.4</td><td>36.8</td><td>34.9</td><td>35.3</td></tr><tr><td>LID (Ma et al. (2018))</td><td>48.1 71.7</td><td>70.9</td><td>46.5 71.9</td><td>54.1 72.3</td><td>66.7 68.7</td><td>66.6 60.5</td><td>66.8</td><td>66.7</td></tr><tr><td rowspan="4">ImageNet-</td><td>MBF</td><td>99.9</td><td>99.6</td><td>99.9</td><td>99.8</td><td>98.6</td><td>97.8</td><td>65.8 98.8</td><td>68.3</td></tr><tr><td>KD+BU (Feinman et al. (2017))</td><td>57.1</td><td>57.7</td><td>56.2</td><td>58.6</td><td>42.8</td><td>43.6</td><td>41.7</td><td>98.4</td></tr><tr><td>M-D (Lee et al. (2018))</td><td>63.7</td><td>64.8</td><td>45.9</td><td>66.9</td><td>67.1</td><td>65.6</td><td>66.7</td><td>44.8</td></tr><tr><td></td><td></td><td></td><td>89.5</td><td></td><td></td><td></td><td></td><td>67.4</td></tr><tr><td>VGG16</td><td>LID (Ma et al. (2018)) MBF</td><td>82.6 99.8</td><td>84.2 100.0</td><td>100.0</td><td>84.2 100.0</td><td>77.8 99.6</td><td>76.7 99.6</td><td>83.3 100.0</td><td>76.4 100.0</td></tr></table>
143
+
144
+ Table 2: Detection results evaluated by AUROC $( \% )$ in the attack-transfer case.
145
+
146
+ <table><tr><td rowspan="2">database</td><td>Test attack→</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>Trainattack</td><td colspan="3">KD+BU (Feinman et al. (2017))/M-D(Lee et al.(2018))/LID (Ma et al.(2018)/MBF</td><td></td></tr><tr><td>CIFAR-10</td><td>BIM CW-L2 DeepFool R-PGD</td><td>79.0/51.7787.9799.6 83.4/47.9/90.3/99.6 83.6/53.5 /89.7 /99.3 78.1/51.5/86.1/99.6</td><td>78.1/52.2/85.7799.4 82.8/48.4/87.4/99.6 83.1/51.4/86.1/99.1 77.3 /51.9 /84.5 /99.5</td><td>76.4/52.4/86.4/87.8 80.3 /46.5 /87.0 / 88.6 80.6/53.7/86.6/96.9</td><td>78.6/50.9/87.6/99.4 82.9/48.2/88.9/99.5 83.1/53.6/87.9/98.9 77.7/52.1/82.7/99.4</td></tr><tr><td>SVHN</td><td>BIM CW-L2 DeepFool R-PGD</td><td>81.5749.7791.7799.7 83.6/50.8/91.6/99.7 85.0/50.0/91.6/99.7 82.5 /49.9 /91.2 /99.6</td><td>83.1/51.0/88.3/99.7 85.1/50.0/88.7/99.9 86.3/ 50.0 /87.9 /99.8 84.0/49.5/87.8/99.6</td><td>75.8/52.4/84.9/88.3 80.1/48.8/91.9/97.5 82.5/49.7/92.0/97.3 84.1/49.6/92.2/99.3 81.2/50.2/91.6/97.4</td><td>81.5750.4/90.7799.5 83.6/49.1/90.8/99.7 85.0/49.4/90.8 /99.6 82.5/50.1/90.5 /99.5</td></tr><tr><td>ImageNet- AlexNet</td><td>BIM CW-L2 DeepFool R-PGD</td><td>50.8/48.1/71.7/99.9 52.3/50.7/69.7/99.8 51.8/53.6/71.3/99.9 51.6/52.4/72.5 /99.8</td><td>50.8/44.9/70.8/99.6 52.6/60.1/70.9/99.7 51.9/53.5/69.7/99.7 51.3/ 50.4/72.3/99.6</td><td>50.4/49.7772.1/99.8 51.2/52.1/66.0/99.7 51.2/46.5 /71.9 /99.9 50.3 /50.5 /72.2/99.7</td><td>50.7/50.4/70.8/99.8 52.2/55.8/69.8/99.8 51.8/51.2/71.2/99.8</td></tr><tr><td>ImageNet- VGG-16</td><td>BIM CW-L2 DeepFool R-PGD</td><td>57.1/63.7/82.6/99.8 57.3/64.3/81.9/100.0 58.7/45.5/ 80.2/99.7 58.6/62.3/81.1/100.0</td><td>57.1/57.2/84.3/99.5 57.7/64.8/84.2/100.0 59.4/46.1/79.1/99.3 58.9/60.8/83.7/100.0</td><td>53.8/54.4/90.4/100.0 53.8/56.6/90.2/100.0 56.2/45.9/89.5/100.0 55.3/54.4/90.8/100.0</td><td>51.5 /54.1/72.3 /99.8 57.1/65.4/84.2/100.0 57.5/67.6/84.3/100.0 59.0 /44.0/ 80.9 /99.7 58.6/66.9/84.2/100.0</td></tr></table>
147
+
148
+ Table 3: Detection results evaluated by accuracy $( \% )$ in the attack-transfer case.
149
+
150
+ <table><tr><td rowspan=1 colspan=1>database</td><td rowspan=1 colspan=1>Test attack→</td><td rowspan=1 colspan=5>BIM CW-L2 DeepFool R-PGDKD+BU(Feinman et al. (2017))/M-D(Lee et al. (2018))/LID (Ma et al. (2018)/MBF</td></tr><tr><td rowspan=2 colspan=1>CIFAR-10</td><td rowspan=2 colspan=1>BIMCW-L2DeepFoolR-PGD</td><td rowspan=2 colspan=1>74.2/66.7/72.6/98.874.2/66.7/80.3 /98.174.0/66.7 /80.4/95.273.1/66.7/77.7 /98.6</td><td rowspan=1 colspan=1>66.7</td><td rowspan=1 colspan=1>73.0/66.7 /78.5 /98.3 71.7 /66.7/77.9 /89.5</td><td rowspan=1 colspan=1>73.8/66.7/61.3/96.871.7 /66.7/77.9 /89.5 73.8 /66.7 /73.6 /98.2</td><td rowspan=2 colspan=1></td></tr><tr><td rowspan=1 colspan=1>66.7</td><td rowspan=1 colspan=1>71.9 / 66.7 /75.1/98.5 71.0 /66.7/75.4/89.7</td><td rowspan=1 colspan=1>73.4/66.7/74.8/95.471.0 /66.7/75.4/89.7 72.6/66.7/70.2/98.5</td></tr><tr><td rowspan=1 colspan=1>SVHN</td><td rowspan=1 colspan=1>BIMCW-L2DeepFoolR-PGD</td><td rowspan=1 colspan=4>78.6/66.77/83.3/98.7 80.5/66.7779.4/98.9 77.7/66.7/83.5/95.8 78.6/66.7/82.9/98.278.2/66.7/83.5 /98.0 80.0/66.7 /80.8/99.2 77.1/66.7/84.0 /95.9 78.1/66.7/80.7/97.379.8/66.7/83.9/98.0 81.8/66.7/79.9/98.4 79.3/66.7/84.0/97.3 79.9/66.7/80.7/98.078.6/66.7 /83.6 /98.6 80.5 / 66.7 /79.9/98.9 77.7 /66.7 /83.8/96.5 78.6/ 66.7 /81.5 /98.8</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>ImageNet-AlexNet</td><td rowspan=2 colspan=1>BIMCW-L2DeepFoolR-PGD</td><td rowspan=1 colspan=3>34.4/66.7/68.7798.6 34.4/66.6/68.6797.336.5/66.2/64.6/98.0 36.8/66.6/60.6/97.8 35.0 /66.1/60.7/98.1</td><td rowspan=2 colspan=1>34.3/66.7/65.0/98.435.0 /66.1/60.7/98.1 36.4/66.1/62.6/98.034.9/66.8/65.8/98.8 35.9 /66.6/68.3 /98.634.1/66.7/67.0/98.3 35.3/66.7/68.3/98.4</td><td rowspan=2 colspan=1></td></tr><tr><td rowspan=1 colspan=1>36.0 /66.7/69.4/98.835.4/66.7/67.5/98.5</td><td rowspan=1 colspan=1>66.8</td><td rowspan=1 colspan=1>35.2/66.7/67.7/97.6 34.1/66.7/67.0/98.3</td></tr><tr><td rowspan=2 colspan=1>ImageNet-VGG-16</td><td rowspan=2 colspan=1>BIMCW-L2DeepFoolR-PGD</td><td rowspan=2 colspan=1>42.8/67.1777.8/98.643.1/64.8/75.2/98.045.4/66.7 /76.2/98.844.8 /66.3/76.3/98.5</td><td rowspan=1 colspan=1>66.6</td><td rowspan=1 colspan=1>43.6/65.6/76.7 /97.8 38.4/ 62.5/82.5 /98.1</td><td rowspan=2 colspan=1>42.7/67.9/76.9/98.438.4/ 62.5/82.5 /98.1 43.3/67.2/73.9/98.041.8/66.7 /83.3/98.8 45.8 /66.7/74.4/98.640.6/64.9/82.4/98.3 45.8/67.4/76.4/98.4</td><td rowspan=2 colspan=1></td></tr><tr><td rowspan=1 colspan=1>66.7</td><td rowspan=1 colspan=1>45.4/66.6/74.1/97.6 40.6/64.9/82.4/98.3</td></tr></table>
151
+
152
+ LID utilizes other benign testing images as neighborhoods to extract features for each testing image. It is unfair to utilize the information of benign or adversarial for neighboring testing images. In our experiments, we use benign training images as neighborhoods for each testing image.
153
+
154
+ Three comparison cases and evaluation metrics We conduct experiments of three cases, including: 1) non-transfer, both training and testing adversarial examples are crafted by the same attack method; 2) attack-transfer, both training and testing adversarial examples are crafted by different attack methods; 3) data-transfer, both training and testing adversarial examples are crafted by the same attack method, but the data sources of training and testing benign examples are different. Two widely used metrics are used to evaluate the detection performance, including area under the receiver operating characteristics (AUROC), and detection accuracy, which is the diagonal summation of the confusion matrix, using 0.5 as the threshold of the posterior probability. Higher values of both metrics indicate better performance.
155
+
156
+ # 4.3 RESULTS
157
+
158
+ Detection results in the non-transfer case are shown in Table 1. The proposed MBF method shows the best performance in all cases, and is much superior to all compared methods. LID performs the second-best in most case. $\mathrm { K D + B U }$ gives somewhat good detection performance on CIFAR-10 and SVHN, but performs very poor on ImageNet. It tells that $\mathrm { K D + B U }$ is very sensitive to different databases and networks. M-D gives almost the degenerate results. Note that the results of M-D on
159
+
160
+ Table 4: Detection results evaluated by AUROC score $( \% )$ in the data-transfer case. All detectors are trained on the train set, and tested on the out-of-sample set (including 365 images) of the ImageNet database. The best results are highlighted in bold.
161
+
162
+ <table><tr><td></td><td colspan="4">ImageNet-AlexNet</td><td colspan="4">ImageNet-VGG-16</td></tr><tr><td>Detector</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>KD+BU</td><td>66.3</td><td>69.4</td><td>64.7</td><td>68.8</td><td>84.0</td><td>85.0</td><td>79.9</td><td>85.2</td></tr><tr><td>M-D</td><td>48.7</td><td>49.2</td><td>50.0</td><td>51.0</td><td>54.5</td><td>50.0</td><td>50.4</td><td>56.1</td></tr><tr><td>LID</td><td>69.1</td><td>67.6</td><td>72.9</td><td>71.4</td><td>84.2</td><td>88.4</td><td>89.2</td><td>83.7</td></tr><tr><td>MBF</td><td>99.1</td><td>99.0</td><td>99.6</td><td>99.4</td><td>99.3</td><td>99.5</td><td>99.3</td><td>99.5</td></tr></table>
163
+
164
+ Table 5: Attack Failure Rates $( \% )$ of adaptive attacks with different detectors. See context for details.
165
+
166
+ <table><tr><td></td><td>Original CW-L2</td><td>LID</td><td>MBF</td></tr><tr><td>CIFAR-10</td><td>0.0</td><td>88.4</td><td>100.0</td></tr><tr><td>SVHN</td><td>0.0</td><td>85.6</td><td>92.9</td></tr></table>
167
+
168
+ CIFAR-10 and SVHN reported in (Lee et al. (2018)) are very high, but their networks (i.e., ResNet (He et al. (2016)) and DenseNet (Huang et al. (2017)) are different from that used in our experiments. It implies that M-D may be suitable for very deep neural networks, but not for shallower networks.
169
+
170
+ Detection results in the attack-transfer case evaluated by AUROC and accuracy are presented in Tables 2 and 3, respectively. MBF still shows much better performance in all transfer cases than all compared methods, and the changes among detecting different attacks are very small. It verifies the robustness of MBF to different attacks.
171
+
172
+ We also conduct a data-transfer experiment on ImageNet. Specifically, we collect extra 365 images of 8 classes (same with the classes used for the detection training, see Section 4.2) through searching the class names in Baidu and Facebook. These 365 benign and their noisy images can be correctly predicted by both the fine-tuned AlexNet and VGG models. The results on these images are shown in Table 4. MBF still shows the best performance. And, compared to the corresponding results in Table 1, the AUROC/accuracy scores of MBF on detecting different attacks change very gently. It verifies the robustness of MBF to different data sources.
173
+
174
+ # 4.4 ADAPTIVE ATTACK AGAINST ADVERSARIAL DETECTION
175
+
176
+ Similar to Carlini & Wagner (2017b) and Ma et al. (2018), we also present an adaptive white-box attack, of which the goal is not only to fool the classifier, but also to evade the adversarial detector. It measures how easy to bypass the detector. Specifically, by combining the CW-L2 attack (Carlini & Wagner (2017a)) and the proposed MBF detector, the adaptive attack is formulated as follows:
177
+
178
+ $$
179
+ \operatorname * { a r g m i n } _ { \mathbf { x } _ { a d v } \in [ 0 , 1 ] } \| \mathbf { x } - \mathbf { x } _ { a d v } \| _ { 2 } ^ { 2 } + \alpha \cdot \big [ - l ( f _ { \theta } ( \mathbf { x } _ { a d v } ) , y ) + \| D ( f _ { \theta } ( \mathbf { x } _ { a d v } ) ) - D ( f _ { \theta } ( \mathbf { x } ) ) \| _ { 1 } \big ] ,
180
+ $$
181
+
182
+ where $\mathbf { x }$ denotes the clean input, $y$ indicates the ground-truth label. $l ( \mathbf { x } _ { a d v } , y )$ is the Hinge loss. $D ( f _ { \pmb { \theta } } ( \mathbf { x } _ { a d v } ) )$ represents the extracted features by the the detector $D$ (specified later), from $f _ { \pmb { \theta } } ( \mathbf { x } _ { a d v } )$ . The minimization of the $\ell _ { 1 }$ term $| | D ( f _ { \theta } ( \mathbf { x } _ { a d v } ) ) ^ { * } - D ( f _ { \theta } ( \mathbf { x } ) ) | | _ { 1 }$ encourages the detection features of adversarial and benign examples to be close, such that the detector could be evaded.
183
+
184
+ We conduct the above adaptive attack on both CIFAR-10 and SVHN. Specifically, 1000 clean examples are randomly selected from the test set of each database. For each generated adversarial example, if it fails to fool the classifier $f _ { \theta }$ , we record 1. The attack failure rate over all 1000 adversarial examples is computed as the metric. The higher rate indicates that it is more difficult to evade the detector. Since LID performs much better than $\mathrm { K D + B U }$ and M-D in above experiments, here we only compare LID and the proposed MBF detector. For clarity, the detection features are only extracted from the soft-max layer for both LID and MBF. The original CW-L2 attack (i.e., without the $\ell _ { 1 }$ term) is also presented as the baseline. With the same setting in (Ma et al. (2018)), the trade-off parameter $\alpha$ is determined by binary search within the range $[ \bar { 1 0 } ^ { - 3 } , 1 0 ^ { 6 } ]$ . The results are shown in Table 5. The attack failure rates of MBF on both databases are much higher than those of LID. It tells that it is more difficult to evade MBF than LID.
185
+
186
+ # 4.5 HYPOTHESIS TEST VIA KOLMOGOROV-SMIRNOV TEST
187
+
188
+ Kolmogorov-Smirnov test (KS test) (Massey Jr (1951)) is a non-parametric test method in statistics, to test whether a sample follows a reference probability distribution (one-sample KS test), or whether two samples follow the same distribution (two-sample KS test). Specifically, in one-sample KS test, the distance between the empirical distribution function of one sample and the cumulative distribution function of the reference probability distribution is measured. Then, the $p$ -value corresponding to the obtained distance is computed. If the $p$ -value is larger than the significance level $\alpha$ (here we set $\alpha = 0 . 0 5$ ), then the null hypothesis that the sample follows the reference distribution is accepted; otherwise, rejected. Similarly, in two-sample KS test, the distance between the empirical distribution functions of two samples is computed. If the corresponding $p$ -value is larger than $\alpha$ , then it accepts that two samples follow the same distribution. The KS test conducted below is implemented by the python function scipy.stats.ks 2samp7.
189
+
190
+ Table 6: The $p$ -value of KS hypothesis test among clean samples, noisy samples, and adversarial samples crafted by four methods, respectively, on ImageNet-AlexNet.
191
+
192
+ <table><tr><td>ImageNet-VGG-16</td><td>clean</td><td>noisy</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>train set</td><td>0.114</td><td>0.114</td><td>0.236</td><td>0.228</td><td>0.240</td><td>0.235</td></tr><tr><td>test set</td><td>0.114</td><td>0.114</td><td>0.231</td><td>0.228</td><td>0.239</td><td>0.232</td></tr></table>
193
+
194
+ Table 7: The $p$ -value of two-sample KS test among MBF coefficients of different types of examples.
195
+
196
+ <table><tr><td>ImageNet-VGG-16</td><td>(clean, noisy)</td><td>(clean,BIM)</td><td>(BIM,DeepFool)</td><td>(CW-L2,R-PGD)</td></tr><tr><td>train set</td><td>0.998</td><td>0.000</td><td>0.000</td><td>0.236</td></tr><tr><td>test set</td><td>1.000</td><td>0.000</td><td>0.000</td><td>0.225</td></tr></table>
197
+
198
+ Table 8: The $p$ -value of KS hypothesis test among MBF coefficients of different data sources.
199
+
200
+ <table><tr><td>ImageNet-VGG-16</td><td>clean</td><td>noisy</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>(train set,test set)</td><td>0.839</td><td>0.858</td><td>0.368</td><td>0.842</td><td>0.246</td><td>0.221</td></tr><tr><td>(train set, out-of-sample set)</td><td>0.049</td><td>0.054</td><td>0.094</td><td>0.407</td><td>0.737</td><td>0.088</td></tr></table>
201
+
202
+ Hypothesis test 1. Here we verify that whether the posterior vectors of both adversarial and benign examples follow GGD. We denote the posterior vector of one adversarial example as $\bf p \mathrm { _ { a d v } }$ , and that of one benign example as $\mathbf { p } _ { \mathrm { { b e n } } }$ . The distribution of GGD is denoted as ${ \mathcal { P } } _ { \mathrm { G G D } }$ . Then, we conduct two one-sample KS tests, including:
203
+
204
+ • H1.1 The test of adversarial examples: $H _ { 0 }$ : $\mathbf { p } _ { \mathrm { a d v } } \sim \mathcal { P } _ { \mathrm { G G D - a d v } }$ ; $H _ { 1 }$ : padv 6∼ PGGD-adv.
205
+ • H1.2 The test of benign examples: $H _ { 0 }$ : $\mathbf { p } _ { \mathrm { b e n } } \sim \mathcal { P } _ { \mathrm { G G D - b e n } }$ ; $H _ { 1 }$ : pben 6∼ PGGD-ben.
206
+
207
+ In H1.1, the reference distribution $\mathcal { P } _ { \mathrm { G G D - a d v } }$ is firstly estimated from $\mathbf { p } _ { \mathrm { a d v } }$ , using the estimated method proposed in (Lasmar et al. (2009)). To alleviate the uncertainty of the estimation, we draw 500 samples from the estimated $\mathcal { P } _ { \mathrm { G G D - a d v } }$ . Then, we conduct the two-sample KS test between $\mathbf { p } _ { \mathrm { a d v } }$ and these 500 samples respectively. The average $p$ -value over 1000 tests is recorded. The mean of the average $p$ -values over the whole database is reported. H1.2 is conducted similarly. The results tested on ImageNet-AlexNet are shown in Table 6. Due to the space limit, results on other databases and models will be presented in the supplementary material. In all cases, the $p$ -values are larger than the significance level 0.05. Hence, we can conclude that the posterior vectors of both adversarial and benign examples follow GGD. However, note that the parameters of their corresponding GGD are different, which will be verified in the following test.
208
+
209
+ Hypothesis test 2. Here we verify that whether the extracted MBF features of adversarial and benign examples follow the same empirical distribution. We denote the MBF feature vector of one adversarial example as $\mathbf { m _ { \mathrm { a d v } } }$ , and the corresponding empirical distribution is denoted as $\hat { \mathcal { P } } _ { \mathrm { a d v - M B F } }$ . Similarly, we define $\mathbf { m } _ { \mathrm { b e n } }$ and $\hat { \mathcal { P } } _ { \mathrm { b e n - M B F } }$ for benign examples. Then, we conduct the following four two-sample KS tests:
210
+
211
+ • H2.1 The test between adversarial and benign examples: $H _ { 0 }$ : $\hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } = \hat { \mathcal { P } } _ { \mathrm { b e n - M B F } }$ ; $H _ { 1 }$ : $\hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } \neq \hat { \mathcal { P } } _ { \mathrm { b e n - M B F } }$ .
212
+ • H2.2 The test between adversarial examples crafted from different attack methods: $H _ { 0 }$ : $\hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { a t t a c k - 1 } } = \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { a t t a c k - 2 } }$ ; $H _ { 1 } \colon \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { a t t a c k - 1 } } \neq \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { a t t a c k - 2 } }$ .
213
+ H2.3 The test between adversarial examples from different data sources (i.e., train, test and
214
+ out-of-sample set): $H _ { 0 }$ : $\begin{array} { r } { \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { s o u r c e - 1 } } = \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { s o u r c e - 2 } } } \end{array}$ ; $H _ { 1 } \colon \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { s o u r c e - 1 } } \neq \hat { \mathcal { P } } _ { \mathrm { a d v - M B F } } ^ { \mathrm { s o u r c e - 2 } }$ .
215
+
216
+ ![](images/e6e248dabc29baa792b249691b317cc1ab671db8b1d5f02fc3e9a7bc0e6db03a.jpg)
217
+ Figure 1: Statistics (mean $\pm$ standard deviation) of MBF coefficients on train (top row), test (median row), and out-of-sample (bottom row) set of ImageNet-VGG-16.
218
+
219
+ • H2.4 The test between benign examples from different data sources (i.e., train, test and out-of-sample set): $H _ { 0 }$ : $\hat { \mathcal { P } } _ { \mathrm { b e n - M B F } } ^ { \mathrm { s o u r c e - 1 } } = \hat { \mathcal { P } } _ { \mathrm { b e n - M B F } } ^ { \mathrm { s o u r c e - 2 } }$ ; $H _ { 1 } \colon \hat { \mathcal { P } } _ { \mathrm { b e n - M B F } } ^ { \mathrm { s o u r c e - 1 } } \neq \hat { \mathcal { P } } _ { \mathrm { b e n - M B F } } ^ { \mathrm { s o u r c e - 2 } }$ .
220
+
221
+ In above four two-sample KS tests, we test on the 16-dimensional MBF features extracted from the soft-max layer. Since the implementation scipy.stats.ks 2samp cannot compare two vectors, we compare the feature of each dimension separately, then report the average $p$ -value over all dimensions. Specifically, when comparing two sets of samples, we firstly concatenate the feature of each dimension across all samples in the same set, leading to 16 long vectors for each set. Then, each pair of two long vectors corresponding to the same dimension from two sets is compared by KS test. The average $p$ -value over all 16 dimensions is reported. The $p$ -values of ${ \bf H } 2 . 1$ are shown in Table 7 (see the column “(clean, BIM)”). The $p$ -values on both train and test set are 0. Thus, the hypothesis $H _ { 0 }$ is rejected, i.e., the MBF features of adversarial and benign examples follow different distributions. The $p$ -values of ${ \bf H } 2 . 2$ are shown in Table 7. We pick two groups of attack methods, i.e., (BIM, DeepFool) and (CW-L2, R-PGD). The $p$ -values of (BIM, DeepFool) are 0, while the $p$ -values of (CW-L2, R-PGD) are larger than 0.05. It demonstrates that the distributions of adversarial examples crafted from different attack methods are possible to be different. The $p$ -values of ${ \bf H } 2 . 3$ are shown in Table 8. The $p$ -values of all types of adversarial examples exceed 0.05. Thus, the MBF features of adversarial examples from different data sources follow the same distribution. The $p$ -values of H2.4 are shown in Table 8. Only the $p$ -value of “(train set, out-of-sample set)” of clean examples is slightly lower than 0.05, while the values of other cases exceed 0.05. Thus, in most cases, the MBF features of benign examples from different data sources follow the same distribution.
222
+
223
+ From above analysis, we obtain the following conclusions: 1) The extracted MBF features of adversarial and benign examples follow different empirical distributions. It explains why MBF features are effective for detecting adversarial and benign examples; 2) The extracted MBF features of adversarial/benign examples from the train, test and out-of-sample sets follow the same empirical distribution. Although the extracted MBF features of adversarial examples crafted from different attack methods may not follow the same empirical distribution, the significant difference between benign and different adversarial distributions can still lead to the good detection performance in the attack-transfer case. It explains why MBF features are robust across different attack methods and different data sources. Moreover, we visualize the statistics of each dimension of MBF features, i.e., mean and standard deviation, as shown in Fig. 1. These visualizations also support above conclusions. Due to space limit, more KS tests and visualizations on different databases and networks will be presented in the supplementary material.
224
+
225
+ # 5 CONCLUSION
226
+
227
+ This work has proposed a novel adversarial detection method, dubbed MBF. The assumption behind is that the internal responses of the classification network of both adversarial and benign examples follow the generalized Gaussian distribution (GGD), but with different shape factors. The magnitude of Benford-Fourier coefficient is a function w.r.t. the shape factor, and can be easily estimated based on responses. Thus, it can serve as the discriminative features between adversarial and benign examples. The extensive experiments conducted on several databases, as well as the empirical analysis via KS test, demonstrate the superior effectiveness and robustness to different attacks and different data sources of the proposed MBF method, over state-of-the-art detection methods.
228
+
229
+ # REFERENCES
230
+
231
+ Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy, pp. 39–57. IEEE, 2017a.
232
+
233
+ Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14. ACM, 2017b.
234
+
235
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
236
+
237
+ Reuben Feinman, Ryan R Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
238
+
239
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
240
+
241
+ Nathaniel R Goodman. Statistical analysis based on a certain multivariate complex gaussian distribution (an introduction). The Annals of mathematical statistics, 34(1):152–177, 1963.
242
+
243
+ Kathrin Grosse, Praveen Manoharan, Nicolas Papernot, Michael Backes, and Patrick McDaniel. On the (statistical) detection of adversarial examples. arXiv preprint arXiv:1702.06280, 2017.
244
+
245
+ 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.
246
+
247
+ Dan Hendrycks and Kevin Gimpel. Early methods for detecting adversarial images. arXiv preprint arXiv:1608.00530, 2016.
248
+
249
+ 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, pp. 4700–4708, 2017.
250
+
251
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
252
+
253
+ Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The cifar-10 dataset. online: http://www.cs.toronto.edu/kriz/cifar.html, 55, 2014.
254
+
255
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
256
+
257
+ Nour-Eddine Lasmar, Youssef Stitou, and Yannick Berthoumieu. Multiscale skewed heavy tailed model for texture analysis. In 2009 16th IEEE International Conference on Image Processing (ICIP), pp. 2281–2284. IEEE, 2009.
258
+
259
+ Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pp. 7167–7177, 2018.
260
+
261
+ Xin Li and Fuxin Li. Adversarial examples detection in deep networks with convolutional filter statistics. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5764– 5772, 2017.
262
+
263
+ Jiajun Lu, Theerasit Issaranon, and David Forsyth. Safetynet: Detecting and rejecting adversarial examples robustly. In Proceedings of the IEEE International Conference on Computer Vision, pp. 446–454, 2017.
264
+
265
+ Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Grant Schoenebeck, Dawn Song, Michael E Houle, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. In International Conference on Learning Representations, 2018.
266
+
267
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
268
+
269
+ Frank J Massey Jr. The kolmogorov-smirnov test for goodness of fit. Journal of the American statistical Association, 46(253):68–78, 1951.
270
+
271
+ Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. In International Conference on Learning Representations, 2017.
272
+
273
+ Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2574–2582, 2016.
274
+
275
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
276
+
277
+ Tianyu Pang, Chao Du, Yinpeng Dong, and Jun Zhu. Towards robust detection of adversarial examples. In Advances in Neural Information Processing Systems, pp. 4579–4589, 2018.
278
+
279
+ Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European Symposium on Security and Privacy, pp. 372–387. IEEE, 2016.
280
+
281
+ A. Papoulis and S.U. Pillai. Probability, Random Variables, and Stochastic Processes. McGrawHill Series in Electrical and Computer Engineering. McGraw-Hill, 2001. ISBN 9780072817256. URL https://books.google.com.hk/books?id $=$ Mal4OgAACAAJ.
282
+
283
+ Cecilia Pasquini, Fernando Perez-Gonz ´ alez, and Giulia Boato. A benford-fourier jpeg compression ´ detector. In 2014 IEEE International Conference on Image Processing, pp. 5322–5326. IEEE, 2014.
284
+
285
+ Karl Pearson. Liii. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901.
286
+
287
+ Fernando Perez-Gonz ´ alez, Greg L Heileman, and Chaouki T Abdallah. Benford’s lawin image ´ processing. In 2007 IEEE International Conference on Image Processing, volume 1, pp. I–405. IEEE, 2007.
288
+
289
+ Murray Rosenblatt. A central limit theorem and a strong mixing condition. Proceedings of the National Academy of Sciences of the United States of America, 42(1):43, 1956.
290
+
291
+ Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-gan: Protecting classifiers against adversarial attacks using generative models. arXiv preprint arXiv:1805.06605, 2018.
292
+
293
+ Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
294
+
295
+ Mahesh K Varanasi and Behnaam Aazhang. Parametric generalized gaussian density estimation. The Journal of the Acoustical Society of America, 86(4):1404–1415, 1989.
296
+
297
+ Zhihao Zheng and Pengyu Hong. Robust detection of adversarial attacks by modeling the intrinsic properties of deep neural networks. In Advances in Neural Information Processing Systems, pp. 7913–7922, 2018.
298
+
299
+ # A APPENDIX
300
+
301
+ A.1 PROOF OF THEOREM 1
302
+
303
+ Proof 1 Assume that all the variables $\{ \mathcal { T } _ { m } \} _ { m = 1 , \dots , M }$ are independent and identically distributed. Applying the central limit theorem Rosenblatt (1956) to the real and imaginary parts of $_ { \mathcal { V } }$ , we can obtain that both parts asymptotically follow the Gaussian distribution
304
+
305
+ $$
306
+ \mathcal { V } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mathcal { T } _ { m } \sim \mathcal { N } \big ( E ( \mathcal { T } _ { 1 } ) , \frac { 1 } { M } D ( \mathcal { T } _ { 1 } ) \big ) ,
307
+ $$
308
+
309
+ where
310
+
311
+ $$
312
+ \begin{array} { l } { \displaystyle E ( \mathcal { T } _ { 1 } ) = E \left( e ^ { - j 2 \pi n \log _ { 1 0 } | \mathcal { X } _ { 1 } | } \right) = \int _ { - \infty } ^ { + \infty } \mathcal { P } _ { \mathcal { X } _ { 1 } } ( x ) \cdot e ^ { - j 2 \pi n \log _ { 1 0 } | x | } d x = a _ { n } , } \\ { \displaystyle D ( \mathcal { T } _ { 1 } ) = E \big ( \left| \mathcal { T } _ { 1 } \right| ^ { 2 } \big ) - \left| E \left( \mathcal { T } _ { 1 } \right) \right| ^ { 2 } = E \big ( \left| e ^ { - j 2 \pi n \log _ { 1 0 } | \mathcal { X } _ { 1 } | } \right| ^ { 2 } \big ) - \left| a _ { n } \right| ^ { 2 } = 1 - \left| a _ { n } \right| ^ { 2 } . } \end{array}
313
+ $$
314
+
315
+ The PDF of $\mathcal { V }$ can be rewritten as follows:
316
+
317
+ $$
318
+ \mathcal { V } \sim \mathcal { N } ( a _ { n } , \frac { 1 - | a _ { n } | ^ { 2 } } { M } ) .
319
+ $$
320
+
321
+ Thus, we obtain
322
+
323
+ $$
324
+ \mathcal { E } \sim \mathcal { N } ( 0 , \frac { 1 - | a _ { n } | ^ { 2 } } { M } ) .
325
+ $$
326
+
327
+ Besides, the pseudo variance Goodman (1963) of $\mathcal { T } _ { 1 }$ is
328
+
329
+ $$
330
+ \mathcal { T } _ { \mathcal { T } _ { 1 } , \mathcal { T } _ { 1 } } = E ( \mathcal { T } _ { 1 } ^ { 2 } ) - E ( \mathcal { T } _ { 1 } ) ^ { 2 } = E \big ( e ^ { - j 2 \pi n \log _ { 1 0 } \left| \mathcal { X } _ { 1 } ^ { 2 } \right| } \big ) - a _ { n } ^ { 2 } = a _ { 2 n } - a _ { n } ^ { 2 } .
331
+ $$
332
+
333
+ Correspondingly,
334
+
335
+ $$
336
+ \mathcal { I } _ { \mathcal { E } , \mathcal { E } } = \frac { 1 } { M } \mathcal { I } _ { \mathcal { T } _ { 1 } , \mathcal { T } _ { 1 } } = \frac { a _ { 2 n } - a _ { n } ^ { 2 } } { M } .
337
+ $$
338
+
339
+ Since $\left( a _ { 2 n } - a _ { n } ^ { 2 } \right)$ is bounded, we have $\begin{array} { r } { \operatorname* { l i m } _ { M \to \infty } \mathcal { I } _ { \mathcal { E } , \mathcal { E } } = 0 } \end{array}$ . Thus, we obtain that the random variable $\mathcal { E }$ follows circularly-symmetric complex Gaussian distribution, because the sufficient and necessary condition is that mean value and pseudo variance equal zero Goodman (1963). It implies that both the real and imaginary part of $\mathcal { E }$ follow the same Gaussian distribution and they are independent. Thus, the magnitude of this complex random variable follows the Rayleigh distribution Papoulis & Pillai (2001), and the probability density function of $| \mathcal { E } |$ can be formulated as
340
+
341
+ $$
342
+ \mathcal { P } _ { | \varepsilon | } \left( r \right) = \frac { r } { s ^ { 2 } } e ^ { - r ^ { 2 } / 2 s ^ { 2 } } ,
343
+ $$
344
+
345
+ where s is the scale parameter. Knowing the properties of the Rayleigh distributionPapoulis & Pillai (2001), we have:
346
+
347
+ $$
348
+ s ^ { 2 } = { \frac { 1 } { 2 } } D ( { \mathcal { E } } ) = { \frac { 1 - | a _ { n } | ^ { 2 } } { 2 M } } .
349
+ $$
350
+
351
+ Utilizing the fact that $\left| a _ { n } \right| ^ { 2 }$ is close to 0 when n is a modest number, we obtain that $\begin{array} { r } { D \left( \mathcal { E } \right) \approx \frac { 1 } { M } } \end{array}$ , leading to $\textstyle s ^ { 2 } = { \frac { 1 } { 2 M } }$ . Then, we obtain
352
+
353
+ $$
354
+ E { \bigl ( } | { \mathcal { E } } | { \bigr ) } = { \frac { 1 } { 2 } } { \sqrt { \frac { \pi } { M } } } , D { \bigl ( } | { \mathcal { E } } | { \bigr ) } = { \frac { 4 - \pi } { 4 M } } .
355
+ $$
356
+
357
+ It is easy to observe that both $E { \big ( } | { \mathcal { E } } | { \big ) }$ and $D ( \left. \boldsymbol { \mathcal { E } } \right. )$ are close to zero when the number of samples M increases. It implies that the estimation error $\varepsilon _ { n }$ gets closer to $O$ as $M$ increases.
358
+
359
+ Table 9: The $p$ -value of KS hypothesis test among clean samples, noisy samples, and adversarial samples crafted by four methods, respectively.
360
+
361
+ <table><tr><td colspan="2"></td><td>clean</td><td>noisy</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td rowspan="2">CIFAR-10</td><td>train set</td><td>0.074</td><td>0.074</td><td>0.158</td><td>0.139</td><td>0.155</td><td>0.159</td></tr><tr><td>test set</td><td>0.072</td><td>0.072</td><td>0.158</td><td>0.138</td><td>0.216</td><td>0.216</td></tr><tr><td rowspan="2">SVHN</td><td>train set</td><td>0.104</td><td>0.104</td><td>0.249</td><td>0.194</td><td>0.222</td><td>0.245</td></tr><tr><td>test set</td><td>0.106</td><td>0.106</td><td>0.249</td><td>0.193</td><td>0.219</td><td>0.239</td></tr><tr><td rowspan="2">ImageNet-AlexNet</td><td>train set</td><td>0.116</td><td>0.116</td><td>0.253</td><td>0.235</td><td>0.242</td><td>0.253</td></tr><tr><td>test set</td><td>0.117</td><td>0.117</td><td>0.261</td><td>0.236</td><td>0.243</td><td>0.259</td></tr><tr><td rowspan="2">ImageNet-VGG-16</td><td>train set</td><td>0.114</td><td>0.114</td><td>0.236</td><td>0.228</td><td>0.240</td><td>0.235</td></tr><tr><td>test set</td><td>0.114</td><td>0.114</td><td>0.231</td><td>0.228</td><td>0.239</td><td>0.232</td></tr></table>
362
+
363
+ Table 10: The $p$ -value of two-sample KS test among MBF coefficients of different types of examples.
364
+
365
+ <table><tr><td colspan="2"></td><td>(clean,noisy)</td><td>(clean,BIM)</td><td>(BIM,DeepFool)</td><td>(CW-L2,R-PGD)</td></tr><tr><td rowspan="2">CIFAR-10</td><td>train set</td><td>0.640</td><td>0.000</td><td>0.000</td><td>0.003</td></tr><tr><td>test set</td><td>0.764</td><td>0.000</td><td>0.030</td><td>0.000</td></tr><tr><td rowspan="2">SVHN</td><td>train set</td><td>0.559</td><td>0.000</td><td>0.030</td><td>0.000</td></tr><tr><td>test set</td><td>0.685</td><td>0.000</td><td>0.000</td><td>0.000</td></tr><tr><td rowspan="2">ImageNet-AlexNet</td><td>train set</td><td>1.000</td><td>0.000</td><td>0.002</td><td>0.134</td></tr><tr><td>test set</td><td>0.993</td><td>0.000</td><td>0.477</td><td>0.000</td></tr><tr><td rowspan="2">ImageNet-VGG-16</td><td>train set</td><td>0.998</td><td>0.000</td><td>0.000</td><td>0.236</td></tr><tr><td>test set</td><td>1.000</td><td>0.000</td><td>0.000</td><td>0.225</td></tr></table>
366
+
367
+ Table 11: The $p$ -value of KS test among MBF coefficients from different data sources.
368
+
369
+ <table><tr><td colspan="2"></td><td>clean noisy</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>CIFAR-10</td><td>(train set, test set)</td><td>0.120 0.188</td><td>0.333</td><td>0.456</td><td>0.584</td><td>0.223</td></tr><tr><td>SVHN</td><td>(train set, test set)</td><td>0.494 0.708</td><td>0.523</td><td>0.147</td><td>0.491</td><td>0.645</td></tr><tr><td>ImageNet- AlexNet</td><td>(train set, test set) (train set, out-of-sample)</td><td>0.153 0.148 0.000 0.000</td><td>0.370 0.169</td><td>0.605 0.101</td><td>0.410 0.206</td><td>0.386 0.158</td></tr><tr><td>ImageNet- VGG-16</td><td>(train set, test set) (train set, out-of-sample)</td><td>0.839 0.858 0.049 0.054</td><td>0.368 0.094</td><td>0.842 0.407</td><td>0.246 0.737</td><td>0.221 0.088</td></tr></table>
370
+
371
+ ![](images/951766bb96a13d49ac27f0e9767ec43586237ffa3aba2ff5527718e6f9c18193.jpg)
372
+ Figure 2: Statistics (mean $\pm$ standard deviation) of MBF coefficients on train (top row) and test (bottom row) set of CIFAR-10.
373
+
374
+ ![](images/f90ea0187e4a20a3df47ccc875e9571b38f3c0e93fe3a9c53bf08df094171e49.jpg)
375
+ Figure 3: Statistics (mean $\pm$ standard deviation) of MBF coefficients on train (top row) and test (bottom row) set of SVHN.
376
+
377
+ ![](images/a2307b9dd6d8b208fa0ca9565e779759c161a7c1546a2a84a8e287388b4c42f5.jpg)
378
+ Figure 4: Statistics (mean $\pm$ standard deviation) of MBF coefficients on train (top row) and test (median row), and out-of-sample (bottom row) set of ImageNet-AlexNet.
379
+
380
+ Table 12: Detection results evaluated by AUROC score $( \% )$ on nearly 4000 images from the testset of MNIST. The best results are highlighted in bold.
381
+
382
+ <table><tr><td>Iteration numberin each GD run</td><td>Number of GD runs</td><td>BIM</td><td>CW-L2</td><td>DeepFool</td><td>R-PGD</td></tr><tr><td>200</td><td>10</td><td>0.744</td><td>0.980</td><td>0.702</td><td>0.746</td></tr><tr><td>100</td><td>10</td><td>0.689</td><td>0.973</td><td>0.650</td><td>0.690</td></tr><tr><td>100</td><td>5</td><td>0.664</td><td>0.969</td><td>0.628</td><td>0.666</td></tr><tr><td>100</td><td>2</td><td>0.612</td><td>0.959</td><td>0.586</td><td>0.614</td></tr><tr><td colspan="2">MBF</td><td>1.000</td><td>0.991</td><td>1.000</td><td>1.000</td></tr></table>
383
+
384
+ # A.2 ADDITIONAL EMPIRICAL ANALYSIS
385
+
386
+ Here we present additional empirical analysis on more databases and networks, as shown in Tables 9, 10 and 11. The $p$ -values in most cases also supports the conclusions obtained in the main manuscript. We also present more visualizations in Figs. 2, 3 and 4. These visualizations also demonstrate the distinct difference of MBF features between adversarial and benign examples.
387
+
388
+ # A.3 COMPARISON BETWEEN DEFENSE-GAN
389
+
390
+ We adopt official code8 of Defense-GAN (Samangouei et al. (2018)) and train an generative model on train set of MNIST dataset after 130, 000 epochs (As the official code of Defense-GAN currently only supports three datasets including MNIST, Fashion-MNIST, and CelebA). The classification model attains an accuracy of $9 8 . 7 \%$ on the test set of MNIST dataset. We still utilize four attack strategies, including BIM, CW-L2, DeepFool and R-PGD. After removing images that are misclassified and failed to attack, we pick 6000 images to train SVMs based on our MBF features, and leave nearly 4000 images for testing. There are two key hyper-parameters in Defense-GAN, including the iteration number in each GD run, and the total number of GD runs. We have tried multiple settings of these two hyper-parameters. Table 12 show the AUROC score on nearly 4000 images. Our MBF method exceeds Defense-GAN by a large margin in quantitative performance.
391
+
392
+ # A.4 DETAILED PARAMETERS OF ADVERSARIAL ATTACK
393
+
394
+ Four popular adversarial attack methods are adopted to craft adversarial examples, including basic iterative method (BIM), CarliniWagnerL2Attack (CW-L2), DeepFool, and random projected gradient descent (R-PGD). We emphasize detailed parameters of these attack strategies for reproducibility, which are BIM $\mathrm { ( e p s { = } 0 . 3 }$ , stepsize $= 0 . 0 5$ , iterations ${ \it \Omega } = 1 0$ ), CW-L2 (binary search steps $^ { = 5 }$ , confidence $= 0 . 0$ , learning rate $= 0 . 0 0 5$ , max iterations $\mathord { \left. \begin{array} { r l l } { - 1 0 0 0 } \end{array} \right. }$ ), DeepFool (max step $\mathord { \mathrm { \ s } } = 1 0 0$ ), R-PGD $\mathrm { \ e p s { = } 0 . 3 }$ , stepsize ${ \mathrm { \Omega } } { = } 0 . 0 1$ , iterations $\scriptstyle = 4 0$ ). All of the attack strategies are implemented by Foolbox.
md/train/rygf-kSYwH/rygf-kSYwH.md ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Behaviour Suite for Reinforcement Learning
2
+
3
+ Ian Osband∗, Yotam Doron, Matteo Hessel, John Aslanides Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepesvari Satinder Singh, Benjamin Van Roy, Richard Sutton, David Silver, Hado Van Hasselt
4
+
5
+ DeepMind
6
+
7
+ # Abstract
8
+
9
+ This paper introduces the Behaviour Suite for Reinforcement Learning, or bsuite for short. bsuite is a collection of carefully-designed experiments that investigate core capabilities of reinforcement learning (RL) agents with two objectives. First, to collect clear, informative and scalable problems that capture key issues in the design of general and efficient learning algorithms. Second, to study agent behaviour through their performance on these shared benchmarks. To complement this effort, we open source github.com/deepmind/bsuite, which automates evaluation and analysis of any agent on bsuite. This library facilitates reproducible and accessible research on the core issues in RL, and ultimately the design of superior learning algorithms. Our code is Python, and easy to use within existing projects. We include examples with OpenAI Baselines, Dopamine as well as new reference implementations. Going forward, we hope to incorporate more excellent experiments from the research community, and commit to a periodic review of bsuite from a committee of prominent researchers.
10
+
11
+ # 1 Introduction
12
+
13
+ The reinforcement learning (RL) problem describes an agent interacting with an environment with the goal of maximizing cumulative reward through time (Sutton $\&$ Barto, 2017). Unlike other branches of control, the dynamics of the environment are not fully known to the agent, but can be learned through experience. Unlike other branches of statistics and machine learning, an RL agent must consider the effects of its actions upon future experience. An efficient RL agent must address three challenges simultaneously:
14
+
15
+ 1. Generalization: be able to learn efficiently from data it collects.
16
+ 2. Exploration: prioritize the right experience to learn from.
17
+ 3. Long-term consequences: consider effects beyond a single timestep.
18
+
19
+ The great promise of reinforcement learning are agents that can learn to solve a wide range of important problems. According to some definitions, an agent that can learn to perform at or above human level across a wide variety of tasks is an artificial general intelligence (AGI) (Minsky, 1961; Legg et al., 2007).
20
+
21
+ Interest in artificial intelligence has undergone a resurgence in recent years. Part of this interest is driven by the constant stream of innovation and success on high profile challenges previously deemed impossible for computer systems. Improvements in image recognition are a clear example of these accomplishments, progressing from individual digit recognition (LeCun et al., 1998), to mastering ImageNet in only a few years (Deng et al., 2009; Krizhevsky et al., 2012). The advances in RL systems have been similarly impressive: from checkers (Samuel, 1959), to Backgammon (Tesauro, 1995), to Atari games (Mnih et al., 2015a), to competing with professional players at DOTA (Pachocki et al., 2019) or StarCraft (Vinyals et al., 2019) and beating world champions at Go (Silver et al., 2016). Outside of playing games, decision systems are increasingly guided by AI systems (Evans & Gao, 2016).
22
+
23
+ As we look towards the next great challenges for RL and AI, we need to understand our systems better (Henderson et al., 2017). This includes the scalability of our RL algorithms, the environments where we expect them to perform well, and the key issues outstanding in the design of a general intelligence system. We have the existence proof that a single self-learning RL agent can master the game of Go purely from self-play (Silver et al., 2018). We do not have a clear picture of whether such a learning algorithm will perform well at driving a car, or managing a power plant. If we want to take the next leaps forward, we need to continue to enhance our understanding.
24
+
25
+ # 1.1 Practical theory often lags practical algorithms
26
+
27
+ The practical success of RL algorithms has built upon a base of theory including gradient descent (Bottou, 2010), temporal difference learning (Sutton, 1988) and other foundational algorithms. Good theory provides insight into our algorithms beyond the particular, and a route towards general improvements beyond ad-hoc tinkering. As the psychologist Kurt Lewin said, ‘there is nothing as practical as good theory’ (Lewin, 1943). If we hope to use RL to tackle important problems, then we must continue to solidify these foundations. This need is particularly clear for RL with nonlinear function approximation, or ‘deep RL’. At the same time, theory often lags practice, particularly in difficult problems. We should not avoid practical progress that can be made before we reach a full theoretical understanding. The successful development of algorithms and theory typically moves in tandem, with each side enriched by the insights of the other.
28
+
29
+ The evolution of neural network research, or deep learning, provides a poignant illustration of how theory and practice can develop together (LeCun et al., 2015). Many of the key ideas for deep learning have been around, and with successful demonstrations, for many years before the modern deep learning explosion (Rosenblatt, 1958; Ivakhnenko, 1968; Fukushima, 1979). However, most of these techniques remained outside the scope of developed learning theory, partly due to their complex and non-convex loss functions. Much of the field turned away from these techniques in a ‘neural network winter’, focusing instead of function approximation under convex loss (Cortes & Vapnik, 1995). These convex methods were almost completely dominant until the emergence of benchmark problems, mostly for image recognition, where deep learning methods were able to clearly and objectively demonstrate their superiority (LeCun et al., 1998; Krizhevsky et al., 2012). It is only now, several years after these high profile successes, that learning theory has begun to turn its attention back to deep learning (Kawaguchi, 2016; Bartlett et al., 2017; Belkin et al., 2018). The current theory of deep RL is still in its infancy. In the absence of a comprehensive theory, the community needs principled benchmarks that help to develop an understanding of the strengths and weakenesses of our algorithms.
30
+
31
+ # 1.2 An ‘MNIST’ for reinforcement learning
32
+
33
+ In this paper we introduce the Behaviour Suite for Reinforcement Learning (or bsuite for short): a collection of experiments designed to highlight key aspects of agent scalability. Our aim is that these experiments can help provide a bridge between theory and practice, with benefits to both sides. These experiments embody fundamental issues, such as ‘exploration’ or ‘memory’ in a way that can be easily tested and iterated. For the development of theory, they force us to instantiate measurable and falsifiable hypotheses that we might later formalize into provable guarantees. While a full theory of RL may remain out of reach, the development of clear experiments that instantiate outstanding challenges for the field is a powerful driver for progress. We provide a description of the current suite of experiments and the key issues they identify in Section 2.
34
+
35
+ Our work on bsuite is part of a research process, rather than a final offering. We do not claim to capture all, or even most, of the important issues in RL. Instead, we hope to provide a simple library that collects the best available experiments, and makes them easily accessible to the community. As part of an ongoing commitment, we are forming a bsuite committee that will periodically review the experiments included in the official bsuite release. We provide more details on what makes an ‘excellent’ experiment in Section 2, and on how to engage in their construction for future iterations in Section 5.
36
+
37
+ The Behaviour Suite for Reinforcement Learning is a not a replacement for ‘grand challenge’ undertakings in artificial intelligence, or a leaderboard to climb. Instead it is a collection of diagnostic experiments designed to provide insight into key aspects of agent behaviour. Just as the MNIST dataset offers a clean, sanitised, test of image recognition as a stepping stone to advanced computer vision; so too bsuite aims to instantiate targeted experiments for the development of key RL capabilities.
38
+
39
+ The successful use of illustrative benchmark problems is not unique to machine learning, and our work is similar in spirit to the Mixed Integer Programming Library (MIPLIB) (miplib2017). In mixed integer programming, and unlike linear programming, the majority of algorithmic advances have (so far) eluded theoretical analysis. In this field, MIPLIB serves to instantiate key properties of problems (or types of problems), and evaluation on MIPLIB is a typical component of any new algorithm. We hope that bsuite can grow to perform a similar role in RL research, at least for those parts that continue to elude a unified theory of artificial intelligence. We provide guidelines for how researchers can use bsuite effectively in Section 3.
40
+
41
+ # 1.3 Open source code, reproducible research
42
+
43
+ As part of this project we open source github.com/deepmind/bsuite, which instantiates all experiments in code and automates the evaluation and analysis of any RL agent on bsuite. This library serves to facilitate reproducible and accessible research on the core issues in reinforcement learning. It includes:
44
+
45
+ • Canonical implementations of all experiments, as described in Section 2.
46
+ • Reference implementations of several reinforcement learning algorithms.
47
+ Example usage of bsuite with alternative codebases, including ‘OpenAI Gym’.
48
+ • Launch scripts for Google cloud that automate large scale compute at low cost.1 • A ready-made bsuite Jupyter notebook with analyses for all experiments.
49
+ • Automated LATEX appendix, suitable for inclusion in conference submission.
50
+
51
+ We provide more details on code and usage in Section 4.
52
+
53
+ We hope the Behaviour Suite for Reinforcement Learning, and its open source code, will provide significant value to the RL research community, and help to make key conceptual issues concrete and precise. bsuite can highlight bottlenecks in general algorithms that are not amenable to hacks, and reveal properties and scalings of algorithms outside the scope of current analytical techniques. We believe this offers an avenue towards great leaps on key issues, separate to the challenges of large-scale engineering (Nair et al., 2015). Further, bsuite facilitates clear, targeted and unified experiments across different code frameworks, something that can help to remedy issues of reproducibility in RL research (Tanner & White, 2009; Henderson et al., 2017).
54
+
55
+ # 1.4 Related work
56
+
57
+ The Behaviour Suite for Reinforcement Learning fits into a long history of RL benchmarks. From the beginning, research into general learning algorithms has been grounded by the performance on specific environments (Sutton & Barto, 2017). At first, these environments were typically motivated by small MDPs that instantiate the general learning problem. ‘CartPole’ (Barto et al., 1983) and ‘MountainCar’ (Moore, 1990) are examples of classic benchmarks that has provided a testing ground for RL algorithm development. Similarly, when studying specific capabilities of learning algorithms, it has often been helpful to design diagnostic environments with that capability in mind. Examples of this include ‘RiverSwim’ for exploration (Strehl & Littman, 2008) or ‘Taxi’ for temporal abstraction (Dietterich, 2000). Performance in these environments provide a targeted signal for particular aspects of algorithm development.
58
+
59
+ As the capabilities or RL algorithms have advanced, so has the complexity of the benchmark problems. The Arcade Learning Environment (ALE) has been instrumental in driving progress in deep RL through surfacing dozens of Atari 2600 games as learning environments (Bellemare et al., 2013). Similar projects have been crucial to progress in continuous control (Duan et al., 2016; Tassa et al., 2018), model-based RL (Wang et al., 2019) and even rich 3D games (Beattie et al., 2016). Performing well in these complex environments requires the integration of many core agent capabilities. We might think of these benchmarks as natural successors to ‘CartPole’ or ‘MountainCar’.
60
+
61
+ The Behaviour Suite for Reinforcement Learning offers a complementary approach to existing benchmarks in RL, with several novel components:
62
+
63
+ 1. bsuite experiments enforce a specific methodology for agent evaluation beyond just the environment definition. This is crucial for scientific comparisons and something that has become a major problem for many benchmark suites (Machado et al., 2017) (Section 2). 2. bsuite aims to isolate core capabilities with targeted ‘unit tests’, rather than integrate general learning ability. Other benchmarks evolve by increasing complexity, bsuite aims to remove all confounds from the core agent capabilities of interest (Section 3). 3. bsuite experiments are designed with an emphasis on scalability rather than final performance. Previous ‘unit tests’ (such as ‘Taxi’ or ‘RiverSwim’) are of fixed size, bsuite experiments are specifically designed to vary the complexity smoothly (Section 2). 4. github.com/deepmind/bsuite has an extraordinary emphasis on the ease of use, and compatibility with RL agents not specifically designed for bsuite. Evaluating an agent on bsuite is practical even for agents designed for a different benchmark (Section 4).
64
+
65
+ # 2 Experiments
66
+
67
+ This section outlines the experiments included in the Behaviour Suite for Reinforcement Learning 2019 release. In the context of bsuite, an experiment consists of three parts:
68
+
69
+ 1. Environments: a fixed set of environments determined by some parameters.
70
+ 2. Interaction: a fixed regime of agent/environment interaction (e.g. 100 episodes).
71
+ 3. Analysis: a fixed procedure that maps agent behaviour to results and plots.
72
+
73
+ One crucial part of each bsuite analysis defines a ‘score’ that maps agent performance on the task to $[ 0 , 1 ]$ . This score allows for agent comparison ‘at a glance’, the Jupyter notebook includes further detailed analysis for each experiment. All experiments in bsuite only measure behavioural aspects of RL agents. This means that they only measure properties that can be observed in the environment, and are not internal to the agent. It is this choice that allows bsuite to easily generate and compare results across different algorithms and codebases. Researchers may still find it useful to investigate internal aspects of their agents on bsuite environments, but it is not part of the standard analysis.
74
+
75
+ Every current and future bsuite experiment should target some key issue in RL. We aim for simple behavioural experiments, where agents that implement some concept well score better than those that don’t. For an experiment to be included in bsuite it should embody five key qualities:
76
+
77
+ • Targeted: performance in this task corresponds to a key issue in RL.
78
+ • Simple: strips away confounding/confusing factors in research.
79
+ • Challenging: pushes agents beyond the normal range.
80
+ • Scalable: provides insight on scalability, not performance on one environment.
81
+ • Fast: iteration from launch to results in under 30min on standard CPU.
82
+
83
+ Where our current experiments fall short, we see this as an opportunity to improve the Behaviour Suite for Reinforcement Learning in future iterations. We can do this both through replacing experiments with improved variants, and through broadening the scope of issues that we consider.
84
+
85
+ We maintain the full description of each of our experiments through the code and accompanying documentation at github.com/deepmind/bsuite. In the following subsections, we pick two bsuite experiments to review in detail: ‘memory length’ and ‘deep sea’, and review these examples in detail. By presenting these experiments as examples, we can emphasize what we think makes bsuite a valuable tool for investigating core RL issues. We do provide a high level summary of all other current experiments in Appendix A.
86
+
87
+ To accompany our experiment descriptions, we present results and analysis comparing three baseline algorithms on bsuite: DQN (Mnih et al., 2015a), A2C (Mnih et al., 2016) and Bootstrapped DQN (Osband et al., 2016). As part of our open source effort, we include full code for these agents and more at bsuite/baselines. All plots and analysis are generated through the automated bsuite Jupyter notebook, and give a flavour for the sort of agent comparisons that are made easy by bsuite.
88
+
89
+ # 2.1 Example experiment: memory length
90
+
91
+ Almost everyone agrees that a competent learning system requires memory, and almost everyone finds the concept of memory intuitive. Nevertheless, it can be difficult to provide a rigorous definition for memory. Even in human minds, there is evidence for distinct types of ‘memory’ handled by distinct regions of the brain (Milner et al., 1998). The assessment of memory only becomes more difficult to analyse in the context of general learning algorithms, which may differ greatly from human models of cognition. Which types of memory should we analyse? How can we inspect belief models for arbitrary learning systems? Our approach in bsuite is to sidestep these debates through simple behavioural experiments.
92
+
93
+ We refer to this experiment as memory length; it is designed to test the number of sequential steps an agent can remember a single bit. The underlying environment is based on a stylized T-maze (O’Keefe & Dostrovsky, 1971), parameterized by a length $N \in \mathbb { N }$ . Each episode lasts $N$ steps with observation $o _ { t } = ( c _ { t } , t / N )$ for $t = 1 , . . , N$ and action space $\mathcal { A } = \{ - 1 , + 1 \}$ . The context $c _ { 1 } \sim \mathrm { U n i f } ( \mathcal { A } )$ and $c _ { t } = 0$ for all $t \geq 2$ . The reward $r _ { t } = 0$ for all $t < N$ , but $r _ { N } = \mathrm { S i g n } ( a _ { N } = c _ { 1 } )$ . For the bsuite experiment we run the agent on sizes $N = 1 , . . , 1 0 0$ exponentially spaced and look at the average regret compared to optimal after 10k episodes. The summary ‘score’ is the percentage of runs for which the average regret is less than $7 5 \%$ of that achieved by a uniformly random policy.
94
+
95
+ ![](images/5fba235f7cc9fe8a44f3a05fb6242801bf0737a0878ecf8655fe36dd7b275bb1.jpg)
96
+ Figure 1: Illustration of the ‘memory length’ environment
97
+
98
+ Memory length is a good bsuite experiment because it is targeted, simple, challenging, scalable and fast. By construction, an agent that performs well on this task has mastered some use of memory over multiple timesteps. Our summary ‘score’ provides a quick and dirty way to compare agent performance at a high level. Our sweep over different lengths $N$ provides empirical evidence about the scaling properties of the algorithm beyond a simple pass/fail. Figure 2a gives a quick snapshot of the performance of baseline algorithms. Unsurprisingly, actor-critic with a recurrent neural network greatly outperforms the feedforward DQN and Bootstrapped DQN. Figure 2b gives us a more detailed analysis of the same underlying data. Both DQN and Bootstrapped DQN are unable to learn anything for length $> 1$ , they lack functioning memory. A2C performs well for all $N \ \leq \ 3 0$ and essentially random for all $N > 3 0$ , with quite a sharp cutoff. While it is not surprising that the recurrent agent outperforms feedforward architectures on a memory task, Figure 2b gives an excellent insight into the scaling properties of this architecture. In this case, we have a clear explanation for the observed performance: the RNN agent was trained via backprop-through-time with length 30. bsuite recovers an empirical evaluation of the scaling properties we would expect from theory.
99
+
100
+ # 2.2 Example experiment: deep sea
101
+
102
+ Reinforcement learning calls for a sophisticated form of exploration called deep exploration (Osband et al., 2017). Just as an agent seeking to ‘exploit’ must consider the long term consequences of its actions towards cumulative rewards, an agent seeking to ‘explore’ must consider how its actions can position it to learn more effectively in future timesteps. The literature on efficient exploration broadly states that only agents that perform deep exploration can expect polynomial sample complexity in learning (Kearns & Singh, 2002). This literature has focused, for the most part, on uncovering possible strategies for deep exploration through studying the tabular setting analytically (Jaksch et al., 2010; Azar et al., 2017). Our approach in bsuite is to complement this understanding through a series of behavioural experiments that highlight the need for efficient exploration.
103
+
104
+ ![](images/b14ce0f5f2981daa185a93293264a95c8755b30c32be1507672aedfc51ffbb96.jpg)
105
+ Figure 2: Selected output from bsuite evaluation on ‘memory length’.
106
+
107
+ The deep sea problem is implemented as an $N \times N$ grid with a one-hot encoding for state. The agent begins each episode in the top left corner of the grid and descends one row per timestep. Each episode terminates after $N$ steps, when the agent reaches the bottom row. In each state there is a random but fixed mapping between actions $\mathcal { A } = \{ 0 , 1 \}$ and the transitions ‘left’ and ‘right’. At each timestep there is a small cost $r = - 0 . 0 1 / N$ of moving right, and $r = 0$ for moving left. However, should the agent transition right at every timestep of the episode it will be rewarded with an additional reward of $+ 1$ . This presents a particularly challenging exploration problem for two reasons. First, following the ‘gradient’ of small intermediate rewards leads the agent away from the optimal policy. Second, a policy that explores with actions uniformly at random has probability $2 ^ { - N }$ of reaching the rewarding state in any episode. For the bsuite experiment we run the agent on sizes $N = 1 0 , 1 2 , . . , 5 0$ and look at the average regret compared to optimal after 10k episodes. The summary ‘score’ computes the percentage of runs for which the average regret drops below 0.9 faster than the $2 ^ { N }$ episodes expected by dithering.
108
+
109
+ ![](images/50b2723be4f1b41e9b292fd87a0e75bec57e3986b2f1efb1d914002f9dd94bde.jpg)
110
+ Figure 3: Deep-sea exploration: a simple example where deep exploration is critical.
111
+
112
+ Deep Sea is a good bsuite experiment because it is targeted, simple, challenging, scalable and fast. By construction, an agent that performs well on this task has mastered some key properties of deep exploration. Our summary score provides a ‘quick and dirty’ way to compare agent performance at a high level. Our sweep over different sizes $N$ can help to provide empirical evidence of the scaling properties of an algorithm beyond a simple pass/fail. Figure 3 presents example output comparing A2C, DQN and Bootstrapped DQN on this task. Figure 4a gives a quick snapshot of performance. As expected, only Bootstrapped DQN, which was developed for efficient exploration, scores well. Figure 4b gives a more detailed analysis of the same underlying data. When we compare the scaling of learning with problem size $N$ it is clear that only Bootstrapped DQN scales gracefully to large problem sizes. Although our experiment was only run to size 50, the regular progression of learning times suggest we might expect this algorithm to scale towards $N > 5 0$ .
113
+
114
+ ![](images/2ac0d82a1954f38d9d2ef8e9b96275bedc51bb126fea0c4f4076f61b08c2790c.jpg)
115
+ Figure 4: Selected output from bsuite evaluation on ‘deep sea’.
116
+
117
+ # 3 How to use bsuite
118
+
119
+ This section describes some of the ways you can use bsuite in your research and development of RL algorithms. Our aim is to present a high-level description of some research and engineering use cases, rather than a tutorial for the code installation and use. We provide examples of specific investigations using bsuite in Appendixes C, D and E. Section 4 provides an outline of our code and implementation. Full details and tutorials are available at github.com/deepmind/bsuite.
120
+
121
+ A bsuite experiment is defined by a set of environments and number of episodes of interaction. Since loading the environment via bsuite handles the logging automatically, any agent interacting with that environment will generate the data required for required for analysis through the Jupyter notebook we provide (P´erez & Granger, 2007). Generating plots and analysis via the notebook only requires users to provide the path to the logged data. The ‘radar plot’ (Figure 5) at the start of the notebook provides a snapshot of agent behaviour, based on summary scores. The notebook also contains a complete description of every experiment, summary scoring and in-depth analysis of each experiment. You can interact with the full report at bit.ly/bsuite-agents.
122
+
123
+ ![](images/9b6810dff7ffef5a1c445303c8577c724df91665cf1bec6e6540082eb4987422.jpg)
124
+ Figure 5: We aggregate experiment performance with a snapshot of 7 core capabilities.
125
+
126
+ If you are developing an algorithm to make progress on fundamental issues in RL, running on bsuite provides a simple way to replicate benchmark experiments in the field. Although many of these problems are ‘small’, in the sense that their solution does not necessarily require large neural architecture, they are designed to highlight key challenges in RL. Further, although these experiments do offer a summary ‘score’, the plots and analysis are designed to provide much more information than just a leaderboard ranking. By using this common code and analysis, it is easy to benchmark your agents and provide reproducible and verifiable research.
127
+
128
+ If you are using RL as a tool to crack a ‘grand challenge’ in AI, such as beating a world champion at Go, then taking on bsuite gridworlds might seem like small fry. We argue that one of the most valuable uses of bsuite is as a diagnostic ‘unit-test’ for large-scale algorithm development. Imagine you believe that ‘better exploration’ is key to improving your performance on some challenge, but when you try your ‘improved’ agent, the performance does not improve. Does this mean your agent does not do good exploration? Or maybe that exploration is not the bottleneck in this problem? Worse still, these experiments might take days and thousands of dollars of compute to run, and even then the information you get might not be targeted to the key RL issues. Running on bsuite, you can test key capabilities of your agent and diagnose potential improvements much faster, and more cheaply. For example, you might see that your algorithm completely fails at credit assignment beyond $n = 2 0$ steps. If this is the case, maybe this lack of credit-assignment over long horizons is the bottleneck and not necessarily exploration. This can allow for much faster, and much better informed agent development - just like a good suite of tests for software development.
129
+
130
+ Another benefit of bsuite is to disseminate your results more easily and engage with the research community. For example, if you write a conference paper targeting some improvement to hierarchical reinforcement learning, you will likely provide some justification for your results in terms of theorems or experiments targeted to this setting.2 However, it is typically a large amount of work to evaluate your algorithm according to alternative metrics, such as exploration. This means that some fields may evolve without realising the connections and distinctions between related concepts. If you run on bsuite, you can automatically generate a one-page Appendix, with a link to a notebook report hosted online. This can help provide a scientific evaluation of your algorithmic changes, and help to share your results in an easily-digestible format, compatible with ICML, ICLR and NeurIPS formatting. We provide examples of these experiment reports in Appendices B, C, D and E.
131
+
132
+ # 4 Code structure
133
+
134
+ To avoid discrepancies between this paper and the source code, we suggest that you take practical tutorials directly from github.com/deepmind/bsuite. A good starting point is bit.ly/bsuite-tutorial: a Jupyter notebook where you can play the code right from your browser, without installing anything. The purpose of this section is to provide a high-level overview of the code that we open source. In particular, we want to stress is that bsuite is designed to be a library for RL research, not a framework. We provide implementations for all the environments, analysis, run loop and even baseline agents. However, it is not necessary that you make use of them all in order to make use of bsuite.
135
+
136
+ The recommended method is to implement your RL agent as a class that implements a policy method for action selection, and an update method for learning from transitions and rewards. Then, simply pass your agent to our run loop, which enumerates all the necessary bsuite experiments and logs all the data automatically. If you do this, then all the experiments and analysis will be handled automatically and generate your results via the included Jupyter notebook. We provide examples of running these scripts locally, and via Google cloud through our tutorials.
137
+
138
+ If you have an existing codebase, you can still use bsuite without migrating to our run loop or agent structure. Simply replace your environment with environment $=$ bsuite.load and record(bsuite id) and add the flag bsuite id to your code. You can then complete a full bsuite evaluation by iterating over the bsuite ids defined in sweep.SWEEP. Since the environments handle the logging themselves, your don’t need any additional logging for the standard analysis. Although full bsuite includes many separate evaluations, no single bsuite environment takes more than 30 minutes to run and the sweep is naturally parallel. As such, we recommend launching in parallel using multiple processes or multiple machines. Our examples include a simple approach using Python’s multiprocessing module with Google cloud compute. We also provide examples of running bsuite from OpenAI baselines (Dhariwal et al., 2017) and Dopamine (Castro et al., 2018).
139
+
140
+ Designing a single RL agent compatible with diverse environments can cause problems, particularly for specialized neural networks. bsuite alleviates this problem by specifying an observation spec that surfaces the necessary information for adaptive network creation. By default, bsuite environments implement the dm env standards (Muldal et al., 2017), but we also include a wrapper for use through Openai gym (Brockman et al., 2016). However, if your agent is hardcoded for a format, bsuite offers the option to output each environment with the observation spec of your choosing via linear interpolation. This means that, if you are developing a network suitable for Atari and particular observation spec, you can choose to swap in bsuite without any changes to your agent.
141
+
142
+ # 5 Future iterations
143
+
144
+ This paper introduces the Behaviour Suite for Reinforcement Learning, and marks the start of its ongoing development. With our opensource effort, we chose a specific collection of experiments as the bsuite2019 release, but expect this collection to evolve in future iterations. We are reaching out to researchers and practitioners to help collate the most informative, targeted, scalable and clear experiments possible for reinforcement learning. To do this, submissions should implement a sweep that determines the selection of environments to include and logs the necessary data, together with an analysis that parses this data.
145
+
146
+ In order to review and collate these submissions we will be forming a bsuite committee. The committee will meet annually during the NeurIPS conference to decide which experiments will be included in the bsuite release. We are reaching out to a select group of researchers, and hope to build a strong core formed across industry and academia. If you would like to submit an experiment to bsuite or propose a committee member, you can do this via github pull request, or via email to bsuite.committee@gmail.com.
147
+
148
+ We believe that bsuite can be a valuable tool for the RL community, and particularly for research in deep RL. So far, the great success of deep RL has been to leverage large amounts of computation to improve performance. With bsuite, we hope to leverage largescale computation for improved understanding. By collecting clear, informative and scalable experiments; and providing accessible tools for reproducible evaluation we hope to facilitate progress in reinforcement learning research.
149
+
150
+ # References
151
+
152
+ Mart´ın Abadi et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
153
+
154
+ Mohammad Gheshlaghi Azar, Ian Osband, and R´emi Munos. Minimax regret bounds for reinforcement learning. In Proc. of ICML, 2017.
155
+
156
+ Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems 30, pp. 6241–6250, 2017.
157
+
158
+ Andrew G Barto, Richard S Sutton, and Charles W Anderson. Neuronlike adaptive elements that can solve difficult learning control problems. IEEE transactions on systems, man, and cybernetics, (5):834–846, 1983.
159
+
160
+ Charles Beattie, Joel Z Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich K¨uttler, Andrew Lefrancq, Simon Green, V´ıctor Vald´es, Amir Sadik, et al. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016.
161
+
162
+ Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine learning and the bias-variance trade-off. arXiv preprint arXiv:1812.11118, 2018.
163
+
164
+ 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.
165
+
166
+ L´eon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pp. 177–186. Springer, 2010.
167
+
168
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. URL http://arxiv.org/abs/ 1606.01540.
169
+
170
+ Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, and Marc G. Bellemare. Dopamine: A Research Framework for Deep Reinforcement Learning. 2018. URL http://arxiv. org/abs/1812.06110.
171
+
172
+ Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3):273–297, 1995.
173
+
174
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
175
+
176
+ Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https: //github.com/openai/baselines, 2017.
177
+
178
+ Thomas G Dietterich. Hierarchical reinforcement learning with the maxq value function decomposition. Journal of artificial intelligence research, 13:227–303, 2000.
179
+
180
+ Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pp. 1329–1338, 2016.
181
+
182
+ Richard Evans and Jim Gao. Deepmind AI reduces google data centre cooling bill by 40 https: //deepmind.com/blog/deepmind-ai-reduces-google-data-centre-cooling-bill-40/, 2016.
183
+
184
+ Kunihiko Fukushima. Neural network model for a mechanism of pattern recognition unaffected by shift in position-neocognitron. IEICE Technical Report, A, 62(10):658–665, 1979.
185
+
186
+ John C Gittins. Bandit processes and dynamic allocation indices. Journal of the Royal Statistical Society: Series B (Methodological), 41(2):148–164, 1979.
187
+
188
+ Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. CoRR, abs/1709.06560, 2017. URL http://arxiv. org/abs/1709.06560.
189
+
190
+ Alexey Grigorevich Ivakhnenko. The group method of data of handling; a rival of the method of stochastic approximation. Soviet Automatic Control, 13:43–55, 1968.
191
+
192
+ Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(Apr):1563–1600, 2010.
193
+
194
+ Kenji Kawaguchi. Deep learning without poor local minima. In Advances in neural information processing systems, pp. 586–594, 2016.
195
+
196
+ M. Kearns and S. Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49, 2002.
197
+
198
+ Jeannette Kiefer and Jacob Wolfowitz. Stochastic estimation of the maximum of a regression function. 1952.
199
+
200
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
201
+
202
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25, pp. 1097–1105, 2012.
203
+
204
+ Yann LeCun, L´eon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
205
+
206
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436, 2015.
207
+
208
+ Shane Legg, Marcus Hutter, et al. A collection of definitions of intelligence. Frontiers in Artificial Intelligence and applications, 157:17, 2007.
209
+
210
+ Kurt Lewin. Psychology and the process of group living. The Journal of Social Psychology, 17(1): 113–131, 1943.
211
+
212
+ Xiuyuan Lu and Benjamin Van Roy. Ensemble sampling. In Advances in Neural Information Processing Systems, pp. 3260–3268, 2017.
213
+
214
+ Marlos C Machado, Marc G Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the Arcade Learning Environment: Evaluation protocols and open problems for general agents. arXiv preprint arXiv:1709.06009, 2017.
215
+
216
+ Brenda Milner, Larry R Squire, and Eric R Kandel. Cognitive neuroscience and the study of memory. Neuron, 20(3):445–468, 1998.
217
+
218
+ Marvin Minsky. Steps towards artificial intelligence. Proceedings of the IRE, 1961.
219
+
220
+ miplib2017. MIPLIB 2017, 2018. http://miplib.zib.de.
221
+
222
+ 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, 2015a.
223
+
224
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015b.
225
+
226
+ 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 Proc. of ICML, 2016.
227
+
228
+ Andrew William Moore. Efficient memory-based learning for robot control. 1990.
229
+
230
+ Alistair Muldal, Yotam Doron, and John Aslanides. dm env. https://github.com/deepmind/dm_ env, 2017.
231
+
232
+ Arun Nair, Praveen Srinivasan, Sam Blackwell, Cagdas Alcicek, Rory Fearon, et al. Massively Parallel Methods for Deep Reinforcement Learning. In ICML Workshop on Deep Learning, 2015.
233
+
234
+ John O’Keefe and Jonathan Dostrovsky. The hippocampus as a spatial map: preliminary evidence from unit activity in the freely-moving rat. Brain research, 1971.
235
+
236
+ Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In Advances In Neural Information Processing Systems 29, pp. 4026–4034, 2016.
237
+
238
+ Ian Osband, Daniel Russo, Zheng Wen, and Benjamin Van Roy. Deep exploration via randomized value functions. arXiv preprint arXiv:1703.07608, 2017.
239
+
240
+ Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Advances in Neural Information Processing Systems 31, pp. 8617–8629. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 8080-randomized-prior-functions-for-deep-reinforcement-learning.pdf.
241
+
242
+ Ian Osband, Yotam Doron, Matteo Hessel, John Aslanides, , Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepesvari, Satinder Singh, Benjamin Van Roy, Richard Sutton, David Silver, and Hado Van Hasselt. Behaviour suite for reinforcement learning. 2019.
243
+
244
+ Jakub Pachocki, David Farhi, Szymon Sidor, Greg Brockman, Filip Wolski, Henrique PondÃľ, Jie Tang, Jonathan Raiman, Michael Petrov, Christy Dennison, Brooke Chan, Susan Zhang, RafaÅĆ JÃşzefowicz, and PrzemysÅĆaw DÄŹbiak. Openai five. https://openai.com/five, 2019.
245
+
246
+ Fernando P´erez and Brian E. Granger. IPython: a system for interactive scientific computing. Computing in Science and Engineering, 9(3):21–29, May 2007. ISSN 1521-9615. doi: 10.1109/ MCSE.2007.53. URL https://ipython.org.
247
+
248
+ Frank Rosenblatt. The perceptron: a probabilistic model for information storage and organization in the brain. Psychological review, 65(6):386, 1958.
249
+
250
+ Daniel Russo, Benjamin Van Roy, Abbas Kazerouni, and Ian Osband. A tutorial on Thompson sampling. arXiv preprint arXiv:1707.02038, 2017.
251
+
252
+ AL Samuel. Some studies oin machine learning using the game of checkers. IBM Journal of Researchand Development, 3:211–229, 1959.
253
+
254
+ 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.
255
+
256
+ David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy Lillicrap, Karen Simonyan, and Demis Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140–1144, 2018. ISSN 0036-8075. doi: 10.1126/science.aar6404. URL https://science.sciencemag.org/content/362/6419/1140.
257
+
258
+ Alexander L Strehl and Michael L Littman. An analysis of model-based interval estimation for markov decision processes. Journal of Computer and System Sciences, 74(8):1309–1331, 2008.
259
+
260
+ Richard Sutton and Andrew Barto. Reinforcement Learning: An Introduction. MIT Press, 2017.
261
+
262
+ R.S. Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3, 1988.
263
+
264
+ Brian Tanner and Adam White. Rl-glue: Language-independent software for reinforcement-learning experiments. Journal of Machine Learning Research, 10(Sep):2133–2136, 2009.
265
+
266
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
267
+
268
+ Gerald Tesauro. Temporal difference learning and TD-gammon. Communications of the ACM, 38 (3):58–68, 1995.
269
+
270
+ 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.
271
+
272
+ Hado van Hasselt, Arthur Guez, and David Silver. Deep Reinforcement Learning with Double Q-Learning. In Proceedings of the AAAI Conference on Artificial Intelligence, 2016.
273
+
274
+ Oriol Vinyals, Igor Babuschkin, Junyoung Chung, Michael Mathieu, Jaderberg, et al. AlphaStar: Mastering the Real-Time Strategy Game StarCraft II. https://deepmind.com/blog/ alphastar-mastering-real-time-strategy-game-starcraft-ii/, 2019.
275
+
276
+ Tingwu Wang, Xuchan Bao, Ignasi Clavera, Jerrick Hoang, Yeming Wen, Eric Langlois, Shunshi Zhang, Guodong Zhang, Pieter Abbeel, and Jimmy Ba. Benchmarking model-based reinforcement learning. CoRR, abs/1907.02057, 2019. URL http://arxiv.org/abs/1907.02057.
277
+
278
+ # A Experiment summary
279
+
280
+ This appendix outlines the experiments that make up the bsuite 2019 release. In the interests of brevity, we provide only an outline of each experiment here. Full documentation for the environments, interaction and analysis are kept with code at github.com/deepmind/bsuite.
281
+
282
+ # A.1 Basic learning
283
+
284
+ We begin with a collection of very simple decision problems, and standard analysis that confirms an agent’s competence at learning a rewarding policy within them. We call these experiments ‘basic’, since they are not particularly targeted at specific core issues in RL, but instead test a general base level of competence we expect all general agents to attain.
285
+
286
+ # A.1.1 Simple bandit
287
+
288
+ ![](images/ef97416bdbde16221bd45e95e4a9613584874df1212509fb6f68b91a237227e9.jpg)
289
+
290
+ # A.1.2 MNIST
291
+
292
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Finite-armed bandit with deterministic re- wards [0,0.1,..1] (Gittins, 1979). 20 seeds.</td></tr><tr><td> interaction</td><td>10k episodes, record regret vs optimal.</td></tr><tr><td> score</td><td> regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>basic</td></tr></table>
293
+
294
+ ![](images/a92674e5270923d4c96ecb0a25d54d68a0c0484cb26334715d3e48c4fb453fd9.jpg)
295
+
296
+ A.1.3 Catch
297
+
298
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Contextual bandit classification of MNIST with ±1 rewards (LeCun et al.,1998). 20 seeds.</td></tr><tr><td>interaction</td><td>10k episodes, record average regret.</td></tr><tr><td> score</td><td> regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>basic, generalization</td></tr></table>
299
+
300
+ ![](images/9abeccfe27e47e808cc80794a4014c47247c21e78e5883527285787b4229e587.jpg)
301
+
302
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>A 10x5 Tetris-grid with single block falling per column. The agent can move left/right in the bottom row to‘catch’ the block. 20 seeds.</td></tr><tr><td>interaction</td><td>10k episodes, record average regret.</td></tr><tr><td>score</td><td> regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>basic, credit assignment</td></tr></table>
303
+
304
+ A.1.4 Cartpole
305
+
306
+ ![](images/6a7a3a4c5c088db232e4cb408366bc089144e0fccf86a7d95a55edec7bafb552.jpg)
307
+
308
+ <table><tr><td>component</td><td>description</td></tr><tr><td> environments</td><td>Agent can move a cart left/right on a plane to keep a balanced pole upright (Barto et al., 1983), 20 seeds.</td></tr><tr><td> interaction</td><td>10k episodes, record average regret.</td></tr><tr><td> score</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>basic, credit assignment, generalization</td></tr></table>
309
+
310
+ # A.1.5 Mountain car
311
+
312
+ ![](images/d579b04d0310ca37943a037dd6c3fa19fd7d8d0d8d39d769261bf68b828f0cc2.jpg)
313
+
314
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Agent drives an underpowered car up a hil (Moore,1990), 20 seeds.</td></tr><tr><td> interaction</td><td>10k episodes, record average regret.</td></tr><tr><td> score</td><td> regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>basic, credit assignment, generalization</td></tr></table>
315
+
316
+ # A.2 Stochasticity
317
+
318
+ To investigate the robustness of RL agents to noisy rewards, we repeat the experiments from Section A.1 under differing levels of Gaussian noise. This time we allocate the 20 different seeds across 5 levels of Gaussian noise $N ( 0 , \sigma ^ { 2 } )$ for $\sigma = [ 0 . 1 , 0 . 3 , 1 , 3 , 1 0 ]$ with 4 seeds each.
319
+
320
+ # A.3 Problem scale
321
+
322
+ To investigate the robustness of RL agents to problem scale, we repeat the experiments from Section A.1 under differing reward scales. This time we allocate the 20 different seeds across 5 levels of reward scaling, where we multiply the observed rewards by $\lambda =$ $[ 0 . 0 1 , 0 . 1 , 1 , 1 0 , 1 0 0 ]$ with 4 seeds each.
323
+
324
+ # A.4 Exploration
325
+
326
+ As an agent interacts with its environment, it observes the outcomes that result from previous states and actions, and learns about the system dynamics. This leads to a fundamental tradeoff: by exploring poorly-understood states and actions the agent can learn to improve future performance, but it may attain better short-run performance by exploiting its existing knowledge. Exploration is the challenge of prioritizing useful information for learning, and the experiments in this section are designed to necessitate efficient exploration for good performance.
327
+
328
+ # A.4.1 Deep sea
329
+
330
+ ![](images/6fb014a631c5ce402f98627f84e2ac7cde7fab432fe04e4ea8251574ea2cf2b0.jpg)
331
+
332
+ # A.4.2 Stochastic deep sea
333
+
334
+ ![](images/32928f4151ef5170229369be92d0e2e4e87ec7b1643370c2e9ce76c64b6f6e3f.jpg)
335
+
336
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Deep sea chain environments with stochastic transitions, N(O,1) reward noise, size N=[5..50].</td></tr><tr><td> interaction</td><td>10k episodes, record average regret.</td></tr><tr><td> score</td><td>% of runs with ave regret &lt; 90% random</td></tr><tr><td> issues</td><td>exploration, stochasticity</td></tr></table>
337
+
338
+ # A.4.3 Cartpole swingup
339
+
340
+ ![](images/0c3e4c2cca89bc6eb5df8b70e66253f0e23a362b8f20f77f7b0538f0f6f1942d.jpg)
341
+
342
+ <table><tr><td>component</td><td>description</td></tr><tr><td> environments</td><td>Cartpole ‘swing up’ problem with sparse re- ward (Barto et al.,1983), heigh limit x=[0, 0.5, .., 0.95].</td></tr><tr><td> interaction</td><td>1k episodes, record average regret.</td></tr><tr><td> score</td><td>% of runs with average return &gt; 0</td></tr><tr><td> issues</td><td>exploration, generalization</td></tr></table>
343
+
344
+ # A.5 Credit assignment
345
+
346
+ Reinforcement learning extends contextual bandit decision problem to allow long term consequences in decision problems. This means that actions in one timestep can effect dynamics in future timesteps. One of the challenges of this setting is that of credit assignment, and the experiments in this section are designed to highlight these issues.
347
+
348
+ # A.5.1 Umbrella length
349
+
350
+ ![](images/5be62617046129f9a126e1dfe1faef3398971f9e49d8786f855b74a29118d7e2.jpg)
351
+
352
+ # A.5.2 Umbrella features
353
+
354
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Stylized‘umbrella problem&#x27;,where only the first decision matters and long chain of con- founding variables. Vary length 1..10o loga- rithmically.</td></tr><tr><td> interaction</td><td>1k episodes, record average regret.</td></tr><tr><td>score</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>credit assignment, stochasticity</td></tr></table>
355
+
356
+ ![](images/72b3f1164a425f8526bef64ae751dee450926e756eae837f5a4dbba01d650ff7.jpg)
357
+ A.5.3 Discounting chain
358
+
359
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>Stylized ‘umbrella problem&#x27;,where only the first decision matters and long chain of con- founding variables. Vary features 1..10o loga- rithmically.</td></tr><tr><td>interaction</td><td>1k episodes, record average regret .</td></tr><tr><td>score</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>credit assignment, stochasticity</td></tr></table>
360
+
361
+ <table><tr><td rowspan="7">oo+ Reward 1 at =- Reward 1.l at t=3 。O Reward 1 at t-10 。o Reward 1 at t=30 oo</td><td>component</td><td>description</td></tr><tr><td> environments</td><td>Experiment designed to highlight issues of dis- counting horizon.</td></tr><tr><td>interaction</td><td>1k episodes, record average regret.</td></tr><tr><td>score Reward l at t=100</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>credit assignment</td></tr></table>
362
+
363
+ # A.6 Memory
364
+
365
+ Memory is the challenge that an agent should be able to curate an effective state representation from a series of observations. In this section we review a series of experiments in which agents with memory can perform much better than those that only have access to the immediate observation.
366
+
367
+ # A.6.1 Memory length
368
+
369
+ ![](images/b55cba6830e354ea429514e45d8dae150702387b89be3201fe5eddd8aad71c35.jpg)
370
+ A.6.2 Memory bits
371
+
372
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>T-maze with a single binary context, grow length 1..100 logarithmically.</td></tr><tr><td> interaction</td><td>1k episodes, record average regret.</td></tr><tr><td> score</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>credit assignment</td></tr></table>
373
+
374
+ ![](images/97f25769d712b5bee4ecc4ad5179f7d692088854ad3fe3b1a254f79c67b19e04.jpg)
375
+
376
+ <table><tr><td>component</td><td>description</td></tr><tr><td>environments</td><td>T-maze with length 2, vary number of bits to remember 1..100 logarithmically.</td></tr><tr><td> interaction</td><td>1k episodes, record average regret.</td></tr><tr><td> score</td><td>regret normalized [random, optimal] → [0,1]</td></tr><tr><td> issues</td><td>credit assignment</td></tr></table>
377
+
378
+ # B bsuite report as conference appendix
379
+
380
+ If you run an agent on bsuite, and you want to share these results as part of a conference submission, we make it easy to share a single-page ‘bsuite report’ as part of your appendix. We provide a simple LATEXfile that you can copy/paste into your paper, and is compatible out-the-box with ICLR, ICML and NeurIPS style files. This single page summary displays the summary scores for experiment evaluations for one or more agents, with plots generated automatically from the included ipython notebook. In each report, two sections are left for the authors to fill in: one describing the variants of the agents examined and another to give some brief commentary on the results. We suggest that authors promote more in-depth analysis to their main papers, or simply link to a hosted version of the full bsuite analysis online. You can find more details on our automated reports at github.com/deepmind/bsuite.
381
+
382
+ The sections that follow are example bsuite reports, that give some example of how these report appendixes might be used. We believe that these simple reports can be a good complement to conference submissions in RL research, that ‘sanity check’ the elementary properties of algorithmic implementations. An added bonus of bsuite is that it is easy to set up a like for like experiment between agents from different ‘frameworks’ in a way that would be extremely laborious for an individual researcher. If you are writing a conference paper on a new RL algorithm, we believe that it makes sense for you to include a bsuite report in the appendix by default.
383
+
384
+ # C bsuite report: benchmarking baseline agents
385
+
386
+ The Behaviour Suite for Reinforcement Learning, or bsuite for short, is a collection of carefully-designed experiments that investigate core capabilities of a reinforcement learning (RL) agent. The aim of the bsuite project is to collect clear, informative and scalable problems that capture key issues in the design of efficient and general learning algorithms and study agent behaviour through their performance on these shared benchmarks. This report provides a snapshot of agent performance on bsuite2019, obtained by running the experiments from github.com/deepmind/bsuite (Osband et al., 2019).
387
+
388
+ # C.1 Agent definition
389
+
390
+ In this experiment all implementations are taken from bsuite/baselines with default configurations. We provide a brief summary of the agents run on bsuite2019:
391
+
392
+ • random: selects action uniformly at random each timestep.
393
+ • dqn: Deep Q-networks (Mnih et al., 2015b).
394
+ • boot dqn: bootstrapped DQN with prior networks (Osband et al., 2016; 2018).
395
+ • actor critic rnn: an actor critic with recurrent neural network (Mnih et al., 2016).
396
+
397
+ # C.2 Summary scores
398
+
399
+ Each bsuite experiment outputs a summary score in [0,1]. We aggregate these scores by according to key experiment type, according to the standard analysis notebook. A detailed analysis of each of these experiments may be found in a notebook hosted on Colaboratory bit.ly/bsuite-agents.
400
+
401
+ ![](images/42cdd217b4392223ef039dd74cff482c673aa7bfc194372eeb4befaf857a3478.jpg)
402
+ Figure 6: A snapshot of agent behaviour.
403
+
404
+ ![](images/c96f970f02435d58ffeca4e171da11a6fada35ed3986226fb1f5da4e76ccf688.jpg)
405
+ Figure 7: Score for each bsuite experiment.
406
+
407
+ # C.3 Results commentary
408
+
409
+ • random performs uniformly poorly, confirming the scores are working as intended.
410
+
411
+ • dqn performs well on basic tasks, and quite well on credit assignment, generalization, noise and scale. DQN performs extremely poorly across memory and exploration tasks. The feedforward MLP has no mechanism for memory, and $\epsilon { = } 5 \%$ -greedy action selection is inefficient exploration.
412
+
413
+ • boot dqn is mostly identically to DQN, except for exploration where it greatly outperforms. This result matches our understanding of Bootstrapped DQN as a variant of DQN designed to estimate uncertainty and use this to guide deep exploration.
414
+
415
+ • actor critic rnn typically performs worse than either DQN or Bootstrapped DQN on all tasks apart from memory. This agent is the only one able to perform better than random due to its recurrent network architecture.
416
+
417
+ # D bsuite report: optimization algorithm in DQN
418
+
419
+ The Behaviour Suite for Reinforcement Learning, or bsuite for short, is a collection of carefully-designed experiments that investigate core capabilities of a reinforcement learning (RL) agent. The aim of the bsuite project is to collect clear, informative and scalable problems that capture key issues in the design of efficient and general learning algorithms and study agent behaviour through their performance on these shared benchmarks. This report provides a snapshot of agent performance on bsuite2019, obtained by running the experiments from github.com/deepmind/bsuite (Osband et al., 2019).
420
+
421
+ # D.1 Agent definition
422
+
423
+ All agents correspond to different instantiations of the DQN agent (Mnih et al., 2015b), as implemented in bsuite/baselines but with differnet optimizers from Tensorflow (Abadi et al., 2015). In each case we tune a learning rate to optimize performance on ‘basic’ tasks from {1e-1, 1e-2, 1e-3}, keeping all other parameters constant at default value.
424
+
425
+ • sgd: vanilla stochastic gradient descent with learning rate 1e-2 (Kiefer & Wolfowitz, 1952).
426
+ • rmsprop: RMSProp with learning rate 1e-3 (Tieleman & Hinton, 2012).
427
+ • adam: Adam with learning rate 1e-3 (Kingma & Ba, 2015).
428
+
429
+ # D.2 Summary scores
430
+
431
+ Each bsuite experiment outputs a summary score in [0,1]. We aggregate these scores by according to key experiment type, according to the standard analysis notebook. A detailed analysis of each of these experiments may be found in a notebook hosted on Colaboratory: bit.ly/bsuite-optim.
432
+
433
+ ![](images/3970f5b55d39aec9dd37b475a8a48c52557bc12b476d7443288e3855238f2303.jpg)
434
+ Figure 8: A snapshot of agent behaviour.
435
+
436
+ ![](images/29de21ce937e30d387d018c4a6adbd7d4049d57c4a4eeb7d887202c84d55c374.jpg)
437
+ Figure 9: Score for each bsuite experiment.
438
+
439
+ # D.3 Results commentary
440
+
441
+ Both RMSProp and Adam perform better than SGD in every category. In most categories, Adam slightly outperforms RMSprop, although this difference is much more minor. SGD performs particularly badly on environments that require generalization and/or scale. This is not particularly surprising, since we expect the non-adaptive SGD may be more sensitive to learning rate optimization or annealing.
442
+
443
+ In Figure 11 we can see that the differences are particularly pronounced on the cartpole domains. We hypothesize that this task requires more efficient neural network optimization, and the nonadaptive SGD is prone to numerical issues.
444
+
445
+ # E bsuite report: ensemble size in Bootstrapped DQN
446
+
447
+ The Behaviour Suite for Reinforcement Learning, or bsuite for short, is a collection of carefully-designed experiments that investigate core capabilities of a reinforcement learning (RL) agent. The aim of the bsuite project is to collect clear, informative and scalable problems that capture key issues in the design of efficient and general learning algorithms and study agent behaviour through their performance on these shared benchmarks. This report provides a snapshot of agent performance on bsuite2019, obtained by running the experiments from github.com/deepmind/bsuite (Osband et al., 2019).
448
+
449
+ # E.1 Agent definition
450
+
451
+ In this experiment, all agents correspond to different instantiations of a Bootstrapped DQN with prior networks (Osband et al., 2016; 2018). We take the default implementation from bsuite/baselines. We investigate the effect of the number of models used in the ensemble, sweeping over {1, 3, 10, 30}.
452
+
453
+ # E.2 Summary scores
454
+
455
+ Each bsuite experiment outputs a summary score in [0,1]. We aggregate these scores by according to key experiment type, according to the standard analysis notebook. A detailed analysis of each of these experiments may be found in a notebook hosted on Colaboratory: bit.ly/bsuite-ensemble.
456
+
457
+ ![](images/2b54632e488669188b1d36b0e5ff530e9a5a96cdef42321992da3f84c21c1dca.jpg)
458
+ Figure 10: A snapshot of agent behaviour. Figure 11: Score for each bsuite experiment.
459
+
460
+ # E.3 Results commentary
461
+
462
+ Generally, increasing the size of the ensemble improves bsuite performance across the board. However, we do see signficantly decreasing returns to ensemble size, so that ensemble 30 does not perform much better than size 10. These results are not predicted by the theoretical scaling of proven bounds (Lu & Van Roy, 2017), but are consistent with previous empirical findings (Osband et al., 2017; Russo et al., 2017). The gains are most extreme in the exploration tasks, where ensemble sizes less than 10 are not able to solve large ‘deep sea’ tasks, but larger ensembles solve them reliably.
463
+
464
+ Even for large ensemble sizes, our implementation does not completely solve every cartpole swingup instance. Further examination learning curves suggests this may be due to some instability issues, which might be helped by using Double DQN to combat value overestimation (van Hasselt et al., 2016).
md/train/ryuxYmvel/ryuxYmvel.md ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HOLSTEP: A MACHINE LEARNING DATASET FOR HIGHER-ORDER LOGIC THEOREM PROVING
2
+
3
+ Cezary Kaliszyk
4
+ University of Innsbruck
5
+ cezary.kaliszyk@uibk.ac.at
6
+
7
+ François Chollet, Christian Szegedy Google Research {fchollet,szegedy}@google.com
8
+
9
+ # ABSTRACT
10
+
11
+ Large computer-understandable proofs consist of millions of intermediate logical steps. The vast majority of such steps originate from manually selected and manually guided heuristics applied to intermediate goals. So far, machine learning has generally not been used to filter or generate these steps. In this paper, we introduce a new dataset based on Higher-Order Logic (HOL) proofs, for the purpose of developing new machine learning-based theorem-proving strategies. We make this dataset publicly available under the BSD license. We propose various machine learning tasks that can be performed on this dataset, and discuss their significance for theorem proving. We also benchmark a set of simple baseline machine learning models suited for the tasks (including logistic regression, convolutional neural networks and recurrent neural networks). The results of our baseline models show the promise of applying machine learning to HOL theorem proving.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ As the usability of interactive theorem proving (ITP) systems (Harrison et al., 2014) grows, its use becomes a more common way of establishing the correctness of software as well as mathematical proofs. Today, ITPs are used for software certification projects ranging from compilers (Leroy, 2009) and operating system components (Chen et al., 2016; Klein et al., 2014), to establishing the absolute correctness of large proofs in mathematics such as the Kepler conjecture (Hales et al., 2015) and the Feit-Thomson Theorem (Gonthier et al., 2013).
16
+
17
+ For results of such significance to be possible, the theorem libraries of these ITPs must contain all necessary basic mathematical properties, accompanied with formal proofs. This means that the size of many ITP libraries can be measured in dozens of thousands of theorems (Grabowski et al., 2010; Blanchette et al., 2015) and billions of individual proof steps. While the general direction of the proofs is specified by humans (by providing the goal to prove, specifying intermediate steps, or applying certain automated tactics), the majority of such proof steps are actually found by automated reasoning-based proof search (Kaliszyk & Urban, 2015b), with very little application of machine learning techniques so far.
18
+
19
+ At the same time, fast progress has been unfolding in machine learning applied to tasks that involve logical inference, such as natural language question answering (Sukhbaatar et al., 2015), knowledge base completion (Socher et al., 2013a), automated translation (Wu et al., 2016), and premise selection in the context of theorem proving (Alemi et al., 2016). Deep learning in particular has proven to be a powerful tool for embedding semantic meaning and logical relationships into geometric spaces, specifically via models such as convolutional neural networks, recurrent neural networks, and tree-recursive neural networks. These advances strongly suggest that deep learning may have become mature enough to yield significant advances in automated theorem proving. Remarkably, it has recently become possible to build a system, AlphaGo (Silver et al., 2016), blending classical AI techniques such as Monte-Carlo tree search and modern deep learning techniques, capable of playing the game of Go at super-human levels. We should note that theorem proving and Go playing are conceptually related, since both consist in searching for specific nodes in trees of states with extremely large arity and relatively large depth, which involves node evaluation decision (how valuable is this state?) and policy decisions (which node should be expanded next?). The success of AlphaGo can thus serve as encouragement on the road to building deep learning-augmented theorem provers that would blend classical techniques developed over the past few decades with the latest machine learning advances.
20
+
21
+ Fast progress in specific machine learning verticals has occasionally been achieved thanks to the release of specialized datasets (often with associated competitions, e.g. the ImageNet dataset for large-scale image classification (Deng et al., 2009)) serving as an experimental testbed and public benchmark of current progress, thus focusing the efforts of the research community. We hope that releasing a theorem proving dataset suited for specific machine learning tasks can serve the same purpose in the vertical of applying machine learning to theorem proving.
22
+
23
+ # 1.1 CONTRIBUTION AND OVERVIEW
24
+
25
+ First, we develop a dataset for machine learning based on the proof steps used in a large interactive proof section 2. We focus on the HOL Light (Harrison, 2009) ITP, its multivariate analysis library (Harrison, 2013), as well as the formal proof of the Kepler conjecture (Hales et al., 2010). These formalizations constitute a diverse proof dataset containing basic mathematics, analysis, trigonometry, as well as reasoning about data structures such as graphs. Furthermore these formal proof developments have been used as benchmarks for automated reasoning techniques (Kaliszyk & Urban, 2014).
26
+
27
+ The dataset consists of 2,013,046 training examples and 196,030 testing examples that originate from 11,400 proofs. Precisely half of the examples are statements that were useful in the currently proven conjectures and half are steps that have been derived either manually or as part of the automated proof search but were not necessary in the final proofs. The dataset contains only proofs of non-trivial theorems, that also do not focus on computation but rather on actual theorem proving. For each proof, the conjecture that is being proven as well as its dependencies (axioms) and may be exploited in machine learning tasks. Furthermore, for each statement both its human-readable (pretty-printed) statement and a tokenization designed to make machine learning tasks more manageable are included.
28
+
29
+ Next, in section 3 we discuss the proof step classification tasks that can be attempted using the dataset, and we discuss the usefulness of these tasks in interactive and automated theorem proving. These tasks include unconditioned classification (without access to conjectures and dependencies) and conjecture-conditioned classification (with access to the conjecture) of proof steps as being useful or not in a proof. We outline the use of such classification capabilities for search space pruning and internal guidance, as well as for generation of intermediate steps or possible new lemma statements.
30
+
31
+ Finally, in section 4 we propose three baseline models for the proof step classification tasks, and we experimentally evaluate the models on the data in section 5. The models considered include both a relatively simple regression model, as well as deep learning models based on convolutional and recurrent neural networks.
32
+
33
+ # 1.2 RELATED WORK
34
+
35
+ The use of machine learning in interactive and automated theorem proving has so far focused on three tasks: premise selection, strategy selection, and internal guidance. We shortly explain these.
36
+
37
+ Given a large library of proven facts and a user given conjecture, the multi-label classification problem of selecting the facts that are most likely to lead to a successful proof of the conjecture has been usually called relevance filtering or premise selection (Alama et al., 2014). This is crucial for the efficiency of modern automation techniques for ITPs (Blanchette et al., 2016), which today can usually solve $4 0 { - } 5 0 \%$ of the conjectures in theorem proving libraries. Similarly most competitive ATPs today (Sutcliffe, 2016) implement the SInE classifier (Hoder & Voronkov, 2011).
38
+
39
+ A second theorem proving task where machine learning has been of importance is strategy selection. With the development of automated theorem provers came many parameters that control their execution. In fact, modern ATPs, such as E (Schulz, 2013) and Vampire (Kovács & Voronkov, 2013), include complete strategy description languages that allow a user to specify the orderings, weighting functions, literal selection strategies, etc. Rather than optimizing the search strategy globally, one can choose the strategy based on the currently considered problem. For this some frameworks use machine learning (Bridge et al., 2014; Kühlwein & Urban, 2015).
40
+
41
+ Finally, an automated theorem prover may use machine learning for choosing the actual inference steps. It has been shown to significantly reduce the proof search in first-order tableaux by the selection of extension steps to use (Urban et al., 2011), and has been also successfully applied in monomorphic higher-order logic proving (Färber & Brown, 2016). Data/proof mining has also been applied on the level of interactive theorem proving tactics (Duncan, 2007) to extract and reuse repeating patterns.
42
+
43
+ # 2 DATASET EXTRACTION
44
+
45
+ We focus on the HOL Light theorem prover for two reasons. First, it follows the LCF approach1). This means that complicated inferences are reduced to the most primitive ones and the data extraction related modifications can be restricted the primitive inferences and it is relatively easy to extract proof steps at an arbitrary selected level of granularity. Second, HOL Light implements higher-order logic (Church, 1940) as its foundation, which on the one hand is powerful enough to encode most of today’s formal proofs, and on the other hand allows for an easy integration of many powerful automation mechanisms (Baader & Nipkow, 1998; Paulson, 1999).
46
+
47
+ When selecting the theorems to record, we choose an intermediate approach between HOL Light ProofRecording (Obua & Skalberg, 2006) and the HOL/Import one (Kaliszyk & Krauss, 2013). The theorems that are derived by most common proof functions are extracted by patching these functions like in the former approach, and the remaining theorems are extracted from the underlying OCaml programming language interpreter. In certain cases decision procedures derive theorems to be reused in subsequent invocations. We detect such values by looking at theorems used across proof blocks and avoid extracting such reused unrelated subproofs.
48
+
49
+ All kernel-level inferences are recorded together with their respective arguments in a trace file. The trace is processed offline to extract the dependencies of the facts, detect used proof boundaries, mark the used and unused steps, and mark the training and testing examples. Only proofs that have sufficiently many used and unused steps are considered useful for the dataset. The annotated proof trace is processed again by a HOL kernel saving the actual training and testing examples originating from non-trivial reasoning steps. Training and testing examples are grouped by proof: for each proof the conjecture (statement that is finally proved), the dependencies of the theorem are constant, and a list of used and not used intermediate statements is provided. This means that the conjectures used in the training and testing sets are normally disjoint.
50
+
51
+ For each statement, whether it is the conjecture, a proof dependency, or an intermediate statement, both a fully parenthesised HOL Light human-like printout is provided, as well as a predefined tokenization. The standard HOL Light printer uses parentheses and operator priorities to make its notations somewhat similar to textbook-style mathematics, while at the same time preserving the complete unambiguity of the order of applications (this is particularly visible for associative operators). The tokenization that we propose attempts to reduce the number of parentheses. To do this we compute the maximum number of arguments that each symbol needs to be applied to, and only mark partial application. This means that fully applied functions (more than $90 \%$ of the applications) do not require neither application operators nor parentheses. Top-level universal quantifications are eliminated, bound variables are represented by their de Bruijn indices (the distance from the corresponding abstraction in the parse tree of the term) and free variables are renamed canonically. Since the Hindley-Milner type inference Hindley (1969) mechanisms will be sufficient to reconstruct the most-general types of the expressions well enough for automated-reasoning techniques Kaliszyk et al. (2015) we erase all type information. Table 1 presents some dataset statistics. The dataset, the description of the used format, the scripts used to generate it and baseline models code are available:
52
+
53
+ http://cl-informatik.uibk.ac.at/cek/holstep/
54
+
55
+ Table 1: HolStep dataset statistics
56
+
57
+ <table><tr><td></td><td>Train</td><td>Test</td><td>Positive</td><td>Negative</td></tr><tr><td>Examples</td><td>2013046</td><td>196030</td><td>1104538</td><td>1104538</td></tr><tr><td>Avg. length</td><td>503.18</td><td>440.20</td><td>535.52</td><td>459.66</td></tr><tr><td>Avg. tokens</td><td>87.01</td><td>80.62</td><td>95.48</td><td>77.40</td></tr><tr><td>Conjectures</td><td>9999</td><td>1411</td><td>-</td><td>-</td></tr><tr><td>Avg. dependencies</td><td>29.58</td><td>22.82</td><td>1</td><td>1</td></tr></table>
58
+
59
+ # 3 MACHINE LEARNING TASKS
60
+
61
+ # 3.1 TASKS DESCRIPTION
62
+
63
+ This dataset makes possible several tasks well-suited for machine learning most of which are highly relevant for theorem proving:
64
+
65
+ • Predicting whether a statement is useful in the proof of a given conjecture;
66
+ • Predicting the dependencies of a proof statement (premise selection);
67
+ • Predicting whether a statement is an important one (human named);
68
+ • Predicting which conjecture a particular intermediate statement originates from;
69
+ • Predicting the name given to a statement;
70
+ • Generating intermediate statements useful in the proof of a given conjecture;
71
+ • Generating the conjecture the current proof will lead to.
72
+
73
+ In what follows we focus on the first task: classifying proof step statements as being useful or not in the context of a given proof. This task may be further specialized into two different tasks:
74
+
75
+ • Unconditioned classification of proof steps: determining how likely a given proof is to be useful for the proof it occurred in, based solely on the content of statement (i.e. by only providing the model with the step statement itself, absent any context). Conditioned classification of proof steps: determining how likely a given proof is to be useful for the proof it occurred in, with “conditioning” on the conjecture statement that the proof was aiming to attain, i.e. by providing the model with both the step statement and the conjecture statement).
76
+
77
+ In the dataset, for every proof we provide the same number of useful and non-useful steps. As such, the proof step classification problem is a balanced two-class classification problem, where a random baseline would yield an accuracy of 0.5.
78
+
79
+ # 3.2 RELEVANCE TO INTERACTIVE AND AUTOMATED THEOREM PROVING
80
+
81
+ In the interaction with an interactive theorem prover, the tasks that require most human time are: the search for good intermediate steps; the search for automation techniques able to justify the individual steps, and searching theorem proving libraries for the necessary simpler facts. These three problems directly correspond to the machine learning tasks proposed in the previous subsection. Being able to predict the usefulness of a statement will significantly improve many automation techniques. The generation of good intermediate lemmas or intermediate steps can improve level of granularity of the proof steps. Understanding the correspondence between statements and their names can allow users to search for statements in the libraries more efficiently (Aspinall & Kaliszyk, 2016). Premise selection and filtering are already used in many theorem proving systems, and generation of succeeding steps corresponds to conjecturing and theory exploration.
82
+
83
+ ![](images/821894620258089e462f597721fc7f2f41b4042c203e976e2ffdd198b87566c3.jpg)
84
+ Figure 1: Unconditioned classification model architectures.
85
+
86
+ # 4 BASELINE MODELS
87
+
88
+ For each task (conditioned and unconditioned classification), we propose three different deep learning architectures, meant to provide a baseline for the classification performance that can be achieved on this dataset. Our models cover a range of architecture features (from convolutional networks to recurrent networks), aiming at probing what characteristics of the data are the most helpful for usefulness classification.
89
+
90
+ Our models are implemented in TensorFlow (Abadi et al., 2015) using the Keras framework (Chollet, 2015). Each model was trained on a single Nvidia K80 GPU. Training only takes a few hours per model, which makes running these experiments accessible to most people (they could even be run on a laptop CPU). We are releasing all of our benchmark code as open-source software 2 so as to allow others to reproduce our results and improve upon our models.
91
+
92
+ # 4.1 UNCONDITIONED CLASSIFICATION MODELS
93
+
94
+ Our three models for this task are as follow:
95
+
96
+ • Logistic regression on top of learned token embeddings. This minimal model aims to determine to which extent simple differences between token distribution between useful and non-useful statements can be used to distinguish them. It provides an absolute floor on the performance achievable on this task. • 2-layer 1D convolutional neural network (CNN) with global maxpooling for sequence reduction. This model aims to determine the importance of local patterns of tokens. • 2-layer 1D CNN with LSTM (Hochreiter & Schmidhuber, 1997) sequence reduction. This model aims to determine the importance of order in the features sequences.
97
+
98
+ See figure 1 for a layer-by-layer description of these models.
99
+
100
+ # 4.2 CONDITIONED CLASSIFICATION MODELS
101
+
102
+ For this task, we use versions of the above models that have two siamese branches (identical branches with shared weights), with one branch processing the proof step statement being considered, and the
103
+
104
+ ![](images/a90e1dc148c2f2fa15c0165b2b7665040e764c96be2465d5ee50f0ad13c726d4.jpg)
105
+ Figure 2: Conditioned classification model architectures.
106
+
107
+ other branch processing the conjecture. Each branch outputs an embedding; these two embeddings (step embedding and conjecture embedding) are then concatenated and the classified by a fullyconnected network. See figure 2 for a layer-by-layer description of these models.
108
+
109
+ # 4.3 INPUT STATEMENTS ENCODING
110
+
111
+ It should be noted that all of our models start with an Embedding layer, mapping tokens or characters in the statements to dense vectors in a low-dimensional space. We consider two possible encodings for presenting the input statements (proof steps and conjectures) to the Embedding layers of our models:
112
+
113
+ • Character-level encoding of the human-readable versions of the statements, where each character (out of a set of 86 unique characters) in the pretty-printed statements is mapped to a 256-dimensional dense vector. This encoding yields longer statements (training statements are 308 character long on average).
114
+ • Token-level encoding of the versions of the statements rendered with our proposed highlevel tokenization scheme. This encoding yields shorter statements (training statements are 60 token long on average), while considerably increasing the size of set of unique tokens (1993 total tokens in the training set).
115
+
116
+ Table 2: HolStep proof step classification accuracy without conditioning
117
+
118
+ <table><tr><td></td><td>Logistic regression</td><td>1D CNN</td><td>1D CNN-LSTM</td></tr><tr><td>Accuracy with char input</td><td>0.71</td><td>0.82</td><td>0.83</td></tr><tr><td>Accuracy with token input</td><td>0.71</td><td>0.83</td><td>0.77</td></tr></table>
119
+
120
+ Table 3: HolStep proof step classification accuracy with conditioning
121
+
122
+ <table><tr><td></td><td>Logistic regression</td><td>Siamese 1D CNN</td><td>Siamese 1D CNN-LSTM</td></tr><tr><td>Accuracy with char input</td><td>0.71</td><td>0.81</td><td>0.83</td></tr><tr><td>Accuracy with token input</td><td>0.71</td><td>0.82</td><td>0.77</td></tr></table>
123
+
124
+ # 5 RESULTS
125
+
126
+ Experimental results are presented in tables 2 and 3, as well as figs. 3 to 6.
127
+
128
+ # 5.1 INFLUENCE OF MODEL ARCHITECTURE
129
+
130
+ Our unconditioned logistic regression model yields an accuracy of $71 \%$ , both with character encoding and token encoding (tables 2 and 3). This demonstrates that differences in token or character distributions between useful and non-useful steps alone, absent any context, is sufficient for discriminating between useful and non-useful statements to a reasonable extent. This also demonstrates that the token encoding is not fundamentally more informative than raw character-level statements.
131
+
132
+ Additionally, our unconditioned 1D CNN model yields an accuracy of $82 \%$ to $83 \%$ , both with character encoding and token encoding (tables 2 and 3). This demonstrates that patterns of characters or patterns of tokens are considerably more informative than single tokens for the purpose of usefulness classification.
133
+
134
+ Finally, our unconditioned convolutional-recurrent model does not improve upon the results of the 1D CNN, which indicates that our models are not able to meaningfully leverage order in the feature sequences into which the statements are encoded.
135
+
136
+ # 5.2 INFLUENCE OF INPUT ENCODING
137
+
138
+ For the logistic regression model and the 2-layer 1D CNN model, the choice of input encoding seems to have little impact. For the convolutional-recurrent model, the use of the high-level tokenization seems to cause a large decrease in model performance (figs. 4 and 6). This may be due to the fact that token encoding yields shorter sequences, making the use of a LSTM less relevant.
139
+
140
+ # 5.3 INFLUENCE OF CONDITIONING ON THE CONJECTURE
141
+
142
+ None of our conditioned models appear to be able to improve upon the unconditioned models, which indicates that our architectures are not able to leverage the information provided by the conjecture. The presence of the conditioning does however impact the training profile of our models, in particular by making the 1D CNN model converge faster and overfit significantly quicker (figs. 5 and 6).
143
+
144
+ # 6 CONCLUSIONS
145
+
146
+ Our baseline deep learning models, albeit fairly weak, are still able to predict statement usefulness with a remarkably high accuracy. Such methods already help first-order automated provers (Kaliszyk & Urban, 2015a) and as the branching factor is higher in HOL the predictions are valuable for a number of practical proving applications. This includes making tableaux-based (Paulson, 1999) and superposition-based (Hurd, 2003) internal ITP proof search significantly more efficient in turn making formalization easier. However, our models do not appear to be able to leverage order in the input sequences, nor conditioning on the conjectures. This is due to the fact that these models are not doing any form of logical reasoning on their input statements; rather they are doing simple pattern matching at the level of n-grams of characters or tokens. This shows the need to focus future efforts on different models that can do reasoning, or alternatively, on systems that blend explicit reasoning (e.g. graph search) with deep learning-based feature learning. A potential new direction would be to leverage the graph structure of HOL statements using e.g. Recursive Neural Tensor Networks (Socher et al., 2013a;b) or other graph-based recursive architectures.
147
+
148
+ ![](images/a005d1a27b1ed2c048eb84bbd78e94445bdeed1aa42302235e5adc5fb5947e63.jpg)
149
+ Figure 3: Training profile of the three unconditioned baseline models with character input.
150
+
151
+ ![](images/b47242ae74d391eb24307af379669fb0a56e2025f35168a81905c69493fd7b4d.jpg)
152
+ Figure 4: Training profile of the three unconditioned baseline models with token input.
153
+
154
+ ![](images/17c7f989c97c9e8b86b4fe265a96619c2f7ea88a5e06b21d6c64ceddf2338aa8.jpg)
155
+ Figure 5: Training profile of the three conditioned baseline models with character input.
156
+
157
+ ![](images/87d44006190fe92d90fd54144f8b0605b42092602e67eff4e886c823b46d4a17.jpg)
158
+ Figure 6: Training profile of the three conditioned baseline models with token input.
159
+
160
+ # 6.1 FUTURE WORK
161
+
162
+ The dataset focuses on one interactive theorem prover. It would be interesting if the proposed techniques generalize, primarily across ITPs that use the same foundational logic, for example using OpenTheory (Hurd, 2011), and secondarily across fundamentally different ITPs or even ATPs. A significant part of the unused steps originates from trying to fulfill the conditions for rewriting and from calls to intuitionistic tableaux. The main focus is however on the human found proofs so the trained predictions may to an extent mimic the bias on the usefulness in the human proofs. As ATPs are at the moment very week in comparison with human intuition improving this even for the many proofs humans do not find difficult would be an important gain.
163
+
164
+ Finally, two of the proposed task for the dataset have been premise selection and intermediate sentence generation. It would be interesting to define more ATP-based ways to evaluate the selected premises, as well as to evaluate generated sentences (Kaliszyk et al., 2015). The set is a relatively large one when it comes to proof step classification, however the number of available premises makes the set a medium-sized set for premise selection in comparison with those of the Mizar Mathematical Library or the seL4 development.
165
+
166
+ # ACKNOWLEDGEMENTS
167
+
168
+ The first author was partly supported by the ERC starting grant 714034.
169
+
170
+ # REFERENCES
171
+
172
+ Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
173
+
174
+ Jesse Alama, Tom Heskes, Daniel Kühlwein, Evgeni Tsivtsivadze, and Josef Urban. Premise selection for mathematics by corpus analysis and kernel methods. J. Autom. Reasoning, 52(2): 191–213, 2014. doi: 10.1007/s10817-013-9286-5.
175
+
176
+ Alex A. Alemi, François Chollet, Geoffrey Irving, Christian Szegedy, and Josef Urban. DeepMath – Deep sequence models for premise selection. In Daniel D. Lee, Masashi Sugiyama, Ulrike V. Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems (NIPS 2016), pp. 2235–2243, 2016. URL https://arxiv.org/abs/1606.04442.
177
+
178
+ David Aspinall and Cezary Kaliszyk. What’s in a theorem name? In Jasmin Christian Blanchette and Stephan Merz (eds.), Interactive Theorem Proving (ITP 2016), volume 9807 of LNCS, pp. 459–465. Springer, 2016. doi: 10.1007/978-3-319-43144-4.
179
+
180
+ Franz Baader and Tobias Nipkow. Term rewriting and all that. Cambridge University Press, 1998. ISBN 978-0-521-45520-6.
181
+
182
+ Jasmin C. Blanchette, Cezary Kaliszyk, Lawrence C. Paulson, and Josef Urban. Hammering towards QED. J. Formalized Reasoning, 9(1):101–148, 2016. ISSN 1972-5787. doi: 10.6092/issn. 1972-5787/4593.
183
+
184
+ Jasmin Christian Blanchette, Maximilian P. L. Haslbeck, Daniel Matichuk, and Tobias Nipkow. Mining the Archive of Formal Proofs. In Manfred Kerber, Jacques Carette, Cezary Kaliszyk, Florian Rabe, and Volker Sorge (eds.), Intelligent Computer Mathematics (CICM 2015), volume 9150 of LNCS, pp. 3–17. Springer, 2015.
185
+
186
+ James P. Bridge, Sean B. Holden, and Lawrence C. Paulson. Machine learning for first-order theorem proving - learning to select a good heuristic. J. Autom. Reasoning, 53(2):141–172, 2014. doi: 10.1007/s10817-014-9301-5.
187
+
188
+ Haogang Chen, Daniel Ziegler, Tej Chajed, Adam Chlipala, M. Frans Kaashoek, and Nickolai Zeldovich. Using crash Hoare logic for certifying the FSCQ file system. In Ajay Gulati and Hakim Weatherspoon (eds.), USENIX 2016. USENIX Association, 2016.
189
+
190
+ François Chollet. Keras. https://github.com/fchollet/keras, 2015.
191
+
192
+ Alonzo Church. A formulation of the simple theory of types. J. Symb. Log., 5(2):56–68, 1940. doi: 10.2307/2266170. URL http://dx.doi.org/10.2307/2266170.
193
+
194
+ 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.
195
+
196
+ Hazel Duncan. The Use of Data-Mining for the Automatic Formation of Tactics. PhD thesis, University of Edinburgh, 2007.
197
+
198
+ Michael Färber and Chad E. Brown. Internal guidance for Satallax. In Nicola Olivetti and Ashish Tiwari (eds.), International Joint Conference on Automated Reasoning (IJCAR 2016), volume 9706 of LNCS, pp. 349–361. Springer, 2016. doi: 10.1007/978-3-319-40229-1.
199
+
200
+ Georges Gonthier, Andrea Asperti, Jeremy Avigad, Yves Bertot, Cyril Cohen, François Garillot, Stéphane Le Roux, Assia Mahboubi, Russell O’Connor, Sidi Ould Biha, Ioana Pasca, Laurence Rideau, Alexey Solovyev, Enrico Tassi, and Laurent Théry. A machine-checked proof of the odd order theorem. In Sandrine Blazy, Christine Paulin-Mohring, and David Pichardie (eds.), Interactive Theorem Proving (ITP 2013), volume 7998 of LNCS, pp. 163–179. Springer, 2013.
201
+
202
+ Michael J. C. Gordon, Robin Milner, and Christopher P. Wadsworth. Edinburgh LCF, volume 78 of Lecture Notes in Computer Science. Springer, 1979. ISBN 3-540-09724-4. doi: 10.1007/ 3-540-09724-4. URL http://dx.doi.org/10.1007/3-540-09724-4.
203
+
204
+ Adam Grabowski, Artur Kornilowicz, and Adam Naumowicz. Mizar in a nutshell. J. Formalized Reasoning, 3(2):153–245, 2010. doi: 10.6092/issn.1972-5787/1980.
205
+
206
+ Thomas Hales, John Harrison, Sean McLaughlin, Tobias Nipkow, Steven Obua, and Roland Zumkeller. A revision of the proof of the Kepler Conjecture. Discrete & Computational Geometry, 44(1):1–34, 2010.
207
+
208
+ Thomas C. Hales, Mark Adams, Gertrud Bauer, Dat Tat Dang, John Harrison, Truong Le Hoang, Cezary Kaliszyk, Victor Magron, Sean McLaughlin, Thang Tat Nguyen, Truong Quang Nguyen, Tobias Nipkow, Steven Obua, Joseph Pleso, Jason Rute, Alexey Solovyev, An Hoai Thi Ta, Trung Nam Tran, Diep Thi Trieu, Josef Urban, Ky Khac Vu, and Roland Zumkeller. A formal proof of the Kepler conjecture. CoRR, abs/1501.02155, 2015.
209
+
210
+ John Harrison. HOL Light: An overview. In Stefan Berghofer, Tobias Nipkow, Christian Urban, and Makarius Wenzel (eds.), Theorem Proving in Higher Order Logics (TPHOLs 2009), volume 5674 of LNCS, pp. 60–66. Springer, 2009.
211
+
212
+ John Harrison. The HOL Light theory of Euclidean space. J. Autom. Reasoning, 50(2):173–190, 2013. doi: 10.1007/s10817-012-9250-9.
213
+
214
+ John Harrison, Josef Urban, and Freek Wiedijk. History of interactive theorem proving. In Jörg Siekmann (ed.), Handbook of the History of Logic vol. 9 (Computational Logic), pp. 135–214. Elsevier, 2014.
215
+
216
+ R. Hindley. The principal type-scheme of an object in combinatory logic. Transactions of the american mathematical society, 146:29–60, 1969. ISSN 0002-9947.
217
+
218
+ Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
219
+
220
+ Kryštof Hoder and Andrei Voronkov. Sine qua non for large theory reasoning. In Nikolaj Bjørner and Viorica Sofronie-Stokkermans (eds.), CADE-23, volume 6803 of LNAI, pp. 299–314. Springer, 2011.
221
+
222
+ Joe Hurd. First-order proof tactics in higher-order logic theorem provers. In Myla Archer, Ben Di Vito, and César Muñoz (eds.), Design and Application of Strategies/Tactics in Higher Order Logics (STRATA 2003), number NASA/CP-2003-212448 in NASA Technical Reports, pp. 56–68, September 2003. URL http://www.gilith.com/research/papers.
223
+
224
+ Joe Hurd. The OpenTheory standard theory library. In Mihaela Gheorghiu Bobaru, Klaus Havelund, Gerard J. Holzmann, and Rajeev Joshi (eds.), NASA Formal Methods (NFM 2011), volume 6617 of LNCS, pp. 177–191. Springer, 2011.
225
+
226
+ Cezary Kaliszyk and Alexander Krauss. Scalable LCF-style proof translation. In Sandrine Blazy, Christine Paulin-Mohring, and David Pichardie (eds.), Interactive Theorem Proving (ITP 2013), volume 7998 of LNCS, pp. 51–66. Springer, 2013.
227
+
228
+ Cezary Kaliszyk and Josef Urban. Learning-assisted automated reasoning with Flyspeck. J. Autom. Reasoning, 53(2):173–213, 2014. doi: 10.1007/s10817-014-9303-3.
229
+
230
+ Cezary Kaliszyk and Josef Urban. FEMaLeCoP: Fairly efficient machine learning connection prover. In Martin Davis, Ansgar Fehnker, Annabelle McIver, and Andrei Voronkov (eds.), 20th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning (LPAR 2015), volume 9450 of LNCS, pp. 88–96. Springer, 2015a. doi: 10.1007/978-3-662-48899-7.
231
+
232
+ Cezary Kaliszyk and Josef Urban. Learning-assisted theorem proving with millions of lemmas. J. Symbolic Computation, 69:109–128, 2015b. doi: 10.1016/j.jsc.2014.09.032.
233
+
234
+ Cezary Kaliszyk, Josef Urban, and Jiˇrí Vyskocil. Learning to parse on aligned corpora. In Christian ˇ Urban and Xingyuan Zhang (eds.), Proc. 6h Conference on Interactive Theorem Proving (ITP’15), volume 9236 of LNCS, pp. 227–233. Springer-Verlag, 2015. doi: 10.1007/978-3-319-22102-1_ 15.
235
+
236
+ Gerwin Klein, June Andronick, Kevin Elphinstone, Toby C. Murray, Thomas Sewell, Rafal Kolanski, and Gernot Heiser. Comprehensive formal verification of an OS microkernel. ACM Trans. Comput. Syst., 32(1):2, 2014.
237
+
238
+ Laura Kovács and Andrei Voronkov. First-order theorem proving and Vampire. In Natasha Sharygina and Helmut Veith (eds.), Computer-Aided Verification (CAV 2013), volume 8044 of LNCS, pp. 1–35. Springer, 2013.
239
+
240
+ Daniel Kühlwein and Josef Urban. MaLeS: A framework for automatic tuning of automated theorem provers. J. Autom. Reasoning, 55(2):91–116, 2015. doi: 10.1007/s10817-015-9329-1.
241
+
242
+ Xavier Leroy. Formal verification of a realistic compiler. Commun. ACM, 52(7):107–115, 2009.
243
+
244
+ Steven Obua and Sebastian Skalberg. Importing HOL into Isabelle/HOL. In Ulrich Furbach and Natarajan Shankar (eds.), International Joint Conference on Automated Reasoning (IJCAR 2006), volume 4130 of LNCS, pp. 298–302. Springer, 2006.
245
+
246
+ Lawrence C. Paulson. A generic tableau prover and its integration with Isabelle. J. Universal Computer Science, 5(3):73–87, 1999.
247
+
248
+ Stephan Schulz. System description: E 1.8. In Kenneth L. McMillan, Aart Middeldorp, and Andrei Voronkov (eds.), Logic for Programming, Artificial Intelligence (LPAR 2013), volume 8312 of LNCS, pp. 735–743. Springer, 2013.
249
+
250
+ David Silver, Aja Huang, Christopher J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529:484–503, 2016. URL http://www.nature.com/nature/journal/v529/n7587/full/nature16961.html.
251
+
252
+ Richard Socher, Danqi Chen, Christopher D. Manning, and Andrew Y. Ng. Reasoning with neural tensor networks for knowledge base completion. In Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings., pp. 926–934, 2013a. URL http://papers.nips.cc/paper/ 5028-reasoning-with-neural-tensor-networks-for-knowledge-base-completion.
253
+
254
+ Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. $\mathrm { N g }$ , 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, pp. 1631–1642, Stroudsburg, PA, October 2013b. Association for Computational Linguistics.
255
+
256
+ Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in Neural Information Processing Systems, pp. 2431–2439, 2015.
257
+
258
+ Geoff Sutcliffe. The CADE ATP system competition - CASC. AI Magazine, 37(2):99–101, 2016.
259
+
260
+ Josef Urban, Jiˇrí Vyskocil, and Petr Št ˇ epánek. MaLeCoP: Machine learning connection prover. In ˇ Kai Brünnler and George Metcalfe (eds.), TABLEAUX 2011, volume 6793 of LNCS. Springer, 2011.
261
+
262
+ Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144, 2016. URL http://arxiv.org/abs/1609.08144.
md/train/ryxY73AcK7/ryxY73AcK7.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/ud-WYSo9JSL/ud-WYSo9JSL.md ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Can contrastive learning avoid shortcut solutions?
2
+
3
+ Joshua RobinsonMIT CSAIL & LIDSjoshrob@mit.edu
4
+
5
+ Li Sun University of Pittsburgh lis118@pitt.edu
6
+
7
+ Ke Yu University of Pittsburgh yu.ke@pitt.edu
8
+
9
+ Kayhan Batmanghelich University of Pittsburgh kayhan@pitt.edu
10
+
11
+ Stefanie Jegelka MIT CSAIL stefje@csail.mit.edu
12
+
13
+ Suvrit Sra
14
+ MIT LIDS
15
+ suvrit@mit.edu
16
+
17
+ # Abstract
18
+
19
+ The generalization of representations learned via contrastive learning depends crucially on what features of the data are extracted. However, we observe that the contrastive loss does not always sufficiently guide which features are extracted, a behavior that can negatively impact the performance on downstream tasks via “shortcuts”, i.e., by inadvertently suppressing important predictive features. We find that feature extraction is influenced by the difficulty of the so-called instance discrimination task (i.e., the task of discriminating pairs of similar points from pairs of dissimilar ones). Although harder pairs improve the representation of some features, the improvement comes at the cost of suppressing previously well represented features. In response, we propose implicit feature modification (IFM), a method for altering positive and negative samples in order to guide contrastive models towards capturing a wider variety of predictive features. Empirically, we observe that IFM reduces feature suppression, and as a result improves performance on vision and medical imaging tasks. The code is available at: https://github. com/joshr17/IFM.
20
+
21
+ # 1 Introduction
22
+
23
+ Representations trained with contrastive learning are adept at solving various vision tasks including classification, object detection, instance segmentation, and more [5, 15, 44]. In contrastive learning, encoders are trained to discriminate pairs of positive (similar) inputs from a selection of negative (dissimilar) pairs. This task is called instance discrimination: It is often framed using the InfoNCE loss [14, 33], whose minimization forces encoders to extract input features that are sufficient to discriminate similar and dissimilar pairs.
24
+
25
+ However, learning features that are discriminative during training does not guarantee a model will generalize. Many studies find inductive biases in supervised learning toward simple “shortcut” features and decision rules [16, 21, 32] which result in unpredictable model behavior under perturbations [22, 43] and failure outside the training distribution [2, 37]. Simplicity bias has various potential sources [11] including training methods [8, 29, 41] and architecture design [10, 17]. Bias towards shortcut decision rules also hampers transferability in contrastive learning [4], where it is in addition influenced by the instance discrimination task. These difficulties lead us to ask: can the contrastive instance discrimination task itself be modified to avoid learning shortcut solutions?
26
+
27
+ We approach this question by studying the relation between contrastive instance discrimination and feature learning. First, we theoretically explain why optimizing the InfoNCE loss alone does not guarantee avoidance of shortcut solutions that suppress (i.e., discard) certain input features [4, 11]. Second, despite this negative result, we show that it is still possible to trade off representation of one feature for another using simple methods for adjusting the difficulty of instance discrimination. However, these methods have an important drawback: improved learning of one feature often comes at the cost of harming another. That is, feature suppression is still prevalent. In response, we propose implicit feature modification, a technique that encourages encoders to discriminate instances using multiple input features. Our method introduces no computational overhead, reduces feature suppression (without trade-offs), and improves generalization on various downstream tasks.
28
+
29
+ ![](images/d6fbf1d29fd523c967273ded3a7ee69208a51fd99337cc1bb6d7349925dbcce9.jpg)
30
+ Figure 1: An ideal encoder would discriminate between instances using multiple distinguishing features instead of finding simple shortcuts that suppress features. We show that InfoNCE-trained encoders can suppress features (Sec. 2.2). However, making instance discrimination harder during training can trade off representation of different features (Sec. 2.3). To avoid the need for trade-offs we propose implicit feature modification (Sec. 3), which reduces suppression in general, and improves generalization (Sec. 4).
31
+
32
+ Contributions. In summary, this paper makes the following main contributions:
33
+
34
+ 1. It analyzes feature suppression in contrastive learning, and explains why feature suppression can occur when optimizing the InfoNCE loss. 2. It studies the relation between instance discrimination tasks and feature learning; concretely, adjustments to instance discrimination difficulty leads to different features being learned. 3. It proposes implicit feature modification, a simple and efficient method that reduces the tendency to use feature suppressing shortcut solutions and improves generalization.
35
+
36
+ # 1.1 Related work
37
+
38
+ Unsupervised representation learning is enjoying a renaissance driven by steady advances in effective frameworks [3, 5, 15, 18, 33, 44, 45, 51]. As well as many effective contrastive methods, Siamese approaches that avoid representation collapse without explicitly use of negatives have also been proposed [6, 13, 51]. Pretext task design has been at the core of progress in self-supervised learning. Previously popular tasks include image colorization [54] and inpainting [35], and theoretical work shows pre-trained encoders can provably generalize if a pretext task necessitates the learning of features that solve downstream tasks [27, 39]. In contrastive learning, augmentation strategies are a key design component [5, 48, 50], as are negative mining techniques [9, 15, 25, 40]. While feature learning in contrastive learning has received less attention, recent work finds that low- and mid-level features are more important for transfer learning [55], and feature suppression can occur [4] just as with supervised learning [10, 16]. Combining contrastive learning with an auto-encoder has also been considered [28], but was found to harm representation of some features in order to avoid suppression of others. Our work is distinguished from prior work through our focus on how the design of the instance discrimination task itself affects which features are learned.
39
+
40
+ # 2 Feature suppression in contrastive learning
41
+
42
+ Feature suppression refers to the phenomenon where, in the presence of multiple predictive input features, a model uses only a subset of them and ignores the others. The selected subset often corresponds to intuitively “simpler” features, e.g., color as opposed to shape. Such features lead to “shortcut” decision rules that might perform well on training data, but can harm generalization and lead to poor robustness to data shifts. Feature suppression has been identified as a common problem in deep learning [11], and both supervised and contrastive learning suffer from biases induced by the choice of optimizer and architecture. However, contrastive learning bears an additional potential source of bias: the choice of instance discrimination task. Which positive and negative pairs are presented critically affects which features are discriminative, and hence which features are learned. In this work we study the relation between feature suppression and instance discrimination.
43
+
44
+ First, we explain why optimizing the InfoNCE loss is insufficient in general to avoid feature suppression, and show how it can lead to counter-intuitive generalization (Sec. 2.2). Given this negative result, we then ask if it is at least possible to control which features a contrastive encoder learns? We find that this is indeed the case, and that adjustments to the instance discrimination task lead to different features being learned (Sec. 2.3). However, the primary drawback of these adjustments is that improving one feature often comes at the cost of harming representation of another. That is, feature suppression is still prevalent. Addressing this drawback is the focus of Sec. 3.
45
+
46
+ # 2.1 Setup and definition of feature suppression
47
+
48
+ Formally, we assume that the data has underlying feature spaces ${ \mathcal { Z } } ^ { 1 } , \ldots , { \mathcal { Z } } ^ { n }$ with a distribution $p _ { j }$ on each $\mathcal { Z } ^ { j }$ . Each $j \in [ n ]$ , corresponding to a latent space $\mathcal { Z } ^ { j }$ , models a distinct feature. We write the product as $\begin{array} { r } { \mathcal { Z } ^ { S } = \prod _ { j \in S } \mathcal { Z } ^ { j } } \end{array}$ , and simply write $\mathcal { Z }$ instead of $\mathcal { Z } ^ { [ n ] }$ where $[ n ] = \{ 1 , \dots , n \}$ . A set of features $z = ( z ^ { j } ) _ { j \in [ n ] } \in \mathcal { Z }$ is generated by sampling each coordinate $z ^ { j } \in \mathcal { Z } ^ { j }$ independently, and we denote the measure on $\mathcal { Z }$ induced by $z$ by $\lambda$ . Further, let $\lambda ( \cdot | z ^ { S } )$ denote the conditional measure on $\mathcal { Z }$ for fixed $z ^ { S }$ . For $S \subseteq [ n ]$ we use $\dot { z } ^ { S }$ to denote the projection of $z$ onto $\mathcal { Z } ^ { S }$ . Finally, an injective map $g : { \mathcal { Z } } { \mathcal { X } }$ produces observations $x = g ( z )$ .
49
+
50
+ Our aim is to train an encoder $f : \mathcal { X } \to \mathbb { S } ^ { d - 1 }$ to map input data $x$ to the surface of the unit sphere $\mathbb { S } ^ { d - 1 } = \{ u \in \mathbb { R } ^ { d } : \| u \| _ { 2 } = 1 \}$ in such a way that $f$ extracts useful information. To formally define feature suppression, we need the pushforward $h \# \nu ( V ) = \nu ( h ^ { - 1 } ( V ) )$ of a measure $\nu$ on a space $\mathcal { U }$ for a measurable map $h : \mathcal { U } \to \mathcal { V }$ and measurable $V \subseteq \nu$ , where $\dot { h } ^ { - 1 } ( V )$ denotes the preimage.
51
+
52
+ Consider an encoder $f : \mathcal { X } \to \mathbb { S } ^ { d - 1 }$ and features $S \subseteq [ n ]$ . For each $z ^ { S } \in \mathcal { Z } ^ { S }$ , let $\mu ( \cdot | z ^ { S } ) =$ $( f \circ g ) \# \lambda ( \cdot | z ^ { S } )$ be the pushforward measure on $\mathbb { S } ^ { d - 1 }$ by $f \circ g$ of the conditional $\lambda ( \cdot | z ^ { S } )$ .
53
+
54
+ 1. $f$ suppresses $S$ if for any pair $z ^ { S } , { \bar { z } } ^ { S } \in { \mathcal { Z } } ^ { S }$ , we have $\mu ( \cdot | z ^ { S } ) = \mu ( \cdot | \bar { z } ^ { S } )$ .
55
+
56
+ 2. $f$ distinguishes $S$ if for any pair of distinct $z ^ { S } , { \bar { z } } ^ { S } \in { \mathcal { Z } } ^ { S }$ , measures $\mu ( \cdot | z ^ { S } ) , \mu ( \cdot | \bar { z } ^ { S } )$ have disjoint support.
57
+
58
+ Feature suppression is thus captured in a distributional manner, stating that $S$ is suppressed if the encoder distributes inputs in a way that is invariant to the value $z ^ { S }$ . Distinguishing features, meanwhile, asks that the encoder $f$ separates points with different features $z ^ { S }$ into disjoint regions. We consider training an encoder $f : \mathcal { X } \to \mathbb { S } ^ { d - 1 }$ to optimize the InfoNCE loss [33, 14],
59
+
60
+ $$
61
+ \begin{array} { r } { \mathcal { L } _ { m } ( f ) = \mathbb { E } _ { x , x ^ { + } , \{ x _ { i } ^ { - } \} _ { i = 1 } ^ { m } } \bigg [ - \log \frac { e ^ { f ( x ) ^ { \top } f ( x ^ { + } ) / \tau } } { e ^ { f ( x ) ^ { \top } f ( x ^ { + } ) / \tau } + \sum _ { i = 1 } ^ { m } e ^ { f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) / \tau } } \bigg ] , } \end{array}
62
+ $$
63
+
64
+ where $\tau$ is known as the temperature. Positive pairs $x , x ^ { + }$ are generated by first sampling $z \sim \lambda$ , then independently sampling two random augmentations $a , a ^ { + } \sim A$ , $a : \mathcal { X } \to \mathcal { X }$ from a distribution $\mathcal { A }$ , and setting $x = a ( g ( z ) )$ and $x ^ { + } = a ^ { + } ( g ( z ) )$ . We assume $\mathcal { A }$ samples the identity function $a ( x ) = x$ with non-zero probability (“ $x$ is similar to itself”), and that there are no collisions: $a ( x ) \neq a ^ { \prime } ( x ^ { \prime } )$ for all $a , a ^ { \prime }$ , and all $x \neq x ^ { \prime }$ . Each negative example $\boldsymbol { x } _ { i } ^ { - }$ is generated as $x _ { i } ^ { - } = a _ { i } ( g ( z _ { i } ) )$ , by independently sampling features $z _ { i } \sim \lambda$ and an augmentation $a _ { i } \sim { \mathcal { A } }$ .
65
+
66
+ # 2.2 Why optimizing the InfoNCE loss can still lead to feature suppression
67
+
68
+ Do optimal solutions to the InfoNCE loss automatically avoid shortcut solutions? Unfortunately, as we show in this section, this is not the case in general; there exist both optimal solutions of the InfoNCE loss that do and solutions that do not suppress a given feature. Following previous work [40, 49, 56], we analyze the loss as the number of negatives goes to infinity,
69
+
70
+ $$
71
+ \begin{array} { r l } { \stackrel { \cdot } { = } \underset { m \infty } { \operatorname* { l i m } } \{ \mathcal { L } _ { m } ( f ) - \log m - \frac { 2 } { \tau } \} = \frac { 1 } { 2 \tau } \mathbb { E } _ { x , x ^ { + } } \Vert f ( x ) - f ( x ^ { + } ) \Vert ^ { 2 } + \mathbb { E } _ { x ^ { + } } \log [ \mathbb { E } _ { x ^ { - } } e ^ { f ( x ^ { + } ) ^ { \top } f ( x ^ { - } ) / \tau } ] . } \end{array}
72
+ $$
73
+
74
+ We subtract $\log m$ to ensure the limit is finite, and use $x ^ { - }$ to denote a random sample with the same distribution as $\boldsymbol { x } _ { i } ^ { - }$ . Prop. 2.2 (proved in App. A) shows that, assuming the marginals $p _ { j }$ are uniform, the InfoNCE loss is optimized both by encoders that suppress feature $j$ , and by encoders that distinguish $j$ .
75
+
76
+ Suppose that $p _ { j }$ is uniform on $\mathcal { Z } ^ { j } = \mathbb { S } ^ { d - 1 }$ for all $j \in [ n ]$ . Then for any feature $j \in [ n ]$ there exists an encoder $f _ { \mathrm { s u p p } }$ that suppresses feature $j$ and encoder $f _ { \mathrm { d i s c } }$ that discriminates $j$ but both attain $\operatorname* { m i n } { } _ { f }$ : measurable $\mathcal { L } ( f )$ .
77
+
78
+ The condition that $p _ { j }$ is uniformly distributed on $\mathcal { Z } ^ { j } = \mathbb { S } ^ { d - 1 }$ is similar to conditions used in previous work [56]. Prop. 2.2 shows that empirical observations of feature suppression [4] (see also Fig. 3)
79
+
80
+ are not simply due to a failure to sufficiently optimize the loss, but that the possibility of feature suppression is built into the loss. What does Prop. 2.2 imply for the generalization behavior of encoders? Besides explaining why feature suppression can occur, Prop. 2.2 also suggests another counter-intuitive possibility: lower InfoNCE loss may actually lead to worse performance on some tasks.
81
+
82
+ To empirically study whether this possibility manifests in practice, we use two datasets with known semantic features: (1) In the Trifeature data, [16] each image is $1 2 8 \times 1 2 8$ and has three features: color, shape, and texture, each taking possible 10 values. See Fig. 10, App. C for sample images. (2) In the STL-digits data, samples combine MNIST digits and STL10 objects by placing copies of a randomly selected MNIST digit on top of an STL10 image. See Fig. 11 App. C for sample images.
83
+
84
+ We train encoders with ResNet-18 backbone using SimCLR [5]. To study correlations between the loss value and error on downstream tasks, we train 33 encoders on Trifea
85
+
86
+ ![](images/58d9620e1c56307182ac968752d1752ee45a3c23d4152d77dc12bb6e84348c5e.jpg)
87
+ Figure 2: Linear readout error on different downstream tasks can be negatively correlated. Further, lower InfoNCE loss does not always yield not lower error: error rates on texture, shape and STL10 prediction are negatively correlated with InfoNCE loss.
88
+
89
+ ture and 7 encoders on STL-digits with different hyperparameter settings (see App. C.2 for full details on training and hyperparameters). For Trifeature, we compute the Pearson correlation between InfoNCE loss and linear readout error when predicting {color, shape, texture}. Likewise, for STL-digits we compute correlations between the InfoNCE loss and MNIST and STL10 prediction error.
90
+
91
+ Fig. 2 shows that performance on different downstream tasks is not always positively correlated. For Trifeature, color error is negatively correlated with shape and texture, while for STL-digits there is a strong negative correlation between MNIST digit error and STL10 error. Importantly, lower InfoNCE loss is correlated with lower prediction error for color and MNIST-digit, but with larger error for shape, texture and STL10. Hence, lower InfoNCE loss can improve representation of some features (color, MNIST digit), but may actually hurt others. This conflict is likely due to the simpler color and MNIST digit features being used as shortcuts. Our observation is an important addition to the statement of Wang and Isola [49] that lower InfoNCE loss improves generalization: the situation is more subtle – whether lower InfoNCE helps generalization on a task depends on the use of shortcuts.
92
+
93
+ # 2.3 Controlling feature learning via the difficulty of instance discrimination
94
+
95
+ The previous section showed that the InfoNCE objective has solutions that suppress features. Next, we ask what factors determine which features are suppressed? Is there a way to target specific features and ensure they are encoded? One idea is to use harder positive and negative examples. Hard examples are precisely those that are not easily distinguishable using the currently extracted features. So, a focus on hard examples may change the scope of the captured features. To test this hypothesis, we consider two methods for adjusting the difficulty of positive and negative samples:
96
+
97
+ 1. Temperature $\tau$ in the InfoNCE loss (Eqn. 1). Smaller $\tau$ places higher importance on positive an negative pairs with high similarity [47]. 2. Hard negative sampling method of Robinson et al. [40], which uses importance sampling to sample harder negatives. The method introduces a hardness concentration parameter $\beta$ , with larger $\beta$ corresponding to harder negatives (see [40] for full details).
98
+
99
+ Results reported in Fig. 3 (also Fig. 13 in App. C.2) show that varying instance discrimination difficulty—i.e., varying temperature $\tau$ or hardness concentration $\beta$ —enables trade-offs between which features are represented. On Trifeature, easier instance discrimination (large $\tau$ , small $\beta$ ) yields good performance on ‘color’—an “easy” feature for which a randomly initialized encoder already has high linear readout accuracy—while generalization on the harder texture and shape features is poor. The situation reverses for harder instance discrimination (small $\tau$ , large $\beta$ ). We hypothesize that the use of “easy” features with easy instance discrimination is analogous to simplicity biases in supervised deep networks [17, 21]. As with supervised learning [10, 17], we observe a bias for texture over shape in convolutional networks, with texture prediction always outperforming shape.
100
+
101
+ ![](images/ec74850ae8dbb37af5c9996ed86223161b43646369ceb4f7b0680fc8bb16fcb2.jpg)
102
+ Figure 3: Trifeature dataset [16]. The difficulty of instance discrimination affects which features are learned (Sec. 2.3). When instance discrimination is easy (big $\tau$ , small $\beta$ ), encoders represent color well and other features badly. When instance discrimination is hard (small $\tau$ , big $\beta$ ), encoders represent more challenging shape and texture features well, at the expense of color.
103
+
104
+ That there are simple levers for controlling which features are learned already distinguishes contrastive learning from supervised learning, where attaining such control is less easy (though efforts have been made [23]). However, these results show that representation of one feature must be sacrificed in exchange for learning another one better. To understand how to develop methods for improving feature representation without suppressing others, the next result (proof in App. A) examines more closely why there is a relationship between (hard) instance discrimination tasks and feature learning.
105
+
106
+ [Informal] Suppose that $p _ { j }$ is uniform on $\mathcal { Z } ^ { j } = \mathbb { S } ^ { d - 1 }$ for all $j \in [ n ]$ . Further, for $S \subseteq [ n ]$ suppose that $x , x ^ { + } , \{ x _ { i } ^ { - } \} _ { i }$ are conditioned on the event that they have the same features $S$ . Then any $f$ that minimizes the (limiting) InfoNCE loss suppresses features $S$ .
107
+
108
+ The positive and negative instances in Prop. 2.3 must be distinguished with features in $S ^ { c }$ . Relating this point to the above observations, assume that an encoder exclusively uses features $S$ . Any positives and negatives that do not (much) differ in features $S$ are difficult for the encoder. By Prop. 2.3, focusing the training on these difficult examples pushes the encoder to instead use features in $S ^ { c }$ , i.e., to learn new features. But at the same time, the proposition also says that a strong focus on such hard negative pairs leads to suppressing the originally used features $S$ , explaining the results in Fig. 3. While the two techniques for adjusting instance difficulty we studied were unable to avoid feature suppression, this insight forms the motivation for implicit feature modification, which we introduce next.
109
+
110
+ # 3 Implicit feature modification for reducing feature suppression
111
+
112
+ The previous section found that simple adjustments to instance discrimination difficulty could significantly alter which features a model learns. Prop. 2.3 suggests that this ability to modify which features are learned stems from holding features constant across positive and negative samples. However, these methods were unable to avoid trade-offs in feature representation (Fig. 3) since features that are held constant are themselves suppressed (Prop. 2.3).
113
+
114
+ To avoid this effect, we develop a technique that adaptively modifies samples to remove whichever features are used to discriminate a particular positive pair from negatives, then trains an encoder to discriminate instances using both the original features, and the features left over after modification. While a natural method for modifying features is to directly transform raw input data, it is very challenging to modify the semantics of an input in this way. So instead we propose modifying features by applying transformations to encoded samples $v = f ( x )$ . Since we modify the encoded samples, instead of raw inputs $x$ , we describe our method as implicit.
115
+
116
+ We set up our notation. Given batch $x , x ^ { + } , \{ x _ { i } ^ { - } \} _ { i = 1 } ^ { m }$ we write $ { \boldsymbol { v } } \ = \ f ( { \boldsymbol { { x } } } )$ , $v ^ { + } ~ = ~ f ( x ^ { + } )$ , and $v _ { i } ^ { - } = f ( x _ { i } ^ { - } )$ to denote the corresponding embeddings. As in Eqn. 1, the point-wise InfoNCE loss is,
117
+
118
+ $$
119
+ \ell ( v , v ^ { + } , \{ v _ { i } ^ { - } \} _ { i = 1 } ^ { m } ) = - \log \frac { e ^ { v ^ { \top } v ^ { + } / \tau } } { e ^ { v ^ { \top } v ^ { + } / \tau } + \sum _ { i = 1 } ^ { m } e ^ { v ^ { \top } v _ { i } ^ { - } / \tau } } .
120
+ $$
121
+
122
+ [Implicit feature modification] Given budget $\varepsilon \in \mathbb { R } _ { + } ^ { m }$ , and encoder $f : \mathcal { X } \to \mathbb { S } ^ { d }$ , an adversary removes features from $f$ that discriminates batch $x , \stackrel { \cdot } { x } ^ { + } , \{ x _ { i } ^ { - } \} _ { i = 1 } ^ { m }$ by maximizing the point-wise InfoNCE loss, \`"(v, v+, {vi }mi=1) = max+2B + ,{i 2B" }mi=1 \` $\begin{array} { r } { \ell _ { \varepsilon } ( v , v ^ { + } , \{ v _ { i } ^ { - } \} _ { i = 1 } ^ { m } ) = \operatorname* { m a x } _ { \delta ^ { + } \in \mathcal { B } _ { \varepsilon ^ { + } } , \{ \delta _ { i } ^ { - } \in \mathcal { B } _ { \varepsilon _ { i } } \} _ { i = 1 } ^ { m } } \ell ( v , v ^ { + } + \delta ^ { + } , \{ v _ { i } ^ { - } + \delta _ { i } ^ { - } \} _ { i = 1 } ^ { m } ) } \end{array}$ .
123
+
124
+ Here $B _ { \varepsilon }$ denotes the $\ell _ { 2 }$ -ball of radius $\varepsilon$ . Implicit feature modification (IFM) removes components of the current representations that are used to discriminate positive and negative pairs. In other words, the embeddings of positive and negative samples are modified to remove well represented features. So, if the encoder is currently using a simple shortcut solution, IFM removes the features used, thereby encouraging the encoder to also discriminate instances using other features. By applying perturbations in the embedding space IFM can modify high level semantic features (see Fig. 4), which is extremely challenging when applying perturbations in input space. In order to learn new features using the perturbed loss while still learning potentially complementary information using the original InfoNCE objective, we propose optimizing the the multi-task objective $\mathrm { m i n } _ { f } \{ \mathcal { L } ( f ) \dot { + } \alpha \mathcal { L } _ { \varepsilon } ( \dot { f } ) \} / 2$ where $\mathcal { L } _ { \varepsilon } = \mathbb { E } \ell _ { \varepsilon }$ is the adversarial perturbed loss, and $\mathcal { L }$ the standard InfoNCE loss. For simplicity, all experiments set the balancing parameter $\alpha = 1$ unless explicitly noted, and all take $\varepsilon ^ { + } , \varepsilon _ { i } ^ { - }$ to be equal, and denote this single value by $\varepsilon$ . Crucially, $\ell _ { \varepsilon }$ can be computed analytically and efficiently. For any $v , v ^ { + } , \{ v _ { i } ^ { - } \} _ { i = 1 } ^ { m } \in \bar { \mathbb { R } } ^ { d }$ we have,
125
+
126
+ $$
127
+ \nabla _ { v _ { j } ^ { - } } \ell = \frac { e ^ { v ^ { \top } v _ { j } ^ { - } / \tau } } { e ^ { v ^ { \top } v + / \tau } + \sum _ { i = 1 } ^ { m } e ^ { v ^ { \top } v _ { i } ^ { - } / \tau } } \cdot \frac { v } { \tau } \quad \mathrm { a n d } \quad \nabla _ { v ^ { + } } \ell = \left( \frac { e ^ { v ^ { \top } v ^ { + } / \tau } } { e ^ { v ^ { \top } v ^ { + } / \tau } + \sum _ { i = 1 } ^ { m } e ^ { v ^ { \top } v _ { i } ^ { - } / \tau } } - 1 \right) \cdot \frac { v } { \tau } .
128
+ $$
129
+
130
+ In particular, $\nabla _ { v _ { \bot \ldots } ^ { - } } \ell \propto v$ and $\nabla _ { v ^ { + } } \ell \propto - v$ . This expression shows that the adversary perturbs $\cdot ^ { v _ { j } ^ { - } }$ (resp. $v ^ { + }$ j) in the direction of the anchor $v$ (resp $- v ,$ ). Since the derivative directions are independent of $\{ v _ { i } ^ { - } \} _ { i = 1 } ^ { m }$ and $v ^ { + }$ , we can analytically compute optimal perturbations in $B _ { \varepsilon }$ . Indeed, following the constant ascent direction shows the optimal updates are simply $v _ { i } ^ { - } v _ { i } ^ { - } + \varepsilon _ { i } v$ and $v ^ { + } v ^ { + } - \varepsilon ^ { + } v$ . The positive (resp. negative) perturbations increase (resp. decrease) cosine similarity to the anchor $\sin ( v , v _ { i } ^ { - } + \varepsilon _ { i } v ) 1$ as $\varepsilon _ { i } \to \infty$ (resp. $\sin ( v , v ^ { + } - \bar { \varepsilon } ^ { + } v ) - 1$ as $\varepsilon ^ { + } \to \infty$ ). In Fig. 4 we visualize the newly synthesized $v _ { i } ^ { - } , v ^ { + }$ and find meaningful interpolation of semantics. Plugging the update rules for $v ^ { + }$ and ${ \boldsymbol v } _ { i } ^ { - }$ into the point-wise InfoNCE loss yields,
131
+
132
+ $$
133
+ \begin{array} { r } { \ell _ { \varepsilon } ( v , v ^ { + } , \{ v _ { i } ^ { - } \} _ { i = 1 } ^ { m } ) = - \log \frac { e ^ { ( v ^ { \top } v ^ { + } - \varepsilon ^ { + } ) / \tau } } { e ^ { ( v ^ { \top } v ^ { + } - \varepsilon ^ { + } ) / \tau } + \sum _ { i = 1 } ^ { m } e ^ { ( v ^ { \top } v _ { i } ^ { - } + \varepsilon _ { i } ) / \tau } } . } \end{array}
134
+ $$
135
+
136
+ In other words, IFM amounts to simply perturbing the logits – reduce the positive logit by $\varepsilon ^ { + } / \tau$ and increase negative logits by $\varepsilon _ { i } / \tau$ . From this we see that $\ell _ { \varepsilon }$ is automatically symmetrized in the positive samples: perturbing $v$ instead of $v ^ { + }$ results in the exact same objective. Eqn. 2 shows that IFM re-weights each negative sample by a factor $e ^ { \varepsilon _ { i } / \tau }$ and positive samples by $e ^ { - \varepsilon ^ { + } / \tau }$ .
137
+
138
+ # 3.1 Visualizing implicit feature modification
139
+
140
+ With implicit feature modification, newly synthesized data points do not directly correspond to any “true” input data point. However it is still possible to visualize the effects of implicit feature modification. To do this, assume access to a memory bank of input data $\mathcal { M } = \{ x _ { i } \} _ { i }$ . A newly synthesized sample $s$ can be approximately visualized by retrieving the 1-nearest neighbour using cosine similarity arg $\operatorname* { m i n } _ { x \in { \mathcal { M } } }$ $\sin ( s , f ( x ) )$ and viewing the image $x$ as an approximation to $s$ .
141
+
142
+ Fig. 4 shows results using a ResNet-50 encoder trained using MoCo-v2 on ImageNet1K using the training set as the memory bank. For positive pair $v , v ^ { + }$ increasing $\varepsilon$ causes the semantics of $v$ and $v ^ { + }$ to diverge. For $\varepsilon = 0 . 1$ a different car with similar pose and color is generated, for $\varepsilon = 0 . 2$ the pose and color then changes, and finally for $\varepsilon = 1$ the pose, color and type of vehicle changes. For negative pair $v , v ^ { - }$ the reverse occurs. For $\varepsilon = 0 . 1$ , $v ^ { - }$ is a vehicle with similar characteristics (number of windows, color etc.), and with $\varepsilon = 0 . 2$ , the pose of the vehicle $v ^ { + }$ aligns with $v$ . Finally for $\varepsilon = 1$ the pose and color of the perturbed negative sample become aligned to the anchor $v$ . In summary, implicit feature modification successfully modifies the feature content in positive and negative samples, thereby altering which features can be used to discriminate instances.
143
+
144
+ Related Work. Several works consider adversarial contrastive learning [19, 24, 26] using PGD (e.g. FGSM) attacks to alter samples in input space. Unlike our approach, PGD-based attacks require costly inner-loop optimization. Other work takes an adversarial viewpoint in input space for other self-supervised tasks e.g., rotations and jigsaws but uses an image-to-image network to simulate FGSM/PGD attacks [31], introducing comparable computation overheads. They note that low-level (i.e., pixel-level) shortcuts can be avoided using their method. All of these works differ from ours by applying attacks in input space, thereby focusing on lower-level features, whereas ours aims to modify high-level features. Fig. 5 compares IFM to this family of input-space adversarial methods by comparing to a top performing method ACL(DS) [24]. We find that ACL improves robust accuracy under $\ell _ { \infty }$ -attack on input space (see [24] for protocol details), whereas IFM improves standard accuracy (full details and discussion in Appdx. C.3). Synthesizing harder negatives in latent space using Mixup [53] has also been considered [25] but does not take an adversarial perspective. Other work, AdCo [20], also takes an adversarial viewpoint in latent space. There are several differences to our approach. AdCo perturbs all negatives using the same weighted combination of all the queries, whereas IFM perturbations are query specific. In other words, IFM makes instance discrimination harder point-wise, whereas AdCo perturbation makes the InfoNCE loss larger on average (see Fig. 4 for visualizations of instance dependent perturbation using IFM). AdCo also treats the negatives as learnable parameters, introducing $\sim 1 M$ more parameters and $\sim 7 \%$ computational overhead, while IFM has no computational overhead and is implemented with only two lines of code (see Tab. 1 for empirical comparison). Finally, no previous work makes the connection between suppression of semantic features and adversarial methods in contrastive learning (see Fig. 6).
145
+
146
+ ![](images/5afd711f6d1c8ba5155a029a38cb357006a49104919af8921fef36588c01ef36.jpg)
147
+ Figure 4: Visualizing implicit feature modification. Top row: progressively moving positive sample away from anchor. Bottom row: progressively moving negative sample away from anchor. In both cases, semantics such as color, orientation, and vehicle type are modified, showing the suitability of implicit feature modification for altering instance discrimination tasks.
148
+
149
+ ![](images/12e76d56fbd4c437b958a68c9ba5a8527e9b6f78defb2f0d01b3e203aa5892c9.jpg)
150
+ Figure 5: Comparison between IFM and ACL(DS). Under standard linear evaluation IFM performs best. ACL is suited to adversarial evaluation.
151
+
152
+ ![](images/13aac9c5a8c8da9fb88ce77335c13c805d3c88c58d0b67da7c450ce2eb3ce0da.jpg)
153
+ Figure 6: Trifeature dataset. Implicit feature modification reduces feature suppression, enhancing the representation of texture, shape and color features simultaneously. All results are average linear readout accuracy over three seeds and use a fixed value $\varepsilon = 0 . 1$ to illustrate robustness to $\varepsilon$ .
154
+
155
+ # 4 Experimental results
156
+
157
+ Implicit feature modification (IFM) can be used with any InfoNCE-based contrastive framework, and we write IFM-SimCLR, IFM-MoCo-v2 etc. to denote IFM applied within a specific framework. Code for IFM will be released publicly, and is also available in the supplementary material.
158
+
159
+ # 4.1 Does implicit feature modification help avoid feature suppression?
160
+
161
+ We study the effect IFM has on feature suppression by training ResNet-18 encoders for 200 epochs with $\tau \in \{ 0 . 0 5 , 0 . 2 , 0 . 5 \}$ on the Trifeature dataset [16]. Results are averaged over three seeds, with IFM using $\varepsilon = 0 . 1$ for simplicity. Fig. 6 shows that IFM improves the linear readout accuracy across all three features for all temperature settings. The capability of IFM to enhance the representation of all features – i.e. reduce reliance on shortcut solutions – is an important contrast with tuning temperature $\tau$ or using hard negatives, which Fig. 3 shows only trades-off which features are learned.
162
+
163
+ ![](images/26ba8877d15efa834c609010064f2443c1db3c4db9cb586a0504757a21b985bb.jpg)
164
+ Figure 7: IFM improves linear readout performance on all datasets for all $\varepsilon \in \{ 0 . 0 5 , 0 . 1 , 0 . 2 \}$ compared to baselines. Protocol uses 400 epochs of training with ResNet-50 backbone.
165
+
166
+ # 4.2 Performance on downstream tasks
167
+
168
+ Sec. 3.1 and Sec. 4.1 demonstrate that implicit feature modification is adept at altering high-level features of an input, and combats feature suppression. This section shows that these desirable traits translate into improved performance on object classification and medical imaging tasks.
169
+
170
+ Experimental setup for classification tasks. Having observed the positive effect IFM has on feature suppression, we next test if this feeds through to improved performance on real tasks of interest. We benchmark using both SimCLR and MoCo-v2 [5, 7] with standard data augmentation [5]. All encoders have ResNet-50 backbones and are trained for 400 epochs (with the exception of on ImageNet100, which is trained for 200 epochs). All encoders are evaluated using the test accuracy of a linear classifier trained on the full training dataset (see Appdx. C.4 for full setup details).
171
+
172
+ Classification tasks. Results given in Fig. 7 and Tab. 1 find that every value of $0 ~ < ~ \varepsilon ~ \le ~ 0 . 2$ improves performance across all datasets using both MoCo- $\nu 2$ and SimCLR frameworks. We find
173
+
174
+ <table><tr><td></td><td>MoCo-v2</td><td>AdCo [20]</td><td colspan="3">IFM-MoCo-v2</td></tr><tr><td>m</td><td>N/A</td><td>N/A</td><td>0.05</td><td>0.1</td><td>0.2</td></tr><tr><td>top-1</td><td>80.4±0.11</td><td>78.9±0.21</td><td>81.1±0.02</td><td>80.9±0.25</td><td>80.7±0.13</td></tr></table>
175
+
176
+ Table 1: Linear readout $( \% )$ ) on ImageNet100, averaged over five seeds.
177
+ IFM improves over MoCo-v2 for all settings of $\varepsilon$ .
178
+
179
+ that optimizing $\mathcal { L } _ { \varepsilon }$ $7 6 . 0 \%$ average score across all eight runs in Fig. 7) performs similarly to the standard contrastive loss $( 7 5 . 9 \%$ average score), and does worse than the IFM loss $( \mathcal { L } + \mathcal { L } _ { \varepsilon } ) \dot { / } 2$ . This suggests that $\mathcal { L }$ and $\mathcal { L } _ { \varepsilon }$ learn complementary features. Tab. 1 benchmarks IFM on ImageNet100 [44] using MoCo-v2, observing improvements of $0 . 9 \%$ . We also compare results on ImageNet100 to AdCo [20], another adversarial method for contrastive learning. We adopt the official code and use the exact same training and finetuning hyperparameters as for MoCo-v2 and IFM. For the AdCo-specific hyperparamters – negatives learning rate $l r _ { \mathrm { n e g } }$ and negatives temperature $\tau _ { \mathrm { n e g } } - \mathrm { w e }$ use a grid search over all combinations $l r _ { \mathrm { n e g } } \in \{ 1 , \bar { 2 } , 3 , 4 \}$ and $\tau _ { \mathrm { n e g } } \in \mathsf { \bar { \{ 0 . 0 2 , 0 . 1 \} } }$ , which includes the AdCo default ImageNet1K recommendations $l r _ { \mathrm { n e g } } = 3$ and $\tau _ { \mathrm { n e g } } = 0 . 0 2$ [20]. The resulting AdCo performance of $7 8 . 9 \%$ is slightly below MoCo-v2. However using their respective ImageNet1K default parameters AdCo and MoCo-v2 achieve $7 2 . 4 \%$ and $7 1 . 8 \%$ respectively, suggesting that the discrepancy between AdCo and MoCo-v2 may in part be due to the use of improved hyperparameters tuned on MoCo-v2. Note importantly, IFM is robust to the choice of $\varepsilon$ : all values $\varepsilon \in \{ 0 . 0 5 , 0 . 1 , 0 . 2 \}$ were found to boost performance across all datasets and all frameworks. We emphasize that the MoCo-v2 baseline performance of $8 0 . 5 \%$ on ImageNet100 is strong. Our hyperparameters, which we detail in Appdx. C.4.1, may be of interest to other works benchmarking MoCo-v2 on ImageNet100.
180
+
181
+ Medical images. To evaluate our method on a modality differing significantly from object-based images we consider the task of learning representations of medical images. We benchmark using the approach proposed by [42] which is a variant of MoCo-v2 that incorporates the anatomical context in the medical images. We evaluate our method on the COPDGene dataset [38], which is a multi-center observational study focused on the genetic epidemiology of Chronic obstructive pulmonary disease (COPD). See Appdx. C.5 for full background details on the COPDGene dataset, the five COPD related outcomes we use for evaluation, and our implementation. We perform regression analysis for continuous outcomes in terms of coefficient of determination (R-square), and logistic regression to predict ordinal outcomes and report the classification accuracy and the 1-off accuracy, i.e., the probability of the predicted category is within one class of true value.
182
+
183
+ Tab. 2 reports results. For fair comparison we use same experimental configuration for the baseline approach [42] and our method. We find that IFM yields improvements on all outcome predictions.
184
+
185
+ <table><tr><td>Method</td><td>logFEV1pp</td><td>logFEV1FVC</td><td>CLE</td><td>CLE1-off</td><td></td><td>Para-septalPara-septal l-off</td><td>mMRC</td><td>mMRC1-off</td></tr><tr><td>Loss</td><td colspan="2">R-Square</td><td colspan="6">Accuracy (%)</td></tr><tr><td>L(baseline)</td><td>0.566±.005</td><td>0.661±.005</td><td>49.6±0.4</td><td>81.8±0.5</td><td>55.7±0.3</td><td>84.4±0.2</td><td>50.4±0.5</td><td>72.5±0.3</td></tr><tr><td>Lg,ε=0.1</td><td>0.591±.008</td><td>0.681±.008</td><td>49.4±0.4</td><td>81.9±0.3</td><td>55.6±0.3</td><td>85.1±0.2</td><td>50.3±0.8</td><td>72.7±0.4</td></tr><tr><td>IFM,ε=0.1</td><td>0.615±.005</td><td>0.691±.006</td><td>48.2±0.8</td><td>80.6±0.4</td><td>55.3±0.4</td><td>84.7±0.3</td><td>50.4±0.5</td><td>72.8±0.2</td></tr><tr><td>IFM,ε = 0.2</td><td>0.595±.006</td><td>0.683±.006</td><td>48.5±0.6</td><td>80.5±0.6</td><td>55.3±0.3</td><td>85.1±0.1</td><td>49.8±0.8</td><td>72.0±0.3</td></tr><tr><td>IFM,ε= 0.5</td><td>0.607±.006</td><td>0.683±.005</td><td>49.6±0.4</td><td>82.0±0.3</td><td>54.9±0.2</td><td>84.7±0.2</td><td>50.6±0.4</td><td>73.1±0.2</td></tr><tr><td>IFM,ε = 1.0</td><td>0.583±.005</td><td>0.675±.006</td><td>50.0±0.5</td><td>82.9±0.4</td><td>56.3±0.6</td><td>85.7±0.2</td><td>50.3±0.6</td><td>71.9±0.3</td></tr></table>
186
+
187
+ Table 2: Linear readout performance on COPDGene dataset. The values are the average of 5-fold cross validation with standard deviations. The bold face indicates the best average performance. IFM yields improvements on all phenotype predictions.
188
+
189
+ ![](images/b3a0c0f5b45705c48026a3b939aab0886ce1f3dbd5c0de0274447ad9ce01439a.jpg)
190
+ Figure 8: Label $\left\{ \mathcal { D } , \mathcal { D } _ { \mathrm { R } } , \mathcal { D } _ { \mathrm { N R } } \right\}$ indicates which dataset was used to train the linear readout function. Improved performance of IFM on standard data $\mathcal { D }$ can be attributed to improved representation of robust features $\mathcal { D } _ { \mathrm { R } }$ . See Sec. 4.3 for construction of robust $( \mathcal { D } _ { \mathtt { R } } )$ and non-robust $( \mathcal { D } _ { \mathrm { N R } } )$ datasets.
191
+
192
+ The gain is largest on spirometry outcome prediction, particularly logFEV1pp with improvement of $8 . { \bar { 7 } } \%$ with $\varepsilon = 0 . 1$ . We found that at least $\varepsilon = 0 . 5$ and 1.0 improve performance on all tasks. However, we note that not all features yield a statistically significant improvement with IFM.
193
+
194
+ # 4.3 Further study on the impact of IFM on feature learning
195
+
196
+ This section further studies the effect implicit feature modification has on what type of features are extracted. Specifically, we consider the impact on learning of robust (higher-level) vs. non-robust features (pixel-level features). Our methodology, which is similar to that of Ilyas et al. [22] for deep supervised learning, involves carefully perturbing inputs to obtain non-robust features.
197
+
198
+ Constructing non-robust features. Given encoder $f$ we finetune a linear probe (classifier) $h$ ontop of $f$ using training data (we do not use data augmentation). Once $h$ is trained, we consider each labeled example $( x , y )$ from training data $\mathcal { D } _ { \mathrm { t r a i n } } \in \{ \mathrm { t i n y I m a g e N e t , S T L 1 0 , C I F A R 1 0 , C I F A R 1 0 0 } \}$ . A hallucinated target label $t$ is sampled uniformly at random, and we perturb $x = x _ { 0 }$ until $h \circ f$ predicts $t$ using repeated FGSM attacks [12] $x _ { k } \gets x _ { k - 1 } - \varepsilon \mathrm { s i g n } ( \nabla _ { x } \ell ( h \circ f ( x _ { k - 1 } ) , t ) )$ . At each step we check if arg maxi $h \circ f ( x _ { k } ) _ { i } = t$ (we use the maximum of logits for inference) and stop iterating and set $x _ { \mathrm { a d v } } = x _ { k }$ for the first $k$ for which the prediction is $t$ . This usually takes no more than a few FGSM steps with $\varepsilon = 0 . 0 1$ . We form a dataset of “robust” features by adding $( x _ { \mathrm { a d v } } , y )$ to $\mathcal { D } _ { R }$ , and a dataset of “non-robust” features by adding $( x _ { \mathrm { a d v } } , t )$ to $\mathcal { D } _ { N R }$ . To a human the pair $( x _ { \mathrm { a d v } } , t )$ will look mislabeled, but for the encoder $x _ { \mathrm { a d v } }$ contains features predictive of $t$ . Finally, we re-finetune (i.e. re-train) linear classifier $g$ using $\mathcal { D } _ { R }$ (resp. $\mathcal { D } _ { N R }$ ).
199
+
200
+ Fig. 8 compares accuracy of the re-finetuned models on a test set of standard $\mathcal { D } _ { \mathrm { t e s t } }$ examples (no perturbations are applied to the test set). Note that $\mathcal { D } _ { R }$ , $\mathcal { D } _ { N R }$ depend on the original encoder $f$ . When re-finetuning $f$ we always use datasets $\mathcal { D } _ { R }$ , $\mathcal { D } _ { N R }$ formed via FGSM attacks on $f$ itself. So there is one set $\mathcal { D } _ { R } , \mathcal { D } _ { N R }$ for SimCLR, and another set for IFM. Fig. 8 shows that IFM achieves superior generalization $( \mathcal { D } )$ compared to SimCLR by better representing robust features $( \mathcal { D } _ { R } )$ . Representation of non-robust features $( \mathcal { D } _ { N R } )$ is similar for IFM $( 5 \bar { 5 } . 5 \%$ average across all datasets) and SimCLR $( 5 6 . 7 \%$ average). IFM is juxtaposed to the supervised adversarial training of Madry et al., which sacrifices standard supervised performance in exchange for not using non-robust features [30, 46].
201
+
202
+ # 5 Discussion
203
+
204
+ This work studies the relation between contrastive instance discrimination and feature learning. While we focus specifically on contrastive learning, it would be of interest to also study feature learning for other empirically successful self-supervised methods [1, 6, 13, 51]. Understanding differences in feature learning biases between different methods may inform which methods are best suited for a given task, as well as point the way to further improved self-supervised techniques.
205
+
206
+ Acknowledgments SJ was supported by NSF BIGDATA award IIS-1741341, NSF Convergence Accelerator Track D 2040636. SS acknowledges support from NSF-TRIPODS $^ +$ X:RES (1839258). JR was partially supported by a Two Sigma fellowship. KB acknowledges support from NIH (1R01HL141813-01), NSF (1839332 Tripod $+ \mathrm { X }$ ), and a research grant from SAP SE Commonwealth Universal Research Enhancement (CURE) program awards research grants from the Pennsylvania Department of Health. Finally, we warmly thank Katherine Hermann and Andrew Lampinen for making the Trifeature dataset available for our use.
207
+
208
+ # References
209
+
210
+ [1] Adrien Bardes, Jean Ponce, and Yann LeCun. VICReg: Variance-invariance-covariance regularization for self-supervised learning. preprint arXiv:2105.04906, 2021.
211
+ [2] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision (ECCV), pages 456–473, 2018.
212
+ [3] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In Advances in Neural Information Processing Systems (NeurIPS), pages 9912–9924, 2020.
213
+ [4] Ting Chen and Lala Li. Intriguing properties of contrastive losses. preprint arXiv:2011.02803, 2020.
214
+ [5] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Int. Conference on Machine Learning (ICML), pages 10709–10719, 2020.
215
+ [6] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
216
+ [7] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. preprint arXiv:2003.04297, 2020.
217
+ [8] Lenaic Chizat and Francis Bach. Implicit bias of gradient descent for wide two-layer neural networks trained with the logistic loss. In Conference on Learning Theory (COLT), pages 1305–1338, 2020.
218
+ [9] Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 8765–8775, 2020.
219
+ [10] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In Int. Conf. on Learning Representations (ICLR), 2019.
220
+ [11] Robert Geirhos, Jorn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, ¨ Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020.
221
+ [12] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In Int. Conf. on Learning Representations (ICLR), 2015.
222
+ [13] Jean-Bastien Grill, Florian Strub, Florent Altche, 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. In Advances in Neural Information Processing Systems (NeurIPS), pages 21271–21284, 2020.
223
+ [14] Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation ¨ principle for unnormalized statistical models. In Proc. Int. Conference on Artificial Intelligence and Statistics (AISTATS), pages 297–304, 2010.
224
+ [15] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9729–9738, 2020.
225
+ [16] Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? Exploring datasets, architectures, and training. In Advances in Neural Information Processing Systems (NeurIPS), pages 9995–10006, 2020.
226
+ [17] Katherine L Hermann, Ting Chen, and Simon Kornblith. The origins and prevalence of texture bias in convolutional neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 19000–19015, 2019.
227
+ [18] 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 Int. Conf. on Learning Representations (ICLR), 2019.
228
+ [19] Chih-Hui Ho and Nuno Nvasconcelos. Contrastive learning with adversarial examples. In Advances in Neural Information Processing Systems (NeurIPS), pages 17081–17093, 2020.
229
+ [20] Qianjiang Hu, Xiao Wang, Wei Hu, and Guo-Jun Qi. Adco: Adversarial contrast for efficient learning of unsupervised representations from self-trained negative adversaries. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
230
+ [21] Minyoung Huh, Hossein Mobahi, Richard Zhang, Brian Cheung, Pulkit Agrawal, and Phillip Isola. The low-rank simplicity bias in deep networks. preprint arXiv:2103.10427, 2021.
231
+ [22] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems (NeurIPS), pages 125–136, 2019.
232
+ [23] Jorn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive ¨ invariance causes adversarial vulnerability. In Int. Conf. on Learning Representations (ICLR), 2018.
233
+ [24] Ziyu Jiang, Tianlong Chen, Ting Chen, and Zhangyang Wang. Robust pre-training by adversarial contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 16199–16210, 2020.
234
+ [25] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 21798–21809, 2020.
235
+ [26] Minseon Kim, Jihoon Tack, and Sung Ju Hwang. Adversarial self-supervised contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
236
+ [27] Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. preprint arXiv:2008.01064, 2020.
237
+ [28] Tianhong Li, Lijie Fan, Yuan Yuan, Hao He, Yonglong Tian, and Dina Katabi. Informationpreserving contrastive learning for self-supervised representations. preprint arXiv:2012.09962, 2020.
238
+ [29] Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In Int. Conf. on Learning Representations (ICLR), 2020.
239
+ [30] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In Int. Conf. on Learning Representations (ICLR), 2018.
240
+ [31] Matthias Minderer, Olivier Bachem, Neil Houlsby, and Michael Tschannen. Automatic shortcut removal for self-supervised representation learning. In International Conference on Machine Learning, pages 6927–6937, 2020.
241
+ [32] Thao Nguyen, Maithra Raghu, and Simon Kornblith. Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. In Int. Conf. on Learning Representations (ICLR), 2021.
242
+ [33] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. preprint arXiv:1807.03748, 2018.
243
+
244
+ [34] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
245
+
246
+ [35] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2536–2544, 2016.
247
+
248
+ [36] Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, ¨ Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikitlearn: Machine learning in python. Journal of machine learning research, pages 2825–2830, 2011.
249
+
250
+ [37] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet classifiers generalize to ImageNet? In Int. Conference on Machine Learning (ICML), pages 5389–5400, 2019.
251
+
252
+ [38] Elizabeth A Regan, John E Hokanson, James R Murphy, Barry Make, David A Lynch, Terri H Beaty, Douglas Curran-Everett, Edwin K Silverman, and James D Crapo. Genetic epidemiology of COPD (COPDGene) study design. COPD: Journal of Chronic Obstructive Pulmonary Disease, 7(1):32–43, 2011.
253
+
254
+ [39] Joshua Robinson, Stefanie Jegelka, and Suvrit Sra. Strength from weakness: Fast learning using weak supervision. In Int. Conference on Machine Learning (ICML), pages 8127–8136, 2020.
255
+
256
+ [40] Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. Contrastive learning with hard negative samples. In Int. Conf. on Learning Representations (ICLR), 2021.
257
+
258
+ [41] Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878, 2018.
259
+
260
+ [42] Li Sun, Ke Yu, and Kayhan Batmanghelich. Context matters: Graph-based self-supervised representation learning for medical images. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 4874–4882, 2021.
261
+
262
+ [43] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In Int. Conf. on Learning Representations (ICLR), 2014.
263
+
264
+ [44] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Europ. Conference on Computer Vision (ECCV), 2020.
265
+
266
+ [45] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 6827–6839, 2020.
267
+
268
+ [46] Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In Int. Conf. on Learning Representations (ICLR), 2018.
269
+
270
+ [47] Feng Wang and Huaping Liu. Understanding the behaviour of contrastive loss. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
271
+
272
+ [48] Feng Wang, Huaping Liu, Di Guo, and Fuchun Sun. Unsupervised representation learning by invariance propagation. In Advances in Neural Information Processing Systems (NeurIPS), pages 3510–3520, 2020.
273
+
274
+ [49] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Int. Conference on Machine Learning (ICML), pages 9574–9584, 2020.
275
+
276
+ [50] Xiao Wang and Guo-Jun Qi. Contrastive learning with stronger augmentations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021.
277
+ [51] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stephane Deny. Barlow twins: Self- ´ supervised learning via redundancy reduction. In Int. Conference on Machine Learning (ICML), 2021.
278
+ [52] Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In Int. Conference on Machine Learning (ICML), pages 7472–7482, 2019.
279
+ [53] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In Int. Conf. on Learning Representations (ICLR), 2018.
280
+ [54] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In Europ. Conference on Computer Vision (ECCV), pages 649–666, 2016.
281
+ [55] Nanxuan Zhao, Zhirong Wu, Rynson WH Lau, and Stephen Lin. What makes instance discrimination good for transfer learning? In Int. Conf. on Learning Representations (ICLR), 2021.
282
+ [56] Roland S Zimmermann, Yash Sharma, Steffen Schneider, Matthias Bethge, and Wieland Brendel. Contrastive learning inverts the data generating process. In Int. Conference on Machine Learning (ICML), 2021.
md/train/v_4XcXsAZUn/v_4XcXsAZUn.md ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Robustness of Graph Neural Networks at Scale
2
+
3
+ Simon Geisler, Tobias Schmidt, Hakan ¸Sirin, Daniel Zügner, Aleksandar Bojchevski, and Stephan Günnemann Department of Informatics Technical University of Munich {geisler, schmidtt, sirin, zuegnerd, bojchevs, guennemann}@in.tum.de
4
+
5
+ # Abstract
6
+
7
+ Graph Neural Networks (GNNs) are increasingly important given their popularity and the diversity of applications. Yet, existing studies of their vulnerability to adversarial attacks rely on relatively small graphs. We address this gap and study how to attack and defend GNNs at scale. We propose two sparsity-aware first-order optimization attacks that maintain an efficient representation despite optimizing over a number of parameters which is quadratic in the number of nodes. We show that common surrogate losses are not well-suited for global attacks on GNNs. Our alternatives can double the attack strength. Moreover, to improve GNNs’ reliability we design a robust aggregation function, Soft Median, resulting in an effective defense at all scales. We evaluate our attacks and defense with standard GNNs on graphs more than 100 times larger compared to previous work. We even scale one order of magnitude further by extending our techniques to a scalable GNN.
8
+
9
+ # 1 Introduction
10
+
11
+ The evidence that Graph Neural Networks (GNNs) are not robust to adversarial perturbations is compelling [14, 20, 50]. However, the graphs in previous robustness studies are tiny. This is worrying, given that GNNs are already deployed in many real-world Internet-scale applications $\boxed { \boxed { 5 } } \boxed { \boxed { 4 4 } } \boxed { }$ . For example, PubMed $\pmb { \mathbb { B 3 } }$ (19,717 nodes) is often considered to be a large-scale graph and around $2 0 \mathrm { G B }$ of memory is required for an attack based on its dense adjacency matrix. Such memory requirements are impractical and limit advancements of the field. In this work, we set the foundation for the holistic study of adversarial robustness of GNNs at scale. We study graphs with up to 111 million nodes for local attacks (i.e. attacking a single node) and 2.5 million nodes for global attacks (i.e. attacking all nodes at once). As it turns out,
12
+
13
+ ![](images/489fa1947f5ba90ad39f4467c320d9233f93dde3bc0fa498f5df0a276e45bddc.jpg)
14
+ Figure 1: GPU memory consumption for a global attack with Projected Gradient Descent (PGD) $\mathbb { \lVert \rVert 3 \rVert }$ , its quadratic extrapolation, and our Projected Randomized Block Coordinate Descent (PR-BCD) $\textcircled { \ S 3 }$ . Both yield similar adversarial accuracy. Beyond attacks, our defense $\textcircled { \ S 4 }$ also scales to these graphs.
15
+
16
+ GNNs at scale are also highly vulnerable to adversarial attacks. In Fig. 1, we show the substantial improvement of memory efficiency of our attack over a popular prior work for attacking a GNN globally. Analogous to our attacks, our effective defense scales to graphs with 111 million nodes and beyond.
17
+
18
+ Scope. We focus on adversarial robustness w.r.t. structure attacks on GNNs for node classification
19
+
20
+ $$
21
+ \operatorname* { m a x } _ { \tilde { A } \ \mathrm { s . t . } \ \lVert \tilde { A } - A \rVert _ { 0 } < \Delta } \mathcal { L } ( f _ { \theta } ( \tilde { A } , X ) )
22
+ $$
23
+
24
+ with loss function $\mathcal { L }$ (or its surrogate $\mathcal { L } ^ { \prime }$ ), budget $\Delta$ , and fixed model parameters $\theta$ . The GNN $f _ { \theta } ( A , X )$ is applied to a graph $\mathcal { G } = ( A , X )$ with node attributes $\ b { X } \in \mathbb { R } ^ { \hat { n } \times d }$ , the adjacency matrix $\pmb { A } \in \{ 0 , 1 \} ^ { n \times n }$ , and $m$ edges. We focus on evasion (test time) attacks, but our methods can be used in poisoning (train time) attacks $\boxed { \boxplus 9 } \rbrack$ . We distinguish between local attacks on a single node and global attacks that target a large fraction of nodes with a shared budget $\Delta$ . We study white-box attacks since they have the most powerful threat model and can be used to understand the robustness w.r.t. “worst-case noise” of a model, as well as to assess the efficacy of defenses. For these reasons white-box attacks are important and practical from the perspective of a defender.
25
+
26
+ Broader impact. Since we enable the study of robustness at scale, which previously was practically infeasible, an adversary can potentially abuse our attacks. The risk is minimized given that we assume perfect knowledge about the graph, model, and labels. Nonetheless, our findings suggest that one should be careful when deploying GNNs, and highlight that further research is needed. To mitigate this risk, we must be able to evaluate it. We also propose a scalable defense that shows strong performance empirically but we urge practitioners to consider potential trade-offs, e.g. improving robustness at the expense of accuracy for different groups of users.
27
+
28
+ Contributions. We address three major challenges hindering the study of GNNs’ adversarial robustness at scale and propose viable solutions including an extensive empirical evaluation: (1) Previous losses are not well-suited for global attacks on GNNs; (2) Attacks on GNNs scale quadratically in the number of nodes or worse; (3) Similarly, previous robust GNNs are typically not scalable.
29
+
30
+ (1) Surrogate loss. We study the limitation of state-of-the-art surrogate losses for attacking the accuracy of a GNN over all nodes [8, 9, 17, 27, 41, 43, 49] in $\boxed { \ S 2 }$ Especially in combination with small/realistic budgets $\Delta$ and on large graphs, previous surrogate losses lead to weak attacks. In particular, Cross Entropy (CE) or the widely used Carlini-Wagner loss $[ 6 , 4 3 ]$ are weak surrogates for such global attacks. Our novel losses that overcome these limitations easily improve the strength of the attack by $100 \%$ on common datasets. For larger graphs, this gap even becomes more significant.
31
+
32
+ (2) Attacks. Attacks solving a discrete optimization problem easily become computationally infeasible because of the vast amount of potential adjacency matrices $( { \check { O } } ( 2 ^ { n ^ { 2 } } ) )$ . An approximate solution can be found with first-order optimization but we then still optimize over a quadratic number of parameters $( n ^ { 2 } )$ . There is no trivial way to sparsify existing attacks as we need to represent each edge explicitly to obtain its gradient (i.e. space complexity $\bar { \Theta } ( n ^ { 2 } ) )$ . Nevertheless, we overcome this limitation and propose two strategies to apply first-order optimization without the burden of a dense adjacency matrix. In $\textcircled { \ S 3 }$ we describe how to add/remove edges between existing nodes based on Randomized Block Coordinate Descent (R-BCD) at an additional memory requirement of $\mathcal { O } ( \Delta )$ . Due to the limited scalability of traditional GNNs, we also consider the case where we attack PPRGo [5], a scalable GNN. Here, we even obtain an algorithm with constant complexity in the nodes $n$ .
33
+
34
+ (3) Defense. We propose Soft Median in $\textcircled { \ S 4 } -$ a computationally efficient, robust, differentiable aggregation function inspired by Geisler et al. $ { \mathbb { I } } { \mathrm { 1 8 } } { \Vert }$ , by taking advantage of recent advancements in differentiable sorting $\dot { \textmu }$ . Using our Soft Median we observe similar robustness to $\mathbb { \lVert 1 8 \rVert }$ , but with a significantly lower memory footprint, which enables us to defend GNNs at scale.
35
+
36
+ # 2 Surrogate Losses for Global Attacks
37
+
38
+ During training and in first-order attacks, we ideally wish to optimize a target metric which is often discontinuous (e.g. accuracy and 0/1 loss $\mathcal { L } _ { 0 / 1 }$ ). However, for gradient-based optimization we commonly substitute the actual target loss by a surrogate $\mathcal { L } ^ { \prime } \approx \mathcal { L }$ (e.g. cross entropy for $\mathcal { L } _ { 0 / 1 }$ ). In the context of i.i.d. samples (e.g. images), a single example is attacked in isolation with its own budget, which is similar to a local attack for GNNs. When a single node’s prediction is attacked, it is often sufficient to maximize the cross entropy for the attacked node/image (untargeted attack): $\mathrm { C E } ( y , p ) = - \log ( p _ { c ^ { * } } )$ . where $y$ is the label and $\pmb { p }$ is the vector of confidence scores.
39
+
40
+ Many global attacks for GNNs [8, 41, 43, 49] maximize the average CE to attack all nodes with a combined budget $\Delta$ . However, a loss like CE can be ineffective, particularly when the number of nodes is large in comparison to the budget $\Delta / { n } 0$ . While experimenting on large graphs, we often observed that the CE loss increases even though the accuracy does not decline (see $\bar { \bigtriangledown } \bar { \mathbf { B } } )$ . As we can see in $\mathrm { F i g } . 2 ,$ this is due to CE’s bias towards nodes that have a low confidence score. With CE and a sufficiently small budget $\Delta \ll n$ we primarily attack nodes that are already misclassified, which means that the classification margin $\begin{array} { r } { \psi = \operatorname* { m i n } _ { c \neq c ^ { * } } p _ { c ^ { * } } - p _ { c } } \end{array}$ is already negative.
41
+
42
+ ![](images/b142ae79437f020539c2b1d475396372ee4a53a99550365f2fb0a368103447f5.jpg)
43
+ Figure 2: Margin $\psi$ of test nodes vs. attacked nodes, before (“clean”) and after perturbation (“perturbed”). We attack the PubMed graph $\mathrm { ( T a b l e 1 ) }$ and a single-layer GCN with one percent of edges $\epsilon = 0 . 0 1$ ) as a budget. In stark contrast to the tanh margin (b), the CE loss (a) spends a lot of its budget on misclassified nodes (i.e. $\psi < 0$ ). See $\underline { { \left\| \ S \ B \right\| } }$ for more variants and details.
44
+
45
+ Global attack. In contrast to attacking a single image/node, a global attack on a GNN has to (1) keep house with the budget $\Delta$ and (2) find edges that degrade the overall accuracy maximally (i.e. target “fragile” nodes). Without additional information, intuitively, one would first attack low-confidence nodes close to the decision boundary. Hence, the surrogate loss should have a minimal (maximally negative) gradient at $\psi \to 0 ^ { + }$ (i.e. approaching $\psi \to 0$ from $\psi \geq 0$ ). Moreover, if we solely want to lower the accuracy, then we can stop attacking a node once it is misclassified1:
46
+
47
+ Definition 1 A surrogate loss $\mathcal { L } ^ { \prime }$ for global attacks $\mathbf { \eta } ^ { ( \mathbf { I } ) }$ should only incentivize perturbing nodes that are correctly classified: $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } \rvert _ { \psi < 0 } = 0$ and $\mathbf { \Pi } ^ { ( \mathbf { I I } ) }$ should favour nodes close to the decision boundary: $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } | _ { \psi _ { 0 } } < \partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } | _ { \psi _ { 1 } }$ for any $0 < \psi _ { 0 } < \psi _ { 1 }$ .
48
+
49
+ Since $\boxed { \mathrm { E q . 1 } }$ is in general a discrete and non-convex optimization problem that is often NP-complete [1, 3, 38, 45], we propose to study the surrogate loss under the subsequent simplifying assumptions. Note that in an actual attack other influences (e.g. node degree) are still considered while solving the optimization problem. Assumption $I$ : The set of attacked nodes is independent (their receptive fields do not overlap). Particularly on large graphs with small budgets, $\Delta / { n } 0$ , deciding which node to attack becomes an increasingly local decision since the receptive field becomes insignificant in comparison to the rest of the graph. Assumption 2: The budget required to change the prediction of node $i$ depends (only) on the margin: $\Delta _ { i } = g ( | \psi _ { i } | )$ for some increasing and non-negative function $g ( \cdot )$ . That is, the larger the margin $\psi _ { i }$ , the harder it is to attack node $i$ . As stated in Proposition $^ { 1 , }$ with these assumptions, an optimizer with a surrogate loss compliant with Definition is also optimizing the 0/1 loss $\mathcal { L } _ { 0 / 1 }$ (for proof see $\ S \ B . 4 )$
50
+
51
+ Proposition 1 Let $\mathcal { L } ^ { \prime }$ be the surrogate for the 0/1 loss $\mathcal { L } _ { 0 / 1 }$ used to attack a node classification algorithm $f _ { \theta } ( A , X )$ with a global budget $\Delta$ . Suppose we greedily attack nodes in order of $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } ( \psi _ { 0 } ) \leq$ $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } ( \psi _ { 1 } ) \leq \dots \leq \partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } ( \psi _ { l } )$ until the budget is exhausted $\begin{array} { r } { \Delta < \sum _ { i = 0 } ^ { l + 1 } \Delta _ { i } } \end{array}$ . Under Assumptions 1 & 2, we then obtain the global optimum of $\begin{array} { r } { \operatorname* { m a x } _ { \tilde { A } s . t . \| \tilde { A } - A \| _ { 0 } < \Delta } \mathcal { L } _ { 0 / 1 } ( f _ { \theta } ( \tilde { A } , X ) ) } \end{array}$ if $\mathcal { L } ^ { \prime }$ has the properties (I) $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } \rvert _ { \psi < 0 } = 0$ and $\left( \mathbf { I I } \right) \partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } \vert _ { \psi _ { 0 } } < \partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } \vert _ { \psi _ { 1 } }$ for any $0 < \psi _ { 0 } < \psi _ { 1 }$ .
52
+
53
+ Even under the simplifying Assumptions 1 & 2, the Cross Entropy (CE) is not guaranteed to obtain the global optimum. The (CE) violates property (I) and in the worst case only perturbs nodes that are already misclassified (see $\operatorname { F i g } . 2 )$ . The Carlini-Wagner (CW) [6, 43] loss $\mathbf { C W } =$ $\mathrm { m i n } ( \mathrm { m a x } _ { c \neq c ^ { * } } z _ { c } - z _ { c ^ { * } } , 0 )$ violates property (II). It is also not guaranteed to obtain the global optimum, i.e. CW loss lacks focus on nodes close to the decision boundary. In the worst case, an attack with CW spends all budget on confident nodes—without flipping a single one.
54
+
55
+ We propose the Masked Cross Entropy $\begin{array} { r } { \mathbf { M C E } = 1 / | \mathbb { V } ^ { + } | \sum _ { i \in \mathbb { V } ^ { + } } - \log ( p _ { c ^ { * } } ^ { ( i ) } ) } \end{array}$ which fulfills both properties by only considering correctly classified nodes $\mathbb { V } ^ { + }$ and, hence, reaches the global optimum under the stated assumptions. Empirically, for a greedy gradient-based attack the MCE comes with gains of more than $200 \%$ in strength (see $\overline { { \mathbb { F } \mathrm { 1 g . ~ } \boldsymbol { 6 } } } \big )$ . Surprisingly, if we apply MCE to a Projected Gradient Descent (PGD) attack, we observe hardly any improvement over CE. We identify two potential reasons for that. The first is due to the learning dynamics of PGD. Suppose a misclassified node does not receive any weight in the gradient update, now if the budget is exceeded after the update it is likely to be down-weighted. This can lead to nodes that oscillate around the decision boundary (for more details see $\underline { { \overline { { \ S \ : \bf { B } } } } } )$ . A similar behavior occurs for to the Carlini-Wagner loss in e.g. Fig. B.1 (e).
56
+
57
+ In Definition 2, we relax properties $( \mathrm { I } ) / ( \mathrm { I I } )$ and propose to overcome these limitations via enforcing confidently misclassified nodes, i.e. we want the attacked nodes to be at a “safe” distance from the decision boundary. We propose the tanh of the margin in logit space, i.e. tanh margin $= \operatorname { t a n h } ( \operatorname* { m a x } _ { c \neq c ^ { * } } z _ { c } - z _ { c ^ { * } } )$ . It obeys Definition 2 and its effectiveness is apparent from Fig. 2. For the empirical evaluation see $\boxed { \ S 5 }$ and for more results as well as details on all selected losses see $\ S \ \mathbf { B } .$ In the appendix we also study further losses to deepen the understanding about the required properties. Additionally, in $\ S \ \mathbf { B } . \bar { 5 } ,$ we give an alternative Proposition 1 for a relaxed Assumption 2 s.t. $\mathbb { E } [ \Delta _ { i } | \psi _ { i } ] = g ( | \psi _ { i } | )$
58
+
59
+ Definition 2 A surrogate loss $\mathcal { L } ^ { \prime }$ for global attacks that encourages confident misclassification (A) should saturate $\scriptstyle \operatorname* { l i m } _ { \psi \to - 1 ^ { + } } \mathcal { L } ^ { \prime } < \infty$ and $\mathbf { ( B ) }$ should favor points close to the decision boundary: $\partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } | _ { \psi _ { 0 } } < \partial \mathcal { L } ^ { \prime } / \partial z _ { c ^ { * } } | _ { \psi _ { 1 } } < 0$ for any $0 < \psi _ { 0 } < \psi _ { 1 } < 1$ or $- 1 < \psi _ { 1 } < \psi _ { 0 } < 0 .$ .
60
+
61
+ # 3 Scalable Attacks
62
+
63
+ Beginning with $[ 1 4 , 5 0 ]$ , many adversarial attacks on the graph structure have been proposed. As discussed, gradient-based attacks such as [9, 41, 49, 50] aim for lower computational cost by approximating the corresponding discrete optimization problem. However, they optimize all possible entries in the dense adjacency matrix $\pmb { A }$ which comes with quadratic space complexity $\Theta ( n ^ { 2 } )$ . Since previous attacks come with limited scalability (e.g. see $\overline { { \mathbb { F } \mathrm { 1 g . ~ } \mathrm { 1 } } } )$ , GNNs robustness on larger graphs is largely unexplored. First, we propose a family of attacks that does not require a dense adjacency matrix and comes with linear complexity w.r.t. the budget $\Delta$ . Then, we further improve the complexity of our attack for a scalable GNN called PPRGo [5].
64
+
65
+ Related work. Li et al. $\pmb { \mathbb { D } } \pmb { \ 6 } \|$ evaluate their local adversarial attack SGA only on a graph with around 200k nodes and SGA is specifically designed for Simplified Graph Convolution (SGC) $\mathbb { \left[ \left| 4 0 \right| \right] }$ . Note that a two-layer SGC is identical to Nettack’s surrogate model. We consider arbitrary Graph Neural Networks and we even scale our global attack to a graph ten times larger. With PPRGo we even outscale them by factor 500. Feng et al. $\mathbb { \ m }$ partition the graph to lower the attack’s memory footprint but still have a time complexity of $\mathcal { O } ( n ^ { 2 } )$ . Dai et al. $\pmb { \mathbb { I } } \pmb { \ 4 } \|$ scale their reinforcement learning approach to a graph for financial transactions with 2.5 million nodes. In contrast to our work, they scale their local attack only using a tiny budget $\Delta$ of a single edge deletion and only need to consider the receptive field of a single node. We scale our local attack to 111M nodes and allow large budgets $\Delta$ .
66
+
67
+ Large scale optimization. In some big data use cases, the cost to calculate the gradient towards all variables can be prohibitively high. For this reason, coordinate descent has gained importance in machine learning and large-scale optimization $\mathbb { \lVert 3 9 \rVert }$ . Nesterov $\mathbb { \left. 2 9 \right. }$ proposed (and analyzed the convergence of) Randomized Block Coordinate Descent (R-BCD). In R-BCD only a subset (called a block) of variables is optimized at a time and, hence, only the gradients towards those variables are required. In many cases, this allows for a lower memory footprint and in some settings even converges faster than standard methods $\left[ \left[ 3 0 \right] \right]$ .
68
+
69
+ For clarity, we model the perturbations $P \in \{ 0 , 1 \} ^ { n \times n }$ explicitly $( P _ { i j } = 1$ denotes an edge flip):
70
+
71
+ $$
72
+ \operatorname* { m a x } _ { P \mathrm { ~ s . t . } P \in \{ 0 , 1 \} ^ { n \times n } , \sum P \leq \Delta } { \mathcal { L } } ( f _ { \theta } ( A \oplus P , X ) ) .
73
+ $$
74
+
75
+ Here, $\oplus$ stands for an element-wise exclusive or and $\Delta$ denotes the edge budget (i.e. the number of altered entries in the perturbed adjacency matrix). Naively, applying R-BCD to optimize towards the dense adjacency matrix would only save some computation on obtaining the respective gradient. It still has a space complexity of $\mathcal { O } ( n ^ { \bar { 2 } } )$ on top of the complexity of the attacked model because we still have to store up to $\mathit { \Pi } _ { n ^ { 2 } }$ parameters. Note that the $L _ { 0 }$ perturbation constraint with limited budget $\Delta$ implies that the solution will be sparse. We build upon this fact and in each epoch, in a survival-ofthe-fittest manner, we keep that part of the search space which is “promising” and resample the rest. Despite the differences, we simply call our approach Projected Randomized Block Coordinate Descent (PR-BCD) and provide the pseudo code in Algo. $^ 1$ (a preliminary version appeared in $\mathbb { I m }$ ). On top of the GNN, PR-BCD comes with space complexity of $\Theta ( b )$ where $b$ is the block size (number of coordinates) since everything can be implemented efficiently with sparse operations. We typically choose $\Delta$ to be a fraction of $m$ and $b > \Delta$ , thus, in practice, we have a linear overhead.
76
+
77
+ ![](images/b4072d8b9135dad069022a3968803ce6d367da1929c8458191ba6c8b9a6afcce.jpg)
78
+ Figure 3: Influence of block size $b$ on PR-BCD (dashed $L _ { 0 }$ PGD $\mathbb { E 3 } \mathbb { I }$ ) with tanh margin loss and $\epsilon = 0 . 1$ . (a) shows adv. accuracy with three-sigma error over five seeds. We resample $E _ { \mathrm { r e s . } } ~ = ~ 5 0$ epochs and then fine-tune 250. (b) shows adv. accuracy over epochs $t$ with $E \cdot b =$ const.
79
+
80
+ 1: Input: Gr. $( A , X )$ , lab. $\textbf { { y } }$ , GNN $f _ { \theta } ( \cdot )$ , loss $\mathcal { L }$
81
+ 2: Parameter: budget $\Delta$ , block size $b$ , epochs $E$
82
+ & $E _ { \mathrm { r e s . } }$ , heuristic $\operatorname { \bar { \it h } } ( \dots )$ , learning rate $\alpha _ { t }$
83
+ 3: Draw w/o replacement $i _ { 0 } { \in } \{ 0 , 1 , { \ldots } , { n ^ { 2 } } - 1 \} ^ { b }$
84
+ 4: Initialize zeros for ${ \pmb p } _ { 0 } \in \mathbb { R } ^ { b }$
85
+ 5: for $t \in \{ 1 , 2 , \ldots , E \}$ do
86
+ 6: $\hat { \pmb { y } } f _ { \theta } ( \pmb { A } \oplus \pmb { p } _ { t - 1 } , \pmb { X } )$
87
+ 7: $p _ { t } \gets p _ { t - 1 } + \alpha _ { t } \nabla _ { p _ { t - 1 } [ i _ { t - 1 } ] } \mathcal { L } ( \hat { \pmb { y } } , \pmb { y } )$
88
+ 8: Projection $p _ { t } \gets \Pi _ { \mathbb { E } [ \mathrm { B e r n o u l l i } ( { \pmb p } _ { t } ) ] \leq \Delta } ( { \pmb p } _ { t } )$
89
+ 9: $\mathbf { \delta } _ { i _ { t } } \gets i _ { t - 1 }$
90
+ 10: if t Eres. then
91
+ 11: $\mathrm { m a s k } _ { \mathrm { r e s . } } h ( \pmb { p } _ { t } )$
92
+ 12: pt[maskres.] 0
93
+ 13: Resample it[maskres.]
94
+ 14: P ⇠ Bernoulli(pE) s.t. $\sum P \leq \Delta$
95
+ 15: Return A P
96
+
97
+ PR-BCD. For $L _ { 0 }$ -norm PGD we relax the discrete edge perturbations $_ { P }$ from $\{ 0 , 1 \} ^ { ( n \times n ) }$ to $[ 0 , 1 ] ^ { ( n \times n ) }$ as proposed by $\mathrm { X u }$ et al. [43]. Each entry of $_ { r }$ denotes the probability for flipping it. In each epoch we only look at a randomly sampled, non-contiguous block of $_ { r }$ of size $b$ (line 3, line 10-13) and additionally ignore the diagonal elements (i.e. self-loops). If using an undirected graph, the potential edges are restricted to the upper/lower triangular $n \times n$ matrix. In each epoch $t \in \{ \bar { 1 } , \bar { 2 } , \dots \}$ , $\pmb { p }$ is added to $/$ subtracted from the discrete edge weight (line 6). Note, we overload $\oplus$ s.t. $\pmb { A } _ { i j } \oplus p _ { i j } = A _ { i j } + p _ { i j }$ if $A _ { i j } = 0$ and $A _ { i j } - p _ { i j }$ otherwise. We use $\pmb { p }$ and $_ { P }$ interchangeably while $\pmb { p }$ only corresponds to the current subset/block of $\bar { P } _ { i _ { t } }$ . After each gradient update (line 7), the projection $\Pi _ { \mathbb { E } [ \mathrm { B e r n o u l l i } ( p ) ] \leq \Delta } ( p )$ adjusts the probability mass such that $\begin{array} { r } { \mathbb { E } [ \bar { \mathrm { B e r n o u l l i } } ( \bar { p } ) ] = \sum _ { i \in b } p _ { i } \le \bar { \Delta } } \end{array}$ and that $\pmb { p } \in [ 0 , 1 ]$ (line 8). In the end we draw $b$ sample s.t. $P \in \{ 0 , 1 \} ^ { ( n \times n ) }$ via $P \sim \mathrm { B e r n o u l l i } ( p )$ (line 14).
98
+
99
+ The projection $\Pi _ { \mathbb { E } [ \mathrm { B e r n o u l l i } ( p ) ] \leq \Delta } ( p )$ likely results in many zero elements, but is not guaranteed to be sparse (for details see $\textstyle \left\| { \mathfrak { S } } \ C . 1 \right\|$ . If $\pmb { p }$ has more than $50 \%$ non-zero entries, we remove the entries with the lowest probability mass such that $50 \%$ of the search space is resampled. Otherwise, we resample all zero entries in $\pmb { p }$ . However, one also might apply a more sophisticated heuristic $h ( p )$ which we leave for future work (see line 11). After $E _ { \mathrm { r e s . } }$ . epochs we fine-tune $\pmb { p }$ , i.e. we stop resampling and decay the learning rate as in $\mathbb { \lVert \rVert 3 \rVert }$ . We also employ early stopping for both stages $t \leq E _ { \mathrm { r e s . } }$ and $t > E _ { \mathrm { r e s } }$ with the epoch $t$ ) such that we take the result of the epoch with highest loss $\mathcal { L }$ .
100
+
101
+ Block size $b$ . With growing $n$ it is unrealistic that each possible entry of the adjacency matrix was part of at least one random search space of (P)R-BCD. As is apparent, with a constant search space size, the number of mutually exclusive chunks of the perturbation matrix grows with $\Theta ( n ^ { 2 } )$ and this would imply a quadratic runtime. However, as evident in randomized black-box attacks $ { \mathbb { B } } 7 { \mathbb { I } }$ , it is not necessary to test every possible edge to obtain an effective attack. In $\boxed { \mathrm { F i g . ~ } 3 }$ (a), we analyze the influence of the block size $b$ on the adversarial accuracy. On small datasets and over a wide range of block sizes $b$ , our method performs comparably (or sometimes even better) to its dense equivalent. For larger graphs, we observe that the block size $b$ has a stronger influence on the adversarial accuracy. However, as shown in $\left[ \mathrm { F i g . } \ 3 \right] ( \mathbf { b } )$ , one might increase the number of epochs for an improved attack strength. This indicates that PR-BCD successfully identifies the harmful edges to keep.
102
+
103
+ GR-BCD. As an alternative to PR-BCD, we propose Greedy R-BCD (GR-BCD) which greedily flips the entries with the largest gradient in the block so that after $E$ iterations the budget is met. It is even a little bit more scalable as it does not require $b > \Delta$ (see $\textstyle \left\| { \mathfrak { S } } \mathbf { C } . 2 \right\|$ for details such as the pseudo code).
104
+
105
+ Limitations. We solely propose approximate attacks that do not provide any guarantee on how well they approximate the actual optimization problem and, hence, only provide an upper bound on e.g. the adversarial accuracy. We also recommend monitoring the relaxation error. One could use certificates to get the respective lower bound, provided they were scalable enough. Even sparse smoothing [4] might be too slow since we need many forward passes. As our attacks rely on the gradient they also require that the victim model is (approximately) differentiable. Otherwise, the approximation can become inappropriate. Moreover, we are limited by the scalability of the attacked GNN as we discuss next. For the theoretical complexities of all studied attacks, we refer to § E.
106
+
107
+ Scalable GNNs. Up to now, we implicitly assumed that we have enough memory to obtain the predictions and gradient towards the edges. GNNs that typically process the whole graph “at once”, are inherently limited in their scalability. Our PR-BCD attack is even applicable when operating at those limits (see experiments on Products in $\textcircled { \ S 5 }$ . To push the limits further, we now consider more scalable GNNs. Some notable scalable GNNs either sample subgraphs $\mathbb { Z } \mathbb { Z } \mathbb { 3 } \mathbb { I }$ or, such as PPRGo [5], simplify the message passing operation. Next, we extend our PR-BCD to a local attack on PPRGo with constant complexity including the (Soft Median) PPRGo (we introduce the Soft Median in $\textcircled { \ S 4 }$
108
+
109
+ PPRGo.To scale to massive graphs effectively, we need to obtain sublinear/constant complexity w.r.t. the number of nodes. This severely restricts the possibilities of how one might approach a global attack and is the reason why we now focus on local attacks (i.e. attacking single node $\romannumeral 1$ ). For an $L$ -layer message passing GNN we need to recursively compute the $L$ -hop neighborhood to obtain the prediction of a single node. This makes it difficult to obtain a sublinear space complexity (here including the GNN)—especially if one considers arbitrary edge insertions. In contrast, PPRGo $\pmb { \Vert 5 \Vert }$ leverages the Personalized Page Rank (PPR) matrix $\mathbf { I I } \overset { \cdot } { = } \alpha ( \bar { I } - ( 1 - \alpha ) D ^ { - 1 } A ) ^ { - 1 }$ (row normalization) to reduce the number of explicit message passing steps to one (with feat. encoder $f _ { \mathrm { e n c , } }$ ):
110
+
111
+ $$
112
+ p = \mathrm { s o f t m a x } \left[ \mathrm { A G G } \left\{ \left( \mathbf { H } _ { u v } , f _ { \mathrm { e n c } } ( \pmb { x } _ { u } ) \right) , \forall u \in \mathbb { N } ^ { \prime } ( v ) \right\} \right]
113
+ $$
114
+
115
+ Differentiable PPR Update. For a local attack on PPRGo, we require a differentiable update of the respective PPR Scores for an edge perturbation on a weighted graph. We achieve this using the Sherman-Morrison formula through a closed-form rank-one update of row $i$ of the PPR matrix:
116
+
117
+ $$
118
+ \tilde { \Pi } _ { i } = \alpha \left( \Pi _ { i } ^ { \prime } - \frac { \Pi _ { i i } ^ { \prime } v \Pi ^ { \prime } } { 1 + v \Pi _ { \ddots i } ^ { \prime } } \right)
119
+ $$
120
+
121
+ where $\mathbf { I I ^ { \prime } } = \alpha ^ { - 1 } \mathbf { I I }$ and, with degree matrix $_ { D }$ , $\pmb { v } = ( \pmb { D } _ { i i } + \sum \pmb { p } ) ^ { - 1 } ( \pmb { A } _ { i } + \pmb { p } ) - \pmb { D } _ { i i } ^ { - 1 } \pmb { A } _ { i }$ . This suffices to attack incoming edges of a node and since everything is differentiable $( { \partial \mathcal { L } ^ { \prime } } / { \partial p } )$ we do not need a surrogate model (common practice [26, 36, 50]). In $\ S \bar { { \mathrm C } } . 3 ,$ we give details on the derivation and show how we can leverage the fact that PPRGo uses a top- $\bar { k }$ -sparsified PPR matrix to obtain constant complexity $\mathcal O ( b k )$ (assuming $b \ll n$ and $k \ll n$ ). With $\Delta < b$ , our approach comes with no restriction on how we can insert or remove incoming edges of a specific node. Other approaches such as $\boxed { 1 4 } \boxed { 2 6 }$ gain scalability via restricting the set of admissible nodes for edge perturbations.
122
+
123
+ # 4 Scalable Defense
124
+
125
+ To complete the robustness picture we now shift focus to defenses. Unfortunately, we are not aware of any defense that scales to graphs significantly larger than PubMed. Thus, we propose a novel, scalable defense based on a robust message-passing aggregation, relying on recent advancements in differentiable sorting $\textcircled { \scriptsize { 1 3 1 } }$ . Our Soft Median not only comes with the best possible breakdown point of 0.5 but also can have a lower error than its hard equivalent for finite perturbations $( \mathrm { s e e } \ S \mathrm { D } . 3 )$ . Moreover, our Soft Median performs similarly to the recent Soft Medoid $\dot { \left\| 1 8 \right\| }$ , but comes with better computational complexity w.r.t. the neighborhood size, lower memory footprint, and enables us to scale to bigger graphs. We can also use this aggregation neatly in the PPRGo architecture resulting in the first defense that scales to massive graphs with over 111M nodes (see Eq. 3)
126
+
127
+ Background. We typically have the message passing framework of a GNN:
128
+
129
+ $$
130
+ \mathbf { h } _ { v } ^ { ( l ) } = \sigma ^ { ( l ) } \left[ \mathbf { A G G } ^ { ( l ) } \left\{ \left( A _ { v u } , \mathbf { h } _ { u } ^ { ( l - 1 ) } W ^ { ( l ) } \right) , \forall u \in \mathbb { N } ^ { \prime } ( v ) \right\} \right]
131
+ $$
132
+
133
+ with neighborhood $\mathbb { N } ^ { \prime } ( v ) = \mathbb { N } ( v ) \cup v$ including the node itself, the $l$ -th layer message passing aggregation $\mathbf { A G G } ^ { ( l ) }$ , embedding $\mathbf { h } _ { v } ^ { ( l ) }$ , normalized adjacency matrix $\pmb { A }$ , weights $W ^ { ( l ) }$ , and activation $\sigma ^ { ( l ) }$
134
+
135
+ Related Work. Following Günnemann $\pmb { \mathbb { D } } \pmb { \mathbb { 0 } }$ , we classify defenses into three categories: (1) preprocessing [16, 22, 41], (2) training procedure $\textcircled { 1 1 0 } , \textcircled { 4 3 } , \textcircled { 4 9 } $ , and (3) modifications of the architecture [11, 18, 23, 35, 42, 46–48]. All these previous defenses were not evaluated on graphs substantially larger than PubMed. Note GNNGuard $\mathbb { H }$ was only evaluated on a subset of arXiv, covering $20 \%$ of the nodes and $6 \%$ of the edges. Even though our attacks lend themselves well for adversarial training but we leave it for future work due to the overhead during training. Instead, we build the observation of Geisler et al. [18] that common aggregations (e.g. sum or mean) in $\mathbb { E } { \bf q } . 5 ]$ are known to be non-robust. They propose a differentiable robust aggregation for $\mathbf { A G G } ^ { ( l ) }$ and call it Soft Medoid. It is a continuous relaxation of the Medoid and requires the row/column sum over the distance matrix of the embedding of the nodes in the neighborhood. Hence this operation has a quadratic complexity w.r.t. the neighborhood size and comes with a sizable memory overhead during training and inference.
136
+
137
+ Soft Median. Intuitively, the Soft Median is a weighted mean where the weight for each instance is determined based on the distance to the dimension-wise median $\bar { \mathbf { x } }$ . This way, instances far from the dimension-wise median are filtered out. We define the Soft Median as
138
+
139
+ $$
140
+ \mu _ { \operatorname { S o f t M e d i a n } } ( X ) = \operatorname { s o f t m a x } \left( - c / T \sqrt { d } \right) ^ { \top } X = s ^ { \top } X \approx \operatorname { a r g m i n } _ { x ^ { \prime } \in \mathbb { X } } \| \bar { x } - x ^ { \prime } \| ,
141
+ $$
142
+
143
+ with the distances $c _ { v } = \| \bar { \pmb { x } } - \pmb { X } _ { v , : } \|$ and number of dimensions $d$ . We use $\boldsymbol { X }$ as well as $\mathbb { X }$ interchangeably. For a single dimension, this closely resembles the soft sorting operator as proposed in $\tilde { \mathbb { B } } \tilde { \mathbb { I } }$ for the central element and can be understood as a soft version of the median. To apply it to multivariate inputs, we rely on the dimension-wise median which can be computed efficiently for practical choices of $d$ . In contrast to the Soft Medoid, we do not require the distances between all input instances which makes the Soft Median much more efficient. Assuming $d$ is sufficiently small, the Soft Median scales linearly with the number of inputs $\left| \mathbb { N } ^ { \prime } ( v ) \right|$ .
144
+
145
+ The temperature. The temperature parameter $T$ controls the steepness of the weight distribution $\pmb { s }$ between the neighbors. In the extreme case as $T 0$ we recover the instance which is closest to the dimension-wise Median (i.e. $\begin{array} { r } { \arg \operatorname* { m i n } _ { { \pmb x } ^ { \prime } \in \mathbb { X } } \left\| \bar { \pmb x } - { \pmb x } ^ { \prime } \right\| ) } \end{array}$ . In the other extreme case $T \to \infty$ , the Soft Median is equivalent to the sample mean. We observe a similar empirical behavior as Geisler et al. $\left[ \left[ 1 8 \right] \right]$ and we decide on a temperature value in our experiments by grid search.
146
+
147
+ Breakdown point. For any finite $T$ , our proposed Soft Median has the best possible breakdown point of 0.5 as we state formally in Theorem 1 (for proof see $\mathbb { B } \underline { { \mathbf { D . 1 } } } \underline { { \mathbf { \mu } } }$ . Note that despite the lower complexity compared to Soft Medoid, we maintain the same breakdown point:
148
+
149
+ Theorem 1 Let $\mathbb { X } = \{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \}$ be a collection of points in $\mathbb { R } ^ { d }$ with finite coordinates and temperature $T \in [ 0 , \infty )$ . Then the Soft Median location estimator $( E q . \ 6 )$ has the finite sample breakdown point of $\epsilon ^ { * } ( \bar { \mu } _ { S o f t M e d i a n } , X ) = { } ^ { 1 } / n \lfloor ^ { ( n + 1 ) } / 2 \rfloor$ (asympt. $\begin{array} { r } { \operatorname* { l i m } _ { n \to \overline { { \infty } } } \overline { { \epsilon ^ { * } ( \mu } } \ u { \hat { s } } \hat { o } f t M e d i a n , \boldsymbol { X } ) = 0 . 5 ) } \end{array}$ .
150
+
151
+ We define the weighted Soft Median as
152
+
153
+ $$
154
+ \mu _ { \mathrm { W S M } } ( X , \mathbf { a } ) = C \left( \pmb { \mathscr { s } } \circ \mathbf { \mathscr { a } } \right) ^ { \top } X
155
+ $$
156
+
157
+ where $\pmb { s }$ is the softmax weight of $\boxed { \mathrm { E q . ~ } 6 }$ obtained using the weighted dimension-wise Median, $C$ normalizes s.t. $\sum s \circ \mathbf { a } = \sum$ a, $\circ$ is the elementwise multiplication, and a the edges weights. Similarly to $\pm \textcircled { 1 8 } \textcircled { 1 }$ , we recover the message passing operation of a GCN $\mathbb { \left[ \left[ 2 4 \right] \right] }$ for $T \to \infty$ .
158
+
159
+ Empirical robustness. The optimal breakdown point only assesses worst-case perturbations. Therefore, in Fig. 4, we analyze the $L _ { 2 }$ distance in the latent space after the first message passing operation for a clean vs. perturbed graph. Empirically the Soft Median has a $20 \%$ lower error than the weighted sum of a GCN (we call
160
+
161
+ ![](images/dd80abed2fc736e5bfe1cc4add2d8eb1e176dfa46084bc917e72a82a445c6492.jpg)
162
+ Figure 4: Empirical bias $B ( \epsilon )$ for the second layer of a GCN with GDC preproc. $\lVert 2 5 \rVert$ network under PGD attack with $L _ { 2 }$ distance. We use $T = 0 . 2$ and a relative budget of $\epsilon = 0 . 2 5$ .
163
+
164
+ it sum since the weights do not sum up to 1). While here the Soft Medoid seems to be more robust, this is not consistent with the adversarial accuracy values in $\ S 5 .$ Interestingly, the Soft Median can outperform its hard equivalent in terms of the finite error as we show in $\underline { { \overline { { \ S ~ \dot { \bf ~ D . 3 } } } } }$ .
165
+
166
+ Limitations. Our Soft Median has the best possible breakdown point which is a (well-established) indicator for robustness but does not prove adversarial robustness. As for most defenses, ours can provide a false sense of robustness. If possible, use attacks and certification techniques to verify the application-specific efficacy. Similar to the Soft Medoid in $\mathbb { \lVert 1 8 \rVert 3 2 \rVert }$ , we show that the Soft Median can improve the certified robustness in $| \ S \ D . 4 |$ Naturally, our Soft Median also comes with higher cost than e.g. a naïve summation despite having the same asymptotic complexity. Nevertheless, the overhead seems to be reasonable as we show in our experiments and in combination with PPRGo one can mitigate the slightly higher memory requirements with smaller batch size.
167
+
168
+ # 5 Empirical Evaluation
169
+
170
+ In the following, we present our experiments (consisting of approx. 2,500 runs) to show the efficacy and scalability of our methods on the six graphs detailed in Table 1. Attacks: We benchmark our GR-BCD and PR-BCD against PGD [43], greedy FGSM (similar to Dai et al. [14]) as well as DICE [37]. Defenses: Besides regular/vanilla GNNs we compare our Soft Median GDC/PPRGo with Soft Medoid GDC [18], SVD GCN [16], RGCN [48], and Jaccard
171
+
172
+ Table 1: Dataset summary. For the dense adjacency matrix we assume 4 bytes per entry. We represent the sparse (COO) matrix via two 8 byte integer pointers and a 4 bytes float value per edge. We highlight configurations above $3 0 \mathrm { G B }$ .
173
+
174
+ <table><tr><td>Dataset</td><td>#Nodes n</td><td>Size (dense)</td><td>Size (sparse)</td></tr><tr><td>Cora ML 四</td><td>2.8k</td><td>35.88MB</td><td>168.32 kB</td></tr><tr><td>Citeseer 28</td><td>3.3k</td><td>43.88MB</td><td>94.30kB</td></tr><tr><td>PubMed [33</td><td>19.7k</td><td>1.56 GB</td><td>1.77 MB</td></tr><tr><td>arXiv 2</td><td>169.3 k</td><td>114.71 GB</td><td>23.32MB</td></tr><tr><td>Products [21</td><td>2.4M</td><td>23.99 TB</td><td>2.47 GB</td></tr><tr><td>Papers 100M 四</td><td>111.1 M</td><td>49.34 PB</td><td>32.31 GB</td></tr></table>
175
+
176
+ GCN [41]. For the Soft Median, we follow Soft Medoid GDC [18] and diffuse the adjacency matrix with PPR/GDC [25] and use PPRGo’s efficient implementation to calculate the PPR scores. For the OGB datasets we use the public splits and otherwise sample 20 nodes per class for training/validation. We typically report the average over three random seeds/splits and the 3-sigma error of the mean. The full setup and details about baselines are given in $\mathbb { S } \mathbb { F } . 1 \mathbb { J }$ For supplementary material including the code and configuration see https://www.in.tum.de/daml/robustness-of-gnns-at-scale.
177
+
178
+ Time and memory cost. We want to stress again that most of the baselines barely scale to PubMed using a common 11GB GeForce GTX 1080 Ti (as we do). We only use a 32GB Tesla V100 for the experiments on Products with a full-batch GNN, since a three-layer GCN requires roughly 30 GB already during training. Extrapolating the overhead on PubMed to the largest dataset, Papers 100M, traditional attacks and defenses would require roughly 1 exabyte $1 0 ^ { 1 8 }$ bytes) while for ours 11 GB suffice. Our attacks and defenses are also reasonably fast. On arXiv ( $1 7 0 \mathrm { k }$ nodes), we train for 500 epochs and run the global PR-BCD attack for 500 epochs. The whole training and attacking procedure requires less than 2 minutes. Moreover, one epoch on Papers 100M with the local PR-BCD attack takes less than 10 seconds. See $\ S \ : \mathrm { F } . 2$ for further details and $\mathsf { \Omega } _ { \mathbb { S } \mathbb { E } }$ for theoretical complexities.
179
+
180
+ Surrogate Loss. We illustrate the losses in $\mathrm { F i g . } 5 ,$ where we clustered the losses in three groups. (1) incentivizing low margins: Cross Entropy CE and margin. (2) focusing on high-confidence nodes: Carlini-Wagner CW, the (neg.) CE of the most-likely, non-target class NCE, and ELU Margin. (3) focusing on nodes close to the decision boundary: MCE (ours) and tanh margin (ours). In Fig. 6, we see that the losses of category (3), or equivalently obeying the properties of Definition 1 or Definition 2, are superior to the other losses. For example, with MCE and FGSM the accuracy drops twice as much as with CE. A detailed discussion and mathematical formulation of all losses can be found in $\boxed { \ S \mathrm { ~ B } }$ Additionally, we report further experiments backing our claims and discuss the losses’ properties in more detail. Subsequently, we use MCE for greedy attacks and tanh margin otherwise.
181
+
182
+ Robustness w.r.t. global attacks. In Table 2, we present the experimental results for our proposed global attacks on the small dataset Cora ML since most baselines do not scale much further. Our attacks are as strong as their dense equivalents despite being much more scalable. In Fig. 7, w e compare our PR-BCD attack on all baselines that fit into memory or can be trained within 24 hours on the bigger datasets. On the large products dataset, it suffices to perturb roughly $2 \%$ of the edges to push the accuracy below $60 \%$ , i.e. reaching the performance of an MLP $\dot { \left[ \left[ 2 1 \right] \right] }$ . We conclude that GNNs on large graphs are indeed not robust (see also $\ S \operatorname { F } . S )$ . Our defense Soft Median GDC and Soft Median PPRGo are consistently among the best models tested over all scales. For example with $\epsilon = 0 . 1$ , the accuracy of a Vanilla GCN drops by an absolute $20 \%$ while for the Soft Median PPRGo we only lose $5 \%$ . To fit our Soft Median GDC on Products into memory, we had to reduce the number of hidden dimensions in comparison to its baselines. However, note that even a Vanilla GCN requires almost the entire memory of the 32 GB GPU. Despite the small sacrifice in clean accuracy, we already outperform most baselines for a budget of $\epsilon > 0 . 0 1$ . We also faced similar scaling limitations for the Soft Medoid GDC baseline on arXiv. This highlights the lower memory requirements for our Soft Median. In $\mathbb { S } \xrightarrow { \mathbb { F } . 3 }$ we present more exhaustive results and adaptive/direct attacks supporting the robustness of our defense but highlighting the importance of adaptiveness.
183
+
184
+ ![](images/be4043791a8d951a507c5b9c9b7b1f89500746ac461fca7e9037255173a9bae2.jpg)
185
+ Figure 5: Losses for the binary case. The losses are grouped via their basic properties (see text).
186
+ Figure 6: Attacking GCN on Pubmed. The lower the adv. accuracy the better the loss.
187
+
188
+ Table 2: Comparing attacks (transfer from Vanilla GCN) and defenses. We show the adversarial accuracy for $\epsilon = 0 . 1$ on Cora ML, and the clean test accuracy (last column). We only highlight the strongest defense as the attacks perform similarly. Our approaches are underlined. See § F.3 for more datasets, budgets, and adaptive/direct attacks.
189
+
190
+ <table><tr><td>Attack</td><td>FGSM</td><td>GR-BCD</td><td>PGD</td><td>PR-BCD</td><td>Acc.</td></tr><tr><td>Soft Median GDC</td><td>0.769 ± 0.002</td><td>0.765 ± 0.001</td><td>0.758 ± 0.002</td><td>0.752 ± 0.002</td><td>0.824 ± 0.002</td></tr><tr><td>Soft Median PPRGo</td><td>0.778 ± 0.001</td><td>0.781 ± 0.002</td><td>0.769 ± 0.001</td><td>0.770 ± 0.001</td><td>0.821 ± 0.001</td></tr><tr><td>Vanilla GCN</td><td>0.641 ± 0.003</td><td>0.622 ± 0.003</td><td>0.662 ± 0.003</td><td>0.645 ± 0.002</td><td>0.827 ± 0.003</td></tr><tr><td>Vanilla GDC</td><td>0.672 ± 0.005</td><td>0.677 ± 0.005</td><td>0.679 ± 0.002</td><td>0.674 ± 0.004</td><td>0.842 ± 0.003</td></tr><tr><td>Vanilla PPRGo</td><td>0.724 ± 0.003</td><td>0.726 ± 0.002</td><td>0.704 ± 0.001</td><td>0.700 ± 0.002</td><td>0.826 ± 0.002</td></tr><tr><td>Soft Medoid GDC</td><td>0.773 ± 0.005</td><td>0.775 ± 0.003</td><td>0.759 ± 0.003</td><td>0.761 ± 0.003</td><td>0.819 ± 0.002</td></tr><tr><td>SVD GCN</td><td>0.751 ± 0.007</td><td>0.755 ± 0.006</td><td>0.719 ± 0.005</td><td>0.724 ± 0.006</td><td>0.781 ± 0.005</td></tr><tr><td>Jaccard GCN</td><td>0.661 ± 0.002</td><td>0.664 ± 0.001</td><td>0.673 ± 0.002</td><td>0.667 ± 0.003</td><td>0.818 ± 0.003</td></tr><tr><td>RGCN</td><td>0.654 ± 0.007</td><td>0.665 ± 0.005</td><td>0.671 ± 0.007</td><td>0.664 ± 0.004</td><td>0.819 ± 0.002</td></tr></table>
191
+
192
+ ![](images/bb4736d623497e2f9f6638c2ba810b67a7161a18c7ebc029dc506e36788b7092.jpg)
193
+ Figure 7: PR-BCD (DICE dashed) on the large datasets (transfer) where the adversarial accuracy denotes the accuracy after attacking with budget $\Delta = \epsilon m$ .
194
+
195
+ Robustness w.r.t. local attacks. In Fig. 8, we compare the results of our local PR-BCD with Nettack on Cora ML (undirected). We define the budget $\Delta _ { i } = \epsilon d _ { i }$ and select the nodes for each budget s.t. $\Delta _ { i } \geq 1$ . Similarly to Zügner et al. $ { \mathbb { I } } ^ { { 5 } \mathrm { O I } }$ , we apply the attack only to the 10 nodes with highest confidence, 10 with lowest, and 20 random nodes (all correctly classified). For more datasets and budgets see $\ S \ F . 4 .$ Our attack seems to be slightly stronger than Nettack on all architectures and budgets. Nettack and PR-BCD use a different strategy to make the original combinatorial optimization problem feasible (see $\ S \ O _ { 1 } )$ . Nettack uses a linearized surrogate model to select the adversarial edges. Evidently, this leads to a weaker attack compared to relaxing the optimization problem as we proposed with PR-BCD. On the large datasets Products and Papers 100M (directed), we outperform the simple DICE baseline substantially. We compare to DICE since Nettack is not scalable enough. In comparison to the small datasets, the Vanilla GCN/PPRGo are extremely fragile and much lower budgets $\Delta _ { i }$ suffice to flip almost every node’s prediction. Our proposed defense Soft Median PPRGo on the other hand remains similarly robust as on the small datasets. On Papers 100M with $\Delta _ { i } = 0 . 2 5$ , the Soft Median PPRGo reduces the attacker’s success rate from around $90 \%$ to just $30 \%$ $90 \%$ vs. $1 \%$ on Products with $\Delta _ { i } = 0 . 5$ ).
196
+
197
+ Table 3: Attack success rate of PR-BCD (ours) and SGA $[ \overline { { 2 6 } } ]$ on a Vanilla GCN and Vanilla SGC [40] The stronger attack is bold. For poisoning we retrain on the perturbed graph of an evasion attack.
198
+
199
+ <table><tr><td colspan="2">Frac. edges ∈,△i= edi</td><td>Attack</td><td colspan="3">PR-BCD</td><td colspan="3">SGA</td></tr><tr><td colspan="2"></td><td></td><td>0.25</td><td>0.50</td><td>1.00</td><td>0.25</td><td>0.50</td><td>1.00</td></tr><tr><td rowspan="3">C eII</td><td rowspan="2">GCN</td><td>evasion</td><td>0.38 ± 0.04</td><td>0.65 ± 0.04</td><td>0.96 ± 0.02</td><td>0.36 ± 0.04</td><td>0.51 ± 0.05</td><td>0.82 ±0.03</td></tr><tr><td>poisoning</td><td>0.46 ± 0.05</td><td>0.79 ± 0.04</td><td>0.97 ± 0.02</td><td>0.47 ± 0.05</td><td>0.64 ± 0.04</td><td>0.95 ± 0.02</td></tr><tr><td>evasion</td><td>0.45 ± 0.05</td><td>0.57± 0.05</td><td>0.97±0.02</td><td>0.37± 0.04</td><td>0.43 ± 0.05</td><td>0.95 ±0.02</td></tr><tr><td rowspan="3">eeeeet</td><td>SGC</td><td>poisoning evasion</td><td>0.50 ± 0.05 0.42 ± 0.05</td><td>0.66 ± 0.04</td><td>0.96 ± 0.02</td><td>0.47 ± 0.05</td><td>0.62 ± 0.04</td><td>0.97 ± 0.01</td></tr><tr><td>GCN</td><td></td><td></td><td>0.66± 0.04</td><td>0.85 ± 0.03</td><td>0.34± 0.04</td><td>0.50± 0.05</td><td>0.72±0.04</td></tr><tr><td></td><td>poisoning evasion</td><td>0.53 ± 0.05 0.39±0.04</td><td>0.78 ± 0.04 0.62 ± 0.04</td><td>0.94 ± 0.02 0.91±0.03</td><td>0.54 ± 0.05</td><td>0.76 ± 0.04</td><td>0.93 ± 0.02</td></tr><tr><td rowspan="3">AIX.Ie</td><td>SGC</td><td>poisoning</td><td>0.49 ± 0.05</td><td>0.77 ± 0.04</td><td>0.92 ± 0.03</td><td>0.35 ± 0.04 0.49 ± 0.05</td><td>0.55 ± 0.05 0.74 ± 0.04</td><td>0.85±0.03 0.97 ± 0.01</td></tr><tr><td>GCN</td><td>evasion</td><td>0.92 ± 0.03</td><td>1.00 ± 0.00</td><td>1.00 ± 0.00</td><td>0.58± 0.05</td><td>0.90±0.03</td><td>0.98 ± 0.01</td></tr><tr><td></td><td>poisoning</td><td>0.82 ± 0.03</td><td>0.99 ± 0.01</td><td>1.00 ± 0.00</td><td>0.52 ± 0.05</td><td>0.82 ± 0.04</td><td>0.98 �� 0.01</td></tr><tr><td rowspan="2"></td><td>SGC</td><td>evasion</td><td>0.91± 0.03</td><td>0.97 ± 0.01</td><td>1.00± 0.00</td><td>0.83± 0.04</td><td>0.94±0.02</td><td>0.94± 0.02</td></tr><tr><td></td><td>poisoning</td><td>0.91 ± 0.03</td><td>0.97 ± 0.01</td><td>1.00 ± 0.00</td><td>0.83 ± 0.04</td><td>0.94 ± 0.02</td><td>0.94 ±0.02</td></tr></table>
200
+
201
+ In Table 3, we compare to the SGA attack of Li et al. [26] that transfers the attacks from a SGC $\mathbb { H O }$ surrogate. With our PR-BCD we attack the respective model directly. We follow SGA and obtain a poisoning attack by applying the perturbations of an evasion attack to the graph before training. Our PR-BCD clearly dominates SGA–even on SGC. This demonstrates how generally applicable our PR-BCD is without any modifications. We hypothesize that PR-BCD is stronger since, in contrast to SGA, it does not constrain the edge perturbations to be within a subgraph. Moreover, the large gap for a GCN highlights the importance of adaptive attacks (i.e. no surrogate). Also in terms of scalability, we find PR-BCD to be superior, even though SGA is efficient on graphs up to the size of arXiv. However, on products, we observe that for $s = 3$ SGC message passing steps we sometimes require more than $1 1 \ \mathrm { G b }$ and $s \ : = \ : 4$ we typically require more than $3 2 \ \mathrm { G b }$ . However, our PR-BCD with PPRGo scales to graphs 2 magnitudes larger $\mathrm { P a } -$ pers100M) and requires less than 11 GB (see $\overset { \cdot } { \vartheta } \operatorname { F } . 2 )$
202
+
203
+ ![](images/2c852dbad637cd22f8dfa77d421dada0dae6dd2bc1057ee42d3f1b915a3181b8.jpg)
204
+ Figure 8: Adversarial classification margins $\tilde { \psi } _ { i }$ of the attacked nodes. In (a), we compare our local PR-BCD attack with Nettack $ { \mathbb { I } } ^ { { \left[ 5 0 \right] } }$ on (undirected) Cora ML. In (b), we show the results on the (directed) largescale datasets Products (2.5 million nodes) and Papers 100M (111 million nodes), respectively. Our Soft Medoid PPRGo resists the attacks much better than the baselines.
205
+
206
+ # 6 Conclusion
207
+
208
+ We study the adversarial robustness of GNNs at scale. We tackle all three of the identified challenges: (1) we introduce surrogate losses for global attacks that can double the attack strength, (2) we principally scale first-order attacks that optimize over the quadratic number of possible edges, and (3) we propose a scalable defense using our novel Soft Median which is differentiable as well as provably robust. We show that our attacks and defenses are practical by scaling to graphs of up to 111 million nodes. In some settings our defense reduces the attack’s success rate from around $90 \%$ to $1 \%$ . Most importantly, our work enables the assessment of robustness for massive-scale applications with GNNs.
209
+
210
+ # Acknowledgments and Disclosure of Funding
211
+
212
+ This research was supported by the Helmholtz Association under the joint research school “Munich School for Data Science - MUDS“.
213
+
214
+ References
215
+ [1] M. Andriushchenko and M. Hein. Provably robust boosted decision stumps and trees against adversarial attacks. In Advances in Neural Information Processing Systems. Curran Associates, Inc., 2019.
216
+ [2] A. Bojchevski and S. Günnemann. Deep Gaussian embedding of graphs: Unsupervised inductive learning via ranking. 6th International Conference on Learning Representations, ICLR, 2018.
217
+ [3] A. Bojchevski and S. Günnemann. Certifiable Robustness to Graph Perturbations. Neural Information Processing Systems, NeurIPS, 2019.
218
+ [4] A. Bojchevski, J. Klicpera, and S. Günnemann. Efficient Robustness Certificates for Graph Neural Networks via Sparsity-Aware Randomized Smoothing. 37th International Conference on Machine Learning, ICML, 2020.
219
+ [5] A. Bojchevski, J. Klicpera, B. Perozzi, A. Kapoor, M. Blais, B. Rózemberczki, M. Lukasik, and S. Günnemann. Scaling Graph Neural Networks with Approximate PageRank. International Conference on Knowledge Discovery and Data Mining, KDD, 2020.
220
+ [6] N. Carlini and D. Wagner. Towards Evaluating the Robustness of Neural Networks. IEEE Symposium on Security and Privacy, 2017.
221
+ [7] J. Chen, T. Ma, and C. Xiao. FASTGCN: Fast learning with graph convolutional networks via importance sampling. 6th International Conference on Learning Representations, ICLR, 2018.
222
+ [8] J. Chen, Y. Wu, X. Xu, Y. Chen, H. Zheng, and Q. Xuan. Fast gradient attack on network embedding. arXiv:1809.02797, 2018.
223
+ [9] J. Chen, Y. Chen, H. Zheng, S. Shen, S. Yu, D. Zhang, and Q. Xuan. MGA: Momentum Gradient Attack on Network. IEEE Transactions on Computational Social Systems, 2020.
224
+ [10] J. Chen, X. Lin, H. Xiong, Y. Wu, H. Zheng, and Q. Xuan. Smoothing Adversarial Training for GNN. IEEE Transactions on Computational Social Systems, 2020.
225
+ [11] L. Chen, J. Li, Q. Peng, Y. Liu, Z. Zheng, and C. Yang. Understanding Structural Vulnerability in Graph Convolutional Networks. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, Montreal, Canada, Aug. 2021. International Joint Conferences on Artificial Intelligence Organization.
226
+ [12] T. Chen, B. Xu, C. Zhang, and C. Guestrin. Training Deep Nets with Sublinear Memory Cost. arXiv preprint arXiv:1604.06174, 2016.
227
+ [13] W. L. Chiang, Y. Li, X. Liu, S. Bengio, S. Si, and C. J. Hsieh. Cluster-GCN: An efficient algorithm for training deep and large graph convolutional networks. International Conference on Knowledge Discovery and Data Mining, KDD, 2019.
228
+ [14] H. Dai, H. Li, T. Tian, H. Xin, L. Wang, Z. Jun, and S. Le. Adversarial attack on graph structured data. 35th International Conference on Machine Learning, ICML, 3, 2018.
229
+ [15] D. Donoho and P. J. Huber. The notion of breakdown point. In A Festschrift For Erich L. Lehmann. Wadsworth Statist./Probab. Ser., Wadsworth, Belmont, CA, 1983, 1983.
230
+ [16] N. Entezari, S. A. Al-Sayouri, A. Darvishzadeh, and E. E. Papalexakis. All you need is Low (rank): Defending against adversarial attacks on graphs. International Conference on Web Search and Data Mining, WSDM, 2020.
231
+ [17] B. Feng, Y. Wang, X. Li, and Y. Ding. Scalable Adversarial Attack on Graph Neural Networks with Alternating Direction Method of Multipliers. arXiv:2009.10233 [cs, stat], Sept. 2020. arXiv: 2009.10233.
232
+ [18] S. Geisler, D. Zügner, and S. Günnemann. Reliable Graph Neural Networks via Robust Aggregation. Neural Information Processing Systems, NeurIPS, (NeurIPS), 2020.
233
+ [19] S. Geisler, D. Zügner, A. Bojchevski, and S. Günnemann. Attacking Graph Neural Networks at Scale. Deep Learning for Graphs at AAAI Conference on Artificial Intelligence, 2021.
234
+ [20] S. Günnemann. Graph neural networks: Adversarial robustness. In L. Wu, P. Cui, J. Pei, and L. Zhao, editors, Graph Neural Networks: Foundations, Frontiers, and Applications, chapter 8. Springer, Singapore, 2021.
235
+ [21] W. Hu, M. Fey, M. Zitnik, Y. Dong, H. Ren, B. Liu, M. Catasta, and J. Leskovec. Open Graph Benchmark: Datasets for Machine Learning on Graphs. 2020.
236
+ [22] M. Jin, H. Chang, W. Zhu, and S. Sojoudi. Power up! Robust Graph Convolutional Network against Evasion Attacks based on Graph Powering. AAAI Conference on Artificial Intelligence, 2019.
237
+ [23] W. Jin, T. Derr, Y. Wang, Y. Ma, Z. Liu, and J. Tang. Node Similarity Preserving Graph Convolutional Networks. WSDM 2021 - Proceedings of the 14th ACM International Conference on Web Search and Data Mining, 2021.
238
+ [24] T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. 5th International Conference on Learning Representations, ICLR, 2017.
239
+ [25] J. Klicpera, S. Weißenberger, and S. Günnemann. Diffusion Improves Graph Learning. Neural Information Processing Systems, NeurIPS, 2019.
240
+ [26] J. Li, T. Xie, L. Chen, F. Xie, X. He, and Z. Zheng. Adversarial attack on large scale graph. IEEE Transactions on Knowledge & Data Engineering, 2021.
241
+ [27] J. Ma, S. Ding, and Q. Mei. Towards More Practical Adversarial Attacks on Graph Neural Networks. Neural Information Processing Systems, NeurIPS, (NeurIPS), 2020.
242
+ [28] A. K. McCallum, K. Nigam, J. Rennie, and K. Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 2000.
243
+ [29] Y. Nesterov. Efficiency of coordinate descent methods on huge-scale optimization problems. SIAM J. Optim., 22, 2012.
244
+ [30] Y. Nesterov and S. Stich. Efficiency of accelerated coordinate descent method on structured optimization problems. Siam J. Optim., 27, 2017.
245
+ [31] S. Prillo and J. Martin Eisenschlos. SoftSort: A Continuous Relaxation for the argsort Operator. 37th International Conference on Machine Learning, ICML, 119, 2020.
246
+ [32] J. Schuchardt, A. Bojchevski, J. Klicpera, and S. Günnemann. Collective robustness certificates. 9th International Conference on Learning Representations, ICLR, 2021.
247
+ [33] P. Sen, G. M. Namata, M. Bilgic, L. Getoor, B. Gallagher, and T. Eliassi-Rad. Collective classification in network data. AI Magazine, 2008.
248
+ [34] O. Shchur, M. Mumme, A. Bojchevski, and S. Günnemann. Pitfalls of Graph Neural Network Evaluation. arXiv:1811.05868 [cs, stat], June 2019. arXiv: 1811.05868.
249
+ [35] X. Tang, Y. Li, Y. Sun, H. Yao, P. Mitra, and S. Wang. Transferring robustness for graph neural network against poisoning attacks. Conference on Web Search and Data Mining, WSDM, 2020.
250
+ [36] J. Wang, M. Luo, F. Suya, J. Li, Z. Yang, and Q. Zheng. Scalable attack on graph data by injecting vicious nodes. Data Mining and Knowledge Discovery, 34(5), 2020.
251
+ [37] M. Waniek, T. P. Michalak, M. J. Wooldridge, and T. Rahwan. Hiding individuals and communities in a social network. Nature Human Behaviour, 2(2), 2018.
252
+ [38] L. Weng, H. Zhang, H. Chen, Z. Song, C.-J. Hsieh, L. Daniel, D. Boning, and I. Dhillon. Towards Fast Computation of Certified Robustness for ReLU Networks. In 35th International Conference on Machine Learning, ICML, July 2018.
253
+ [39] S. J. Wright. Coordinate Descent Algorithms. Mathematical Programming, 151, 2015.
254
+ [40] F. Wu, A. Souza, T. Zhang, C. Fifty, T. Yu, and K. Weinberger. Simplifying Graph Convolutional Networks. In 36th International Conference on Machine Learning, ICML, May 2019.
255
+ [41] H. Wu, C. Wang, Y. Tyshetskiy, A. Docherty, K. Lu, and L. Zhu. Adversarial examples for graph data: Deep insights into attack and defense. IJCAI International Joint Conference on Artificial Intelligence, 2019-Augus, 2019.
256
+ [42] T. Wu, H. Ren, P. Li, and J. Leskovec. Graph Information Bottleneck. Neural Information Processing Systems, NeurIPS, (NeurIPS), 2020.
257
+ [43] K. Xu, H. Chen, S. Liu, P. Y. Chen, T. W. Weng, M. Hong, and X. Lin. Topology attack and defense for graph neural networks: An optimization perspective. IJCAI International Joint Conference on Artificial Intelligence, 2019-Augus, 2019.
258
+ [44] R. Ying, R. He, K. Chen, P. Eksombatchai, W. L. Hamilton, and J. Leskovec. Graph convolutional neural networks for web-scale recommender systems. International Conference on Knowledge Discovery and Data Mining, KDD, 2018.
259
+ [45] H. Zhang, T.-W. Weng, P.-Y. Chen, C.-J. Hsieh, and L. Daniel. Efficient Neural Network Robustness Certification with General Activation Functions. In Advances in Neural Information Processing Systems. Curran Associates, Inc., 2018.
260
+ [46] X. Zhang and M. Zitnik. GNNGuard: Defending Graph Neural Networks against Adversarial Attacks. Neural Information Processing Systems, NeurIPS, (NeurIPS), 2020.
261
+ [47] Y. Zhang, S. Pal, M. Coates, and D. Ustebay. Bayesian Graph Convolutional Neural Networks for Semi-Supervised Classification. AAAI Conference on Artificial Intelligence, 33, 2019.
262
+ [48] D. Zhu, P. Cui, Z. Zhang, and W. Zhu. Robust graph convolutional networks against adversarial attacks. International Conference on Knowledge Discovery and Data Mining, KDD, 2019.
263
+ [49] D. Zügner and S. Günnemann. Adversarial attacks on graph neural networks via meta learning. 7th International Conference on Learning Representations, ICLR, 2019.
264
+ [50] D. Zügner, A. Akbarnejad, and S. Günnemann. Adversarial attacks on neural networks for graph data. International Conference on Knowledge Discovery and Data Mining, KDD, 2018.
md/train/xzqLpqRzxLq/xzqLpqRzxLq.md ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IEPT: INSTANCE-LEVEL AND EPISODE-LEVEL PRETEXT TASKS FOR FEW-SHOT LEARNING
2
+
3
+ Manli Zhang, Jianhong Zhang & Zhiwu Lu ∗
4
+ Gaoling School of Artificial Intelligence, Renmin University of China, Beijing, China Beijing Key Laboratory of Big Data Management and Analysis Methods, Beijing, China {manlizhang,jianhong,luzhiwu}@ruc.edu.cn
5
+
6
+ Tao Xiang University of Surrey, Guildford, Surrey, UK t.xiang@surrey.ac.uk
7
+
8
+ Mingyu Ding
9
+ The University of Hong Kong, Hong Kong
10
+ mingyuding@hku.hk
11
+
12
+ # Songfang Huang
13
+
14
+ Alibaba DAMO Academy, Hangzhou, China songfang.hsf@alibaba-inc.com
15
+
16
+ # ABSTRACT
17
+
18
+ The need of collecting large quantities of labeled training data for each new task has limited the usefulness of deep neural networks. Given data from a set of source tasks, this limitation can be overcome using two transfer learning approaches: few-shot learning (FSL) and self-supervised learning (SSL). The former aims to learn ‘how to learn’ by designing learning episodes using source tasks to simulate the challenge of solving the target new task with few labeled samples. In contrast, the latter exploits an annotation-free pretext task across all source tasks in order to learn generalizable feature representations. In this work, we propose a novel Instance-level and Episode-level Pretext Task (IEPT) framework that seamlessly integrates SSL into FSL. Specifically, given an FSL episode, we first apply geometric transformations to each instance to generate extended episodes. At the instancelevel, transformation recognition is performed as per standard SSL. Importantly, at the episode-level, two SSL-FSL hybrid learning objectives are devised: (1) The consistency across the predictions of an FSL classifier from different extended episodes is maximized as an episode-level pretext task. (2) The features extracted from each instance across different episodes are integrated to construct a single FSL classifier for meta-learning. Extensive experiments show that our proposed model (i.e., FSL with IEPT) achieves the new state-of-the-art.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ Deep convolutional neural networks (CNNs) (Krizhevsky et al., 2012; He et al., 2016b; Huang et al., 2017) have seen tremendous successes in a wide range of application fields, especially in visual recognition. However, the powerful learning ability of CNNs depends on a large amount of manually labeled training data. In practice, for many visual recognition tasks, sufficient manual annotation is either too costly to collect or not feasible (e.g., for rare object classes). This has severely limited the usefulness of CNNs for real-world application scenarios. Attempts have been made recently to mitigate such a limitation from two distinct perspectives, resulting in two popular research lines, both of which aim to transfer knowledge learned from the data of a set of source tasks to a new target one: few-shot learning (FSL) and self-supervised learning (SSL).
23
+
24
+ FSL (Fei-Fei et al., 2006; Vinyals et al., 2016; Finn et al., 2017; Snell et al., 2017; Sung et al., 2018) typically takes a ‘learning to learn’ or meta-learning paradigm. That is, it aims to learn an algorithm for learning from few labeled samples, which generalizes well across any tasks. To that end, it adopts an episodic training strategy – the source tasks are arranged into learning episodes, each of which contains $n$ classes and $k$ labeled samples per class to simulate the setting for the target task. Part of the CNN model (e.g., feature extraction subnet, classification layers, or parameter initialization) is then meta-learned for rapid adaptation to new tasks.
25
+
26
+ ![](images/ac5ad2ee0448bf35ac7fc284a145ae6ff0d67b950b288048f1c82a5d8bf0456d.jpg)
27
+ Figure 1: Schematic of our approach to FSL. Given a training episode, we apply 2D rotations by 0, 90, 180, and 270 degrees to each instance to generate four extended episodes. After going through a feature extraction CNN, four losses over three branches are designed: (1) In the top branch, we employ a self-supervised rotation classifier with the instance-level SSL loss $\mathcal { L } _ { i n s t }$ . (2) In the middle branch, an FSL classifier is exploited to predict the FSL classification probabilities for each episode. We maximize the classification consistency among the extended episodes by forcing the four probability distributions to be consistent using $\mathcal { L } _ { e p i s }$ . The average supervised FSL loss $\mathcal { L } _ { a u x }$ is also computed. (3) In the bottom branch, we utilize an integration transformer module to fuse the features extracted from each instance with different rotation transformations; they are then used to compute an integrated FSL loss $\mathcal { L } _ { i n t e g }$ . Among the four losses, $\mathcal { L } _ { i n s t }$ and $\mathcal { L } _ { e p i s }$ are the self-supervised losses, and $\mathcal { L } _ { a u x }$ and $\mathcal { L } _ { i n t e g }$ are the supervised losses.
28
+
29
+ In contrast, SSL (Doersch et al., 2015; Noroozi & Favaro, 2016; Iizuka et al., 2016; Doersch & Zisserman, 2017; Noroozi et al., 2018) does not require the source data to be annotated. Instead, it exploits an annotation-free pretext task on the source task data in the hope that a task-generalizable feature representation can be learned from the source tasks for easy adoption or adaptation in a target task. Such a pretext task gets its self-supervised signal at the per-instance level. Examples include rotation and context prediction (Gidaris et al., 2018; Doersch et al., 2015), jigsaw solving (Noroozi & Favaro, 2016), and colorization (Iizuka et al., 2016; Larsson et al., 2016). Since these pretext tasks are class-agnostic, solving them leads to the learning of transferable knowledge.
30
+
31
+ Since both FSL and SSL aim to reduce the need of collecting a large amount of labeled training data for a target task by transferring knowledge from a set of source tasks, it is natural to consider combining them in a single framework. Indeed, two recent works (Gidaris et al., 2019; Su et al., 2020) proposed to integrate SSL into FSL by adding an auxiliary SSL pretext task in an FSL model. It showed that the SSL learning objective is complementary to that of FSL and combining them leads to improved FSL performance. However, in (Gidaris et al., 2019; Su et al., 2020), SSL is combined with FSL in a superficial way: it is only taken as a separate auxiliary task for each single training instance and has no effect on the episodic training pipeline of the FSL model. Importantly, by ignoring the class labels of samples, the instance-level SSL learning objective is weak on its own. Since meta-learning across episodes is the essence of most contemporary FSL models, we argue that adding instance-level SSL pretext tasks alone fails to exploit fully the complementarity of the aforementioned FSL and SSL, for which a closer and deeper integration is needed.
32
+
33
+ To that end, in this paper we propose a novel Instance-level and Episode-level Pretext Task (IEPT) framework for few-shot recognition. Apart from adding an instance-level pretext SSL task as in (Gidaris et al., 2019; Su et al., 2020), we introduce two episode-level SSL-FSL hybrid learning objectives for seamless SSL-FSL integration. Concretely, as illustrated in Figure 1, our full model has three additional learning objectives (besides the standard FSL one): (1) Different rotation transformations are applied to each original few-shot episode to generate a set of extended episodes, where each image has a rotation label for the instance-level pretext task (i.e., to predict the rotation label). (2) The consistency across the predictions of an FSL classifier from different extended episodes is maximized as an episode-level pretext task. For each training image, the rotation transformation does not change its semantic content and hence its class label; the FSL classifier predictions across different extended episodes thus should be consistent, hence the consistency regularization objective. (3) The correlation of features across instances from these extended episodes is modeled by a transformer-based attention module, optimizing the fusion of the features of each instance/image and its various rotation-transformed versions mainly for task adaptation during meta-testing. Importantly, with these three new learning objectives introduced in IEPT, any meta-learning based FSL model can now benefit more from SSL by fully exploiting their complementarity.
34
+
35
+ Our main contributions are: (1) For the first time, we propose both instance-level and episode-level pretext tasks (IEPT) for integrating SSL into FSL. The episode-level pretext task enables episodic training of SSL and hence closer integration of SSL with FSL. (2) In addition to these pretext tasks, FSL further benefits from SSL by integrating features extracted from various rotation-transformed versions of the original training instances. The optimal way of feature integration is learned by a transformer-based attention module, which is mainly designed for task adaptation during meta-testing. (3) Extensive experiments show that the proposed model achieves the new state-of-the-art.
36
+
37
+ # 2 RELATED WORK
38
+
39
+ Few-Shot Learning. The recent FSL studies are dominated by meta-learning based methods. They can be divided into three groups: (1) Metric-based methods (Vinyals et al., 2016; Snell et al., 2017; Sung et al., 2018; Allen et al., 2019; Xing et al., 2019; Li et al., 2019a;b; Wu et al., 2019; Ye et al., 2020; Afrasiyabi et al., 2020; Liu et al., 2020; Zhang et al., 2020) aim to learn the distance metric between feature embeddings. The focus of these methods is often on meta-learning of a feature-extraction CNN, whilst the classifiers used are of simple form such as a nearest-neighbor classifier. (2) Optimization-based methods (Finn et al., 2017; Ravi & Larochelle, 2017; Rusu et al., 2019; Lee et al., 2019) learn to optimize the model rapidly given a few labeled samples per class in the new task. (3) Model-based methods (Santoro et al., 2016; Munkhdalai & Yu, 2017; Mishra et al., 2018) focus on designing either specific model structures or parameters capable of rapid updating. Apart from these three groups of methods, other FSL methods have attempted feature hallucination (Schwartz et al., 2018; Hariharan & Girshick, 2017; Gao et al., 2018; Wang et al., 2018; Zhang et al., 2019; Tsutsui et al., 2019) which generates additional samples from the given few shots for network finetuning, and parameter predicting (Qiao et al., 2018; Qi et al., 2018; Gidaris & Komodakis, 2019; 2018) which learns to predict part of the parameters of a network given few samples of new classes for quick adaptation. In this work, we adopt the metric-based Prototypical Network (ProtoNet) (Snell et al., 2017) as the basic FSL classifier for the main instantiation of our IEPT framework due to its simplicity and popularity. However, we show that any meta-learning based FSL method can be combined with our IEPT (see results in Figure 2(c)).
40
+
41
+ Self-Supervised Learning. In SSL, it is assumed that the source task data is label-free and a pretext task is designed to provide self-supervision signals at the instance-level. Existing SSL approaches differ mainly in the pretext task design. These include predicting the rotation angle (Gidaris et al., 2018) and the context of image patch (Doersch et al., 2015; Nathan Mundhenk et al., 2018), jigsaw solving (Noroozi & Favaro, 2016; Noroozi et al., 2018) (i.e. shuffling and then reordering image patch), and performing images reversion (Iizuka et al., 2016; Pathak et al., 2016; Larsson et al., 2016). SSL has been shown to be beneficial to various down-steam tasks such as semantic object matching (Novotny et al., 2018), object segmentation (Ji et al., 2019) and object detection (Doersch & Zisserman, 2017) by learning transferable feature presentations for these tasks.
42
+
43
+ Integrating Self-Supervised Learning into Few-Shot Learning. To the best of our knowledge, only two recent works (Gidaris et al., 2019; Su et al., 2020) have attempted combining SSL with FSL. However, the integration of SSL into FSL is often shallow: the original FSL training pipeline is intact; in the meantime, an additional loss on each image w.r.t. a self-supervised signal like the rotation angle or relative patch location is introduced. With pretext tasks solely at the instance level, combining the two approaches (i.e., SSL and FSL) can only be superficial without fully exploiting the episodic training pipeline unique to FSL. Different from (Gidaris et al., 2019; Su et al., 2020), we introduce an episode-level pretext task to integrate SSL into the episodic training in FSL fully. Specifically, the consistency across the predictions of an FSL classifier from different extended episodes is maximized to reflect the fact that various rotation transformations should not alter the class-label prediction. Moreover, features of each instance and its various rotation-transformed versions are now fused for FSL classification, to integrate SSL with FSL for the supervised classification task. Our experimental results show that thanks to the closer integration of SSL and FSL, our IEPT clearly outperforms (Gidaris et al., 2019; Su et al., 2020) (see Table 1).
44
+
45
+ # 3 METHODOLOGY
46
+
47
+ # 3.1 PRELIMINARY
48
+
49
+ Problem Setting. Given an $n$ -way $k$ -shot FSL task sampled from a test set $\mathcal { D } _ { t }$ , to imitate the test setting, an FSL model is typically trained in an episodic way. That is, $n$ -way $k$ -shot episodes are randomly sampled from a training set $\mathcal { D } _ { s }$ , where the class label space of $\mathcal { D } _ { s }$ has no overlap with that of $\mathcal { D } _ { t }$ . Each episode $E _ { e }$ contains a support set $S _ { e }$ and a query set $\mathcal { Q } _ { e }$ . Concretely, we first randomly sample a set of $n$ classes $\mathcal { C } _ { e }$ from the training set, and then generate $S _ { e }$ and $\mathcal { Q } _ { e }$ by sampling $k$ support samples and $q$ query samples from each class in $\mathcal { C } _ { e }$ , respectively. Formally, we have $\mathcal S _ { e } \stackrel { - } { = } \{ ( x _ { i } , y _ { i } ) \bar { | } y _ { i } \in \mathcal C _ { e } , i \stackrel { - } { = } 1 , . . . , n \stackrel { - } { \times } k \}$ and $\mathcal { Q } _ { e } = \{ ( x _ { i } , y _ { i } ) | y _ { i } \in \mathcal { C } _ { e } , i = 1 , . . . , n \times q \}$ , where $S _ { e } \cap \mathcal { Q } _ { e } = \emptyset$ . For simplicity, we denote $l _ { k } = n \times k$ and $l _ { q } = n \times q$ . In the meta-training stage, the training process has an inner and an outer loop in each episode: in the inner loop, the model is updated using $S _ { e }$ ; its performance is then evaluated on the query set $\mathcal { Q } _ { e }$ in the outer loop to update the model parameters or algorithm that one wants to meta-learn.
50
+
51
+ Basic FSL Classifier. We employ ProtoNet (Snell et al., 2017) as the basic FSL model. This model has a feature-extraction CNN and a simple non-parametric classifier. The parameter of the feature extractor is to be meta-learned. Concretely, in the inner loop of an episode, ProtoNet fixes the feature extractor and computes the mean feature embedding for each class as follows:
52
+
53
+ $$
54
+ h _ { c } = \frac { 1 } { k } \cdot \sum _ { ( x _ { i } , y _ { i } ) \in S _ { e } } f _ { \phi } ( x _ { i } ) \cdot \mathbb { I } ( y _ { i } = c ) ,
55
+ $$
56
+
57
+ where class $c \in \mathcal { C } _ { e }$ , $f _ { \phi }$ is a feature extractor with learnable parameters $\phi$ , and $\mathbb { I }$ is the indicator function. By computing the distance between the feature embedding of each query sample and that of the corresponding class, the loss function used to meta-learn $\phi$ in the outer loop is defined as:
58
+
59
+ $$
60
+ \mathcal { L } _ { f s l } ( S _ { e } , \mathcal { Q } _ { e } ) = \frac { 1 } { | \mathcal { Q } _ { e } | } \sum _ { ( x _ { i } , y _ { i } ) \in \mathcal { Q } _ { e } } - \log \frac { \exp ( - d ( f _ { \phi } ( x _ { i } ) , h _ { y _ { i } } ) ) } { \sum _ { c \in \mathcal { C } _ { e } } \exp ( - d ( f _ { \phi } ( x _ { i } ) , h _ { c } ) ) } ,
61
+ $$
62
+
63
+ where $d ( \cdot , \cdot )$ denotes a distance function (e.g., the $l _ { 2 }$ distance).
64
+
65
+ # 3.2 PRETEXT TASKS IN IEPT
66
+
67
+ The schematic of our IEPT is illustrated in Figure 1. We first define a set of 2D-rotation operators $\mathcal { G } = \{ g _ { r } | r = 0 , . . . , R - 1 \}$ , where $g _ { r }$ means the operator of rotating the image by $r ^ { * 9 0 }$ degrees and $R$ is the total number of rotations ( $R = 4$ in our implementation). Given an original episode $E _ { e } = \{ S _ { e } , \mathcal { Q } _ { e } \}$ as described in Sec. 3.1, we utilize the 2D-rotation operators from $\mathcal { G }$ in turn to transform each image in $E _ { e }$ . This results in a set of $R$ extended episodes (including the original one) $E = \{ \{ \mathcal { S } _ { e } ^ { r } , \bar { \mathcal { Q } } _ { e } ^ { r } \} | r = 0 , . . . , R - 1 \}$ , where $S _ { e } ^ { r } \ = \ \{ ( x _ { i } , y _ { i } , \bar { r } ) | y _ { i } \in C _ { e } , i \ = \ \bar { 1 } , . . . , l _ { k } \}$ and $\mathcal { Q } _ { e } ^ { r } = \{ ( x _ { i } , y _ { i } , r ) | y _ { i } \in C _ { e } , i = 1 , . . . , l _ { q } \} ,$ . Now each episode is denoted as $E _ { e } ^ { r } = \{ ( x _ { i } , y _ { i } , r ) | y _ { i } \in$ $C _ { e } , i = 1 , . . . , l _ { k } , l _ { k } + 1 , . . . , l _ { k } + l _ { q } \}$ , where the first $l _ { k }$ samples are from $S _ { e } ^ { r }$ and the rest from $\mathcal { Q } _ { e } ^ { r }$ Note that $\{ \cal { S } _ { e } ^ { 0 } , \cal { Q } _ { e } ^ { 0 } \}$ is the original episode $\{ \boldsymbol { S } _ { e } , \boldsymbol { \mathcal { Q } } _ { e } \}$ . With the rotation transformations, each sample $( x _ { i } , y _ { i } , r _ { i } )$ in $E$ carries a class label $y _ { i }$ for supervised learning (from the inherent class) and a label $r _ { i }$ from the rotation operator for self-supervised learning. After generating the set of extended episodes $E$ , the feature extractor $f _ { \phi }$ is applied to each image $x _ { i }$ in $E$ . On these episodes, we design two self-supervised pretext tasks, one at the instance-level and the other episode-level.
68
+
69
+ Instance-Level Pretext Task. The instance-level task is to recognize different rotation transformations. The idea is that if the model to be meta-learned here (i.e., $f _ { \phi } )$ can be used to distinguish different transformations, it must understand the canonical poses of objects (e.g., animals have legs touching the ground and trees have leaves on top), a vital part of class-agnostic and thus transferable knowledge. With the self-supervised rotation label $r _ { i }$ , we consider the mapping: $f _ { \theta _ { r o t } } : x _ { i } \mapsto r _ { i }$ for each instance $( x _ { i } , y _ { i } , r _ { i } ) \in E$ , where $f _ { \theta _ { r o t } }$ is a rotation classifier with learnable parameters $\theta _ { r o t }$ . Given the input pair $( x _ { i } , r _ { i } )$ , the total instance-level rotation loss is a cross-entropy loss:
70
+
71
+ $$
72
+ \mathcal { L } _ { i n s t } = \frac { 1 } { R ( l _ { k } + l _ { q } ) } \sum _ { r = 0 } ^ { R - 1 } \sum _ { ( x _ { i } , y _ { i } , r _ { i } ) \in E _ { e } ^ { r } } - \log \frac { \exp ( [ f _ { \theta _ { r o t } } ( f _ { \phi } ( x _ { i } ) ) ] _ { r _ { i } } ) } { \sum _ { r ^ { \prime } = 0 } ^ { R - 1 } \exp ( [ f _ { \theta _ { r o t } } ( f _ { \phi } ( x _ { i } ) ) ] _ { r ^ { \prime } } ) } ,
73
+ $$
74
+
75
+ where $[ f _ { \theta _ { r o t } } ( f _ { \phi } ( x _ { i } ) ) ] \in \mathbb { R } ^ { R }$ is the rotation scoring vector and $[ \cdot ] _ { r }$ means taking the $r$ -th element.
76
+
77
+ Episode-Level Pretext Task. We design the episode-level task based on a simple principle: although different extended episodes contain images with different rotation transformations, these transformations do not change their class labels. Consequently, the FSL classifier should produce consistent probability distributions for each instance across different extended episodes. Such consistency can be measured using the Kullback–Leibler (KL) divergence. Formally, for each extended episode $\{ S _ { e } ^ { r } , \mathcal { Q } _ { e } ^ { r } \}$ in $E$ , we first define the probability distribution of FSL classification over the query set $\mathcal { Q } _ { e } ^ { r }$ as $\mathcal { P } _ { e } ^ { r } = [ p _ { 1 } ^ { r } ; \cdot \cdot \cdot ; p _ { l _ { q } } ^ { r } ] \in \mathbb { R } ^ { l _ { q } \times n }$ , where $p _ { i } ^ { r } \in \mathbb { R } ^ { n }$ is the probability distribution for $x _ { i }$ in $\mathcal { Q } _ { e } ^ { r }$ with its $c$ -th element $[ p _ { i } ^ { r } ] _ { c }$ $\mathbf { \bar { \psi } } c = 1 , . . . , n )$ being:
78
+
79
+ $$
80
+ [ p _ { i } ^ { r } ] _ { c } = \frac { \exp ( - d ( f _ { \phi } ( x _ { i } ) , h _ { c } ^ { r } ) ) } { \sum _ { c ^ { \prime } } \exp ( - d ( f _ { \phi } ( x _ { i } ) , h _ { c ^ { \prime } } ^ { r } ) ) } .
81
+ $$
82
+
83
+ The above probability is computed as in Sec. 3.1 and the class embedding $h _ { c } ^ { r }$ is obtained from $S _ { e } ^ { r }$ The mean probability distribution of the $R$ extended episodes is thus given by:
84
+
85
+ $$
86
+ \hat { p } _ { i } = \frac { 1 } { R } \cdot \sum _ { r = 0 } ^ { R - 1 } p _ { i } ^ { r } .
87
+ $$
88
+
89
+ The total episode-level consistency regularization loss is computed with the KL divergence loss:
90
+
91
+ $$
92
+ \mathcal { L } _ { e p i s } = \frac { 1 } { R l _ { q } } \cdot \sum _ { r = 0 } ^ { R - 1 } \sum _ { i = 1 } ^ { l _ { q } } \mathrm { m e a n } ( p _ { i } ^ { r } ( \log p _ { i } ^ { r } - \log \hat { p } _ { i } ) ) .
93
+ $$
94
+
95
+ where $\mathrm { m e a n } ( \cdot )$ is an element-wise averaging function.
96
+
97
+ # 3.3 INTEGRATED FSL TASK
98
+
99
+ The two tasks introduced so far are self-supervised tasks without using the class labels in the query set. Now we describe how in the supervised classification task, the extended episodes can be used.
100
+
101
+ Given the set of extended episodes $E$ , we denote the feature set of $E$ as $E _ { e m b }$ , where $E _ { e m b } =$ $\{ f _ { \phi } ( x _ { i } ) | ( x _ { i } , y _ { i } , r ) \in E _ { e } ^ { r } , r = 0 , \cdots , R - 1 , i = 1 , . . . , l _ { k } + l _ { q } \}$ . Note that each extended episode in $E$ corresponds to one specific rotation transformation of the same set of images from the original episode $E _ { e }$ . Therefore, in order to capture the correlation among instances with different transformations and learn how best combine them to form the class mean for meta-learning, an instance attention module is deployed w.r.t. each image in $E _ { e }$ (i.e., all images are assumed to be independent). Specifically, based on $E _ { e m b }$ , we construct the feature tensor $\bar { F } \in \mathbb { R } ^ { ( l _ { k } + l _ { q } ) \times R \times d }$ , where $d$ is the feature dimension. We then adopt a transformer to obtain the integrated representation for FSL classification. The transformer architecture is based on a self-attention mechanism, as in (Vaswani et al., 2017). It receives the triplet input $( F , F , F )$ as $( Q , K , V )$ (Query, Key, and Value, respectively). With $\dot { F } ^ { ( i ) }$ being the $i$ -th row of $F$ (w.r.t. the $i$ -th image in $E _ { e }$ ), the attentive module is defined as:
102
+
103
+ $$
104
+ \begin{array} { r l } & { ( \boldsymbol { F } _ { Q } ^ { ( i ) } , \boldsymbol { F } _ { K } ^ { ( i ) } , \boldsymbol { F } _ { V } ^ { ( i ) } ) = ( \boldsymbol { F } ^ { ( i ) } \boldsymbol { W } _ { Q } , \boldsymbol { F } ^ { ( i ) } \boldsymbol { W } _ { K } , \boldsymbol { F } ^ { ( i ) } \boldsymbol { W } _ { V } ) , } \\ & { \boldsymbol { F } _ { a t t } ^ { ( i ) } = \boldsymbol { F } ^ { ( i ) } + \mathrm { s o f t m a x } ( \frac { \boldsymbol { F } _ { Q } ^ { ( i ) } ( \boldsymbol { F } _ { K } ^ { ( i ) } ) ^ { T } } { \sqrt { d _ { K } } } ) \boldsymbol { F } _ { V } ^ { ( i ) } , } \end{array}
105
+ $$
106
+
107
+ where $d _ { K } = d$ , and $W _ { Q } , W _ { K } , W _ { V }$ represent the parameters of three fully-connected layers respectively (the parameters of the integration transformer are collected as $\theta _ { i n t }$ ). Note that the key and value are computed from each image and its augmented versions, i.e., they are computed independently without using inter-image correlation. With the attentive feature $F _ { a t t } \in \mathbb { R } ^ { ( l _ { k } + l _ { q } ) \times R \times d }$ , the integrated representation $F _ { i n t e g } = [ F ^ { S } ; F ^ { Q } ] \in \mathbb { R } ^ { ( l _ { k } + l _ { q } ) \times R d }$ ( $F ^ { S }$ and $F ^ { Q }$ are respectively for the support set and query set) is given by:
108
+
109
+ $$
110
+ F _ { i n t e g } = \mathrm { f l a t t e n } ( F _ { a t t } ) ,
111
+ $$
112
+
113
+ where flatten $( \cdot )$ denotes flattening $F _ { a t t }$ along the last two dimensions, i.e., concatenating the attentive features from different extended episodes for the corresponding images. The integrated representation is then inputted to the FSL classifier to define the FSL classification loss:
114
+
115
+ $$
116
+ \mathcal { L } _ { i n t e g } = \frac { 1 } { l _ { q } } \cdot \sum _ { i = 1 } ^ { l _ { q } } - \log \frac { \exp ( - d ( F _ { i } ^ { Q } , h _ { y _ { i } } ^ { f } ) ) } { \sum _ { c \in \mathcal { C } _ { e } } \exp ( - d ( F _ { i } ^ { Q } , h _ { c } ^ { f } ) ) }
117
+ $$
118
+
119
+ where the class embedding the integrated FSL task act $\begin{array} { r } { h _ { c } ^ { f } = \frac { 1 } { k } \cdot \sum _ { i = 1 } ^ { l _ { k } } F _ { i } ^ { S } \cdot \mathbb { I } ( y _ { i } = c ) } \end{array}$ is computed on the support set. Note thatrediction averaging.
120
+
121
+ # 3.4 TOTAL LOSS
122
+
123
+ The total training loss for our full model consists of the self-supervised losses from the pretext tasks and the supervised losses from the FSL tasks. In this work, in addition to $\mathcal { L } _ { i n t e g }$ in Eq. (10), another supervised FSL loss $\mathcal { L } _ { a u x }$ is also used (see Figure 1). $\mathcal { L } _ { a u x }$ is the average FSL classification loss over the extended episodes. Formally, it can be written as:
124
+
125
+ $$
126
+ \mathcal { L } _ { a u x } = \frac { 1 } { R } \cdot \sum _ { r = 0 } ^ { R - 1 } \mathcal { L } _ { f s l } ( S _ { e } ^ { r } , \mathcal { Q } _ { e } ^ { r } )
127
+ $$
128
+
129
+ Therefore, the total loss $\mathcal { L } _ { t o t a l }$ for training our full model is given as follows:
130
+
131
+ $$
132
+ \begin{array} { r } { \mathcal { L } _ { t o t a l } = \underbrace { \overbrace { w _ { 1 } * \mathcal { L } _ { i n s t } } ^ { i n s t a n c e { - } l e v e l } + \overbrace { w _ { 2 } * \mathcal { L } _ { e p i s } } ^ { e p i s o d e { - } l e v e l } } _ { \mathrm { s e l f - s u p e r v i s e d l o s s } } + \underbrace { w _ { 3 } * \mathcal { L } _ { a u x } + \mathcal { L } _ { i n t e g } } _ { \mathrm { s u p e r v i s e d l o s s } } , } \end{array}
133
+ $$
134
+
135
+ where $w _ { 1 } , w _ { 2 } , w _ { 3 }$ are the loss weight hyperparameters.
136
+
137
+ # 3.5 INFERENCE
138
+
139
+ During the test stage, we only exploit the integrated representation $F _ { i n t e g }$ for the final FSL prediction. The predicted class label for $x _ { i } \in \mathcal { Q } _ { e }$ can be computed with Eq. (10) as:
140
+
141
+ $$
142
+ y _ { i } ^ { p r e d } = \underset { y \in \mathcal { C } _ { e } } { \operatorname { a r g m a x } } \frac { \exp ( - d ( F _ { i } ^ { Q } , h _ { y } ^ { f } ) ) } { \sum _ { c \in \mathcal { C } _ { e } } \exp ( - d ( F _ { i } ^ { Q } , h _ { c } ^ { f } ) ) } .
143
+ $$
144
+
145
+ # 3.6 FULL IEPT ALGORITHM
146
+
147
+ For easy reproduction, we present the full algorithm for FSL with IEPT in Algorithm 1. Once learned, with the learned $\psi$ , we can perform the inference over the test episodes with Eq. (13).
148
+
149
+ # Algorithm 1 FSL with IEPT
150
+
151
+ Input: The training set $\mathcal { D } _ { s }$ , the rotation operator set $\mathcal { G }$
152
+ The loss weight hyperparameters $w _ { 1 } , w _ { 2 } , w _ { 3 }$
153
+ Output: The learned $\psi$
154
+ 1: Randomly initialize all learnable parameters $\psi = \{ \phi , \theta _ { r o t } , \theta _ { i n t } \}$
155
+ 2: for iteration $= 1$ , ..., MaxIteration do
156
+ 3: Randomly sample episode $E _ { e }$ from $\mathcal { D } _ { s }$
157
+ 4: Generate the set of extended episodes $E$ from $E _ { e }$ using $\mathcal { G }$
158
+ 5: Compute the SSL loss $\mathcal { L } _ { i n s t }$ for the instance-level pretext task with Eq. (3)
159
+ 6: Compute the SSL loss $\mathcal { L } _ { e p i s }$ for the episode-level pretext task with Eq. (6)
160
+ 7: Compute the supervised FSL loss $\mathcal { L } _ { a u x }$ over the extended episodes with Eq. (11)
161
+ 8: Compute the supervised FSL loss $\mathcal { L } _ { i n t e g }$ for the integrated episode with Eq. (10)
162
+ 9: $\mathcal { L } _ { t o t a l } = w _ { 1 } * \mathcal { L } _ { i n s t } + w _ { 2 } * \mathcal { L } _ { e p i s } + w _ { 3 } * \mathcal { L } _ { a u x } + \mathcal { L } _ { i n t }$ teg
163
+ 10: Update $\psi$ based on $\nabla _ { \psi }$ Ltotal
164
+ 11: end for
165
+ 12: return $\psi$ .
166
+
167
+ # 4 EXPERIMENTS
168
+
169
+ # 4.1 EXPERIMENTAL SETUP
170
+
171
+ Datasets. Two widely-used FSL datasets are selected: miniImageNet (Vinyals et al., 2016) and tieredImageNet (Ren et al., 2018). The first dataset consists of a total number of 100 classes (600 images per class) and the train/validation/test split is set to 64/16/20 classes as in (Ravi & Larochelle, 2017). The second dataset is a larger dataset including 608 classes totally (nearly 1,200 images per class), which is split into 351/97/160 classes for train/validation/test. Both datasets are subsets sampled from ImageNet (Russakovsky et al., 2015).
172
+
173
+ Table 1: Comparative results for 5-way 1/5-shot FSL. The mean classification accuracies (top-1, $\%$ with the $9 5 \%$ confidence intervals are reported. $\dagger$ indicates the result is reproduced by ourselves.
174
+
175
+ <table><tr><td rowspan="2">Method</td><td colspan="3">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>Backbone</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MatchingNet (Vinyals etal.,2016)</td><td>Conv4-64</td><td>43.56± 0.84</td><td>55.31± 0.73</td><td></td><td></td></tr><tr><td>ProtoNet† (Snell et al., 2017)</td><td>Conv4-64</td><td>52.61 ± 0.52</td><td>71.33 ± 0.41</td><td>53.33 ± 0.50</td><td>72.10 ± 0.41</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>Conv4-64</td><td>48.70 ± 1.84</td><td>63.10 ±0.92</td><td>51.67 ± 1.81</td><td>70.30 ±0.08</td></tr><tr><td>Relation Net (Sung et al.,2018)</td><td>Conv4-64</td><td>50.40 ± 0.80</td><td>65.30 ±0.70</td><td>54.48 �� 0.93</td><td>71.32 ± 0.78</td></tr><tr><td>IMP† (Allen et al., 2019)</td><td>Conv4-64</td><td>52.91 ± 0.49</td><td>71.57 ± 0.42</td><td>53.63 ± 0.51</td><td>71.89 ± 0.44</td></tr><tr><td>DN4 (Li et al., 2019b)</td><td>Conv4-64</td><td>51.24 ± 0.74</td><td>71.02 ± 0.64</td><td></td><td>1</td></tr><tr><td>DN PARN (Wu et al., 2019)</td><td>Conv4-64</td><td>55.22 ± 0.84</td><td>71.55 ± 0.66</td><td></td><td></td></tr><tr><td>PN+rot (Gidaris et al., 2019)</td><td>Conv4-64</td><td>53.63 ± 0.43</td><td>71.70 ± 0.36</td><td></td><td></td></tr><tr><td>CC+rot (Gidaris et al., 2019)</td><td>Conv4-64</td><td>54.83 ± 0.43</td><td>71.86 ± 0.33</td><td></td><td></td></tr><tr><td>DSN-MR (Simon et al., 2020)</td><td>Conv4-64</td><td>55.88 ± 0.90</td><td>70.50±0.68</td><td></td><td></td></tr><tr><td>Centroid (Afrasiyabi et al., 2020)</td><td>Conv4-64</td><td>53.14 ± 1.06</td><td>71.45 ± 0.72</td><td></td><td></td></tr><tr><td>Neg-Cosine (Liu et al., 2020)</td><td>Conv4-64</td><td>52.84 ±0.76</td><td>70.41 ± 0.66</td><td></td><td>一</td></tr><tr><td>IEPT (ours)</td><td>Conv4-64</td><td>56.26± 0.45</td><td></td><td>73.91±0.34 58.25±0.48 75.63±0.46</td><td></td></tr><tr><td>ProtoNet† (Snell et al.,2017)</td><td>Conv4-512</td><td>53.25± 0.44</td><td>73.15 ± 0.35</td><td>57.88 ±0.50</td><td>76.82±0.40</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>Conv4-512</td><td>49.33 ±0.60</td><td>65.17 ± 0.49</td><td>52.84± 0.56</td><td>70.91 ± 0.46</td></tr><tr><td>Relation Net (Sung et al.,2018)</td><td>Conv4-512</td><td>50.86 ± 0.57</td><td>67.32 ± 0.44</td><td>54.69 ±0.59</td><td>72.71 ±0.43</td></tr><tr><td>PN+rot (Gidaris et al.,2019)</td><td>Conv4-512</td><td>56.02 ±0.46</td><td>74.00 ± 0.35</td><td></td><td>一</td></tr><tr><td>CC+rot (Gidaris et al., 2019)</td><td>Conv4-512</td><td>56.27 ± 0.43</td><td>74.30 ± 0.33</td><td></td><td>一</td></tr><tr><td>IEPT (ours)</td><td>Conv4-512</td><td>58.43±0.46</td><td>75.07±0.33</td><td>60.91±0.59</td><td>79.61±0.45</td></tr><tr><td>ProtoNet† (Snell et al.,2017)</td><td>ResNet-12</td><td>62.39 ±0.51</td><td>80.53±0.42</td><td>68.23±0.50</td><td>84.03 ± 0.41</td></tr><tr><td>TADAM (Oreshkin et al., 2018)</td><td>ResNet-12</td><td>58.50 ± 0.30</td><td>76.70 ±0.38</td><td></td><td>一</td></tr><tr><td>MetaOptNet (Lee et al.,2019)</td><td>ResNet-12</td><td>62.64± 0.61</td><td>78.63 ± 0.46</td><td>65.99 ± 0.72</td><td>81.56 ± 0.63</td></tr><tr><td>MTL (Sun et al., 2019)</td><td>ResNet-12</td><td>61.20 ± 1.80</td><td>75.50 ± 0.80</td><td>65.62 ± 1.80</td><td>80.61 ±0.90</td></tr><tr><td>CAN (Hou et al., 2019)</td><td>ResNet-12</td><td>63.85 ±0.48</td><td>79.44 ± 0.34</td><td>69.89 ± 0.51</td><td>84.23 ± 0.37</td></tr><tr><td>AM3 (Xing et al., 2019)</td><td>ResNet-12</td><td>65.21 ± 0.49</td><td>75.20 ±0.36</td><td>67.23 ± 0.34</td><td>78.95 ± 0.22</td></tr><tr><td>Shot-Free (Ravichandran et al.,2019)</td><td>ResNet-12</td><td>59.04 ± 0.43</td><td>77.64 ± 0.39</td><td>66.87 ± 0.43</td><td>82.64 ±0.43</td></tr><tr><td>Neg-Cosine (Liu et al., 2020)</td><td>ResNet-12</td><td>63.85 ± 0.81</td><td>81.57 ± 0.56</td><td></td><td></td></tr><tr><td>Distill (Tian et al., 2020)</td><td>ResNet-12</td><td>64.82 ±0.60</td><td>82.14 ± 0.43</td><td>71.52 ± 0.69</td><td>86.03 ±0.49</td></tr><tr><td>DSN-MR (Simon et al.,2020)</td><td>ResNet-12</td><td>64.60 ±0.72</td><td>79.51± 0.50</td><td>67.39 ± 0.82</td><td>82.85 ±0.56</td></tr><tr><td>DeepEMD (Zhang et al.,2020)</td><td>ResNet-12</td><td>65.91 ± 0.82</td><td>82.41 ± 0.56</td><td>71.16 ± 0.87</td><td>86.03 ± 0.58</td></tr><tr><td>FEAT (Ye et al.,2020)</td><td>ResNet-12</td><td>66.78±0.20</td><td>82.05 ± 0.14</td><td>70.80 ±0.23</td><td>84.79 ± 0.16</td></tr><tr><td>ProtoNet+Rotation (Su et al.,2020)</td><td>ResNet-18</td><td></td><td>76.00±0.60</td><td></td><td>78.90±0.70</td></tr><tr><td>IEPT (ours)</td><td>ResNet-12</td><td>67.05±0.448</td><td>82.90±0.30</td><td>)72.24±0.50 86.73±0.34</td><td></td></tr></table>
176
+
177
+ Feature Extractors. For fair comparison with published results, our IEPT adopts three widely-used feature extractors: Conv4-64 (Vinyals et al., 2016), Conv4-512, and ResNet-12 (He et al., 2016a). Particularly, Conv4-512 is almost the same as Conv4-64 except having a different channel size of the last convolution layer. To speed up the training process, as in many previous works (Ye et al., 2020; Zhang et al., 2020; Simon et al., 2020), we pretrain all the feature extractors on the training split of each dataset for our IEPT. Following (He et al., 2016a), we use the temperature scaling skill during the training phase. On both datasets, the input image size is $8 4 \times 8 4$ . The output feature dimensions of Conv4-64, Conv4-512, and ResNet-12 are 64, 512, and 640, respectively.
178
+
179
+ Evaluation Metrics. We take the 5-way 5-shot (or 1-shot) FSL evaluation setting, as in previous works. We randomly sample 2,000 episodes from the test split and report the mean classification accuracy (top-1, $\%$ ) as well as the $9 5 \%$ confidence interval. Since the integration transformer copes with each sample independently, we take a strict non-transductive setting during evaluation.
180
+
181
+ Implementation Details. PyTorch is used for our implementation. We utilize the Adam optimizer (Kingma & Ba, 2015) for Conv4-64 & Conv4-512 and the SGD optimizer for ResNet-12 to train our IEPT model. The hyperparameters of our IEPT model are selected according to the performance on the validation split.We will release the code soon.
182
+
183
+ # 4.2 MAIN RESULTS
184
+
185
+ Comparison to State-of-the-Arts. We compare our IEPT with two groups of baselines: (1) Recent SSL-based FSL methods (Gidaris et al., 2019; Su et al., 2020); (2) Representative/latest FSL methods (w/o SSL) (Snell et al., 2017; Finn et al., 2017; Lee et al., 2019; Ravichandran et al., 2019; Simon et al., 2020; Zhang et al., 2020; Ye et al., 2020; Liu et al., 2020). The comparative results for 5-way
186
+
187
+ Table 2: Ablation study results for our full IEPT model over miniImageNet and tieredImageNet. Our full model includes two self-supervised losses (i.e. $\mathcal { L } _ { e p i s }$ and $\mathcal { L } _ { i n s t . }$ ) and two supervised losses (i.e. $\mathcal { L } _ { a u x }$ and $L _ { i n t e g . }$ ). Conv4-64 is used as the feature extractor.
188
+
189
+ <table><tr><td></td><td></td><td></td><td></td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>Linteg</td><td>Linst</td><td>Lepis</td><td>Laux</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>√</td><td></td><td></td><td></td><td>55.04 ± 0.52</td><td>72.01 ± 0.41</td><td>56.98 ± 0.47</td><td>74.15 ± 0.51</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>55.49 ± 0.56</td><td>72.54± 0.46</td><td>57.41 ± 0.51</td><td>74.65 ± 0.50</td></tr><tr><td>√</td><td></td><td></td><td></td><td>55.88± 0.43</td><td>72.97 ± 0.40</td><td>57.76± 0.45</td><td>75.06 ± 0.40</td></tr><tr><td>√</td><td></td><td></td><td></td><td>55.97 ± 0.57</td><td>73.28 ± 0.39</td><td>57.83 ± 0.55</td><td>75.22 ± 0.48</td></tr><tr><td>√</td><td>?</td><td>&gt;&gt;&gt;</td><td>√</td><td>56.26 ± 0.45</td><td>73.91 ± 0.34</td><td>58.25 ± 0.48</td><td>75.63 ± 0.46</td></tr></table>
190
+
191
+ ![](images/af3c8b4f8135fe31235a01a5a12b5a61f1267d2c4e0e0affdba8e3fca164fe3e.jpg)
192
+ Figure 2: (a) Comparison among different combination methods over episodes for FSL with selfsupervision. $\mathbf { ( b ) }$ Illustration of the effect of different choices of $R$ on the performance of our model $R$ denotes the number of extended episodes used for SSL). (c) Comparative results obtained by our IEPT using different basic FSL classifiers (i.e. ProtoNet, FEAT, and IMP). It can be seen clearly that integrated episode-based fusion leads to more separation between classes. All figures present 5-way 1-shot/5-shot results on miniImageNet, using Conv4-64 as the feature extractor.
193
+
194
+ 1/5-shot FSL are shown in Table 1. We have the following observations: (1) When compared with the representative/latest FSL methods (w/o SSL), our IEPT achieves the best performance on all datasets and under all settings, validating the effectiveness of SSL with IEPT for FSL. (2) Our IEPT also clearly outperforms the two SSL-based FSL methods (Gidaris et al., 2019; Su et al., 2020) which only use instance-level pretext tasks, demonstrating the importance of closer/episode-level integration of SSL into FSL. (3) The improvements achieved by our IEPT over ProtoNet range from $2 \%$ to $5 \%$ . Since our IEPT takes ProtoNet as the baseline, the obtained margins provide direct evidence that SSL brings significant benefits to FSL. Note that our IEPT is also shown to be effective under both the fine-grained FSL and cross-domain FSL settings in Sec. 4.3 (see Table 3).
195
+
196
+ Ablation Study. Our full IEPT model is trained with four losses (see Eq. (12)), including two self-supervised losses and two supervised losses: the episode-level SSL loss $\mathcal { L } _ { e p i s }$ , the instance-level SSL loss $\mathcal { L } _ { i n s t }$ , the auxiliary FSL loss $\mathcal { L } _ { a u x }$ and the integrated FSL loss $\bar { L } _ { i n t e g }$ . To demonstrate the contribution of each loss, we present the ablation study results for our full IEPT model in Table 2, where Conv4-64 is used as the backbone. We start with $L _ { i n t e g }$ and then add the additional three losses successively. It can be observed that the performance of our model continuously increases when more losses are used, indicating that each loss contributes to the final performance.
197
+
198
+ # 4.3 FURTHER EVALUATIONS
199
+
200
+ Different Combination Methods over Episodes. We have introduced a transformer-based attention module to fuse the features of each instance from all extended episodes (and an integrated episode can be obtained) for the supervised classification task (see Sec. 3.3). In this experiment, we compare it with two alternative ways of across-episode integration: (1) Averaging extended episodes: the extended episodes are directly fused for FSL classification; (2) Averaging all episodes: the extended episodes as well as the integrated episode are fused for FSL classification. We present the comparative results on miniImageNet in Figure 2(a). For comprehensive comparison, the results of FSL with each single extended episode are also reported. We can observe that: (1) The performance of ‘Episode $0 ^ { \circ }$ ’ is the highest among the four baselines (i.e., FSL with single extended episode), perhaps because the feature extractor is pretrained on the original images without rotation transformations. (2) FSL by averaging extended episodes (i.e., ‘Averaging extended episodes’) indeed improves each of the four baselines. (3) FSL with integrated episode (i.e., ‘Integrated episode’) is superior to FSL by simply averaging extended episodes. (4) Comparing ‘Integrated episode’ with ‘Averaging all episodes’, the performance of FSL with integrated episode is more stable across different settings, furthering validating the usefulness of our across-episode integration. Overall, the episode-integration module is indeed effective in FSL with self-supervision. This is also supported by the visualization results presented in Appendices A.3 & A.4.
201
+
202
+ Table 3: Comparative results for the fine-grained FSL on CUB (Wah et al., 2011) and the cross-domain FSL on miniImageNet CUB.
203
+
204
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Backbone</td><td colspan="2">CUB</td><td colspan="2">miniImageNet→CUB</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MatchingNet (Vinyals et al.,2016)</td><td>Conv4-64</td><td>61.16±0.89</td><td>72.86±0.70</td><td>42.62 ± 0.55</td><td>56.53± 0.44</td></tr><tr><td>ProtoNet (Snell et al.,2017)</td><td>Conv4-64</td><td>63.72 ±0.22</td><td>81.50 ± 0.15</td><td>50.51 ± 0.56</td><td>69.28±0.40</td></tr><tr><td>MAML (Finn et al.,2017)</td><td>Conv4-64</td><td>55.92 ± 0.95</td><td>72.09 ±0.76</td><td>43.59 ± 0.54</td><td>54.18 ± 0.41</td></tr><tr><td>Relation Net (Sung et al., 2018)</td><td>Conv4-64</td><td>62.45 ± 0.98</td><td>76.11 ± 0.69</td><td>49.84 ±0.54</td><td>68.98 ±0.42</td></tr><tr><td>FEAT(Ye et al.,2020)</td><td>Conv4-64</td><td>68.87 ±0.22</td><td>82.90±0.15</td><td>51.52 ± 0.54</td><td>70.16 ± 0.40</td></tr><tr><td>IEPT(ours)</td><td>Conv4-64</td><td>69.97±0.49</td><td>84.33± 0.33</td><td>52.68±0.56</td><td>72.98±0.40</td></tr></table>
205
+
206
+ Different Number of Extended Episodes. In all the above experiments, the number of the extended episodes $R$ is set to 4 (rotation by $0 ^ { \circ }$ , $9 0 °$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ ). Figure 2(b) shows the impact of the value of $R$ . Note that when $R = 1$ , our IEPT model is equivalent to ProtoNet which is without self-supervision. It can be seen that the performance of our model consistently grows when $R$ increases from 1 to 4. Additionally, the study on exploiting other pretext tasks for our IEPT is presented in Appendix A.1.
207
+
208
+ Different Basic FSL Classifiers. As mentioned in Sec. 3.1, we adopt ProtoNet as the basic FSL classifier due to its scalability and simplicity. To further show the effectiveness of our IEPT when other basic FSL classifiers are used, we provide the results obtained by our IEPT using ProtoNet, FEAT, and IMP for FSL in Figure 2(c). It can be clearly observed that our IEPT leads to an improvement of about $1 \%$ over each basic FSL method (ProtoNet, FEAT, or IMP), indicating that our IEPT can be applied to improve a variety of popular FSL methods.
209
+
210
+ Comparative Results for Fine-Grained FSL and Cross-Domain FSL. To evaluate our IEPT algorithm under the fine-grained FSL and cross-domain FSL settings, we conduct experiments on CUB (Wah et al., 2011) and miniImageNet $ \mathrm { C U B }$ , respectively. For fine-grained FSL on CUB, following (Ye et al., 2020), we randomly split the dataset into 100 training classes, 50 validation classes, and 50 test classes. For cross-domain FSL on miniImageNet $ \mathrm { C U B }$ , the 100 training classes are from miniImageNet; the 50 validation classes and 50 test classes (using the aforementioned split for fine-grained FSL) are from CUB. Under both settings, we use Conv4-64 as the feature extractor. The 5-way 1/5-shot FSL results are shown in Table 3. Our IEPT clearly achieves the best results, yielding $1 - 3 \%$ improvements over the second-best FEAT. This shows the effectiveness of our IEPT under both fine-grained and cross-domain settings.
211
+
212
+ # 5 CONCLUSION
213
+
214
+ We have proposed a novel Instance-level and Episode-level Pretext Task (IEPT) framework for integrating SSL into FSL. For the first time, we have introduced an episode-level pretext task for FSL with self-supervision, in addition to the conventional instance-level pretext task. Moreover, we have also developed an episode extension-integration framework by introducing an integration transformer module to fully exploit the extended episodes for FSL. Extensive experiments on two benchmarks demonstrate that the proposed model (i.e., FSL with IEPT) achieves the new state-of-theart. Our ongoing research directions include: exploring other episode-level pretext tasks for FSL with self-supervision, and applying FSL with self-supervision to other vision problems.
215
+
216
+ # ACKNOWLEDGMENTS
217
+
218
+ This work was supported in part by National Natural Science Foundation of China (61976220 and 61832017), Beijing Outstanding Young Scientist Program (BJJWZYJH012019100020098), Open Project Program Foundation of Key Laboratory of Opto-Electronics Information Processing, Chinese Academy of Sciences (OEIP-O-202006), and Alibaba Innovative Research (AIR) Program.
219
+
220
+ # REFERENCES
221
+
222
+ Arman Afrasiyabi, Jean-Franc¸ois Lalonde, and Christian Gagne. Associative alignment for few-shot image ´ classification. In European Conference on Computer Vision (ECCV), 2020.
223
+
224
+ Kelsey R. Allen, Evan Shelhamer, Hanul Shin, and Joshua B. Tenenbaum. Infinite mixture prototypes for few-shot learning. In International Conference on Machine Learning (ICML), pp. 232–241, 2019.
225
+
226
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. International Conference on Learning Representations (ICLR), 2020.
227
+
228
+ Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In International Conference on Computer Vision (ICCV), pp. 2051–2060, 2017.
229
+
230
+ Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In International Conference on Computer Vision (ICCV), pp. 1422–1430, 2015.
231
+
232
+ Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), pp. 594–611, 2006.
233
+
234
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML), pp. 1126–1135, 2017.
235
+
236
+ Hang Gao, Zheng Shou, Alireza Zareian, Hanwang Zhang, and Shih-Fu Chang. Low-shot learning via covariancepreserving adversarial augmentation networks. In Advances in Neural Information Processing Systems, pp. 975–985, 2018.
237
+
238
+ Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4367–4375, 2018.
239
+
240
+ Spyros Gidaris and Nikos Komodakis. Generating classification weights with gnn denoising autoencoders for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 21–30, 2019.
241
+
242
+ Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations (ICLR), 2018.
243
+
244
+ Spyros Gidaris, Andrei Bursuc, Nikos Komodakis, Patrick Perez, and Matthieu Cord. Boosting few-shot visual learning with self-supervision. In International Conference on Computer Vision (ICCV), pp. 8059–8068, 2019.
245
+
246
+ Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In International Conference on Computer Vision (ICCV), pp. 3037–3046, 2017.
247
+
248
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016a.
249
+
250
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016b.
251
+
252
+ Ruibing Hou, Hong Chang, MA Bingpeng, Shiguang Shan, and Xilin Chen. Cross attention network for few-shot classification. In Advances in Neural Information Processing Systems, pp. 4003–4014, 2019.
253
+
254
+ Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4700–4708, 2017.
255
+
256
+ Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Let there be color! joint end-to-end learning of global and local image priors for automatic image colorization with simultaneous classification. ACM Transactions on Graphics (ToG), pp. 1–11, 2016.
257
+
258
+ Xu Ji, Joao F Henriques, and Andrea Vedaldi. Invariant information clustering for unsupervised image clas- ˜ sification and segmentation. In International Conference on Computer Vision (ICCV), pp. 9865–9874, 2019.
259
+
260
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
261
+
262
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1097–1105, 2012.
263
+
264
+ Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Learning representations for automatic colorization. In European Conference on Computer Vision (ECCV), pp. 577–593, 2016.
265
+
266
+ Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10657– 10665, 2019.
267
+
268
+ Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang. Finding task-relevant features for few-shot learning by category traversal. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–10, 2019a.
269
+
270
+ Wenbin Li, Lei Wang, Jinglin Xu, Jing Huo, Yang Gao, and Jiebo Luo. Revisiting local descriptor based imageto-class measure for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7260–7268, 2019b.
271
+
272
+ Bin Liu, Yue Cao, Yutong Lin, Qi Li, Zheng Zhang, Mingsheng Long, and Han Hu. Negative margin matters: Understanding margin in few-shot classification. In European Conference on Computer Vision (ECCV), 2020.
273
+
274
+ Leland McInnes, John Healy, and James Melville. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018.
275
+
276
+ Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. In International Conference on Learning Representations (ICLR), 2018.
277
+
278
+ Tsendsuren Munkhdalai and Hong Yu. Meta networks. In International Conference on Machine Learning (ICML), pp. 2554–2563, 2017.
279
+
280
+ T Nathan Mundhenk, Daniel Ho, and Barry Y Chen. Improvements to context based self-supervised learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9339–9348, 2018.
281
+
282
+ Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision (ECCV), pp. 69–84, 2016.
283
+
284
+ Mehdi Noroozi, Ananth Vinjimoor, Paolo Favaro, and Hamed Pirsiavash. Boosting self-supervised learning via knowledge transfer. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9359–9367, 2018.
285
+
286
+ David Novotny, Samuel Albanie, Diane Larlus, and Andrea Vedaldi. Self-supervised learning of geometrically stable features through probabilistic introspection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3637–3645, 2018.
287
+
288
+ Boris Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. Tadam: Task dependent adaptive metric for ´ improved few-shot learning. In Advances in Neural Information Processing Systems, pp. 721–731, 2018.
289
+
290
+ Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2536–2544, 2016.
291
+
292
+ Hang Qi, Matthew Brown, and David G Lowe. Low-shot learning with imprinted weights. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5822–5830, 2018.
293
+
294
+ Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7229–7238, 2018.
295
+
296
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017.
297
+
298
+ Avinash Ravichandran, Rahul Bhotika, and Stefano Soatto. Few-shot learning with embedded class models and shot-free meta training. In International Conference on Computer Vision (ICCV), pp. 331–339, 2019.
299
+
300
+ Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, and Richard S. Zemel. Meta-learning for semi-supervised few-shot classification. In International Conference on Learning Representations (ICLR), 2018.
301
+
302
+ 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. In International Journal of Computer Vision (IJCV), pp. 211–252, 2015.
303
+
304
+ Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In International Conference on Learning Representations (ICLR), 2019.
305
+
306
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In International Conference on Machine Learning (ICML), pp. 1842–1850, 2016.
307
+
308
+ Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Abhishek Kumar, Rogerio Feris, Raja Giryes, and Alex Bronstein. Delta-encoder: an effective sample synthesis method for few-shot object recognition. In Advances in Neural Information Processing Systems, pp. 2850–2860, 2018.
309
+
310
+ Christian Simon, Piotr Koniusz, Richard Nock, and Mehrtash Harandi. Adaptive subspaces for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4136–4145, 2020.
311
+
312
+ Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, pp. 4077–4087, 2017.
313
+
314
+ Jong-Chyi Su, Subhransu Maji, and Bharath Hariharan. When does self-supervision improve few-shot learning? In European Conference on Computer Vision (ECCV), 2020.
315
+
316
+ Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 403–412, 2019.
317
+
318
+ Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1199–1208, 2018.
319
+
320
+ Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: a good embedding is all you need? In European Conference on Computer Vision (ECCV), 2020.
321
+
322
+ Satoshi Tsutsui, Yanwei Fu, and David Crandall. Meta-reinforced synthetic data for one-shot fine-grained visual recognition. In Advances in Neural Information Processing Systems, pp. 3057–3066, 2019.
323
+
324
+ 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.
325
+
326
+ Oriol Vinyals, Charles Blundell, Timothy Lillicrap, koray kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
327
+
328
+ 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.
329
+
330
+ Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7278–7286, 2018.
331
+
332
+ Ziyang Wu, Yuwei Li, Lihua Guo, and Kui Jia. Parn: Position-aware relation networks for few-shot learning. In International Conference on Computer Vision (ICCV), pp. 6659–6667, 2019.
333
+
334
+ Chen Xing, Negar Rostamzadeh, Boris Oreshkin, and Pedro O O. Pinheiro. Adaptive cross-modal few-shot learning. In Advances in Neural Information Processing Systems, pp. 4847–4857, 2019.
335
+
336
+ Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Few-shot learning via embedding adaptation with set-toset functions. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8808–8817, 2020.
337
+
338
+ Chi Zhang, Yujun Cai, Guosheng Lin, and Chunhua Shen. Deepemd: Few-shot image classification with differentiable earth mover’s distance and structured classifiers. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 12203–12213, 2020.
339
+
340
+ Hongguang Zhang, Jing Zhang, and Piotr Koniusz. Few-shot learning via saliency-guided hallucination of samples. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2770–2779, 2019.
341
+
342
+ # A APPENDIX
343
+
344
+ # A.1 COMPARISON AMONG DIFFERENT SSL STRATEGIES
345
+
346
+ To generate the extended episodes in IEPT, we apply four rotation transformations (i.e. rotation by $0 ^ { \circ }$ , $9 0 °$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ ) to each image. It makes sense to explore whether other self-supervised strategies are also effective for our IEPT. To this end, we exploit shuffling image patches (see Figure 3) for self-supervised learning (SSL). Specifically, we divide each image into $2 ^ { \ast } 2$ patches and reorganize the patch orders to obtain a shuffling label. To compare with the rotation strategy fairly, we choose only four shuffling orders: (1, 2, 3, 4), (2, 3, 4, 1), (3, 4, 1, 2) and (4, 1, 2, 3). Note that the (1, 2, 3, 4) shuffling order equals to the original image. Similar to the rotation strategy, a fully-connected layer is utilized to recognize the shuffling order. The comparative results are shown in Table 4. We can see that both IEPT with shuffling and IEPT with rotation achieve better performance than the original ProtoNet. Particularly, IEPT with shuffling yields $1 - 3 \%$ and $3- 4 \%$ improvements under 5-shot and 1-shot, respectively. This clearly shows the effectiveness of our IEPT for FSL even when different SSL strategies are used to define the pretext tasks.
347
+
348
+ Table 4: FSL results obtained by our IEPT using two SSL strategies (i.e. rotation and shuffling image patches). Conv4-64 is used as the feature extractor.
349
+
350
+ <table><tr><td>Method</td><td rowspan="2">Backbone</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td></td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>ProtoNet</td><td>Conv4-64</td><td>52.61 ±0.52</td><td>71.33 ± 0.41</td><td>53.33 ± 0.50</td><td>72.10± 0.41</td></tr><tr><td>IEPT (rotation)</td><td>Conv4-64</td><td>56.26 ± 0.45</td><td>73.91 ± 0.34</td><td>58.25 ±0.48</td><td>75.63 ± 0.46</td></tr><tr><td>IEPT (shuffling)</td><td>Conv4-64</td><td>55.57 ± 0.60</td><td>72.84 ± 0.54</td><td>57.81 ± 0.48</td><td>74.92 ± 0.50</td></tr></table>
351
+
352
+ ![](images/2d68786b89daf9ea45fcd13f2c425d6edbd6a37859f608778de12061ff067209.jpg)
353
+ Figure 3: Illustration of the self-supervised strategy by shuffling image patches.
354
+
355
+ A.2 COMPARISON AMONG DIFFERENT INTEGRATION APPROACHES
356
+
357
+ We employ the integration transformer to find the intrinsic correlation of various rotation-transformed instances. The transformer architecture is based on a self-attention mechanism. Concretely, it receives the feature sets of extended episodes as input $Q$ , $K$ and $V$ . Further, it matches each query in $Q$ with a list of keys in $K$ and returns the weighted sum of corresponding values. To show the importance of the transformer module, we compare it with two other integration approaches (i.e. concatenating and averaging) to integrate the features of extended episodes. The comparative results in Table 5 demonstrate that the integration transformer consistently performs better than the simply concatenating/averaging approaches. This suggests that the attention-based integration transformer is a better choice for designing the integration module.
358
+
359
+ Table 5: Comparative results obtained by three different approaches to integrating the features from the extended episodes, with Conv4-64 being the feature extractor.
360
+
361
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Backbone</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>concatenating</td><td>Conv4-64</td><td>51.52±0.60</td><td>73.36± 0.49</td><td>50.78±0.68</td><td>72.79± 0.57</td></tr><tr><td>averaging</td><td>Conv4-64</td><td>51.58 ± 0.62</td><td>70.97 ± 0.54</td><td>53.91 ± 0.69</td><td>72.52 ± 0.59</td></tr><tr><td>transformer (ours)</td><td>Conv4-64</td><td>56.26± 0.45</td><td>73.91 ± 0.34</td><td>58.25 ± 0.48</td><td>75.63± 0.46</td></tr></table>
362
+
363
+ ![](images/afa66040ad4c1918609b3c5a1e793531019fcc73f4e6f207f4681c14646f499f.jpg)
364
+ Figure 4: Feature visualizations of a number of test episodes using the UMAP algorithm (McInnes et al., 2018). Each row indicates a group of test extended episodes (the first four columns, rotation by $0 ^ { \circ }$ , $9 0 °$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ ) and their integrated episode (the last column). The 5-way 5-shot FSL (with Conv4-64) is adopted on miniImageNet.
365
+
366
+ # A.3 FEATURE VISUALIZATIONS OF TEST EPISODES
367
+
368
+ We provide the feature visualizations of test episodes in Figure 4. It can be seen that an integrated episode (the last one in each row) clearly has a better cluster data structure than the corresponding four extended episodes (the first four ones in each row). This indicates that our transformer-based across-episode integration is indeed effective for few-shot classification with self-supervision.
369
+
370
+ # A.4 ATTENTION VISUALIZATION OF TEST EPISODES
371
+
372
+ We present attention map visualization of two test episodes (left and right) in Figure 5. Each average attention map is computed by averaging the attention map of all instances of a certain class. We can observe that: (1) The average attention maps from different classes vary significantly, showing that the diverse semantics of different classes can be reflected by our attention-based integration transformer. (2) When the classes of two episodes overlap (e.g., ‘trifle’ and ‘dalmatian’), the average attention maps of an overlapped class from two episodes are similar, illustrating that our attention-based integration transformer can well capture the semantics of classes across episodes.
373
+
374
+ ![](images/d5c83307373ad302b67daff2626249571668bdb71167a2ce318b0ac9aa79845d.jpg)
375
+ Figure 5: Feature and attention visualization of two test episodes (left and right). Both figures present 5-way 5-shot results on miniImageNet, using Conv4-64 as the feature extractor.
376
+
377
+ A.5 COMPARISON WITH SIMPLE BASELINE FOR SSL+FSL
378
+
379
+ We compare our IEPT with a simple baseline that trains the model with $\mathcal { L } _ { a u x } + \mathcal { L } _ { i n s t }$ and then makes inference by just averaging the outputs of different extended episodes. The results are shown in Table 6. It can be observed that the performance of our IEPT is much more effective than that of simple integration, due to the extra use of $\mathcal { L } _ { i n t e g } + \mathcal { L } _ { e p i s }$ for FSL.
380
+
381
+ Table 6: Comparison with the simple baseline that trains the model with $\mathcal { L } _ { a u x } + \mathcal { L } _ { i n s t }$ and then makes inference by just averaging the outputs of different extended episodes.
382
+
383
+ <table><tr><td></td><td></td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>Method</td><td>Backbone</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>Laux+Linst</td><td>Conv4-64</td><td>53.25 ± 0.46</td><td>71.50 ± 0.42</td><td>55.06 ± 0.44</td><td>72.87 ± 0.42</td></tr><tr><td>IEPT (ours)</td><td>Conv4-64</td><td>56.26 ± 0.45</td><td>73.91 ± 0.34</td><td>58.25 ± 0.48</td><td>75.63 ± 0.46</td></tr></table>
384
+
385
+ # A.6 DIFFERENT ALTERNATIVES OF SELF-SUPERVISED LOSSES
386
+
387
+ In Table 7, we provide further ablation study regarding different alternatives of $\mathcal { L } _ { e p i s }$ and $\mathcal { L } _ { i n s t }$ . For the episode-level self-supervised loss $\mathcal { L } _ { e p i s }$ , we compare our implementation (using the KL loss between each distribution and the mean distribution) with that using a pairwise KL loss (i.e., the KL loss between each pair of distributions). For the instance-level self-supervised loss $\mathcal { L } _ { i n s t }$ , we compare our implementation (using the rotation prediction loss) with the recent self-supervised learning technique (Chen et al., 2020). We observe that our implementation achieves slight performance improvements over those using the pairwise KL loss or the contrastive learning loss.
388
+
389
+ Table 7: Ablation study results regarding different alternatives of $\mathcal { L } _ { e p i s }$ and $\mathcal { L } _ { i n s t }$
390
+
391
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Backbone</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>IEPT (Linst-SimCLR)</td><td>Conv4-64</td><td>56.04 ± 0.44</td><td>73.67± 0.41</td><td>58.24± 0.43</td><td>75.59± 0.41</td></tr><tr><td>IEPT (Lepis-Pairwise)</td><td>Conv4-64</td><td>55.95 ± 0.47</td><td>73.72 ±0.40</td><td>57.91 ± 0.45</td><td>75.28±0.40</td></tr><tr><td>IEPT (ours)</td><td>Conv4-64</td><td>56.26 ± 0.45</td><td>73.91 ± 0.34</td><td>58.25 ± 0.48</td><td>75.63 ± 0.46</td></tr></table>
392
+
393
+ # A.7 APPLICATION OF IEPT TO OPTIMIZATION-BASED METHOD MAML
394
+
395
+ In Table 8, we show the results obtained by applying our IEPT to the optimization-based model MAML (Finn et al., 2017). We use Conv4-64 as the feature extractor. We can see that our IEPT brings $0 . 7 \% - 2 . 1 \%$ improvements to MAML. This further shows the flexibility (as well as effectiveness) of our IEPT for FSL.
396
+
397
+ Table 8: Comparative results by applying IEPT to the optimization-based method MAML.
398
+
399
+ <table><tr><td rowspan="2"></td><td rowspan="2">Backbone</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>Method MAML</td><td>Conv4-64</td><td>48.70±1.84</td><td>63.10±0.92</td><td>51.67 ± 1.81</td><td>70.30±0.80</td></tr><tr><td>MAML+IEPT</td><td>Conv4-64</td><td>49.68 ± 0.50</td><td>65.22 ± 0.48</td><td>52.85 ± 0.52</td><td>71.04 ± 0.49</td></tr></table>
400
+
401
+ ![](images/19a2a9e135d017944a544b6d105ac0bab71b8611d3f98f7456e4da154a02510e.jpg)
402
+ Figure 6: Visualization of our hyper-parameter analysis under 5-way 1-shot (left) and 5-shot (right) on miniImageNet. Conv4-64 is used as the feature extractor.
403
+
404
+ # A.8 HYPER-PARAMETER SENSITIVITY TEST
405
+
406
+ We select the hyper-parameters $w _ { 1 }$ , $w _ { 2 }$ and $w _ { 3 }$ from the candidate set $\{ 0 . 1 , 0 . 5 , 1 . 0 , 5 . 0 , 1 0 . 0 \}$ and show the hyper-parameter analysis results in Figure 6. We find that the performance of our IEPT is relatively stable. Concretely, the performance of our IEPT is not sensitive to $w _ { 1 }$ and $w _ { 2 }$ with proper values, but too large $w _ { 1 }$ (i.e. $w _ { 1 } = 1 0 . 0 $ ) tends to cause obvious degradation, perhaps because the FSL task is biased by the rotation prediction loss.