Datasets:
Add files using upload-large-folder tool
Browse files- md/train/5rm0b_fsNZ/5rm0b_fsNZ.md +278 -0
- md/train/B1elCp4KwH/B1elCp4KwH.md +347 -0
- md/train/BJeOioA9Y7/BJeOioA9Y7.md +347 -0
- md/train/BJesDsA9t7/BJesDsA9t7.md +243 -0
- md/train/BJlxm30cKm/BJlxm30cKm.md +314 -0
- md/train/BJxkOlSYDH/BJxkOlSYDH.md +0 -0
- md/train/BkgBvsC9FQ/BkgBvsC9FQ.md +275 -0
- md/train/BkgNqkHFPr/BkgNqkHFPr.md +375 -0
- md/train/BkpiPMbA-/BkpiPMbA-.md +288 -0
- md/train/ByeMPlHKPH/ByeMPlHKPH.md +223 -0
- md/train/BylIciRcYQ/BylIciRcYQ.md +362 -0
- md/train/HJxV-ANKDH/HJxV-ANKDH.md +522 -0
- md/train/HkE0Nvqlg/HkE0Nvqlg.md +572 -0
- md/train/J_VRu0ZFVX-/J_VRu0ZFVX-.md +549 -0
- md/train/KJNcAkY8tY4/KJNcAkY8tY4.md +375 -0
- md/train/Mh1Abj33qI/Mh1Abj33qI.md +424 -0
- md/train/QHUUrieaqai/QHUUrieaqai.md +360 -0
- md/train/QgX15Mdi1E_/QgX15Mdi1E_.md +322 -0
- md/train/RLRXCV6DbEJ/RLRXCV6DbEJ.md +307 -0
- md/train/S1MB-3RcF7/S1MB-3RcF7.md +427 -0
- md/train/S1lN69AT-/S1lN69AT-.md +146 -0
- md/train/SJJySbbAZ/SJJySbbAZ.md +0 -0
- md/train/SJgNwi09Km/SJgNwi09Km.md +334 -0
- md/train/SJgTps0qtQ/SJgTps0qtQ.md +245 -0
- md/train/SJgn3lBtwH/SJgn3lBtwH.md +392 -0
- md/train/SJiHXGWAZ/SJiHXGWAZ.md +373 -0
- md/train/SkfrvsA9FX/SkfrvsA9FX.md +462 -0
- md/train/Sy2ogebAW/Sy2ogebAW.md +214 -0
- md/train/Sy8XvGb0-/Sy8XvGb0-.md +307 -0
- md/train/SyNPk2R9K7/SyNPk2R9K7.md +260 -0
- md/train/SyfXKoRqFQ/SyfXKoRqFQ.md +313 -0
- md/train/Syx4_iCqKQ/Syx4_iCqKQ.md +220 -0
- md/train/TRDAFiwDq8A/TRDAFiwDq8A.md +283 -0
- md/train/YNA3UEPCUp/YNA3UEPCUp.md +451 -0
- md/train/cLYyCXHU7g1n/cLYyCXHU7g1n.md +271 -0
- md/train/d0MtHWY0NZ/d0MtHWY0NZ.md +307 -0
- md/train/d7KBjmI3GmQ/d7KBjmI3GmQ.md +562 -0
- md/train/gl3D-xY7wLq/gl3D-xY7wLq.md +394 -0
- md/train/nLYMajjctMh/nLYMajjctMh.md +0 -0
- md/train/o2mbl-Hmfgd/o2mbl-Hmfgd.md +0 -0
- md/train/rJedV3R5tm/rJedV3R5tm.md +391 -0
- md/train/rJxAo2VYwr/rJxAo2VYwr.md +279 -0
- md/train/rkl85oRqYX/rkl85oRqYX.md +0 -0
- md/train/rklOg6EFwS/rklOg6EFwS.md +377 -0
- md/train/rkl_f6EFPS/rkl_f6EFPS.md +0 -0
- md/train/roNqYL0_XP/roNqYL0_XP.md +354 -0
- md/train/sqZ-b0a6Wm/sqZ-b0a6Wm.md +264 -0
- md/train/tKlYQJLYN8v/tKlYQJLYN8v.md +293 -0
- md/train/uys9OcmXNtU/uys9OcmXNtU.md +313 -0
- md/train/xgGS6PmzNq6/xgGS6PmzNq6.md +498 -0
md/train/5rm0b_fsNZ/5rm0b_fsNZ.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Proportional Participatory Budgeting with Additive Utilities
|
| 2 |
+
|
| 3 |
+
Dominik Peters University of Toronto Toronto, ON, Canada dominik@cs.toronto.edu
|
| 4 |
+
|
| 5 |
+
Grzegorz Pierczynski ´ University of Warsaw Warsaw, Poland g.pierczynski@mimuw.edu.pl
|
| 6 |
+
|
| 7 |
+
Piotr Skowron University of Warsaw Warsaw, Poland p.skowron@mimuw.edu.pl
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
We study voting rules for participatory budgeting, where a group of voters collectively decides which projects should be funded using a common budget. We allow the projects to have arbitrary costs, and the voters to have arbitrary additive valuations over the projects. We formulate two axioms that guarantee proportional representation to groups of voters with common interests. To the best of our knowledge, all known rules for participatory budgeting do not satisfy either of the two axioms; in addition we show that the most prominent proportional rule for committee elections, Proportional Approval Voting, cannot be adapted to arbitrary costs nor to additive valuations so that it would satisfy our axioms of proportionality. We construct a simple and attractive voting rule called the Method of Equal Shares that satisfies one of our axioms (for arbitrary costs and arbitrary additive valuations), and that can be evaluated in polynomial time. We prove that our other stronger axiom is also satisfiable, though by a computationally more expensive and less natural voting rule.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Consider an abstract model where there is a group of agents who have preferences over a set of options. Each option has a cost, and the goal is to select a subset of options whose total cost does not exceed a predefined budget. This model provides a formal framework for a number of real-life scenarios. Perhaps the most natural example is Participatory Budgeting (PB). Through a voting system, PB allows residents of a city (the agents) to decide which projects (the options) will be funded by the government. In recent years, PB has been started in many cities around the world [Cabannes, 2004, Aziz and Shah, 2020], and in some cases is used to decide a significant fraction of the city budget. For example, in Paris, PB has been run every year since 2014, and since 2016 the total amount of funding for PB in Paris has been more than 100 million euros annually. Besides PB, the formal model captures the problem of electing a representative committee for a group of voters, say a faculty board or a parliament [Faliszewski et al., 2017, Lackner and Skowron, 2020], but also appears useful in situations that do not involve humans. For example, our framework describes the problem of selecting validators in consensus protocols, such as the blockchain [Cevallos and Stewart, 2020], the problem of selecting web pages that should be displayed in response to user queries, where the selected set of web pages should be useful for different types of user profiles [Skowron et al., 2017] or the problem of locating public facilities [Skowron et al., 2016, Byrka et al., 2018]. Algorithms for PB can even be used for improving the quality of genetic algorithms [Faliszewski et al., 2016]. While there are numerous applications of the model that we consider, for concreteness we will use terminology referring to participatory budgeting.
|
| 16 |
+
|
| 17 |
+
In this paper, we focus on designing algorithms (which we call aggregation rules) for selecting projects. We are interested in rules that are fair in the sense that each agent has roughly equal influence on the outcome.This implies that the selected subset of projects must proportionally represent the views of the voters, and so every group of voters with similar preferences should have an appropriate portion of the available budget allocated to fulfilling those preferences. Our results contribute to the study of fairness in algorithmic decision making. Notably, while many works on this topic aim to be fair to agents described by feature vectors (that for example contain demographic information), we only use agents’ preferences. Fair algorithms will need to identify cohesive groups of agents on their own.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Map of Circleville, showing the locations and costs of the PB project proposals.
|
| 21 |
+
|
| 22 |
+
To understand the constraints that fairness and proportionality place on the decision procedure, let us start by discussing the way cities implement PB today. To count the votes, most cities use a variant of a simple protocol: Each voter is allowed to vote for a certain number of project proposals. Then, the projects with the highest number of votes are funded, until the budget limit is reached. While simple and intuitive, this is a bad voting rule. To see this, consider Circleville, a fictional city divided into four districts. A map of the city is shown in Figure 1. The districts all have similar sizes, but Northside has the largest population. Suppose $\$ 400 k$ have been allocated to PB, and suppose that all the project proposals are of a local character (such as school renovations), and so residents only vote for projects that concern their own district. For example, every Northside resident will cast votes for projects $A , B , C$ , and $D$ , but no one else votes for these. Because Northside is the most populous district, the Northside projects will all receive the highest number of votes, and the voting rule described will spend the entire budget on Northside projects. The 280k residents of the other districts are left empty-handed.
|
| 23 |
+
|
| 24 |
+
To circumvent this obvious issue, many cities have opted to hold separate elections for each district. The budget is divided in advance between the districts (e.g., in proportion to their number of residents), each project is assigned to a district, and voters only vote in their local election. While this avoids the issue of spending the entire budget in Northside, this fix introduces many other problems. For example, projects on the boundary of two districts (such as $A$ and $P$ ) need to be assigned to one of them. Residents of the other district may be in favor of the boundary project, but cannot vote for it. Thus boundary projects are less likely to be funded, even if they would be more valuable overall. Similarly, projects without a specific location that benefit the entire city cannot be handled. Also, interest groups that are not geographic in nature will be underserved; for instance, parents across the city might favor construction of a large playground (project $C$ ), but with separate district elections, parents cannot form a voting block. Similarly, bike riders across the city cannot express their joint interest in the construction of a bike trail along Example River (projects $R , S , H$ , and $G$ ).
|
| 25 |
+
|
| 26 |
+
To solve these problems, it seems desirable to hold a single city-wide election, but use a voting system that ensures that money is spent proportionally. The voting system should automatically and endogenously identify groups of voters who share common interests, and make sure that those groups are appropriately represented. This aim has been identified by several researchers [Aziz et al., 2018b], but no convincing proposal for a proportional voting rule has emerged so far. Indeed, no good formalization of “proportionality” for the PB context has been identified in the literature, except for the concept of the core. However, the core is a very demanding requirement, and there are situations where it fails to exist [Fain et al., 2018].
|
| 27 |
+
|
| 28 |
+
In this paper, we formalize proportionality for participatory budgeting as an axiom called extended justified representation (EJR). The axiom requires that no group of voters with common interests is underserved. We construct a simple and attractive voting rule (the Method of Equal Shares) that satisfies EJR for approval preferences, and that satisfies EJR up to one project for general additive valuations. We then discuss a strengthening of EJR—which we call fully justified representation (FJR)—and show that this strengthening is still satisfiable, albeit by a different voting rule.
|
| 29 |
+
|
| 30 |
+
Both our proportionality axiom and our voting rule are generalizations of concepts that have been introduced in the literature on multi-winner voting [Faliszewski et al., 2017]. That literature can be seen as handling a special case of PB, where all projects cost the same amount of money. This is often called the unit cost assumption. It turns out that the unit cost assumption substantially simplifies the problem. Further, much of the relevant literature studies rules that work with approval ballots, where voters are allowed to approve or disapprove each project. In our paper, we allow any additive valuations (not just 0/1), which is more expressive. The proportionality axioms and voting rules that we introduce all work for general additive valuations. This is notable, since allowing additive valuations introduces significant conceptual difficulty. Indeed, most prominent multi-winner voting rules do not naturally extend to additive valuations (or at least not gracefully).
|
| 31 |
+
|
| 32 |
+
Allowing additive valuations gives voters a way to more precisely describe their preference intensities. This can be valuable information in a PB setting where there are often projects which differ significantly in their cost. In practice, PB elections typically only elicit approval information. Using rules such as ours (defined for general additive valuations), we can interpret this approval information in two different ways: either as $_ { 0 / 1 }$ utilities (so that a voter’s utility for a selected outcome is the number of approved funded projects) or as cost-based utilities (so the utility for an outcome is the total cost of approved funded projects). These two interpretations lead to interestingly different rules, with cost-based utilities favoring more expensive projects and leading to outcomes that are more similar to the outcomes that are selected by the greedy rule typically used by cities today.
|
| 33 |
+
|
| 34 |
+
# 2 Preliminaries
|
| 35 |
+
|
| 36 |
+
For each $t \in \mathbb { N }$ , write $[ t ] = \{ 1 , 2 , \ldots , t \}$ . An election is a tuple $( N , C , \mathrm { c o s t } , \{ u _ { i } \} _ { i \in N } )$ , where:
|
| 37 |
+
|
| 38 |
+
• $N = [ n ]$ and $C = \{ c _ { 1 } , \ldots , c _ { m } \}$ are the sets of voters and candidates (or projects). • cost : $C \to \mathbb { Q } _ { + }$ is a function that for each $c \in C$ assigns the cost that needs to be paid if $c$ is selected. For each $T \subseteq C$ , we write $\begin{array} { r } { \mathrm { c o s t } ( T ) = \sum _ { c \in T } \mathrm { c o s t } ( c ) } \end{array}$ for the total cost of $T$ . • For each voter $i \in N$ , the function $u _ { i } \colon C \to [ 0 , 1 ]$ defines $i$ ’s additive utility function. If a set $T \subseteq C$ of candidates is implemented, $i$ ’s overall utility is $\begin{array} { r } { u _ { i } ( T ) = \sum _ { c \in T } u _ { i } ( c ) } \end{array}$ . For a subset $S \subseteq N$ of voters, we further write $\begin{array} { r } { u _ { S } ( T ) = \sum _ { i \in S } \sum _ { c \in T } u _ { i } ( c ) } \end{array}$ for the total utility enjoyed by $S$ if $T$ is implemented. We assume that $u _ { N } ( c ) > 0$ for each $c \in C$ , so that every candidate is assigned positive utility by at least one voter.
|
| 39 |
+
|
| 40 |
+
The voters have a fixed common budget which we normalize to 1. A subset of candidates $W \subseteq C$ is feasible if $\textstyle \operatorname { c o s t } ( W ) \leq 1$ . Our goal is to choose a feasible subset of candidates, which we call an outcome, based on voters’ utilities. An aggregation rule (or, in short, a rule) is a function $\mathcal { R }$ that for each election $E$ returns a feasible outcome $W = { \mathcal { R } } ( E )$ called the winning outcome. 1
|
| 41 |
+
|
| 42 |
+
There are two interesting special cases of our model:
|
| 43 |
+
|
| 44 |
+
Committee elections. In this case, there exists $k \in \mathbb N$ (the committee size) such that each candidate costs $^ { 1 / k }$ . Then $W$ is an outcome if and only if $| W | \leq k$ . In this special case we also refer to outcomes as committees, and we say that the election satisfies the unit cost assumption.
|
| 45 |
+
|
| 46 |
+
Approval utilities. In this case, for each $i \in N$ and $c \in C$ it holds that $u _ { i } ( c ) \in \{ 0 , 1 \}$ . The approval set of voter $i$ is $A ( i ) : = \{ c \in C \colon u _ { i } ( c ) = 1 \}$ , and we say that $i$ approves candidate $c$ if $c \in A ( i )$ . If $c \in A ( i ) \cap W$ , we say that $c$ is a representative of $i$ .
|
| 47 |
+
|
| 48 |
+
Often we combine of these special cases, and study approval-based committee elections.
|
| 49 |
+
|
| 50 |
+
# 3 The Method of Equal Shares (MES)
|
| 51 |
+
|
| 52 |
+
Recently, Peters and Skowron [2020] introduced an aggregation rule for approval-based committee elections that they called Rule X. In that setting the rule satisfies a combination of appealing proportionality properties. Here, we extend it to the more general model of participatory budgeting, that is, to the model with arbitrary costs and utilities. We will call this rule the Method of Equal Shares (in short, MES).
|
| 53 |
+
|
| 54 |
+
Definition 1 (Method of Equal Shares (MES)). Each voter is initially given an equal fraction of the budget, i.e., each voter is given $^ 1 / n$ dollars. We start with an empty outcome $W = \emptyset$ and sequentially add candidates to $W$ . To add a candidate $c$ to $W$ , we need the voters to pay for $c$ . Write $p _ { i } ( c )$ for the amount that voter $i$ pays for $c$ ; we will need that $\begin{array} { r } { \sum _ { i \in N } p _ { i } ( c ) = \cot ( c ) } \end{array}$ . We write $\begin{array} { r } { p _ { i } ( W ) = \sum _ { c \in W } p _ { i } ( c ) \leq \frac { 1 } { n } } \end{array}$ for the total amount $i$ has paid so far. For $\rho \geq 0$ , we say that a candidate $c \notin W$ is $\rho$ 2 -affordable if
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\sum _ { i \in N } \operatorname* { m i n } \left( { \textstyle { \frac { 1 } { n } } } - p _ { i } ( W ) , u _ { i } ( c ) \cdot \rho \right) = \operatorname { c o s t } ( c ) .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
If no candidate is $\rho$ -affordable for any $\rho$ , MES terminates and returns $W$ . Otherwise it selects a candidate $c \notin W$ that is $\rho$ -affordable for a minimum $\rho$ . Individual payments are given by
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { p _ { i } ( c ) = \operatorname* { m i n } \left( \frac { 1 } { n } - p _ { i } ( W ) , u _ { i } ( c ) \cdot \rho \right) } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Intuitively, when the Method of Equal Shares (MES) adds a candidate $c$ , it asks voters to pay an amount proportional to their utility $u _ { i } ( c )$ for $c$ ; in particular, the cost per unit of utility is $\rho$ . If a voter does not have enough money, the rule asks the voter to pay all the money the voter has left, which is $\textstyle { \frac { 1 } { n } } - p _ { i } ( W )$ . Throughout the execution of MES, the value of $\rho$ increases. Thus, candidates are added in decreasing order of utility per dollar that the voters get from the candidates. In comparison to the work of Peters and Skowron [2020], the new elements in our definition of the rule are (1) the formula according to which the costs of selected projects are divided among the voters, and (2) the algorithm specifying in which order the candidates are selected; these are critical to ensure that the rule is proportional.
|
| 67 |
+
|
| 68 |
+
# 3.1 Extended Justified Representation (EJR)
|
| 69 |
+
|
| 70 |
+
The first notion of proportionality that we examine is Extended Justified Representation (EJR). This axiom was first proposed for approval-based committee elections [Aziz et al., 2017]. Even for the special case of approval-based committee elections, only few rules are known to satisfy EJR [Aziz et al., 2017, 2018a, Peters and Skowron, 2020], but the Method of Equal Shares is one of them. In this section, we introduce a generalization of EJR to the PB model and show that our rule continues to satisfy EJR.
|
| 71 |
+
|
| 72 |
+
We first recall the definition of EJR for approval-based committee elections. Intuitively, this axiom ensures that every large enough group of voters whose approval sets have a large enough intersection must obtain a fair number of representatives. For example, if a group of voters forms an $\alpha$ -fraction of the whole population and if this group agrees on sufficiently many candidates, then it should be allowed to decide about an $\alpha$ -fraction of the elected candidates. Formally, this is achieved by excluding the possibility that each member of the group approves less than $\lfloor \alpha k \rfloor$ elected candidates.
|
| 73 |
+
|
| 74 |
+
Definition 2 (Extended Justified Representation for approval-based committee elections). We say that a group of voters $S$ is $\ell$ -cohesive for $\ell \in \mathbb { N }$ if $| S | \ge \ell / \kappa \cdot n$ and $\begin{array} { r } { | \bigcap _ { i \in S } A ( i ) | \geq \ell } \end{array}$ . A rule $\mathcal { R }$ satisfies extended justified representation if for each election instance $E$ and each $\ell$ -cohesive group $S$ of voters there exists a voter $i \in S$ such that $| A ( i ) \cap \mathcal { R } ( E ) | \geq \ell$ .
|
| 75 |
+
|
| 76 |
+
At first sight it is unintuitive that we only require that at least one voter obtain $\ell$ representatives. However, the strengthening of EJR that requires each member of $S$ to obtain $\ell$ representatives is impossible even on very small instances [Aziz et al., 2017]. Still, even with only the at-least-one guarantee, EJR has plenty of bite [Aziz et al., 2018a, Skowron, 2018, Peters and Skowron, 2020].
|
| 77 |
+
|
| 78 |
+
The generalization of this axiom to the PB model is not straightforward and to the best of our knowledge none has been proposed in the literature.2 To warm up, let’s first relax the unit cost assumption, but stay in the approval-based setting. Then EJR should state the following.
|
| 79 |
+
|
| 80 |
+
Definition 3 (Extended Justified Representation for approval-based elections). We say that a group of voters $S$ is $T$ -cohesive for $T \subseteq C$ if $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ and $\textstyle T \subseteq \bigcap _ { i \in S } A ( i )$ . A rule $\mathcal { R }$ satisfies extended justified representation if for each election instance $E$ and each $T$ -cohesive group $S$ of voters there exists a voter $i \in S$ such that $| A ( i ) \cap \mathcal { R } ( E ) | \geq | T |$ .
|
| 81 |
+
|
| 82 |
+
Thus, cohesiveness now requires that the group $S$ can identify a collection of projects $T$ that they all approve and that is affordable with their fraction of the budget $\mathbf { \bar { \rho } } | S | \geq \mathrm { c o s t } ( T ) \cdot \bar { n } )$ . Note that voters $i \in S$ obtain utility $u _ { i } ( T ) = | T |$ from $T$ ; EJR requires that at least one member of $S$ must attain this utility in the election outcome.
|
| 83 |
+
|
| 84 |
+
To further generalize EJR beyond approvals is more difficult, because the notion of a candidate who is approved by all members of $S$ does not have an analogue. Instead, we quantify cohesion by calculating the minimum utility that any member of $S$ assigns to each project in $T$ .
|
| 85 |
+
|
| 86 |
+
Definition 4 (Extended Justified Representation). A group of voters $S$ is $( \alpha , T )$ -cohesive, where $\alpha \colon C \to [ 0 ; 1 ]$ and $T \subseteq C$ , if $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ and if $u _ { i } ( c ) \geq \alpha ( c )$ for all $i \in S$ and $c \in T$ . A rule $\mathcal { R }$ satisfies extended justified representation if for each election instance $E$ and each $( \alpha , T )$ -cohesive group of voters $S$ there exists a voter $i \in S$ such that $\begin{array} { r } { u _ { i } ( { \mathcal { R } } ( E ) ) \geq \sum _ { c \in T } \alpha ( c ) } \end{array}$ .
|
| 87 |
+
|
| 88 |
+
Again, an $( \alpha , T )$ -cohesive group of voters $S$ can propose the projects in $T$ , since they are affordable with $S$ ’s share of the budget. The values $( \alpha ( c ) ) _ { c \in T }$ denote how much the coalition $S$ agrees about the desirability of the projects in $T$ . In particular, we have $\begin{array} { r } { u _ { i } ( T ) \geq \sum _ { c \in T } \alpha ( c ) } \end{array}$ for each $i \in S$ Consequently, Definition 4 prohibits any outcome in which every voter in $S$ 2 gets utility strictly lower than $\textstyle \sum _ { c \in T } { \dot { \alpha } } ( c )$ ; hence there must exists $i \in S$ such that $\begin{array} { r } { u _ { i } ( \mathcal { R } \bar { ( } E ) ) \geq \sum _ { c \in T } \alpha ( c ) } \end{array}$ .
|
| 89 |
+
|
| 90 |
+
EJR is a demanding property in the PB model. Consider the special case where there is only one voter, $N = \{ 1 \}$ . Then any outcome $W$ satisfying EJR must solve the knapsack problem, i.e. it must maximize $\textstyle \sum _ { c \in W } u _ { 1 } ( c )$ , since otherwise an optimum knapsack $T$ witnesses an EJR violation. Because the knapsack problem is weakly NP-hard, this presents a difficulty for a rule to satisfy EJR.3
|
| 91 |
+
|
| 92 |
+
Proposition 1. Unless $P = N P$ no aggregation rule that can be computed in strongly polynomial time can satisfy EJR in the general PB model.
|
| 93 |
+
|
| 94 |
+
Indeed, the Method of Equal Shares fails EJR in the general PB model. However, we can show that it satisfies a mild relaxation, which requires EJR to hold “up to one project”.
|
| 95 |
+
|
| 96 |
+
Definition 5 (Extended Justified Representation Up To One Project). A rule $\mathcal { R }$ satisfies extended justified representation up to one project if for each election instance $E$ and each $( \alpha , T )$ -cohesive group of voters $S$ there exists a voter $i \in S$ such that either $\begin{array} { r } { u _ { i } ( \mathcal { R } ( E ) ) \geq \sum _ { c \in T } \alpha ( c ) } \end{array}$ or for some $a \in C$ it holds that $\begin{array} { r } { u _ { i } ( \mathcal { R } ( E ) \cup \{ a \} ) > \sum _ { c \in T } \alpha ( c ) } \end{array}$ .
|
| 97 |
+
|
| 98 |
+
It is worth noting that in the approval-based model, Definitions 4 and 5 are actually equivalent, because the “up to one project” option never applies: Consider an $( \alpha , T )$ -cohesive group of voters $S$ . Since voters’ utilities are $_ { 0 / 1 }$ , we may assume that for each $c \in T$ we have $\alpha ( c ) = 1$ : if $\alpha ( c ) > 0$ this is clear; otherwise we can remove $c$ from $T$ without losing cohesiveness. Thus, the cohesiveness condition is equivalent to the condition that every voter approves every candidate in $T$ . Finally, note that in the approval model, due to the strict inequality, both conditions $\begin{array} { r } { u _ { i } ( \mathcal { R } ( E ) ) \geq \sum _ { c \in T } \alpha ( \dot { c } ) } \end{array}$ and $\begin{array} { r } { \exists _ { a \in C \cdot } u _ { i } ( \mathcal { R } ( E ) \cup \{ a \} ) > \sum _ { c \in T } \alpha ( c ) } \end{array}$ boil down to $\begin{array} { r } { | A ( i ) \cap \mathcal { R } ( E ) | \ge \sum _ { c \in T } \alpha ( c ) = | \bar { T } | } \end{array}$ .
|
| 99 |
+
|
| 100 |
+
Our main result is that the Method of Equal Shares satisfies EJR up to one project in the general PB model. By the previous observation, it hence satisfies EJR in the approval-based model (even when not imposing unit costs).
|
| 101 |
+
|
| 102 |
+
Theorem 1. The Method of Equal Shares satisfies EJR up to one project in the participatory budgeting model.
|
| 103 |
+
|
| 104 |
+
Proof. For a contradiction, assume there is an election $E$ , a set $S \subseteq N$ and a set $T \subseteq C$ such that: (i) $\mathrm { c o s t } ( T ) \leq { \mathsf { \Pi } } ^ { | S | } / n$ , (ii) $u _ { i } ( c ) \geq \alpha ( c ) > 0$ (candidates with $\alpha ( c ) = 0$ can be skipped) for each $i \in S$ and $c \in T$ , and (iii) $\begin{array} { r } { u _ { i } ( \mathcal { R } ( E ) \cup \{ a \} ) \leq \sum _ { c \in T } \alpha ( c ) } \end{array}$ for each $i \in S$ and $a \in T$ .
|
| 105 |
+
|
| 106 |
+
Assume for a while that the voters from $S$ have unrestricted initial budgets, and let us analyze how MES would proceed in this case. For simplicity, let us rename the candidates in $T$ so that $T = \{ c _ { 1 } , \ldots , c _ { t } \}$ and so that for $1 \leq i < j \leq t$ candidate $c _ { i }$ is picked by MES before candidate $c _ { j }$ .
|
| 107 |
+
|
| 108 |
+
Whenever a candidate $c \in T$ is selected, the voters pay for this candidate. Voter $i$ pays $p _ { i } ( c )$ dollars for $c$ , and in return, she gets utility $u _ { i } ( c )$ . Thus, the price-per-utility she pays equals $\rho _ { i } ( c ) = p _ { i } ( c ) \big / u _ { i } ( c ) ,$ . MES works in a way that all voters from $S$ who pay for $c$ obtain the same price-per-utility ratio, i.e., for all $i , j \in S$ and $c \in C$ we have that $\rho _ { i } ( c ) = \rho _ { j } ( c )$ . Further, this price-per-utility equals at most $\mathrm { c o s t } ( c ) \big / { u _ { S } ( c ) }$ , independently of whether any voters from $N \backslash S$ pay for $c$ or not (if no voters from $N \backslash S$ pays for $c$ , then the price-per-utility equals exactly $\mathrm { c o s t } ( c ) \big / u _ { S } ( c ) \big )$ :
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\nu _ { i } ( c ) = { \frac { p _ { i } ( c ) } { u _ { i } ( c ) } } = { \frac { p _ { i } ( c ) \cdot { \frac { \sum _ { j \in S } u _ { j } ( c ) } { \sum _ { j \in S } u _ { j } ( c ) } } } { u _ { i } ( c ) } } = { \frac { 1 } { \sum _ { j \in S } u _ { j } ( c ) } } \cdot \sum _ { j \in S } { \frac { p _ { i } ( c ) } { u _ { i } ( c ) } } \cdot u _ { j } ( c ) = { \frac { \sum _ { j \in S } p _ { j } ( c ) } { \sum _ { j \in S } u _ { j } ( c ) } } \leq { \frac { \cos \operatorname { t } ( c ) } { u _ { S } ( c ) } } .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Since $u _ { i } ( c ) \geq \alpha ( c )$ for each $i \in S$ and $c \in T$ , the price-per-utility for $c \in T$ equals at most $\mathrm { c o s t } ( c ) \big / | S | \alpha ( c )$ . Now, consider the voter who in the first possible iteration uses more than $^ 1 / n$ dollars4. For this voter, call her $i$ , let us consider the function $f$ defined as follows. For each value $x$ , the function $f$ returns the price that $i$ needs to pay to achieve the utility $x$ . We make this function continuous, by assuming that the candidates are divisible. That is, if the voter pays $p$ for her first paid candidate $c$ with utility $u _ { i } ( c )$ , then $f ( u _ { i } ( c ) / 2 ) = p / 2$ , $f ( u _ { i } ( c ) / 3 ) = P / 3$ , and so on. The key observation is that the function $f$ is convex. This is because MES selects the candidates in increasing order of price-per-utility. This function is depicted below.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
|
| 118 |
+
We are interested in the value $f ( \sum _ { c \in T } \alpha ( c ) )$ . This value would be maximized if the fragments of the function with the lowest slope were the shortest. However, we know that the part of the function that corresponds $\rho _ { i } ( c )$ must be of length at least equal to $u _ { i } ( c ) \geq \alpha ( c )$ . Thus:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
f \left( \sum _ { c \in T } \alpha ( c ) \right) \leq \sum _ { c \in T } \alpha ( c ) \cdot \rho _ { i } ( c ) \leq \sum _ { c \in T } \alpha ( c ) \cdot { \frac { \mathrm { c o s t } ( c ) } { | S | \alpha ( c ) } } = \sum _ { c \in T } { \frac { \mathrm { c o s t } ( c ) } { | S | } } = { \frac { \mathrm { c o s t } ( T ) } { | S | } } \leq { \frac { 1 } { n } } .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Now, consider the first moment when $i$ uses more than $^ 1 / n$ dollars. Until this time moment, MES behaves exactly in the same way as if the voters from $S$ had their initial budgets set to $^ 1 / n$ (this follows from how we chose $i$ ). Further, we know that in this moment, if we chose a candidate that would be chosen if the voters had unrestricted budgets, then the utility of voter $i$ would be greater than $\textstyle \sum _ { c \in T } \alpha ( c )$ . This gives a contradiction, and completes the proof. □
|
| 125 |
+
|
| 126 |
+
Theorem 1 establishes the Method of Equal Shares as a prime candidate for voting under a budget constraint, showing that it satisfies a demanding fairness property. This makes it the first known rule that can give such strong proportionality guarantees in the model with additive utilities and arbitrary costs. In the literature on the special case of approval-based committee elections, another rule has received much attention: Proportional Approval Voting (PAV). Let us briefly recall the definition of this rule.
|
| 127 |
+
|
| 128 |
+
Definition 6 (Proportional Approval Voting (PAV)). For an approval-based election, PAV selects a feasible outcome maximizing $\textstyle \sum _ { i \in N } \operatorname { H } ( | \bar { A ( i ) } \cap W | )$ , where $\begin{array} { r } { \dot { \mathrm { H } } ( r ) = \sum _ { j = 1 } ^ { r } \ d ^ { 1 } / j } \end{array}$ is the rth harmonic number.
|
| 129 |
+
|
| 130 |
+
This rule satisfies EJR when assuming unit costs [Aziz et al., 2017]. But without unit costs, PAV fails EJR. In fact, Example 1 shows that, for each $r \geq 0$ , PAV does not even satisfy EJR up to $r$ projects.
|
| 131 |
+
|
| 132 |
+
Example 1. Fix a constant $r \in \mathbb { N } \left( r \geq 2 \right)$ , and consider the following approval-based profile:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { l l } { { r ^ { 2 } - 1 \mathrm { ~ v o t e r s : ~ } } } & { { \qquad \{ a _ { 1 } , a _ { 2 } , \ldots , a _ { r } \} , } } \\ { { \mathrm { ~ 1 ~ v o t e r : ~ } } } & { { \qquad \{ b _ { 1 } , b _ { 2 } , \ldots , b _ { r } \} . } } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
The candidates $a _ { 1 } , a _ { 2 } , \ldots , a _ { r }$ cost $^ { 1 / r }$ dollars each; the candidates $b _ { 1 } , b _ { 2 } , \dots , b _ { r } \thinspace \mathrm { c o s t } \thinspace 1 / r ^ { 3 }$ dollars each. EJR requires that the one voter who approves candidates $b _ { 1 } , \ldots , b _ { r }$ must approve at least $r$ candidates in the outcome. However, PAV selects $\{ a _ { 1 } , a _ { 2 } , \ldots , a _ { r } \}$ , leaving the voter with nothing. □
|
| 139 |
+
|
| 140 |
+
In fact, in Appendix A, we prove that no rule that globally maximizes an objective function over voter utilities (like PAV) can satisfy proportionality. Further, in Appendix C we argue that another rule for proportional approval-based committee elections, Phragmén’s rule, does not extend to the PB setting.
|
| 141 |
+
|
| 142 |
+
# 3.2 Approximating the Core
|
| 143 |
+
|
| 144 |
+
An important proportionality property that has been proposed for PB is the core [Aziz et al., 2017, Fain et al., 2018], an idea adapted from cooperative game theory.
|
| 145 |
+
|
| 146 |
+
Definition 7 (The Core). For an election $( N , C , \mathrm { c o s t } , \{ u _ { i } \} _ { i \in N } )$ , an outcome $W$ is in the core if for every $S \subseteq N$ and $T \subseteq C$ with $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ there exists $i \in S$ such that $u _ { i } ( W ) \geq u _ { i } ( T )$ .
|
| 147 |
+
|
| 148 |
+
The core is a stronger guarantee than EJR. The core allows any group $S$ to present an arbitrary “counter-proposal” $T$ that they can afford, and guarantees that at least one member $i \in S$ would prefer to stick with the core outcome $W$ , so $u _ { i } ( W ) \geq u _ { i } ( T )$ . EJR only guarantees that $u _ { i } ( W ) \geq$ $\sum _ { \substack { . c \in T } } \operatorname* { m i n } _ { j \in S } u _ { j } ( c )$ . Thus, EJR only respects counter-proposals $T$ if they have broad agreement 2within the coalition $S$ . This is arguably a reasonable restriction, since such coalitions can more easily coordinate to “complain” against the selected $W$ . Still, it would be nice to give the stronger core guarantee. Unfortunately, there are elections where no outcome is in the core, even with unit costs.
|
| 149 |
+
|
| 150 |
+
Example 2.5 We have 6 voters and 6 candidates with unit costs, and $k = 3$ . Utilities satisfy
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { r l r l r l } & { u _ { 1 } ( c _ { 1 } ) > u _ { 1 } ( c _ { 2 } ) > 0 , } & & { u _ { 2 } ( c _ { 2 } ) > u _ { 2 } ( c _ { 3 } ) > 0 , } & & { u _ { 3 } ( c _ { 3 } ) > u _ { 3 } ( c _ { 1 } ) > 0 ; } \\ & { u _ { 4 } ( c _ { 4 } ) > u _ { 4 } ( c _ { 5 } ) > 0 , } & & { u _ { 5 } ( c _ { 5 } ) > u _ { 5 } ( c _ { 6 } ) > 0 , } & & { u _ { 6 } ( c _ { 6 } ) > u _ { 6 } ( c _ { 4 } ) > 0 , } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
and all other utilities are equal to 0. Let $W \subseteq C$ be any feasible outcome, so $| W | \le 3$ . Then either $| W \cap \{ c _ { 1 } , c _ { 2 } , c _ { 3 } \} | \leq 1$ or $| W \cap \{ c _ { 4 } , c _ { 5 } , c _ { 6 } \} | \leq 1$ . Without loss of generality assume the former, and assume that $c _ { 2 } \notin W$ and $c _ { 3 } \notin W$ . Then $\overrightarrow { S } = \{ v _ { 2 } , v _ { 3 } \}$ and $T = { \bar { \{ c _ { 3 } \} } }$ block $W$ , since $2 = | S | \geq$ $\begin{array} { r } { \mathrm { c o s t } ( T ) * n = \frac { 1 } { 3 } \cdot 6 = 2 } \end{array}$ and both $u _ { 2 } ( c _ { 3 } ) > u _ { 2 } ( c _ { 1 } ) \ge u _ { 2 } ( W )$ and $\dot { u } _ { 3 } ( \dot { c } _ { 3 } ) > u _ { 3 } ( c _ { 1 } ) \ge u _ { 3 } ( W )$ .
|
| 157 |
+
|
| 158 |
+
Notably, this example is not approval-based. It is unknown whether the core is always non-empty for approval-based elections (with or without the unit cost assumption).
|
| 159 |
+
|
| 160 |
+
In the committee context, Peters and Skowron [2020] showed that the Method of Equal Shares (MES) returns an outcome that never violates the core too badly. We can generalize this result to the general PB setting: MES provides a multiplicative approximation to the core.6
|
| 161 |
+
|
| 162 |
+
Definition 8. For $\alpha \geq 1$ , we say that an outcome is in the $\alpha$ -core if for every $S \subseteq N$ and $T \subseteq C$ with $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ there exists $i \in S$ and $c \in T$ such that $\begin{array} { r } { u _ { i } ( \mathcal { R } ( E ) \cup \{ c \} ) \geq \frac { u _ { i } ( T ) } { \alpha } } \end{array}$
|
| 163 |
+
|
| 164 |
+
Theorem 2. Given an election $E$ , let $u _ { \mathrm { m a x } }$ be the highest utility a voter can get from a feasible outcome. Let $u _ { \mathrm { m i n } }$ we denote the smallest, yet positive utility a voter can get from a feasible outcome:
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
u _ { \operatorname* { m a x } } = \operatorname* { m a x } _ { i \in N } \operatorname* { m a x } _ { \operatorname { c o s t } ( W ) \leq 1 } u _ { i } ( W ) \qquad a n d \qquad u _ { \operatorname* { m i n } } = \operatorname* { m i n } _ { i \in N } \operatorname* { m i n } _ { u _ { i } ( W ) > 0 } u _ { i } ( W ) .
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
Then the outcome selected by MES is always in the $\alpha$ -core for $\alpha = 4 \log ( 2 \cdot u _ { \mathrm { m a x } } / u _ { \mathrm { m i n } } )$
|
| 171 |
+
|
| 172 |
+
The bound of $\alpha$ is asymptotically tight. All proofs omitted from the main text appear in Appendix D.
|
| 173 |
+
|
| 174 |
+
# 3.3 Other properties of the Method of Equal Shares
|
| 175 |
+
|
| 176 |
+
In Appendices B and C we discuss two other properties: priceability [Peters and Skowron, 2020, Peters et al., 2021] and exhaustiveness. Here, let us only discuss the latter one. Exhaustiveness requires that a voting rule spends its entire budget. Of course, due to the discrete model, we cannot guarantee that the rule will spend exactly 1 dollar (i.e., the entire budget); however, we can require that no additional project is fits within the budget.
|
| 177 |
+
|
| 178 |
+
Definition 9 (Exhaustiveness, Aziz et al., 2018b). An election rule $\mathcal { R }$ is exhaustive if for each election instance $E$ and each non-selected candidate $c \notin \mathcal { R } ( E )$ it holds that $\operatorname { c o s t } ( \mathcal { R } ( E ) \cup \{ c \} ) > 1$ .
|
| 179 |
+
|
| 180 |
+
Notably, the Method of Equal Shares fails to be exhaustive: even if there is enough budget remaining to fund more projects, the rule may reach a state when no project is $\rho$ -affordable. In Appendix C we discuss a few possible ways to make the rule exhaustive. We experimentally compare these modifications in Appendix H.
|
| 181 |
+
|
| 182 |
+
# 4 Greedy Cohesive Rule
|
| 183 |
+
|
| 184 |
+
In Section 3 we discussed the EJR axiom for the PB model, and saw that it is implemented by Method of Equal Shares. We will now propose a strengthening of EJR, and show a rule that satisfies the new strong property. Interestingly, even in the approval-based committee-election model our new property is substantially stronger than EJR, and hence this new rule provides the strongest known proportionality guarantees. On the other hand, compared to MES, it is computationally expensive and arguably less natural.
|
| 185 |
+
|
| 186 |
+
# 4.1 Full Justified Representation (FJR)
|
| 187 |
+
|
| 188 |
+
Our new proportionality axiom strengthens EJR by weakening its requirement that groups must be cohesive. Thus, the new axiom guarantees representation to groups that are only partially cohesive.
|
| 189 |
+
|
| 190 |
+
Definition 10 (Full Justified Representation (FJR)). We say that a group of voters $S$ is weakly $( \beta , T )$ -cohesive for $\beta \in \mathbb { R }$ and $T \subseteq C$ , if $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ and $u _ { i } ( T ) \geq \beta$ for every voter $i \in S$ . A rule $\mathcal { R }$ satisfies full justified representation $( F J R )$ if for each election instance $E$ and each weakly $( \beta , T )$ -cohesive group of voters $S$ there exists a voter $i \in S$ such that $u _ { i } ( \mathcal { R } ( E ) ) \geq \beta$ .
|
| 191 |
+
|
| 192 |
+
In the approval-based committee-election model, FJR boils down to the following requirement: Let $S$ be a group of voters, and suppose that each member of $S$ approves at least $\beta$ candidates from some set $T \subseteq C$ with $| T | \leq \ell$ , and let $| S | \geq \ell / k \cdot n$ . Then at least one voter from $S$ must have at least $\beta$ representatives in the committee. It is clear that in the special case of $\beta = \ell$ , we obtain Definition 2, hence FJR implies EJR. The same implication holds in the general PB model.
|
| 193 |
+
|
| 194 |
+
Proposition 2. FJR implies EJR in the general PB model.
|
| 195 |
+
|
| 196 |
+
It is easy to see that FJR is implied by the core property (cf. Definition 7). It is related to, but stronger than, some other relaxations of the core discussed by Peters and Skowron [2020, Section 5.2].
|
| 197 |
+
|
| 198 |
+
Previously known aggregation rules faill FJR (see Appendix E). Still, it turns out that FJR can always be satisfied: we present a (somewhat artificial) rule satisfying this strong notion of proportionality.
|
| 199 |
+
|
| 200 |
+
Definition 11 (Greedy Cohesive Rule (GCR)). The Greedy Cohesive Rule (GCR) is defined sequentially as follows: we start with an empty outcome $W = \emptyset$ . At each step, we search for a weakly $( \beta , T )$ -cohesive group $S$ . If such a group exists, we find one where $\beta \geq 1$ is maximum,7 add all the candidates from $T$ to $W$ , remove all voters in $S$ from the election and repeat the search. If no such group exists, we stop and return $W$ .
|
| 201 |
+
|
| 202 |
+
Let us first check that the Greedy Cohesive Rule always selects an outcome that does not exceed the budget limit. Indeed, whenever the algorithm adds some set $T$ to $W$ , then by definition of weakly cohesive groups, we have $| S | \geq \mathrm { c o s t } ( T ) \cdot n$ , and hence it removes at least $\mathrm { c o s t } ( T ) \cdot n$ voters after this step. Thus, if GCR selects an outcome with total cost $\operatorname { c o s t } ( W )$ , then it must have removed at least $\cos ( W ) \cdot n$ voters during its execution. Hence $\mathrm { c o s t } ( W ) \leq 1$ .
|
| 203 |
+
|
| 204 |
+
Theorem 3. The Greedy Cohesive Rule satisfies FJR.
|
| 205 |
+
|
| 206 |
+
In Appendix $\mathrm { F }$ we further analyze GCR and discuss ways to extend its outcome when it is not exhaustive. We also present an example where GCR selects a counter-intuitive outcome.
|
| 207 |
+
|
| 208 |
+
# 5 Experiments
|
| 209 |
+
|
| 210 |
+
In this section we evaluate different voting rules on data from real-world participatory budgeting elections carried out in several major cities in Poland. The data we use is taken from Pabulib and was collected by [Stolicki et al., 2020].8 The data is anonymized except for some basic demographic information which we do not use in our experiments.
|
| 211 |
+
|
| 212 |
+
We looked at election instances in which the projects were divided into several groups. One group consists of city-wide projects, and each other group consists of projects that were assigned to a city district. Each voter was allowed to approve at most ten city-wide projects, and at most ten projects from her district. A part of the municipal budget was assigned to city-wide projects and the other part was divided among the districts in proportion to their populations. Currently, the cities that we consider use a rule that selects projects greedily in order of approval score until the budget is exhausted.
|
| 213 |
+
|
| 214 |
+
In our experimental analysis we used two types of voters’ preferences:
|
| 215 |
+
|
| 216 |
+
Approval utilities: corresponding directly to the approval-ballots from our PB data.
|
| 217 |
+
|
| 218 |
+
Cardinal utilities: for each voter $i$ and each project $c _ { j }$ we obtained the utility $u _ { i } ( c _ { j } )$ as follows. If $i$ does not approve $c _ { j }$ , we set $u _ { i } ( c _ { j } ) = 0$ . If $i$ approves $c _ { j }$ , we sample $u _ { i } ( c _ { j } )$ from the normal distribution centred at $\mathrm { c o s t } ( c _ { j } )$ . (We also tested similar models where $u _ { i } ( c _ { j } )$ was sampled from the uniform and exponential distributions, but those led to qualitatively similar conclusions.)
|
| 219 |
+
|
| 220 |
+
We are interested in comparing the Method of Equal Shares, the greedy approval rule currently used for selecting projects, Phragmén’s rule, and the sequential version of PAV (sPAV). (We have limited the experiments to polynomial-time algorithms, since the instances are quite large.) Since Phragmén’s rule does not extend to additive utilities, we only use this rule for approval utilities.
|
| 221 |
+
|
| 222 |
+
In our analysis we evaluated the following metrics:
|
| 223 |
+
|
| 224 |
+
Total utility (UTIL). The total utility of the voters from the selected set $\begin{array} { r } { W \colon \sum _ { i \in N } \sum _ { c \in W } u _ { i } ( c ) } \end{array}$ .
|
| 225 |
+
|
| 226 |
+
Distribution of projects (PROJ-DIS). For each election instance we look at the projects selected from each district. We compute their cost and divide it by the fraction of the budget that is proportional to the population of the district. From those ratios we take a variance.
|
| 227 |
+
|
| 228 |
+
Distribution of utilities (UTIL-DIS). For each election instance and each voter $i$ we compute her normalised utility from the set of selected projects $W$ , which we define as $\begin{array} { r } { \sum _ { i \in N } \sum _ { c \in W } u _ { i } ( c ) } \end{array}$ divided by $\textstyle n \cdot \sum _ { c \in W } u _ { i } ( c )$ . We compute the variance of these values.
|
| 229 |
+
|
| 230 |
+
In Appendix H.1 we discuss in detail the obtained results and provide tables summarizing the measured metrics. Below we only briefly discuss the conclusions from the experimental evaluation.
|
| 231 |
+
|
| 232 |
+
First we checked whether the outcome that was in fact selected by the cities is fair according to the kind of fairness criteria we have been studying. We found that in at least 59 out of 366 elections $( 1 6 \% )$ , EJR was failed. In most cases, the failure was of the form that there was a group of voters who approved 0 of the selected projects but who approved an unelected project in common, and the group was large enough to afford that project. This is even a failure of the PB version of the axiom JR (Justified Representation).
|
| 233 |
+
|
| 234 |
+
Second, we compared three different strategies of making MES exhaustive. We observed substantial differences between different variants of MES. We conclude that MES gives a lot of flexibility to a mechanism designer, as it often selects outcomes that do not spend all of the budget, while still satisfying strong fairness requirements like EJR. Depending on the specific objectives, a mechanism designer can choose to complete this outcome using different strategies. Among the strategies we described in Appendix C, we observed that the outcomes produced by EXH2 are better from a utilitarian perspective. It also divides the budget between different city districts in a substantially fairer way than outcomes produced by EXH1. Therefore we suggest EXH2 as the preferred method.
|
| 235 |
+
|
| 236 |
+
In our third experiment we compared MES, Phragmén’s rule, and PAV. We observed that for approval utilities the results returned by MES and Phragmén’s rule are comparably good, both in terms of the total utility obtained by the voters and in terms of proportionality measured as a distribution of projects and voters’ utilities. On the other hand, if we take a model with more fine-grained utilities, the difference between the two rules becomes apparent. This difference is unsurprising since Phragmén’s rule does not take into account the more fine-grained information on utilities, but operates only on approval ballots. Yet, our results suggest that there is indeed a considerable advantage of using rules (like MES) that take into account the full information contained in cardinal additive utilities. We conclude that MES performs as well as Phragmén’s rule for approval ballots and outperforms it when more fine-grained information on voters’ utilities are available. Somewhat surprisingly, we show that the sequential variant of PAV produces highly disproportional outcomes compared to Phragmén’s rule and MES. Altogether, our experiments confirm our theoretical results and suggest that the Method of Equal Shares outperforms the other two rules in terms of proportionality and/or efficiency.
|
| 237 |
+
|
| 238 |
+
# 6 Conclusion
|
| 239 |
+
|
| 240 |
+
In this paper, we have formulated two axioms, EJR and FJR, that capture the idea of proportionality in the participatory budgeting (PB) model. We have argued that none of the prominent committee election rules extend to the PB model so that it would satisfy even much weaker forms of proportionality. We have designed a simple and natural rule for the PB model, the Method of Equal Shares (MES). It satisfies EJR and other proportionality-related properties, and it is computable in polynomial time. The stronger of our two properties, FJR, is also satisfiable, albeit by a different and arguably less natural voting rule. It is an interesting open question whether there exists a natural voting rule that satisfies FJR and shares other desirable properties of MES.
|
| 241 |
+
|
| 242 |
+
There are numerous results which are not included in the main text. Specifically, in Appendices B and C we discuss other properties of MES, and in Appendix F we provide a more detailed analysis of GCR. In Appendix G we explain that our rules can be directly applied to a model where voters have ordinal preferences, that is, when they rank the candidates from the most to the least preferred one. Notably, in the ordinal model MES satisfies the axiom of proportionality for solid coalitions, which is perhaps the strongest known axiom of proportionality for ordinal preferences.
|
| 243 |
+
|
| 244 |
+
Many cities run PB by dividing the overall budget between districts and running separate elections in each district. In particular, this is true in the Polish cities that provide our experimental election data. We claimed in the introduction that this practice of separate elections leads to inferior outcomes. We designed a final experiment to study this question. Our results show a visible advantage of using global rules such as MES over separate district elections. For example, MES always produces outcomes with a more equal distribution of voter utility, and in most cases also provides a higher total utility in comparison to the rules that are in actual use in the elections we examined.
|
| 245 |
+
|
| 246 |
+
# Acknowledgments
|
| 247 |
+
|
| 248 |
+
Grzegorz Pierczynski and Piotr Skowron were supported by Poland’s National Science Center grant ´ UMO-2019/35/B/ST6/02215.
|
| 249 |
+
|
| 250 |
+
References
|
| 251 |
+
H. Aziz and B. Lee. The expanding approvals rule: improving proportional representation and monotonicity. Social Choice and Welfare, 54(1):1–45, 2020.
|
| 252 |
+
H. Aziz and N. Shah. Participatory budgeting: Models and approaches. In Tamás Rudas and Gábor Péli, editors, Pathways Between Social Science and Computational Social Science: Theories, Methods, and Interpretations. Springer, 2020.
|
| 253 |
+
H. Aziz, M. Brill, V. Conitzer, E. Elkind, R. Freeman, and T. Walsh. Justified representation in approval-based committee voting. Social Choice and Welfare, 48(2):461–485, 2017.
|
| 254 |
+
H. Aziz, E. Elkind, S. Huang, M. Lackner, L. Sánchez-Fernández, and P. Skowron. On the complexity of extended and proportional justified representation. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence (AAAI-2018), pages 902–909, 2018a.
|
| 255 |
+
H. Aziz, B. Lee, and N. Talmon. Proportionally representative participatory budgeting: Axioms and algorithms. In Proceedings of the 16th International Conference on Autonomous Agents and Multiagent Systems (AAMAS-2017), pages 23–31, 2018b.
|
| 256 |
+
G. Benade, S. Nath, A. D. Procaccia, and N. Shah. Preference elicitation for participatory budgeting. In Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI-2017), pages 376–382, 2017.
|
| 257 |
+
J. Byrka, P. Skowron, and K. Sornat. Proportional approval voting, harmonic $k$ -median, and negative association. In In proceedings of 45th International Colloquium on Automata, Languages, and Programming (ICALP-2018), pages 26:1–26:14, 2018.
|
| 258 |
+
Y. Cabannes. Participatory budgeting: a significant contribution to participatory democracy. Environment and Urbanization, 16(1):27–46, 2004.
|
| 259 |
+
Alfonso Cevallos and Alistair Stewart. A verifiably secure and proportional committee election rule. arXiv preprint arXiv:2004.12990, 2020.
|
| 260 |
+
Y. Cheng, Z. Jiang, K. Munagala, and K. Wang. Group fairness in committee selection. In Proceedings of the 2019 ACM Conference on Economics and Computation, pages 263–279, 2019.
|
| 261 |
+
B. Fain, K. Munagala, and N. Shah. Fair allocation of indivisible public goods. In Proceedings of the 2018 ACM Conference on Economics and Computation, pages 575–592, 2018. Extended version arXiv:1805.03164.
|
| 262 |
+
P. Faliszewski, J. Sawicki, R. Schaefer, and M. Smolka. Multiwinner voting in genetic algorithms for solving illposed global optimization problems. In Proceedings of the 19th International Conference on the Applications of Evolutionary Computation, pages 409–424, 2016.
|
| 263 |
+
P. Faliszewski, P. Skowron, A. Slinko, and N. Talmon. Multiwinner voting: A new challenge for social choice theory. In U. Endriss, editor, Trends in Computational Social Choice, pages 27–47. AI Access, 2017.
|
| 264 |
+
P. Faliszewski, P. Skowron, S. Szufa, and N. Talmon. Proportional representation in elections: STV vs PAV. In Proceedings of the 18th International Conference on Autonomous Agents and Multiagent Systems (AAMAS-2019), pages 1946–1948, 2019.
|
| 265 |
+
Z. Jiang, K. Munagala, and K. Wang. Approximately stable committee selection. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 463–472, 2020.
|
| 266 |
+
M. Lackner and P. Skowron. Consistent approval-based multi-winner rules. In Proceedings of the 19th ACM Conference on Economics and Computation (EC-2018), pages 47–48, 2018.
|
| 267 |
+
M. Lackner and P. Skowron. Approval-based committee voting: Axioms, algorithms, and applications. Technical Report arXiv:2007.01795 [cs.GT], arXiv.org, 2020.
|
| 268 |
+
D. Peters and P. Skowron. Proportionality and the limits of welfarism. In Proceedings of the 2020 ACM Conference on Economics and Computation, pages 793–794, 2020. Extended version arXiv:1911.11747.
|
| 269 |
+
D. Peters, G. Pierczynski, N. Shah, and P. Skowron. Market-based explanations of collective decisions. In Proceedings of the 35th AAAI Conference on Artificial Intelligence (AAAI-2021), 2021.
|
| 270 |
+
L. Sánchez-Fernández, E. Elkind, M. Lackner, N. Fernández, J. A. Fisteus, P. Basanta Val, and P. Skowron. Proportional justified representation. In Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI-2017), pages 670–676, 2017.
|
| 271 |
+
P. Skowron. Proportionality degree of multiwinner rules. Technical Report arXiv:1810.08799 [cs.GT], arXiv.org, 2018.
|
| 272 |
+
P. Skowron, P. Faliszewski, and J. Lang. Finding a collective set of items: From proportional multirepresentation to group recommendation. Artificial Intelligence, 241:191–216, 2016.
|
| 273 |
+
P. Skowron, M. Lackner, M. Brill, D. Peters, and E. Elkind. Proportional rankings. In Proceedings of the 24th International Joint Conference on Artificial Intelligence (IJCAI-2017), pages 409–415, 2017.
|
| 274 |
+
Dariusz Stolicki, Stanisław Szufa, and Nimrod Talmon. Pabulib: A participatory budgeting library. arXiv preprint arXiv:2012.06539, 2020.
|
| 275 |
+
N. Talmon and P. Faliszewski. A framework for approval-based budgeting methods. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence (AAAI-2019), pages 2181–2188, 2019.
|
| 276 |
+
T. N. Thiele. Om flerfoldsvalg. In Oversigt over det Kongelige Danske Videnskabernes Selskabs Forhandlinger, pages 415–441. 1895.
|
| 277 |
+
N. Tideman and D. Richardson. Better voting methods through technology: The refinementmanageability trade-off in the Single Transferable Vote. Public Choice, 103(1–2):13–34, 2000.
|
| 278 |
+
D. Woodall. Properties of preferential election rules. Voting Matters, 3:Paper 4, 1994.
|
md/train/B1elCp4KwH/B1elCp4KwH.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING HIERARCHICAL DISCRETE LINGUISTIC UNITS FROM VISUALLY-GROUNDED SPEECH
|
| 2 |
+
|
| 3 |
+
David Harwath∗, Wei-Ning $\mathbf { H s u } ^ { * }$ , and James Glass
|
| 4 |
+
|
| 5 |
+
Computer Science and Artificial Intelligence Lab Massachusetts Institute of Technology Cambridge, MA 02139, USA {dharwath,wnhsu,glass}@csail.mit.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In this paper, we present a method for learning discrete linguistic units by incorporating vector quantization layers into neural models of visually grounded speech. We show that our method is capable of capturing both word-level and sub-word units, depending on how it is configured. What differentiates this paper from prior work on speech unit learning is the choice of training objective. Rather than using a reconstruction-based loss, we use a discriminative, multimodal grounding objective which forces the learned units to be useful for semantic image retrieval. We evaluate the sub-word units on the ZeroSpeech 2019 challenge, achieving a $2 7 . 3 \%$ reduction in ABX error rate over the top-performing submission, while keeping the bitrate approximately the same. We also present experiments demonstrating the noise robustness of these units. Finally, we show that a model with multiple quantizers can simultaneously learn phone-like detectors at a lower layer and word-like detectors at a higher layer. We show that these detectors are highly accurate, discovering 279 words with an F1 score of greater than 0.5.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
By 8 months of age, human infants learn to recognize not only the names of their caregivers and common objects, but also the contrast between the different vowels and consonants which comprise these words (Dupoux, 2018). Nearly all toddlers learn to carry a conversation long before they can read and write. Humans learn to model the discrete, hierarchical, and compositional nature of their native language not from written text, but from speech audio - a continuous, time-varying waveform which is the product not only of the underlying words which were spoken, but also the physical properties of the speaker’s vocal tract, the speaker’s health and emotional state, and the noise and reverberation present in the environment. The question of how such a complex symbolic system is inferred from continuous and noisy sensory input data is of interest not only to the cognitive science community, but also to machine learning researchers who aim to reproduce this ability with computers. A more comprehensive understanding of human language acquisition has practical significance in real-world applications, such as automatic speech recognition (ASR) and natural language understanding (NLU) systems. In the past several decades, enormous progress has been made in speech recognition research, and nowadays ASR systems are able to achieve human-level accuracy in many domains (Chiu et al., 2018). Unfortunately, the techniques that have been developed to achieve these levels of performance are extremely data-hungry, requiring many thousands of hours of speech audio recordings for training. Since supervised machine learning algorithms form the basis of ASR training, the data also needs to be annotated by expert humans. Due to the immense cost of collecting and annotating speech data, ASR technology currently exists for approximately 120 (Google, 2019) out of the nearly 7,000 (Lewis et al., 2016) human languages spoken worldwide. It is highly unlikely that purely supervised machine learning techniques will be able to scale to include all human languages, necessitating the development of alternative methods by researchers which are able to function with far fewer annotations, or even no annotations at all. Because human beings provide an existence proof of language acquisition from speech completely without language supervision, it is plausible that this ability could be replicated by a machine learning algorithm.
|
| 14 |
+
|
| 15 |
+
In this paper, we present a method for discovering discrete and hierarchical representations of speech units both at the sub-word level and the word level. Previously proposed linguistic unit discovery methods have only leveraged the speech audio modality in isolation, relying on objective functions that attempt to capture statistical regularities within the speech signal. The key innovation in our work is that we discover units by training models with explicit discretization layers to associate speech waveforms with visual images using a cross-modal grounding objective. This forces our models to learn representations which capture semantic information at the highest layers of the network. Because semantics are predominantly carried by words, and words are composed of subword units (such as phones and syllables), the visual grounding objective indirectly forces the model to learn speaker- and noise-invariant representations of speech units. By incorporating trainable quantization layers into our networks, we are able to capture these units in discrete inventories. Whether these units correspond to word-like or sub-word units depends on where the quantization layers are inserted, and how they are trained.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
Prior work on unsupervised modeling of the speech signal has generally focused on learning representations which either disentangle or isolate the latent factors that are of interest for downstream tasks. In most cases the primary latent factor of interest is the phonetic or lexical identity of a given segment of speech, but other factors, such as the identity of the speaker, are sometimes of interest as well. Because the factors of interest are often inherently discrete (e.g. words and phones), many of the proposed approaches attempt to perform segmentation and clustering of the surface features in one way or another. One family of techniques is based upon Segmental Dynamic Time Warping (S-DTW) (Park & Glass, 2005; 2008; Jansen et al., 2010; Jansen & Van Durme, 2011), which uses a self-comparison algorithm to identify relatively long duration (on the order of a second) patterns which frequently reoccur in a speech corpus; these patterns tend to capture words or short phrases. A different line of work employs probabilistic graphical models to jointly segment and cluster the speech signal (Varadarajan et al., 2008; Zhang & Glass, 2009; Gish et al., 2009; Lee & Glass, 2012; Siu et al., 2014; Lee et al., 2015; Ondel et al., 2016; Kamper et al., 2016; 2017a). With an appropriately designed model, it is possible to learn multiple, hierarchical categories of speech units. However, in order to enable efficient inference, the conditional distributions of these models tend to be simple and therefore have limited modeling power.
|
| 20 |
+
|
| 21 |
+
Deep neural network models have been successfully used to learn powerful speech representations using weakly or unsupervised objectives (Thiolliere et al., 2015; Kamper et al., 2015; Hsu et al., 2017a;b; Hsu & Glass, 2018; Holzenberger et al., 2018; Milde & Biemann, 2018; van den Oord et al., 2018; Chung et al., 2019; Pascual et al., 2019). These representations have predominantly been continuous in nature, as discrete latent variables are not trivially compatible with backpropagation. To obtain discrete representations, a post-hoc clustering step can be applied to the continuous representations (Kamper et al., 2017b; Feng et al., 2019). More recently, several papers have proposed ways of directly incorporating discrete variables into neural network models, including using Gumbel-Softmax (Eloff et al., 2019b) or straight-through estimators (van den Oord et al., 2017; Chorowski et al., 2019; Razavi et al., 2019).
|
| 22 |
+
|
| 23 |
+
A different method for learning meaningful representations of speech is via a multimodal grounding objective, which encourages the learning of speech representations that are predictive of the contextual information contained in a separate but accompanying modality, such as vision. Visual grounding of speech is a form of self-supervised learning (Virginia de Sa, 1994), which is powerful in part because it offers a way of training models with a discriminative objective that does not depend on traditional transcriptions or annotations. The first work in this direction relied on phone strings to represent the speech (Roy & Pentland, 2002; Roy, 2003), but more recently this learning has been shown to be possible directly on the speech signal (Synnaeve et al., 2014; Harwath & Glass, 2015; Harwath et al., 2016). Subsequent work on visually-grounded models of speech has investigated improvements and alternatives to the modeling or training algorithms (Leidal et al., 2017; Kamper et al., 2017c; Havard et al., 2019a; Merkx et al., 2019; Chrupała et al., 2017; Scharenborg et al., 2018; Kamper et al., 2019b;a; Sur´ıs et al., 2019; Ilharco et al., 2019; Eloff et al., 2019a), application to multilingual settings (Harwath et al., 2018a; Kamper & Roth, 2017; Azuh et al., 2019; Havard et al., 2019a), analysis of the linguistic abstractions, such as words and phones, which are learned by the models (Harwath & Glass, 2017; Harwath et al., 2018b; Drexler & Glass, 2017; Alishahi et al.,
|
| 24 |
+
|
| 25 |
+
2017; Harwath et al., 2019; Harwath & Glass, 2019; Havard et al., 2019b), and the impact of jointly training with textual input (Holzenberger et al., 2019; Chrupała, 2019; Pasad et al., 2019). Representations learned by models of visually grounded speech are also well-suited for transfer learning to supervised tasks, being highly robust to noise and domain shift (Hsu et al., 2019).
|
| 26 |
+
|
| 27 |
+
# 3 DATA AND MODELS
|
| 28 |
+
|
| 29 |
+
# 3.1 DATASET
|
| 30 |
+
|
| 31 |
+
For training our models, we utilize the MIT Places 205 dataset (Zhou et al., 2014) and their accompanying spoken audio captions (Harwath et al., 2016; 2018b). The caption dataset contains approximately 400,000 spoken audio captions, each of which describes a different Places image. These captions are free-form spontaneous speech, collected from over 2,500 different speakers and covering a 40,000 word vocabulary. The average caption duration is approximately 10 seconds, and each caption contains on average 20 words. For vetting our models during training, we use a held-out validation set of 1,000 image-caption pairs.
|
| 32 |
+
|
| 33 |
+
# 3.2 NEURAL MODELS OF VISUALLY-GROUNDED SPEECH
|
| 34 |
+
|
| 35 |
+
We base our model upon the Residual Deep Audio-Visual Embedding network (ResDAVEnet) architecture (Harwath et al., 2019), which contains two branches of fully convolutional networks, one for images and the other for audio. Each branch encodes samples of the corresponding modality into a $d$ -dimensional space, regardless of the original dimensionality of the samples. This is achieved by applying global spatial mean pooling and global temporal mean pooling to the image branch output and the audio branch output, respectively. The image branch is adapted from ResNet50 (He et al., 2016), where the final softmax layer and the preceding fully-connected layers are removed, replaced with a 1x1 linear convolutional layer in order to project the feature map to the desired dimension. To model the audio inputs, a 17-layer fully convolutional network with residual connections is used. The input is a log Mel-frequency spectrogram with 40 frequency bins and $2 5 ~ \mathrm { m s }$ -wide, Hammingwindowed frames with a shift of $1 0 ~ \mathrm { m s }$ . The first layer of this network is a 1-D convolution that spans the entire frequency axis of the spectrogram, while the remaining 16 convolutional layers are 1-D across the time axis. These 16 layers are divided into four residual blocks of 4 layers each, and downsampling between these blocks is accomplished by applying the first convolution of each block with a stride of 2. For full details of the model, refer to Harwath et al. (2019).
|
| 36 |
+
|
| 37 |
+
# 3.3 LEARNING HIERARCHICAL DISCRETE UNITS WITH VECTOR QUANTIZING LAYERS
|
| 38 |
+
|
| 39 |
+
Previous analyses reveal that ResDAVEnet-like models learn linguistic abstractions at different levels, including words (Harwath & Glass, 2017) and robust phonetic features (Harwath & Glass, 2019; Hsu et al., 2019). To explicitly learn hierarchical discrete linguistic units within this framework, we propose to incorporate multiple vector quantization (VQ) layers (van den Oord et al., 2017) into the ResDAVEnet audio branch; we refer to this new architecture as ResDAVEnet-VQ.
|
| 40 |
+
|
| 41 |
+
VQ layers can be understood as a type of bottleneck, which constrain the amount of information that can flow through. While these layers have been used to learn discrete sub-word units (van den Oord et al., 2017; Chorowski et al., 2019; Razavi et al., 2019), previous work injects VQ layers into autoencoders that are trained with a reconstruction loss. As a result, the embedding dimension of each code and the number of codes need to be carefully tuned (Liu et al., 2019). When the embedding dimension is too low or the codebook size too small, the model does not have enough expressive power to capture linguistic variability. When it is too large, the model starts to encode non-linguistic information in order to improve reconstruction. In contrast, the learning signal of ResDAVEnet-VQ is provided by the visual-semantic grounding objective. Rather than encoding as much information about input as possible, the learned codes in ResDAVEnet-VQ only need to capture semantic information. Since semantics in speech are predominantly transmitted by words, and words are composed of sub-word units like phones, the grounding objective places pressure on the model to robustly infer both from speech. Since words and phones are inherently discrete symbols, representing them with learned discrete units may not even hurt the grounding performance.
|
| 42 |
+
|
| 43 |
+
Figure 1 illustrates the proposed ResDAVEnet-VQ model. We add a quantization layer after each of the first two residual blocks of the ResDAVEnet-VQ model, denoted as VQ2 and VQ3, respectively, with the intention that they should capture discrete sub-word-like and word-like units. A VQ layer is defined as $\pmb { { \cal E } } \in \mathbb { R } ^ { K \times \check { D } }$ , where $K$ represents the codebook size, and $D$ represents the output dimensionality of the input features to the codebook. Denoting the $t ^ { t h }$ temporal frame of the input to the quantization layer as $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , quantization is performed according to $\begin{array} { r } { \mathbf q _ { t } ~ = ~ \mathbf E _ { k , : } } \end{array}$ , where $k \mathbf { \Psi } =$ a $\begin{array} { r } { \operatorname { r g m i n } _ { j } | | \pmb { x } _ { t } - \pmb { E } _ { j , : } | | _ { 2 } } \end{array}$ The quantized output is then fed as input to the subsequent residual block. As in van den Oord et al. (2017), we use the straight-through estimator (Bengio et al., 2013) to compute the gradient passed from $\pmb q _ { t }$ to $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . We use the exponential moving average (EMA) codebook updates proposed by van den Oord et al. (2017).
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: Diagram of the ResDAVEnet-VQ model. On the left, we show the placement of the vector quantization blocks in the audio branch. Note that each “Res” block is comprised of a stack of multiple sub-layers (see Harwath et al. (2019) for details). The right half of the figure depicts the quantization mechanism of each VQ block, as well as the bypass path when the block is disabled.
|
| 47 |
+
|
| 48 |
+
# 3.4 CODEBOOK LEARNING SCHEDULES
|
| 49 |
+
|
| 50 |
+
We include multiple VQ layers in the ResDAVEnet-VQ model, each of which can be independently enabled or bypassed without changing the rest of the architecture configuration. When all model weights, including the VQ codebooks, are trained jointly in a single training run we call this a “coldstart” model. Alternatively, a model can be “warm-started” by copying the weights from another trained model that has fewer (or no) VQ layers enabled, and randomly initializing the codebook of the newly activated VQ layer(s). This gives rise to the questions of how many quantizers should be used and in what order they should be enabled. It is unclear whether models with the same VQ layers activated would learn the same representation at each layer regardless of the training curriculum. Let $A _ { m }$ denote a subset of all VQ layers, and $A _ { m - 1 } \subset A _ { m }$ . We use $\mathrm { } ^ { \ast } A _ { 1 } \dots A _ { M } ^ { \prime \prime }$ to denote a model that is obtained by sequentially training models $^ { * * } A _ { 1 } \to \dots \to A _ { m } ^ { \phantom { * } , }$ initialized from $^ { } A _ { 1 } \to \dots \to A _ { m - 1 } { } ^ { , , }$ , where the model $A _ { 1 }$ is initialized from scratch, and the final model would have VQ layers in $A _ { M }$ activated. For instance, a model initialized from scratch with no VQ layers enabled is denoted as $" \boldsymbol { Q } ^ { \flat }$ , and a model initialized with that and with both layers enabled is denoted as $\cdot \cal { O } \{ 2 , 3 \} ^ { \cdots }$ .
|
| 51 |
+
|
| 52 |
+
# 3.5 TRAINING WITH THE TRIPLET LOSS
|
| 53 |
+
|
| 54 |
+
We train our models using the same loss function as Harwath et al. (2019). This loss function blends two triplet loss terms (Weinberger & Saul, 2009), one based on random sampling of negative examples, and the other based on semi-hard negative mining (Jansen et al., 2018), in order to find more challenging negative samples. Specifically, let the sets of output embedding vectors for a minibatch of $B$ audio/image training pairs respectively be $\mathbb { A } = \{ \pmb { a } _ { 1 } , \dotsc , \pmb { a } _ { B } \}$ and $\mathbb { I } \stackrel { - } { = } \{ i _ { 1 } , \dotsc , i _ { B } \}$ . To compute the randomly-sampled triplet loss term, we select impostor examples for the $j ^ { t h }$ input according to $\bar { \mathbf { } } _ { j } \sim \mathbf { \delta }$ UniformCategorical $( \{ \pmb { a } _ { 1 } , \dots , \pmb { a } _ { B } \} \backslash \pmb { a } _ { j } )$ and $\bar { i } _ { j } \sim$ UniformCategorical $\big ( \{ i _ { 1 } , \ldots , i _ { B } \} \backslash i _ { j } \big )$ . The randomly-sampled triplet loss is then computed as:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathcal { L } _ { s } = \sum _ { j = 1 } ^ { B } \left( \operatorname* { m a x } ( 0 , i _ { j } ^ { T } \bar { a } _ { j } - i _ { j } ^ { T } a _ { j } + 1 ) + \operatorname* { m a x } ( 0 , \bar { i } _ { j } ^ { T } a _ { j } - i _ { j } ^ { T } a _ { j } + 1 ) \right)
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
For the semi-hard negative triplet loss, we first define the sets of impostor candidates for the $j ^ { t h }$ example as $\hat { \mathbb { A } } _ { j } = \{ \pmb { a } \in \mathbb { A } | \pmb { i } _ { j } ^ { T } \pmb { a } < \pmb { i } _ { j } ^ { T } \pmb { a } _ { j } \}$ and $\hat { \mathbb { I } } _ { j } = \lbrace i \in \mathbb { I } \vert i ^ { T } { \pmb { a } } _ { j } < i _ { j } ^ { T } { \pmb { a } } _ { j } \rbrace$ . The semi-hard negative
|
| 61 |
+
|
| 62 |
+
loss is then computed as:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathcal { L } _ { h } = \sum _ { j = 1 } ^ { B } \Big ( \operatorname* { m a x } ( 0 , \operatorname* { m a x } ( i _ { j } ^ { T } \hat { a } ) - i _ { j } ^ { T } a _ { j } + 1 ) + \operatorname* { m a x } ( 0 , \operatorname* { m a x } ( \hat { i } ^ { T } a _ { j } ) - i _ { j } ^ { T } a _ { j } + 1 ) \Big )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Finally, the overall loss function is computed by combining the two above losses, $\mathcal { L } = \mathcal { L } _ { s } + \mathcal { L } _ { h }$ , which was found by (Harwath et al., 2019) to outperform either loss on its own.
|
| 69 |
+
|
| 70 |
+
# 3.6 IMPLEMENTATION DETAILS
|
| 71 |
+
|
| 72 |
+
All of our models were trained for 180 epochs using the Adam optimizer (Kingma & Ba, 2014) with a batch size of 80. We used an exponentially decaying learning rate schedule, with an initial value of 2e-4 that decayed by a factor of 0.95 every 3 epochs. Following van den Oord et al. (2017), we use an EMA decay factor of $\gamma = . 9 9$ for training each VQ codebook. Our core experimental results all use a codebook size of 1024 vectors for all quantizers, but in the supplementary material we include experiments with smaller and larger codebooks. Following Chorowski et al. (2019), the jitter probability hyperparameter for each quantization layer was fixed at 0.12. While we do not apply data augmentation to the input spectrograms, during training we perform standard data augmentation techniques to the images. We resize each raw image so that its smallest dimension is 256 pixels, and then we apply an Inception-style random crop which is resized to 224 pixels square. During training, we also flip each image horizontally with a probability of 0.5. During evaluation, the center 224 pixel square crop is always taken from the image. Finally, the RGB pixel values are mean and variance normalized. We trained each model on the Places audio caption train split, and computed the image and caption recall at 10 $( \mathbb { R } ^ { \ @ 1 0 ) }$ scores on the validation split of the Places audio captions after each training epoch. The model snapshot that achieved the highest average $\mathbb { R } \ @ 1 0$ score on the validation set from each training is used for all evaluation. To extract embeddings and units from our models, we simply perform a forward pass through the speech branch of the ResDAVEnet-VQ network and retain the outputs from the target layer at a uniform frame-rate. The frame-rate is determined by the downsampling factor at the target layer relative to the input. For non-quantized layers, these outputs will be continuous embeddings. For quantized layers, these will be quantized embedding retrieved from the assigned entry in the codebook.
|
| 73 |
+
|
| 74 |
+
# 4 EXPERIMENTS
|
| 75 |
+
|
| 76 |
+
# 4.1 SUB-WORD UNIT LEARNING ON THE ZEROSPEECH 2019 ABX TASK
|
| 77 |
+
|
| 78 |
+
Evaluation metrics Learning unsupervised speech representations that are indicative of phonetic content is of high interest to the speech community, and recently has been the focus of the ZeroSpeech Challenge (Versteegh et al., 2015; Dunbar et al., 2017; 2019). One of the core evaluations is the minimal-pair ABX task (Schatz et al., 2013), which aims to benchmark representations in terms of their discriminability between different sub-word speech units. In this task, a model is tasked with extracting representations for a triplet of speech waveform segments denoted by $A , B ,$ , and $X$ . $A$ and $B$ are constrained to be a triphone minimal pair; that is, both segments capture three phones, but differ only in the identity of their center phone. The third segment, $X$ is chosen to contain the same underlying triphone sequence as $A$ . Supposing $f ( \cdot )$ denotes the model’s mapping function from a waveform segment to a sequence of embedding vectors, the ABX error rate under a given similarity metric $ { \left. { \cal { S } } ( \cdot , \cdot ) \right. }$ is defined as the fraction of ABX triples in which $S ( f ( A ) , f ( X ) ) \bar { > } S ( f ( B ) , f ( \bar { X } ) )$ . An ABX error rate of $50 \%$ indicates random assignment, while an ABX of $0 \%$ reflects perfect phone discriminability. In the ZeroSpeech challenge, $\bar { S ( \cdot , \cdot ) }$ is implemented using Dynamic Time Warping (DTW) with various distance measures (cosine, KL, etc.). In our evaluation, we use the cosine distance.
|
| 79 |
+
|
| 80 |
+
The ZeroSpeech 2019 challenge in particular emphasizes on discovering an inventory of discrete sub-word units, rather than continuous representations. Therefore, in addition to an ABX error rate, a bitrate is also computed for each model which reflects the amount of information carried by the learned units. A lower bitrate can be achieved by having a more compact inventory of learned units or having a smaller number of codes per second. The full details of the evaluation can be found in Dunbar et al. (2019). To be clear, all of our ResDAVEnet-VQ models were not trained on the
|
| 81 |
+
|
| 82 |
+
Table 1: Comparison of $\mathrm { R @ 1 0 }$ , ABX scores, and bit-rates between different configurations and baseline models trained on ZeroSpeech 2019 data or Places Audio Caption. All quantizers reflected in this table used a codebook size of 1,024 vectors. We do not compute RLE or segment scores for the FHVAE-DPGMM model, since we did not re-implement that model.
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Model ID</td><td>Layer</td><td>R@10</td><td>ABX</td><td>Frame-Based Bitrate</td><td>RLE Bitrate</td><td>Segment-Based ABX</td><td>Bitrate</td></tr><tr><td>FHVAE-DPGMM (ZS)</td><td>N/A</td><td>N/A</td><td>21.67</td><td>413.23</td><td></td><td></td><td></td></tr><tr><td>WaveNet-VQ (ZS)</td><td>N/A</td><td>N/A</td><td>19.98</td><td>151.55</td><td>136.74</td><td>20.48</td><td>126.17</td></tr><tr><td>WaveNet-VQ (PA)</td><td>N/A</td><td>N/A</td><td>24.87</td><td>149.00</td><td>136.27</td><td>25.23</td><td>126.22</td></tr><tr><td>“g”</td><td>Res2 Res3</td><td>.735</td><td>11.35 10.86</td><td>N/A N/A</td><td>N/A N/A</td><td>N/A N/A</td><td>N/A N/A</td></tr><tr><td></td><td>VQ2</td><td>.753</td><td>12.33</td><td>433.30</td><td>361.09</td><td>12.78</td><td>332.86</td></tr><tr><td>“ →{2}”</td><td>VQ2</td><td>.760</td><td>11.79</td><td>390.61</td><td>317.66</td><td>12.66</td><td>289.11</td></tr><tr><td>3</td><td>VQ3</td><td>.734</td><td>38.21</td><td>213.92</td><td>129.65</td><td>38.68</td><td>108.84</td></tr><tr><td></td><td>VQ3</td><td>.794</td><td>15.04</td><td>182.93</td><td>140.04</td><td>16.53</td><td>121.26</td></tr><tr><td>"{2,3}"</td><td>VQ2</td><td>.667</td><td>25.62</td><td>408.75</td><td>258.37</td><td>26.32</td><td>217.58</td></tr><tr><td></td><td>VQ3</td><td></td><td>32.23</td><td>218.76</td><td>156.69</td><td>32.49</td><td>136.90</td></tr><tr><td>“→{2,3}”</td><td>VQ2</td><td>.787</td><td>13.15</td><td>405.43</td><td>334.39</td><td>13.30</td><td>303.03</td></tr><tr><td></td><td>VQ3</td><td></td><td>14.95</td><td>199.91</td><td>172.05</td><td>15.60</td><td>159.07</td></tr><tr><td>“{2}→{2,3}”</td><td>VQ2</td><td>.764</td><td>12.51</td><td>415.13</td><td>341.85</td><td>13.06</td><td>311.82</td></tr><tr><td></td><td>VQ3</td><td></td><td>14.52</td><td>167.84</td><td>136.11</td><td>15.68</td><td>121.17</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>“{3}→{2,3}”</td><td>VQ2</td><td>.760</td><td>13.55</td><td>421.23</td><td>271.91</td><td>14.38</td><td>232.87</td></tr><tr><td></td><td>VQ3</td><td></td><td>33.70</td><td>208.63</td><td>117.37</td><td>33.58</td><td>98.29</td></tr></table>
|
| 85 |
+
|
| 86 |
+
ZeroSpeech training data, but instead on the Places audio captions, thus there is a domain mismatch between training and testing these models.
|
| 87 |
+
|
| 88 |
+
In addition to the frame-based bitrate and ABX scores computed by the ZeroSpeech 2019 evaluation toolkit, we implement our own extensions to these metrics. Because it is common for successive frames to be assigned to the same codebook entry and phonetic information is not encoded at a fixed frame rate, lossless run length encoding (RLE) can be a more reasonable measure of the bitrate of a frame-based model. RLE does not change the ABX score since it can be trivially inverted, but it does change the bitrate. For computing the RLE bitrate, we modify the bitrate calculation specified in Dunbar et al. (2019) so that a unique symbol is defined as the tuple (unit, length) where length is the number of frames assigned to a given unit with in a segment. We also consider segment-based ABX and bitrate, which is similar to the RLE metrics except in this case we outright discard the frame length information. This typically results in an even greater reduction in bitrate, but also an accompanying deterioration in ABX score.
|
| 89 |
+
|
| 90 |
+
Baseline models In Table 1, we compare our results to those derived from two of the topperforming submissions to the ZeroSpeech 2019 challenge: a re-implementation of WaveNetVQ (Chorowski et al., 2019) provided by Cho et al. (2019) and FHVAE-DPGMM (Feng et al., 2019). Using the code accompanied with the WaveNet-VQ submission, we were able to train their model on the set of 400,000 Places audio captions to make a fairer comparison with our ResDAVEnet-VQ models in terms of the amount of speech data used. In addition, when trying to reproduce the reported WaveNet-VQ results, we obtain better performance than previously reported by training for more steps. Table 1 shows that WaveNet-VQ achieves similar bitrates regardless of the training data. However, ABX deteriorates from 19.98 to 24.87, implying the model cannot utilize data of a larger scale but out-of-domain relative to the test set. A similar degradation when testing on out-of-domain data with FHVAE models was observed in Hsu et al. (2019). We did not re-train the model submitted by Feng et al. (2019), and instead compare against the scores reported in Dunbar et al. (2019).
|
| 91 |
+
|
| 92 |
+
ABX discrimination without using quantization Our first experiment investigates exactly which layer in the ResDAVEnet-VQ model is most suited for ABX phone discrimination, and would thus make a good candidate for learning of quantized sub-word units. The leftmost plot in Figure 2 shows that layers 2 and 3 of a ResDAVEnet-VQ model without any quantization enabled perform the best in terms of ABX error rate on the ZeroSpeech 2019 English test set; the exact numbers for this model are displayed in the caption of Figure 2. Because layers 2 and 3 achieve the lowest ABX error rates without quantization, we focus our attention on the impact of quantization there.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: $\mathrm { R @ 1 0 }$ and ABX tracked at various training epochs. The “ $\mathcal { D }$ ” model achieves a final $\mathbb { R } \ @ 1 0$ of .735, with ABX scores of 19.77, 11.35, 10.86, and 14.05 for the conv1, res2, res3, and res4 layers.
|
| 96 |
+
|
| 97 |
+
Quantizing one layer When quantizing only one layer, we examine quantization of layer 2 vs. layer 3, and using cold-start training vs. warm-start initialization from model “ $\chi ^ { \prime }$ . The ABX and bitrate results for these models, as well as the $\mathbb { R } \ @ 1 0$ scores on the Places validation set, are shown in Table 1. In all cases, quantization applied at the output of layer 2 achieves a better ABX score than quantization at layer 3, but VQ3 achieves a better bitrate. Quantization barely impacts the performance of layer 2, whose ABX score very slightly rises from 11.35 to 11.79. Warm-start initialization is beneficial to $\mathrm { R @ 1 0 }$ and ABX score in both cases, but we notice an intriguing anomaly when applying cold-start quantization to layer 3: the ABX score deteriorates significantly, rising from 10.86 in the case of the non-quantized model to 38.21. This indicates that while VQ2 is capable of learning a finite inventory of units that are highly predictive of phonetic identity from either a warm-start or cold-start initialization, cold-start training of VQ3 results in very little phonetic information captured by the quantizer. Interestingly, this model is still learning to infer visual semantics from the speech signal, as evidenced by a high $\mathbb { R } \ @ 1 0$ score; we later show in Section 4.2 that the reason for this anomaly is because cold-start training of VQ3 results in the learning of word detectors. In all cases except for model $\{ 3 \} ^ { \flat }$ , we note that the ABX scores achieved by our models are significantly better than the baselines. Our best model in terms of ABX $\ " \infty \{ 2 \} \ " )$ achieves a $4 1 . 0 \%$ reduction in ABX over the WaveNet-VQ baseline, at a cost of a $1 3 2 . 3 \%$ increase in RLE bitrate; however, model “ $\mathrm { \Phi ^ { \prime } } \mathcal { O } \to \{ 3 \} ^ { \flat }$ achieves a $2 4 . 7 \%$ reduction in ABX error rate with only a $2 . 4 \%$ increase in RLE bitrate. These results do not constitute a fair comparison, however, because the WaveNet-VQ and ResDAVEnet-VQ models were trained on different datasets; when training the WaveNet-VQ model on the same set of audio captions used to train ResDAVEnet-VQ (but without the accompanying images, since WaveNet-VQ is not a multimodal model), the ABX error rate increases to $2 4 . 8 7 \%$ , tipping the results even more in favor of the ResDAVEnet-VQ models.
|
| 98 |
+
|
| 99 |
+
Quantizing two layers Quantizing multiple layers at once offers the possibility of learning a hierarchy of units. Thus, we aim to capture phonetic information in a lower layer quantizer and word-level information at a higher layer quantizer. Cold-start training of two quantizers $( ^ { 6 6 } \{ 2 , 3 \} ^ { 5 } )$ results in a significant drop in ABX performance for both VQ2 and VQ3, but also a drop in $\mathrm { R @ 1 0 }$ on the Places validation set. We see much better results in terms of $\textrm { R @ 1 0 }$ and ABX for the remaining 3 models which were initialized from the “ $\varnothing$ ” model or a model with only one quantizer enabled; for example, model “ $\{ 2 \} \{ 2 , 3 \} ^ { \prime }$ achieves an ABX of 14.52 with an RLE bitrate of 136.11, representing a $2 7 . 3 \%$ ABX improvement over the best baseline while keeping the bitrate approximately the same. We see in model “ $\{ 3 \} \{ 2 , 3 \} ^ { \prime }$ that the same phenomenon observed with model $\{ 3 \} ^ { \flat }$ persists: VQ3 achieves relatively poor ABX, despite a high overall $\textrm { R @ 1 0 }$ and strong ABX with VQ2 at $1 3 . 5 5 \%$ . We confirm in Section 4.2 that the VQ3 layer of model ${ } ^ { * * } \{ 3 \} \{ 2 , 3 \bar \} ^ { * }$ does indeed capture word-level information, indicating that this model has successfully localized phonetic unit identity in the second layer and lexical unit identity in the third layer. Overall, our results suggest that when learning hierarchical quantized representations with a ResDAVEnet-VQ model, the nature of the representations learned is highly dependent on the training curriculum.
|
| 100 |
+
|
| 101 |
+
Table 2: ABX scores and RLE bitrates for various SNRs on the noisy ZeroSpeech19 English test set. “R-B” stands for “RLE-Bitrate,” and (n) denotes a model trained on the noisy Places Audio dataset. For the WaveNet-VQ models, (ZS) and (PA) respectively denote training on the ZeroSpeech 19 English training set, and the clean Places Audio dataset.
|
| 102 |
+
|
| 103 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Layer</td><td colspan="2">Clean</td><td colspan="2">20-30 dB</td><td colspan="2">10-20 dB</td><td colspan="2">0-10 dB</td></tr><tr><td>ABX</td><td>R-B</td><td>ABX</td><td>R-B</td><td>ABX</td><td>R-B</td><td>ABX</td><td>R-B</td></tr><tr><td colspan="2">WaveNet-VQ (ZS) WaveNet-VQ (PA)</td><td>N/A N/A</td><td>19.98 24.87</td><td>136.74 136.27</td><td>21.22 27.18</td><td>141.07 137.70</td><td>27.51</td><td>144.28 132.34</td><td>42.55</td><td>126.96 110.50</td></tr><tr><td colspan="2">“0”</td><td>Res2</td><td></td><td>N/A</td><td>11.63</td><td></td><td>33.29</td><td></td><td>42.67</td><td></td></tr><tr><td colspan="2">“g</td><td>Res3</td><td>11.35</td><td>N/A</td><td>11.16</td><td>N/A N/A</td><td>13.17 12.96</td><td>N/A N/A</td><td>19.44 19.43</td><td>N/A N/A</td></tr><tr><td colspan="2">“→{2}”</td><td></td><td>10.86 11.79</td><td>317.66</td><td>12.15</td><td>325.40</td><td>14.62</td><td>332.21</td><td>23.96</td><td>327.15</td></tr><tr><td colspan="2">→ {2,3}”</td><td>VQ2</td><td>12.51</td><td>341.85</td><td>12.56</td><td>350.28</td><td>14.82</td><td>362.73</td><td>25.02</td><td>330.54</td></tr><tr><td colspan="2">“ 2 →</td><td>VQ2 VQ3</td><td>14.52</td><td>136.11</td><td>14.73</td><td>137.68</td><td>17.44</td><td>143.14</td><td>27.68</td><td>133.13</td></tr><tr><td colspan="2">{2,3” 3 → {2,3”</td><td>VQ2</td><td>13.55</td><td>271.91</td><td>13.65</td><td>272.46</td><td>15.69</td><td>267.70</td><td>24.06</td><td>244.52</td></tr><tr><td colspan="2">“3 → {2,3}”</td><td>VQ3</td><td>33.70</td><td>117.37</td><td>32.56</td><td>118.22</td><td>34.65</td><td>115.40</td><td>39.82</td><td>102.48</td></tr><tr><td colspan="2">“g”(n)</td><td>Res2</td><td>13.32</td><td>N/A</td><td>12.30</td><td>N/A</td><td>12.97</td><td>N/A</td><td>16.91</td><td>N/A</td></tr><tr><td colspan="2">“0”(n)</td><td>Res3</td><td>11.85</td><td>N/A</td><td>11.90</td><td>N/A</td><td>12.44</td><td>N/A</td><td>16.09</td><td>N/A</td></tr><tr><td colspan="2">“→{2}”(n)</td><td>VQ2</td><td>12.64</td><td>342.53</td><td>12.20</td><td>348.57</td><td>13.34</td><td>359.43</td><td></td><td></td></tr><tr><td colspan="2">“{2} → {2,3}”(n)</td><td></td><td>13.42</td><td>365.89</td><td>13.71</td><td>359.14</td><td>14.57</td><td></td><td>18.82</td><td>373.60</td></tr><tr><td colspan="2">“2</td><td>VQ2</td><td>14.39</td><td>179.19</td><td>14.92</td><td>180.36</td><td>15.38</td><td>370.67</td><td>18.78</td><td>392.10</td></tr><tr><td colspan="2">{2,3}"(n) “3 →</td><td>VQ3</td><td>16.52</td><td>223.28</td><td>16.47</td><td>223.61</td><td></td><td>182.27</td><td>19.58</td><td>188.32</td></tr><tr><td colspan="2">{2,3}"(n) “3}</td><td>VQ2</td><td></td><td></td><td></td><td></td><td>17.75</td><td>225.72</td><td>22.68</td><td>230.01</td></tr><tr><td colspan="2">→ {2,3}"(n)</td><td>VQ3</td><td>26.21</td><td>187.31</td><td>25.88</td><td>187.92</td><td>26.34</td><td>188.49</td><td>31.26</td><td>191.28</td></tr></table>
|
| 104 |
+
|
| 105 |
+
Training and testing on noisy data In Hsu et al. (2019), it was shown that representations learned by a ResDAVEnet model were far more robust to train/test domain mismatch in terms of background noise, channel characteristics, and speaker identity than standard spectral features when training a supervised speech recognizer. Here, we examine whether this robustness is also exemplified by the quantized versions of this model. We construct three additional test sets using the ZeroSpeech 2019 English testing data by adding noise sampled from the AudioSet (Jansen et al., 2018) dataset. For each ZeroSpeech testing waveform, we randomly sampled an AudioSet waveform of the same duration and performed linear mixing with a signal-to-noise ratio (SNR) selected randomly within a specified range. We construct low, medium, and high noise testing sets, corresponding to SNRs of 20-30 dB, 10-20 dB, and 0-10 dB. We then perform the ABX discrimination task on these noisy waveforms, displaying the results in Table 2. We find that for all models, a worsening SNR results in a deterioration in ABX performance. However, the ResDAVEnet-VQ models prove to be far more noise robust than the Wavenet-VQ model; even in the high noise testing set, the best ResDAVEnetVQ model achieves an ABX of $2 3 . 9 6 \%$ , while the WaveNet-VQ models degrade to nearly-random ABX scores of $4 2 . 5 5 \%$ and $4 2 . 6 7 \%$ .
|
| 106 |
+
|
| 107 |
+
Given that a ResDAVEnet-VQ model trained on the “clean” Places Audio captions is highly robust to additive noise on the ABX discrimination task, we investigated whether adding noise to the Places Audio captions themselves would result in an even higher degree of noise robustness. To that end, we followed a similar data augmentation approach to create a noisy version of the Places Audio captions, where the SNR of each caption was randomly chosen to sit within the range of 0-30 dB. The bottom half of Table 2 shows the results of training several ResDAVEnet-VQ models on the noisy Places Audio captions and testing on the clean and noisy ZeroSpeech ABX tasks. In general, we observe a degradation ABX score in the clean conditions, but with a significantly higher degree of noise robustness in the noisier conditions.
|
| 108 |
+
|
| 109 |
+
Visualization of learned units To better measure the correspondence between the VQ units and English phones, we compute corpus-level co-occurrence statistics (at the frame-level) across the TIMIT training set, excluding the sa dialect sentences. To facilitate visualization, we use the $^ { \cdot } \sigma \{ 2 \} ^ \cdot \}$ model with a codebook size of 128. We display the conditional probability matrix P (phone|unit) in Figure 3, with the rows and columns ordered via spectral co-clustering with 10 clusters in order to group together phones that share similar sets of VQ codes. Visually, there is a strong mapping between TIMIT phone labels and ResDAVEnet-VQ codes. In some cases, redundant codes are used for the same phone label (this is especially the case for the silence label), and in other cases we see that phones belonging to the same manner class often tend to share codebook units. We can numerically quantify the mapping between the phone and unit labels with the normalized mutual information measure (NMI), which we found to be .378 in this case. We also include several caption spectrograms with their time-aligned unit sequences in Figures 5, 6, and 7 in the supplementary material.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3: Conditional probability matrix displaying $P ( p h o n e | u n i t )$ using the “ $\cdot \sigma \{ 2 \} ^ { \ast }$ model with a VQ2 codebook size of 128. For visualization, we saturate the color scaling at probability 0.5.
|
| 113 |
+
|
| 114 |
+
Table 3: Performance of the VQ3 layer from the $\mathrm { \cdot \{ 3 \} \{ 2 , 3 \} ^ { \bullet } }$ ” model when codes are treated as word detectors. Codes are ranked by the highest F1 score among the retrieved words for a given code. Word hypotheses for a given code are ranked by the F1 score. P denotes precision, R recall, and occ the number of co-occurrences of the code and word in the data.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>code</td><td></td><td colspan="4">Top Hypotheses</td><td colspan="6">Second Hypotheses</td></tr><tr><td>rank</td><td></td><td>word</td><td>F1</td><td>P</td><td>R</td><td>occ</td><td>word</td><td>F1</td><td>P</td><td>R</td><td>occ</td></tr><tr><td>1</td><td>918</td><td>pantry</td><td>90.67</td><td>88.29</td><td>93.18</td><td>41</td><td>spice</td><td>3.96</td><td>2.20</td><td>20.00</td><td>1</td></tr><tr><td>2</td><td>596</td><td>kitchen</td><td>90.08</td><td>91.59</td><td>88.63</td><td>304</td><td>countertop</td><td>1.64</td><td>0.84</td><td>29.63</td><td>8</td></tr><tr><td>3</td><td>88</td><td>classroom</td><td>88.97</td><td>89.05</td><td>88.89</td><td>72</td><td>classrooms</td><td>5.01</td><td>2.57</td><td>100.00</td><td>2</td></tr><tr><td>4</td><td>58</td><td>baseball</td><td>88.71</td><td>88.63</td><td>88.78</td><td>182</td><td>player</td><td>3.01</td><td>1.65</td><td>17.11</td><td>13</td></tr><tr><td>5</td><td>706</td><td>background</td><td>87.86</td><td>91.93</td><td>84.14</td><td>838</td><td>ground</td><td>0.58</td><td>0.39</td><td>1.18</td><td>4</td></tr><tr><td>198</td><td>237</td><td>lobby</td><td>68.43</td><td>56.77</td><td>86.11</td><td>31</td><td> waiting</td><td>9.93</td><td>7.86</td><td>13.46</td><td>14</td></tr><tr><td>199</td><td>829</td><td>shirt</td><td>68.41</td><td>71.49</td><td>65.58</td><td>322</td><td>shirts</td><td>18.28</td><td>10.37</td><td>76.79</td><td>43</td></tr><tr><td>200</td><td>59</td><td>grass</td><td>68.31</td><td>56.53</td><td>86.28</td><td>503</td><td>grassy</td><td>15.30</td><td>8.67</td><td>65.35</td><td>83</td></tr></table>
|
| 117 |
+
|
| 118 |
+
# 4.2 FROM PHONES TO WORDS: LEARNING A HIERARCHY OF UNITS
|
| 119 |
+
|
| 120 |
+
As shown in Table 1, all of the ResDAVEnet-VQ models which underwent cold-start training of VQ3 exhibited a similar phenomenon in which the ABX error rate of that layer was particularly high, despite the model performing well at the image-caption retrieval task. We hypothesized that this could be due to VQ3 learning to recognize higher level linguistic units, such as words. To examine this empirically, we inferred the VQ3 unit sequence for every audio caption in the Places Audio training set according to several different models. Using the estimated word-level transcriptions of the utterances (provided by the Google SpeechRecognition API), we computed precision, recall, and F1 scores for every unique (word, VQ3 code) pair for a given model and quantization layer. We then ranked the VQ codes in descending order according to their maximum F1 score for any word in the vocabulary. Table 3 shows a sampling of these statistics for model ${ \bf \dot { \theta } } \{ 3 \} \{ 2 , 3 \} ^ { \bf \theta }$ . In the supplementary material, we include many more examples for this model in Table 7, as well as examples for the $^ { \bullet } \{ 2 \} \{ 2 , 3 \} ^ { \bullet }$ model (which did not learn VQ3 word detectors) in Table 8. It should be emphasized that these models are exactly the same in all respects, except for the order in which their quantizers were trained.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: Visualization of the precision, recall, and F1 scores of individual VQ3 codes when treated as word detectors on the Places Audio captions.
|
| 124 |
+
|
| 125 |
+
We examine the overall performance of VQ3 as a word detector for these models in Figure 4. The right hand side of Figure 4 displays the number of VQ3 codes whose maximum F1 score is above a given threshold, while the left hand side shows the distribution of precision and recall scores for the top 250 words ranked by F1. This gives an approximate indication of how many VQ3 codes have learned to specialize as detectors for a specific word. We see that the VQ3 layer of model $\cdot \{ 3 \} \{ 2 , 3 \} ^ { \prime }$ learns 279 codebook entries with an F1 score above 0.5. In contrast, the VQ3 layer of model $^ { \cdot } \{ 2 \bar \} \{ 2 , 3 \} ^ { \prime }$ learns only a handful of word-detecting codebook entries with an F1 of greater than 0.5. This experiment supports the notion that the reason for the poor ABX performances of the VQ3 layer in models $\ " \{ 3 \} \ "$ and ${ \bf \cdot } \{ 3 \} \{ 2 , 3 \} ^ { \bf \cdot }$ is in fact due to its specialization for detecting specific words, and that this specialization only emerges when the VQ3 layer is learned before the VQ2 layer. Section A.2 in the supplementary material examines this phenomenon in greater experimental detail.
|
| 126 |
+
|
| 127 |
+
# 5 CONCLUSIONS
|
| 128 |
+
|
| 129 |
+
In this paper, we demonstrated that the neural vector quantization layers proposed by van den Oord et al. (2017) can be integrated into the visually-grounded speech models proposed by Harwath et al. (2019). This resulted in the ability of the speech model to directly represent speech units, such as phones and words, as discrete latent variables. We presented extensive experiments and analysis of these learned representations, demonstrating significant improvements in phone discrimination ability over the current state-of-the-art models for sub-word speech unit discovery. We demonstrated that these units are also far more robust to noise and domain shift than units derived from previously proposed models. These results supported the notion that semantic supervision via a discriminative, multimodal grounding objective has the potential to be more powerful than reconstruction-based objectives typically used in unsupervised speech models.
|
| 130 |
+
|
| 131 |
+
We also showed how multiple vector quantizers could be employed simultaneously within a single ResDAVEnet-VQ model, and that these quantizers could be made to specialize in learning a hierarchy of speech units: specifically, phones in the lower quantizer and words in the upper quantizer. Our analysis showed that hundreds of codebooks in the upper quantizer learned to perform as word detectors, and that these detectors were highly accurate. Our experiments also revealed that this behavior only emerged when VQ3 was trained before VQ2. These results suggest the importance of the learning curriculum, which should be more deeply investigated in future work. Future work should attempt to make explicit what kind of compositional rules are implicitly encoded by these models when mapping sequences of codes from the lower quantizer to word-level units in the upper quantizer; the automatic derivation of a sub-word unit inventory, vocabulary, and pronunciation lexicon could serve as the starting point for a fully unsupervised speech recognition system. Future work should also investigate whether layers above VQ3 could be made to learn even higher-level linguistic abstractions, such as grammar, syntax, and compositional reasoning.
|
| 132 |
+
|
| 133 |
+
# REFERENCES
|
| 134 |
+
|
| 135 |
+
Afra Alishahi, Marie Barking, and Grzegorz Chrupała. Encoding of phonology in a recurrent neural model of grounded speech. In Proc. ACL Conference on Natural Language Learning (CoNLL), 2017.
|
| 136 |
+
|
| 137 |
+
Emmanuel Azuh, David Harwath, and James Glass. Towards bilingual lexicon discovery from visually grounded speech audio. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 138 |
+
|
| 139 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 140 |
+
|
| 141 |
+
Chung-Cheng Chiu, Tara N Sainath, Yonghui Wu, Rohit Prabhavalkar, Patrick Nguyen, Zhifeng Chen, Anjuli Kannan, Ron J Weiss, Kanishka Rao, Ekaterina Gonina, et al. State-of-the-art speech recognition with sequence-to-sequence models. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018.
|
| 142 |
+
|
| 143 |
+
Suhee Cho, Yeonjung Hong, Yookyunk Shin, and Youngsun Cho. VQVAE with speaker adversarial training, 2019. URL https://github.com/Suhee05/Zerospeech2019.
|
| 144 |
+
|
| 145 |
+
Jan Chorowski, Ron J. Weiss, Samy Bengio, and Aaron van den Oord. Unsupervised speech rep- ¨ resentation learning using wavenet autoencoders. IEEE Transactions on Audio, Speech and Language Processing, 2019.
|
| 146 |
+
|
| 147 |
+
Grzegorz Chrupała. Symbolic inductive bias for visually grounded learning of spoken language. In Proc. Annual Meeting of the Association for Computational Linguistics (ACL), 2019.
|
| 148 |
+
|
| 149 |
+
Grzegorz Chrupała, Lieke Gelderloos, and Afra Alishahi. Representations of language in a model of visually grounded speech signal. In Proc. Annual Meeting of the Association for Computational Linguistics (ACL), 2017.
|
| 150 |
+
|
| 151 |
+
Yu-An Chung, Wei-Ning Hsu, Hao Tang, and James R. Glass. An unsupervised autoregressive model for speech representation learning. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 152 |
+
|
| 153 |
+
Jennifer Drexler and James Glass. Analysis of audio-visual features for unsupervised speech recognition. In Proc. Grounded Language Understanding Workshop, 2017.
|
| 154 |
+
|
| 155 |
+
Ewan Dunbar, Xuan Nga Cao, Juan Benjumea, Julien Karadayi, Mathieu Bernard, Laurent Besacier, Xavier Anguera, and Emmanuel Dupoux. The zero resource speech challenge 2017. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2017.
|
| 156 |
+
|
| 157 |
+
Ewan Dunbar, Robin Algayres, Julien Karadayi, Mathieu Bernard, Juan Benjumea, Xuan-Nga Cao, Lucie Miskic, Charlotte Dugrain, Lucas Ondel, Alan W. Black, Laurent Besacier, Sakriani Sakti, and Emmanuel Dupoux. The zero resource speech challenge 2019: TTS without T. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 158 |
+
|
| 159 |
+
Emmanuel Dupoux. Cognitive science in the era of artificial intelligence: A roadmap for reverseengineering the infant language-learner. In Cognition, 2018.
|
| 160 |
+
|
| 161 |
+
Ryan Eloff, Herman Engelbrecht, and Herman Kamper. Multimodal one-shot learning of speech and images. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019a.
|
| 162 |
+
|
| 163 |
+
Ryan Eloff, Andre Nortje, Benjamin van Niekerk, Avashna Govender, Leanne Nortje, Arnu Preto- ´ rius, Elan van Biljon, Ewald van der Westhuizen, Lisa van Staden, and Herman Kamper. Unsupervised acoustic unit discovery for speech synthesis using discrete latent-variable neural networks. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019b.
|
| 164 |
+
|
| 165 |
+
Siyuan Feng, Tan Lee, and Zhiyuan Peng. Combining adversarial training and disentangled speech representation for robust zero-resource subword modeling. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 166 |
+
|
| 167 |
+
Herb Gish, Man-Hung Siu, Arthur Chan, and William Belfield. Unsupervised training of an HMMbased speech recognizer for topic classification. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2009.
|
| 168 |
+
|
| 169 |
+
Google. Google cloud speech-to-text API. https://cloud.google.com/ speech-to-text/, 2019. Accessed: 2019-09-16.
|
| 170 |
+
|
| 171 |
+
David Harwath and James Glass. Deep multimodal semantic embeddings for speech and images. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2015.
|
| 172 |
+
|
| 173 |
+
David Harwath and James Glass. Learning word-like units from joint audio-visual analysis. In Proc. Annual Meeting of the Association for Computational Linguistics (ACL), 2017.
|
| 174 |
+
|
| 175 |
+
David Harwath and James Glass. Towards visually grounded sub-word speech unit discovery. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019.
|
| 176 |
+
|
| 177 |
+
David Harwath, Antonio Torralba, and James R. Glass. Unsupervised learning of spoken language with visual context. In Proc. Neural Information Processing Systems (NeurIPS), 2016.
|
| 178 |
+
|
| 179 |
+
David Harwath, Galen Chuang, and James Glass. Vision as an interlingua: Learning multilingual semantic embeddings of untranscribed speech. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018a.
|
| 180 |
+
|
| 181 |
+
David Harwath, Adria Recasens, D \` ´ıdac Sur´ıs, Galen Chuang, Antonio Torralba, and James Glass. Jointly discovering visual objects and spoken words from raw sensory input. In Proc. IEEE European Conference on Computer Vision (ECCV), 2018b.
|
| 182 |
+
|
| 183 |
+
David Harwath, Adria Recasens, D \` ´ıdac Sur´ıs, Galen Chuang, Antonio Torralba, and James Glass. Jointly discovering visual objects and spoken words from raw sensory input. International Journal of Computer Vision, 2019.
|
| 184 |
+
|
| 185 |
+
William Havard, Jean-Pierre Chevrot, and Laurent Besacier. Models of visually grounded speech signal pay attention to nouns: a bilingual experiment on English and Japanese. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019a.
|
| 186 |
+
|
| 187 |
+
William N. Havard, Jean-Pierre Chevrot, and Laurent Besacier. Word recognition, competition, and activation in a model of visually grounded speech. In Proc. ACL Conference on Natural Language Learning (CoNLL), 2019b.
|
| 188 |
+
|
| 189 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 190 |
+
|
| 191 |
+
Nils Holzenberger, Mingxing Du, Julien Karadayi, Rachid Riad, and Emmanuel Dupoux. Learning word embeddings: Unsupervised methods for fixed-size representations of variable-length speech segments. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2018.
|
| 192 |
+
|
| 193 |
+
Nils Holzenberger, Shruti Palaskar, Pranava Madhyastha, Florian Metze, and Raman Arora. Learning from multiview correlations in open-domain videos. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019.
|
| 194 |
+
|
| 195 |
+
Wei-Ning Hsu and James Glass. Scalable factorized hierarchical variational autoencoder training. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2018.
|
| 196 |
+
|
| 197 |
+
Wei-Ning Hsu, Yu Zhang, and James Glass. Learning latent representations for speech generation and transformation. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2017a.
|
| 198 |
+
|
| 199 |
+
Wei-Ning Hsu, Yu Zhang, and James Glass. Unsupervised learning of disentangled and interpretable representations from sequential data. In Proc. Neural Information Processing Systems (NeurIPS), 2017b.
|
| 200 |
+
|
| 201 |
+
Wei-Ning Hsu, David Harwath, and James Glass. Transfer learning from audio-visual grounding to speech recognition. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 202 |
+
|
| 203 |
+
Gabriel Ilharco, Yuan Zhang, and Jason Baldridge. Large-scale representation learning from visually grounded untranscribed speech. In Proc. ACL Conference on Natural Language Learning (CoNLL), 2019.
|
| 204 |
+
|
| 205 |
+
Aren Jansen and Benjamin Van Durme. Efficient spoken term discovery using randomized algorithms. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2011.
|
| 206 |
+
|
| 207 |
+
Aren Jansen, Kenneth Church, and Hynek Hermansky. Toward spoken term discovery at scale with zero resources. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2010.
|
| 208 |
+
|
| 209 |
+
Aren Jansen, Manoj Plakal, Ratheet Pandya, Daniel P.W. Ellis, Shawn Hershey, Jiayang Liu, R. Channing Moore, and Rif A. Saurous. Unsupervised learning of semantic audio representations. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018.
|
| 210 |
+
|
| 211 |
+
Herman Kamper and Michael Roth. Visually grounded cross-lingual keyword spotting in speech. In Proc. of the Workshop on Spoken Language Technologies for Under-Resourced Languages (SLTU), 2017.
|
| 212 |
+
|
| 213 |
+
Herman Kamper, Aren Jansen, and Sharon Goldwater. Fully unsupervised small-vocabulary speech recognition using a segmental Bayesian model. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2015.
|
| 214 |
+
|
| 215 |
+
Herman Kamper, Aren Jansen, and Sharon Goldwater. Unsupervised word segmentation and lexicon discovery using acoustic word embeddings. IEEE Transactions on Audio, Speech and Language Processing, 2016.
|
| 216 |
+
|
| 217 |
+
Herman Kamper, Aren Jansen, and Sharon Goldwater. A segmental framework for fullyunsupervised large-vocabulary speech recognition. Computer Speech and Language, 46(3):154– 174, 2017a.
|
| 218 |
+
|
| 219 |
+
Herman Kamper, Karen Livescu, and Sharon Goldwater. An embedded segmental k-means model for unsupervised segmentation and clustering of speech. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2017b.
|
| 220 |
+
|
| 221 |
+
Herman Kamper, Shane Settle, Gregory Shakhnarovich, and Karen Livescu. Visually grounded learning of keyword prediction from untranscribed speech. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2017c.
|
| 222 |
+
|
| 223 |
+
Herman Kamper, Aristotelis Anastassiou, and Karen Livescu. Semantic query-by-example speech search using visual grounding. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019a.
|
| 224 |
+
|
| 225 |
+
Herman Kamper, Gregory Shakhnarovich, and Karen Livescu. Semantic speech retrieval with a visually grounded model of untranscribed speech. IEEE Transactions on Audio, Speech and Language Processing, 2019b.
|
| 226 |
+
|
| 227 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proc. International Conference on Learning Representations (ICLR), 2014.
|
| 228 |
+
|
| 229 |
+
Chia-Ying Lee and James Glass. A nonparametric Bayesian approach to acoustic model discovery. In Proc. Annual Meeting of the Association for Computational Linguistics (ACL), 2012.
|
| 230 |
+
|
| 231 |
+
Chia-Ying Lee, Timothy J. O’Donnell, and James Glass. Unsupervised lexicon discovery from acoustic input. In Proc. Annual Meeting of the Association for Computational Linguistics (ACL), 2015.
|
| 232 |
+
|
| 233 |
+
Kenneth Leidal, David Harwath, and James Glass. Learning modality-invariant representations for speech and images. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2017.
|
| 234 |
+
|
| 235 |
+
M. Paul Lewis, Gary F. Simon, and Charles D. Fennig. Ethnologue: Languages of the World, Nineteenth edition. SIL International. Online version: http://www.ethnologue.com, 2016.
|
| 236 |
+
|
| 237 |
+
Andy T Liu, Po-chun Hsu, and Hung-yi Lee. Unsupervised end-to-end learning of discrete linguistic units for voice conversion. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 238 |
+
|
| 239 |
+
Danny Merkx, Stefan L. Frank, and Mirjam Ernestus. Language learning using speech to image retrieval. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 240 |
+
|
| 241 |
+
Benjamin Milde and Chris Biemann. Unspeech: Unsupervised speech context embeddings. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2018.
|
| 242 |
+
|
| 243 |
+
Lucas Ondel, Lukas Burget, and Jan ´ Cernock ˇ y. Variational inference for acoustic unit discovery. ´ In Proc. of the Workshop on Spoken Language Technologies for Under-Resourced Languages (SLTU), 2016.
|
| 244 |
+
|
| 245 |
+
Alex Park and James Glass. Towards unsupervised pattern discovery in speech. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2005.
|
| 246 |
+
|
| 247 |
+
Alex Park and James Glass. Unsupervised pattern discovery in speech. IEEE Transactions on Audio, Speech and Language Processing, 2008.
|
| 248 |
+
|
| 249 |
+
Ankita Pasad, Bowen Shi, Herman Kamper, and Karen Livescu. On the contributions of visual and textual supervision in low-resource semantic speech retrieval. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 250 |
+
|
| 251 |
+
Santiago Pascual, Mirco Ravanelli, Joan Serra, Antonio Bonafonte, and Yoshua Bengio. Learning \` problem-agnostic speech representations from multiple self-supervised tasks. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2019.
|
| 252 |
+
|
| 253 |
+
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019.
|
| 254 |
+
|
| 255 |
+
Deb Roy. Grounded spoken language acquisition: Experiments in word learning. IEEE Transactions on Multimedia, 5(2):197–209, 2003.
|
| 256 |
+
|
| 257 |
+
Deb Roy and Alex Pentland. Learning words from sights and sounds: a computational model. Cognitive Science, 26:113–146, 2002.
|
| 258 |
+
|
| 259 |
+
Odette Scharenborg, Laurent Besacier, Alan W. Black, Mark Hasegawa-Johnson, Florian Metze, Graham Neubig, Sebastian Stuker, Pierre Godard, Markus M ¨ uller, Lucas Ondel, Shruti Palaskar, ¨ Philip Arthur, Francesco Ciannella, Mingxing Du, Elin Larsen, Danny Merkx, Rachid Riad, Liming Wang, and Emmanuel Dupoux. Linguistic unit discovery from multi-modal inputs in unwritten languages: Summary of the ”Speaking Rosetta” JSALT 2017 workshop. In Proc. International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018.
|
| 260 |
+
|
| 261 |
+
Thomas Schatz, Vijayaditya Peddinti, Francis Bach, Aren Jansen, Hynek Hermansky, and Emmanuel Dupoux. Evaluating speech features with the minimal-pair ABX task: Analysis of the classical MFC/PLP pipeline. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2013.
|
| 262 |
+
|
| 263 |
+
Man-Hung. Siu, Herb Gish, Arthur Chan, William Belfield, and Steve Lowe. Unsupervised training of an HMM-based self-organizing unit recognizer with applications to topic classification and keyword discovery. Computer Speech and Language, 28(1):210–223, 2014.
|
| 264 |
+
|
| 265 |
+
D´ıdac Sur´ıs, Adria Recasens, David Bau, David Harwath, James Glass, and Antonio Torralba. \` Learning words by drawing images. In Proc. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 266 |
+
|
| 267 |
+
Gabriel Synnaeve, Maarten Versteegh, and Emmanuel Dupoux. Learning words from images and speech. In Proc. Neural Information Processing Systems (NeurIPS), 2014.
|
| 268 |
+
|
| 269 |
+
R. Thiolliere, E. Dunbar, G. Synnaeve, M. Versteegh, and E. Dupoux. A hybrid dynamic time warping-deep neural network architecture for unsupervised acoustic modeling. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2015.
|
| 270 |
+
|
| 271 |
+
Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In Proc. Neural Information Processing Systems (NeurIPS), 2017.
|
| 272 |
+
|
| 273 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predic-¨ tive coding. CoRR, abs/1807.03748, 2018. URL http://arxiv.org/abs/1807.03748.
|
| 274 |
+
|
| 275 |
+
Balakrishnan Varadarajan, Sanjeev Khudanpur, and Emmanuel Dupoux. Unsupervised learning of acoustic sub-word units. In Proceedings of ACL-08: HLT, Short Papers, 2008.
|
| 276 |
+
|
| 277 |
+
Martin Versteegh, Roland Thiolliere, Thomas Schatz, Xuan Nga Cao, Xavier Anguera, Aren Jansen, and Emmanuel Dupoux. The zero resource speech challenge 2015. In Proc. Annual Conference of International Speech Communication Association (INTERSPEECH), 2015.
|
| 278 |
+
|
| 279 |
+
Virginia de Sa. Learning classification with unlabeled data. In Proc. Neural Information Processing Systems (NeurIPS), 1994.
|
| 280 |
+
|
| 281 |
+
Kilian Q. Weinberger and Lawrence K. Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research (JMLR), 2009.
|
| 282 |
+
|
| 283 |
+
Yaodong Zhang and James Glass. Unsupervised spoken keyword spotting via segmental dtw on gaussian posteriorgrams. In Proc. IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), 2009.
|
| 284 |
+
|
| 285 |
+
Bolei Zhou, Agata Lapedriza, Jianxiong Xiao, Antonio Torralba, and Aude Oliva. Learning deep features for scene recognition using places database. In Proc. Neural Information Processing Systems (NeurIPS), 2014.
|
| 286 |
+
|
| 287 |
+
# A APPENDIX
|
| 288 |
+
|
| 289 |
+
# A.1 VARYING THE CODEBOOK SIZE.
|
| 290 |
+
|
| 291 |
+
In Table 4, we examine the impact of varying the codebook size of model $\^ { \bullet } \cal { O } \{ 2 \} ^ { \bullet }$ from 128 through 2048. We find that the ABX score is best for 1024 codebook vectors, although the performance is quite good for all models. Unsurprisingly, models with smaller codebooks also achieve lower bitrates.
|
| 292 |
+
|
| 293 |
+
Table 4: ABX scores and bitrates for various codebook sizes on the clean ZeroSpeech19 English test set, using the $^ { \cdot \cdot } \mathcal { O } \{ 2 \} ^ { \cdot \cdot }$ model.
|
| 294 |
+
|
| 295 |
+
<table><tr><td>Codebook size</td><td>R@10</td><td>ABX</td><td>Bitrate</td><td>RLE-Bitrate</td><td>Segment-ABX</td><td>Segment-Bitrate</td></tr><tr><td>128</td><td>.772</td><td>14.25</td><td>295.65</td><td>212.27</td><td>15.42</td><td>179.38</td></tr><tr><td>256</td><td>.756</td><td>12.95</td><td>341.18</td><td>260.10</td><td>14.21</td><td>228.07</td></tr><tr><td>512</td><td>.761</td><td>12.59</td><td>363.95</td><td>288.64</td><td>13.10</td><td>259.94</td></tr><tr><td>1024</td><td>.760</td><td>11.79</td><td>390.61</td><td>317.66</td><td>12.66</td><td>289.11</td></tr><tr><td>2048</td><td>.768</td><td>12.41</td><td>360.04</td><td>283.68</td><td>13.15</td><td>254.23</td></tr></table>
|
| 296 |
+
|
| 297 |
+
A.2 THE IMPACT OF THE VQ TRAINING CURRICULUM ON THE LOCALIZATION OF WORD DETECTORS
|
| 298 |
+
|
| 299 |
+
In Section 4.2, we showed that cold-start training of the VQ3 layer caused its codebook vectors to specialize as word detectors, whereas warm-start training did not. Our subsequent experiments (Table 6) revealed that when adding a third quantization layer at the Res4 position to a model that did not learn word detectors at VQ3, the VQ4 layer did in fact learn many word detectors. This suggests implicit word recognition ability can be localized at different layers in the ResDAVEnet audio model, and exactly where it emerges depends upon the VQ training curriculum. We hypothesize that this is due in part to two factors:
|
| 300 |
+
|
| 301 |
+
Table 5: ABX scores on the ZeroSpeech 19 English test set using features derived from the output of the Res3 block of the ResDAVEnet audio branch (pre-quantization).
|
| 302 |
+
|
| 303 |
+
<table><tr><td>Model ID</td><td>Res3 ABX</td></tr><tr><td>“Q”</td><td>10.86</td></tr><tr><td>“Q→{2}”</td><td>11.61</td></tr><tr><td>“→{3}”</td><td>10.91</td></tr><tr><td>“→{2,3}”</td><td>12.68</td></tr><tr><td>“{2}”</td><td>11.45</td></tr><tr><td>“{2}→{2,3}”</td><td>11.37</td></tr><tr><td>“{3}”</td><td>32.24</td></tr><tr><td>“{3}→{2,3}”</td><td>28.33</td></tr></table>
|
| 304 |
+
|
| 305 |
+
1. In a warm-start model, whatever type of information (subword-like, word-like) the continuous model learned to encode at a particular convolutional layer (or residual block) does not change after a quantizer is appended to that layer.
|
| 306 |
+
2. In a cold-start model, each active quantization layer forms a potential bottleneck, restricting the amount of information that is able to pass through to subsequent layers.
|
| 307 |
+
|
| 308 |
+
According to this hypothesis, if word-level recognition tends to emerge at a particular layer in an unconstrained network with no quantization bottleneck, it will stay there when quantization is introduced for fine-tuning. However, when a quantization bottleneck is introduced from the very beginning of training, the gradient flowing down into the lower network layers is more constrained during the initial training epochs (when the gradient tends to be the largest). This may have the effect of steering the optimizer into a different part of the parameter space, in which word recognition occurs at a different layer than it otherwise would.
|
| 309 |
+
|
| 310 |
+
We present results from two experiments that support this view. In Table 5, we show the ABX scores of the Res3 layer prior to quantization (if present) during the course of three different training curricula resulting in a $^ { 6 6 } \{ 2 , 3 \}$ ” final model. We observe that the ABX error rate changes very little within each individual curriculum. This indicates that the initial model sets the stage for which layer learns to capture phonetic information with the highest salience, and that subsequent training steps do not tend to move this information elsewhere.
|
| 311 |
+
|
| 312 |
+
Table 6: The number of codebook vectors at a particular VQ layer that learned to be a detector for any word with an F1 score greater than 0.5.
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { r l } & \underbrace { \frac { \mathcal { H } \mathrm { ~ o u n i t r e s t ~ L y e r s } } { 1 } } _ { \begin{array} { c } { \times } \\ \\ { \times } \\ \\ { \frac { \mathcal { H } \cdot \sqrt { 2 } \cdot 3 ^ { \nu } } { \begin{array} { c } { \times \cos \left( 3 \right) ^ { \nu } } \\ { \frac { 3 } { \sqrt { 3 } } } \\ { \frac { \mathcal { H } \cdot \sqrt { 2 } \cdot 3 ^ { \nu } } { \sqrt { 3 } + \left( 2 \cdot 3 \right) ^ { \nu } } } \end{array} } } & { \begin{array} { c } { \mathrm { ~ V o r ~ L y e r e ~ \mathcal { } ~ \mathcal { H } ~ w o r d r o s ~ ( 7 1 \cdot 5 \cdot 0 . 5 ) } } \\ { \frac { 3 } { 2 0 } } \\ { \frac { 3 } { 2 0 } } \end{array} } } \\ { \geq } & { \begin{array} { c } { \frac { \mathcal { H } \cdot \sqrt { 2 } \cdot 3 ^ { \nu } } { \begin{array} { c } { \times \left( 2 \cdot 3 \right) ^ { \nu } } \\ { \frac { \nu } { \sqrt { 3 } } + \left( 2 \cdot 3 \right) ^ { \nu } } \end{array} } } & { \begin{array} { c } { \frac { 3 } { 3 } } \\ { \frac { 3 } { 2 } } \\ { \frac { \pi } { \sqrt { 3 } } } \end{array} } & { \begin{array} { c } { 1 0 } \\ { 1 0 } \end{array} } \\ { \left( \begin{array} { c } { \frac { \pi } { \sqrt { 3 } + \left( 2 \cdot 3 \right) ^ { \nu } } - \frac { 2 } { 3 } \frac { \pi } { \sqrt { 3 } } } \\ { \frac { \pi } { \sqrt { 3 } } - \frac { 2 } { 3 } \cdot 3 ^ { \nu } } \end{array} \right) } \\ { \geq } & { \begin{array} { c } { \frac { 3 } { \sqrt { 3 } + 3 - \left( 2 \cdot 3 \right) ^ { \nu } } } \\ { 3 } \end{array} } \\ { \left( \begin{array} { c } { \frac { \pi } { \sqrt { 3 } + \left( 2 \cdot 3 \right) ^ { \nu } } - \frac { 2 } { 3 } \frac { \pi } { \sqrt { 3 } } } \\ { \frac { \pi } { \sqrt { 3 } } } \end{array} \right) } \end{array} } \end{array} \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
Table 6 displays the number of word detectors learned by various VQ layers across different training curricula. Here, we claim that a codebook vector belonging to a particular VQ layer has learned to be a word detector if its F1 score for any word appearing in the test set exceeds 0.5 (as measured on the test set). There are several interesting things to note here. First, we only observe a significant number of word detectors at the VQ3 layer when that layer is trained from a cold-start. Even when adding a second VQ layer as in the ${ } ^ { * * } \{ 3 \} \stackrel { \cdot } { } \{ 2 , 3 \} ^ { \prime }$ model, these detectors remain at VQ3.
|
| 319 |
+
|
| 320 |
+
Jointly training VQ2 and VQ3 together from a cold-start results in the word detectors being divided between those layers. While this experiment demonstrates that it is possible to jointly train two quantizers at once, the $\{ 2 , 3 \}$ model learned the smallest total number of word detectors of any model. Additionally, we were unable to successfully train a cold-start $\{ 2 , 3 , 4 \}$ model; these experiments suggest that training quantizers one by one may be easier in general.
|
| 321 |
+
|
| 322 |
+
For all models beginning from a “ $\overrightarrow { Q }$ ” or “ $\{ 2 \} ^ { \ast }$ initial model, we do not observe any word detectors at either VQ2 or VQ3. However, a third quantizer at the VQ4 position in the $^ { \infty } \{ \stackrel { . . } { 2 } \} \{ 2 , 3 \} $ $\{ 2 , 3 , 4 \} ^ { \prime }$ model was able to capture words. We hypothesize that in all models not trained from a “ $\{ 3 \} ^ { \ast }$ initialization, word recognition is implicitly learned by the Res4 layer, and adding a quantizer to the output of this layer serves to make the categorical nature of those representations explicit.
|
| 323 |
+
|
| 324 |
+
# A.3 WORD DETECTOR TABLES FOR VARIOUS MODELS
|
| 325 |
+
|
| 326 |
+
In Table 7, we show a sampling of 50 word-detecting codebook entries from the VQ layer of the $^ { \bullet } \{ 3 \} \{ 2 , 3 \} ^ { \ast }$ model (many word detectors learned). Analagous results for the $\^ { * } \{ 2 \} \stackrel { \cdot } { } \{ 2 , 3 \} ^ { * }$ model (few word detectors learned) are shown in Table 8.
|
| 327 |
+
|
| 328 |
+
# A.4 UNIT VISUALIZATION FOR INDIVIDUAL CAPTION SPECTROGRAMS
|
| 329 |
+
|
| 330 |
+
To provide a better intuitive understanding of what the units learned by our models look like, in Figures 5, 6, and 7, we display speech spectrograms for several Places caption fragments. Along with each spectrogram we display the time-aligned, ground-truth, word-level text (top transcription), the inferred unit sequence for the VQ4 layer (middle transcription), and the unit sequence for the VQ3 (bottom transcription) layer. All VQ unit alignments in these figures are derived from the “ $\{ 2 \} \{ 2 , 3 \} \{ 2 , \bar { 3 } , 4 \} ^ { , , }$ model.
|
| 331 |
+
|
| 332 |
+
Table 7: Performance of the VQ3 layer from the $\{ 3 \} \{ 2 , 3 \} ^ { \prime }$ ” model when codes are treated as word detectors. Codes are ranked by the highest F1 score among the retrieved words for a given code. Word hypotheses for a given code are ranked by the F1 score.
|
| 333 |
+
|
| 334 |
+
<table><tr><td rowspan=1 colspan=12>Top Hypotheses Second Hypothesesrank codeword F1 P R occ word F1 P R oCC</td></tr><tr><td rowspan=1 colspan=12>1 918 pantry 90.67 88.29 93.18 41 spice 3.96 2.20 20.00 1</td></tr><tr><td rowspan=1 colspan=2>2 596 kitchen</td><td rowspan=1 colspan=1>90.08</td><td rowspan=1 colspan=1>91.59</td><td rowspan=1 colspan=8>88.63 304 countertop 1.64 0.84 29.63 8</td></tr><tr><td rowspan=1 colspan=2>3 88 classroom</td><td rowspan=1 colspan=1>88.97</td><td rowspan=1 colspan=1>89.05</td><td rowspan=1 colspan=8>88.89 72 classrooms 5.01 2.57 100.00 2</td></tr><tr><td rowspan=1 colspan=2>4 58 baseball</td><td rowspan=1 colspan=1>88.71</td><td rowspan=1 colspan=1>88.63</td><td rowspan=1 colspan=8>88.78 182 player 3.01 1.65 17.11 13</td></tr><tr><td rowspan=1 colspan=2>5 706 background</td><td rowspan=1 colspan=1>87.86</td><td rowspan=1 colspan=1>91.93</td><td rowspan=1 colspan=8>84.14 838 ground 0.58 0.39 1.18 4</td></tr><tr><td rowspan=1 colspan=2>6 736 museum</td><td rowspan=1 colspan=1>87.35</td><td rowspan=1 colspan=1>93.44</td><td rowspan=1 colspan=8>82.00 41 museums 5.47 2.81 100.00 1</td></tr><tr><td rowspan=1 colspan=2>7 274 subway</td><td rowspan=1 colspan=1>87.26</td><td rowspan=1 colspan=1>88.34</td><td rowspan=1 colspan=8>86.21 75 assembly 5.32 2.85 40.00 4</td></tr><tr><td rowspan=1 colspan=2>8 116 construction</td><td rowspan=1 colspan=1>87.07</td><td rowspan=1 colspan=1>89.78</td><td rowspan=1 colspan=8>84.52 131 constructed 2.43 1.25 38.46 5</td></tr><tr><td rowspan=1 colspan=2>9 892 walking</td><td rowspan=1 colspan=1>87.06</td><td rowspan=1 colspan=1>87.57</td><td rowspan=1 colspan=8>86.55 412 walk 7.07 3.97 31.94 23</td></tr><tr><td rowspan=1 colspan=2>10 557 concrete</td><td rowspan=1 colspan=1>86.53</td><td rowspan=1 colspan=1>90.98</td><td rowspan=1 colspan=2>82.50</td><td rowspan=1 colspan=1>99</td><td rowspan=1 colspan=3>concur 1.21 0.61</td><td rowspan=1 colspan=2>100.00 1</td></tr><tr><td rowspan=1 colspan=2>11 48 desert</td><td rowspan=1 colspan=1>86.50</td><td rowspan=1 colspan=1>90.30</td><td rowspan=1 colspan=2>83.01</td><td rowspan=1 colspan=1>171</td><td rowspan=1 colspan=3>dozen 2.76 1.49</td><td rowspan=1 colspan=2>18.18 2</td></tr><tr><td rowspan=1 colspan=2>12 534 background</td><td rowspan=1 colspan=1>86.18</td><td rowspan=1 colspan=1>81.95</td><td rowspan=1 colspan=2>90.86</td><td rowspan=1 colspan=1>905</td><td rowspan=1 colspan=1>back</td><td rowspan=1 colspan=1>8.95</td><td rowspan=1 colspan=2>5.83 19.34</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=2>13 44 patio</td><td rowspan=1 colspan=1>85.82</td><td rowspan=1 colspan=1>90.87</td><td rowspan=1 colspan=2>81.29</td><td rowspan=1 colspan=1>113</td><td rowspan=1 colspan=1>patios</td><td rowspan=1 colspan=1>1.56</td><td rowspan=1 colspan=1>0.79</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=2>14 625 background</td><td rowspan=1 colspan=1>85.17</td><td rowspan=1 colspan=1>92.92</td><td rowspan=1 colspan=3>78.61 783</td><td rowspan=1 colspan=2>back 1.63</td><td rowspan=1 colspan=1>1.01</td><td rowspan=1 colspan=2>4.23 14</td></tr><tr><td rowspan=1 colspan=2>15 732 closet</td><td rowspan=1 colspan=1>84.92</td><td rowspan=1 colspan=1>94.64</td><td rowspan=1 colspan=3>77.01 67</td><td rowspan=1 colspan=2>closets 4.96</td><td rowspan=1 colspan=1>2.68</td><td rowspan=1 colspan=2>33.33</td></tr><tr><td rowspan=1 colspan=2>16 30 waterfall</td><td rowspan=1 colspan=1>84.90</td><td rowspan=1 colspan=1>75.73</td><td rowspan=1 colspan=3>96.61 57</td><td rowspan=1 colspan=2>waterfalls 14.26</td><td rowspan=1 colspan=1>7.68</td><td rowspan=1 colspan=2>100.00 7</td></tr><tr><td rowspan=1 colspan=2>17 388 courtyard</td><td rowspan=1 colspan=1>84.89</td><td rowspan=1 colspan=1>92.16</td><td rowspan=1 colspan=3>78.69 48</td><td rowspan=1 colspan=2> graveyard 5.50</td><td rowspan=1 colspan=1>3.24</td><td rowspan=1 colspan=2>18.18 4</td></tr><tr><td rowspan=1 colspan=2>18 560 hospital</td><td rowspan=1 colspan=1>84.70</td><td rowspan=1 colspan=1>91.48</td><td rowspan=1 colspan=3>78.85 41</td><td rowspan=1 colspan=2>horses 1.55</td><td rowspan=1 colspan=1>1.92</td><td rowspan=1 colspan=2>1.30 1</td></tr><tr><td rowspan=1 colspan=2>19 18 driveway</td><td rowspan=1 colspan=1>84.56</td><td rowspan=1 colspan=1>90.10</td><td rowspan=1 colspan=3>79.66 47</td><td rowspan=1 colspan=1>driveways</td><td rowspan=1 colspan=1>3.52</td><td rowspan=1 colspan=1>1.82</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=2>20 598 palm</td><td rowspan=1 colspan=1>84.39</td><td rowspan=1 colspan=1>82.08</td><td rowspan=1 colspan=3>86.84 99</td><td rowspan=1 colspan=1>plum</td><td rowspan=1 colspan=1>1.57</td><td rowspan=1 colspan=1>0.79</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=2>21 85 yellow</td><td rowspan=1 colspan=1>84.30</td><td rowspan=1 colspan=1>83.93</td><td rowspan=1 colspan=3>84.66 574</td><td rowspan=1 colspan=1>yellowish</td><td rowspan=1 colspan=1>1.98</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>7</td></tr><tr><td rowspan=1 colspan=2>22 584 playground</td><td rowspan=1 colspan=1>84.18</td><td rowspan=1 colspan=1>77.37</td><td rowspan=1 colspan=1>92.31</td><td rowspan=1 colspan=2>36</td><td rowspan=1 colspan=1>play</td><td rowspan=1 colspan=1>6.32</td><td rowspan=1 colspan=1>4.75</td><td rowspan=1 colspan=1>9.43</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=2>23 162 stadium</td><td rowspan=1 colspan=1>83.82</td><td rowspan=1 colspan=1>84.50</td><td rowspan=1 colspan=1>83.15</td><td rowspan=1 colspan=2>74</td><td rowspan=1 colspan=1>boardwalk</td><td rowspan=1 colspan=1>9.12</td><td rowspan=1 colspan=1>4.91</td><td rowspan=1 colspan=1>63.16</td><td rowspan=1 colspan=1>12</td></tr><tr><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>769 bamboo</td><td rowspan=1 colspan=1>83.79</td><td rowspan=1 colspan=1>93.68</td><td rowspan=1 colspan=1>75.79</td><td rowspan=1 colspan=2>72</td><td rowspan=1 colspan=1>baboons</td><td rowspan=1 colspan=1>2.03</td><td rowspan=1 colspan=1>1.03</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>193 small</td><td rowspan=1 colspan=1>83.55</td><td rowspan=1 colspan=1>90.46</td><td rowspan=1 colspan=1>77.63</td><td rowspan=1 colspan=2>791</td><td rowspan=1 colspan=1>smaller</td><td rowspan=1 colspan=1>2.15</td><td rowspan=1 colspan=1>1.10</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>15</td></tr><tr><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>412 podium</td><td rowspan=1 colspan=1>83.53</td><td rowspan=1 colspan=1>76.73</td><td rowspan=1 colspan=1>91.67</td><td rowspan=1 colspan=2>22</td><td rowspan=1 colspan=1>auditorium</td><td rowspan=1 colspan=1>8.69</td><td rowspan=1 colspan=1>5.82</td><td rowspan=1 colspan=1>17.14</td><td rowspan=1 colspan=1>6</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>108 highway</td><td rowspan=1 colspan=1>83.52</td><td rowspan=1 colspan=1>79.58</td><td rowspan=1 colspan=1>87.88</td><td rowspan=1 colspan=2>58</td><td rowspan=1 colspan=1>highlights</td><td rowspan=1 colspan=1>5.44</td><td rowspan=1 colspan=1>2.87</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>394 church</td><td rowspan=1 colspan=1>83.34</td><td rowspan=1 colspan=1>75.98</td><td rowspan=1 colspan=1>92.28</td><td rowspan=1 colspan=2>227</td><td rowspan=1 colspan=1>religious</td><td rowspan=1 colspan=1>6.34</td><td rowspan=1 colspan=1>3.45</td><td rowspan=1 colspan=1>39.39</td><td rowspan=1 colspan=1>13</td></tr><tr><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>661 distance</td><td rowspan=1 colspan=1>83.32</td><td rowspan=1 colspan=1>78.96</td><td rowspan=1 colspan=1>88.19</td><td rowspan=1 colspan=2>351</td><td rowspan=1 colspan=1>lounge</td><td rowspan=1 colspan=1>1.63</td><td rowspan=1 colspan=1>0.86</td><td rowspan=1 colspan=1>14.71</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>708 distance</td><td rowspan=1 colspan=1>82.97</td><td rowspan=1 colspan=1>96.32</td><td rowspan=1 colspan=1>72.86</td><td rowspan=1 colspan=2>290</td><td rowspan=1 colspan=1>farmland</td><td rowspan=1 colspan=1>1.35</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>55.56</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>31</td><td rowspan=1 colspan=1>14 gallery</td><td rowspan=1 colspan=1>82.97</td><td rowspan=1 colspan=1>85.08</td><td rowspan=1 colspan=1>80.95</td><td rowspan=1 colspan=2>17</td><td rowspan=1 colspan=1>art</td><td rowspan=1 colspan=1>11.39</td><td rowspan=1 colspan=1>12.15</td><td rowspan=1 colspan=1>10.71</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>996 large</td><td rowspan=1 colspan=1>82.95</td><td rowspan=1 colspan=1>87.05</td><td rowspan=1 colspan=1>79.21</td><td></td><td rowspan=1 colspan=1>1753</td><td rowspan=1 colspan=1>very</td><td rowspan=1 colspan=1>2.83</td><td rowspan=1 colspan=1>1.72</td><td rowspan=1 colspan=1>8.01</td><td rowspan=1 colspan=1>94</td></tr><tr><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>944 cathedral</td><td rowspan=1 colspan=1>82.78</td><td rowspan=1 colspan=1>79.22</td><td rowspan=1 colspan=1>86.67</td><td></td><td rowspan=1 colspan=1>52</td><td rowspan=1 colspan=1>feed</td><td rowspan=1 colspan=1>2.74</td><td rowspan=1 colspan=1>1.41</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=2>34 122 purple</td><td rowspan=1 colspan=1>82.63</td><td rowspan=1 colspan=1>91.98</td><td rowspan=1 colspan=1>75.00</td><td rowspan=1 colspan=2>138</td><td rowspan=1 colspan=1>proportion</td><td rowspan=1 colspan=1>1.66</td><td rowspan=1 colspan=1>0.84</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=2>35 630 trees</td><td rowspan=1 colspan=1>82.52</td><td rowspan=1 colspan=1>80.39</td><td rowspan=1 colspan=1>84.77</td><td rowspan=1 colspan=2>1258</td><td rowspan=1 colspan=1>tree</td><td rowspan=1 colspan=1>15.48</td><td rowspan=1 colspan=1>9.47</td><td rowspan=1 colspan=1>42.33</td><td rowspan=1 colspan=1>171</td></tr><tr><td rowspan=1 colspan=2>186 375 boy</td><td rowspan=1 colspan=1>69.90</td><td rowspan=1 colspan=1>65.45</td><td rowspan=1 colspan=1>75.00</td><td rowspan=1 colspan=2>93</td><td rowspan=1 colspan=1>boys</td><td rowspan=1 colspan=1>20.87</td><td rowspan=1 colspan=1>13.09</td><td rowspan=1 colspan=1>51.43</td><td rowspan=1 colspan=1>18</td></tr><tr><td rowspan=1 colspan=2>187 634 ground</td><td rowspan=1 colspan=1>69.78</td><td rowspan=1 colspan=1>73.92</td><td rowspan=1 colspan=1>66.08</td><td rowspan=1 colspan=2>224</td><td rowspan=1 colspan=1>playground</td><td rowspan=1 colspan=1>7.45</td><td rowspan=1 colspan=1>3.94</td><td rowspan=1 colspan=1>69.23</td><td rowspan=1 colspan=1>27</td></tr><tr><td rowspan=1 colspan=2>188 69 courtyard</td><td rowspan=1 colspan=1>69.55</td><td rowspan=1 colspan=1>57.98</td><td rowspan=1 colspan=1>86.89</td><td rowspan=1 colspan=2>53</td><td rowspan=1 colspan=1>plaza</td><td rowspan=1 colspan=1>28.89</td><td rowspan=1 colspan=1>19.87</td><td rowspan=1 colspan=1>52.94</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=2>189 281 wooden</td><td rowspan=1 colspan=1>69.50</td><td rowspan=1 colspan=1>57.89</td><td rowspan=1 colspan=1>86.92</td><td rowspan=1 colspan=2>525</td><td rowspan=1 colspan=1>wood</td><td rowspan=1 colspan=1>23.55</td><td rowspan=1 colspan=1>14.52</td><td rowspan=1 colspan=1>62.20</td><td rowspan=1 colspan=1>153</td></tr><tr><td rowspan=1 colspan=2>190 812 lighthouse</td><td rowspan=1 colspan=1>69.41</td><td rowspan=1 colspan=1>59.74</td><td rowspan=1 colspan=1>82.81</td><td rowspan=1 colspan=2>53</td><td rowspan=1 colspan=1>lighthouses</td><td rowspan=1 colspan=1>11.69</td><td rowspan=1 colspan=1>6.21</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=2>191 225 house</td><td rowspan=1 colspan=1>69.13</td><td rowspan=1 colspan=1>61.59</td><td rowspan=1 colspan=1>78.78</td><td rowspan=1 colspan=2>516</td><td rowspan=1 colspan=1>houses</td><td rowspan=1 colspan=1>18.29</td><td rowspan=1 colspan=1>10.31</td><td rowspan=1 colspan=1>80.73</td><td rowspan=1 colspan=1>88</td></tr><tr><td rowspan=1 colspan=2>192 705 dark</td><td rowspan=1 colspan=1>69.11</td><td rowspan=1 colspan=1>68.57</td><td rowspan=1 colspan=1>69.66</td><td rowspan=1 colspan=2>186</td><td rowspan=1 colspan=1>darker</td><td rowspan=1 colspan=1>3.05</td><td rowspan=1 colspan=1>1.56</td><td rowspan=1 colspan=1>75.00</td><td rowspan=1 colspan=1>6</td></tr><tr><td rowspan=1 colspan=2>193 980 building</td><td rowspan=1 colspan=1>69.10</td><td rowspan=1 colspan=1>77.48</td><td rowspan=1 colspan=1>62.35</td><td rowspan=1 colspan=2>1161</td><td rowspan=1 colspan=1>buildings</td><td rowspan=1 colspan=1>25.72</td><td rowspan=1 colspan=1>15.71</td><td rowspan=1 colspan=1>70.78</td><td rowspan=1 colspan=1>281</td></tr><tr><td rowspan=1 colspan=2>194 844 grass</td><td rowspan=1 colspan=1>69.01</td><td rowspan=1 colspan=1>61.85</td><td rowspan=1 colspan=1>78.04</td><td rowspan=1 colspan=2>455</td><td rowspan=1 colspan=1>grassy</td><td rowspan=1 colspan=1>21.70</td><td rowspan=1 colspan=1>12.42</td><td rowspan=1 colspan=1>85.83</td><td rowspan=1 colspan=1>109</td></tr><tr><td rowspan=1 colspan=2>195 446 lake</td><td rowspan=1 colspan=1>68.69</td><td rowspan=1 colspan=1>78.63</td><td rowspan=1 colspan=1>60.98</td><td rowspan=1 colspan=2>125</td><td rowspan=1 colspan=1>late</td><td rowspan=1 colspan=1>5.02</td><td rowspan=1 colspan=2>2.90 18.52</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=2>196 182 trash</td><td rowspan=1 colspan=1>68.64</td><td rowspan=1 colspan=1>66.79</td><td rowspan=1 colspan=1>70.59</td><td rowspan=1 colspan=2>48</td><td rowspan=1 colspan=1>boulders</td><td rowspan=1 colspan=1>10.16</td><td rowspan=1 colspan=1>6.27</td><td rowspan=1 colspan=1>26.67</td><td rowspan=1 colspan=1>4</td></tr><tr><td rowspan=1 colspan=2>197 437 photograph</td><td rowspan=1 colspan=1>68.63</td><td rowspan=1 colspan=1>59.06</td><td rowspan=1 colspan=1>81.89</td><td rowspan=1 colspan=2>588</td><td rowspan=1 colspan=1>photographs</td><td rowspan=1 colspan=1>30.56</td><td rowspan=1 colspan=1>18.46</td><td rowspan=1 colspan=1>88.73</td><td rowspan=1 colspan=1>181</td></tr><tr><td rowspan=1 colspan=2>198 237 lobby</td><td rowspan=1 colspan=1>68.43</td><td rowspan=1 colspan=1>56.77</td><td rowspan=1 colspan=1>86.11</td><td rowspan=1 colspan=2>31</td><td rowspan=1 colspan=1>waiting</td><td rowspan=1 colspan=1>9.93</td><td rowspan=1 colspan=1>7.86</td><td rowspan=1 colspan=1>13.46</td><td rowspan=1 colspan=1>14</td></tr><tr><td rowspan=1 colspan=2>199 829 shirt</td><td rowspan=1 colspan=1>68.41</td><td rowspan=1 colspan=1>71.49</td><td rowspan=1 colspan=1>65.58</td><td rowspan=1 colspan=2>322</td><td rowspan=1 colspan=1>shirts</td><td rowspan=1 colspan=1>18.28</td><td rowspan=1 colspan=3>10.37 76.79 43</td></tr><tr><td rowspan=1 colspan=3>200 59 grass 68.31</td><td rowspan=1 colspan=1>56.53</td><td rowspan=1 colspan=8>86.28 503 grassy 15.30 8.67 65.35 83</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 8: Performance of the VQ3 layer from the $\{ 2 \} \{ 2 , 3 \} ^ { \prime }$ model when codes are treated as word detectors. Codes are ranked by the highest F1 score among the retrieved words for a given code. Word hypotheses for a given code are ranked by the F1 score.
|
| 337 |
+
|
| 338 |
+
<table><tr><td>rank</td><td></td><td colspan="5">Top Hypotheses</td><td colspan="5">Second Hypotheses</td></tr><tr><td></td><td>code</td><td>word</td><td>F1</td><td>P</td><td>R</td><td>occ</td><td>word</td><td>F1</td><td>P</td><td>R</td><td>occ</td></tr><tr><td>1</td><td>924</td><td>people</td><td>76.71</td><td>67.49</td><td>88.85</td><td>1665</td><td>computer</td><td>2.17</td><td>1.12</td><td>40.40</td><td>40</td></tr><tr><td>2</td><td>749</td><td>white</td><td>76.47</td><td>66.92</td><td>89.21</td><td>2265</td><td>one</td><td>4.15</td><td>2.50</td><td>12.14</td><td>134</td></tr><tr><td>3</td><td>530</td><td>building</td><td>75.47</td><td>64.84</td><td>90.28</td><td>1681</td><td>buildings</td><td>23.93</td><td>13.81</td><td>89.67</td><td>356</td></tr><tr><td>4</td><td>505</td><td>blue</td><td>59.12</td><td>46.90</td><td>79.96</td><td>1093</td><td>pool</td><td>10.74</td><td>5.89</td><td>60.80</td><td>152</td></tr><tr><td>5</td><td>581</td><td>snow</td><td>57.61</td><td>41.77</td><td>92.83</td><td>466</td><td>snowy</td><td>16.63</td><td>9.12</td><td>94.50</td><td>103</td></tr><tr><td>6</td><td>778</td><td>building</td><td>52.10</td><td>36.71</td><td>89.69</td><td>1670</td><td>buildings</td><td>14.30</td><td>7.78</td><td>88.16</td><td>350</td></tr><tr><td>7</td><td>144</td><td>with</td><td>49.12</td><td>41.58</td><td>59.99</td><td>3386</td><td>wooden</td><td>6.32</td><td>3.34</td><td>60.60</td><td>366</td></tr><tr><td>8</td><td>299</td><td>small</td><td>47.83</td><td>32.78</td><td>88.42</td><td>901</td><td>snow</td><td>30.55</td><td>18.35</td><td>91.24</td><td>458</td></tr><tr><td>9</td><td>550</td><td>large</td><td>45.13</td><td>30.50</td><td>86.76</td><td>1920</td><td>car</td><td>8.57</td><td>4.52</td><td>82.13</td><td>216</td></tr><tr><td>10</td><td>76</td><td>trees</td><td>44.82</td><td>29.76</td><td>90.77</td><td>1347</td><td>tree</td><td>15.21</td><td>8.31</td><td>89.36</td><td>361</td></tr><tr><td>11</td><td>831</td><td>water</td><td>41.84</td><td>27.50</td><td>87.43</td><td>1210</td><td>wall</td><td>17.57</td><td>9.87</td><td>79.97</td><td>491</td></tr><tr><td>12</td><td>1015</td><td>large</td><td>39.59</td><td>26.06</td><td>82.29</td><td>1821</td><td>cars</td><td>6.58</td><td>3.42</td><td>84.21</td><td>224</td></tr><tr><td>13</td><td>80</td><td>red</td><td>39.15</td><td>26.13</td><td>78.05</td><td>992</td><td>bed</td><td>9.14</td><td>4.91</td><td>66.67</td><td>168</td></tr><tr><td>14</td><td>719</td><td>woman</td><td>38.71</td><td>24.95</td><td>86.31</td><td>687</td><td>women</td><td>7.75</td><td>4.09</td><td>72.41</td><td>126</td></tr><tr><td>15</td><td>614</td><td>people</td><td>37.71</td><td>25.10</td><td>75.83</td><td>1421</td><td>table</td><td>22.10</td><td>12.75</td><td>82.93</td><td>656</td></tr><tr><td>16</td><td>816</td><td>water</td><td>37.71</td><td>24.25</td><td>84.75</td><td>1173</td><td>river</td><td>5.72</td><td>2.97</td><td>80.22</td><td>215</td></tr><tr><td>17</td><td>457</td><td>sky</td><td>35.71</td><td>23.20</td><td>77.47</td><td>540</td><td>skies</td><td>11.81</td><td>6.33</td><td>88.12</td><td>141</td></tr><tr><td>18</td><td>480</td><td>has</td><td>34.88</td><td>25.01</td><td>57.64</td><td>1204</td><td>house</td><td>9.88</td><td>5.48</td><td>50.38</td><td>330</td></tr><tr><td>19</td><td>245</td><td>yellow</td><td>34.14</td><td>21.17</td><td>88.05</td><td>597</td><td>flowers</td><td>13.44</td><td>7.27</td><td>89.43</td><td>237</td></tr><tr><td>20</td><td>968</td><td>picture</td><td>34.11</td><td>22.32</td><td>72.33</td><td>1686</td><td>pictures</td><td>16.79</td><td>9.38</td><td>79.77</td><td>698</td></tr><tr><td>21</td><td>985</td><td>trees</td><td>33.88</td><td>22.04</td><td>73.25</td><td>1087</td><td>tree</td><td>10.96</td><td>5.93</td><td>72.52</td><td>293</td></tr><tr><td>22</td><td>536</td><td>man</td><td>33.53</td><td>20.71</td><td>88.06</td><td>1128</td><td> standing</td><td>9.06</td><td>4.86</td><td>66.17</td><td>532</td></tr><tr><td>23</td><td>0</td><td>black</td><td>33.49</td><td>20.81</td><td>85.77</td><td>1163</td><td>background</td><td>21.15</td><td>12.28</td><td>76.20</td><td>759</td></tr><tr><td>24</td><td>815</td><td>with</td><td>33.21</td><td>22.76</td><td>61.36</td><td>3463</td><td>white</td><td>8.60</td><td>4.85</td><td>38.05</td><td>966</td></tr><tr><td>25</td><td>293</td><td>large</td><td>33.13</td><td>23.80</td><td>54.50</td><td>1206</td><td>bridge</td><td>19.09</td><td>10.78</td><td>83.18</td><td>371</td></tr><tr><td>26</td><td>870</td><td>trees</td><td>32.87</td><td>20.79</td><td>78.44</td><td>1164</td><td>train</td><td>12.97</td><td>7.00</td><td>88.03</td><td></td></tr><tr><td>27</td><td>153</td><td>yellow</td><td>32.42</td><td>19.94</td><td>86.73</td><td>588</td><td></td><td>15.39</td><td>9.47</td><td>40.92</td><td>353</td></tr><tr><td>28</td><td>243</td><td>front</td><td></td><td>20.97</td><td>68.69</td><td>895</td><td>area from</td><td>14.34</td><td></td><td></td><td>354</td></tr><tr><td>29</td><td></td><td>black</td><td>32.13 31.40</td><td></td><td></td><td></td><td></td><td></td><td>8.51</td><td>45.49</td><td>358</td></tr><tr><td></td><td>538</td><td>small</td><td></td><td>19.64</td><td>78.24</td><td>1061</td><td>glass</td><td>8.28</td><td>4.36</td><td>82.90</td><td>223</td></tr><tr><td>30</td><td>526</td><td></td><td>31.34</td><td>19.08</td><td>87.83</td><td>895</td><td>iarge</td><td>5.91</td><td>4.04</td><td>11.03</td><td>244</td></tr><tr><td>31</td><td>395</td><td>picture</td><td>31.32</td><td>20.90</td><td>62.46</td><td>1456</td><td>pictures</td><td>13.98</td><td>7.80</td><td>67.54</td><td>591</td></tr><tr><td>32</td><td>133</td><td>white</td><td>29.82</td><td>18.98</td><td>69.55</td><td>1766</td><td>black</td><td>16.34</td><td>9.32 5.89</td><td>66.37 31.29</td><td>900 388</td></tr><tr><td>33 34</td><td>715 39</td><td>white picture</td><td>29.45 29.37</td><td>19.73 22.51</td><td>58.05 42.26</td><td>1474 985</td><td>like like</td><td>9.92 9.82</td></table>
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 5: Two different captions containing the phrase “many people.” In both cases, the VQ4 layer infers the same unit sequence (872, 360, 712, middle transcription) beneath the phrase. The VQ3 units are somewhat noisier, but contain the common subsequence (956, 265, 80, 401, 262, 762, 246, 774, 828, 386, bottom transcription).
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 6: Two different captions containing word “train”. In both cases, the VQ4 layer infers the same unit sequence (680, 248, top transcription) surrounding the word “train”. The VQ3 alignments contain the same common subsequence (358, 306, 908, 564, 950, 770, bottom transcription). Notice that the same (358, 306) VQ3 unit sequence is aligned to the $/ \mathrm { { t r } / \Omega }$ phone cluster at the beginning of both instances of the word “train,” as well as the $/ \mathrm { { t r } / \Omega }$ at the beginning of both instances of “tree” in Figure 7. Unit 358 is also found covering the $/ \mathrm { { t r } / \Omega }$ at the beginning of the word “tracks” in the topmost spectrogram (although unit 306 is absent in this case).
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 7: Two different captions containing word “trees”. In both cases, the VQ4 layer infers the same unit sequence (8, 412, 50, top transcription) surrounding the word “trees”. The VQ3 alignments contain the same common subsequence (358, 306, 648, 677, 730, bottom transcription). Notice that the (358, 306) VQ3 unit sequence is aligned to the $/ \mathrm { { t r } / \Omega }$ phone cluster at the beginning of both instances of “trees,” and this same unit sequence is inferred for the $/ \mathrm { { t r } / \Omega }$ phone sequence in both instances of “train” in Figure 6.
|
md/train/BJeOioA9Y7/BJeOioA9Y7.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# KNOWLEDGE FLOW: IMPROVE UPON YOUR TEACH-ERS
|
| 2 |
+
|
| 3 |
+
Iou-Jen Liu, Jian Peng, Alexander G. Schwing University of Illinois at Urbana-Champaign {iliu3, jpeng, aschwing}@illinois.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
A zoo of deep nets is available these days for almost any given task, and it is increasingly unclear which net to start with when addressing a new task, or which net to use as an initialization for fine-tuning a new model. To address this issue, in this paper, we develop knowledge flow which moves ‘knowledge’ from multiple deep nets, referred to as teachers, to a new deep net model, called the student. The structure of the teachers and the student can differ arbitrarily and they can be trained on entirely different tasks with different output spaces too. Upon training with knowledge flow the student is independent of the teachers. We demonstrate our approach on a variety of supervised and reinforcement learning tasks, outperforming fine-tuning and other ‘knowledge exchange’ methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Research communities have amassed a sizable number of deep net architectures for different tasks, and new ones are added almost daily. Some of those architectures are trained from scratch while others are fine-tuned, i.e., before training, their weights are initialized using a structurally similar deep net which was trained on different data.
|
| 12 |
+
|
| 13 |
+
Beyond fine-tuning, particularly in reinforcement learning, teachers have also been considered in one way or another by Rusu et al. (2016b); Fernando et al. (2017); Wang et al. (2017); Li & Hoiem (2016); Bengio et al. (2009); Patel et al. (2015); Chen & Liu (2016); Teh et al. (2017); Parisotto et al. (2016). For instance, progressive neural net (Rusu et al., 2016b) keeps multiple teachers during both training and inference, and learns to extract useful features from the teachers for a new target task. PathNet (Fernando et al., 2017) uses genetic algorithms to choose pathways from a giant network for learning new tasks. ‘Growing a Brain’ (Wang et al., 2017) fine-tunes a neural network while growing the network’s capacity (wider or deeper layers). Actor-mimic (Parisotto et al., 2016) pre-trains a big model on multiple source tasks, then the big model is used as a weight initialization for a new model which will be trained on a new target task. Knowledge distillation (Hinton et al., 2015) distills knowledge from a large ensemble of models to a smaller student model.
|
| 14 |
+
|
| 15 |
+
However, all the aforementioned techniques have limitations. For example, progressive neural net models (Rusu et al., 2016b) grow with the number of teachers. This large number of parameters limits the number of teachers a progressive neural net can handle, and largely increases the training and testing time. In PathNet (Fernando et al., 2017), searching over a big network for pathways is computationally intensive. For fine-tuning based methods such as ‘Growing a Brain’ (Wang et al., 2017) and actor-mimic (Parisotto et al., 2016), only one pretrained model can be used at a time. Hence, their performance heavily relies on the chosen pretrained model.
|
| 16 |
+
|
| 17 |
+
To address these shortcomings, we develop knowledge flow which moves ‘knowledge’ of multiple teachers when training a student. Irrespective of how many teachers we use, the student is guaranteed to become independent at the final stage of training and the size of the resulting student net remains constant. In addition, our framework makes no restrictions on the deep net size of the teacher and student, which provides flexibility in choosing teacher models. Importantly, our approach is applicable to a variety of tasks from reinforcement learning to fully-supervised training.
|
| 18 |
+
|
| 19 |
+
We evaluate knowledge flow on a variety of tasks from reinforcement learning to fully-supervised learning. In particular, we follow Rusu et al. (2016b); Fernando et al. (2017) and compare on the same
|
| 20 |
+
|
| 21 |
+
Atari games. In addition, we also observed significant top-1 error rate improvements on supervised learning datasets, i.e., CIFAR-10, and CIFAR-100.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
Knowledge flow is applicable to a variety of settings from supervised learning to reinforcement learning, which we briefly review to introduce notation.
|
| 26 |
+
|
| 27 |
+
Supervised Learning recovers the parameters $\theta$ of a mapping $f _ { \theta } : \mathcal { X } \mathcal { Y }$ from data space $\mathcal { X }$ to output space $\mathcal { V }$ . To this end, a dataset $D = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ containing $n$ pairs $( x _ { i } , y _ { i } )$ (assumed to be sampled i.i.d.) is used, where $x _ { i } \in { \mathcal { X } }$ and $y _ { i } \in \mathcal { V }$ . Given this dataset, the parameters $\theta$ of the mapping $f _ { \theta }$ are learned by minimizing a loss function $\ell _ { ( x , y ) } ( \theta )$ composed of a regularization term $R ( \theta )$ and an empirical risk $\ell ( y , f _ { \boldsymbol { \theta } } ( x ) )$ which compares groundtruth label $y$ and prediction $f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ The parameters $\theta$ are obtained by optimizing the following program:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { ( x , y ) \sim D } [ \ell _ { ( x , y ) } ( \theta ) ] : = \mathbb { E } _ { ( x , y ) \sim D } [ \ell ( y , f _ { \theta } ( x ) ) ] + R ( \theta ) .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Hereby, the mapping $f _ { \theta }$ is obtained by maximizing the logits or a corresponding probability distribution $\hat { f } _ { \boldsymbol { \theta } } ( y | \boldsymbol { x } )$ , i.e., $f _ { \theta } = \arg \operatorname* { m a x } _ { y \in \mathcal { V } } \hat { f } _ { \theta } ( y | x )$ . Here and below let the hat $( ^ { 6 } \hat { \cdot } \vec { \cdot } )$ indicate probability distributions over appropriate domains.
|
| 34 |
+
|
| 35 |
+
Reinforcement Learning considers an agent interacting with an environment according to a policy
|
| 36 |
+
$\pi _ { \theta _ { \pi } } : \mathcal { X } \mathcal { A }$ which maps a state $x _ { t } \in \mathcal X$ to an action $a _ { t } \in \mathcal A$ at time $t$ . The policy depends on
|
| 37 |
+
the parameters a scalar rewardthe discount fa $\theta _ { \pi }$ . After performing action . The discounted return ar. The expected future rew $a _ { t }$ , theime d w agent observeis defined as n observing s $x _ { t + 1 }$ and rece, where wing p esiscy $r _ { t }$ $t$ $\begin{array} { r } { R _ { t } = \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } r _ { t + k } } \end{array}$ $\gamma$ $x$
|
| 38 |
+
$\pi _ { \theta _ { \pi } }$ is defined as $V ^ { \pi _ { \theta _ { \pi } } } ( x _ { t } ) = \mathbb { E } _ { \tau \sim \pi _ { \theta _ { \pi } } } [ R _ { t } | x _ { t } ]$ , where $\tau = \{ ( x _ { t } , a _ { t } , r _ { t } ) , ( x _ { t + 1 } , a _ { t + 1 } , r _ { t + 1 } ) , \ldots \}$ is a
|
| 39 |
+
trajectory generated by following $\pi _ { \theta _ { \pi } }$ from state $x _ { t }$ .
|
| 40 |
+
|
| 41 |
+
The goal of reinforcement learning is to find a policy that maximizes the expected future reward from each state $x _ { t }$ . Without loss of generality, in this paper, we follow the asynchronous advantage actor-critic (A3C) formulation (Mnih et al., 2016). In A3C, the policy mapping $\pi _ { \boldsymbol { \theta } _ { \pi } } ( x ) = \arg \operatorname* { m a x } _ { a \in \mathcal { A } } \hat { \pi } _ { \boldsymbol { \theta } _ { \pi } } ( a \vert x )$ is obtained from a probability distribution over states, where ${ \hat { \pi } } _ { \boldsymbol { \theta } _ { \pi } } ( a | \boldsymbol { x } )$ is modeled by a deep net with parameters $\theta _ { \pi }$ . The value function is also approximated by a deep net $V _ { \theta _ { v } } ( x )$ , having parameters $\theta _ { v }$ .
|
| 42 |
+
|
| 43 |
+
To optimize the policy parameters $\theta _ { \pi }$ given a state $x _ { t }$ , a loss function based on a scaled negative log-likelihood and a negative entropy regularizer is common:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\ell _ { \pi } ^ { \tau } ( \theta _ { \pi } ) = \frac { 1 } { | \tau | } \sum _ { t \in \tau } [ - \log \hat { \pi } _ { \theta _ { \pi } } ( a _ { t } | x _ { t } ) ( R _ { t } - V _ { \theta _ { v } } ( x _ { t } ) ) - \beta H ( \hat { \pi } _ { \theta _ { \pi } } ( \cdot | x _ { t } ) ) ] .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Herestate , $\begin{array} { r } { R _ { t } = \sum _ { i = 0 } ^ { k - 1 } \gamma ^ { i } r _ { t + i } + \gamma ^ { k } V _ { \theta _ { v } } ( x _ { t + k } ) } \end{array}$ isry e empirical generated $k$ -step return following ained when s. The scalar $x _ { t }$ $| \tau |$ $\tau$ $\pi _ { \theta _ { \pi } }$ $\beta \geq 0$ a user-specified constant, and $H ( \hat { \pi } _ { \boldsymbol { \theta } _ { \pi } } ( \cdot | \boldsymbol { x } _ { t } ) )$ is the entropy function, which encourages exploration by favoring a uniform probability distribution ${ \hat { \pi } } _ { \theta _ { \pi } } ( a | x )$ . To optimize the value function $V _ { \theta _ { v } }$ , it is common to use the squared loss $\begin{array} { r } { \ell _ { v } ^ { \tau } ( \theta _ { v } ) = \frac { 1 } { 2 | \tau | } \sum _ { t \in \tau } ( R _ { t } - V _ { \theta _ { v } } ( x _ { t } ) ) ^ { 2 } } \end{array}$ .
|
| 50 |
+
|
| 51 |
+
By minimizing the empirical expectation of $\ell _ { \pi } ^ { \tau } ( \theta _ { \pi } )$ and $\ell _ { v } ^ { \tau } ( \theta _ { v } )$ , i.e., by addressing
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\operatorname* { m i n } _ { \theta _ { \pi } } \mathbb { E } _ { \tau \sim \pi _ { \theta _ { \pi } } } [ \ell _ { \pi } ^ { \tau } ( \theta _ { \pi } ) ] , \quad \mathrm { ~ a n d ~ } \quad \operatorname* { m i n } _ { \theta _ { v } } \mathbb { E } _ { \tau \sim \pi _ { \theta _ { \pi } } } [ \ell _ { v } ^ { \tau } ( \theta _ { v } ) ] ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
alternatingly, we learn a policy and a value function that maximize expected return.
|
| 58 |
+
|
| 59 |
+
# 3 KNOWLEDGE FLOW
|
| 60 |
+
|
| 61 |
+
Instead of optimizing the programs given in Eq. (1) and Eq. (2) from scratch, the aforementioned warm-start techniques (see Sec. 5 for more) are applicable. To address their mentioned shortcomings, we propose knowledge flow, a framework that moves ‘knowledge’ from an arbitrary number of deep nets, henceforth referred to as ‘teachers’ to a deep net under training, called the ‘student.’
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: (a) Example of a two-teacher knowledge flow. (b) Deep net transformation of knowledge flow. (c) Average normalized weights for teachers’ and the student’s layers. At the beginning of training, the student heavily relies on teacher one. As training progresses, teacher one’s weight decreases, and the student’s weight increases until the student is eventually independent.
|
| 65 |
+
|
| 66 |
+
# 3.1 OVERVIEW
|
| 67 |
+
|
| 68 |
+
Knowledge flow is outlined on example deep nets in Fig. 1 (a,b). We train the parameters of the student net which are randomly initialized. To this end we take advantage of teachers, whose parameters are fixed and obtained from pre-trained models on different source tasks by different algorithms. For example, for reinforcement learning, we may consider teachers trained by A3C (Mnih et al., 2016), A2C (Dhariwal et al., 2017) or DQN (Mnih et al., 2015).
|
| 69 |
+
|
| 70 |
+
‘Knowledge’ of multiple teachers is transferred to a student by adding transformed and scaled intermediate representations from the teacher deep nets to the student net. To achieve this, we modify the student net, i.e., $f _ { \theta }$ in the supervised setting and $\pi _ { \theta _ { \pi } } ( a | x ) , V _ { \theta _ { v } } ( x )$ in the reinforcement learning case. We add teacher representations which are transformed by multiplication with a trainable matrix Q and scaled via a weight $p _ { w }$ that is normalized to sum to one for each student layer and parameterized via trainable parameters $w$ . The normalized weights encode which of the teachers’ or the student’s representation to trust at every layer of the student net. Note that a teacher can help the student at different levels of abstraction with input from different levels of its net.
|
| 71 |
+
|
| 72 |
+
Importantly, after training, the student model should perform well on the target task without relying on teachers. To achieve this, as training progresses, we increasingly encourage a high normalized weight on the student representation, which forces the student to eventually capture all the ‘knowledge.’ Due to the trainable scaling, at an early stage of training, we observe the student to rely heavily on the ‘knowledge’ of the teacher to quickly obtain better performance. However, as training proceeds, the student is encouraged to become more and more independent. During final stages of training, the student will no longer be able to rely on teachers, which ensures that the student has learned to master the desired task on its own. This is observed in Fig. 1 (c).
|
| 73 |
+
|
| 74 |
+
To formally encourage this successive transfer we introduce two additional loss functions. The first, referred to as the dependency loss $\ell _ { \mathrm { d e p } } ( w )$ , captures how much a student relies on teachers. It depends on the weight vector $w$ which encodes the strength of the coupling. The second one ensures that a student’s behavior doesn’t change rapidly when the teachers’ influence decreases. We use loss $\ell _ { \mathrm { K L } } ( \cdot , \cdot )$ to capture the change.
|
| 75 |
+
|
| 76 |
+
By combining student net modifications and additional loss terms, for the supervised task we obtain
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m i n } _ { \theta , w , Q } \mathbb { E } _ { ( x , y ) } [ \widetilde { \ell } _ { ( x , y ) } ( \theta , w , Q ) + \lambda _ { 1 } \ell _ { \mathrm { d e p } } ( w ) + \lambda _ { 2 } \ell _ { \mathrm { K L } } ( \widetilde { \hat { f } } _ { \theta } , \widetilde { \hat { f } } _ { \theta _ { \mathrm { o l d } } } ) ] ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
and for reinforcement learning the transformed program reads as follows:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\left\{ \begin{array} { l l } { \operatorname* { m i n } _ { \theta _ { \pi } , w , Q } \mathbb { E } _ { \tau \sim \tilde { \pi } _ { \theta _ { \pi } } } [ \tilde { \ell } _ { \pi } ^ { \tau } ( \theta _ { \pi } , w , Q ) + \lambda _ { 1 } \ell _ { \mathrm { d e p } } ( w ) + \lambda _ { 2 } \ell _ { \mathrm { K L } } ^ { \tau } ( \tilde { \hat { \pi } } _ { \theta _ { \pi } } , \tilde { \hat { \pi } } _ { \theta _ { \pi _ { \mathrm { o l d } } } } ) ] } \\ { \operatorname* { m i n } _ { \theta _ { v } , w , Q } \mathbb { E } _ { \tau \sim \tilde { \pi } _ { \theta _ { \pi } } } [ \tilde { \ell } _ { v } ^ { \tau } ( \theta _ { v } , w , Q ) ] } \end{array} \right. .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Loss $\tilde { \ell } \colon ( \theta , w , Q )$ originates from the original loss $\ell \colon ( \theta )$ (Eqs. (1)-(2)) by transforming the deep net to include cross-connections, hence its dependence on $w , Q$ . The tilde $( ^ { 6 } )$ denotes this dependence, also for probability distribution $\tilde { \hat { f } }$ and policy distribution $\tilde { \hat { \pi } }$ . Parameters from the current and a previous iteration are referred to via $\theta$ and $\theta _ { \mathrm { o l d } }$ respectively.
|
| 89 |
+
|
| 90 |
+
For both supervised and reinforcement learning, $\lambda _ { 1 }$ and $\lambda _ { 2 }$ control the strength which is used to decrease the influence of the teacher. A low $\lambda _ { 1 }$ allows the student to rely on teachers. Close to the end of training, the student should be independent. Therefore, we set $\lambda _ { 1 }$ to a small value at the beginning, and gradually increase its value as training progresses.
|
| 91 |
+
|
| 92 |
+
Note that we don’t make any assumptions about teachers and student’s objective. If a teacher’s and student’s objective differ, negative transfer may occur initially. However, the proposed method quickly decreases the weight for teacher layers to reduce this effect. Despite differences, students could potentially still benefit from the low level representation of the teachers. We do observe this low level knowledge transfer in our experiments.
|
| 93 |
+
|
| 94 |
+
In the following we first describe how to modify the deep nets, before we detail the loss functions $\ell _ { \mathrm { d e p } }$ and $\ell _ { \mathrm { K L } }$ , which are used to successively decrease the influence of the teachers.
|
| 95 |
+
|
| 96 |
+
# 3.2 DEEP NET TRANSFORMATION AND LOSS TERMS
|
| 97 |
+
|
| 98 |
+
Deep Net Transformation: Knowledge flow enhances the student by adding transformed and scaled intermediate representations from teacher models. To perform the transformation, intermediate representations from teachers are first multiplied by transformation matrices $Q$ . Then the transformed representations from teachers and representations from the student are linearly combined. The weights for this linear combination are determined by a weight $p _ { w }$ which is normalized to sum to one for each student layer.
|
| 99 |
+
|
| 100 |
+
Let index $m = 0$ denote the student model and let $\theta ^ { ( 0 ) }$ refer to its parameters. Further, let $\theta ^ { ( m ) }$ , $m \in \{ 1 , \ldots , M \}$ denote teacher models. We use $l _ { m } ^ { i }$ to refer to deep net layer $i$ of teacher $m$ , with $i \in \{ 1 , \ldots , L _ { m } \}$ and $L _ { m }$ the number of layers in teacher $m$ . We define layer $j$ of the student model to be $l _ { 0 } ^ { j }$ , where $j \in \{ 1 , \dots , L _ { 0 } \}$ and $L _ { 0 }$ the number of deep net layers in the student model. The output of layer $l _ { m } ^ { k }$ right before and after an activation unit is denoted $z ( l _ { m } ^ { k } )$ and $h ( l _ { m } ^ { k } )$ respectively.
|
| 101 |
+
|
| 102 |
+
To align a teacher’s layer $l _ { m } ^ { i }$ with a student’s layer $l _ { 0 } ^ { j }$ , we introduce a learnable transformation matrix $Q ^ { j } ( l _ { m } ^ { i } ) \in \mathbb { R } ^ { \dim ( l _ { 0 } ^ { j } ) \times \dim ( l _ { m } ^ { i } ) }$ , where $\dim ( \cdot )$ gives the number of elements in the corresponding layer. The matrix multiplication $Q ^ { j } ( l _ { m } ^ { i } ) z ( l _ { m } ^ { i } )$ aligns the representation from layer $i$ of teacher $m$ with the representation of layer $j$ of the student.
|
| 103 |
+
|
| 104 |
+
For each layer $j$ in the student model, we define a candidate set $\mathbb { L } ^ { j }$ , which contains $l _ { 0 } ^ { j }$ and all the teachers’ layers to be considered. For example, in Fig. 1 (a), layer one of the student model is combined with layer one of teacher one and layer two of teacher two. Therefore, the candidate set of layer one of the student model is given by $\mathbb { L } ^ { 1 } \dot { = } \{ l _ { 0 } ^ { 1 } , l _ { 1 } ^ { 1 } , l _ { 2 } ^ { 2 } \}$ .
|
| 105 |
+
|
| 106 |
+
To decide which teachers’ or the student’s representation to trust at every layer of the student net, we introduce a normalized weight $p _ { w } ^ { j } ( l )$ for all $j \in \{ 1 , \ldots , L _ { 0 } \}$ , where $l \in \mathbb { L } ^ { j }$ , summing to one for each layer $j$ in the student deep net, $i . e .$ .,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\sum _ { l \in \mathbb { L } ^ { j } } p _ { w } ^ { j } ( l ) = 1 , \forall j \in \{ 1 , \dots , L _ { 0 } \} .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
To obtain the combined intermediate representation of layer $j$ for the student model, we use
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
h ( l _ { 0 } ^ { j } ) = \sigma \left( \sum _ { l \in \mathbb { L } ^ { j } \backslash l _ { 0 } ^ { j } } p _ { w } ^ { j } ( l ) Q ^ { j } ( l ) z ( l ) + p _ { w } ^ { j } ( l _ { 0 } ^ { j } ) z ( l _ { 0 } ^ { j } ) \right) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $p _ { w } ^ { j } ( l _ { m } ^ { i } )$ determines how much the student layer $j$ relies on transformed representations of layer $i$ from the $m$ -th teacher. Intuitively, if the transformed representation of the $m$ -th teacher layer $i$ is helpful, $p _ { w } ^ { j } ( l _ { m } ^ { i } )$ will be close to one. We visualize the deep net transformation in Fig. 1 (b).
|
| 119 |
+
|
| 120 |
+
Note that the intermediate representations of teachers are not changed in our framework. To obtain the output of layer $l _ { m } ^ { k }$ we apply the original activation unit to the original representation $z ( l _ { m } ^ { i } )$ , i.e., $\begin{array} { r } { h ( l _ { m } ^ { i } ) = \sigma ( z ( l _ { m } ^ { i } ) ) , ~ \overset { } { \forall } m \in \{ 1 , \dots , M \} , j \in \{ 1 , \dots L _ { m } \} } \end{array}$ .
|
| 121 |
+
|
| 122 |
+
The maximal number of introduced matrices $Q$ in our framework is $\textstyle \sum _ { i = 1 } ^ { M } L _ { i } L _ { 0 }$ . In practice, we don’t link a student’s layer to every layer of a teacher network. Intuitively, a teachers’ bottom layer features are very likely irrelevant to a student’s top layer features. Indeed, we observed that linking a teachers’ bottom layer to a student’s top layer generally doesn’t yield improvements. Therefore, in practice, we recommend to link one teacher layer to one or two student layers, in which case we introduce on the order of $M L _ { 0 }$ matrices Q. Also note that while additional trainable parameters $Q$ and $w$ are introduced in our framework, $Q$ and $w$ are not part of the resulting student network since we ensure $p _ { w } ^ { j } ( l ) \equiv 0 \forall l \in \mathbb { L } ^ { j } \backslash l _ { 0 } ^ { j }$ at the end of training as discussed next. Hence, the additional parameters function as auxiliary knobs that help the student learn faster. In the final stage of training, the student will be independent (see Fig. 1 (c)) and does no longer rely on $Q , w ,$ , or any transformed representations from teachers.
|
| 123 |
+
|
| 124 |
+
Table 1: Comparison with PathNet (Fernando et al., 2017) and progressive neural network (PNN) (Rusu et al., 2016b). Since PathNet and PNN don’t report exact scores we obtain their numbers from their plots and indicate that with a $\sim$ symbol. The results of the state-of-the-art methods: A3C (Mnih et al., 2016), PPO (Schulman et al., 2017), and ACKTR (Wu et al., 2017) on Atari games are also listed for reference.
|
| 125 |
+
|
| 126 |
+
<table><tr><td></td><td colspan="2">w/ Seaquest teacher</td><td colspan="2">w/ Riverraid teacher</td><td colspan="2">w/ Sea. and River. teachers</td><td colspan="3">No teachers</td></tr><tr><td></td><td>Ours</td><td>PathNet</td><td>Ours</td><td>PathNet</td><td>Ours</td><td>PNN</td><td>A3C</td><td>PPO</td><td>ACKTR</td></tr><tr><td>Alien</td><td>1254</td><td>~1700</td><td>1259</td><td>~1800</td><td>1911</td><td>~2000</td><td>182</td><td>1850</td><td>3197</td></tr><tr><td>Asterix</td><td>3982</td><td>~2000</td><td>3823</td><td>~2000</td><td>6012</td><td>~9000</td><td>6723</td><td>4533</td><td>31583</td></tr><tr><td>Boxing</td><td>96</td><td>~70</td><td>96</td><td>~80</td><td>99</td><td>~99</td><td>34</td><td>95</td><td>1</td></tr><tr><td>Gopher</td><td>4152</td><td>~3900</td><td>3820</td><td>~2100</td><td>5233</td><td>~4500</td><td>8443</td><td>2933</td><td>47730</td></tr><tr><td>Hero</td><td>21250</td><td>~12500</td><td>29343</td><td>~12500</td><td>30928</td><td>~30000</td><td>28766</td><td>n/a</td><td>n/a</td></tr><tr><td>James.</td><td>857</td><td>~600</td><td>832</td><td>~600</td><td>1245</td><td>~850</td><td>352</td><td>561</td><td>512</td></tr><tr><td>Krull</td><td>8193</td><td>~7800</td><td>6890</td><td>~7500</td><td>10000</td><td>~9954</td><td>8067</td><td>7942</td><td>9689</td></tr></table>
|
| 127 |
+
|
| 128 |
+
Decreasing Teachers’ Influence: We successively decrease the influence of the teachers during training by gradually encouraging the normalized weight $p _ { w } ^ { j } ( l _ { 0 } ^ { j } )$ to increase to a value of $1 \forall j \in$ $\{ 1 , 2 , \ldots , L _ { 0 } \}$ . To capture how much the student relies on teachers, we introduce the dependence cost as the negative log probability:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\ell _ { \mathtt { d e p } } ( w ) = - \frac { 1 } { L _ { 0 } } \sum _ { j \in \{ 1 , 2 , . . . , L _ { 0 } \} } \log p _ { w } ^ { j } ( l _ { 0 } ^ { j } ) .
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
By minimizing $\ell _ { \mathrm { d e p } } ( w )$ , we encourage weights for the layers of the student to increase. Hence we encourage the student to become more and more independent. During the final stage of training, $p _ { w } ^ { j } ( l _ { 0 } ^ { j } )$ approaches one for all $j \in \{ 1 , \ldots , L _ { 0 } \}$ , making the student independent of the transformed representation obtained from teachers.
|
| 135 |
+
|
| 136 |
+
Empirically, we found that a fast decrease of the influence of the teacher can degrade the performance. This is intuitive as it requires some time to find good transformations $Q$ . Moreover, decreasing the influence of a teacher too fast may change the output distribution over labels or actions of the student model too much, and thus lead to performance loss. To prevent changing a student’s output distribution too fast, we found a Kullback-Leibler (KL) regularizer to yield good results. More specifically, in the case of supervised learning we use
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\ell _ { \mathrm { K L } } \big ( \tilde { \hat { f } } _ { \boldsymbol { \theta } } , \tilde { \hat { f } } _ { \boldsymbol { \theta } _ { \mathrm { o l d } } } \big ) = D _ { \mathrm { K L } } \big [ \tilde { \hat { f } } _ { \boldsymbol { \theta } } \big ( \cdot | \boldsymbol { x } \big ) | | \tilde { \hat { f } } _ { \boldsymbol { \theta } _ { \mathrm { o l d } } } \big ( \cdot | \boldsymbol { x } \big ) \big ] .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Hereby, $\theta$ is the set of current parameters, and $\theta _ { \mathrm { o l d } }$ are the previous ones. In the reinforcement learning case we use $D _ { \mathrm { K L } } [ \tilde { \hat { \pi } } _ { \boldsymbol { \theta } } ( \cdot \vert x _ { t } ) \vert \vert \tilde { \hat { \pi } } _ { \boldsymbol { \theta } _ { \mathrm { o l d } } } ^ { - } ( \cdot \vert x _ { t } ) ]$ .
|
| 143 |
+
|
| 144 |
+
# 4 EXPERIMENTAL RESULTS
|
| 145 |
+
|
| 146 |
+
In the following we evaluate knowledge flow on reinforcement and supervised learning tasks. Results are reported by using only the student model to avoid even the smallest influence from any teacher nets.
|
| 147 |
+
|
| 148 |
+
# 4.1 REINFORCEMENT LEARNING
|
| 149 |
+
|
| 150 |
+
We evaluate knowledge flow on reinforcement learning using Atari games that were used by Rusu et al. (2016b); Fernando et al. (2017). Following existing work, the input to our agent are raw images from the environment. The agent learns to predict actions only based on the rewards and the input images from the environment. The agent chooses an action every four frames, and the last action is repeated on the skipped four frames. For all teacher models and the student model, we use the fully forward architecture of A3C (Mnih et al., 2016). The model has three hidden layers. The first layer is a convolutional layer with 16 filters of size $8 \mathrm { x } 8$ and stride 4. The second layer is a convolutional layer with 32 filters of size $4 \mathbf { x } 4$ and stride 2. The third layer is a fully connected layer with 256 hidden units. Following the third hidden layer are two sets of output. One is a softmax output that provides a probability distribution over all valid actions. The other one is a scalar output that provides the estimated value function. We use the same hyper-parameter settings as Mnih et al. (2016) except for the learning rate. Mnih et al. (2016) use RMSProp with shared statistics while we use Adam with shared statistics, which we found to give better results when training the baselines. The learning rate is set to $1 0 ^ { - 4 }$ and gradually decreased to zero for all experiments. To select $\lambda _ { 1 }$ and $\lambda _ { 2 }$ in our framework, we follow progressive neural net (Rusu et al., 2016b): randomly sample $\lambda _ { 1 } \in \{ 0 . 0 5 , 0 . 1 , 0 . 5 \}$ and $\lambda _ { 2 } \in \{ 0 . 0 \bar { 0 } 1 , \bar { 0 } . 0 1 , 0 . 0 5 \}$ . Note that $\lambda _ { 1 }$ is set to zero at the beginning of training, and linearly increased to the sampled value at the end of training. Following Rusu et al. (2016b), we repeat each experiment 25 times with different random seeds and randomly sampled $\lambda _ { 1 }$ and $\lambda _ { 2 }$ . The results of the top three out of 25 runs are reported. As A3C, we run 16 agents on 16 CPU cores in parallel.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 2: Comparison with progressive neural network and PathNet.
|
| 154 |
+
|
| 155 |
+
Evaluation Metrics: We follow the evaluation procedure of Mnih et al. (2015). The trained student models are evaluated by playing each game for 30 episodes. We also follow the ‘no-op’ procedure: at the beginning of each testing episode, the agents perform up to 30 ‘no-op’ actions.
|
| 156 |
+
|
| 157 |
+
Results: We first compare our framework with PathNet (Fernando et al., 2017) and progressive neural net (PNN) (Rusu et al., 2016b), which are state-of-the-art transfer reinforcement learning frameworks, using their experimental settings. The comparison is summarized in Table 1. The state-of-the-art results (Mnih et al., 2016; Schulman et al., 2017; Wu et al., 2017) on Atari games are also included in Table 1 for reference. Compared to PathNet, a student model trained using our transfer framework with one teacher achieves higher scores in 11 out of 14 experiments. Compared with PNN, for a two-teacher framework, our trained student model has only 0.7M parameters and PNN has 16M parameters. Nonetheless we observe higher scores in five out of the seven experiments. The results demonstrate that knowledge flow effectively transfers knowledge from teachers to the student. Table 1 also indicates that, in our framework, when the number of teachers increases from one to two, the student’s performance improves significantly across all experiments. The training curves for the experiments are shown in Fig. 2. The curve is the average of the top three out of 25 runs. We observe our approach to generally perform very well.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Comparison with fine-tuning and baseline A3C on different combinations of environment/teacher settings.
|
| 161 |
+
|
| 162 |
+
To further evaluate knowledge flow, we experiment with different combinations of environment/teacher settings. These settings are not used by PathNet and progressive neural network. The results are summarized in Table 2, where “ours w/ expert” represents that one teacher is expert for the target game; “ours w/ non-expert” represents that both teachers are not experts for the target game; “Fine-tune” represents fine-tuning from a non-expert on a new target game; “A3C baseline” represents our implementation of the A3C baseline; “A3C” represents the scores reported originally (Mnih et al., 2016). Note that our A3C implementation achieves better scores than those reported by Mnih et al. (2016) for most of the games. As shown in Table 2, knowledge flow with expert teacher performs better than the baseline across all experiments, which we interpret as evidence that knowledge flow successfully transfers ‘knowledge’ from an expert teacher to the student. In addition, knowledge flow with non-expert teachers also outperforms fine-tuning on a non-expert teacher. The reasons are twofold: First, a student model in knowledge flow can learn from multiple teachers while the fine-tuning method can only start from one setting. Second, in knowledge flow, the student can avoid the negative impact from insufficiently pretrained teachers, while fine-tuning from an insufficiently pretrained model slows down the training process and may degrade the overall performance. The training curves for the experiments are shown in Fig. 3. More training curves are in the Appendix (Fig. 6). Note that in knowledge flow, the student can benefit from the intermediate representations of the teacher, even if input space, output space and objectives differ. For example, in Fig. 3 (a), the two teachers are Chopper Command and Space Invaders, which are quite different from the target game Seaquest. The student model still benefits from learning from the teachers and achieves scores ten times larger than learning without teacher and fine-tuning from a teacher.
|
| 163 |
+
|
| 164 |
+
# 4.2 SUPERVISED LEARNING
|
| 165 |
+
|
| 166 |
+
For supervised learning, we use a variety of image classification benchmarks, including CIFAR10 (Krizhevsky, 2009), CIFAR-100 (Krizhevsky, 2009), STL-10 (Coates et al., 2011), and EMNIST (Cohen et al., 2017). The parameters $\lambda _ { 1 }$ for the dependent cost and $\lambda _ { 2 }$ for the KL cost are determined using the validation set of each dataset.
|
| 167 |
+
|
| 168 |
+
Evaluation Metrics: To evaluate the trained student model we report top-1 error rate on the test set of each dataset. All plots and reported numbers are the average of three runs obtained using different random seeds.
|
| 169 |
+
|
| 170 |
+
Table 3: Test Error $( \% )$ on CIFAR-10/100. The parentheses following “Ours” indicates the teachers we use. I.e., ‘Ours (SVHN, C100)’ indicates that we use an SVHN expert and a C100 expert as teachers.
|
| 171 |
+
|
| 172 |
+
<table><tr><td></td><td>Baseline Densenet f</td><td>Fine-tune</td><td>Fine-tune t from C100 from SVHN(C100,SVHN)</td><td>Ours</td><td colspan="3">Baseline Fine-tune Fine-tune Ours Densenet from C10 from SVHN(C10,SVHN)</td></tr><tr><td>C10</td><td>4.44</td><td>4.27</td><td>4.58</td><td>3.88</td><td>C100 21.64 20.83</td><td>21.02</td><td>20.78</td></tr><tr><td colspan="6">(a) (b)</td></tr></table>
|
| 173 |
+
|
| 174 |
+
CIFAR-10/CIFAR-100: CIFAR-10 and CIFAR-100 datasets consist of colored images of size $3 2 \times 3 2$ . CIFAR-10 (C10) has 10 classes and CIFAR-100 (C100) has 100 classes. For both dataset, the training and test sets contain 50,000 and 10,000 images respectively. We perform all experiments on CIFAR-10 and CIFAR-100 with standard data augmentation (Huang et al., 2017).
|
| 175 |
+
|
| 176 |
+
We use Densenet (Huang et al., 2017) (depth 100, growth rate 24) as a baseline and follow their hyper-parameter settings to train our baseline, teacher and student models. For our approach, we first train teachers on CIFAR-10, CIFAR-100, and SVHN (Netzer et al., 2011). We then train the student model using a different combination of teachers. We compare our results to fine-tuning and the baseline model. As shown in Table 3 (a), for the CIFAR-10 target task, fine-tuning from the CIFAR-100 expert improves $4 \%$ over the baseline. Fine-tuning from the SVHN expert performs worse than the baseline model. Intuitively, for the CIFAR-10 target task, the CIFAR-100 deep net is a good teacher while a deep net trained with SVHN isn’t. Presented with both good and inadequate teachers, knowledge flow improves by $1 3 \%$ over the baseline. This demonstrates that knowledge flow can not only leverage a good teacher’s ‘knowledge,’ but it can also avoid misleading influence. As detailed in Table 3 (b), the results are similar on the CIFAR-100 dataset.
|
| 177 |
+
|
| 178 |
+
To further demonstrate the properties of knowledge flow, additional results are in the appendix.
|
| 179 |
+
|
| 180 |
+
# 5 RELATED WORK
|
| 181 |
+
|
| 182 |
+
As mentioned before, ‘knowledge’ transfer has been considered using a variety of techniques. We briefly discuss related work in contrast to our approach in the following and defer details to Sec. 8.
|
| 183 |
+
|
| 184 |
+
PathNet (Fernando et al., 2017) enables multiple agents to train the same deep net while reusing parameters and avoiding catastrophic forgetting. In contrast to this formulation we consider availability of multiple pre-trained teacher nets.
|
| 185 |
+
|
| 186 |
+
Progressive Net (Rusu et al., 2016b) leverages transfer and avoids catastrophic forgetting by introducing lateral connections to previously learned features. Our discussed method uses similar lateral connections. However, in contrast to Rusu et al. (2016b), our method ensures independence of the student upon training, addressing a limitation in (Rusu et al., 2016b) where only a fraction of the capacity of the student is eventually utilized.
|
| 187 |
+
|
| 188 |
+
Distral a neologism combining ‘distill & transfer learning’ (Teh et al., 2017) considers joint training of multiple tasks. Multiple tasks share a ‘distilled’ policy which encodes common behavior between different tasks. While each worker addresses its own task, a shared policy encourages consistency between the policies. Different from Distral, which is a multi-task learning framework, knowledge flow addresses a single task, while in multi-task learning, multiple tasks are addressed at the same time. Hence, common for multi-task learning and knowledge flow is a transfer of information. However, in multi-task learning, information extracted from different tasks are shared to boost performance, while, in knowledge flow, the information of multiple teachers is leveraged to help a student learn better a single, new, previously unseen task.
|
| 189 |
+
|
| 190 |
+
Other related work includes actor-mimic (Parisotto et al., 2016), learning without forgetting (Li & Hoiem, 2016), growing a brain (Wang et al., 2017), policy distillation (Rusu et al., 2016a), domain adaptation (Pan & Yang, 2010; Long et al., 2015; Tzeng et al., 2015), knowledge distillation (Hinton et al., 2015) or lifelong learning (Chen & Liu, 2016). A more detailed discussion on related work is provided in Sec. 8 of the supplementary material.
|
| 191 |
+
|
| 192 |
+
# 6 CONCLUSION
|
| 193 |
+
|
| 194 |
+
We developed a general knowledge flow approach that permits to train a deep net from any number of teachers. We showed results for reinforcement learning and supervised learning, demonstrating improvements compared to training from scratch and to fine-tuning. In the future we plan to learn when to use which teacher and how to actively swap teachers during training of a student.
|
| 195 |
+
|
| 196 |
+
REFERENCES
|
| 197 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proc. ICML, 2009.
|
| 198 |
+
Aaron Chen. pytorch-playground. https://github.com/aaron-xichen/ pytorch-playground, 2017.
|
| 199 |
+
Z. Chen and B. Liu. Lifelong Machine Learning. Morgan & Claypool Publishers, 2016.
|
| 200 |
+
Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proc. AISTATS, 2011.
|
| 201 |
+
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and André van Schaik. EMNIST: an extension of MNIST to handwritten letters. arXiv preprint arXiv:1702.05373, 2017.
|
| 202 |
+
Prafulla Dhariwal, Christopher Hesse, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. Openai baselines, 2017.
|
| 203 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A. Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
|
| 204 |
+
Tommaso Furlanello, Jiaping Zhao, Andrew M. Saxe, Laurent Itti, and Bosco S. Tjan. Active long term memory networks. arXiv preprint arXiv:1606.02355, 2016.
|
| 205 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. CVPR, 2016.
|
| 206 |
+
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 207 |
+
Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. In Proc. CVPR, 2017.
|
| 208 |
+
Heechul Jung, Jeongwoo Ju, Minju Jung, and Junmo Kim. Less-forgetting learning in deep neural networks. arxiv, 2016.
|
| 209 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 210 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. In Proc. ECCV, 2016.
|
| 211 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In Proc. ICML, 2015.
|
| 212 |
+
T. Mitchell, W. Cohen, E. Hruscha, P. Talukdar, J. Betteridge, A. Carlson, B. Dalvi, M. Gardner, B. Kisiel, J. Krishnamurthy, N. Lao, K. Mazaitis, T. Mohammad, N. Nakashole, E. Platanios, A. Ritter, M. Samadi, B. Settles, R. Wang, D. Wijaya, A. Gupta, X. Chen, A. Saparov, M. Greaves, and J. Welling. Never-ending learning. In Proc. AAAI, 2015.
|
| 213 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. In Nature, 2015.
|
| 214 |
+
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 Proc. ICML, 2016.
|
| 215 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 216 |
+
|
| 217 |
+
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Trans. on Knowl. and Data Eng., 2010.
|
| 218 |
+
|
| 219 |
+
Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In Proc. ICLR, 2016.
|
| 220 |
+
|
| 221 |
+
Vishal M. Patel, Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Visual domain adaptation: A survey of recent advances. IEEE Signal Process. Mag., 2015.
|
| 222 |
+
|
| 223 |
+
Andrei A. Rusu, Sergio Gomez Colmenarejo, Çaglar Gülçehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. In Proc. ICLR, 2016a.
|
| 224 |
+
|
| 225 |
+
Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. In arXiv preprint arXiv:1606.04671, 2016b.
|
| 226 |
+
|
| 227 |
+
Paul Ruvolo and Eric Eaton. Ella: An efficient lifelong learning algorithm. In Proc. ICML, 2013.
|
| 228 |
+
|
| 229 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 230 |
+
|
| 231 |
+
Yee Teh, Victor Bapst, Wojciech M. Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In Proc. NIPS, 2017.
|
| 232 |
+
|
| 233 |
+
Martin Thoma. Analysis and optimization of convolutional neural network architectures. arXiv preprint arXiv:1707.09725, 2017.
|
| 234 |
+
|
| 235 |
+
Sebastian Thrun. Lifelong learning algorithms. In Learning to Learn. Springer US, 1998.
|
| 236 |
+
|
| 237 |
+
Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In Proc. ICCV, 2015.
|
| 238 |
+
|
| 239 |
+
Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Growing a brain: Fine-tuning by increasing model capacity. In Proc. CVPR, 2017.
|
| 240 |
+
|
| 241 |
+
Yuhuai Wu, Elman Mansimov, Shun Liao, Roger B. Grosse, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. In Proc. NIPS, 2017.
|
| 242 |
+
|
| 243 |
+
Junbo Jake Zhao, Michaël Mathieu, Ross Goroshin, and Yann LeCun. Stacked what-where autoencoders. arXiv preprint arXiv:1506.02351, 2015.
|
| 244 |
+
|
| 245 |
+
Table 4: Test error $( \% )$ of distilled student net.
|
| 246 |
+
|
| 247 |
+
<table><tr><td></td><td>MNIST</td><td>MNIST w/o digit ‘3'</td><td>C100</td><td>Imagenet</td></tr><tr><td>Student alone</td><td>1.46</td><td>11.06</td><td>31.87</td><td>30.24</td></tr><tr><td>KD Hinton et al. (2015)</td><td>0.74</td><td>2.06</td><td>30.28</td><td>30.04</td></tr><tr><td>Ours</td><td>0.73</td><td>1.05</td><td>30.07</td><td>29.05</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Table 5: Our approach on the EMNIST Letters dataset.
|
| 250 |
+
|
| 251 |
+
<table><tr><td>Model (Teacher)</td><td>Test error(%)</td></tr><tr><td>Cohen et al. (2017)</td><td>14.85</td></tr><tr><td>Fine-tune from EMNIST digits</td><td>9.04</td></tr><tr><td>Baseline</td><td>9.20</td></tr><tr><td>Ours (EMNIST letters)</td><td>7.13</td></tr><tr><td>Ours (EMNIST half letters)</td><td>8.13</td></tr><tr><td>Ours (EMNIST digit)</td><td>8.11</td></tr></table>
|
| 252 |
+
|
| 253 |
+
# 7 APPENDIX
|
| 254 |
+
|
| 255 |
+
# 7.1 SUPERVISED LEARNING
|
| 256 |
+
|
| 257 |
+
Comparison with Knowledge Distillation: We follow knowledge Distillation (KD) (Hinton et al., 2015) to distill knowledge from a larger model (teacher) to a smaller model (student). The student models have $5 0 \% - 5 \%$ parameters of the teacher models. Following their setup, we conduct experiments on MNIST, MNIST with digit $\cdot _ { 3 } \cdot$ missing in the training set, CIFAR-100, and ImageNet. For MNIST and MNIST with digit $\cdot _ { 3 } ,$ missing, following KD, the teacher model is an MLP with two hidden layers of 1200 hidden units, and the student model is an MLP with two hidden layers of 800 hidden units. For CIFAR-100, we use the model from Chen (2017) as teacher model. The student model follows the structure of the teacher, but the number of output channels of each convolutional layer is halved. For ImageNet, the teacher model is a 50-layer ResNet (He et al., 2016), and the student model is a 18-layer ResNet. The test error of the distilled student model are summarize in Table 4. Our framework has consistently better performance than KD, because the student model in our framework benefits not only from the output layer behavior of the teacher but also from intermediate layer representations of the teacher.
|
| 258 |
+
|
| 259 |
+
# EMNIST:
|
| 260 |
+
|
| 261 |
+
The ‘EMNIST Letters’ dataset consists of images of size $2 8 \times 2 8$ pixels showing handwritten letters. It has 26 balanced classes. Each class contains lower and upper case letters. The training and test sets contain 124,800 and 20,800 images respectively. The ‘EMNIST Digits’ dataset consists of images of size $2 8 \times 2 8$ pixels showing handwritten digits. It has 10 balanced classes. The training and test sets contain 240,000 and 40,000 images respectively.
|
| 262 |
+
|
| 263 |
+
In this case we use the MNIST model from Chen (2017) as a baseline, teacher and student model. We trained teachers on EMNIST Digits, EMNIST Letters, and EMNIST Letters with only 13 classes. Our target task is EMNIST Letters. The student model is trained with different teachers and the results are compared to fine-tuning, the baseline model, and the state-of-the-art results on EMNIST. The results are summarized in Table 5. Compared to the baseline and fine-tuning, student learning in our framework with expert teacher (EMNIST Letters), semi-expert teacher (Half EMNIST Letters), and non-expert teacher (EMNIST Digits) all have better performance. In Fig. 4 we illustrate the accuracy over epochs for training of different models.
|
| 264 |
+
|
| 265 |
+
# STL-10:
|
| 266 |
+
|
| 267 |
+
The STL-10 dataset consist of colored images of size $9 6 \times 9 6$ pixels. It has 10 balanced classes. The training set contains 5,000 labeled images and 100,000 unlabeled images. The test set contains 8,000 images. In our experiment, we only use the 5,000 labeled images for training.
|
| 268 |
+
|
| 269 |
+
We use the STL-10 model from Chen (2017) as our baseline, teacher and student model. We trained teachers on CIFAR-10 and CIFAR-100. We compare our results to fine-tuning and the baseline in Table 6. Note that STL-10 is very similar to CIFAR-10 and CIFAR-100. Therefore, both CIFAR-10 and CIFAR-100 are very good teachers. As shown in Table 6, compared to the baseline, fine-tuning a model using weights pretrained on CIFAR-10 and CIFAR-100 reduce test errors by more than $1 0 \%$ . Compared with fine-tuning, student model training in our framework further reduces the test error by $3 \%$ . Note that we only train on the labeled data while other approaches use this data for testing of semi-supervised approaches. Hence our results are obtained using fewer data and may not be directly comparable. We still list their results in Table 6 for reference. In Fig. 5 we illustrate the accuracy over the epochs of training.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 4: Comparison of top-1 accuracy of our approach, fine-tuning and baseline on the EMNIST Letters test dataset.
|
| 273 |
+
|
| 274 |
+
Table 6: Our approach on the STL-10 dataset (fully supervised).
|
| 275 |
+
|
| 276 |
+
<table><tr><td>Test error (%)</td></tr><tr><td>Zhao et al. (2015) Thoma (2017)</td><td>25.20 21.34</td></tr><tr><td>Baseline Fine-tune from C10 Fine-tune from C100</td><td>25.50 14.32</td></tr></table>
|
| 277 |
+
|
| 278 |
+
# 7.2 REINFORCEMENT LEARNING
|
| 279 |
+
|
| 280 |
+
We also compare to Distral (Teh et al., 2017), which is the state-of-the-art multi-task reinforcement learning framework. We used $\mathrm { \mathrm { ' K L } } + \mathrm { e n t } \ 1 \ \mathrm { c o l } ^ { \mathrm { ? } }$ , which has a central model $( m _ { 0 } )$ , and a task model $( m _ { i } )$ for each task. We perform the experiments on Atari games. In the experiments, we have three tasks (task 1, task 2, task 3). The teachers of task 2 $\left( m _ { 2 } \right)$ and task 3 $( m _ { 3 } )$ are provided for our framework. Distral is trained for 120M steps (40M steps/task), and our model is trained for $4 0 \mathbf { M }$ steps. For fair comparison, we report results of Distral’s task 1 model $( m _ { 1 } )$ , which is better than its center model $( m _ { 0 } )$ . The results are summarized in Table 7. Distral is suboptimal, because it aims to learn a multi-task agent. In addition, identical action and state space is assumed. When the target task is very different from the source tasks, Distral cannot decrease the teacher influence. In contrast, our framework can decrease a teacher’s influence, and thus reduce negative transfer.
|
| 281 |
+
|
| 282 |
+
# 7.3 VISUALIZATION OF NORMALIZED WEIGHTS OF TEACHERS AND STUDENT
|
| 283 |
+
|
| 284 |
+
Following the reviewer’s suggestion, we plot the averaged normalized weight $( p _ { w } )$ for teachers and the student in the C10 experiment, where C100 and SVHN experts are teachers. Intuitively, the C100 teacher should have a higher $p _ { w }$ value than the SVHN teacher, because C100 is more relevant to C10. The plot verifies this intuition. As shown in Fig. 7, $p _ { w }$ of the C100 teacher is higher than that of the SVHN teacher over the entire training. Note, both teachers’ normalized weights approach zero at the end of training.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 5: Comparison of top-1 accuracy of our approach, fine-tuning and baseline on the STL-10 test dataset.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 6: Comparison with fine-tuning and baseline A3C on different combinations of environment/teacher settings.
|
| 291 |
+
|
| 292 |
+
# 7.4 ABLATION STUDIES
|
| 293 |
+
|
| 294 |
+
# 7.4.1 UNTRAINED TEACHER MODELS
|
| 295 |
+
|
| 296 |
+
To verify that the student really benefits from the knowledge of teachers, we conduct an ablation study suggested by a reviewer. We use teacher models that haven’t been trained at all. Intuitively, learning with untrained teachers should have worse performance than learning with knowledgeable teachers. Our experiments verify this intuition. In Fig. 8 (a), where the target task is hero, learning with untrained teachers (‘w/ untrained teachers’) achieves an average reward of 15934. Learning with knowledgeable teachers (‘Ours with seaquest and riverraid teacher’) achieves an average reward of 30928. More results are presented in Figs. 8 (b, c). The results show that knowledge flow achieves higher rewards than training with untrained teachers in different environments and teacher-student settings.
|
| 297 |
+
|
| 298 |
+
Table 7: Comparison with Distral on Task 1 score.
|
| 299 |
+
|
| 300 |
+
<table><tr><td>Task1,Task2,Task3</td><td>Distral Teh et al. (2017)</td><td>Ours</td></tr><tr><td>KungFuMaster, Hero, Seaquest</td><td>27433</td><td>35103</td></tr><tr><td>Hero, Seaquest, Riverraid</td><td>15096</td><td>30928</td></tr><tr><td>James, Seaquest,Riverraid</td><td>550</td><td>1245</td></tr></table>
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 7: Normalized weights for the teachers and the student in C10 experiments.
|
| 304 |
+
|
| 305 |
+
# 7.4.2 TRAINING WITHOUT KL TERM
|
| 306 |
+
|
| 307 |
+
The KL term prevents the student’s output distribution over actions or labels from drastic changes when the teachers’ influence is decreasing. To investigate the importance of the KL term, we conduct an ablation study where the KL coefficient $\left( \lambda _ { 2 } \right)$ is set to zero. The result is summarized in Fig. 9. Considering Fig. 9 (a), where the target task is MsPacman and the teachers are Riverraid and Seaquest experts. Without the KL term, when a teacher’s influence decreases, the rewards drop drastically. In contrast, with a KL term, we don’t observe performance drops. At the end of training, learning with the KL term achieves an average reward of 2907 and learning without the KL term achieves an average reward of 1215. More results are presented in Fig. 9 (b, c), which shows that training with the KL term achieves higher reward than training without the KL term.
|
| 308 |
+
|
| 309 |
+
# 7.5 TEACHERS WITH DIFFERENT ARCHITECTURE THAN STUDENT
|
| 310 |
+
|
| 311 |
+
In additional experiments, following the suggestion of a reviewer, we use architectures for the teacher which differ from the student model. More specifically, we use the model of Mnih et al. (2015) as a teacher model. The teacher model consists of 3 convolutional layers, which have 32, 64, and 64 filters, followed by a hidden fully connected layer which has 512 ReLUs. We use the model of Mnih et al. (2016) as the student model. The student model consists of 2 convolutional layers, which have 16 and 32 filters respectively, followed by a hidden fully connected layer which has 256 ReLUs. Both models’ fully connected layers are followed by two output layers for actions and values. In the experiments, we link each teacher’s first convolutional layer to the student’s first convolutional layer. Moreover, we link each teacher’s third convolutional layer to the student’s second convolutional layer, and each teacher’s fully connected layer to the student’s fully connected layer. In the experiment, the target task is KungFu Master, and the teachers are experts for Seaquest and Riverraid. The results are summarized in Fig. 10. We observed that learning with teachers, whose architecture differs from the student, to have similar performance as learning with teachers which have the same architecture. Consider as an example Fig. 10 (a), where the target task is KungFu Master, and the teachers are experts for Seaquest and Riverraid. At the end of training, learning with teachers of different architectures achieves an average reward of 37520, and learning with teachers of the same architecture achieves an average reward of 35012. More results are shown in Fig. 10 (b, c). The results show that knowledge flow can enable higher rewards, even if the teachers and the student architectures differ.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 8: Ablation study: using untrained teachers.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 9: Ablation study regarding KL term. Seaquest and Riverraid experts are used as teachers for all experiments.
|
| 318 |
+
|
| 319 |
+
# 7.6 AVERAGE NETWORK AS $\theta _ { o l d }$
|
| 320 |
+
|
| 321 |
+
For the parameters $\theta _ { \mathrm { o l d } }$ an average network can be used. To investigate how usage of an average network to obtain the parameters $\theta _ { \mathrm { o l d } }$ affects the performance, we conduct an experiment where $\theta _ { \mathrm { o l d } }$ is computed using the exponential running average of the model weight. More specifically, $\theta _ { \mathrm { o l d } }$ is updated as follows: $\theta _ { \mathrm { o l d } } \alpha \cdot \theta _ { \mathrm { o l d } } + ( 1 - \alpha ) \cdot \theta$ , where $\alpha = 0 . 9$ . The results are summarized in Fig. 11. We observe that using an exponential average to compute $\theta _ { \mathrm { o l d } }$ results in very similar performance as using a single model. Consider Fig. 11 (a), where the target task is Boxing and the teacher is a Riverraid expert. At the end of training, using an average network to obtain $\theta _ { \mathrm { o l d } }$ achieves an average reward of 96.2 and using a single network to obtain $\theta _ { \mathrm { o l d } }$ achieves an average reward of 96.0. More results on using an average network are shown in Fig. 11 (b, c).
|
| 322 |
+
|
| 323 |
+
# 8 RELATED WORK
|
| 324 |
+
|
| 325 |
+
As mentioned before, variants of ‘knowledge’ transfer have been considered using a variety of techniques, for instance, fine-tuning, progressive neural nets (Rusu et al., 2016b), PathNet (Fernando et al., 2017), ‘Growing a Brain’ (Wang et al., 2017), actor-mimic (Parisotto et al., 2016), learning without forgetting (Li & Hoiem, 2016). Also related are techniques on transfer learning and lifelong learning. We discuss those methods and contrast them to our approach in the following.
|
| 326 |
+
|
| 327 |
+
PathNet (Fernando et al., 2017) enables multiple agents to train the same giant deep net while reusing parameters and avoiding catastrophic forgetting. To this end, agents embedded in the neural net discover which weights can be reused for new tasks and restrict application of gradients to those parameters. In contrast to this formulation we consider availability of multiple teacher nets, which are trained.
|
| 328 |
+
|
| 329 |
+
Progressive Net (Rusu et al., 2016b) leverages transfer and avoids catastrophic forgetting by introducing lateral connections to previously learned features. Our discussed method uses similar lateral connections. However, in contrast to Rusu et al. (2016b), we introduce scaling with normalized weights. This ensures independence of the student upon training, addressing a limitation in (Rusu et al., 2016b) where only a fraction of the capacity of the student is eventually utilized.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 10: Teachers’ architecture differs from the student’s architecture. Seaquest and Riverraid experts are used as teachers for all experiments.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 11: Average network to compute $\theta _ { o l d }$ . Riverraid expert is used as teacher for all experiments.
|
| 336 |
+
|
| 337 |
+
Distral a neologism combining ‘distill & transfer learning’ (Teh et al., 2017) considers joint training of multiple tasks. Multiple tasks share a ‘distilled’ policy which encodes common behavior between different tasks. While each worker addresses its own task, a shared policy encourages consistency between the policies. Different from Distral, which is a multi-task learning framework, knowledge flow addresses a single task, while in multi-task learning, multiple tasks are addressed at the same time. Hence, common for multi-task learning and knowledge flow is a transfer of information. However, in multi-task learning, information extracted from different tasks are shared to boost performance, while, in knowledge flow, the information of multiple teachers is leveraged to help a student learn better a single, new, previously unseen task.
|
| 338 |
+
|
| 339 |
+
Knowledge distillation (Hinton et al., 2015) distills information form a larger deep net into a smaller one. It assumes both nets are trained on the same dataset. In contrast, our technique allows knowledge transfer between different source and target domains.
|
| 340 |
+
|
| 341 |
+
Actor-mimic (Parisotto et al., 2016) enables an agent to learn how to address multiple tasks simultaneously and generalize the extracted knowledge to new domains. A single policy net learns how to act in a set of tasks following the guidance of several expert teachers. A combination of feature regression and cross entropy loss is used to encourage the student to produce similar actions and representations. Our proposed technique differs in that we take advantage of a teachers representation at the beginning of training,
|
| 342 |
+
|
| 343 |
+
Learning without forgetting (Li & Hoiem, 2016) permits to add a new task to a deep net without forgetting the original capabilities. Importantly, only data from the new task is used and the old capabilities are retained by first recording the old networks output on the new data. Similar techniques have been developed by Furlanello et al. (2016); Jung et al. (2016). In contrast, we transfer ‘knowledge’ from teacher networks more explicitly.
|
| 344 |
+
|
| 345 |
+
Growing a Brain (Wang et al., 2017) analyzes the parameters which change during fine-tuning and points out that more natural model adaptation is obtained when increasing the model capacity, by either extending width or depth. Appropriate normalization is essential to significantly outperform classical fine-tuning. Since this technique is based on fine-tuning, it differs from our student-teacher based approach.
|
| 346 |
+
|
| 347 |
+
Other related work includes policy distillation (Rusu et al., 2016a), domain adaptation (Pan & Yang, 2010; Long et al., 2015; Tzeng et al., 2015) or lifelong learning (Chen & Liu, 2016; Thrun, 1998; Mitchell et al., 2015; Ruvolo & Eaton, 2013).
|
md/train/BJesDsA9t7/BJesDsA9t7.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BETTER ACCURACY WITH QUANTIFIED PRIVACY: REPRESENTATIONS LEARNED VIA RECONSTRUCTIVE ADVERSARIAL NETWORK
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The remarkable success of machine learning, especially deep learning, has produced a variety of cloud-based services for mobile users. Such services require an end user to send data to the service provider, which presents a serious challenge to end-user privacy. To address this concern, prior works either add noise to the data or send features extracted from the raw data. They struggle to balance between the utility and privacy because added noise reduces utility and raw data can be reconstructed from extracted features.
|
| 8 |
+
|
| 9 |
+
This work represents a methodical departure from prior works: we balance between a measure of privacy and another of utility by leveraging adversarial learning to find a sweeter tradeoff. We design an encoder that optimizes against the reconstruction error (a measure of privacy), adversarially by a Decoder, and the inference accuracy (a measure of utility) by a Classifier. The result is RAN, a novel deep model with a new training algorithm that automatically extracts features for classification that are both private and useful.
|
| 10 |
+
|
| 11 |
+
It turns out that adversarially forcing the extracted features to only conveys the intended information required by classification leads to an implicit regularization leading to better classification accuracy than the original model which completely ignores privacy. Thus, we achieve better privacy with better utility, a surprising possibility in machine learning! We conducted extensive experiments on five popular datasets over four training schemes, and demonstrate the superiority of RAN compared with existing alternatives.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Today’s most robust and accurate models are boosted by deep learning techniques, which benefit a lot of mobile intelligent services, such as speech-based assistant (e.g. Siri), face recognition enabled phone-unlock (e.g. FaceID). However, the uncontrolled submission of raw sound, image, and human activity data from mobile users to service provider has well-known privacy risks Abadi et al. (2016). For example, the underlying correlation detection, re-identification and other malicious mining Dwork et al. (2017); Bhatia et al. (2016). Different from pinning hopes on service providers to anonymise data for privacy-preserving, we present to encode each piece of raw data in the enduser side and only send the encoded data to the service provider. And the encoded data must be both private and useful. Privacy can be quantified by the risk of sensitive raw data disclosure given the encoded data. For classification services, utility can be quantified by the inference accuracy, achieved by the service provider using a discriminative model.
|
| 16 |
+
|
| 17 |
+
Existing solutions addressing the privacy concern struggle to balance between above two seemingly conflicting objectives: privacy vs. utility. An obvious and widely practiced solution to the above problem is to transform the raw data into features and upload the features only, like Google Now GoogleNow (2018); Google Cloud Machine Learning Engine also provides API to preprocess the raw data into engineering features before uploading GoogleCloud (2018). This solution not only alleviates the privacy concern but also reduces the mobile data usage. However, it does not provide any quantifiable privacy guarantee. It is well known that we can reconstruct the raw data from the features Mahendran & Vedaldi (2015). As a result, Ossia et al. (2017) further apply dimensionality reduction and add noise to the features before sending them to the service provider, which unfortunately result in inference accuracy degradation.
|
| 18 |
+
|
| 19 |
+
Unlike previous work, we aim to systematically derive deep features for a sweeter tradeoff between privacy and utility using deep neural networks, by leveraging adversarial training. Our key idea is to judiciously combine generative learning, for maximizing reconstruction error, and discriminative learning, for minimizing discriminative error. Specifically, we present Reconstructive Adversarial Network (RAN), an end-to-end deep model with a new training algorithm. RAN controls two types of descent gradients, i.e., reconstruction error and discriminative error, in back-propagation process to guide the training of a feature extractor or Encoder.
|
| 20 |
+
|
| 21 |
+
Defining the exact adversarial attacker and finding the right measurement for privacy is an open problem in itself Mendes & Vilela (2017). In this paper, we quantify Privacy using an intuitive metric, i.e., the difficulty of reconstructing raw data via a generative model, or the reconstruction error. In this case, the adversarial attacker is defined as a data reconstructor. Therefore, as shown in Figure 2, a RAN consists of three parts: a feature extractor (Encoder), a utility discriminator (Classifier), and an adversarial reconstructor (Decoder). The output of the Encoder feeds to the input of the Classifier and the Decoder. We envision the Encoder runs in mobile devices and processes raw data into features. The Classifier runs in an untrusted platform, e.g. the cloud. A malicious party can seek to reconstruct the raw data from the features using the Decoder. There is no theoretic guarantee on end-to-end training the colloborated discriminative model and generative model. Therefore, we present a novel algorithm to train the RAN via an adversarial process, i.e., training the Encoder with a Classifier first to improve intermediate features’ utility for discriminative tasks and confronting the Encoder with an adversary Decoder to enhance the features’ privacy. All three parts, Encoder, Classifier and Decoder, are iteratively trained using gradient descent. From the manifold perspective, the two separate flows across RAN’s Encoder, Decoder and Classifier, i.e., decent gradients of discrimination error and reconstruction error from the end of Classifier and Decoder in back-propagation, guide the exact model parameter updating, which can iteratively derive the privacy-specific and utility-imposed feature manifold.
|
| 22 |
+
|
| 23 |
+
Using MNIST LeCun (1998), CIFAR-10Krizhevsky et al. (2014), ImageNet Deng et al. (2009), Ubisound Sicong et al. (2017) and Har UCI (2017) benchmark datasets, we show RAN is effective in training an Encoder for end users to generate deep features that are both private and useful.
|
| 24 |
+
|
| 25 |
+
Surprisingly, we observe adversarial learned features to remove redundant information, for privacy, even surpass the accuracy of the original model. Removing redundant information enhances the generalization. See $\ S \ O 3$ and $\ S$ A for more details. This better generalization is as auspicious illustration that in practice, with machine learning, we can gain both utility and privacy at the same time.
|
| 26 |
+
|
| 27 |
+
In the rest of this paper, we elaborate RAN’s design in $\ S 2$ and evaluate the performance of RAN in $\ S \ O 3$ . We next review the related work in $\ S 4$ and conclude this work in $\ S 5$ . We finally present the theoretic interpretation of RAN in Appendix $\ S$ A.
|
| 28 |
+
|
| 29 |
+
# 2 DESIGN OF RAN
|
| 30 |
+
|
| 31 |
+
This section first formulates the privacy preserving problem, and then elaborates on RAN’s design.
|
| 32 |
+
|
| 33 |
+
2.1 PROBLEM DEFINITION OF MOBILE DATA PRIVACY PRESERVING
|
| 34 |
+
|
| 35 |
+
Many services exist today to analyze data from end users. In this work, we do not trust service providers for the privacy of data: they could be malicious or subject to malicious exploits. For example, as shown in Fig 1, an end user takes a picture of a product and send it to a cloud-based service to find a place to purchase it, which is indeed a service Amazon provides. A lot of sensitive information could accidentally come with the picture, such as personal information and user location in the background.
|
| 36 |
+
|
| 37 |
+
Our key insight is that most services actually do not need the raw data. Therefore, the mobile user can encode raw data into features through a multi-layer Encoder (E) on the client side and only deliver features to the service provider. Such features ideally should have following two properties: Utility: contain enough essential information of raw data so that they are useful for the intended service, e.g., high accuracy for object recognition; Privacy: it is hard to recover the original information of raw data based on perturbed features through a reverse deep model Zhang et al. (2016).
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Framework of mobile data privacy preserving. Mobile users leverage the learned Encoder to generate deep features from the raw data (i.e., ”tea bag” picture) before submit it. And the service provider use the learned Classifier based on the received deep features, to recognize the object in the picture and recommend a seller.
|
| 41 |
+
|
| 42 |
+
# 2.2 UTILITY AND PRIVACY METRICS
|
| 43 |
+
|
| 44 |
+
In this work, we focus on classification services. Therefore, utility is quantified as the inference accuracy of a discriminative model, employed by the service provider. Since defining the exact adversarial attacker and finding the right measurement for privacy is an open problem in itself Mendes & Vilela (2017), this paper quantifies privacy by an intuitive metric, i.e., the reconstruction error in a reversed deep model, $X$ , employed by a malicious party. The reconstruction error measures the risk of original data disclosure. Since the Encoder is distributed to mobile users, we assume it is available to both service providers and potential attackers. That is, both the service provider and the malicious party can train their models using raw data and their corresponding Encoder output. As such we can restate the desirable properties for the Encoder output as:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r l } { \mathrm { U t i l i t y } . } & { { } M a x p r o b ( Y _ { i } ^ { \prime } = Y _ { i } ) , i \in \mathbf { T } } \\ { \mathrm { P r i v a c y } . } & { { } M a x M i n | I _ { i } - I _ { i } ^ { \prime } | ^ { 2 } , i \in \mathbf { T } } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where, $p r o b ( Y _ { i } ^ { \prime } = Y _ { i } )$ denotes the correct inference probability, i.e., accuracy, in the classification service with the testing data $\mathbf { T }$ . $Y _ { i } ^ { \prime }$ and $Y _ { i }$ is the inference class and the true label, respectively. $| I _ { i } - I _ { i } ^ { \prime } | ^ { 2 }$ is the Euclidean distance, i.e., reconstruction error, between the raw data $I _ { i }$ and the mimic data $I _ { i } ^ { \prime }$ reconstructed by a malicious party with the Encoder output.
|
| 51 |
+
|
| 52 |
+
The first objective (Utility) is well-understood for discriminative learning. It can be achieved via a standard optimization process, i.e., minimizing the cross entropy between the predicted label $Y _ { i } ^ { \prime }$ and ground truth $Y _ { i }$ in a supervised manner Kruse et al. (2013). The inner part of the second objective, M inX $| I _ { i } - I _ { i } ^ { \prime } | ^ { 2 }$ , is also well-understood for generative learning. On the other hand, the outer part $M _ { E } \lvert I _ { i } - I _ { i } ^ { \prime } \rvert ^ { 2 }$ is the opposite, i.e., maximizing the reconstruction error. Therefore, the Encoder and the reverse deep model employed by the malicious party $( X )$ are adversarial to each other in their optimization objectives.
|
| 53 |
+
|
| 54 |
+
Achieving above two objectives at the same time is challenging, since utility, i.e., maximized accuracy, and privacy, i.e., maximized reconstruction error, are conflicting objectives to the feature extractor, i.e., Encoder. When improving Utility, the Encoder must extract features to represent the relevant essence of data; when improving Privacy, the Encoder can discard the utility-relevant essence of the data. If not done properly, the Encoder output optimized for Utility leads to effective data reconstruction by a reverse model and therefore poor Privacy Rifai et al. (2011).
|
| 55 |
+
|
| 56 |
+
# 2.3 ARCHITECTURE OF RAN
|
| 57 |
+
|
| 58 |
+
To tackle above challenges, we present RAN to train a feature extractor, i.e., Encoder, with good trade-offs between privacy and utility. As shown in Fig 2, RAN employ two additional neural network modules, Decoder $( D )$ and Classifier $( C )$ , to train the Encoder $( E )$ . The Classifier simulates the intended classification service; when RAN is trained by the service provider, the Classifier can be the same discriminative model eventually used. The Decoder simulates a malicious attacker that attempts to reconstruct the raw data from the Encoder output. All the three modules are end-to-end trained to establish the Encoder (E) for end-users to extract deep features $E ( I )$ from raw data $I$ . The training is an iterative process that will be elaborated in $\ S 2 . 4$ . Below we first introduce RAN’s neural network architecture, along with some empirically gained design insights.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Architecture of reconstructive adversarial network (RAN).
|
| 62 |
+
|
| 63 |
+
• The Encoder $\mathbf { ( E ) }$ consists of an input layer, multiple convolutional layers, pooling layers, and batch-normalization layers. We note that the clever usage of pooling layers and batchnormalization layers contribute to deep feature’s utility and privacy. The batch-normalization layer helps the features’ utility because it normalize the activation to avoid being too high or too low thus has an regularization affect Ioffe & Szegedy (2015). It contributes to features’ privacy as well since it is hard for Decoder to recover detail information from normalized features. And then, the max-pooling layer is helpful to enhance feature’s privacy, because none of un-pooling techniques can recover fine details from size-reduced features through shifting small parts to precisely arrange them into a larger meaningful structure Milletari et al. (2016).
|
| 64 |
+
|
| 65 |
+
• The Decoder $\mathbf { \eta } ^ { ( \mathbf { D } ) }$ is a usual Encoder turned upside down, composed of multiple un-pooling layers Mahendran & Vedaldi (2015) and deconvolutional layers Zeiler et al. (2010). We note that the use of Decoder in training Encoder is to simulate a malicious party. After obtaining a (binary) version of the Encoder, a malicious party is free to explore any neural architectures to reconstruct the raw data. In this paper, we choose a worst possible Decoder, i.e., an exactly layer-to-layer reversed architecture to mirror the Encoder. That is, we assume a powerful adversarial Decoder that knows the Encoder’s operations and connections in training. We also note that the architecture and training algorithm of RAN can easily incorporate other architectures as the Decoder.
|
| 66 |
+
|
| 67 |
+
• the Classifier (C) builds a multi-layer perceptron (MLP) to process deep features and output inference results with several full-connected layers Kruse et al. (2013). As we noted for the Decoder above, a service provider can explore any neural architectures for its discriminative model, given the Encoder. The reason we choose this specific architecture to train the Encoder is because some of the most successful CNN architectures, e.g. VGG and AlexNet, which can be viewed as as the Encoder plus the Classifier of our choice.
|
| 68 |
+
|
| 69 |
+
# 2.4 TRAINING ALGORITHM OF RAN
|
| 70 |
+
|
| 71 |
+
Our goal with RAN is to train an Encoder that can produce output that is both useful, i.e., leading to high inference accuracy when used for classification tasks, and private, i.e., leading to high reconstructive error when reverse engineered by an attacker. As we noted in $\ S 2 . 1$ , these two objectives can be competing when taken naively. The key idea of RAN’s training algorithm is to train the Encoder along with the Classifier and the Decoder, which simulate the service provider and a malicious attacker, respectively. Given a training dataset $\mathbf { T }$ of $m$ pairs of I, the raw data, and Y, the true label, we train a RAN through an iterative process with three stages:
|
| 72 |
+
|
| 73 |
+
# Algorithm 1: Mini-batch stochastic training of reconstructive adversarial network (RAN)
|
| 74 |
+
|
| 75 |
+
Input: Dataset T
|
| 76 |
+
Output: RAN’s Weights $\{ \theta _ { e } , \theta _ { d } , \theta _ { c } \}$
|
| 77 |
+
1 Initialize $\theta _ { e }$ , $\theta _ { d } , \theta _ { c }$ ;
|
| 78 |
+
2 for $n$ epochs do
|
| 79 |
+
3 Sample mini-batch $I$ of $m$ samples from $\mathbf { T }$ ;
|
| 80 |
+
4 for $k$ steps do
|
| 81 |
+
5 Update $\theta _ { e }$ and $\theta _ { c }$ by gradient ascent with learning rate $l _ { 1 }$ : minimize $O _ { d }$ ;
|
| 82 |
+
6 Update $\theta _ { d }$ by gradient ascent with learning rate $l _ { 2 }$ : minimize $O _ { g }$ ;
|
| 83 |
+
7 end
|
| 84 |
+
8 Update $\theta _ { e }$ and $\theta _ { c }$ by gradient ascent with learning rate $l _ { 3 }$ : minimize $O _ { a }$ ;
|
| 85 |
+
9 end
|
| 86 |
+
10 $\ast \mathbf { N }$ ote: $n$ and $k$ are two important hyper-parameters
|
| 87 |
+
|
| 88 |
+
1. Discriminative training maximizes the accuracy in Classifier; mathematically, it minimizes the cross entropy $H$ between predicted class $\dot { C } ( E ( I _ { i } ) )$ and true label $Y _ { i }$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
O _ { d } = \sum _ { i = 1 } ^ { m } H ( Y _ { i } - C ( E ( I _ { i } ) ) ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
2. Generative training minimizes the reconstructive error by the Decoder:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
O _ { g } = \sum _ { i = 1 } ^ { m } | I _ { i } - D ( E ( I _ { i } ) ) | ^ { 2 }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
3. Adversarial training finds a tradeoff point between utility and privacy:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
O _ { a } = \sum _ { i = 1 } ^ { m } \lambda H | Y _ { i } - C ( E ( I _ { i } ) ) | - ( 1 - \lambda ) | I _ { i } - D ( E ( I _ { i } ) ) | ^ { 2 }
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
It is essentially a Lagrangian function of the objectives of the first two stages. $\lambda$ is the Lagrange multiplier that can be used to balance between utility and privacy.
|
| 107 |
+
|
| 108 |
+
Algorithm 1 summarizes the three-stage training algorithm. And we leverage mini-batch techniques to balance the training robustness and efficiency (line 3) Li et al. (2014). Within each epoch, we first perform the discrminative and generative stages (line 5, 6) to initialize model weights. And then, we perform the adversarial stage (line 8) to seek a balance between utility and privacy. We note that $k$ in line 4 is a hyper-parameter of first two stages. These $k$ steps followed by a single iteration of the third stage is trying to synchronize the convergence speed of these three training stages well, borrowing existing techniques in generative adversarial network Goodfellow et al. (2014). Our implementation uses an overall optimized value, $k = 3$ , through comparing several discrete options. And we leverage the AdamOptimizer Kingma & Ba (2014) with an adaptive learning rate for all three stages (line 5, 6 and 8).
|
| 109 |
+
|
| 110 |
+
# 3 EVALUATION
|
| 111 |
+
|
| 112 |
+
In this section, we first compare RAN’s performance on privacy-utility tradeoff with three baselines and then visualize the utility and privacy of resulting Encoder output.
|
| 113 |
+
|
| 114 |
+
Evaluation tasks and models. We evaluate RAN, especially the resulting Encoder, with five popular classification services. Specifically, RAN is evaluated for hand-written digit recognition $T _ { 1 }$ : MNIST LeCun (1998)), image classification $T _ { 2 }$ : CIFAR-10 Krizhevsky et al. (2014), $T _ { 3 }$ : ImageNet Deng et al. (2009)), acoustic event sensing $T _ { 4 }$ : UbiSound Sicong et al. (2017)), and the accelerometer and gyroscope data based human activity recognition ${ T } _ { 5 }$ : Har UCI (2017)). According to the sample size, the LeNet is selected as the neural architectures of RAN’s Encoder plus Classifier for $T _ { 1 }$ , $T _ { 4 }$ and $T _ { 5 }$ , while AlexNet and VGG-16 are chosen for $T _ { 2 }$ and $T _ { 3 }$ , respectively. To assume a powerful adversary that knows the Encoder in the training, the RAN’s Decoder exactly mirrors its Encoder for each task in the training.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 3: Performance comparison of RAN with three baselines on four datasets (MNIST, ImageNet, UbiSound and Har). Y-axis is the test reconstruction error, normalized by log operation. And X-axis represents the utility (accuracy).
|
| 118 |
+
|
| 119 |
+
# 3.1 UTILITY VS. PRIVACY TRADEOFFS
|
| 120 |
+
|
| 121 |
+
This experiment illustrates the superiority of RAN compared with three state-of-the-art data privacy preserving baselines. It does so with five tasks $( T _ { 1 } , T _ { 2 } , T _ { 3 } , T _ { 4 } , T _ { 5 } )$ . However, due to space limit we do not show the results for CIFAR-10 because they are similar to those for ImageNet.
|
| 122 |
+
|
| 123 |
+
• Noisy Data (Noisy) method perturbs the raw data, through adding random Laplace noise to the raw data $I$ and then submit the noisy data $\overline { I }$ to the service provider. This is a typical local differential privacy method He & Cai (2017); Dwork et al. (2010). The utility of noisy data is the inference accuracy in a standard deep model, and its privacy is evaluated by the information loss metric, i.e., $| I - { \check { I } } | ^ { 2 }$ . DNN method encodes the raw data into deep features, using a DNN based encoder (e.g. the convolutional and pooling layers of LeNet, AlexNet, VGG), and only deliver deep features to the service provider GoogleCloud (2018); GoogleNow (2018). Its privacy is tested by the reconstruction error in a Deconvolutional model (mirrors of the encoder), and the the accuracy evaluates the utility in a DNN based classifier (e.g. the fully-connected layers of LeNet, AlexNet, VGG). DNN(resized) method further perturbs above deep features through principal components analysis and Laplace noise injection, and then deliver the perturbed deep features to the service provider Ossia et al. (2017). Its privacy and utility are also tested by the deep model based decoder and classifier, same with that in the DNN baseline. RAN automatically transform the raw data into features, i.e., Encoder output, and then deliver them to the service provider. The privacy of RAN’s Encoder output is tested by the reconstruction error in a separately trained decoder, which is taught based on the binary version (input and output) of the trained RAN’s Encoder, to simulate a malicious attacker. And its utility is tested by the inference accuracy in RAN’s Classifier.
|
| 124 |
+
|
| 125 |
+
The DNN method provides a high utility standard, and the Noisy and DNN(resized) methods set a strict benchmark for RAN.
|
| 126 |
+
|
| 127 |
+
Figure 3 summarises the Pareto front of the testing privacy-utility tradeoff by using three baselines and RAN. In this thread of experiments, we inject various noise factor $\{ 0 . 1 , 0 . 2 , . . . 0 . 9 \}$ into each piece of testing data to test the trained Noisy and DNN(resized) baselines, which are both noise related methods. And we test RAN models which are trained under several settings $\{ 0 . 0 1 , 0 . 0 2 , . . . , 0 . 9 \}$ of the Lagrange multiplier $\lambda$ in Eq.4, to recover its tradeoff trends. First, we see RAN’s Encoder output achieves the most stable privacy-utility tradeoff with a constrictive range, compared to those encoded by other three baselines. Second, RAN’s Encoder output achieves the best overall utility than other three baselines. Specifically, RAN’s output privacy (utility) is $\geq 9 5 \%$ on MNIST, Ubisound and Har, $\geq 8 5 \%$ on ImageNet, and $\ge ~ 7 6 \%$ on CIFAR-10, with the proper $\lambda$ setups, which is even larger than that of the original deep model (see DNN baseline). While the accuracy in Noisy and DNN(resized) baselines is unstable, ranging from $2 0 \%$ to $9 3 \%$ . Third, RAN’s output can attain the higher privacy than usual deep features in a traditional DNN, and guarantee competitive privacy compared to others. Moreover, the RAN’s privacy quantified by RAN’s Decoder (the green dashed line in Figure 3) is averagely larger than that measured by a third-party Decoder (green triangles in Figure 3) which is trained given the binary version of RAN’s Encoder.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 4: 3D visualization of the highly separable features learned by standard DNN and RAN’s Encoder output in the feature space. Different color in each figure standards for one class.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 5: Zoom in on two categories, i.e., sailboat and car in the feature space.
|
| 134 |
+
|
| 135 |
+
Summary. Overall, RAN outperforms other three baselines to attain a better privacy-utility tradeoff over five recognition tasks. Second, the features derived by the proposed learning algorithm to remove redundant (sensitive) information, for privacy, even surpass the accuracy of the original model. We refer readers to $\ S$ A for how and why it works from a theoretical perspective. We also note that the regularization parameter $\lambda$ in RAN can be further systematically fine-tuned, e.g., exponentially varied using reinforcement learning, so that discovers a better privacy-utility tradeoff.
|
| 136 |
+
|
| 137 |
+
# 3.2 UTILITY VISUALIZATION OF RAN’S ENCODER OUTPUT
|
| 138 |
+
|
| 139 |
+
To illustrate the utility of RAN’s Encoder output, we visualize how the distribution of RAN’s Encoder output varies from traditional Depp features. First, as shown in Figure 4, RAN’s Encoder output are highly separable, in the feature space, similar to the deep features from traditional DNN. It reflects the utility for subsequent classification. Second, to zoom in on two categories of images for more details in Figure 5, we see that RAN pushes the features towards the constrictive space dominant dominated by the data without redundant information, i.e., ”sailboat without water” and ”car without road”. While the traditional DNN may capture the background ”water” and ”road” information to help the classification of ”sailboat” and ”car”.
|
| 140 |
+
|
| 141 |
+
Summary. First, RAN’s Encoder output is highly separable in feature space as standard DNN do, which indicates the high utility for the subsequent classification tasks. Second, the learning algorithm on RAN pushes features towards essential information and away from redundant background (sensitive) information (see more interpretations in $\ S$ Appendix A).
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 6: From left to right: raw image from ImageNet (Raw), image with Laplace noise (Noisy), images reconstructed from DNN’s features, resized DNN’s features, and RAN’s Encoder output.
|
| 145 |
+
|
| 146 |
+
# 3.3 VISUALIZING OF RAN’S PRIVACY
|
| 147 |
+
|
| 148 |
+
In this experiment, we visualize the privacy of RAN’s Encoder output, i.e. private features, in comparison to other approaches, using two example images from ImageNet. Figure 6 illustrates the pixel image of the raw data, the noisy data, the mimic data reconstructed from DNN’s deep feature, and mimic data reconstructed from RAN’s private features from two ”bus” images from ImageNet datasets. We can find that the image reconstructed by RAN’s Decoder are dramatically corrupted and hard to distinguish the exact information of raw images. As mentioned in $\ S \ 3 . 1$ , the RAN’s Decoder is more potent than a separately trained Decoder on reconstructing RAN’s hidden features.
|
| 149 |
+
|
| 150 |
+
Summary. First, the corrupted reconstructed images by RAN certify the improved privacy of RAN’s Encoder output. Second, the reconstructed images from DNN’s features recover both object (bus) and background (road) information, while RAN’s Encoder tries to contain object information and remove background information. And then RAN leads better privacy and utility (generalization) to its hidden features. More interpretation is in appendix $\ S \ O \mathrm { A }$ .
|
| 151 |
+
|
| 152 |
+
# 4 RELATED WORK
|
| 153 |
+
|
| 154 |
+
Our work is closely related to the following categories of research.
|
| 155 |
+
|
| 156 |
+
Privacy Preserving for Mobile Data: Unlike the typical privacy preserving techniques which are adopted by data collectors (service providers) to release data for public data mining, RAN keeps the raw data under end-user’s control, i.e., the the user submits private features only, rather than raw data, to service providers. For example, randomized noise addition He & Cai (2017) and Differential privacy Dwork et al. (2014); Abadi et al. (2016) techniques have been widely used by service providers to anonymize/remove personally identifiable information or only releases statistical information to publicly release datasets. RAN outperforms Noisy data (a differential privacy method) with better classification utility and competitive privacy $( \ S 3 . 1 )$ , because RAN’s Encoder is end-to-end trained with collaborative utility-specified deep learning and privacy-imposed adversarial learning for a good trade-off between features utility and privacy.
|
| 157 |
+
|
| 158 |
+
Privacy Preserving with Deep Learning: Generally, prior works adopt two classes of approaches to protect end-user’s raw data: the end user modifies raw data before delivering them to service providers Ossia et al. (2017) or multiple end users cooperate to learn a global data mining results, without revealing their individual raw data Li et al. (2017). However, these segmented systematic methods inevitably incur utility drops in subsequent recognition tasks. We has compared RAN with resized noisy deep features according to Ossia et al. (2017) (§3.1), and concluded RAN achieves a better utility against altering raw data into resized deep features. This is because RAN’s Encoder is also trained along with a accuracy discriminator (Classifier) to guarantee utility.
|
| 159 |
+
|
| 160 |
+
Deep Feature Learning Techniques: In order to generate special features to facilitate the subsequent classification utility and protect raw data’s sensitive information from recovering by generative models, RAN is the first to present an end-to-end deep architecture to sidestep the black-box of collaborative discriminative and generative learning via an end-to-end adversarial process. Today’s extensions of discriminative models, generative models, or both, have been studied to seek latent feature variables, which contributes to inference accuracy but incurs easy data reconstruction by reverse techniques Radford et al. (2015); Zhong et al. (2016). And some components used in existing generative models, such as sensitivity penalty in contractive autoencoder Rifai et al. (2011), data probability distribution in generative adversarial network Goodfellow et al. (2014) and KL divergence in variational autoencoder Doersch (2016), can be further integrated into RAN’s framework to define and enhance application-based privacy.
|
| 161 |
+
|
| 162 |
+
# 5 CONCLUSION
|
| 163 |
+
|
| 164 |
+
This paper presents to establish a deep model for mobile data contributor, i.e., mobile users, to encode the raw data into perturbed features before delivering it to the data collector or miner, i.e., service provider. To realize it, we present RAN, a novel deep model for private and useful feature transforming. RAN is the first to not only maximize feature’s classification accuracy but also maximize its reconstruction error via an end-to-end adversarial training process. In particular, RAN consists an Encoder for feature extracting, a Decoder for data reconstruction error (privacy) quantification from Encoder output and a Classifier for accuracy (utility) discrimination. The proposed training algorithm upon RAN’s contains three phase: discriminative learning function on Encoder and Classifier to boost their discriminative abilities, a generative stage on Decoder to improve its data generative capacity which stand in the position of Encoder’s adversary, and an adversarial stage on Encoder, Classifier and Decoder to achieve our design objectives. Evaluations on five widely used datasets show that RAN’s Encoder output attains a notable privacy-utility tradeoff. In the future, we plan to investigate finer-grained manifold learning techniques on RAN for feature generalization and privacy improvements.
|
| 165 |
+
|
| 166 |
+
A few aspects of RAN do invite further research. First, the RAN framework and the training algorithm can accommodate different choices of privacy quantification, especially application-specific ones. For example, we could measure the privacy by the hidden failure, i.e., the ratio between the background patterns that were discovered based on RANs Encoder output, and the sensitive patterns founded from the raw data, in an object recognition task. Second, the training of two adversaries in RAN’s, i.e., Encoder and Decoder, must be synchronized well to avoid model degradation. It is because of the convergence diversity of Encoder and Decoder. Therefore, some more efforts are needed in RAN, e.g. setting proper iteration steps $k$ and learning rate.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of SIGSAC, pp. 308–318. 2016.
|
| 171 |
+
Jaspreet Bhatia, Travis D Breaux, Liora Friedberg, Hanan Hibshi, and Daniel Smullen. Privacy risk in cybersecurity data sharing. In Workshop on ISCS, pp. 57–64. ACM, 2016.
|
| 172 |
+
Jen-Tzung Chien and Ching-Huai Chen. Deep discriminative manifold learning. In Proceeding of ICASSP, pp. 2672–2676. 2016.
|
| 173 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of CVPR. 2009.
|
| 174 |
+
Carl Doersch. Tutorial on variational autoencoders. arXiv preprint arXiv:1606.05908, 2016.
|
| 175 |
+
Cynthia Dwork, Moni Naor, Toniann Pitassi, and Guy N Rothblum. Differential privacy under continual observation. In Proceedings of STC, pp. 715–724. ACM, 2010.
|
| 176 |
+
Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Journal of Foundations and Trends in Theoretical Computer Science, pp. 211–407, 2014.
|
| 177 |
+
Cynthia Dwork, Adam Smith, Thomas Steinke, and Jonathan Ullman. Exposed! a survey of attacks on private data. Annual Review of Statistics and Its Application, 4:61–84, 2017.
|
| 178 |
+
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.
|
| 179 |
+
|
| 180 |
+
GoogleCloud. Data preparation. https://cloud.google.com/ml-engine/docs/ tensorflow/data-prep, 2018.
|
| 181 |
+
|
| 182 |
+
GoogleNow. Google now launcher. https://en.wikipedia.org/wiki/Google_Now, 2018.
|
| 183 |
+
|
| 184 |
+
Jianping He and Lin Cai. Differential private noise adding mechanism: Basic conditions and its application. In American Control Conference (ACC), 2017, pp. 1673–1678. IEEE, 2017.
|
| 185 |
+
|
| 186 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 187 |
+
|
| 188 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 189 |
+
|
| 190 |
+
Alex Krizhevsky, Nair Vinod, and Hinton Geoffrey. The cifar-10 dataset. https://goo.gl/ hXmru5, 2014.
|
| 191 |
+
|
| 192 |
+
Rudolf Kruse, Christian Borgelt, Frank Klawonn, Christian Moewes, Matthias Steinbrecher, and Pascal Held. Multi-layer perceptrons. pp. 47–81. Springer, 2013.
|
| 193 |
+
|
| 194 |
+
Yann LeCun. The mnist database of handwritten digits. https://goo.gl/t6gTEy, 1998.
|
| 195 |
+
|
| 196 |
+
Mu Li, Tong Zhang, Yuqiang Chen, and Alexander J Smola. Efficient mini-batch training for stochastic optimization. In Proceedings of SIGKDD, pp. 661–670. ACM, 2014.
|
| 197 |
+
|
| 198 |
+
Ping Li, Jin Li, Zhengan Huang, Tong Li, Chong-Zhi Gao, Siu-Ming Yiu, and Kai Chen. Multi-key privacy-preserving deep learning in cloud computing. Future Generation Computer Systems, pp. 76–85, 2017.
|
| 199 |
+
|
| 200 |
+
Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In Proceedings of CVPR, pp. 5188–5196. 2015.
|
| 201 |
+
|
| 202 |
+
Ricardo Mendes and Joao P Vilela. Privacy-preserving data mining: methods, metrics, and applica- ˜ tions. IEEE Access, 5:10562–10582, 2017.
|
| 203 |
+
|
| 204 |
+
Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In Proceedings of 3DV, pp. 565–571. 2016.
|
| 205 |
+
|
| 206 |
+
Seyed Ali Ossia, Ali Shahin Shamsabadi, Ali Taheri, Hamid R Rabiee, Nic Lane, and Hamed Haddadi. A hybrid deep learning architecture for privacy-preserving mobile analytics. arXiv preprint arXiv:1703.02952, 2017.
|
| 207 |
+
|
| 208 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 209 |
+
|
| 210 |
+
Salah Rifai, Pascal Vincent, Xavier Muller, Xavier Glorot, and Yoshua Bengio. Contractive autoencoders: Explicit invariance during feature extraction. In Proceedings ICML, pp. 833–840. 2011.
|
| 211 |
+
|
| 212 |
+
Liu Sicong, Zhou Zimu, Du Junzhao, Shangguan Longfei, Jun Han, and Xin Wang. Ubiear: Bringing location-independent sound awareness to the hard-of-hearing people with smartphones. Journal of IMWUT, 2017.
|
| 213 |
+
|
| 214 |
+
UCI. Har: Dataset for human activity recognition. https://goo.gl/m5bRo1, 2017.
|
| 215 |
+
|
| 216 |
+
Matthew D Zeiler, Dilip Krishnan, Graham W Taylor, and Rob Fergus. Deconvolutional networks. 2010.
|
| 217 |
+
|
| 218 |
+
Qingchen Zhang, Laurence T Yang, and Zhikui Chen. Privacy preserving deep computation model on cloud for big data feature learning. IEEE Transactions on Computers, 65(5), 2016.
|
| 219 |
+
|
| 220 |
+
Guoqiang Zhong, Li-Na Wang, Xiao Ling, and Junyu Dong. An overview on data representation learning: From traditional feature learning to recent deep learning. Journal of Finance and Data Science, pp. 265–278, 2016.
|
| 221 |
+
|
| 222 |
+
# A MANIFOLD BASED INTERPRETATION
|
| 223 |
+
|
| 224 |
+
We resort to the manifold perspective of the deep model. It is common in literature to assume that the high-dimensional raw data lies on a lower dimensional manifold, refers to latent variables Chien & Chen (2016). A DNN can also be viewed as a parametric manifold learner utilizing the nonlinear mapping with multi-layer architecture and connection weights.
|
| 225 |
+
|
| 226 |
+
We decompose the input data $I$ into two orthogonal lower dimensional manifolds:
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
I = I ^ { O D } + I _ { \perp } ^ { O D }
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
Here, the component $I ^ { O D }$ is the ideal manifold component that is both necessary and sufficient for object detection. Thus, ideally, we want our training algorithm to rely on this information for object detection solely. Formally, for the discriminative classifier, this implies that $p r o b ( Y | I ) =$ $p r o b ( Y | I ^ { O D } )$ . And the other manifold component $I _ { \perp } ^ { O D }$ , orthogonal to $I ^ { O D }$ , may or may not contain information for the object class, but it is dispensable for object detection. In practice, the real data does have redundant correlations. Thus $I _ { \perp } ^ { O D }$ may be learned for object detection, but unnecessary. However, revealing $I _ { \perp } ^ { O D }$ is likely to contain sensitive information thus hurt the privacy. If we assume that there does exist a sweet-spot trade-off between utility and privacy, that we hope to find, then it must be the case that $I ^ { O D }$ is not sensitive (as it is necessary and sufficient).
|
| 233 |
+
|
| 234 |
+
The features $F$ learned by standard deep learning algorithms to minimize the training error based on information from $I$ , will mostly likely overlap (non-zero projection) with both $I ^ { \partial D }$ and $I _ { \perp } ^ { O D }$ . And the overlap with $I _ { \perp } ^ { O D }$ compromises the privacy (as evident from our experiments). Apart from privacy, the redundant correlation in $I _ { \perp } ^ { O D }$ is also likely only be spurious in training data. Thus, merely minimizing training loss can lead to over-fitting.
|
| 235 |
+
|
| 236 |
+
This is where we can shoot two stones via an adversarial process. In RAN, the Encoder is trained by utility-specified discriminative learning objective (Eq.(2)) and privacy-imposed adversarial learning objective (Eq.(4)), to find features $F ^ { \prime }$ as shown in Figure 7. The manifold $I ^ { \prime }$ formulated by parametric Encoder is forced by discriminative learning objective (Eq.(2)), just like the traditional approach, to contain information from both $I ^ { O D }$ as well as $\bar { I } _ { \perp } ^ { O D }$ . However, the adversarial training objective (Eq(4)) will push features $F ^ { \prime }$ away (or orthogonal) from $I _ { \perp } ^ { O D }$ . In this way, we get privacy as well, since $F ^ { \prime }$ as a function of $I$ which has two manifolds, being orthogonal to $I _ { \perp } ^ { O D }$ forces it to only depend on $I ^ { O D }$ .
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 7: A new manifold pushed by RAN to form the feature extractor, i.e., Encoder, for utility and privacy. The utility-specified discriminative learning objective (Eq.(2)) push it to contain $I ^ { O { \tilde { D } } }$ and $\dot { I } _ { \perp } ^ { O D }$ , and the privacy-imposed adversarial training objective (Eq(4)) pushes it away from sensitive component IOD⊥ .
|
| 240 |
+
|
| 241 |
+
Meanwhile, from a generalization perspective, in the training data, the spurious information from $I _ { \perp } ^ { O D }$ that might over-fit the training data is iteratively removed by the adversarial training objective (Eq.(4)) automatically leading to enhanced generalization. For example, as shown in Figure 6, if we want to discriminate between ”bus” and ”sailboat”, the ”road” in the picture can help, but it is obviously a bad way of classifying and may not generalize if the test image contains ”bus” without the ”road”. However, ”road” maybe most of the background and retain some information to ease image reconstruction, which is unintended. Adding noise will obfuscate both ”road” and ”bus”, compromising object detection at the cost of privacy. The RAN, instead, will only obfuscate ”road”, making reconstruction impossible without compromising the utility. In fact, RAN will get increased utility due to better generalization.
|
| 242 |
+
|
| 243 |
+
This is an auspicious illustration that in machine learning we can gain both utility and privacy in practice. A rigorous formalism and study of this phenomena could be an independent field in itself.
|
md/train/BJlxm30cKm/BJlxm30cKm.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN EMPIRICAL STUDY OF EXAMPLE FORGETTING DURING DEEP NEURAL NETWORK LEARNING
|
| 2 |
+
|
| 3 |
+
Mariya Toneva∗† Carnegie Mellon University
|
| 4 |
+
|
| 5 |
+
Alessandro Sordoni∗ Microsoft Research Montreal
|
| 6 |
+
|
| 7 |
+
Remi Tachet des Combes∗ Microsoft Research Montreal
|
| 8 |
+
|
| 9 |
+
Adam Trischler Microsoft Research Montreal
|
| 10 |
+
|
| 11 |
+
Yoshua Bengio MILA, Universite de Montr ´ eal ´ CIFAR Senior Fellow
|
| 12 |
+
|
| 13 |
+
Geoffrey J. Gordon Microsoft Research Montreal Carnegie Mellon University
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Inspired by the phenomenon of catastrophic forgetting, we investigate the learning dynamics of neural networks as they train on single classification tasks. Our goal is to understand whether a related phenomenon occurs when data does not undergo a clear distributional shift. We define a “forgetting event” to have occurred when an individual training example transitions from being classified correctly to incorrectly over the course of learning. Across several benchmark data sets, we find that: (i) certain examples are forgotten with high frequency, and some not at all; (ii) a data set’s (un)forgettable examples generalize across neural architectures; and (iii) based on forgetting dynamics, a significant fraction of examples can be omitted from the training data set while still maintaining state-of-the-art generalization performance.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Many machine learning models, in particular neural networks, cannot perform continual learning. They have a tendency to forget previously learnt information when trained on new tasks, a phenomenon usually called catastrophic forgetting (Kirkpatrick et al., 2017; Ritter et al., 2018). One of the hypothesized causes of catastrophic forgetting in neural networks is the shift in the input distribution across different tasks—e.g., a lack of common factors or structure in the inputs of different tasks might lead standard optimization techniques to converge to radically different solutions each time a new task is presented. In this paper, we draw inspiration from this phenomenon and investigate the extent to which a related forgetting process occurs as a model learns examples traditionally considered to belong to the same task.
|
| 22 |
+
|
| 23 |
+
Similarly to the continual learning setting, in stochastic gradient descent (SGD) optimization, each mini-batch can be considered as a mini-“task” presented to the network sequentially. In this context, we are interested in characterizing the learning dynamics of neural networks by analyzing (catastrophic) example forgetting events. These occur when examples that have been “learnt” (i.e., correctly classified) at some time $t$ in the optimization process are subsequently misclassified — or in other terms forgotten — at a time $t ^ { \prime } > t$ . We thus switch the focus from studying interactions between sequentially presented tasks to studying interactions between sequentially presented dataset examples during SGD optimization. Our starting point is to understand whether there exist examples that are consistently forgotten across subsequent training presentations and, conversely, examples that are never forgotten. We will call the latter unforgettable examples. We hypothesize that specific examples consistently forgotten between subsequent presentations, if they exist, must not share commonalities with other examples from the same task. We therefore analyze the proportion of forgettable/unforgettable examples for a given task and what effects these examples have on a model’s decision boundary and generalization error.
|
| 24 |
+
|
| 25 |
+
The goal of our investigation is two-fold. First, we attempt to gain insight into the optimization process by analyzing interactions among examples during learning and their influence on the final decision boundary. We are particularly interested in whether we can glean insight on the compressibility of a dataset, and thereby increase data efficiency without compromising generalization accuracy. It is a timely problem that has been the recent focus of few-shot learning approaches via meta-learning (Finn et al., 2017; Ravi & Larochelle, 2017). Second, we aim to characterize whether forgetting statistics can be used to identify “important” samples and detect outliers and examples with noisy labels (John, 1995; Brodley & Friedl, 1999; Sukhbaatar et al., 2014; Jiang et al., 2018).
|
| 26 |
+
|
| 27 |
+
Identifying important, or most informative examples is an important line of work and was extensively studied in the literature. Techniques of note — among others — are predefined curricula of examples (Bengio & LeCun, 2007), self-paced learning (Kumar et al., 2010), and more recently meta-learning (Fan et al., 2017). These research directions usually define “hardness” or “commonality” of an example as a function of the loss on that particular example at some point during training (or possibly at convergence). They do not consider whether some examples are consistently forgotten throughout learning. Very recently, Chang et al. (2017) consider re-weighting examples by accounting for the variance of their predictive distribution. This is related to our definition of forgetting events, but the authors provide little analysis of the extent to which the phenomenon occurs in their proposed tasks. Our purpose is to study this phenomenon from an empirical standpoint and characterize its prevalence in different datasets and across different model architectures.
|
| 28 |
+
|
| 29 |
+
Our experimental findings suggest that: a) there exist a large number of unforgettable examples, i.e., examples that are never forgotten once learnt, those examples are stable across seeds and strongly correlated from one neural architecture to another; b) examples with noisy labels are among the most forgotten examples, along with images with “uncommon” features, visually complicated to classify; c) training a neural network on a dataset where a very large fraction of the least forgotten examples have been removed still results in extremely competitive performance on the test set.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Curriculum Learning and Sample Weighting Curriculum learning is a paradigm that favors learning along a curriculum of examples of increasing difficulty (Bengio et al., 2009). This general idea has found success in a variety of areas since its introduction (Kumar et al., 2010; Lee & Grauman, 2011; Schaul et al., 2015). Kumar et al. (2010) implemented their curriculum by considering easy the examples with a small loss. In our experiments, we empirically validate that unforgettable examples can be safely removed without compromising generalization. Zhao & Zhang (2015); Katharopoulos & Fleuret (2018) relate sample importance to the norm of its loss gradient with respect to the parameters of the network. Fan et al. (2017); Kim & Choi (2018); Jiang et al. (2018) learn a curriculum directly from data in order to minimize the task loss. Jiang et al. (2018) also study the robustness of their method in the context of noisy examples. This relates to a rich literature on outlier detection and removal of examples with noisy labels (John, 1995; Brodley & Friedl, 1999; Sukhbaatar et al., 2014; Jiang et al., 2018). We will provide evidence that noisy examples rank higher in terms of number of forgetting events. Koh & Liang (2017) borrow influence functions from robust statistics to evaluate the impact of the training examples on a model’s predictions.
|
| 34 |
+
|
| 35 |
+
Deep Generalization The study of the generalization properties of deep neural networks when trained by stochastic gradient descent has been the focus of several recent publications (Zhang et al., 2016; Keskar et al., 2016; Chaudhari et al., 2016; Advani & Saxe, 2017). These studies suggest that the generalization error does not depend solely on the complexity of the hypothesis space. For instance, it has been demonstrated that over-parameterized models with many more parameters than training points can still achieve low test error (Huang et al., 2017; Wang et al., 2018) while being complex enough to fit a dataset with completely random labels (Zhang et al., 2016). A possible explanation for this phenomenon is a form of implicit regularization performed by stochastic gradient descent: deep neural networks trained with SGD have been recently shown to converge to the maximum margin solution in the linearly separable case (Soudry et al., 2017; Xu et al., 2018). In our work, we provide empirical evidence that generalization can be maintained when removing a substantial portion of the training examples and without restricting the complexity of the hypothesis class. This goes along the support vector interpretation provided by Soudry et al. (2017).
|
| 36 |
+
|
| 37 |
+
# 3 DEFINING AND COMPUTING EXAMPLE FORGETTING
|
| 38 |
+
|
| 39 |
+
Our general case study for example forgetting is a standard classification setting. Given a dataset $\mathbfcal { D } = ( \mathbf { x } _ { i } , y _ { i } ) _ { i }$ of observation/label pairs, we wish to learn the conditional probability distribution $p ( \boldsymbol { y } | \mathbf { x } ; \boldsymbol { \theta } )$ using a deep neural network with parameters $\theta$ . The network is trained to minimize the empirical risk $\begin{array} { r } { R = \frac { 1 } { | \mathcal { D } | } \sum _ { i } L ( p ( y _ { i } | \mathbf { x } _ { i } ; \boldsymbol { \theta } ) , \dot { y _ { i } } ) } \end{array}$ , where $L$ denotes the cross-entropy loss and $y _ { i } \in$ $1 , \ldots k$ . The minimization is performed using variations of stochastic gradient descent, starting from initial random parameters $\mathcal { \dot { \theta } } ^ { 0 }$ , and by sampling examples at random from the dataset $\mathcal { D }$ .
|
| 40 |
+
|
| 41 |
+
Forgetting and learning events We denote by $\hat { y } _ { i } ^ { t } = \arg \operatorname* { m a x } _ { k } p ( y _ { i k } | \mathbf { x } _ { i } ; \boldsymbol { \theta } ^ { t } )$ the predicted label for example $\mathbf { x } _ { i }$ obtained after $t$ steps of SGD. We also let $\operatorname { a c c } _ { i } ^ { t } = \mathbb { 1 } _ { \hat { y } _ { i } ^ { t } = y _ { i } }$ be a binary variable indicating whether the example is correctly classified at time step $t$ . Example $i$ undergoes a forgetting event when $\operatorname { a c c } _ { i } ^ { t }$ decreases between two consecutive updates: $\operatorname { a c c } _ { i } ^ { t } > \operatorname { a c c } _ { i } ^ { t + 1 }$ . In other words, example $i$ is misclassified at step $t + 1$ after having been correctly classified at step $t$ . Conversely, a learning event has occurred if $\mathrm { a c c } _ { i } ^ { t } < \mathsf { a c c } _ { i } ^ { t + 1 }$ . Statistics that will be of interest in the next sections include the distribution of forgetting events across examples and the first time a learning event occurs.
|
| 42 |
+
|
| 43 |
+
Classification margin We will also be interested in analyzing the classification margin. Our predictors have the form $p ( y _ { i } | \mathbf { x } _ { i } ; \theta ) = \sigma ( \beta ( \mathbf { x } _ { i } ) )$ , where $\sigma$ is a sigmoid (softmax) activation function in the case of binary (categorical) classification. The classification margin $m$ is defined as the difference between the logit of the correct class and the largest logit among the other classes, i.e. $m = \beta _ { k } - \arg \operatorname* { m a x } _ { k ^ { \prime } \neq k } \beta _ { k ^ { \prime } }$ , where $k$ is the index corresponding to the correct class.
|
| 44 |
+
|
| 45 |
+
Unforgettable examples We qualify examples as unforgettable if they are learnt at some point and experience no forgetting events during the whole course of training: example $i$ is unforgettable if the first time it is learnt $t ^ { * }$ verifies $t ^ { * } < \infty$ and for all $k \geq t ^ { * }$ , $\mathsf { a c c } _ { i } ^ { k } \bar { = } 1$ . Note that, according to this definition, examples that are never learnt during training do not qualify as unforgettable. We refer to examples that have been forgotten at least once as forgettable.
|
| 46 |
+
|
| 47 |
+
# 3.1 PROCEDURAL DESCRIPTION AND EXPERIMENTAL SETTING
|
| 48 |
+
|
| 49 |
+
Following the previous definitions, monitoring forgetting events entails computing the prediction for all examples in the dataset at each model update, which would be prohibitively expensive. In practice, for each example, we subsample the full sequence of forgetting events by computing forgetting statistics only when the example is included in the current mini-batch; that is, we compute forgetting across presentations of the same example in subsequent mini-batches. This gives a lower bound on the number of forgetting events an example undergoes during training.
|
| 50 |
+
|
| 51 |
+
We train a classifier on a given dataset and record the forgetting events for each example when they are sampled in the current mini-batch. For the purposes of further analysis, we then sort the dataset’s examples based on the number of forgetting events they undergo. Ties are broken at random when sampling from the ordered data. Samples that are never learnt are considered forgotten an infinite number of times for sorting purposes. Note that this estimate of example forgetting is computationally expensive; see Sec. 6 for a discussion of a cheaper method.
|
| 52 |
+
|
| 53 |
+
We perform our experimental evaluation on three datasets of increasing complexity: MNIST (LeCun et al., 1999), permuted MNIST – a version of MNIST that has the same fixed permutation applied to the pixels of all examples, and CIFAR-10 (Krizhevsky,
|
| 54 |
+
|
| 55 |
+
<table><tr><td>Algorithm1Computingforgettingstatisti</td></tr><tr><td>initialize prev_acc = O,i ∈ D initialize forgetting T[i] = O,i ∈D while not training done do B~ D # sample a minibatch</td></tr><tr><td>for example i∈ B do compute acci if prev_acc;>acci then</td></tr><tr><td>T[i]=T[]+1 prev_acc = acci</td></tr><tr><td>gradient update classifier on B return T</td></tr></table>
|
| 56 |
+
|
| 57 |
+
2009). We use various model architectures and training schemes that yield test errors comparable with the current state-of-the-art on the respective datasets. In particular, the MNIST-based experiments use a network comprised of two convolutional layers followed by a fully connected one, trained using SGD with momentum and dropout. This network achieves $0 . 8 \%$ test error. For CIFAR$I O$ , we use a ResNet with cutout (DeVries & Taylor, 2017) trained using SGD and momentum with a particular learning rate schedule. This network achieves a competitive $3 . 9 9 \%$ test error. For full experimentation details, see the Supplementary.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: Histograms of forgetting events on (from left to right) MNIST, permutedMNIST and CIFAR-10. Insets show the zoomed-in y-axis.
|
| 61 |
+
|
| 62 |
+
# 4 CHARACTERIZING EXAMPLE FORGETTING
|
| 63 |
+
|
| 64 |
+
Number of forgetting events We estimate the number of forgetting events of all the training examples for the three different datasets (MNIST, permutedMNIST and CIFAR-10) across 5 random seeds. The histograms of forgetting events computed from one seed are shown in Figure 1. There are 55,012, 45,181 and 15,628 unforgettable examples common across 5 seeds, they represent respectively $9 1 . 7 \%$ , $7 5 . 3 \%$ , and $3 1 . 3 \%$ of the corresponding training sets. Note that datasets with less complexity and diversity of examples, such as MNIST, seem to contain significantly more unforgettable examples. permutedMNIST exhibits a complexity balanced between MNIST (easiest) and CIFAR-10 (hardest). This finding seems to suggest a correlation between forgetting statistics and the intrinsic dimension of the learning problem, as recently formalized by Li et al. (2018).
|
| 65 |
+
|
| 66 |
+
Stability across seeds To test the stability of our metric with respect to the variance generated by stochastic gradient descent, we compute the number of forgetting events per example for 10 different random seeds and measure their correlation. From one seed to another, the average Pearson correlation is $8 9 . 2 \%$ . When randomly splitting the 10 different seeds into two sets of 5, the cumulated number of forgetting events within those two sets shows a high correlation of $9 7 . 6 \%$ . We also ran the original experiment on 100 seeds to devise $9 5 \%$ confidence bounds on the average (over 5 seeds) number of forgetting events per example (see Appendix 13). The confidence interval of the least forgotten examples is tight, confirming that examples with a small number of forgetting events can be ranked confidently.
|
| 67 |
+
|
| 68 |
+
Forgetting by chance In order to quantify the possibility of forgetting occurring by chance, we additionally analyze the distribution of forgetting events obtained under the regime of random update steps instead of the true SGD steps. In order to maintain the statistics of the random updates similar to those encountered during SGD, random updates are obtained by shuffling the gradients produced by standard SGD on a main network (more details are provided in Appendix 12). We report the histogram of chance forgetting events in Supplementary Figure 13: examples are being forgotten by chance a small number of time, at most twice and most of the time less than once. The observed stability across seeds, low number of chance forgetting events and the tight confidence bounds suggest that it is unlikely for the ordering produced by the metric to be the by-product of another unrelated random cause.
|
| 69 |
+
|
| 70 |
+
First learning events We investigate whether unforgettable and forgettable examples need to be presented different numbers of times in order to be learnt for the first time (i.e. for the first learning event to occur, as defined in Section 3). The distributions of the presentation numbers at which first learning events occur across all datasets can be seen in Supplemental Figure 8. We observe that, while both unforgettable and forgettable sets contain many examples that are learnt during the first 3-4 presentations, the forgettable examples contain a larger number of examples that are first learnt later in training. The Spearman rank correlation between the first learning event presentations and the number of forgetting events across all training examples is 0.56, indicating a moderate relationship.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Pictures of unforgettable (Top) and forgettable examples (Bottom) of every CIFAR-10 class. Forgettable examples seem to exhibit peculiar or uncommon features. Additional examples are available in Supplemental Figure 15.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: Distributions of forgetting events across training examples in CIFAR-10 when $2 0 \%$ of labels are randomly changed. Left. Comparison of forgetting events between examples with noisy and original labels. The most forgotten examples are those with noisy labels. No noisy examples are unforgettable. Right. Comparison of forgetting events between examples with noisy labels and the same examples with original labels. Examples exhibit more forgetting when their labels are changed.
|
| 77 |
+
|
| 78 |
+
Misclassification margin The definition of forgetting events is binary and as such fairly crude compared to more sophisticated estimators of example relevance (Zhao & Zhang, 2015; Chang et al., 2017). In order to qualify its validity, we compute the misclassification margin of forgetting events. The misclassification margin of an example is defined as the mean classification margin (defined in Section 3) over all its forgetting events, a negative quantity by definition. The Spearman rank correlation between an example’s number of forgetting events and its mean misclassification margin is -0.74 (computed over 5 seeds, see corresponding 2D-histogram in Supplemental Figure 9). These results suggest that examples which are frequently forgotten have a large misclassification margin.
|
| 79 |
+
|
| 80 |
+
Visual inspection We visualize some of the unforgettable examples in Figure 2 along with some examples that have been most forgotten in the CIFAR-10 dataset. Unforgettable samples are easily recognizable and contain the most obvious class attributes or centered objects, e.g., a plane on a clear sky. On the other hand, the most forgotten examples exhibit more ambiguous characteristics (as in the center image, a truck on a brown background) that may not align with the learning signal common to other examples from the same class.
|
| 81 |
+
|
| 82 |
+
Detection of noisy examples We further investigate the observation that the most forgettable examples seem to exhibit atypical characteristics. We would expect that if highly forgettable examples have atypical class characteristics, then noisily-labeled examples will undergo more forgetting events. We randomly change the labels of $2 0 \%$ of CIFAR-10 and record the number of forgetting events of both the noisy and regular examples through training. The distributions of forgetting events across noisy and regular examples are shown in Figure 3. We observe that the most forgotten examples are those with noisy labels and that no noisy examples are unforgettable. We also compare the forgetting events of the noisy examples to that of the same set of examples with original labels and observe a much higher degree of forgetting in the noisy case. The results of these synthetic experiments support the hypothesis that highly forgettable examples exhibit atypical class characteristics.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 4: Synthetic continual learning setup for CIFAR-10. Background color in each column indicates the training partition, curves track performance on both partitions during interleaved training. Solids lines represent the average of 5 runs and dashed lines represent the standard error. The figure highlights that examples that have been forgotten at least once can “support” those that have never been forgotten, as shown in (c.2) and (b.3).
|
| 86 |
+
|
| 87 |
+
# 4.1 CONTINUAL LEARNING SETUP
|
| 88 |
+
|
| 89 |
+
We observed that in harder tasks such as CIFAR-10, a significant portion of examples are forgotten at least once during learning. This leads us to believe that catastrophic forgetting may be observed, to some extent, even when considering examples coming from the same task distribution. To test this hypothesis, we perform an experiment inspired by the standard continual learning setup (McCloskey & Cohen, 1989; Kirkpatrick et al., 2017). We create two tasks by randomly sampling 10k examples from the CIFAR-10 training set and dividing them in two equally-sized partitions $5 \mathrm { k }$ examples each). We treat each partition as a separate ”task” even though they should follow the same distribution. We then train a classifier for 20 epochs on each partition in an alternating fashion, while tracking performance on both partitions. The results are reported in Figure 4 (a). The background color represents which of the two partitions is currently used for training. We observe some forgetting of the second task when we only train on the first task (panel (a.2)). This is somewhat surprising as the two tasks contain examples from the same underlying distribution.
|
| 90 |
+
|
| 91 |
+
We contrast the results from training on random partitions of examples with ones obtained by partitioning the examples based on forgetting statistics (Figure 4 (b)). That is, we first compute the forgetting events for all examples based on Algorithm 1 and we create our tasks by sampling 5k examples that have zero forgetting events (named f0) and 5k examples that have non-zero forgetting events (named fN). We observe that examples that have been forgotten at least once suffer a more drastic form of forgetting than those included in a random split (compare (a.2) with (b.2)). In panel (b.3) and (c.2) we can observe that examples from task f0 suffer very mild forgetting when training on task fN. This suggests that examples that have been forgotten at least once may be able to “support” those that have never been forgotten. We observe the same pattern when we investigate the opposite alternating sequence of tasks in Figure 4 (b, right).
|
| 92 |
+
|
| 93 |
+
# 5 REMOVING UNFORGETTABLE EXAMPLES
|
| 94 |
+
|
| 95 |
+
As shown in the previous section, learning on examples that have been forgotten at least once minimally impacts performance on those that are unforgettable. This appears to indicate that unforgettable examples are less informative than others, and, more generally, that the more an example is forgotten during training, the more useful it may be to the classification task. This seems to align with the observations in Chang et al. (2017), where the authors re-weight training examples by accounting for the variance of their predictive distribution. Here, we test whether it is possible to completely remove a given subset of examples during training.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 5: Left Generalization performance on CIFAR-10 of ResNet18 where increasingly larger subsets of the training set are removed (mean $+ / -$ std error of 5 seeds). When the removed examples are selected at random, performance drops very fast. Selecting the examples according to our ordering can reduce the training set significantly without affecting generalization. The vertical line indicates the point at which all unforgettable examples are removed from the training set. Right Difference in generalization performance when contiguous chunks of 5000 increasingly forgotten examples are removed from the training set. Most important examples tend to be those that are forgotten the most.
|
| 99 |
+
|
| 100 |
+
In Fig. 5 $( L e f t )$ , we show the evolution of the generalization performance in CIFAR-10 when we artificially remove examples from the training dataset. We choose the examples to remove by increasing number of forgetting events. Each point in the figure corresponds to retraining the model from scratch on an increasingly smaller subset of the training data (with the same hyper-parameters as the base model). We observe that when removing a random subset of the dataset, performance rapidly decreases. Comparatively, by removing examples ordered by number of forgetting events, $3 0 \%$ of the dataset can be removed while maintaining comparable generalization performance as the base model trained on the full dataset, and up to $3 5 \%$ can be removed with marginal degradation (less than $0 . 2 \%$ ). The results on the other datasets are similar: a large fraction of training examples can be ignored without hurting the final generalization performance of the classifiers (Figure 6).
|
| 101 |
+
|
| 102 |
+
In Figure 5 (Right), we show the evolution of the generalization error when we remove from the dataset 5,000 examples with increasing forgetting statistics. Each point in the figure corresponds to the generalization error of a model trained on the full dataset minus 5,000 examples as a function of the average number of forgetting events in those 5,000 examples. As can be seen, removing the same number of examples with increasingly more forgetting events results in worse generalization for most of the curve. It is interesting to notice the rightmost part of the curve moving up, suggesting that some of the most forgotten examples actually hurt performance. Those could correspond to outliers or mislabeled examples (see Sec. 4). Finding a way to separate those points from very informative ones is an ancient but still active area of research (John, 1995; Jiang et al., 2018).
|
| 103 |
+
|
| 104 |
+
Support vectors Various explanations of the implicit generalization of deep neural networks (Zhang et al., 2016) have been offered: flat minima generalize better and stochastic gradient descent converges towards them (Hochreiter & Schmidhuber, 1997; Kleinberg et al., 2018), gradient descent protects against overfitting (Advani & Saxe, 2017; Tachet et al., 2018), deep networks’ structure biases learning towards simple functions (Neyshabur et al., 2014; Perez et al., 2018). But it remains a poorly understood phenomenon. An interesting direction of research is to study the convergence properties of gradient descent in terms of maximum margin classifiers. It has been shown recently (Soudry et al., 2017) that on separable data, a linear network will learn such a maximum margin classifier. This supports the idea that stochastic gradient descent implicitly converges to solutions that maximally separate the dataset, and additionally, that some data points are more relevant than others to the decision boundary learnt by the classifier. Those points play a part equivalent to support vectors in the support vector machine paradigm. Our results confirm that a significant portion of training data points have little to no influence on the generalization performance when the decision function is learnt with SGD. Forgettable training points may be considered as analogs to support vectors, important for the generalization performance of the model. The number of forgetting events of an example is a relevant metric to detect such support vectors. It also correlates well with the misclassification margin (see Sec.4) which is a proxy for the distance to the decision boundary.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 6: Decrease in generalization performance when fractions of the training sets are removed. When the subsets are selected appropriately, performance is maintained after removing up to $3 0 \%$ of CIFAR-10, $5 0 \%$ of permutedMNIST, and $\bar { 8 0 \% }$ of MNIST. Vertical black line indicates the point at which all unforgettable examples are removed from CIFAR-10. Right is a zoomed in version of Left.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 7: Left. Ranking of examples by forgotten events stabilizes after 75 epochs in CIFAR-10. Middle. Precision and recall of retrieving the unforgettable examples of ResNet18, using the example ordering of a simpler convolutional neural network. Right. Generalization performance on CIFAR-10 of a WideResNet using the example ordering of ResNet18.
|
| 111 |
+
|
| 112 |
+
Intrinsic dataset dimension As mentioned above, the datasets we study have various fractions of unforgettable events $( 9 1 . 7 \%$ for MNIST, $7 5 . 3 \%$ for permutedMNIST and $3 1 . 3 \%$ for CIFAR-10). We also see in Figure 6 that performance on those datasets starts to degrade at different fractions of removed examples: the number of support vectors varies from one dataset to the other, based on the complexity of the underlying data distribution. If we assume that we are in fact detecting analogs of support vectors, we can put these results in perspective with the intrinsic dataset dimension defined by Li et al. (2018) as the codimension in the parameter space of the solution set: for a given architecture, the higher the intrinsic dataset dimension, the larger the number of support vectors, and the fewer the number of unforgettable examples.
|
| 113 |
+
|
| 114 |
+
# 6 TRANSFERABLE FORGETTING EVENTS
|
| 115 |
+
|
| 116 |
+
Forgetting events rely on training a given architecture, with a given optimizer, for a given number of epochs. We investigate to what extent the forgetting statistics of examples depend on those factors.
|
| 117 |
+
|
| 118 |
+
Throughout training We compute the Spearman rank correlation between the ordering obtained at the end of training (200 epochs) and the ordering after various number of epochs. As seen in Fig. 7 (Left), the ordering is very stable after 75 epochs, and we found a reasonable number of epochs to get a good correlation to be 25 (see the Supplementary Materials for precision-recall plots).
|
| 119 |
+
|
| 120 |
+
Between architectures A limitation of our method is that it requires computing the ordering from a previous run. An interesting question is whether that ordering could be obtained from a simpler architecture than residual networks. We train a network with two convolutional layers followed by two fully connected ones (see the Supplementary for the full architecture) and compare the resulting ordering with the one obtained with ResNet18. Figure 7 (Middle) shows a precision-recall plot of the unforgettable examples computed with the residual network. We see a reasonably strong agreement between the unforgettable examples of the convolutional neural network and the ones of the ResNet18. Finally, we train a WideResNet (Zagoruyko & Komodakis, 2016) on truncated data sets using the example ordering from ResNet18. Using the same computing power (one Titan X GPU), Resnet18 requires 2 hours to train whereas WideResNet requires 8 – estimating the forgetting statistics of WideResNet via ResNet18 can save up to 6 hours of training time if the estimate is accurate. We plot WideResNet’s generalization performance using the ordering obtained by ResNet18 in Figure 7 (Right): the network still performs near optimally with $3 0 \%$ of the dataset removed. This opens up promising avenues of computing forgetting statistics with smaller architectures.
|
| 121 |
+
|
| 122 |
+
# 7 CONCLUSION AND FUTURE WORK
|
| 123 |
+
|
| 124 |
+
In this paper, inspired by the phenomenon of catastrophic forgetting, we investigate the learning dynamics of neural networks when training on single classification tasks. We show that catastrophic forgetting can occur in the context of what is usually considered to be a single task. Inspired by this result, we find that some examples within a task are more prone to being forgotten, while others are consistently unforgettable. We also find that forgetting statistics seem to be fairly stable with respect to the various characteristics of training, suggesting that they actually uncover intrinsic properties of the data rather than idiosyncrasies of the training schemes. Furthermore, the unforgettable examples seem to play little part in the final performance of the classifier as they can be removed from the training set without hurting generalization. This supports recent research interpreting deep neural networks as max margin classifiers in the linear case. Future work involves understanding forgetting events better from a theoretical perspective, exploring potential applications to other areas of supervised learning, such as speech or text and to reinforcement learning where forgetting is prevalent due to the continual shift of the underlying distribution.
|
| 125 |
+
|
| 126 |
+
# 8 ACKNOWLEDGMENTS
|
| 127 |
+
|
| 128 |
+
We acknowledge the anonymous reviewers for their insightful suggestions.
|
| 129 |
+
|
| 130 |
+
# REFERENCES
|
| 131 |
+
|
| 132 |
+
Madhu S. Advani and Andrew M. Saxe. High-dimensional dynamics of generalization error in neural networks. CoRR, abs/1710.03667, 2017.
|
| 133 |
+
Yoshua Bengio and Yann LeCun. Scaling learning algorithms towards AI. In Large Scale Kernel Machines. MIT Press, 2007.
|
| 134 |
+
Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ Proceedings of the 26th annual international conference on machine learning, pp. 41–48. ACM, 2009.
|
| 135 |
+
Carla E Brodley and Mark A Friedl. Identifying mislabeled training data. Journal of artificial intelligence research, 11:131–167, 1999.
|
| 136 |
+
Haw-Shiuan Chang, Erik Learned-Miller, and Andrew McCallum. Active Bias: Training More Accurate Neural Networks by Emphasizing High Variance Samples. In Advances in Neural Information Processing Systems, pp. 1002–1012, 2017.
|
| 137 |
+
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. ICLR ’17, 2016.
|
| 138 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 139 |
+
|
| 140 |
+
Yang Fan, Fei Tian, Tao Qin, and Jiang Bian. Learning What Data to Learn. 2017.
|
| 141 |
+
|
| 142 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proc. of ICML, 2017.
|
| 143 |
+
|
| 144 |
+
S. Hochreiter and J. Schmidhuber. Flat minima. Neural Computation, 9(1):1��42, 1997.
|
| 145 |
+
|
| 146 |
+
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.
|
| 147 |
+
|
| 148 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. MentorNet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In Proceedings of the 35th International Conference on Machine Learning. PMLR, 2018.
|
| 149 |
+
|
| 150 |
+
George H John. Robust decision trees: removing outliers from databases. In Proceedings of the First International Conference on Knowledge Discovery and Data Mining, pp. 174–179. AAAI Press, 1995.
|
| 151 |
+
|
| 152 |
+
Angelos Katharopoulos and Franois Fleuret. Not all samples are created equal: Deep learning with importance sampling. In Jennifer G. Dy and Andreas Krause (eds.), ICML, volume 80 of JMLR Workshop and Conference Proceedings, pp. 2530–2539. JMLR.org, 2018. URL http: //dblp.uni-trier.de/db/conf/icml/icml2018.html#KatharopoulosF18.
|
| 153 |
+
|
| 154 |
+
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.
|
| 155 |
+
|
| 156 |
+
Tae-Hoon Kim and Jonghyun Choi. Screenernet: Learning curriculum for neural networks. CoRR, abs/1801.00904, 2018. URL http://dblp.uni-trier.de/db/journals/ corr/corr1801.html#abs-1801-00904.
|
| 157 |
+
|
| 158 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014. URL http: //arxiv.org/abs/1412.6980. cite arxiv:1412.6980Comment: Published as a conference paper at the 3rd International Conference for Learning Representations, San Diego, 2015.
|
| 159 |
+
|
| 160 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, and Others. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, pp. 201611835, 2017.
|
| 161 |
+
|
| 162 |
+
Robert Kleinberg, Yuanzhi Li, and Yang Yuan. An alternative view: When does sgd escape local minima? CoRR, abs/1802.06175, 2018. URL http://dblp.uni-trier.de/db/ journals/corr/corr1802.html#abs-1802-06175.
|
| 163 |
+
|
| 164 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In Doina Precup and Yee Whye Teh (eds.), ICML, volume 70 of JMLR Workshop and Conference Proceedings, pp. 1885–1894. JMLR.org, 2017. URL http://dblp.uni-trier.de/db/ conf/icml/icml2017.html#KohL17.
|
| 165 |
+
|
| 166 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. URL https: //www.cs.toronto.edu/˜kriz/learning-features-2009-TR.pdf.
|
| 167 |
+
|
| 168 |
+
M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-Paced Learning for Latent Variable Models. In Proc. of NIPS, pp. 1–9, 2010.
|
| 169 |
+
|
| 170 |
+
Y. LeCun, C. Cortes C., and C. Burges. The mnist database of handwritten digits. 1999. URL http://yann.lecun.com/exdb/mnist/.
|
| 171 |
+
|
| 172 |
+
Yong Jae Lee and Kristen Grauman. Learning the easy things first: Self-paced visual category discovery. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pp. 1721–1728. IEEE, 2011.
|
| 173 |
+
|
| 174 |
+
Chunyuan Li, Heerad Farkhoor, Rosanne Liu, and Jason Yosinski. Measuring the intrinsic dimension of objective landscapes. CoRR, abs/1804.08838, 2018. URL http://dblp.uni-trier. de/db/journals/corr/corr1804.html#abs-1804-08838.
|
| 175 |
+
|
| 176 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.
|
| 177 |
+
|
| 178 |
+
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. CoRR, abs/1412.6614, 2014. URL http: //dblp.uni-trier.de/db/journals/corr/corr1412.html#NeyshaburTS14.
|
| 179 |
+
|
| 180 |
+
Guillermo Valle Perez, Chico Q. Camargo, and Ard A. Louis. Deep learning generalizes because the parameter-function map is biased towards simple functions. CoRR, abs/1805.08522, 2018. URL http://dblp.uni-trier.de/db/journals/corr/corr1805.html# abs-1805-08522.
|
| 181 |
+
|
| 182 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In Proc. of ICLR, 2017.
|
| 183 |
+
|
| 184 |
+
Hippolyt Ritter, Aleksandar Botev, and David Barber. Online Structured Laplace Approximations For Overcoming Catastrophic Forgetting. 2018. URL http://arxiv.org/abs/1805. 07810.
|
| 185 |
+
|
| 186 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 187 |
+
|
| 188 |
+
Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The Implicit Bias of Gradient Descent on Separable Data. 2017. URL http://arxiv.org/abs/ 1710.10345.
|
| 189 |
+
|
| 190 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 191 |
+
|
| 192 |
+
R. Tachet, M. Pezeshki, S. Shabanian, A. Courville, and Y. Bengio. On the learning dynamics of deep neural networks. 2018. doi: arXiv:1809.06848v1. URL https://arxiv.org/abs/ 1809.06848.
|
| 193 |
+
|
| 194 |
+
Huan Wang, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. Identifying Generalization Properties in Neural Networks. pp. 1–23, 2018. doi: arXiv:1809.07402v1. URL http:// arxiv.org/abs/1809.07402.
|
| 195 |
+
|
| 196 |
+
Tengyu Xu, Yi Zhou, Kaiyi Ji, and Yingbin Liang. Convergence of sgd in learning relu models with separable data. CoRR, abs/1806.04339, 2018. URL http://dblp.uni-trier.de/db/ journals/corr/corr1806.html#abs-1806-04339.
|
| 197 |
+
|
| 198 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks, 2016. URL http://arxiv. org/abs/1605.07146. cite arxiv:1605.07146.
|
| 199 |
+
|
| 200 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 201 |
+
|
| 202 |
+
Peilin Zhao and Tong Zhang. Stochastic Optimization with Importance Sampling for Regularized Loss Minimization. In Proc. of ICML, 2015.
|
| 203 |
+
|
| 204 |
+
# 9 EXPERIMENTATION DETAILS
|
| 205 |
+
|
| 206 |
+
# Detailed distributions
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 8: From left to right, distributions of the first presentation at which each unforgettable and forgettable example was learned in MNIST, permutedMNIST and CIFAR-10 respectively. Rescaled view where the number of examples have been capped between 0 and 1500 for visualization purposes. Unforgettable examples are generally learnt early during training, thus may be considered as “easy” in the sense of Kumar et al. (2010), i.e. may have a low loss during most of the training.
|
| 210 |
+
|
| 211 |
+
# Misclassification margin
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 9: Left 2D-histogram of the number of forgetting events and mean misclassification margin across all examples of CIFAR-10. There is significant negative correlation (-0.74, Spearman rank correlation) between mean misclassification margin and the number of forgetting events.
|
| 215 |
+
|
| 216 |
+
permutedMNIST The permutedMNIST data set is obtained by applying a fixed random permutation of the pixels to all the images of the standard MNIST data set. This typically makes the data set harder to learn for convolutional neural networks as local patterns, e.g. the horizontal bar of the 7, get shuffled. This statement is supported by the two following facts:
|
| 217 |
+
|
| 218 |
+
• The number of unforgettable examples for permutedMNIST is 45181 versus 55012 for MNIST.
|
| 219 |
+
• The intrinsic data set dimension (Li et al., 2018) of permutedMNIST is 1400 compared to 290 for the untouched data set.
|
| 220 |
+
|
| 221 |
+
Network Architectures We use a variety of different architectures in the main text. Below are their specifications.
|
| 222 |
+
|
| 223 |
+
The architecture for the MNIST and permutedMNIST experiments is the following:
|
| 224 |
+
|
| 225 |
+
1. a first convolutional layer with 5 by 5 filters and 10 feature maps,
|
| 226 |
+
2. a second convolutional layer with 5 by 5 filters and 20 feature maps,
|
| 227 |
+
3. a fully connected layer with 50 hidden units
|
| 228 |
+
4. the output layer, with 10 logits, one for each class.
|
| 229 |
+
|
| 230 |
+
We apply ReLU nonlinearities to the feature maps and to the hidden layer. The last layer is passed through a softmax to output probabilities for each class of the data set.
|
| 231 |
+
|
| 232 |
+
The ResNet18 architecture used for CIFAR-10 is described thoroughly in DeVries & Taylor (2017), its implementation can be found at https://github.com/uoguelph-mlrg/Cutout.
|
| 233 |
+
|
| 234 |
+
The second one is a WideResNet (Zagoruyko & Komodakis, 2016), with a depth of 28 and a widen factor of 10. We used the implementation found at https://github.com/meliketoy/ wide-resnet.pytorch.
|
| 235 |
+
|
| 236 |
+
The convolutional architecture used in Section 6 is the following:
|
| 237 |
+
|
| 238 |
+
1. a first convolutional layer with 5 by 5 filters and 6 feature maps,
|
| 239 |
+
2. a 2 by 2 max pooling layer
|
| 240 |
+
3. a second convolutional layer with 5 by 5 filters and 16 feature maps,
|
| 241 |
+
4. a first fully connected layer with 120 hidden units
|
| 242 |
+
5. a second fully connected layer with 84 hidden units
|
| 243 |
+
6. the output layer, with 10 logits, one for each class.
|
| 244 |
+
|
| 245 |
+
# Optimization
|
| 246 |
+
|
| 247 |
+
The MNIST networks are trained to minimize the cross-entropy loss using stochastic gradient descent with a learning rate of 0.01 and a momentum of 0.5.
|
| 248 |
+
|
| 249 |
+
The ResNet18 is trained using cutout, data augmentation and stochastic gradient descent with a 0.9 Nesterov momentum and a learning rate starting at 0.1 and divided by 5 at epochs 60, 120 and 160.
|
| 250 |
+
|
| 251 |
+
The WideResNet is trained using Adam (Kingma & Ba, 2014) and a learning rate of 0.001.
|
| 252 |
+
|
| 253 |
+
# 10 STABILITY OF THE FORGETTING EVENTS
|
| 254 |
+
|
| 255 |
+
In Fig 10, we plot precision-recall diagrams for the unforgettable and most forgotten examples of CIFAR-10 obtained on ResNet18 after 200 epochs and various prior time steps. We see in particular that at 75 epochs, the examples on both side of the spectrum can be retrieved with very high precision and recall.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 10: Right: precision and recall of retrieving the unforgettable examples from a full run of ResNet18 (200 epochs), using the example ordering after 25, 50, and 75 epochs. The unforgettable examples are retrieved with high precision and recall after 50 epochs. Left: same plot for the $1 7 \mathrm { k }$ examples with the most forgetting events.
|
| 259 |
+
|
| 260 |
+
# 11 Noising THE DATA SETS
|
| 261 |
+
|
| 262 |
+
In Section 4, we analyzed the effect of adding label noise on the distribution of forgetting events. Here, we examine the effect of adding pixel noise, i.e. noising the input distribution. We choose to corrupt the inputs with additive Gaussian noise with zero mean and we choose for its standard deviation to be a multiple of channel-wise data standard deviation (i.e., $\sigma _ { \mathrm { n o i s e } } = \lambda \sigma _ { \mathrm { d a t a } } , \lambda \in$ $\{ 0 . 5 , 1 , 2 , 1 0 \} )$ ). Note that we add the noise after applying a channel-wise standard normalization step of the training images, therefore $\sigma _ { \mathrm { { d a t a } } } = 1$ (each channel has zero mean, unit variance, this is a standard pre-processing step and has been applied throughout all the experiments in this paper).
|
| 263 |
+
|
| 264 |
+
The forgetting distributions obtained by noising all the dataset examples with increasing noise standard deviation are presented in Figure 11. We observe that adding increasing amount of noise decreases the amount of unforgettable examples and increases the amount of examples in the second mode of the forgetting distribution.
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 11: Distribution of forgetting events across all training examples in CIFAR-10 when all training images are augmented with increasing additive Gaussian noise. The presence of increasing amount of noise decreases the amount of unforgettable examples and increases the amount of examples in the second mode of the forgetting distribution.
|
| 268 |
+
|
| 269 |
+
We follow the noisy-labels experiments of Section 4 and we apply the aforementioned pixel noise to $2 0 \%$ of the training data $( \sigma _ { \mathrm { n o i s e } } = 1 0 $ ). We present the results of comparing the forgetting distribution of the $2 0 \%$ of examples before and after noise was added to the pixels in Figure 12 (Left). For ease of comparison, we report the same results in the case of label noise in Figure 12 (Right). We observe that the forgetting distribution under pixel noise resembles the one under label noise.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 12: Distribution of forgetting events across all training examples in CIFAR-10 when random $2 0 \%$ of training examples undergo pixel noise $( \sigma _ { \mathrm { n o i s e } } = 1 0 $ ) (Left) or label noise (Right) (same as Figure 3). We observe that the forgetting distribution under pixel noise resembles the one under label noise.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 13: Histogram of forgetting events under true and random gradient steps. (Right) Zoomed-in version where the number of forgetting events is capped at 3 for visualization.
|
| 276 |
+
|
| 277 |
+
Forgetting events may happen by “chance”, i.e. some learning/forgetting events may occur even with random gradients. In order to estimate how large the effect of “chance” is, we compute the forgetting events of a classifier obtained by randomizing the update steps. To keep the statistics of the gradients similar to those encountered during SGD, we proceed as follows:
|
| 278 |
+
|
| 279 |
+
1. Before the beginning of training, clone the “base” classifier into a new “clone” classifier with the same random weights.
|
| 280 |
+
2. At each training step, shuffle the gradients computed on the base classifier and apply those to the clone (the base classifier is still optimized the same way): this ensures that the statistics of the random updates match the statistics of the true gradients during learning.
|
| 281 |
+
3. Compute the forgetting events of the clone classifier on the training set exactly as is done with the base classifier.
|
| 282 |
+
|
| 283 |
+
The results can be found in Fig 13, showing the histogram of forgetting events produced by the clone network, averaged over 5 seeds. This gives an idea of the chance forgetting rate across examples. In this setting, examples are being forgotten by chance at most twice.
|
| 284 |
+
|
| 285 |
+
# 13 CONFIDENCE ON FORGETTING EVENTS FOR CIFAR-10
|
| 286 |
+
|
| 287 |
+
In order to establish confidence intervals on the number of forgetting events, we computed them on 100 seeds and formed 20 averages over 5 seeds. In Fig 14, we show the average (in green), the bottom 2.5 percentile (in blue) and top 2.5 percentile (in orange) of those 20 curves.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 14: $9 5 \%$ confidence interval on forgetting events averaged over 5 seeds.
|
| 291 |
+
|
| 292 |
+
# 14 VISUALIZATION OF FORGETTABLE AND UNFORGETTABLE IMAGES
|
| 293 |
+
|
| 294 |
+
See Fig 15 for additional pictures of the most unforgettable and forgettable examples of every CIFAR-10 class, when examples are sorted by number of forgetting events (ties are broken randomly).
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 15: Additional pictures of the most unforgettable (Left) and forgettable examples (Right) of every CIFAR-10 class, when examples are sorted by number of forgetting events (ties are broken randomly). Forgettable examples seem to exhibit peculiar or uncommon features.
|
| 298 |
+
|
| 299 |
+
# 15 FORGETTING IN CIFAR-100
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 16: Left: distribution of forgetting events in CIFAR-100. Right: distribution of forgetting events in CIFAR-10 when $2 0 \%$ of the labels are changed at random. The distribution of forgetting in CIFAR-100 is much closer to that of forgetting in the noisy CIFAR-10 than it is to forgetting in the original datasets presented in Figure 1.
|
| 303 |
+
|
| 304 |
+
The distribution of forgetting events in CIFAR-100 is shown in Figure 16. There are 3809 unforgettable examples $( 7 . 6 2 \%$ of the training set). CIFAR-100 is the hardest to classify out all of the presented datasets and exhibits the highest percentage of forgetting events. This finding further supports the idea that there may be a correlation between the forgetting statistics and the intrinsic dimension of the learning problem. Additionally, each CIFAR-100 class contains 10 times fewer examples than in CIFAR-10 or the MNIST datasets, making each image all the more useful for the learning problem.
|
| 305 |
+
|
| 306 |
+
We also observe that the distribution of forgetting in CIFAR-100 is much closer to that of forgetting in the noisy CIFAR-10 than it is to forgetting in the original datasets presented in Figure 1. Visualizing the most forgotten examples in CIFAR-100 revealed that CIFAR-100 contains several images that appear multiple times in the training set under different labels. In Figure 17, we present the 36 most forgotten examples in CIFAR-100. Note that they are all images that appear under multiple labels (not shown: the ”girl” image also appears under the label ”baby”, the ”mouse” image also appears under ”shrew”, one of the 2 images of ‘oak tree’ appears under ‘willow tree’ and the other under ’maple tree’).
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 17: The 36 most forgotten examples in CIFAR-100. Note that they are all images that appear under multiple labels (not pictured: the ”girl” image also appears under the label ”baby”, the ”mouse” image also appears under ”shrew”, one of the 2 images of ‘oak tree’ appears under ‘willow tree’ and the other under ’maple tree’.
|
| 310 |
+
|
| 311 |
+
We perform the same removal experiments we presented in Figure 5 for CIFAR-100. The results are shown in Figure 18. Just like with CIFAR-10, we are able to remove all unforgettable examples ( $8 \%$ of the training set) while maintaining test performance.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 18: Generalization performance on CIFAR-100 of ResNet18 where increasingly larger subsets of the training set are removed (mean $+ / -$ std error of 5 seeds). When the removed examples are selected at random, performance drops faster. Selecting the examples according to our ordering reduces the training set without affecting generalization.
|
md/train/BJxkOlSYDH/BJxkOlSYDH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BkgBvsC9FQ/BkgBvsC9FQ.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIALOGWAE: MULTIMODAL RESPONSE GENERATION WITH CONDITIONAL WASSERSTEIN AUTO-ENCODER
|
| 2 |
+
|
| 3 |
+
Xiaodong $\mathbf { G u } ^ { 1 , 3 }$ , Kyunghyun $\mathbf { C h 0 ^ { 2 , 4 } }$ , Jung-Woo $\mathbf { H } \mathbf { a } ^ { 3 }$ , Sunghun $\mathbf { K i m ^ { 1 , 3 } }$
|
| 4 |
+
1Hong Kong University of Science and Technology,
|
| 5 |
+
2New York Universidy, 3Clova AI Research, NAVER, 4CIFAR Azrieli Global Scholar
|
| 6 |
+
1guxiaodong1987@126.com, hunkim@cse.ust.hk
|
| 7 |
+
2kyunghyun.cho@nyu.edu, 3jungwoo.ha@navercorp.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Variational autoencoders (VAEs) have shown a promise in data-driven conversation modeling. However, most VAE conversation models match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope. In this paper, we propose DialogWAE, a conditional Wasserstein autoencoder (WAE) specially designed for dialogue modeling. Unlike VAEs that impose a simple distribution over the latent variables, DialogWAE models the distribution of data by training a GAN within the latent variable space. Specifically, our model samples from the prior and posterior distributions over the latent variables by transforming context-dependent random noise using neural networks and minimizes the Wasserstein distance between the two distributions. We further develop a Gaussian mixture prior network to enrich the latent space. Experiments on two popular datasets show that DialogWAE outperforms the state-of-the-art approaches in generating more coherent, informative and diverse responses.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Neural response generation has been a long interest of natural language research. Most of the recent approaches to data-driven conversation modeling primarily build upon sequence-to-sequence learning (Cho et al., 2014; Sutskever et al., 2014). Previous research has demonstrated that sequenceto-sequence conversation models often suffer from the safe response problem and fail to generate meaningful, diverse on-topic responses (Li et al., 2015; Sato et al., 2017). Conditional variational autoencoders (CVAE) have shown promising results in addressing the safe response issue (Zhao et al., 2017; Shen et al., 2018). CVAE generates the response conditioned on a latent variable - representing topics, tones and situations of the response - and approximate the posterior distribution over latent variables using a neural network. The latent variable captures variabilities in the dialogue and thus generates more diverse responses. However, previous studies have shown that VAE models tend to suffer from the posterior collapse problem, where the decoder learns to ignore the latent variable and degrades to a vanilla RNN (Shen et al., 2018; Park et al., 2018; Bowman et al., 2015). Furthermore, they match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope (Goyal et al., 2017).
|
| 16 |
+
|
| 17 |
+
A number of studies have sought GAN-based approaches (Goodfellow et al., 2014; Li et al., 2017a; Xu et al., 2017) which directly model the distribution of the responses. However, adversarial training over discrete tokens has been known to be difficult due to the non-differentiability. Li et al. (2017a) proposed a hybrid model of GAN and reinforcement learning (RL) where the score predicted by a discriminator is used as a reward to train the generator. However, training with REINFORCE has been observed to be unstable due to the high variance of the gradient estimate (Shen et al., 2017). Xu et al. (2017) make the GAN model differentiable with an approximate word embedding layer. However, their model only injects variability at the word level, thus limited to represent high-level response variabilities such as topics and situations.
|
| 18 |
+
|
| 19 |
+
In this paper, we propose DialogWAE, a novel variant of GAN for neural conversation modeling. Unlike VAE conversation models that impose a simple distribution over latent variables, DialogWAE models the data distribution by training a GAN within the latent variable space. Specifically, it samples from the prior and posterior distributions over the latent variables by transforming contextdependent random noise with neural networks, and minimizes the Wasserstein distance (Arjovsky et al., 2017) between the prior and the approximate posterior distributions. Furthermore, our model takes into account a multimodal1 nature of responses by using a Gaussian mixture prior network. Adversarial training with the Gaussian mixture prior network enables DialogWAE to capture a richer latent space, yielding more coherent, informative and diverse responses.
|
| 20 |
+
|
| 21 |
+
Our main contributions are two-fold: (1) A novel GAN-based model for neural dialogue modeling, which employs GAN to generate samples of latent variables. (2) A Gaussian mixture prior network to sample random noise from a multimodal prior distribution. To the best of our knowledge, the proposed DialogWAE is the first GAN conversation model that exploits multimodal latent structures.
|
| 22 |
+
|
| 23 |
+
We evaluate our model on two benchmark datasets, SwitchBoard (Godfrey and Holliman, 1997) and DailyDialog (Li et al., 2017b). The results demonstrate that our model substantially outperforms the state-of-the-art methods in terms of BLEU, word embedding similarity, and distinct. Furthermore, we highlight how the GAN architecture with a Gaussian mixture prior network facilitates the generation of more diverse and informative responses.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Encoder-decoder variants To address the “safe response” problem of the naive encoder-decoder conversation model, a number of variants have been proposed. Li et al. (2015) proposed a diversitypromoting objective function to encourage more various responses. Sato et al. (2017) propose to incorporate various types of situations behind conversations when encoding utterances and decoding their responses, respectively. Xing et al. (2017) incorporate topic information into the sequence-tosequence framework to generate informative and interesting responses. Our work is different from the aforementioned studies, as it does not rely on extra information such as situations and topics.
|
| 28 |
+
|
| 29 |
+
VAE conversation models The variational autoencoder (VAE) (Kingma and Welling, 2014) is among the most popular frameworks for dialogue modeling (Zhao et al., 2017; Shen et al., 2018; Park et al., 2018). Serban et al. (2017) propose VHRED, a hierarchical latent variable sequenceto-sequence model that explicitly models multiple levels of variability in the responses. A main challenge for the VAE conversation models is the so-called “posterior collapse”. To alleviate the problem, Zhao et al. (2017) introduce an auxiliary bag-of-words loss to the decoder. They further incorporate extra dialogue information such as dialogue acts and speaker profiles. Shen et al. (2018) propose a collaborative CVAE model which samples the latent variable by transforming a Gaussian noise using neural networks and matches the prior and posterior distributions of the Gaussian noise with KL divergence. Park et al. (2018) propose a variational hierarchical conversation RNN (VHCR) which incorporates a hierarchical structure to latent variables. DialogWAE addresses the limitation of VAE conversation models by using a GAN architecture in the latent space.
|
| 30 |
+
|
| 31 |
+
GAN conversation models Although GAN/CGAN has shown great success in image generation, adapting it to natural dialog generators is a non-trivial task. This is due to the non-differentiable nature of natural language tokens (Shen et al., 2017; Xu et al., 2017). Li et al. (2017a) address this problem by combining GAN with Reinforcement Learning (RL) where the discriminator predicts a reward to optimize the generator. However, training with REINFORCE can be unstable due to the high variance of the sampled gradient (Shen et al., 2017). Xu et al. (2017) make the sequenceto-sequence GAN differentiable by directly multiplying the word probabilities obtained from the decoder to the corresponding word vectors, yielding an approximately vectorized representation of the target sequence. However, their approach injects diversity in the word level rather than the level of the whole responses. DialogWAE differs from exiting GAN conversation models in that it shapes the distribution of responses in a high level latent space rather than direct tokens and does not rely on RL where the gradient variances are large.
|
| 32 |
+
|
| 33 |
+
# 3 PROPOSED APPROACH
|
| 34 |
+
|
| 35 |
+
# 3.1 PROBLEM STATEMENT
|
| 36 |
+
|
| 37 |
+
Let $d { = } [ u _ { 1 } , . . . , u _ { k } ]$ denote a dialogue of $k$ utterances where $u _ { i } { = } [ w _ { 1 } , . . . , w _ { | u _ { i } | } ]$ represents an utterance and $w _ { n }$ denotes the $n$ -th word in $u _ { i }$ . Let $c { = } [ u _ { 1 } , . . . , u _ { k - 1 } ]$ denote a dialogue context, the $k$ -1 historical utterances, and $x { = } u _ { k }$ be a response which means the next utterance. Our goal is to estimate the conditional distribution $p _ { \theta } ( x | c )$ .
|
| 38 |
+
|
| 39 |
+
As $x$ and $c$ are sequences of discrete tokens, it is non-trivial to find a direct coupling between them. Instead, we introduce a continuous latent variable $z$ that represents the high-level representation of the response. The response generation can be viewed as a two-step procedure, where a latent variable $z$ is sampled from a distribution $p _ { \theta } ( z | c )$ on a latent space $\mathcal { Z }$ , and then the response $x$ is decoded from $z$ with $p _ { \theta } ( x | z , c )$ . Under this model, the likelihood of a response is
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
p _ { \theta } ( x | c ) = \int _ { z } p ( x | c , z ) p ( z | c ) d _ { z } .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
The exact log-probability is difficult to compute since it is intractable to marginalize out $z$ . Therefore, we approximate the posterior distribution of $z$ as $q _ { \phi } ( z | x , c )$ which can be computed by a neural network named recognition network. Using this approximate posterior, we can instead compute the evidence lower bound (ELBO):
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r l } & { \log p _ { \theta } ( x \vert c ) = \log \displaystyle \int _ { z } p ( x \vert c , z ) p ( z \vert c ) d z } \\ & { \quad \ge \ell ( x , c ) = { \mathbf E } _ { z \sim q _ { \phi } ( z \vert x , c ) } [ \log p _ { \psi } ( x \vert c , z ) ] - { \mathrm { K L } } ( q _ { \phi } ( z \vert x , c ) \vert \vert p ( z \vert c ) ) , } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $p ( z | c )$ represents the prior distribution of $z$ given $c$ and can be modeled with a neural network named prior network.
|
| 52 |
+
|
| 53 |
+
# 3.2 CONDITIONAL WASSERSTEIN AUTO-ENCODERS FOR DIALOGUE MODELING
|
| 54 |
+
|
| 55 |
+
The conventional VAE conversation models assume that the latent variable $z$ follows a simple prior distribution such as the normal distribution. However, the latent space of real responses is more complicated and difficult to be estimated with such a simple distribution. This often leads to the posterior collapse problem (Shen et al., 2018).
|
| 56 |
+
|
| 57 |
+
Inspired by GAN and the adversarial auto-encoder (AAE) (Makhzani et al., 2015; Tolstikhin et al., 2017; Zhao et al., 2018), we model the distribution of $z$ by training a GAN within the latent space. We sample from the prior and posterior over the latent variables by transforming random noise $\epsilon$ using neural networks. Specifically, the prior sample $\tilde { z } \sim p _ { \theta } ( z | c )$ is generated by a generator $G$ from context-dependent random noise $\tilde { \epsilon }$ , while the approximate posterior sample $z \sim q _ { \phi } ( z | c , x )$ is generated by a generator $Q$ from context-dependent random noise $\epsilon$ . Both ˜ and $\epsilon$ are drawn from a normal distribution whose mean and covariance matrix (assumed diagonal) are computed from $c$ with feed-forward neural networks, prior network and recognition network, respectively:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\tilde { z } = G _ { \theta } ( \tilde { \epsilon } ) , ~ \tilde { \epsilon } \sim \mathcal { N } ( \epsilon ; \tilde { \mu } , \tilde { \sigma } ^ { 2 } I ) , ~ \left[ \operatorname* { l i p } _ { \log \tilde { \sigma } ^ { 2 } } \right] = \tilde { W } f _ { \theta } ( c ) + \tilde { b }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
z = Q _ { \phi } ( \epsilon ) , \epsilon \sim \mathcal { N } ( \epsilon ; \mu , \sigma ^ { 2 } I ) , \left[ \underset { \log \sigma ^ { 2 } } { \mu } \right] = W g _ { \phi } ( \left[ \underset { c } { x } \right] ) + b ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $f _ { \theta } ( \cdot )$ and $g _ { \phi } ( \cdot )$ are feed-forward neural networks. Our goal is to minimize the divergence between $p _ { \theta } ( z | c )$ and $\scriptstyle q _ { \phi } ( z | x , c )$ while maximizing the log-probability of a reconstructed response from $z$ . We thus solve the following problem:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\operatorname* { m i n } _ { \theta , \phi , \psi } - E _ { q _ { \phi } ( z | x , c ) } \log p _ { \psi } ( x | z , c ) + W ( q _ { \phi } ( z | x , c ) | | p _ { \theta } ( z | c ) ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $p _ { \theta } ( z | c )$ and $q _ { \phi } ( z | x , c )$ are neural networks implementing Equations 3 and 4, respectively. $p _ { \psi } ( x | z , c )$ is a decoder. $\mathbf { W } ( \cdot | | \cdot )$ represents the Wasserstein distance between these two distributions (Arjovsky et al., 2017). We choose the Wasserstein distance as the divergence since the WGAN has been shown to produce good results in text generation (Zhao et al., 2018).
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: Architecture of DialogWAE
|
| 77 |
+
|
| 78 |
+
Figure 1 illustrates an overview of our model. The utterance encoder (RNN) transforms each utterance (including the response $x$ ) in the dialogue into a real-valued vector. For the $i$ -th utterance in the context, the context encoder (RNN) takes as input the concatenation of its encoding vector and the conversation floor (1 if the utterance is from the speaker of the response, otherwise 0) and computes its hidden state ${ h _ { i } ^ { c t x } }$ . The final hidden state of the context encoder is used as the context representation.
|
| 79 |
+
|
| 80 |
+
At generation time, the model draws a random noise ˜ from the prior network (PriNet) which transforms $c$ through a feed-forward network followed by two matrix multiplications which result in the mean and diagonal covariance, respectively. Then, the generator G generates a sample of latent variable $\tilde { z }$ from the noise through a feed-forward network. The decoder RNN decodes the generated $\tilde { z }$ into a response.
|
| 81 |
+
|
| 82 |
+
At training time, the model infers the posterior distribution of the latent variable conditioned on the context $c$ and the response $x$ . The recognition network (RecNet) takes as input the concatenation of both $x$ and $c$ and transforms them through a feed-forward network followed by two matrix multiplications which define the normal mean and diagonal covariance, respectively. A Gaussian noise $\epsilon$ is drawn from the recognition network with the re-parametrization trick. Then, the generator $\mathrm { Q }$ transforms the Gaussian noise $\epsilon$ into a sample of latent variable $z$ through a feed-forward network. The response decoder (RNN) computes the reconstruction loss:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal { L } _ { r e c } = - E _ { z = Q ( \epsilon ) , \epsilon \sim \mathrm { R e c N e t } ( x , c ) } \log p _ { \psi } ( x | c , z )
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
We match the approximate posterior with the prior distributions of $z$ by introducing an adversarial discriminator $\mathbf { D }$ which tells apart the prior samples from posterior samples. D is implemented as a feed-forward neural network which takes as input the concatenation of $z$ and $c$ and outputs a real value. We train $\mathbf { D }$ by minimizing the discriminator loss:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } _ { d i s c } = E _ { \epsilon \sim \mathrm { R e c N e t } ( x , c ) } [ D ( Q ( \epsilon ) , c ) ] - E _ { \tilde { \epsilon } \sim \mathrm { P r i N e t } ( c ) } [ D ( G ( \tilde { \epsilon } ) , c ) ]
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
3.3 MULTIMODAL RESPONSE GENERATION WITH A GAUSSIAN MIXTURE PRIOR NETWORK
|
| 95 |
+
|
| 96 |
+
It is a usual practice for the prior distribution in the AAE architecture to be a normal distribution. However, responses often have a multimodal nature reflecting many equally possible situations (Sato et al., 2017), topics and sentiments. A random noise with normal distribution could restrict the generator to output a latent space with a single dominant mode due to the unimodal nature of Gaussian distribution. Consequently, the generated responses could follow simple prototypes.
|
| 97 |
+
|
| 98 |
+
To capture multiple modes in the probability distribution over the latent variable, we further propose to use a distribution that explicitly defines more than one mode. Each time, the noise to generate the latent variable is selected from one of the modes. To achieve so, we make the prior network to capture a mixture of Gaussian distributions, namely, $\mathrm { G M M } ( \{ \pi _ { k } , \mu _ { k } , \sigma _ { k } ^ { 2 } I \} _ { k = 1 } ^ { K } )$ , where $\pi _ { k } , \mu _ { k }$ and $\sigma _ { k }$ are parameters of the -th component. This allows it to learn a multimodal manifold in the latent variable space in a two-step generation process – first choosing a component $k$ with $\pi _ { k }$ , and then sampling Gaussian noise within the selected component:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
p ( \epsilon | c ) = \sum _ { k = 1 } ^ { K } v _ { k } \mathcal { N } ( \epsilon ; \mu _ { k } , \sigma _ { k } ^ { 2 } I ) ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
<table><tr><td></td><td>Algorithm 1: DialogWAE Training (UEnc: utterance encoder; CEnc: context encoder; RecNet: recognition network; PriNet: prior network; Dec: decoder) K=3, ncritic=5 in all experiments</td></tr><tr><td></td><td>Initialize {0UEnc,0CEnc,0PriNet,RecNet,0Q,0G,0D,0Dec}</td></tr><tr><td></td><td>2 while not convergence do</td></tr><tr><td>3</td><td>Initialize D</td></tr><tr><td>4</td><td>while D has unsampled batches do</td></tr><tr><td>5</td><td> Sample a mini-batch of N instances {(xn,Cn)}N=1 from D</td></tr><tr><td>6</td><td>Get the representations of context and response xn=UEnc(xn), Cn=CEnc(Cn)</td></tr><tr><td>7</td><td>Sample ∈n from RecNet(xn,Cn) according to Equation 4</td></tr><tr><td>8</td><td>Sample én from PriNet(Cn,K) according to Equation 8-10</td></tr><tr><td>9</td><td>Generate zn=Q(∈n), ≥n=G(én)</td></tr><tr><td>10</td><td>Update {0Q,0G,0PriNet, 0RecNet} by gradient ascent on discriminator loss</td></tr><tr><td>11</td><td></td></tr><tr><td>12 13</td><td>for i∈ {1,.. ,ncritic} do Repeat 5-9</td></tr><tr><td>14</td><td>Update θD by gradient descent on the discriminator loss Ldisc with gradient penalty</td></tr><tr><td>15</td><td>end</td></tr><tr><td>16</td><td>Update {0UEnc,0cEnc, 0RecNet, 0Q,0Dec} by gradient descent on the reconstruction loss</td></tr><tr><td>17</td><td></td></tr><tr><td>18</td><td>end</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>19 end</td><td></td></tr></table>
|
| 105 |
+
|
| 106 |
+
where $v _ { k } \in \Delta ^ { K - 1 }$ is a component indicator with class probabilities $\pi _ { 1 } , \cdots , \pi _ { K }$ ; $\pi _ { k }$ is the mixture coefficient of the $k$ -th component of the GMM. They are computed as
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\pi _ { k } = { \frac { \exp ( e _ { k } ) } { \sum _ { i = 1 } ^ { K } \exp ( e _ { i } ) } } , { \mathrm { ~ w h e r e ~ } } \left[ \begin{array} { c } { { e _ { k } } } \\ { { \mu _ { k } } } \\ { { \log \sigma _ { k } ^ { 2 } } } \end{array} \right] = W _ { k } f _ { \theta } ( c ) + b _ { k }
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Instead of exact sampling, we use Gumbel-Softmax re-parametrization (Kusner and Hernandez- ´ Lobato, 2016) to sample an instance of $v$ :
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
v _ { k } = \frac { \exp ( ( e _ { k } + g _ { k } ) / \tau ) } { \sum _ { i = 1 } ^ { K } \exp ( ( e _ { i } + g _ { i } ) / \tau ) } ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $g _ { i }$ is a Gumbel noise computed as
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
g _ { i } = - \mathrm { l o g } ( - \mathrm { l o g } ( u _ { i } ) ) , u _ { i } \sim U ( 0 , 1 )
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
and $\tau { \in } [ 0 , 1 ]$ is the softmax temperature which is set to 0.1 in all experiments.
|
| 125 |
+
|
| 126 |
+
We refer to this framework as DialogWAE-GMP. A comparison of performance with different numbers of prior components will be shown in Section 5.1.
|
| 127 |
+
|
| 128 |
+
# 3.4 TRAINING
|
| 129 |
+
|
| 130 |
+
Our model is trained epochwise until a convergence is reached. In each epoch, we train the model iteratively by alternating two phases − an AE phase during which the reconstruction loss of decoded responses is minimized, and a GAN phase which minimizes the Wasserstein distance between the prior and approximate posterior distributions over the latent variables. The detailed procedures are presented in Algorithm 1
|
| 131 |
+
|
| 132 |
+
# 4 EXPERIMENTAL SETUP
|
| 133 |
+
|
| 134 |
+
Datasets We evaluate our model on two dialogue datasets, Dailydialog (Li et al., 2017b) and Switchboard (Godfrey and Holliman, 1997), which have been widely used in recent studies (Shen et al., 2018; Zhao et al., 2017). Dailydialog has 13,118 daily conversations for a English learner in a daily life. Switchboard contains 2,400 two-way telephone conversations under 70 specified topics. The datasets are separated into training, validation, and test sets with the same ratios as in the baseline papers, that is, 2316:60:62 for Switchboard (Zhao et al., 2017) and 10:1:1 for Dailydialog (Shen et al., 2018), respectively.
|
| 135 |
+
|
| 136 |
+
Metrics To measure the performance of DialogWAE, we adopted several standard metrics widely used in existing studies: BLEU (Papineni et al., 2002), BOW Embedding (Liu et al., 2016) and distinct (Li et al., 2015). In particular, BLEU measures how much a generated response contains $n$ -gram overlaps with the reference. We compute BLEU scores for $\mathrm { n } { < } 4$ using smoothing techniques (smoothing $7 ) ^ { \frac { 1 } { 2 } }$ (Chen and Cherry, 2014). For each test context, we sample 10 responses from the models and compute their BLEU scores. We define $n$ -gram precision and $n$ -gram recall as the average and the maximum score respectively (Zhao et al., 2017).
|
| 137 |
+
|
| 138 |
+
BOW embedding metric is the cosine similarity of bag-of-words embeddings between the hypothesis and the reference. We use three metrics to compute the word embedding similarity: 1. Greedy: greedily matching words in two utterances based on the cosine similarities between their embeddings, and to average the obtained scores (Rus and Lintean, 2012). 2. Average: cosine similarity between the averaged word embeddings in the two utterances (Mitchell and Lapata, 2008). 3. Extrema: cosine similarity between the largest extreme values among the word embeddings in the two utterances (Forgues et al., 2014). We use Glove vectors (Pennington et al., 2014) as the embeddings which will be discussed later in this section. For each test context, we report the maximum BOW embedding score among the 10 sampled responses.
|
| 139 |
+
|
| 140 |
+
Distinct computes the diversity of the generated responses. dist- $n$ is defined as the ratio of unique $n$ -grams $_ { ( \mathrm { n } = 1 , 2 ) }$ over all $n$ -grams in the generated responses. As we sample multiple responses for each test context, we evaluate diversities for both within and among the sampled responses. We define intra-dist as the average of distinct values within each sampled response and inter-dist as the distinct value among all sampled responses.
|
| 141 |
+
|
| 142 |
+
Baselines We compare the performance of DialogWAE with seven recently-proposed baselines for dialogue modeling: (i) HRED: a generalized sequence-to-sequence model with hierarchical RNN encoder (Serban et al., 2016), (ii) SeqGAN: a GAN based model for sequence generation (Li et al., 2017a), (iii) CVAE: a conditional VAE model with KL-annealing (Zhao et al., 2017), (iv) CVAEBOW: a conditional VAE model with a BOW loss (Zhao et al., 2017), (v) CVAE-CO: a collaborative conditional VAE model (Shen et al., 2018), (vi) VHRED: a hierarchical VAE model (Serban et al., 2017), and (vii) VHCR: a hierarchical VAE model with conversation modeling (Park et al., 2018).
|
| 143 |
+
|
| 144 |
+
Training and Evaluation Details We use the gated recurrent units (GRU) (Cho et al., 2014) for the RNN encoders and decoders. The utterance encoder is a bidirectional GRU with 300 hidden units in each direction. The context encoder and decoder are both GRUs with 300 hidden units. The prior and the recognition networks are both 2-layer feed-forward networks of size 200 with tanh non-linearity. The generators $Q$ and $G$ as well as the discriminator $D$ are 3-layer feed-forward networks with ReLU non-linearity (Nair and Hinton, 2010) and hidden sizes of 200, 200 and 400, respectively. The dimension of a latent variable $z$ is set to 200. The initial weights for all fully connected layers are sampled from a uniform distribution [-0.02, 0.02]. The gradient penalty is used when training $D$ (Gulrajani et al., 2017) and its hyper-parameter $\lambda$ is set to 10. We set the vocabulary size to 10,000 and define all the out-of-vocabulary words to a special token <unk>. The word embedding size is 200 and initialized with Glove vectors pre-trained on Twitter (Pennington et al., 2014). The size of context window is set to 10 with a maximum utterance length of 40. We sample responses with greedy decoding so that the randomness entirely come from the latent variables. The baselines were implemented with the same set of hyper-parameters. All the models are implemented with Pytorch $0 . 4 . { \dot { 0 } } ^ { 3 }$ , and fine-tuned with NAVER Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018).
|
| 145 |
+
|
| 146 |
+
The models are trained with mini-batches containing 32 examples each in an end-to-end manner. In the AE phase, the models are trained by SGD with an initial learning rate of 1.0 and gradient clipping at 1 (Pascanu et al., 2013). We decay the learning rate by $40 \%$ every 10th epoch. In the GAN phase, the models are updated using RMSprop (Tieleman and Hinton) with fixed learning rates of $5 \times 1 0 ^ { - 5 }$ and $1 \times 1 0 ^ { - 5 }$ for the generator and the discriminator, respectively. We tune the hyper-parameters on the validation set and measure the performance on the test set.
|
| 147 |
+
|
| 148 |
+
Table 1: Performance comparison on the SwitchBoard dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average length)
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">BLEU</td><td colspan="2">BOWEmbedding</td><td colspan="2">intra-dist</td><td rowspan="2">L</td></tr><tr><td>R P</td><td>F1</td><td>A E</td><td>G</td><td>dist-1 dist-2</td><td>inter-dist dist-1 dist-2</td></tr><tr><td>HRED</td><td>0.262 0.262</td><td>0.262</td><td>0.820 0.537 0.832</td><td></td><td>0.813 0.452</td><td>0.081 0.045</td><td>12.1</td></tr><tr><td>SeqGAN</td><td>0.282 0.282</td><td>0.282</td><td>0.817 0.515</td><td>0.748</td><td>0.705 0.521</td><td>0.070 0.052</td><td>17.2</td></tr><tr><td>CVAE</td><td>0.295 0.258</td><td>0.275</td><td>0.836 0.572</td><td>0.846</td><td>0.803 0.415</td><td>0.112 0.102</td><td>12.4</td></tr><tr><td>CVAE-BOW</td><td>0.298 0.272</td><td>0.284</td><td>0.828 0.555</td><td>0.840</td><td>0.819 0.493</td><td>0.107 0.099</td><td>12.5</td></tr><tr><td>CVAE-CO</td><td>0.299 0.269</td><td>0.283</td><td>0.839 0.557</td><td>0.855</td><td>0.863 0.581</td><td>0.111 0.110</td><td>10.3</td></tr><tr><td>VHRED</td><td>0.253 0.231</td><td>0.242</td><td>0.810 0.531</td><td>0.844</td><td>0.881 0.522</td><td>0.110 0.092</td><td>8.74</td></tr><tr><td>VHCR</td><td>0.276 0.234</td><td>0.254</td><td>0.826 0.546</td><td>0.851</td><td>0.877 0.536</td><td>0.130 0.131</td><td>9.29</td></tr><tr><td>DialogWAE</td><td>0.394 0.254</td><td>0.309</td><td>0.897 0.627</td><td>0.887</td><td>0.713 0.651</td><td>0.245 0.413</td><td>15.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.420 0.258</td><td>0.319</td><td>0.9250.661</td><td>0.894</td><td>0.713 0.671</td><td>0.333 0.555</td><td>15.2</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 2: Performance comparison on the DailyDialog dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average response length)
|
| 153 |
+
|
| 154 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">BLEU</td><td colspan="2">BOW Embedding</td><td colspan="2">intra-dist</td><td rowspan="2">L</td></tr><tr><td>R P</td><td>F1 A</td><td>E G</td><td>dist-1 dist-2</td><td>inter-dist dist-1</td><td>dist-2</td></tr><tr><td>HRED</td><td>0.232 0.232</td><td>0.232</td><td>0.915 0.511</td><td>0.798</td><td>0.935 0.969</td><td>0.093 0.097</td><td>10.1</td></tr><tr><td>SeqGAN</td><td>0.270 0.270</td><td>0.270</td><td>0.907 0.495</td><td>0.774</td><td>0.747 0.806</td><td>0.075 0.081</td><td>15.1</td></tr><tr><td>CVAE</td><td>0.265 0.222</td><td>0.242 0.923</td><td>0.543</td><td>0.811</td><td>0.938 0.973</td><td>0.177 0.222</td><td>10.0</td></tr><tr><td>CVAE-BOW</td><td>0.256 0.224</td><td>0.239</td><td>0.923 0.540</td><td>0.812</td><td>0.947 0.976</td><td>0.165 0.206</td><td>9.8</td></tr><tr><td>CVAE-CO</td><td>0.259 0.244</td><td>0.251</td><td>0.914 0.530</td><td>0.818</td><td>0.821 0.911</td><td>0.106 0.126</td><td>11.2</td></tr><tr><td>VHRED</td><td>0.271 0.260</td><td>0.265</td><td>0.892 0.507</td><td>0.786</td><td>0.633 0.771</td><td>0.071 0.089</td><td>12.7</td></tr><tr><td>VHCR</td><td>0.289 0.266</td><td>0.277</td><td>0.925 0.525</td><td>0.798</td><td>0.768 0.814</td><td>0.105 0.129</td><td>16.9</td></tr><tr><td>DialogWAE</td><td>0.341 0.278</td><td>0.306</td><td>0.948 0.578</td><td>0.846</td><td>0.830 0.940</td><td>0.327 0.583</td><td>18.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.372 0.286 0.323</td><td></td><td>0.952 0.591 0.853</td><td></td><td>0.754 0.892</td><td>0.313 0.597</td><td>24.1</td></tr></table>
|
| 155 |
+
|
| 156 |
+
# 5 EXPERIMENTAL RESULTS
|
| 157 |
+
|
| 158 |
+
# 5.1 QUANTITATIVE ANALYSIS
|
| 159 |
+
|
| 160 |
+
Tables 1 and 2 show the performance of DialogWAE and baselines on the two datasets. DialogWAE outperforms the baselines in the majority of the experiments. In terms of BLEU scores, DialogWAE (with a Gaussian mixture prior network) generates more relevant responses, with the average recall of $4 2 . 0 \%$ and $3 7 . 2 \%$ on both of the datasets. These are significantly higher than those of the CVAE baselines ( $2 9 . 9 \%$ and $2 6 . 5 \%$ ). We observe a similar trend to the BOW embedding metrics.
|
| 161 |
+
|
| 162 |
+
DialogWAE generates more diverse responses than the baselines do. The inter-dist scores are significantly higher than those of the baseline models. This indicates the sampled responses contain more distinct $n$ -grams. DialogWAE does not show better intra-distinct scores. We conjecture that this is due to the relatively long responses generated by the DialogWAE as shown in the last columns of both tables. It is highly unlikely for there to be many repeated $n$ -grams in a short response.
|
| 163 |
+
|
| 164 |
+
We further investigate the effects of the number of prior components $( K )$ . Figure 2 shows the performance of DialogWAE-GMP with respect to the number of prior components $K$ . We vary $K$ from 1 to 9. As shown in the results, in most cases, the performance increases with $K$ and decreases once $K$ reaches a certain threshold, for example, three. The optimal $K$ on both of the datasets was around 3. We attribute this degradation to training difficulty of a mixture density network and the lack of appropriate regularization, which is left for future investigation.
|
| 165 |
+
|
| 166 |
+
# 5.2 QUALITATIVE ANALYSIS
|
| 167 |
+
|
| 168 |
+
Table 3 presents examples of responses generated by the models on the DailyDialog dataset. Due to the space limitation, we report the results of CVAE-CO and DialogWAE-GMP, which are the representative models among the baselines and the proposed models. For each context in the test set, we show three samples of generated responses from each model. As we expected, DialogWAE generates more coherent and diverse responses that cover multiple plausible aspects. Furthermore, we notice that the generated response is long and exhibits informative content. By contrast, the responses generated by the baseline model exhibit relatively limited variations. Although the responses show some variants in contents, most of them share a similar prefix such as “how much”.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 2: Performance with respect to the number of prior components
|
| 172 |
+
|
| 173 |
+
Table 3: Examples of context-response pairs for the neural network models. eou indicates a change of turn. ‘Eg.i’ means the $_ { i }$ -th example.
|
| 174 |
+
|
| 175 |
+
<table><tr><td rowspan=2 colspan=2>Context</td><td rowspan=1 colspan=4>Examples of Generated Responses</td></tr><tr><td rowspan=1 colspan=3>CVAE-CO</td><td rowspan=1 colspan=1>DialogWAE-GMP</td></tr><tr><td rowspan=1 colspan=2>thank your for callingworld airline.what canI do for you?_eou_</td><td rowspan=1 colspan=3>Eg.1: i'm afraid i can't find it.Eg.2:what's the matter?Eg.3:hi, this is my first time.</td><td rowspan=1 colspan=1>Eg.1: i'd like to make a reservation for you, pleaseEg.2: do you know where i can get to get?Eg.3:can you tell me the way to the station?</td></tr><tr><td rowspan=1 colspan=2>how much is the rent?_eou_ the rent is$1500 per month.</td><td rowspan=1 colspan=3>Eg.1: how much is the rent?Eg.2: how much is the rent?Eg.3:what is the difference?</td><td rowspan=1 colspan=1>Eg.1: no problem. i'll take it.Eg.2: this one is $1.50.50,000 yuan per month.Eg.3: that sounds like a good idea.</td></tr><tr><td rowspan=2 colspan=2>guess who i saw just now?_eou_who?_eou_john smith._eou_ thatbad egg who took the lowroad since he was a boy.</td><td rowspan=2 colspan=3>Eg.1: yes, he is.Eg.2: yes,he isEg.3:yes, he is.</td><td rowspan=2 colspan=1>Eg.1: it is my favorite.Eg.2: no, but i didn't think he was able toget married. i had no idea to get her.Eg.3: this is not, but it's not that bad.it's just a litte bit,but it's not too bad.</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Eg.2:</td></tr></table>
|
| 176 |
+
|
| 177 |
+
We further investigate the interpretability of Gaussian components in the prior network, that is, what each Gaussian model has captured before generation. We pick a dialogue context “I’d like to invite you to dinner tonight, do you have time?” which is also used in (Shen et al., 2018) for analysis and generate five responses for each Gaussian component. As shown in Table 4, different
|
| 178 |
+
|
| 179 |
+
Table 4: Examples of generated responses for each Gaussian component. ‘Eg.i’ means the $_ { i }$ -th example.
|
| 180 |
+
|
| 181 |
+
<table><tr><td rowspan=1 colspan=1>Context</td><td rowspan=1 colspan=3>I would like to invite you to dinner tonight, do you have time?</td></tr><tr><td rowspan=2 colspan=1>Replies</td><td rowspan=1 colspan=1>Component 1</td><td rowspan=1 colspan=1>Component 2</td><td rowspan=1 colspan=1>Component 3</td></tr><tr><td rowspan=1 colspan=1>Eg.1:Yes,I'd like to go withyou.Eg.2: My pleasure.Eg.3:OK, thanks.Eg.4: I don't know what to doEg.5: Sure. I'd like to go out</td><td rowspan=1 colspan=1>Eg.1:I'm not sure.Eg.2: I'm not sure. What’s theproblem?Eg.3: I'm sorry to hear that.What's the problem?Eg.4: It's very kind of you, too.Eg.5: I have no idea. You have to</td><td rowspan=1 colspan=1>Eg.1: Of course I'm not sure.What's the problem?Eg.2: No,I don’t want to go.Eg.3: I want to go to bed, butI'm not sure.Eg.4: Of course not. you.Eg.5: Do you want to go?</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Gaussian models generate different types of responses: component 1 expresses a strong will, while component 2 expresses some uncertainty, and component 3 generates strong negative responses. The overlap between components is marginal (around 1/5). The results indicate that the Gaussian mixture prior network can successfully capture the multimodal distribution of the responses.
|
| 184 |
+
|
| 185 |
+
To validate the previous results, we further conduct a human evaluation with Amazon Mechanical Turk. We randomly selected 50 dialogues from the test set of DailyDialog. For each dialogue context, we generated 10 responses from each of the four models. Responses for each context were inspected by 5 participants who were asked to choose the model which performs the best in regarding to coherence, diversity and informative while being blind to the underlying algorithms. The average percentages that each model was selected as the best to a specific criterion are shown in Table 5.
|
| 186 |
+
|
| 187 |
+
Table 5: Human judgments for models trained on the Dailydialog dataset
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Model</td><td>Coherence</td><td>Diversity</td><td>Informative</td></tr><tr><td>CVAE-CO</td><td>14.4%</td><td>19.2%</td><td>24.8%</td></tr><tr><td>VHCR</td><td>26.8%</td><td>22.4%</td><td>20.4%</td></tr><tr><td>DialogWAE</td><td>27.6%</td><td>29.2%</td><td>25.6%</td></tr><tr><td>DialogWAE-GMP</td><td>31.6%</td><td>29.2%</td><td>29.6%</td></tr></table>
|
| 190 |
+
|
| 191 |
+
The proposed approach clearly outperforms the current state of the art, CVAE-CO and VHCR, by a large margin in terms of all three metrics. This improvement is especially clear when the Gaussian mixture prior was used.
|
| 192 |
+
|
| 193 |
+
# 6 CONCLUSION
|
| 194 |
+
|
| 195 |
+
In this paper, we introduced a new approach, named DialogWAE, for dialogue modeling. Different from existing VAE models which impose a simple prior distribution over the latent variables, DialogWAE samples the prior and posterior samples of latent variables by transforming contextdependent Gaussian noise using neural networks, and minimizes the Wasserstein distance between the prior and posterior distributions. Furthermore, we enhance the model with a Gaussian mixture prior network to enrich the latent space. Experiments on two widely used datasets show that our model outperforms state-of-the-art VAE models and generates more coherent, informative and diverse responses.
|
| 196 |
+
|
| 197 |
+
# ACKNOWLEDGMENTS
|
| 198 |
+
|
| 199 |
+
This work was supported by the Creative Industrial Technology Development Program (10053249) funded by the Ministry of Trade, Industry and Energy (MOTIE, Korea).
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein GAN. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 204 |
+
|
| 205 |
+
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632–642, 2015.
|
| 206 |
+
|
| 207 |
+
Boxing Chen and Colin Cherry. A systematic comparison of smoothing techniques for sentencelevel BLEU. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 362–367, 2014.
|
| 208 |
+
|
| 209 |
+
Kyunghyun Cho, Bart Van Merrienboer, C¸ alar G ¨ ulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN Encoder–Decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics.
|
| 210 |
+
|
| 211 |
+
Gabriel Forgues, Joelle Pineau, Jean-Marie Larcheveque, and R ˆ eal Tremblay. Bootstrapping dia- ´ log systems with word embeddings. In NIPS, modern machine learning and natural language processing workshop, volume 2, 2014.
|
| 212 |
+
|
| 213 |
+
John J Godfrey and Edward Holliman. Switchboard-1 release 2. Linguistic Data Consortium, Philadelphia, 926:927, 1997.
|
| 214 |
+
|
| 215 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014.
|
| 216 |
+
|
| 217 |
+
Prasoon Goyal, Zhiting Hu, Xiaodan Liang, Chenyu Wang, and Eric P Xing. Nonparametric variational auto-encoders for hierarchical representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5094–5102, 2017.
|
| 218 |
+
|
| 219 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein GANs. In Advances in Neural Information Processing Systems, pages 5769–5779, 2017.
|
| 220 |
+
|
| 221 |
+
Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. Nsml: Meet the mlaas platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018.
|
| 222 |
+
|
| 223 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference Learning Representations (ICLR), 2014.
|
| 224 |
+
|
| 225 |
+
Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. GANs for sequences of discrete elements with´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
|
| 226 |
+
|
| 227 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. arXiv preprint arXiv:1510.03055, 2015.
|
| 228 |
+
|
| 229 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017.
|
| 230 |
+
|
| 231 |
+
Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. DailyDialog: A manually labelled multi-turn dialogue dataset. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pages 986–995, 2017.
|
| 232 |
+
|
| 233 |
+
Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016.
|
| 234 |
+
|
| 235 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 236 |
+
|
| 237 |
+
Jeff Mitchell and Mirella Lapata. Vector-based models of semantic composition. proceedings of ACL-08: HLT, pages 236–244, 2008.
|
| 238 |
+
|
| 239 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807– 814, 2010.
|
| 240 |
+
|
| 241 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002.
|
| 242 |
+
|
| 243 |
+
Yookoon Park, Jaemin Cho, and Gunhee Kim. A hierarchical latent structure for variational conversation modeling. arXiv preprint arXiv:1804.03424, 2018.
|
| 244 |
+
|
| 245 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013.
|
| 246 |
+
|
| 247 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014.
|
| 248 |
+
|
| 249 |
+
Vasile Rus and Mihai Lintean. A comparison of greedy and optimal assessment of natural language student input using word-to-word similarity metrics. In Proceedings of the Seventh Workshop on Building Educational Applications Using NLP, pages 157–162. Association for Computational Linguistics, 2012.
|
| 250 |
+
|
| 251 |
+
Shoetsu Sato, Naoki Yoshinaga, Masashi Toyoda, and Masaru Kitsuregawa. Modeling situations in neural chat bots. In Proceedings of ACL 2017, Student Research Workshop, pages 120–127, 2017.
|
| 252 |
+
|
| 253 |
+
Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI, volume 16, pages 3776–3784, 2016.
|
| 254 |
+
|
| 255 |
+
Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, pages 3295–3301, 2017.
|
| 256 |
+
|
| 257 |
+
Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems, pages 6833–6844, 2017.
|
| 258 |
+
|
| 259 |
+
Xiaoyu Shen, Hui Su, Shuzi Niu, and Vera Demberg. Improving variational encoder-decoders in dialogue generation. arXiv preprint arXiv:1802.02032, 2018.
|
| 260 |
+
|
| 261 |
+
Nako Sung, Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lee, Donghyun Kwak, Jung-Woo Ha, et al. Nsml: A machine learning platform that enables you to focus on your models. arXiv preprint arXiv:1712.05902, 2017.
|
| 262 |
+
|
| 263 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014.
|
| 264 |
+
|
| 265 |
+
T Tieleman and G Hinton. Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning. Technical report, Technical Report. Available online: https://zh. coursera. org/learn/neuralnetworks/lecture/YQHki/rmsprop-divide-thegradient-by-a-running-average-of-its-recent-magnitude (accessed on 21 April 2017).
|
| 266 |
+
|
| 267 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. arXiv preprint arXiv:1711.01558, 2017.
|
| 268 |
+
|
| 269 |
+
Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In AAAI, volume 17, pages 3351–3357, 2017.
|
| 270 |
+
|
| 271 |
+
Zhen Xu, Bingquan Liu, Baoxun Wang, SUN Chengjie, Xiaolong Wang, Zhuoran Wang, and Chao Qi. Neural response generation via GAN with an approximate embedding layer. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 617–626, 2017.
|
| 272 |
+
|
| 273 |
+
Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. arXiv preprint arXiv:1703.10960, 2017.
|
| 274 |
+
|
| 275 |
+
Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander M. Rush, and Yann LeCun. Adversarially regularized autoencoders. In Proceedings of the Thirty-fifth International Conference on Machine Learning, ICML 2018, 2018.
|
md/train/BkgNqkHFPr/BkgNqkHFPr.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ENHANCED CONVOLUTIONAL NEURAL KERNELS
|
| 2 |
+
|
| 3 |
+
# Anonymous authors
|
| 4 |
+
|
| 5 |
+
Paper under double-blind review
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recent research shows that for training with $\ell _ { 2 }$ loss, convolutional neural networks (CNNs) whose width (number of channels in convolutional layers) goes to infinity correspond to regression with respect to the CNN Gaussian Process kernel (CNN-GP) (Novak et al., 2019) if only the last layer is trained, and correspond to regression with respect to the Convolutional Neural Tangent Kernel (CNTK) if all layers are trained. An exact algorithm to compute CNTK (Arora et al., 2019) yielded the finding that classification accuracy of CNTK on CIFAR-10 is within $6 { - } 7 \%$ of that of the corresponding CNN architecture (best figure being around $78 \%$ which is interesting performance for a fixed kernel.
|
| 10 |
+
|
| 11 |
+
Here we show how to significantly enhance the performance of these kernels using two ideas. (1) Modifying the kernel using a new operation called Local Average Pooling (LAP) which preserves efficient computability of the kernel and inherits the spirit of standard data augmentation using pixel shifts. Earlier papers were unable to incorporate naive data augmentation because of the quadratic training cost of kernel regression. This idea is inspired by Global Average Pooling (GAP), which we show for CNN-GP and CNTK is equivalent to full translation data augmentation. (2) Representing the input image using a pre-processing technique proposed by Coates et al. (2011), which uses a single convolutional layer composed of random image patches.
|
| 12 |
+
|
| 13 |
+
On CIFAR-10, the resulting kernel, CNN-GP with LAP and horizontal flip data augmentation, achieves $8 9 \%$ accuracy, matching the performance of AlexNet (Krizhevsky et al., 2012) , and outperforms the best previous classifier that is not a trained neural network (Mairal, 2016). Similar improvements are obtained for Fashion-MNIST.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Recent research shows that for training with $\ell _ { 2 }$ loss, convolutional neural networks (CNNs) whose width (number of channels in convolutional layers) goes to infinity, correspond to regression with respect to the CNN Gaussian Process kernel (CNN-GP) if only the last layer is trained (Novak et al., 2019; Garriga-Alonso et al., 2019), and correspond to regression with respect to the Convolutional Neural Tangent Kernel (CNTK) if all layers are trained (Jacot et al., 2018; Allen-Zhu et al., 2018; Du et al., 2019b; Arora et al., 2019). Novak et al. (2019); Garriga-Alonso et al. (2019) also implemented CNN-GP and tested its empirical performance. An efficient exact algorithm was given (Arora et al., 2019) to compute CNTK for CNN architectures, as well as those that include a Global Average Pooling (GAP) layer (defined below). This is a fixed kernel that inherits some benefits of CNNs, including exploitation of locality via convolution, as well as multiple layers of processing. For CIFAR-10, incorporating GAP into the kernel improves classification accuracy by up to $1 0 \%$ compared to pure convolutional CNTK.
|
| 18 |
+
|
| 19 |
+
While this performance is encouraging for a fixed kernel, the best accuracy is still under $7 8 \%$ , which is disappointing even compared to AlexNet. One hope for improving the accuracy further is to somehow capture modern innovations such as batch normalization, data augmentation, residual layers, etc. in CNTK. The current paper shows how to incorporate simple data augmentation. Specifically, the idea of creating new training images from existing images using pixel translation and flips, while assuming that these operations should not change the label. Since deep learning uses stochastic gradient descent (SGD), it is trivial to do such data augmentation on the fly. However, it’s unclear how to efficiently incorporate data augmentation in kernel regression, since training time is quadratic in the number of training images.
|
| 20 |
+
|
| 21 |
+
Thus somehow data augmentation has to be incorporated into the computation of the kernel itself. The main observation here is that the above-mentioned algorithm for computing CNTK involves a dynamic programming whose recursion depth is equal to the depth of the corresponding finite CNN. It is possible to impose symmetry constraints at any desired layer during this computation. In this viewpoint, it can be shown that prediction using CNTK/CNN-GP with GAP is equivalent to prediction using CNTK/CNN-GP without GAP but with full translation data augmentation with wraparound at the boundary. The translation invariance property implicitly assumed in data augmentation is exactly equivalent to an imposed symmetry constraint in the computation of the CNTK which in turn is derived from the pooling layer in the CNN. See Section 4 for more details.
|
| 22 |
+
|
| 23 |
+
Thus GAP corresponds to full translation data augmentation scheme, but in practice such data augmentation creates unrealistic images (cf. Figure 2) and training on them can harm performance. However, the idea of incorporating symmetry in the dynamic programming leads to a variant we call Local Average Pooling (LAP). This implicitly is like data augmentation where image labels are assumed to be invariant to small translation, say by a few pixels. Interestingly, LAP corresponds to a average pooling layer for CNNs, named box filtering (Szeliski, 2010).
|
| 24 |
+
|
| 25 |
+
Experimentally, we find LAP significantly enhances the performance as discussed below.
|
| 26 |
+
|
| 27 |
+
• In extensive experiments on CIFAR-10 and Fashion-MNIST, we find LAP consistently improves performance of CNN-GP and CNTK. In particular, we find CNN-GP with LAP achieves $8 1 \%$ on CIFAR-10 dataset, outperforming the best previous kernel predictor by $3 \%$ .
|
| 28 |
+
• When using the technique proposed by Coates et al. (2011), which uses randomly sampled patches from training data as filters to do pre-processing,2 CNN-GP with LAP and horizontal flip data augmentation achieves $8 9 \%$ accuracy on CIFAR-10, matching the performance of AlexNet (Krizhevsky et al., 2012) and is the strongest classifier that is not a trained neural network.3 We also test performance of CNNs with an extra layer corresponding to LAP and observe that it improves the performance on certain architectures.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Data augmentation has long been known to improve the performance of neural network and kernel methods (Sietsma & Dow, 1991; Scholkopf et al.¨ , 1996). Theoretical study of data augmentation dates back to Chapelle et al. (2001). Recently, Dao et al. (2018) proposed a theoretical framework for understanding data augmentation and showed data augmentation with a kernel classifier can have feature averaging and variance regularization effects. More recently, Chen et al. (2019) quantitatively shows in certain settings, data augmentation provably improves the classifier performance. For more comprehensive discussion on data augmentation and its properties, we refer readers to Dao et al. (2018); Chen et al. (2019) and references therein.
|
| 33 |
+
|
| 34 |
+
CNN-GP and CNTK correspond to infinitely wide CNN with different training strategies (only training the top layer or training all layers jointly). The correspondence between infinite neural networks and kernel machines was first noted by Neal (1996). More recently, this was extended to deep and convolutional neural networks (Lee et al., 2018; Matthews et al., 2018; Novak et al., 2019; Garriga-Alonso et al., 2019). These kernels correspond to infinitely wide neural networks where only the last layer is trained. A recent line of work studied overparameterized neural networks where all layers are trained (Allen-Zhu et al., 2018; Du et al., 2019b; 2018; Li & Liang, 2018; Zou et al., 2018). Their proofs imply the gradient kernel is close to a fixed kernel which only depends the training data and neural network architecture. These kernels thus correspond to infinitely wide neural networks where are all layers are trained. Jacot et al. (2018) named this kernel, neural tangent kernel (NTK). Arora et al. (2019) formally proved infinitely wide neural net predictor trained by gradient descent is equivalent to NTK predictor. Recently, NTKs induced by various neural network architectures are derived and shown to achieve strong empirical performance (Arora et al., 2019; Yang, 2019; Du et al., 2019a).
|
| 35 |
+
|
| 36 |
+
Global Average Pooling (GAP) was first proposed in Lin et al. (2013) and is common in modern CNN design (Springenberg et al., 2014; He et al., 2016; Huang et al., 2017). However, current theoretical understanding on GAP is still rather limited. It has been conjectured in Lin et al. (2013) that GAP reduces the number of parameters in the last fully-connected layer and thus avoids overfitting, and that GAP is more robust to spatial translations of the input since it sums out the spatial information. In this work, we study GAP from the CNN-GP and CNTK perspective, and draw an interesting connection between GAP and data augmentation.
|
| 37 |
+
|
| 38 |
+
Here we are interested in methods that are not trained neural networks. If the features are predefined before seeing the data, Oyallon & Mallat (2015) proposed the scattering network which achieves $\cdot$ classification accuracy on CIFAR-10. If one uses unsupervised learning methods to extract features, the method proposed in Coates et al. (2011) is one of the best-performing approaches on CIFAR-10 preceding modern CNNs. To our knowledge, the best result via unsupervised learning method in this line is by Mairal (2016), who used the convolutional kernel network to achieve $\cdot$ accuracy on CIFAR-10. In this work we combine CNTK with LAP and the idea in Coates et al. (2011) to achieve the best performance for classifiers that are not trained neural networks.
|
| 39 |
+
|
| 40 |
+
# 3 PRELIMINARIES
|
| 41 |
+
|
| 42 |
+
# 3.1 NOTATION
|
| 43 |
+
|
| 44 |
+
We use bold-faced letters for vectors, matrices and tensors. For a vector $\textbf { \em a }$ , let $[ \pmb { a } ] _ { i }$ be its $i$ -th entry; for a matrix $\pmb { A }$ , let $[ A ] _ { i , j }$ be its $( i , j )$ -th entry; for an order 4 tensor $_ { \mathbf { T } }$ , let $[ \bar { \pmb { T } } ] _ { i j , i ^ { \prime } j ^ { \prime } }$ be its $( i , j , i ^ { \prime } , j ^ { \prime } )$ -th entry. For a symmetric tensor, wet let $\begin{array} { r } { \mathrm { t r } \left( \pmb { T } \right) = \sum _ { i , j } \pmb { T } _ { i j , i j } } \end{array}$ . For an order $d$ tensor $\pmb { T } \in \mathbb { R } ^ { C _ { 1 } \times C _ { 2 } \times . . . \times C _ { d } }$ and an integer $\alpha \in [ C _ { d } ]$ , we use $\pmb { T } _ { ( \alpha ) } \in \mathbb { R } ^ { C _ { 1 } \times C _ { 2 } \times . . . \times C _ { d - 1 } }$ to denote the order $d - 1$ tensor formed by fixing the coordinate of the last dimension of $_ { \mathbf { T } }$ to be $\alpha$ .
|
| 45 |
+
|
| 46 |
+
# 3.2 CNN, CNN-GP AND CNTK
|
| 47 |
+
|
| 48 |
+
In this section we give formal definitions of CNN, CNN-GP and CNTK that we study in this paper. Throughout the paper, we let $P$ be the width and $Q$ be the height of the image. We use $q \in \mathbb { Z } _ { + }$ to denote the filter size. In practice, $q = 1 , 3 , 5$ or 7.
|
| 49 |
+
|
| 50 |
+
Padding Schemes. In the definition of CNN, CNTK and CNN-GP, we may use different padding schemes. Let $\pmb { x } \in \mathbb { R } ^ { P \times Q }$ be an matrix. For a given index pair $( i , j )$ with $i \leq 0$ , $i \geq P + 1$ , $j \le 0$ or $j \geq Q + 1$ , different padding schemes define different value for $[ \pmb { x } ] _ { i , j }$ . For circular padding, we define $[ \pmb { x } ] _ { i , j }$ to be $[ { \pmb x } ] _ { i \mathrm { ~ m o d ~ } P , j \mathrm { ~ m o d ~ } G }$ . For zero padding, we simply define $[ \pmb { x } ] _ { i , j }$ to be 0. Note the difference between circular padding and zero padding occurs only on the boundary of images. We will prove our theoretical results for the circular padding scheme to avoid boundary effects.
|
| 51 |
+
|
| 52 |
+
CNN. Now we describe CNN with and without GAP. For any input image $_ { \textbf { \em x } }$ , after $L$ intermediate layers, we obtain $\pmb { x } ^ { ( L ) } \in \mathbb { R } ^ { P \times Q \times C ^ { ( L ) } }$ where $C ^ { ( L ) }$ is the number of channels of the last layer. See Section A for the definition of $\pmb { x } ^ { ( L ) }$ . For the output, there are two choices: with and without GAP.
|
| 53 |
+
|
| 54 |
+
• Without GAP: the final output is defined as f(θ, x) = PC(L)α=1 $\begin{array} { r } { f ( \pmb { \theta } , \pmb { x } ) = \sum _ { \alpha = 1 } ^ { C ^ { ( L ) } } \left. \pmb { W } _ { ( \alpha ) } ^ { ( L + 1 ) } , \pmb { x } _ { ( \alpha ) } ^ { ( L ) } \right. } \end{array}$ where $\pmb { x } _ { ( \alpha ) } ^ { ( L ) } \in$ $\mathbb { R } ^ { P \times Q }$ , and ${ W _ { ( \alpha ) } ^ { ( L + 1 ) } } \in \mathbb { R } ^ { P \times Q }$ is the weight of the last fully-connected layer. • With GAP: the final output is defined as f (θ, x) = 1P Q PC α=1 $\begin{array} { r } { f ( \pmb { \theta } , \pmb { x } ) = \frac { 1 } { P Q } \sum _ { \alpha = 1 } ^ { C ^ { ( L ) } } \pmb { W } _ { ( \alpha ) } ^ { ( L + 1 ) } { \cdot } \sum _ { ( i , j ) \in [ P ] \times [ Q ] } \left[ \pmb { x } _ { ( \alpha ) } ^ { ( L ) } \right] _ { i , j } } \end{array}$ where W (L+1) ${ W _ { ( \alpha ) } ^ { ( L + 1 ) } \in \mathbb { R } }$ is the weight of the last fully-connected layer.
|
| 55 |
+
|
| 56 |
+
CNN-GP and CNTK. Now we describe CNN-GP and CNTK. Let ${ \boldsymbol { x } } , { \boldsymbol { x } } ^ { \prime }$ be two input images. We denote the $L$ -th layer’s CNN-GP kernel as $\Sigma ^ { ( L ) } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \in \mathbb { R } ^ { [ P ] \times [ Q ] \times [ P ] \times [ Q ] }$ and the $L$ -th layer’s CNTK kernel as ${ \bf \dot { \Theta } } ^ { ( L ) } \left( { \bf x } , { \bf x } ^ { \prime } \right) \in \mathbb { R } ^ { \left[ P \right] \times \left[ Q \right] \times \left[ P \right] \times \left[ \dot { Q } \right] }$ . See Section A for the precise definitions of $\pmb { \Sigma } ^ { ( L ) } \left( \pmb { x } , \pmb { x } ^ { \prime } \right)$ and $\Theta ^ { ( L ) } \left( \pmb { x } , \pmb { x } ^ { \prime } \right)$ . For the output kernel value, again, there are two choices, without GAP (equivalent to using a fully-connected layer) or with GAP.
|
| 57 |
+
|
| 58 |
+
• Without GAP: the output of CNN-GP is $\Sigma _ { \mathsf { F C } } \left( \mathbf { { x } } , \mathbf { { x } } ^ { \prime } \right) = \mathrm { { \ t r } } \left( \Sigma ^ { ( L ) } ( \mathbf { { x } } , \mathbf { { x } } ^ { \prime } ) \right)$ and the output of CNTK is $\Theta _ { \mathsf { F C } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) = \mathrm { t r } \left( \Theta ^ { ( L ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right)$ . • With $\begin{array} { r l } & { \mathrm { W i t h } \qquad \mathsf { G A P : } \qquad \mathrm { t h e } \qquad \mathrm { o u t p u t } \qquad \mathrm { o f } \qquad \mathsf { C N N - G P } \qquad \mathrm { i s } \qquad \Sigma _ { \mathsf { G A P } } \left( x , x ^ { \prime } \right) } \\ & { \frac { 1 } { P ^ { 2 } Q ^ { 2 } } \sum _ { i , j , i ^ { \prime } , j ^ { \prime } \in [ P ] \times [ Q ] \times [ Q ] } \left[ \mathbf { \Sigma } \mathbf { { C } } ^ { ( L ) } \left( x , x ^ { \prime } \right) \right] _ { i , j , i ^ { \prime } , j ^ { \prime } } , \quad \mathrm { a n d } \quad \mathrm { t h e } \qquad \mathrm { o u t p u t } \quad \mathrm { o f } \quad \mathsf { C N T K } \quad \mathrm { i s } } \\ & { \Theta _ { \mathsf { G A P } } \left( x , x ^ { \prime } \right) = \frac { 1 } { P ^ { 2 } Q ^ { 2 } } \sum _ { i , j ^ { \prime } , i ^ { \prime } , j ^ { \prime } \in [ P ] \times [ Q ] \times [ P ] \times [ Q ] } \left[ \mathbf { \Sigma } \mathbf { { C } } ^ { ( L ) } \left( x , x ^ { \prime } \right) \right] _ { i , j , i ^ { \prime } , j ^ { \prime } } . } \end{array}$
|
| 59 |
+
|
| 60 |
+
Kernel Prediction. Lastly, we recall the formula for kernel regression. For simplicity, throughout the paper,with data me all ke, define ble. Giwhere ${ \bf K } \left( { \pmb x } , { \pmb x } ^ { \prime } \right)$ and a dataset . The predic $( X , y )$ $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ ${ \bf K } _ { \bf X } \in \mathbb { R } ^ { N \times N }$ $[ \mathbf { K } _ { \mathbf { X } } ] _ { i , j } = \mathbf { K } ( \pmb { x } _ { i } , \pmb { x } _ { j } )$ unseen data $\mathbf { x } ^ { \prime }$ is $\begin{array} { r } { \sum _ { i = 1 } ^ { N } \alpha _ { i } \mathbf { K } ( \pmb { x } ^ { \prime } , \pmb { x } _ { i } ) } \end{array}$ , where $\pmb { \alpha } = \mathbf { K } _ { \mathbf { X } } ^ { - 1 } \pmb { y }$ .
|
| 61 |
+
|
| 62 |
+
# 3.3 DATA AUGMENTATION SCHEMES
|
| 63 |
+
|
| 64 |
+
In this paper we consider two types of data augmentation schemes: translation and horizontal flip.
|
| 65 |
+
|
| 66 |
+
Translation. Given $( i , j ) \in [ P ] \times [ Q ]$ , we define the translation operator $\mathcal { T } _ { i j } : \mathbb { R } ^ { P \times Q \times C } $ $\mathbb { R } ^ { P \times Q \times C }$ : for an image $\pmb { x } \in \mathbb { R } ^ { P \times Q \times C }$ , $\left[ \mathcal { T } _ { i j } \left( \pmb { x } \right) \right] _ { i ^ { \prime } , j ^ { \prime } , c } = \left[ \pmb { x } \right] _ { i ^ { \prime } + i , j ^ { \prime } + j , c }$ for $( i ^ { \prime } , j ^ { \prime } , c ) \in [ P ] \times [ Q ] \times$ $[ C ]$ . Here the precise definition of $[ { \pmb x } ] _ { i ^ { \prime } + i , j ^ { \prime } + j , c }$ depends on the padding scheme. Given a dataset $D = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , the full translation data augmentation scheme creates a new dataset $D _ { \mathcal { T } } =$ $\{ ( \mathcal T _ { i j } ( x _ { i } ) , y _ { i } ) \} _ { ( i , j , n ) \in [ P ] \times [ Q ] \times [ N ] }$ and training is performed on $D _ { \mathcal { T } }$ .
|
| 67 |
+
|
| 68 |
+
eratfor $\mathcal { F } : \mathbb { R } ^ { P \times Q \times C } \mathbb { R } ^ { P \times Q \times C }$ : for an imen a dataset $\pmb { x } ~ \in ~ \mathbb { R } ^ { P \times Q \times C }$ $[ \mathcal { F } ( \pmb { x } ) ] _ { i , j , c } = [ \pmb { x } ] _ { P + 1 - i , j , c }$ $( i , j , c ) \in [ P ] \times [ Q ] \times [ C ]$ $D = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ the horizontal flip augmentation scheme creates a new dataset of the form $D _ { \mathcal { F } } = \{ \left( \mathcal { F } \left( \mathbf { x } _ { i } \right) , y _ { i } \right) \} _ { i = 1 } ^ { N }$ and training is performed on $D _ { \mathcal { F } } \cup D$ .
|
| 69 |
+
|
| 70 |
+
# 4 EQUIVALENCE BETWEEN AUGMENTED KERNEL AND DATA AUGMENTATION
|
| 71 |
+
|
| 72 |
+
In this section, we demonstrate the equivalence between using data augmentation and using a augmented kernel. To formally discuss the equivalence, we use group theory to describe translation and horizontal flip operators. We provide the definition of group in Section B for completeness.
|
| 73 |
+
|
| 74 |
+
It is easy to verify that $\{ \mathcal { F } , \mathcal { Z } \}$ , $\{ \mathcal T _ { i , j } \} _ { ( i , j ) \in [ P ] \times [ Q ] }$ , $\{ \mathcal { T } _ { i , j } \circ \mathcal { F } \} _ { ( i , j ) \in [ P ] \times [ Q ] } \cup \{ \mathcal { T } _ { i , j } \} _ { ( i , j ) \in [ P ] \times [ Q ] }$ are groups, where $\mathcal { T }$ is the identity map. From now on, given a dataset $\left( \mathbf { X } , \pmb { y } \right)$ with data $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ and a group $\mathcal { G }$ , the augmented dataset $\left( \mathbf { X } _ { \mathcal { G } } , \mathbf { y } _ { \mathcal { G } } \right)$ is defined to be $\{ g ( \pmb { x } _ { i } ) , y _ { i } \} _ { g \in \mathscr { G } , i \in [ N ] }$ . Fo r kernel prediction for unseen data $\mathbf { x } ^ { \prime }$ on the augmented dataset, we have the following formula: $\begin{array} { r } { \sum _ { i \in [ N ] , g \in \mathcal { G } } \widetilde { \alpha } _ { i , g } \mathbf { K } ( \pmb { x } ^ { \prime } , g ( \pmb { x } _ { i } ) ) } \end{array}$ , where $\widetilde { \pmb { \alpha } } = \mathbf { K } _ { \mathbf { X } _ { \mathcal { G } } } ^ { - 1 } \pmb { y } _ { \mathcal { G } }$ .
|
| 75 |
+
|
| 76 |
+
To proceed, we define the concept of augmented kernel. Let $\mathcal { G }$ be a finite group. Define the augmented kernel $\mathbf { K } ^ { \mathcal { G } }$ as $\mathbf { K } ^ { \mathcal { G } } ( \pmb { x } , \pmb { x } ^ { \prime } ) \overset { \cdot } { = } \mathbb { E } _ { \pmb { g } \in \mathcal { G } } \mathbb { \bar { E } } _ { \pmb { g } ^ { \prime } \in \mathcal { G } } \mathbf { K } ( \pmb { g } ( \pmb { x } ) , \pmb { g } ^ { \prime } ( \pmb { x } ^ { \prime } ) )$ where ${ \boldsymbol { x } } , { \boldsymbol { x } } ^ { \prime }$ are two inputs images. A key observation is that for CNTK and CNN-GP, when circular padding and GAP is adopted, these are actually the augmented kernels with the group $\mathcal { G } = \{ \mathcal { T } _ { i , j } \} _ { ( i , j ) \in [ P ] \times [ Q ] }$ . Formally, we have $\begin{array} { r } { \Sigma _ { \mathsf { G A P } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) = \frac { 1 } { P Q } \pmb { \Sigma } _ { \mathsf { F C } } ^ { \mathcal { G } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) } \end{array}$ and $\begin{array} { r } { \Theta _ { \mathsf { G A P } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) = \frac { 1 } { P Q } \Theta _ { \mathsf { F C } } ^ { \mathcal { G } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) } \end{array}$ . The proof for these two equations is just by checking the formula of these kernels and using definition of circular padding. By similar proof, one can observe the following invariance property of $\Sigma _ { \mathsf { G A P } } , \Sigma _ { \mathsf { F C } } , \Theta _ { \mathsf { G A P } }$ and $\Theta _ { \mathsf { F C } }$ , under all groups mentioned above, including $\{ \mathcal { F } , \mathcal { Z } \}$ and $\{ \mathcal { T } _ { i , j } \} _ { ( i , j ) \in [ P ] \times [ Q ] }$ .
|
| 77 |
+
|
| 78 |
+
Definition 4.1. A kernel $\mathbf { K }$ is invariant under a group $\mathcal { G }$ if and only if for any $g \in \mathcal G$ $\mathbf { K } ( g ( \pmb { x } ) , g ( \pmb { x } ^ { \prime } ) ) = \mathbf { K } ( \pmb { x } , \pmb { x } ^ { \prime } )$ .
|
| 79 |
+
|
| 80 |
+
Now the following theorem formally states the equivalence between using an augmented kernel on the dataset and using the kernel on the augmented dataset.
|
| 81 |
+
|
| 82 |
+
Theorem 4.1. Given a group $\mathcal { G }$ and a kernel $\mathbf { K }$ such that $\mathbf { K }$ is invariant under $\mathcal { G }$ , then the prediction nted kernel . Namely, f $\mathbf { K } ^ { \mathcal { G } }$ wny $\left( \mathbf { X } , \pmb { y } \right)$ $\mathbf { K }$ $\left( \mathbf { X } _ { \mathcal { G } } , \mathbf { y } _ { \mathcal { G } } \right)$ $\pmb { x } ^ { \prime } \in \mathbb { R } ^ { P \times Q \times C }$ $\begin{array} { r } { \sum _ { i = 1 } ^ { N } \alpha _ { i } \mathbf { K } ^ { \mathcal { G } } ( \pmb { x } ^ { \prime } , \pmb { x } _ { i } ) = \sum _ { i \in [ N ] , g \in \mathcal { G } } \widetilde { \alpha } _ { i , g } \mathbf { K } ( \pmb { x } ^ { \prime } , g ( \pmb { x } _ { i } ) ) } \end{array}$ where $\pmb { \alpha } = \left( \mathbf { K } _ { \mathbf { X } } ^ { \mathcal { G } } \right) ^ { - 1 } \pmb { y } , \tilde { \pmb { \alpha } } = \left( \mathbf { K } _ { \mathbf { X } _ { \mathcal { G } } } \right) ^ { - 1 } \pmb { y } \mathcal { G } .$ .
|
| 83 |
+
|
| 84 |
+
The proof is deferred to Appendix B. Two corollaries are directly followed.
|
| 85 |
+
|
| 86 |
+
Corollary 4.1. For $\mathcal { G } = \{ \mathcal { T } _ { i , j } \} _ { ( i , j ) \in [ P ] \times [ Q ] }$ , for any given dataset $D$ , the prediction of $\Sigma _ { G A P }$ (or $\Theta _ { G A P } )$ with dataset $D$ is equal to the prediction of $\Sigma _ { F C } ( o r \Theta _ { F C } )$ with augmented dataset ${ \cal D } \tau$ . Corollary 4.2. For $\mathcal { G } = \{ \bar { \mathcal { F } } , \mathcal { Z } \}$ , for any given dataset $D$ , the prediction of $\Sigma _ { G A P } ^ { \mathcal { G } }$ (or $\Theta _ { G A P } ^ { g } )$ with dataset $D$ is equal to the prediction of $\Sigma _ { G A P }$ (or $\Theta _ { G A P , }$ ) with augmented dataset $D _ { \mathcal { F } } \cup D$ .
|
| 87 |
+
|
| 88 |
+
Now we discuss implications of Theorem 4.1 and its corollaries. Naively applying data augmentation, with full translation on CNTK or CNN-GP for example, one needs to create a $P ^ { 2 } Q ^ { 2 }$ times larger kernel matrix since there are $P Q$ translation operators, which is often computationally infeasible. Instead, we can directly use the augmented kernel $\scriptstyle \sum _ { \mathsf { G A P } }$ or $\Theta _ { \mathsf { G A P } }$ for the case of full translation on CNTK or CNN-GP) for prediction, for which one only needs to create a kernel matrix that is as large as the original one. For horizontal flip, although the augmentation kernel is not as conveniently computed as full translation, Corollary 4.2 still provides a more efficient method for computing kernel value and solving kernel regression, since the augmented dataset is twice as large as the original dataset.
|
| 89 |
+
|
| 90 |
+
# 5 LOCAL AVERAGE POOLING
|
| 91 |
+
|
| 92 |
+
In this section, we introduce a new operation called Local Average Pooling (LAP). As discussed in the introduction, full translation data augmentation can create unrealistic images. A natural idea is to do local translation data augmentation, i.e., restricting the distance of translation. More specifically, we only allow translation operations $\mathcal { T } _ { \Delta _ { i } , \Delta _ { j } }$ (cf. Section 3.3) for $( \Delta _ { i } , \Delta _ { j } ) \in [ - c , c ] \times [ - c , c ]$ where $c$ is a parameter to control the amount of allowed translation. With a proper choice of the parameter $c$ , translation data augmentation will not create unrealistic images (cf. Figure 2). However, naive local translation data augmentation is computationally infeasible for kernel methods, even for moderate choice of $c$ . To remedy this issue, in this section we introduce LAP, which is inspired by the connection between full translation data augmentation and GAP on CNN-GP and CNTK. Here, for simplicity, we assume $P = Q$ and derive the formula only for CNTK. Our formula can be generalized to CNN-GP in a straightforward manner.
|
| 93 |
+
|
| 94 |
+
Recall that for two given images $_ { \textbf { \em x } }$ and $\mathbf { x } ^ { \prime }$ , without GAP, the formula for output of CNTK is $\operatorname { t r } \left( \Theta ( \pmb { x } , \pmb { x } ^ { \prime } ) \right)$ . With GAP, the formula for output of CNTK is $\begin{array} { r } { \frac { 1 } { P ^ { 4 } } \sum _ { i , j , i ^ { \prime } , j ^ { \prime } \in [ P ] ^ { 4 } } \big [ \Theta \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \big ] _ { i , j , i ^ { \prime } , j ^ { \prime } } } \end{array}$ . With circular padding, the formula can be rewritten as $\begin{array} { r } { \frac { 1 } { P ^ { 2 } } \mathbb { E } _ { \Delta _ { i } , \Delta _ { i } ^ { \prime } , \Delta _ { j } , \Delta _ { j } , \Delta _ { j } ^ { \prime } \sim [ P ] ^ { 4 } } \sum _ { i , j \in [ P ] \times [ P ] } \left[ \Theta \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \right] _ { i + \Delta _ { i } , j + \Delta _ { j } , i + \Delta _ { i } ^ { \prime } , j + \Delta _ { j } ^ { \prime } } } \end{array}$ , which is again equal to $\begin{array} { r } { \frac { 1 } { P ^ { 2 } } \mathbb { E } _ { \Delta _ { i } , \Delta _ { i } ^ { \prime } , \Delta _ { j } , \Delta _ { j } ^ { \prime } \sim [ P ] ^ { 4 } } \mathrm { t r } \Big ( \Theta \left( \mathcal { T } _ { \Delta _ { i } , \Delta _ { j } } ( \pmb { x } ) , \mathcal { T } _ { \Delta _ { i } ^ { \prime } , \Delta _ { j } ^ { \prime } } ( \pmb { x } ^ { \prime } ) \right) \Big ) . \mathrm { \ b w } } \end{array}$ e ignore the $1 / P ^ { 2 }$ scaling factor since it plays no role in kernel regression.
|
| 95 |
+
|
| 96 |
+
Now we consider restricted translation operations $\mathcal { T } _ { \Delta _ { i } , \Delta _ { j } }$ with $( \Delta _ { i } , \Delta _ { j } ) \in [ - c , c ] \times [ - c , c ]$ and derive the formula for LAP. Assuming circular padding, we have
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \quad \mathbb { E } _ { \Delta _ { i } , \Delta _ { i } ^ { \prime } , \Delta _ { j } , \Delta _ { j } ^ { \prime } \sim [ - c , c ] ^ { 4 } } \mathrm { t r } \left( \Theta \left( { \mathcal T } _ { \Delta _ { i } , \Delta _ { j } } ( x ) , { \mathcal T } _ { \Delta _ { i } ^ { \prime } , \Delta _ { j } ^ { \prime } } ( x ^ { \prime } ) \right) \right) } \\ & { = \frac { 1 } { ( 2 c + 1 ) ^ { 4 } } \sum _ { \Delta _ { i } , \Delta _ { i } ^ { \prime } , \Delta _ { j } , \Delta _ { j } ^ { \prime } \in [ - c , c ] ^ { 4 } } \sum _ { i , j \in [ P ] ^ { 2 } } \left[ \Theta ( x , x ^ { \prime } ) \right] _ { i + \Delta _ { i } , j + \Delta _ { j } , i + \Delta _ { i } ^ { \prime } , j + \Delta _ { j } ^ { \prime } } . } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Now we have derived the formula for LAP which is given in Equation 1. Notice that the formula in Equation 1 is a well-defined quantity for all padding schemes. In particular, assuming zero padding, when $c = P$ , LAP is equivalent to GAP. When $c = 0$ , LAP is equivalent to no pooling layer. Another advantage of LAP is that it does not incur significant additional computational cost, since the formula in Equation 1 can be rewritten as $\begin{array} { r } { \sum _ { i , j , i ^ { \prime } , j ^ { \prime } \in [ P ] ^ { 4 } } [ \pmb { w } ] _ { i , j , i ^ { \prime } , j ^ { \prime } } \cdot \left[ \Theta ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { i , j , i ^ { \prime } , j ^ { \prime } } } \end{array}$ where each entry in the weight tensor $\pmb { w }$ can be calculated in $O ( 1 )$ time.
|
| 103 |
+
|
| 104 |
+
Note that the GAP operation in CNN-GP and CNTK corresponds to the GAP layer in CNNs. Here we observe the following box filtering layer that corresponds to LAP in CNNs. Box filtering layer (BF) is a function RP ×Q → RP ×Q such that [BF(x)]i,j = 1(2c+1)2 P∆i,∆j∈[−c,c]2 xi+∆i,j+∆j . This is in fact a standard average pooling layer but with stride 1 and pooling size $2 c + 1$ . We prove the equivalence between LAP and box filtering layer in Appendix C. In Section 6.3, we test BF on CNNs to verify its effectiveness.
|
| 105 |
+
|
| 106 |
+
# 6 EXPERIMENTS
|
| 107 |
+
|
| 108 |
+
In this section we present our empirical findings on CIFAR-10 (Krizhevsky, 2009) and FashionMNIST (Xiao et al., 2017). The detailed experimental setup is reported in Appendix D. When reporting test accuracies, the best result on the test set is in boldface and the result that corresponds to the hyper-parameter chosen by cross-validation is underlined.
|
| 109 |
+
|
| 110 |
+
# 6.1 ABLATION STUDY ON CIFAR-10 AND FASHION-MNIST
|
| 111 |
+
|
| 112 |
+
We perform experiments to study the effect of different values of the $c$ parameter in LAP and horizontal flip data argumentation on CNTK and CNN-GP. For experiments in this section we set the bias term in CNTK and CNN-GP to be $\beta = 0$ (cf. Section A). We use the same architecture for CNTK and CNN-GP as in Arora et al. (2019). I.e., we stack multiple convolutional layers before the final pooling layer. We use $d$ to denote the number of convolutions layers, and in our experiments we set $d$ to be 5, 8, 11 or 14, to study the effect of depth on CNTK and CNN-GP. For CIFAR-10, we set the $c$ parameter in LAP to be $0 , 4 , \ldots , 3 2$ , while for Fashion-MNIST we set the $c$ parameter in LAP to be $0 , 4 , \ldots , 2 8$ . Notice that when $c = 3 2$ for CIFAR-10 or $c = 2 8$ for Fashion-MNIST, LAP is equivalent to GAP, and when $c = 0$ , LAP is equivalent to no pooling layer. Results on CIFAR-10 are reported in Tables 1 and 3. Due to space constraint, results on Fashion-MNIST are reported in Tables 5 and 6 in Appendix E. In each table, for each combination of $c$ and $d$ , the first number is the test accuracy without horizontal flip data augmentation (in percentage), and the second number (in parentheses) is the test accuracy with horizontal flip data augmentation. To perform cross-validation to choose the hyper-parameters, we use the last 10000 samples in the training set of CIFAR-10 and Fashion-MNIST as the validation set and the rest samples as the training set. We then use the full training set to report the test accuracy. To perform cross-validation, we choose $\cdot$ , $d$ , CNN or CNN-GP, and whether or not to adopt horizontal flip based on the validation accuracy (shown in Appendix F). With cross-validation, the resulting accuracy is $8 2 . 0 9 \%$ on CIFAR-10 and $9 4 . 0 7 \%$ on Fashion-MNIST.
|
| 113 |
+
|
| 114 |
+
We made the following observations regarding our experimental results.
|
| 115 |
+
|
| 116 |
+
• LAP with a proper choice of the parameter $c$ significantly improves the performance of CNTK and CNN-GP. On CIFAR-10, the best-performing value of $c$ is $c = 1 2$ or 16, while on FashionMNIST the best-performing value of $c$ is $c = 4$ . We suspect this difference is due to the nature of the two datasets: CIFAR-10 contains real-life images and thus allow more translation, while Fashion-MNIST contains images with centered clothes and thus allow less translation. For both datasets, the best-performing value of $c$ is consistent across all settings (depth, CNTK or CNNGP) that we have considered. Horizontal flip data augmentation is less effective on Fashion-MNIST than on CIFAR-10. There are two possible explanations for this phenomenon. First, most images in Fashion-MNIST are nearly horizontally symmetric (e.g., T-shirts and bags). Second, CNTK and CNN-GP have already achieved a relatively high accuracy on Fashion-MNIST, and thus it is reasonable for horizontal flip data augmentation to be less effective on this dataset.
|
| 117 |
+
• Finally, for CNTK, when $c = 0$ (no pooling layer) and $c = 3 2$ (GAP) our reported test accuracies are close to those in Arora et al. (2019) on CIFAR-10. For CNN-GP, when $c = 0$ (no pooling layer) our reported test accuracies are close to those in Novak et al. (2019) on CIFAR-10 and Fashion-MNIST. This suggests that we have reproduced previous reported results.
|
| 118 |
+
|
| 119 |
+
# 6.2 IMPROVING PERFORMANCE ON CIFAR-10 USING RANDOM PATCHES LAYER
|
| 120 |
+
|
| 121 |
+
Finally, we explore another interesting question: what is the best performance achievable via a method that is not a trained neural network? To further improve the performance, we combine CNTK and CNN-GP with LAP, together with the unsupervised learning approach developed in Coates et al. (2011). Here we use the variant implemented in Recht et al. (2019). More specifically, we first sample 2048 random image patches with size $5 \times 5$ from all training images. Then for the sampled images patches, we subtract the mean of the patches, then normalize them to have unit norm, and finally perform ZCA transformation to the resulting patches. We use the resulting patches as 2048 filters of a convolutional layer with kernel size 5, stride 1 and no dilation or padding. For an input image $_ { \textbf { \em x } }$ , we use $\mathtt { c o n v } ( { \pmb x } )$ to denote the output of the convolutional layer. As in the implementation in Recht et al. (2019), we use ReLU( $\mathsf { c o n v } ( \pmb { x } ) - \beta _ { \mathrm { f e a t u r e } } )$ and $\mathrm { R e L } \dot { \mathrm { U } } ( - \mathrm { c o n v } ( { \pmb x } ) - \bar { \beta } _ { \mathrm { f e a t u r e } } )$ as the input feature for CNTK and CNN-GP. Here we fix $\beta _ { \mathrm { f e a t u r e } } = 1$ as in Recht et al. (2019) and the bias term $\beta$ in CNTK and CNN-GP to be $\beta = 1$ . To make the output kernel value invariant under horizontal flip (cf. Defintion 4.1), for each image patch, we horizontally flipped it and add the flipped patch into the convolutional layer as a new filter. Thus, for an input CIFAR-10 image of size $3 2 \times 3 2$ , the dimension of the output feature is $8 1 9 2 \times 2 8 \times 2 8$ . To isolate the effect of randomness in the choices of the image patches, we fix the random seed to be 0 throughout the experiment. In this experiment, we set the value of the $c$ parameter in LAP to be $4 , 8 , 1 2 , \ldots , 2 0$ to avoid small and large values of $c$ . The results are reported in Tables 2 and 4. Similar to the experiments in Section 6.1, again we set the hyper-parameters by cross-validation, and the resulting accuracy is $8 8 . 9 1 \%$ . See Appendix $\mathrm { F }$ for the validation accuracy for different hyper-parameters.
|
| 122 |
+
|
| 123 |
+
Table 1: Test accuracy of CNTK on CIFAR-10.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td></td><td>14</td></tr><tr><td>0</td><td>66.55 (69.87)</td><td>66.27 (69.87)</td><td>65.85 (69.37)</td><td></td><td>65.47 (68.90)</td></tr><tr><td>4</td><td>77.06 (79.08)</td><td>77.14 (78.96)</td><td>77.06 (78.98)</td><td></td><td>76.52 (78.74)</td></tr><tr><td>8</td><td>79.24 (80.95)</td><td>79.25 (81.03)</td><td>78.98 (80.94)</td><td></td><td>78.65 (80.35)</td></tr><tr><td>12</td><td>80.11 (81.34)</td><td>79.79 (81.28)</td><td>79.29 (81.14)</td><td></td><td>79.13 (80.91)</td></tr><tr><td>16</td><td>79.80 (81.21)</td><td>79.71 (81.40)</td><td>79.74 (81.09)</td><td></td><td>79.42 (81.00)</td></tr><tr><td>20</td><td>79.24 (80.67)</td><td>79.27 (80.88)</td><td>79.30 (80.76)</td><td></td><td>78.92 (80.39)</td></tr><tr><td></td><td>78.07 (79.88)</td><td>78.16 (79.79)</td><td>78.14 (80.06)</td><td></td><td>77.87 (80.07)</td></tr><tr><td>28</td><td>76.91 (78.69)</td><td>77.33 (79.20)</td><td>77.65 (79.56)</td><td></td><td>77.65 (79.74)</td></tr><tr><td>32</td><td>76.79 (78.53)</td><td>77.39 (79.13)</td><td>77.63 (79.51)</td><td></td><td>77.63 (79.74)</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 2: Test accuracy of random patches layer $^ +$ CNTK on CIFAR-10.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>d C</td><td colspan="2">5</td><td>8</td><td colspan="2">11</td><td colspan="2">14</td></tr><tr><td>4</td><td>84.63</td><td>(86.64) (</td><td>84.07 (86.23)</td><td></td><td>83.29 (85.53)</td><td></td><td>82.57 (84.81)</td></tr><tr><td>8</td><td>86.36(</td><td>(88.32)</td><td>85.80 (87.81)</td><td></td><td>85.01 (87.08)</td><td></td><td>84.57 (86.53)</td></tr><tr><td>12</td><td>86.74(</td><td>(88.35)</td><td>86.20 (87.90)</td><td></td><td>85.60 (87.36)</td><td></td><td>84.95 (86.99)</td></tr><tr><td>16</td><td></td><td>86.77 (88.36)</td><td>86.17 (87.85)</td><td></td><td>85.60 (87.44)</td><td></td><td>84.92 (86.98)</td></tr><tr><td>20</td><td>86.17(8</td><td>(87.77)</td><td>85.71 (87.50)</td><td></td><td>85.14 (87.07)</td><td></td><td>84.59 (86.84)</td></tr></table>
|
| 130 |
+
|
| 131 |
+
From our experimental results, it is evident that combining CNTK or CNN-GP with additional feature extractor can significantly improve upon the performance of using solely CNTK or CNNGP, and that of using solely the feature extractor Coates et al. (2011). Previously, it has been reported in Recht et al. (2019) that using solely the feature extractor Coates et al. (2011) (together with appropriate pooling layer) can only achieve a test accuracy of $8 4 . 2 \%$ using 256, 000 image patches, or $8 3 . 3 \%$ using 32, 000 image patches. Even with the help of horizontal data augmentation, the feature extractor Coates et al. (2011) can only achieve a test accuracy of $8 5 . 6 \%$ using 256, $\ 0 0 0$ image patches, or $8 5 . 0 \%$ using 32, 000 image patches. Here we use significantly less image patches (only 2048) but achieve a much better performance, with the help of CNTK and CNN-GP. In particular, we achieve a performance of $8 8 . 9 1 \%$ on CIFAR-10, matching the performance of AlexNet on the same dataset. In the setting reported in Coates et al. (2011), increasing the number of sampled image patches will further improve the performance. Here we also conjecture that in our setting, further increasing the number of sampled image patches can improve the performance and get close to modern CNNs. However, due the limitation on computational resources, we leave exploring the effect of number of sampled image patches as a future research direction.
|
| 132 |
+
|
| 133 |
+
# 6.3 EXPERIMENTS ON CNN WITH BOX FILTERING LAYER
|
| 134 |
+
|
| 135 |
+
In Figure 1, we verify the effectiveness of BF on a 10-layer CNN (with Batch Normalization) on CIFAR-10. The setting of this experiment is reported in Appendix G. Our network structure has no pooling layer except for the BF layer before the last fully-connected layer. The fully-connected layer is fixed during the training. Our experiment illustrates that even with a fixed last FC layer, using
|
| 136 |
+
|
| 137 |
+
Table 3: Test accuracy of CNN-GP on CIFAR-10.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td></td><td>14</td></tr><tr><td>0</td><td>63.53 (67.90)</td><td>65.54 (69.43)</td><td>66.42 (70.30)</td><td></td><td>66.81 (70.48)</td></tr><tr><td>4</td><td>76.35 (78.79)</td><td>77.03 (79.30)</td><td>77.39 (79.52)</td><td></td><td>77.35 (79.65)</td></tr><tr><td>8</td><td>79.48 (81.32)</td><td>79.82 (81.49)</td><td>79.76 (81.71)</td><td></td><td>79.69 (81.53)</td></tr><tr><td>12</td><td>80.40 (82.13)</td><td>80.64 (82.09)</td><td>80.58 (82.06)</td><td></td><td>80.32 (81.95)</td></tr><tr><td>16</td><td>80.36 (81.73)</td><td>80.78 (82.20)</td><td>80.59 (82.06)</td><td></td><td>80.41 (81.83)</td></tr><tr><td>20</td><td>79.87 (81.50)</td><td>80.15( 5 (81.33)</td><td>79.87 (81.46)</td><td></td><td>79.98 (81.35)</td></tr><tr><td>24</td><td>78.60 (79.98)</td><td>78.91 (80.48)</td><td>79.22 (80.53)</td><td></td><td>78.94 (80.46)</td></tr><tr><td>28</td><td>77.18 (78.84)</td><td>78.03 (79.86)</td><td>78.45 (79.87)</td><td></td><td>78.48 (80.07)</td></tr><tr><td>32</td><td>77.00 (78.49)</td><td>77.85 (79.65)</td><td>78.49 (80.04)</td><td></td><td>78.45 (80.01)</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 4: Test accuracy of random patches layer $^ +$ CNN-GP on CIFAR-10.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan=1 colspan=1>dC</td><td rowspan=1 colspan=5>5 8 11 14</td></tr><tr><td rowspan=4 colspan=1>481216</td><td rowspan=1 colspan=1>85.49(87.32)</td><td rowspan=1 colspan=1>85.37(87.22)</td><td rowspan=1 colspan=1>85.16(87.11)</td><td rowspan=1 colspan=1>84.79(86.81)</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>87.07 (88.64)</td><td rowspan=1 colspan=1>86.82(88.68)</td><td rowspan=1 colspan=1>86.53(88.40)</td><td rowspan=2 colspan=2>86.39 (88.15)86.62 (88.29)</td></tr><tr><td rowspan=2 colspan=1>87.23(88.91)87.28 (88.90)</td><td rowspan=1 colspan=1>87.12(88.92)</td><td rowspan=1 colspan=1>86.87(88.66)</td></tr><tr><td rowspan=1 colspan=1>87.11(88.66)</td><td rowspan=1 colspan=1>86.92(88.61)</td><td rowspan=2 colspan=2>86.74 (88.24)86.26 (87.84)</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>86.81 (88.26)</td><td rowspan=1 colspan=1>86.77(88.24)</td><td rowspan=1 colspan=1>86.61(88.14)</td></tr></table>
|
| 144 |
+
|
| 145 |
+
GAP could improve the performance of CNN. Our experiments also show that BF with appropriate choice of $c$ achieves better performance than GAP.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 1: Test accuracy of 10-layer CNN with various values for the $c$ parameter in BF.
|
| 149 |
+
|
| 150 |
+
# 7 CONCLUSION
|
| 151 |
+
|
| 152 |
+
In this paper, inspired by the connection between full translation data augmentation and GAP, we derive a new operation, LAP, on CNTK and CNN-GP, which consistently improves the performance on image classification tasks. Combining CNN-GP with LAP and the pre-processing technique proposed by Coates et al. (2011), the resulting kernel achieves $89 \%$ accuracy on CIFAR-10, matching the performance of AlexNet and is the strongest classifier that is not a trained neural network.
|
| 153 |
+
|
| 154 |
+
Here we list a few future research directions. Is it possible to develop analogs of CNTK or CNNGP incorporating modern techniques such as batch norm and residual layers, to further improve the performance? Moreover, it is an interesting direction to study other components in modern CNNs through the lens of CNTK and CNN-GP.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. arXiv preprint arXiv:1811.03962, 2018.
|
| 159 |
+
|
| 160 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. arXiv preprint arXiv:1904.11955, 2019.
|
| 161 |
+
|
| 162 |
+
Olivier Chapelle, Jason Weston, Leon Bottou, and Vladimir Vapnik. Vicinal risk minimization. In ´ Advances in neural information processing systems, pp. 416–422, 2001.
|
| 163 |
+
|
| 164 |
+
Shuxiao Chen, Edgar Dobriban, and Jane H Lee. Invariance reduces variance: Understanding data augmentation in deep learning and beyond. arXiv preprint arXiv:1907.10905, 2019.
|
| 165 |
+
|
| 166 |
+
Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215–223, 2011.
|
| 167 |
+
|
| 168 |
+
Tri Dao, Albert Gu, Alexander J Ratner, Virginia Smith, Christopher De Sa, and Christopher Re. A ´ kernel theory of modern data augmentation. arXiv preprint arXiv:1803.06084, 2018.
|
| 169 |
+
|
| 170 |
+
Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. arXiv preprint arXiv:1811.03804, 2018.
|
| 171 |
+
|
| 172 |
+
Simon S. Du, Kangcheng Hou, Barnabas P ´ oczos, Ruslan Salakhutdinov, Ruosong Wang, and Keyulu ´ Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. ArXiv, abs/1905.13192, 2019a.
|
| 173 |
+
|
| 174 |
+
Simon S. Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019b.
|
| 175 |
+
|
| 176 |
+
Adria Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional net- \` works as shallow gaussian processes. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bklfsi0cKm.
|
| 177 |
+
|
| 178 |
+
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.
|
| 179 |
+
|
| 180 |
+
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.
|
| 181 |
+
|
| 182 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and gen- ´ eralization in neural networks. arXiv preprint arXiv:1806.07572, 2018.
|
| 183 |
+
|
| 184 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 185 |
+
|
| 186 |
+
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.
|
| 187 |
+
|
| 188 |
+
Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id= B1EA-M-0Z.
|
| 189 |
+
|
| 190 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. arXiv preprint arXiv:1808.01204, 2018.
|
| 191 |
+
|
| 192 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 193 |
+
|
| 194 |
+
Julien Mairal. End-to-end kernel learning with supervised convolutional kernel networks. In Advances in neural information processing systems, pp. 1399–1407, 2016.
|
| 195 |
+
|
| 196 |
+
Alexander G de G Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018.
|
| 197 |
+
|
| 198 |
+
Radford M Neal. Priors for infinite networks. In Bayesian Learning for Neural Networks, pp. 29–53. Springer, 1996.
|
| 199 |
+
|
| 200 |
+
Roman Novak, Lechao Xiao, Yasaman Bahri, Jaehoon Lee, Greg Yang, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\bar { }$ B1g30j0qF7.
|
| 201 |
+
|
| 202 |
+
Edouard Oyallon and Stephane Mallat. Deep roto-translation scattering for object classification. ´ In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865– 2873, 2015.
|
| 203 |
+
|
| 204 |
+
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? arXiv preprint arXiv:1902.10811, 2019.
|
| 205 |
+
|
| 206 |
+
Bernhard Scholkopf, Chris Burges, and Vladimir Vapnik. Incorporating invariances in support vec- ¨ tor learning machines. In International Conference on Artificial Neural Networks, pp. 47–52. Springer, 1996.
|
| 207 |
+
|
| 208 |
+
Jocelyn Sietsma and Robert JF Dow. Creating artificial neural networks that generalize. Neural networks, 4(1):67–79, 1991.
|
| 209 |
+
|
| 210 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 211 |
+
|
| 212 |
+
Richard Szeliski. Computer vision: algorithms and applications. Springer Science & Business Media, 2010.
|
| 213 |
+
|
| 214 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 215 |
+
|
| 216 |
+
Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019.
|
| 217 |
+
|
| 218 |
+
Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Stochastic gradient descent optimizes over-parameterized deep ReLU networks. arXiv preprint arXiv:1811.08888, 2018.
|
| 219 |
+
|
| 220 |
+
# A FORMAL DEFINITIONS OF CNN-GP AND CNTK
|
| 221 |
+
|
| 222 |
+
We add some additional notations. Let $\pmb { I }$ be the identity matrix, and $[ n ] = \{ 1 , 2 , \dots , n \}$ . Let $e _ { i }$ be an indicator vector with $i$ -th entry being 1 and other entries being 0, and let 1 denote the all-one vector. We use $\odot$ to denote the pointwise product and $\otimes$ to denote the tensor product. We use $\mathrm { d i a g ( \cdot ) }$ to transform a vector to a diagonal matrix. We use $\sigma \left( \cdot \right)$ to denote the activation function, such as the rectified linear unit (ReLU) function: $\sigma \left( z \right) = \operatorname* { m a x } \{ z , 0 \}$ , and $\dot { \sigma } \left( \cdot \right)$ to denote the derivative of $\sigma \left( \cdot \right)$ . We set $c _ { \sigma } = 2$ . Denote by $\scriptstyle { \mathcal { N } } ( \mu , \Sigma )$ the Gaussian distribution with mean $\pmb { \mu }$ and covariance $\pmb { \Sigma }$ .
|
| 223 |
+
|
| 224 |
+
Equation equation 2 shows patch $[ { \pmb w } * { \pmb x } ] _ { i j }$ depends on $\begin{array} { r } { [ { \pmb x } ] _ { i - \frac { q - 1 } { 2 } : i + \frac { q - 1 } { 2 } , j - \frac { q - 1 } { 2 } : j + \frac { q - 1 } { 2 } } } \end{array}$ . For $( i , j , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$ , define
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { r } { \mathfrak { I } _ { i j , i ^ { \prime } j ^ { \prime } } = \{ ( i + a , j + b , i ^ { \prime } + a ^ { \prime } , j ^ { \prime } + b ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ] | - ( q - 1 ) / 2 \le a , b , a ^ { \prime } , b ^ { \prime } \le ( q - 1 ) \} , } \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
Now we define the convolution operation. For a convolutional filter $\pmb { w } \in \mathbb { R } ^ { q \times q }$ and an image $\pmb { x } \in \mathbb { R } ^ { P \times Q }$ , the convolution operator is defined as
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
[ { \pmb w } * { \pmb x } ] _ { i j } = \sum _ { a = - \frac { \eta - 1 } { 2 } } ^ { \frac { q - 1 } { 2 } } \sum _ { b = - \frac { \eta - 1 } { 2 } } ^ { \frac { q - 1 } { 2 } } [ { \pmb w } ] _ { a + \frac { q + 1 } { 2 } , b + \frac { q + 1 } { 2 } } [ { \pmb x } ] _ { a + i , b + j } \mathrm { ~ f o r ~ } i \in [ P ] , j \in [ Q ] .
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
Now we formally define CNN.
|
| 237 |
+
|
| 238 |
+
• Let $\pmb { x } ^ { ( 0 ) } = \pmb { x } \in \mathbb { R } ^ { P \times Q \times C ^ { ( 0 ) } }$ be the input image where $C ^ { ( 0 ) }$ is the initial number of channels. • For $h = 1 , \ldots , L , \beta = 1 , \ldots , C ^ { ( h ) }$ , the intermediate outputs are defined as
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\tilde { \mathbf { x } } _ { ( \beta ) } ^ { ( h ) } = \sum _ { \alpha = 1 } ^ { C ^ { ( h - 1 ) } } W _ { ( \alpha ) , ( \beta ) } ^ { ( h ) } * \mathbf { x } _ { ( \alpha ) } ^ { ( h - 1 ) } + \gamma \cdot b _ { ( \beta ) } , \quad \mathbf { x } _ { ( \beta ) } ^ { ( h ) } = \sqrt { \frac { c _ { \sigma } } { C ^ { ( h ) } \times q \times q } \sigma } \left( \tilde { \mathbf { x } } _ { ( \beta ) } ^ { ( h ) } \right)
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
where each W (h) $W _ { ( \alpha ) , ( \beta ) } ^ { ( h ) } \in \mathbb { R } ^ { q \times q }$ is a filter with Gaussian initialization and $b _ { ( \beta ) }$ is a bias term with Gaussian initialization scaled by $\gamma$ .
|
| 245 |
+
|
| 246 |
+
# CNN-GP and CNTK
|
| 247 |
+
|
| 248 |
+
• For $\alpha = 1 , \dots , C ^ { ( 0 ) } , ( i , j , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$ , define
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\Big [ \Sigma ^ { ( 0 ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) \Big ] _ { i j , i ^ { \prime } j ^ { \prime } } = \frac { 1 } { q ^ { 2 } } \sum _ { \alpha = 1 } ^ { C ^ { ( 0 ) } } \mathrm { t r } \left( \Big [ { \pmb K } _ { ( \alpha ) } ^ { ( 0 ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) \Big ] _ { \mathscr D _ { i j , i ^ { \prime } j ^ { \prime } } } \right) + \beta ^ { 2 } .
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
• For $h \in [ L ]$ , – For $( i , \dot { j } , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$ , define
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\begin{array} { r } { \pmb { \Lambda } _ { i j , i ^ { \prime } j ^ { \prime } } ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) = \left( \begin{array} { c c } { \left[ \pmb { \Sigma } ^ { ( h - 1 ) } ( \pmb { x } , \pmb { x } ) \right] _ { i j , i j } } & { \left[ \pmb { \Sigma } ^ { ( h - 1 ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { i j , i ^ { \prime } j ^ { \prime } } } \\ { \left[ \pmb { \Sigma } ^ { ( h - 1 ) } \left( \pmb { x } ^ { \prime } , \pmb { x } \right) \right] _ { i ^ { \prime } j ^ { \prime } , i j } } & { \left[ \pmb { \Sigma } ^ { ( h - 1 ) } \left( \pmb { x } ^ { \prime } , \pmb { x } ^ { \prime } \right) \right] _ { i ^ { \prime } j ^ { \prime } , i ^ { \prime } j ^ { \prime } } } \end{array} \right) \in \mathbb { R } ^ { 2 \times 2 } . } \end{array}
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
– Define ${ \pmb K } ^ { ( h ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) , \dot { \pmb K } ^ { ( h ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) \in \mathbb { R } ^ { P \times Q \times P \times Q }$ , for $( i , j , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\begin{array} { r l } & { \left[ { K ^ { \left( h \right) } } ( { \pmb x } , { \pmb x } ^ { \prime } ) \right] _ { i j , i ^ { \prime } j ^ { \prime } } = c _ { \sigma } \cdot \underset { ( u , v ) \sim \mathcal { N } \left( \mathbf { 0 } , \Lambda _ { i j , i ^ { \prime } j ^ { \prime } } ^ { \left( h \right) } \left( \pmb x , { \pmb x } ^ { \prime } \right) \right) } { \mathbb { E } } \left[ \cdot \sigma \left( u \right) \sigma \left( v \right) \right] , } \\ & { \left[ \dot { \pmb K } ^ { ( h ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) \right] _ { i j , i ^ { \prime } j ^ { \prime } } = c _ { \sigma } \cdot \underset { ( u , v ) \sim \mathcal { N } \left( \mathbf { 0 } , \Lambda _ { i j , i ^ { \prime } j ^ { \prime } } ^ { \left( h \right) } \left( \pmb x , { \pmb x } ^ { \prime } \right) \right) } { \mathbb { E } } \left[ \dot { \sigma } \left( u \right) \dot { \sigma } \left( v \right) \right] . } \end{array}
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
– Define $\Sigma ^ { ( h ) } ( { \pmb x } , { \pmb x } ^ { \prime } ) \in \mathbb { R } ^ { P \times Q \times P \times Q }$ , for $( i , j , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\left[ \Sigma ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { i j , i ^ { \prime } j ^ { \prime } } = \frac { 1 } { q ^ { 2 } } \mathrm { t r } \left( \left[ \pmb { K } ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { D _ { i j , i ^ { \prime } j ^ { \prime } } } \right) + \beta ^ { 2 } .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Note that $\Sigma ( { \pmb x } , { \pmb x } ^ { \prime } )$ and $\dot { \Sigma } ( { \pmb x } , { \pmb x } ^ { \prime } )$ share similar structures as their NTK counterparts (Jacot et al., 2018). The only difference is that we have one more step, taking the trace over patches. This step represents the convolution operation in the corresponding CNN. Next, we can use a recursion to compute the final kernel value.
|
| 273 |
+
|
| 274 |
+
1. First, we define ${ \Theta } ^ { ( 0 ) } ( x , x ^ { \prime } ) = \Sigma ^ { ( 0 ) } ( x , x ^ { \prime } )$ .
|
| 275 |
+
2. For $h = 1 , \ldots , L$ and $( i , j , i ^ { \prime } , j ^ { \prime } ) \in [ P ] \times [ Q ] \times [ P ] \times [ Q ]$ , we define
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
\left[ \Theta ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { i j , i ^ { \prime } j ^ { \prime } } = \frac { 1 } { q ^ { 2 } } \mathrm { t r } \left( \left[ \dot { \pmb { K } } ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \odot \Theta ^ { ( h - 1 ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) + \pmb { K } ^ { ( h ) } ( \pmb { x } , \pmb { x } ^ { \prime } ) \right] _ { D _ { i j , i ^ { \prime } j ^ { \prime } } } \right) + \beta ^ { 2 } .
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
# B ADDITIONAL DEFINITION AND PROOF FOR SECTION 4
|
| 282 |
+
|
| 283 |
+
Definition B.1 (Group). $( { \mathcal { G } } , \circ )$ is $a$ group, if and only if
|
| 284 |
+
|
| 285 |
+
1. each element $g \in { \mathcal { G } }$ is a operator: $\mathbb { R } ^ { P \times Q \times C } \mathbb { R } ^ { P \times Q \times C }$ ;
|
| 286 |
+
2 $\ : \ : \forall g _ { 1 } , g _ { 2 } \in \mathcal { G } , g _ { 1 } \circ g _ { 2 } \in \mathcal { G } \ :$ , where $( g _ { 1 } \circ g _ { 2 } ) ( { \pmb x } )$ is defined as $g _ { 1 } ( g _ { 2 } ( { \pmb x } ) )$ .
|
| 287 |
+
3. $\forall g _ { 1 } , g _ { 2 } , g _ { 3 } \in \mathcal { G } , ( g _ { 1 } \circ g _ { 2 } ) \circ g _ { 3 } = g _ { 1 } \circ ( g _ { 2 } \circ g _ { 3 } ) .$ .
|
| 288 |
+
4. $\exists e \in { \mathcal { G } }$ , such that $\forall g \in { \mathcal { G } }$ , $e \circ g = g \circ e = g$ .
|
| 289 |
+
5. $\forall g _ { 1 } \in { \mathcal { G } }$ , $\exists g _ { 2 } \in { \mathcal { G } }$ , such that $g _ { 1 } \circ g _ { 2 } = g _ { 2 } \circ g _ { 1 } = e$ . We denote $g _ { 2 }$ as the inverse of $g _ { 1 }$ , namely,
|
| 290 |
+
$g _ { 1 } ^ { - 1 }$ .
|
| 291 |
+
|
| 292 |
+
Proof of Theorem 4.1. Since we assume $\mathbf { K } _ { \mathbf { X } } ^ { \mathcal { G } }$ and $\mathbf { K } _ { \mathbf { X } _ { \mathcal { G } } }$ are invertible, both $_ { \pmb { \alpha } }$ and $\widetilde { \alpha }$ are uniquely defined. Now we claim $\widetilde { \pmb { \alpha } } _ { g } = \{ \widetilde { \alpha } _ { i , g } \} _ { i \in [ N ] } \in \mathbb { R } ^ { N }$ is equal to $\frac { \pmb { \alpha } } { | \mathscr { G } | }$ for all $g \in { \mathcal { G } }$ .
|
| 293 |
+
|
| 294 |
+
By the invariance of $\mathbf { K }$ under $\mathcal { G }$ , for all $j \in [ N ]$ and $g ^ { \prime } \in \mathcal G$ ,
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { l } { { \displaystyle \sum _ { i \in [ N ] , g \in { \mathcal G } } \frac { \alpha _ { i } } { | { \mathcal G } | } \mathbf K ( g ^ { \prime } ( { \mathbf x } _ { j } ) , g ( { \mathbf x } _ { i } ) ) = \sum _ { i \in [ N ] , g \in { \mathcal G } } \frac { \alpha _ { i } } { | { \mathcal G } | } \mathbf K ( ( g ^ { - 1 } \circ g ^ { \prime } ) ( { \mathbf x } _ { j } ) , { \mathbf x } _ { i } ) } } \\ { ~ = \sum _ { i \in [ N ] } \alpha _ { i } \mathbb E _ { g \in { \mathcal G } } \mathbf K ( g ( { \mathbf x } _ { j } ) , { \mathbf x } _ { i } ) } \\ { ~ = \sum _ { i \in [ N ] } \alpha _ { i } \mathbf K ^ { { \mathcal G } } ( { \mathbf x } _ { j } , { \mathbf x } _ { i } ) } \\ { ~ = y _ { j } . } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
Note that $\widetilde { \pmb { \alpha } }$ is defined as the unique solution of $\mathbf { K } _ { \mathbf { X } _ { \mathcal { G } } } \tilde { \pmb { \alpha } } = \pmb { y } _ { \mathcal { G } }$ , the claim has been verified.
|
| 301 |
+
|
| 302 |
+
Similarly, we have
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\sum _ { i \in [ N ] , g \in \mathcal { G } } \frac { \alpha _ { i } } { | \mathcal { G } | } \mathbf { K } ( \pmb { x } ^ { \prime } , g ( \pmb { x } _ { i } ) ) = \sum _ { i \in [ N ] } \alpha _ { i } \mathbb { E } _ { g \in \mathcal { G } } \mathbf { K } ( g ^ { - 1 } ( \pmb { x } ^ { \prime } ) , \pmb { x } _ { i } ) = \sum _ { i \in [ N ] } \alpha _ { i } \mathbf { K } ^ { \mathcal { G } } ( \pmb { x } ^ { \prime } , \pmb { x } _ { i } ) .
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
# C EQUIVALENCE BETWEEN LAP AND BOX FILTERING LAYER.
|
| 309 |
+
|
| 310 |
+
For a CNN with a box filtering layer before the final fully-connected layer, the final output is defined $\begin{array} { r } { f ( \pmb { \theta } , \pmb { x } ) = \sum _ { \alpha = 1 } ^ { C ^ { ( L ) } } \Big \langle \pmb { W } _ { ( \alpha ) } ^ { ( L + 1 ) } , \mathsf { B F } \left( \pmb { W } _ { ( \alpha ) } ^ { ( L ) } \right) } \end{array}$ x(L)(α) E, where x(L)(α) $\pmb { x } _ { ( \alpha ) } ^ { ( L ) } \in \mathbb { R } ^ { P \times Q }$ , and ${ W _ { ( \alpha ) } ^ { ( L + 1 ) } } \in \mathbb { R } ^ { P \times Q }$ is the weight of the last fully-connected layer.
|
| 311 |
+
|
| 312 |
+
Now we establish the equivalence between BF and LAP on CNTK. The equivalence on CNNGP can be derived similarly. Let $\Theta _ { \mathsf { B F } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \ \in \ \mathbb { R } ^ { [ P ] \times [ Q ] \times [ P ] \times [ Q ] }$ be the CNTK kernel of BF $\left( \pmb { x } _ { ( \alpha ) } ^ { ( L ) } \right)$ . Since BF is just a linear operation, we have
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\left[ \Theta _ { \mathsf { B F } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \right] _ { i , j , i ^ { \prime } , j ^ { \prime } } = \frac { 1 } { \left( 2 c + 1 \right) ^ { 4 } } \sum _ { \Delta _ { i } , \Delta _ { j } , \Delta _ { i ^ { \prime } } ^ { \prime } , \Delta _ { j ^ { \prime } } ^ { \prime } \in [ - c , c ] ^ { 4 } } \left[ \Theta ^ { \left( L \right) } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \right] _ { i + \Delta _ { i } , j + \Delta _ { j } , i ^ { \prime } + \Delta _ { i } ^ { \prime } , j ^ { \prime } + \Delta _ { j } ^ { \prime } } .
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
By the formula of the output kernel value for CNTK without GAP, we obtain
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\mathrm { t r } \left( \Theta _ { \mathsf { B F } } \left( \pmb { x } , \pmb { x } ^ { \prime } \right) \right) = \frac { 1 } { \left( 2 c + 1 \right) ^ { 4 } } \sum _ { \Delta _ { i } , \Delta _ { i } ^ { \prime } , \Delta _ { j } , \Delta _ { j } ^ { \prime } \in [ - c , c ] ^ { 4 } } \sum _ { \substack { i , j \in [ P ] \times [ Q ] } } [ \Theta ( \pmb { x } , \pmb { x } ^ { \prime } ) ] _ { i + \Delta _ { i } , j + \Delta _ { j } , i + \Delta _ { i } ^ { \prime } , j + \Delta _ { j } ^ { \prime } } .
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 2: Randomly sampled images with full translation data augmentation and local translation data augmentation from CIFAR-10. Full translation data augmentation can create unrealistic images that harm the performance whereas local translation data augmentation creates more realistic images.
|
| 326 |
+
|
| 327 |
+
D EXPERIMENTAL SETUP IN SECTION 6
|
| 328 |
+
|
| 329 |
+
For both CIFAR-10 and Fashion-MNIST we use the full training set and report the test accuracy on the full test set. Throughout this section we only consider $3 \times 3$ convolutional filters with stride 1 and no dilation. In the convolutional layers in CNTK and CNN-GP, we use zero padding with pad size 1 to ensure the input of each layer has the same size. We use zero padding for LAP throughout the experiment. We perform standard preprocessing (mean subtraction and standard deviation division) for all images.
|
| 330 |
+
|
| 331 |
+
In all experiments, we perform kernel ridge regression to utilize the calculated kernel values4. We normalize the kernel matrices so that all diagonal entries are ones. Equivalently, we ensure all features have unit norm in RKHS. Since the resulting kernel matrices are usually ill-conditioned, we set the regularization term $\lambda = 5 \times 1 0 ^ { - 5 }$ , to make inverting kernel matrices numerically stable. We use one-hot encodings of the labels as regression targets. We use scipy.linalg.solve to solve the corresponding kernel ridge regression problem.
|
| 332 |
+
|
| 333 |
+
The kernel value of CNTK and CNN-GP are calculated using the CuPy package. We write native CUDA codes to speed up the calculation of the kernel values. All experiments are performed on Amazon Web Services (AWS), using (possibly multiple) NVIDIA Tesla V100 GPUs. For efficiency considerations, all kernel values are computed with 32-bit precision.
|
| 334 |
+
|
| 335 |
+
One unique advantage of the dynamic programming algorithm for calculating CNTK and CNNGP is that we do not need repeat experiments for, say, different values of $c$ in LAP and different depths. With our highly-optimized native CUDA codes, we spend roughly 1,000 GPU hours on calculating all kernel values for each dataset.
|
| 336 |
+
|
| 337 |
+
# E TEST ACCURACY OF CNTK AND CNN-GP ON FASHION-MNIST
|
| 338 |
+
|
| 339 |
+
Table 5: Test accuracy of CNTK on Fashion-MNIST.
|
| 340 |
+
|
| 341 |
+
<table><tr><td>d C</td><td colspan="3">5 8</td><td colspan="2">11</td></tr><tr><td>0</td><td>92.25 (92.56)</td><td>92.22</td><td>(92.51) 92.11</td><td>(92.29)</td><td>91.76 (92.17)</td></tr><tr><td>4</td><td>93.76 (94.07)</td><td>93.69 (93.86)</td><td>93.55</td><td>(93.74)</td><td>93.37 (93.58)</td></tr><tr><td>8</td><td>93.72 (93.96)</td><td>93.67 (93.78)</td><td>93.50</td><td>(93.58)</td><td>93.32 (93.51)</td></tr><tr><td>12</td><td>93.59 (93.80)</td><td>93.58 (93.70)</td><td>93.35</td><td>(93.44)</td><td>93.21 (93.40)</td></tr><tr><td>16</td><td>93.50 (93.62)</td><td>93.42 (93.63)</td><td>93.27</td><td>(93.40)</td><td>93.10 (93.25)</td></tr><tr><td>20</td><td>93.10 (93.34)</td><td>93.17 (93.49)</td><td></td><td>93.20 (93.34)</td><td>92.99 (93.18)</td></tr><tr><td>24</td><td>92.77 (93.04)</td><td>93.07 (93.44)</td><td>93.11 (</td><td>(93.31)</td><td>93.02 (93.21)</td></tr><tr><td>28</td><td>92.80 (92.98)</td><td>93.08 (93.42)</td><td>93.12(</td><td>(93.28)</td><td>92.97 (93.19)</td></tr></table>
|
| 342 |
+
|
| 343 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td>14</td><td></td></tr><tr><td>0</td><td>91.47 (91.81)</td><td>91.96( (92.37)</td><td>92.09( (92.60)</td><td>92.22</td><td>(92.72)</td></tr><tr><td>4</td><td>93.44 (93.60)</td><td>93.59 (93.79)</td><td>93.63 (93.76)</td><td></td><td>93.59 (93.64)</td></tr><tr><td>8</td><td>93.26 (93.16)</td><td>93.41 (93.51)</td><td>93.31 (93.52)</td><td></td><td>93.39 (93.46)</td></tr><tr><td>12</td><td>92.83 3(92.94)</td><td>93.07 (93.20)</td><td>93.11 (93.15)</td><td></td><td>92.94 (93.09)</td></tr><tr><td>16</td><td>92.46 (92.51)</td><td>92.58 (92.83)</td><td>92.64( (92.92)</td><td></td><td>92.68 (93.07)</td></tr><tr><td>20</td><td>91.83 (91.72)</td><td>92.35 (92.42)</td><td>92.49 (92.79)</td><td></td><td>92.51 (92.69)</td></tr><tr><td>24</td><td>91.15 (91.40)</td><td>92.10 (92.18)</td><td>92.29 (92.60)</td><td></td><td>92.41 (92.77)</td></tr><tr><td>28</td><td>91.30 (91.37)</td><td>92.03 (92.27)</td><td>92.41( (92.79)</td><td></td><td>92.41 (92.74)</td></tr></table>
|
| 344 |
+
|
| 345 |
+
Table 6: Test accuracy of CNN-GP on Fashion-MNIST.
|
| 346 |
+
|
| 347 |
+
# F VALIDATION ACCURACY OF CNTK AND CNN-GP ON CIFAR-10 AND FASHION-MNIST
|
| 348 |
+
|
| 349 |
+
<table><tr><td>d C</td><td colspan="2">5</td><td colspan="2">8</td><td colspan="2">11</td><td colspan="2">14</td></tr><tr><td>0</td><td>64.26</td><td>(68.42)</td><td>64.47 (68.23)</td><td></td><td>63.94 (67.80)</td><td></td><td></td><td>63.29 (67.00)</td></tr><tr><td>4</td><td></td><td>75.97 (78.87)</td><td>75.89 (78.99)</td><td></td><td>75.65 (78.56)</td><td></td><td></td><td>75.40 (78.19)</td></tr><tr><td>8</td><td></td><td>77.93 (80.65)</td><td>77.90 (80.69)</td><td></td><td>77.65 (80.41)</td><td></td><td></td><td>76.92 (79.94)</td></tr><tr><td>12</td><td></td><td>78.51 (80.73)</td><td></td><td>78.47 (80.85)</td><td>78.18 (80.57)</td><td></td><td>77.71 (80.19)</td><td></td></tr><tr><td>16</td><td></td><td>78.47 (80.39)</td><td></td><td>78.69 (80.56)</td><td>78.34 (80.17)</td><td></td><td></td><td>77.74 (79.97)</td></tr><tr><td>20</td><td></td><td>77.86 (79.69)</td><td>77.81 (79.81)</td><td></td><td>77.38 (79.55)</td><td></td><td></td><td>76.88 (79.46)</td></tr><tr><td>24</td><td></td><td>76.59 (78.12)</td><td>76.80 (78.63)</td><td></td><td>76.44 (78.79)</td><td></td><td></td><td>76.18 (78.73)</td></tr><tr><td>28</td><td></td><td>75.44 (77.08)</td><td>76.15 (78.20)</td><td></td><td></td><td>76.10 (78.30)</td><td></td><td>75.95 (78.37)</td></tr><tr><td>32</td><td></td><td>75.33 (76.99)</td><td></td><td>76.04 (78.09)</td><td></td><td>76.08 (78.27)</td><td></td><td>75.99 (78.32)</td></tr></table>
|
| 350 |
+
|
| 351 |
+
Table 7: Validation accuracy of CNTK on CIFAR-10.
|
| 352 |
+
|
| 353 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td></td><td>14</td></tr><tr><td>0</td><td>62.49 (66.63)</td><td>64.25 (68.20)</td><td>64.94 (69.01)</td><td></td><td>65.35 (69.29)</td></tr><tr><td>4</td><td>75.31 (78.59)</td><td>76.05 (79.20)</td><td>76.05 (79.17)</td><td></td><td>76.20 (79.09)</td></tr><tr><td>8</td><td>78.17 (81.02)</td><td>78.53 (81.29)</td><td>78.36 (81.20)</td><td></td><td>78.05 (80.98)</td></tr><tr><td>12</td><td>79.19 (81.38)</td><td>79.08 (81.66)</td><td>79.13 (81.52)</td><td></td><td>78.90 (81.10)</td></tr><tr><td>16</td><td>79.26 (81.18)</td><td>79.24 (81.37)</td><td>78.85 (81.33)</td><td></td><td>78.82 (80.84)</td></tr><tr><td>20</td><td>78.72 (80.61)</td><td>78.72 (80.85)</td><td>78.45 (80.60)</td><td></td><td>78.08 (80.22)</td></tr><tr><td></td><td>77.31 (79.01)</td><td>77.59 (79.49)</td><td>77.41 (79.56)</td><td></td><td>77.26 (79.38)</td></tr><tr><td>28</td><td>76.01 (77.60)</td><td>76.60 (78.32)</td><td>76.57 (78.76)</td><td></td><td>76.86 (79.01)</td></tr><tr><td>32</td><td>75.72 (77.54)</td><td>76.42 (78.47)</td><td>76.56 (78.94)</td><td></td><td>76.63 (78.87)</td></tr></table>
|
| 354 |
+
|
| 355 |
+
Table 8: Validation accuracy of CNN-GP on CIFAR-10.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>d C</td><td colspan="2">5</td><td colspan="2">8</td><td colspan="2">14</td></tr><tr><td>4</td><td>83.89 (85.76)</td><td>83.13</td><td>(85.40)</td><td>82.62 (84.95)</td><td></td><td>82.02 (84.43)</td></tr><tr><td>8</td><td>85.52 (87.59)</td><td>84.88</td><td>(87.12)</td><td>84.30 (86.69)</td><td></td><td>83.84 (86.10)</td></tr><tr><td>12</td><td>85.71 (87.85)</td><td>85.32</td><td>(87.42)</td><td>84.81 (87.02)</td><td></td><td>84.26 (86.58)</td></tr><tr><td>16</td><td>85.68 (87.76)</td><td>85.19(</td><td>(87.30)</td><td>84.71 (86.83)</td><td></td><td>84.47 (86.40)</td></tr><tr><td>20</td><td>85.26 (87.11)</td><td>84.91</td><td>(86.67)</td><td>84.44 1(86.40)</td><td></td><td>84.09 (86.17)</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 9: Validation accuracy of additional feature extractor $^ +$ CNTK on CIFAR-10.
|
| 360 |
+
|
| 361 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td>14</td></tr><tr><td>4</td><td>84.03 (86.16)</td><td>84.21 (86.38)</td><td>84.15 (86.33)</td><td>83.98 (86.04)</td></tr><tr><td>8</td><td>85.85 (87.94)</td><td>85.87 (88.03)</td><td>85.70 (87.87)</td><td>85.49 (87.62)</td></tr><tr><td>12</td><td>86.37 (88.33)</td><td>86.38 (88.25)</td><td>86.06 (88.12)</td><td>85.69 (87.82)</td></tr><tr><td>16</td><td>86.06 (88.27)</td><td>86.21 (88.05)</td><td>86.01 (87.87)</td><td>85.58 (87.74)</td></tr><tr><td>20</td><td>85.73 3(87.71)</td><td>85.79 (87.60)</td><td>85.73 (87.54)</td><td>85.27 (87.21)</td></tr></table>
|
| 362 |
+
|
| 363 |
+
Table 10: Validation accuracy of additional feature extractor $^ +$ CNN-GP on CIFAR-10.
|
| 364 |
+
|
| 365 |
+
<table><tr><td>d C</td><td>5</td><td>8</td><td>11</td><td></td><td>14</td></tr><tr><td>0</td><td>92.07 (92.30)</td><td>92.08 (92.21)</td><td>91.79 (91.99)</td><td></td><td>91.51 (91.72)</td></tr><tr><td>4</td><td>93.84 (93.96)</td><td>93.82 (93.83)</td><td>93.58 (93.74)</td><td></td><td>93.40 (93.57)</td></tr><tr><td>8</td><td>93.82 (93.96)</td><td>93.80 (93.77)</td><td>93.56 (93.71)</td><td></td><td>93.37 (93.57)</td></tr><tr><td>12</td><td>93.71 (93.83)</td><td>93.60 (93.72)</td><td>93.45</td><td>(93.58)</td><td>93.41 (93.45)</td></tr><tr><td>16</td><td>93.59 (93.73)</td><td>93.39 (93.63)</td><td>93.34 (93.53)</td><td></td><td>93.21 (93.45)</td></tr><tr><td>20</td><td>93.24 (93.44)</td><td>93.29 (93.42)</td><td>93.26 (93.30)</td><td></td><td>93.19 (93.31)</td></tr><tr><td>24</td><td>93.16 (93.28)</td><td>93.21 (93.39)</td><td>93.30 (93.32)</td><td></td><td>93.22 (93.32)</td></tr><tr><td>28</td><td>93.11 (93.23)</td><td>93.21 (93.33)</td><td>93.29 ( (93.29)</td><td></td><td>93.28 (93.31)</td></tr></table>
|
| 366 |
+
|
| 367 |
+
Table 11: Validation accuracy of CNTK on Fashion-MNIST.
|
| 368 |
+
|
| 369 |
+
<table><tr><td>d C</td><td colspan="2">5</td><td colspan="2">8</td><td colspan="2">14</td></tr><tr><td>0</td><td>91.13 (91.43)</td><td>91.57</td><td>(91.77)</td><td>91.85 (91.92)</td><td></td><td>91.94 (92.08)</td></tr><tr><td>4</td><td>93.44 (93.55)</td><td></td><td>93.57 (93.54)</td><td>93.69 (93.68)</td><td></td><td>93.58 (93.64)</td></tr><tr><td>8</td><td>93.57 (93.67)</td><td></td><td>93.51 (93.68)</td><td>93.52 (93.72)</td><td></td><td>93.44 (93.58)</td></tr><tr><td>12</td><td>93.15( (93.36)</td><td></td><td>93.49 (93.59)</td><td>93.25 (93.52)</td><td></td><td>93.23 (93.44)</td></tr><tr><td>16</td><td>92.83 (92.84)</td><td></td><td>93.01 (93.19)</td><td>93.01 (93.27)</td><td></td><td>92.95 (93.18)</td></tr><tr><td>20</td><td>92.29 (92.45)</td><td></td><td>92.60 (92.82)</td><td>92.60 (92.93)</td><td></td><td>92.78 (93.10)</td></tr><tr><td>24</td><td>91.76 (92.04)</td><td></td><td>92.28 (92.63)</td><td>92.57 (92.86)</td><td></td><td>92.58 (92.78)</td></tr><tr><td>28</td><td>91.79 (92.00)</td><td></td><td>92.32 (92.56)</td><td>92.56 (92.77)</td><td></td><td>92.70 (93.00)</td></tr></table>
|
| 370 |
+
|
| 371 |
+
Table 12: Validation accuracy of CNN-GP on Fashion-MNIST.
|
| 372 |
+
|
| 373 |
+
# G SETTING OF THE EXPERIMENT IN SECTION 6.3
|
| 374 |
+
|
| 375 |
+
The total number of training epochs is 80, and the learning rate is 0.1 initially, decayed by 10 at epoch 40 and 60 respectively. The momentum is 0.9 and the weight decay factor is 0.0005. In Figure 1, the blue line reports the average test accuracy of the last 10 epochs, while the red line reports the best test accuracy of the total 80 epochs. Each experiment is repeated for 3 times. We use circular padding for both convolutional layers and the BF layer. The last data point with largest $x$ -coordinate reported in Figure 1 corresponds to GAP.
|
md/train/BkpiPMbA-/BkpiPMbA-.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DECISION BOUNDARY ANALYSIS OF ADVERSARIALEXAMPLES
|
| 2 |
+
|
| 3 |
+
Warren He, Bo Li & Dawn Song Computer Science Division University of California, Berkeley
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks (DNNs) are vulnerable to adversarial examples, which are carefully crafted instances aiming to cause prediction errors for DNNs. Recent research on adversarial examples has examined local neighborhoods in the input space of DNN models. However, previous work has limited what regions to consider, focusing either on low-dimensional subspaces or small balls. In this paper, we argue that information from larger neighborhoods, such as from more directions and from greater distances, will better characterize the relationship between adversarial examples and the DNN models. First, we introduce an attack, OPTMARGIN, which generates adversarial examples robust to small perturbations. These examples successfully evade a defense that only considers a small ball around an input instance. Second, we analyze a larger neighborhood around input instances by looking at properties of surrounding decision boundaries, namely the distances to the boundaries and the adjacent classes. We find that the boundaries around these adversarial examples do not resemble the boundaries around benign examples. Finally, we show that, under scrutiny of the surrounding decision boundaries, our OPTMARGIN examples do not convincingly mimic benign examples. Although our experiments are limited to a few specific attacks, we hope these findings will motivate new, more evasive attacks and ultimately, effective defenses.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent research in adversarial examples in deep learning has examined local neighborhoods in the input space of deep learning models. Liu et al. (2017) and Tramer et al. (2017) examine limited \` regions around benign samples to study why some adversarial examples transfer across different models. Madry et al. (2017) explore regions around benign samples to validate the robustness of an adversarially trained model. Tabacof & Valle (2016) examine regions around adversarial examples to estimate the examples’ robustness to random noise. Cao & Gong (2017) determine that considering the region around an input instance produces more robust classification than looking at the input instance alone as a single point.
|
| 12 |
+
|
| 13 |
+
These previous works have limited what regions they consider. Liu et al. and Tramer et al. focus on \` low-dimensional subspaces around a model’s gradient direction. Tabacof & Valle and Cao & Gong explore many directions, but they focus on a small ball.
|
| 14 |
+
|
| 15 |
+
In this paper, we argue that information from larger neighborhoods—both in more directions and at greater distances—will better help us understand adversarial examples in high-dimensional datasets.
|
| 16 |
+
|
| 17 |
+
First, we describe a concrete limitation in a system that utilizes information in small neighborhoods. Cao & Gong’s region classification defense (2017) takes the majority prediction in a small ball around an input instance. We introduce an attack method, OPTMARGIN, for generating adversarial examples that are robust to small perturbations, which can evade this defense.
|
| 18 |
+
|
| 19 |
+
Second, we provide an example of how to analyze an input instance’s surroundings in the model’s input space. We introduce a technique that looks at the decision boundaries around an input instance, and we use this technique to characterize our robust OPTMARGIN adversarial examples. Our analysis reveals that, while OPTMARGIN adversarial examples are robust enough to fool region classification, the decision boundaries around them do not resemble the boundaries around benign examples, in terms of distances from the example to the adjacent classes.
|
| 20 |
+
|
| 21 |
+
Third, as an extension to the above observation, we train a classifier to differentiate the decision boundary information that comes from different types of input instances. We show that our classifier can differentiate OPTMARGIN and benign examples with $9 0 . 4 \%$ accuracy, whereas region classification limits itself to a small region and fails. However, it remains to be seen whether a more sophisticated attack can find adversarial examples surrounded by decision boundaries that more accurately mimic the boundaries around benign examples.
|
| 22 |
+
|
| 23 |
+
To summarize, our contributions are:
|
| 24 |
+
|
| 25 |
+
1. We demonstrate OPTMARGIN, a new attack that evades region classification systems with low-distortion adversarial examples.
|
| 26 |
+
2. We introduce an analysis of decision boundaries around an input instance that explains the effectiveness of OPTMARGIN adversarial examples and also shows the attack’s weaknesses.
|
| 27 |
+
3. We demonstrate the expressiveness of decision boundary information by using it to classify different kinds of input instances.
|
| 28 |
+
|
| 29 |
+
We have released the code we used at https://github.com/sunblaze-ucb/ decision-boundaries.
|
| 30 |
+
|
| 31 |
+
# 2 BACKGROUND AND EXPERIMENTAL SETUP
|
| 32 |
+
|
| 33 |
+
In this paper, we study adversarial examples on the task of image classification. In image classification, a model $f$ takes an image $\boldsymbol { x } \in \mathbb { R } ^ { \mathrm { \hat { h e i g h t } \times w } }$ idth×channels and assigns it a label $f ( x ) \in C$ from a set of classes $C$ . These input instances come from a continuous high-dimensional space, while the output is discrete.
|
| 34 |
+
|
| 35 |
+
# 2.1 DATASETS
|
| 36 |
+
|
| 37 |
+
We use two popular academic image classification datasets for our experiments: MNIST, consisting of black-and-white handwritten digits (LeCun, 1998), and CIFAR-10, consisting of small color pictures (Krizhevsky & Hinton, 2009). In MNIST, the images’ pixel values are in the range $[ 0 , 1 ]$ ; in CIFAR-10, they are in [0, 255]. Additionally, we report similar experimenal results on a small subset of ImageNet in Appendix D.
|
| 38 |
+
|
| 39 |
+
# 2.2 ADVERSARIAL EXAMPLES
|
| 40 |
+
|
| 41 |
+
Adversarial examples are slightly perturbed versions of correctly classified input instances, which are misclassified. Attacks that generate adversarial examples can be targeted, producing examples that are incorrectly classified as an attacker-chosen class, or untargeted, producing examples that are misclassified as any class other than the correct one. For simplicity, we focus our analysis on untargeted attacks.
|
| 42 |
+
|
| 43 |
+
The amount of perturbation used to generate an adversarial example from the original input instance is called the example’s distortion. In this paper, we quantify the distortion using the root-meansquare (RMS) distance metric between the original input instance and the adversarial example.
|
| 44 |
+
|
| 45 |
+
# 2.3 DEFENSES
|
| 46 |
+
|
| 47 |
+
Research on defenses against adversarial examples has explored many different techniques, both for detecting and correcting adversarial examples. In this paper, we discuss two recent defenses (from among many): adversarial training with examples generated by projected gradient descent (PGD) (Madry et al., 2017) and region classification (Cao & Gong, 2017).
|
| 48 |
+
|
| 49 |
+
Adversarial training modifies the training procedure, substituting a portion of the training examples (all of them, in the case of Madry et al.) with adversarial examples. Madry et al. perform adversarial training using PGD, an attack that follows the gradient of the model’s loss function for multiple steps to generate an adversarial example.
|
| 50 |
+
|
| 51 |
+
We give an overview of region classification in Section 3.1.
|
| 52 |
+
|
| 53 |
+
# 2.4 MODELS
|
| 54 |
+
|
| 55 |
+
In this paper, for each dataset, we perform experiments on two models trained from one architecture. For MNIST, the architecture is a convolutional neural network;1 for CIFAR-10, a wide ResNet w32- 10.2 In order to study the effect of PGD adversarial training on a model’s decision regions, from each dataset, we use a defended model trained with the PGD adversarial training defense and an undefended model trained with normal examples. The PGD adversarial training on MNIST used an $L _ { \infty }$ perturbation limit of 0.3; on CIFAR-10, 8.
|
| 56 |
+
|
| 57 |
+
# 3 OPTMARGIN ATTACK ON REGION CLASSIFICATION
|
| 58 |
+
|
| 59 |
+
In this section, we develop a concrete example where limiting the analysis of a neighborhood to a small ball leads to evasion attacks on an adversarial example defense.
|
| 60 |
+
|
| 61 |
+
# 3.1 BACKGROUND: REGION CLASSIFICATION
|
| 62 |
+
|
| 63 |
+
Cao & Gong (2017) propose region classification, a defense against adversarial examples that takes the majority prediction on several slightly perturbed versions of an input, uniformly sampled from a hypercube around it. This approximates computing the majority prediction across the neighborhood around an input as a region. In contrast, the usual method of classifying only the input instance can be referred to as point classification.
|
| 64 |
+
|
| 65 |
+
Cao & Gong show that region classification approach successfully defends against low-distortion adversarial examples generated by existing attacks, and they suggest that adversarial examples robust to region classification, such as Carlini & Wagner’s high-confidence attack, have higher distortion and can be detected by other means.
|
| 66 |
+
|
| 67 |
+
# 3.2 PROPOSED OPTMARGIN ATTACK
|
| 68 |
+
|
| 69 |
+
We introduce an attack, OPTMARGIN, which can generate low-distortion adversarial examples that are robust to small perturbations, like those used in region classification.
|
| 70 |
+
|
| 71 |
+
In our OPTMARGIN attack, we create a surrogate model of the region classifier, which classifies a smaller number of perturbed input points. This is equivalent to an ensemble of models $f _ { i } ( x ) =$ $f ( { \boldsymbol { x } } + { \boldsymbol { v } } _ { i } )$ , where $f$ is the point classifier used in the region classifier and $v _ { i }$ are perturbations applied to the input $x$ . Our attack uses existing optimization attack techniques to generate an example that fools the entire ensemble while minimizing its distortion (Liu et al., 2017; He et al., 2017).
|
| 72 |
+
|
| 73 |
+
Let $Z ( x )$ refer to the $| C |$ -dimensional vector of class weights, in logits, that $f$ internally uses to classify image $x$ . As in Carlini & Wagner’s $L _ { 2 }$ attack (2017b), we define a loss term for each model in our ensemble:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\ell _ { i } ( x ^ { \prime } ) = \ell ( x ^ { \prime } + v _ { i } ) = \operatorname* { m a x } \left( - \kappa , Z ( x ^ { \prime } + v _ { i } ) _ { y } - \operatorname* { m a x } \{ Z ( x ^ { \prime } + v _ { i } ) _ { j } : j \neq y \} \right)
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
This loss term increases when model $f _ { i }$ predicts the correct class $y$ over the next most likely class. When the prediction is incorrect, the value bottoms out at $- \kappa$ logits, with $\kappa$ referred to as the confidence margin. In OPTMARGIN, we use $\kappa = 0$ , meaning it is acceptable that the model just barely misclassifies its input. With these loss terms, we extend Carlini & Wagner’s $L _ { 2 }$ attack (2017b) to use an objective function that uses the sum of these terms. Whereas Carlini & Wagner would have one $\ell ( x ^ { \prime } )$ in the minimization problem below, we have:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r l } { \mathrm { m i n i m i z e } } & { { } | | x ^ { \prime } - x | | _ { 2 } ^ { 2 } + c \cdot \left( \ell _ { 1 } ( x ^ { \prime } ) + \ldots + \ell _ { n } ( x ^ { \prime } ) \right) } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
We use 20 classifiers in the attacker’s ensemble, where we choose $v _ { 1 } , . . . , v _ { 1 9 }$ to be random orthogonal vectors of uniform magnitude $\varepsilon$ , and $v _ { 2 0 } = 0$ . This choice is meant to make it likely for a random perturbation to lie in the region between the $v _ { i }$ ’s. Adding $f _ { 2 0 } ( x ) = f ( x )$ to the ensemble causes the attack to generate examples that are also adversarial under point classification.
|
| 86 |
+
|
| 87 |
+
For stability in optimization, we used fixed values of $v _ { i }$ throughout the optimization of the attack. This technique was previously used in Carlini & Wagner’s attack (2017a) on Feinman et al.’s stochastic dropout defense (2017).
|
| 88 |
+
|
| 89 |
+
# 3.3 DISTORTION EVALUATION
|
| 90 |
+
|
| 91 |
+
We compare the results of our OPTMARGIN attack with Carlini & Wagner’s $L _ { 2 }$ attack (2017b) with low confidence $\kappa = 0$ , which we denote OPTBRITTLE, and with high confidence $\kappa = 4 0$ , which we denote OPTSTRONG, as well as FGSM (Goodfellow et al., 2015) with $\epsilon = 0 . 3$ (in $L _ { \infty }$ distance) for MNIST and 8 for CIFAR-10. In our OPTMARGIN attacks, we use $\varepsilon = 0 . 3$ (in RMS distance) for MNIST and $\varepsilon = 8$ for CIFAR-10. Figure 5 in the appendix shows a sample of images generated by each method. Table 1 shows the average distortion (amount of perturbation used) across a random sample of adversarial examples.
|
| 92 |
+
|
| 93 |
+
<table><tr><td></td><td colspan="4">MNIST</td><td colspan="4">CIFAR-10</td></tr><tr><td>Examples</td><td colspan="2">Normal</td><td colspan="2">Adv tr.</td><td colspan="2">Normal</td><td colspan="2">Adv tr.</td></tr><tr><td>OPTBRITTLE</td><td>100%</td><td>0.0732</td><td>100%</td><td>0.0879</td><td>100%</td><td>0.824</td><td>100%</td><td>3.83</td></tr><tr><td>OPTMARGIN (ours)</td><td>100%</td><td>0.158</td><td>100%</td><td>0.168</td><td>100%</td><td>1.13</td><td>100%</td><td>4.08</td></tr><tr><td>OPTSTRONG</td><td>100%</td><td>0.214</td><td>28%</td><td>0.391</td><td>100%</td><td>2.86</td><td>73%</td><td>37.4</td></tr><tr><td>FGSM</td><td>91%</td><td>0.219</td><td>6%</td><td>0.221</td><td>82%</td><td>8.00</td><td>36%</td><td>8.00</td></tr></table>
|
| 94 |
+
|
| 95 |
+
Table 1: Success rate $( \% )$ and average distortion (RMS) of adversarial examples generated by different attacks. On MNIST, the level of distortion in OPTMARGIN examples is visible to humans, but the original class is still distinctly visible (see Figure 5 in the appendix for sample images).
|
| 96 |
+
|
| 97 |
+
On average, the OPTMARGIN examples have higher distortion than OPTBRITTLE examples (which are easily corrected by region classification) but much lower distortion than OPTSTRONG examples.
|
| 98 |
+
|
| 99 |
+
The OPTSTRONG attack produces examples with higher distortion, which Cao & Gong discount; they suggest that these are easier to detect through other means. Additionally, the OPTSTRONG attack does not succeed in finding adversarial examples with a satisfactory confidence margins for all images on PGD adversarially trained models.3 The FGSM samples are also less successful on the PGD adversarially trained models. The average distortion reported in Table 1 is averaged over only the successful adversarial examples in these two cases. The distortion and success rate can be improved by using intermediate confidence values, at the cost of lower robustness. Due to the low success rate and high distortion, we do not consider OPTSTRONG attacks in the rest of our experiments.
|
| 100 |
+
|
| 101 |
+
# 3.4 EVADING REGION CLASSIFICATION
|
| 102 |
+
|
| 103 |
+
We evaluate the effectiveness of our OPTMARGIN attack by testing the generated examples on Cao & Gong’s region classification defense.
|
| 104 |
+
|
| 105 |
+
We use a region classifier that takes 100 samples from a hypercube around the input. Cao & Gong determined reasonable hypercube radii for similar models by increasing the radius until the region classifier’s accuracy on benign data would fall below the accuracy of a point classifier. We use their reported values in our own experiments: 0.3 for a CNN MNIST classifier and 5.1 (0.02 of 255) for a ResNet CIFAR-10 classifier.
|
| 106 |
+
|
| 107 |
+
In the following experiments, we test with a sample of 100 images from the test set of MNIST and CIFAR-10.
|
| 108 |
+
|
| 109 |
+
Table 2 shows the accuracy of four different configurations of defenses for each task: no defense (point classification with normal training), region classification (with normal training), PGD adversarial training (with point classification), and region classification with PGD adversarial training.
|
| 110 |
+
|
| 111 |
+
<table><tr><td></td><td colspan="4">MNIST</td><td colspan="4">CIFAR-10</td></tr><tr><td></td><td colspan="2">Region cls.</td><td colspan="2">Point cls.</td><td colspan="2">Region cls.</td><td colspan="2">Point cls.</td></tr><tr><td>Examples</td><td>Normal</td><td>Adv. tr.</td><td>Normal</td><td>Adv. tr.</td><td>Normal</td><td>Adv. tr.</td><td>Normal</td><td>Adv. tr.</td></tr><tr><td>Benign</td><td>99%</td><td>100%</td><td>99%</td><td>100%</td><td>93%</td><td>86%</td><td>96%</td><td>86%</td></tr><tr><td>FGSM</td><td>16%</td><td>54%</td><td>9%</td><td>94%</td><td>16%</td><td>55%</td><td>17%</td><td>55%</td></tr><tr><td>OPTBRITTLE</td><td>95%</td><td>89%</td><td>0%</td><td>0%</td><td>71%</td><td>79%</td><td>0%</td><td>0%</td></tr><tr><td>OPTMARGIN (Ours)</td><td>1%</td><td>10%</td><td>0%</td><td>0%</td><td>5%</td><td>5%</td><td>0%</td><td>6%</td></tr></table>
|
| 112 |
+
|
| 113 |
+
Table 2: Accuracy of region classification and point classification on examples from different attacks. More effective attacks result in lower accuracy. The attacks that achieve the lowest accuracy for each configuration of defenses are shown in bold. We omit comparison with OPTSTRONG due to its disproportionately high distortion and low attack success rate.
|
| 114 |
+
|
| 115 |
+
Cao & Gong develop their own attacks against region classification, CW- $L _ { 0 }$ -A, CW- $. L _ { 2 }$ -A, and CW$L _ { \infty }$ -A. These start with Carlini & Wagner’s low-confidence $L _ { 0 } , L _ { 2 }$ , and $L _ { \infty }$ attacks, respectively, and amplify the generated perturbation by some multiplicative factor. They evaluate these in a targeted attack setting. Their best result on MNIST is with CW- $L _ { 2 }$ -A with a $2 \times$ amplification, resulting in $63 \%$ attack success rate. Their best result on CIFAR-10 is with CW- $L _ { \infty }$ -A with a $2 . 8 \times$ amplification, resulting in $85 \%$ attack success rate. In our experiments with OPTMARGIN in an untargeted attack setting, we observe high attack success rates at similar increases in distortion.
|
| 116 |
+
|
| 117 |
+
These results show that our OPTMARGIN attack successfully evades region classification and point classification.
|
| 118 |
+
|
| 119 |
+
# 3.5 PERFORMANCE
|
| 120 |
+
|
| 121 |
+
Using multiple models in an ensemble increases the computational cost of optimizing adversarial examples, proportional to the number of models in the ensemble. Our optimization code, based on Carlini & Wagner’s, uses 4 binary search steps with up to 1,000 optimization iterations each. In our slowest attack, on the PGD adversarially trained CIFAR-10 model, our attack takes around 8 minutes per image on a GeForce GTX 1080.
|
| 122 |
+
|
| 123 |
+
Although this is computationally expensive, an attacker can generate successful adversarial examples with a small ensemble (20 models) compared to the large number of samples used in region classification (100)—the slowdown factor is less for the attacker than for the defender.
|
| 124 |
+
|
| 125 |
+
# 4 DECISION BOUNDARIES AROUND ADVERSARIAL EXAMPLES
|
| 126 |
+
|
| 127 |
+
We have shown that examining a small ball around a given input instance may not adequately distinguish OPTMARGIN adversarial examples. In this section, we introduce a more comprehensive analysis of the neighborhood around an input instance. We study the decision boundaries of a model— the surfaces in the model’s input space where the output prediction changes between classes. We examine benign and adversarial examples in terms of the decision boundaries surrounding them in the input space.
|
| 128 |
+
|
| 129 |
+
Specifically, we consider the distance to the nearest boundary in many directions (Section 4.1) and adjacent decision regions’ classes (Section 4.2).
|
| 130 |
+
|
| 131 |
+
# 4.1 DECISION BOUNDARY DISTANCE
|
| 132 |
+
|
| 133 |
+
To gather information on the sizes and shapes of a model’s decision regions, we estimate the distance to a decision boundary in a sample of random directions in the model’s input space, starting from a given input point. In each direction, we estimate the distance to a decision boundary by computing the model’s prediction on perturbed inputs at points along the direction. In our experiments, we check every 0.02 units (in RMS distance) for MNIST and every 2 units for CIFAR-10. When the model’s prediction on the perturbed image changes from the prediction on the original image (at the center), we use that distance as the estimate of how far the decision boundary is in that direction. When the search encounters a boundary this way, we also record the predicted class of the adjacent region.
|
| 134 |
+
|
| 135 |
+
For CIFAR-10, we perform this search over a set of 1,000 random orthogonal directions (for comparison, the input space is 3,072-dimensional). For MNIST, we search over 784 random orthogonal directions (the entire dimensionality of the input space) in both positive and negative directions, for a total of 1,568 directions.
|
| 136 |
+
|
| 137 |
+
# 4.1.1 INDIVIDUAL INSTANCES
|
| 138 |
+
|
| 139 |
+
Figure 1 shows the decision boundary distances for a typical set of a benign example and adversarial examples generated as described in Section 3 (OPTBRITTLE is an easily mitigated C&W low-confidence $L _ { 2 }$ attack; OPTMARGIN is our method for generating robust examples; FGSM is the fast gradient sign method from Goodfellow et al. (2015)). It shows these attacks applied to models trained normally and models trained with PGD adversarial examples. See Figure 6 in the appendix for a copy of this data plotted in $L _ { \infty }$ distance.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 1: Decision boundary distances (RMS) from single sample images, plotted in ascending order. Colors represent the adjacent class to an encountered boundary. A black line is drawn at the expected distance of an image sampled during region classification. Results are shown for models with normal training and models with PGD adversarial training. For MNIST, original example correctly classified 8 (yellow); OPTBRITTLE and OPTMARGIN examples misclassified as 5 (brown); FGSM example misclassified as 2 (green). For CIFAR-10, original example correctly classified as DEER (purple); OPTBRITTLE, OPTMARGIN, and FGSM examples misclassified as HORSE (gray).
|
| 143 |
+
|
| 144 |
+
The boundary distance plots for examples generated by the basic optimization attack are strikingly different from those for benign examples. As one would expect from the optimization criteria, they are as close to the boundary adjacent to the original class as possible, in a majority of the directions. These plots depict why region classification works well on these examples: a small perturbation in nearly every direction crosses the boundary to the original class.
|
| 145 |
+
|
| 146 |
+
For our OPTMARGIN attack, the plots lie higher, indicating that the approach successfully creates a margin of robustness in many random directions. Additionally, in the MNIST examples, the original class is not as prominent in the adjacent classes. Thus, these examples are challenging for region classification both due to robustness to perturbation and due to the neighboring incorrect decision regions.
|
| 147 |
+
|
| 148 |
+
# 4.1.2 SUMMARY STATISTICS.
|
| 149 |
+
|
| 150 |
+
We summarize the decision boundary distances of each image by looking at the minimum and median distances across the random directions. Figure 2 shows these representative distances for a sample of correctly classified benign examples and successful adversarial examples. See Figure 7 in the appendix for a copy of this data plotted in $L _ { \infty }$ distance.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 2: Minimum and median decision boundary distances across random directions, for a sample of images. Blue: Benign. Red: FGSM. Green: OPTMARGIN (ours). Orange: OPTBRITTLE. Each statistic is plotted in ascending order. A black line is drawn at the expected distance of images sampled by region classification.
|
| 154 |
+
|
| 155 |
+
These plots visualize why OPTMARGIN and FGSM examples, in aggregate, are more robust to random perturbations than the OPTBRITTLE attack. The black line, which represents the expected distance that region classification will check, lies below the green OPTMARGIN line in the median distance plots, indicating that region classification often samples points that match the adversarial example’s incorrect class. OPTMARGIN and FGSM examples, however, are still less robust than benign examples to random noise.
|
| 156 |
+
|
| 157 |
+
Unfortunately, on MNIST, no simple threshold on any one of these statistics accurately separates benign examples (blue) from OPTMARGIN examples (green). At any candidate threshold (a horizontal line), there is either too much of the blue line below it (false positives) or too much of the green line above it (false negatives).
|
| 158 |
+
|
| 159 |
+
PGD adversarial training on the MNIST architecture results in decision boundaries closer to the benign examples, reducing the robustness to random perturbations. In CIFAR-10, however, the opposite is observed, with boundaries farther from benign examples in the PGD adversarially trained model. The effect of PGD adversarial training on the robustness of benign examples to random perturbations is not universally beneficial nor harmful.
|
| 160 |
+
|
| 161 |
+
# 4.2 ADJACENT CLASS PURITY
|
| 162 |
+
|
| 163 |
+
Another observation from plots like those in Figure 1 is that adversarial examples tend to have most directions lead to a boundary adjacent to a single class. We compute the purity of the top $k$ classes around an input image as the largest cumulative fraction of random directions that encounter a boundary adjacent to one of $k$ classes.
|
| 164 |
+
|
| 165 |
+
Figure 3 shows the purity of the top $k$ classes averaged across different samples of images, for varying values of $k$ . These purity scores are especially high for OPTBRITTLE adversarial examples compared to the benign examples. The difference is smaller in CIFAR-10, with the purity of benign examples being higher.
|
| 166 |
+
|
| 167 |
+
Region classification takes advantage of cases where the purity of the top 1 class is high, and the one class is the correct class, and random samples from the region are likely to be past those boundaries.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Average purity of adjacent classes around benign and adversarial examples. Orange: OPTBRITTLE. Red: FGSM. Green: OPTMARGIN (ours). Blue: Benign. Curves that are lower on the left indicate images surrounded by decision regions of multiple classes. Curves that near the top at rank 1 indicate images surrounded almost entirely by a single class.
|
| 171 |
+
|
| 172 |
+
Adversarial examples generated by OPTMARGIN and FGSM are much harder to distinguish from benign examples in this metric.
|
| 173 |
+
|
| 174 |
+
# 5 DECISION BOUNDARY CLASSIFICATION
|
| 175 |
+
|
| 176 |
+
Cao & Gong’s region classification defense is limited in its consideration of a hypercube region of a fixed radius, the same in all directions. We successfully bypassed this defense with our OPTMARGIN attack, which created adversarial examples that were robust to small perturbations in many directions. However, the surrounding decision boundaries of these adversarial examples and benign examples are still different, in ways that sampling a hypercube would not reveal.
|
| 177 |
+
|
| 178 |
+
In this section, we propose a more general system for utilizing the neighborhood of an input to determine whether the input is adversarial. Our design considers the distribution of distances to a decision boundary in a set of randomly chosen directions and the distribution of adjacent classes— much more information than Cao & Gong’s approach.
|
| 179 |
+
|
| 180 |
+
# 5.1 DESIGN
|
| 181 |
+
|
| 182 |
+
We ask the following question: Can information about the decision boundaries around an input be used to differentiate the adversarial examples generated using the current attack methods and benign examples? These adversarial examples are surrounded by distinctive boundaries on some models, such as the the PGD adversarially trained CIFAR-10 model (seen in Figure 2). However, this is not the case for either MNIST model, where no simple threshold can accurately differentiate OPTMARGIN adversarial examples from benign examples. In order to support both models, we design a classifier that uses comprehensive boundary information from many random directions.
|
| 183 |
+
|
| 184 |
+
We construct a neural network to classify decision boundary information, which we show in Figure 4. The network processes the distribution of boundary distances by applying two 1-D convolutional layers to a sorted array of distances. Then, it flattens the result, appends the first three purity scores, and applies two fully connected layers, resulting in a binary classification. We use rectified linear units for activation in internal layers. During training, we use dropout (Hinton et al., 2012) with probability 0.5 in internal layers.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 4: Architecture of our decision boundary classifier. Sizes are shown for our MNIST experiments.
|
| 188 |
+
|
| 189 |
+
# 5.2 EXPERIMENTAL RESULTS
|
| 190 |
+
|
| 191 |
+
We train with an Adam optimizer with a batch size of 128 and a learning rate of 0.001. For MNIST, we train on 8,000 examples (each example here contains both a benign image and an adversarial image) for 32 epochs, and we test on 2,000 other examples. For CIFAR-10, we train on 350 examples for 1,462 epochs, and we test on 100 other examples. We filtered these sets only to train on correctly classified benign examples and successful adversarial examples.
|
| 192 |
+
|
| 193 |
+
Table 3 shows the false positive and false negative rates of the model when using the hard max of the output. We had fewer successful adversarial examples from the FGSM attacks than for OPTBRITTLE and OPTMARGIN. We discuss the results of the corresponding decision boundary classification experiment on FGSM examples in Appendix C.
|
| 194 |
+
|
| 195 |
+
Table 3: False positive and false negative rates for the decision boundary classifier, trained on examples from one attack and evaluated examples generated by the same or a different attack. We consider the accuracy under the worst-case benign/adversarial data split (all-benign if false positive rate is higher; all-adversarial if false negative rate is higher), and we select the best choice of base model and training set. These best-of-worst-case numbers are shown in bold and compared with Cao & Gong’s approach from Table 2.
|
| 196 |
+
|
| 197 |
+
<table><tr><td rowspan="2">Training attack</td><td rowspan="2">False pos. Benign</td><td colspan="2">False neg.</td><td colspan="2">Accuracy</td></tr><tr><td>OPTBRITTLE</td><td>OPTMARGIN</td><td>Our approach</td><td>Cao&Gong</td></tr><tr><td colspan="5">MNIST, normal training</td><td></td></tr><tr><td>OPTBRITTLE</td><td>1.0%</td><td>1.0%</td><td>74.1%</td><td rowspan="4">90.4%</td><td rowspan="4">10%</td></tr><tr><td>OPTMARGIN</td><td>9.6%</td><td>0.6%</td><td>7.2%</td></tr><tr><td></td><td></td><td>MNIST,PGD adversarial training</td><td></td></tr><tr><td>OPTBRITTLE</td><td>2.6%</td><td>2.0%</td><td>39.8%</td></tr><tr><td>OPTMARGIN</td><td>10.3%</td><td>0.4%</td><td>14.5%</td><td></td><td></td></tr><tr><td colspan="5">CIFAR-10, normal training</td><td rowspan="5"></td></tr><tr><td>OPTBRITTLE</td><td>5.3%</td><td>3.2%</td><td>56.8%</td><td></td></tr><tr><td>OPTMARGIN</td><td>8.4%</td><td>7.4%</td><td>5.3%</td><td>96.4%</td></tr><tr><td>CIFAR-10, PGD adversarial training</td><td></td><td></td><td></td><td></td></tr><tr><td>OPTBRITTLE</td><td>0.0%</td><td>2.4%</td><td>51.8%</td><td></td></tr><tr><td>OPTMARGIN</td><td>3.6%</td><td>0.0%</td><td>1.2%</td><td></td></tr></table>
|
| 198 |
+
|
| 199 |
+
This classifier achieves high accuracy on the attacks we study in this paper. These results suggest that our current best attack, OPTMARGIN, does not accurately mimic the distribution of decision boundary distances and adjacent classes. On MNIST, the model with normal training had better accuracy, while the model with PGD adversarial training had better accuracy on CIFAR-10. We do not have a conclusive explanation for this, but we do note that these were the models with decision boundaries being farther from benign examples (Figure 2). It remains an open question, however, whether adversaries can adapt their attacks to generate examples with surrounding decision boundaries that more closely match benign data.
|
| 200 |
+
|
| 201 |
+
# 5.3 PERFORMANCE
|
| 202 |
+
|
| 203 |
+
Assuming one already has a base model for classifying input data, the performance characteristics of this experiment are dominated by two parts: (i) collecting decision boundary information around given inputs and (ii) training a model for classifying the decision boundary information.
|
| 204 |
+
|
| 205 |
+
Our iterative approach to part (i) is expensive, involving many forward invocations of the base model. In our slowest experiment, with benign images on the PGD adversarially trained wide ResNet w32-10 CIFAR-10 model, it took around 70 seconds per image to compute decision boundary information for 1,000 directions on a GeForce GTX 1080. This time varies from image to image because our algorithm stops searching in a direction when it encounters a boundary. Collecting decision boundary information for OPTBRITTLE examples was much faster, for instance. Collecting information in fewer directions can save time, and should perform well as long as the samples adequately capture the distribution of distances and adjacent classes.
|
| 206 |
+
|
| 207 |
+
Part (ii) depends only on the number of directions, and the performance is independent of the base model’s complexity. In our experiments, this training phase took about 1 minute for each model and training set configuration.
|
| 208 |
+
|
| 209 |
+
Running the decision boundary classifier on the decision boundary information is fast compared to the training and boundary collection.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We considered the benefits of examining large neighborhoods around a given input in input space. We demonstrated an effective OPTMARGIN attack against a region classification defense, which only considered a small ball of the input space around a given instance. We analyzed the neighborhood of examples generated by this new attack by looking at the decision boundaries around them, as well as the boundaries around benign examples and less robust adversarial examples. This analysis incorporated information from many directions in input space and from longer distances than previous work. We found that the comprehensive information about surrounding decision boundaries reveals there are still differences between our robust adversarial examples and benign examples. It remains to be seen how attackers might generate adversarial examples that better mimic benign examples’ surrounding decision boundaries.
|
| 214 |
+
|
| 215 |
+
# ACKNOWLEDGMENTS
|
| 216 |
+
|
| 217 |
+
We thank Neil Gong for discussing his work with us, and we thank our anonymous reviewers for their helpful suggestions. This work was supported in part by Berkeley Deep Drive, the Center for Long-Term Cybersecurity, and FORCES (Foundations Of Resilient CybEr-Physical Systems), which receives support from the National Science Foundation (NSF award numbers CNS-1238959, CNS-1238962, CNS-1239054, CNS-1239166). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Xiaoyu Cao and Neil Zhenqiang Gong. Mitigating evasion attacks to deep neural networks via region-based classification. Annual Computer Security Applications Conference (ACSAC), 2017.
|
| 222 |
+
|
| 223 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. ACM Workshop on Artificial Intelligence and Security (AISEC), 2017a.
|
| 224 |
+
|
| 225 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017b.
|
| 226 |
+
|
| 227 |
+
Reuben Feinman, Ryan R Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
|
| 228 |
+
|
| 229 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. 3rd International Conference on Learning Representations (ICLR), 2015.
|
| 230 |
+
|
| 231 |
+
Warren He, James Wei, Xinyun Chen, Nicholas Carlini, and Dawn Song. Adversarial example defense: Ensembles of weak defenses are not strong. In 11th USENIX Workshop on Offensive Technologies (WOOT 17), Vancouver, BC, 2017. USENIX Association. URL https://www. usenix.org/conference/woot17/workshop-program/presentation/he.
|
| 232 |
+
|
| 233 |
+
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.
|
| 234 |
+
|
| 235 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 236 |
+
|
| 237 |
+
Yann LeCun. The MNIST database of handwritten digits. 1998. URL http://yann.lecun. com/exdb/mnist/.
|
| 238 |
+
|
| 239 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. 5th International Conference on Learning Representations (ICLR), 2017.
|
| 240 |
+
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
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. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 244 |
+
|
| 245 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, Inception-ResNet and the impact of residual connections on learning. In AAAI, pp. 4278–4284, 2017.
|
| 246 |
+
|
| 247 |
+
Pedro Tabacof and Eduardo Valle. Exploring the space of adversarial images. In Neural Networks (IJCNN), 2016 International Joint Conference on, pp. 426–433. IEEE, 2016.
|
| 248 |
+
|
| 249 |
+
Florian Tramer, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space \` of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017.
|
| 250 |
+
|
| 251 |
+
# A SAMPLE IMAGES
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 5: Adversarially perturbed images generated by different attack methods, for differently trained models, and their corresponding original images. Instances where the attack does not produce an example are shown as black squares.
|
| 255 |
+
|
| 256 |
+
# B BOUNDARY DISTANCES IN $L _ { \infty }$
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 6: Equivalent of Figure 1, decision boundary distances from sample images, plotted in $L _ { \infty }$ distance. A black line is drawn at the radius of the region used in region classification.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 7: Equivalent of Figure 2, minimum and median decision boundary distances across random directions, plotted in $L _ { \infty }$ distance. Blue: Benign. Red: FGSM. Green: OPTMARGIN (ours). Orange: OPTBRITTLE. A black line is drawn at the radius of the region used in region classification.
|
| 263 |
+
|
| 264 |
+
# C CLASSIFYING FGSM DECISION BOUNDARIES
|
| 265 |
+
|
| 266 |
+
FGSM creates fewer successful adversarial examples, especially for adversarially trained models. The examples from our experiments $\epsilon = 0 . 3$ for MNIST and 8 for CIFAR-10) have higher distortion than the OPTMARGIN examples and are farther away from decision boundaries. We trained a classifier on successful FGSM adversarial examples for normal models (without adversarial training). Table 4 shows the accuracy of these classifiers. PGD adversarial training is effective enough that we did not have many successful adversarial examples to train the classifier.
|
| 267 |
+
|
| 268 |
+
<table><tr><td colspan="3">Normal training</td></tr><tr><td>Dataset</td><td>False pos.</td><td>False neg.</td></tr><tr><td>MNIST</td><td>7.0%</td><td>12.8%</td></tr><tr><td>CIFAR-10</td><td>20.0%</td><td>32.9%</td></tr></table>
|
| 269 |
+
|
| 270 |
+
Table 4: False positive and false negative rates for the decision boundary classifier, trained and evaluated on FGSM examples.
|
| 271 |
+
|
| 272 |
+
# D EXPERIMENTS ON IMAGENET
|
| 273 |
+
|
| 274 |
+
We perform a similar series of experiments on a small subset of ImageNet (Russakovsky et al., 2015), using Szegedy et al.’s Inception-ResNet model4 (2017) in a top-1 classification task. We experiment with a small sample of 450 images from the validation set. We use a hypercube with radius 0.02 for region classification (the same relative size as for CIFAR-10, but for pixel values in the range $[ 0 , 1 ] \cdot$ ), $\bar { \varepsilon } = 8 / 2 5 5$ for OPTMARGIN (0.031), and $\epsilon = 8 / 2 5 5$ for FGSM. In experiments where we train and test a classifier, we divide the set into 350 images for training and 100 images for testing. These experiments use the same number of examples as our CIFAR-10 experiments, but relative to the scope of ImageNet, there are fewer than are needed to exercise all 1,000 classes in the dataset. Thus, the results in this section are more preliminary.
|
| 275 |
+
|
| 276 |
+
Table 5 summarizes the effectiveness of OPTMARGIN and other attacks on Cao & Gong’s region classification defense and the effectiveness of decision boundary classification. The results are consistent with our experiments on MNIST and CIFAR-10, with OPTMARGIN having the highest attack success rate under region classification. However, our decision boundary classifier network accurately classifies OPTBRITTLE and OPTMARGIN adversarial examples. FGSM examples have much higher distortion and are less successful but are less accurately classified.
|
| 277 |
+
|
| 278 |
+
<table><tr><td>Attack</td><td>Distortion</td><td>Top-1 accuracy Point cls.</td><td>Region cls.</td><td>Boundary classification False pos.</td><td>False neg.</td></tr><tr><td>Benign</td><td>N/A</td><td>65%</td><td>66%</td><td>N/A</td><td>N/A</td></tr><tr><td>OPTBRITTLE</td><td>0.000 526</td><td>0%</td><td>64%</td><td>1%</td><td>0%</td></tr><tr><td>OPTMARGIN</td><td>0.00101</td><td>0%</td><td>16%</td><td>4%</td><td>3%</td></tr><tr><td>FGSM</td><td>0.0308</td><td>22%</td><td>22%</td><td>39%</td><td>41%</td></tr></table>
|
| 279 |
+
|
| 280 |
+
Table 5: Effectiveness of attacks on ImageNet. Reported in this table: average distortion (RMS) of successful examples, top-1 accuracy under point classification and region classification, and false positive and false negative rates of a decision boundary classifier trained on examples of the same attack.
|
| 281 |
+
|
| 282 |
+
Figure 8 shows images and surrounding decision boundaries for a sample validation image and adversarial examples created from it. Figure 9 presents summary statistics of decision boundary distance and the average purity of adjacent classes around a sample of validation images. Both the individual examples and summary statistics show that OPTBRITTLE examples are susceptible to classification changes under slight random perturbations, and OPTMARGIN examples are robust enough to withstand the random perturbations used in region classification. On ImageNet, FGSM examples show much higher robustness to random perturbations and more a composition of adjacent decision region classes more similar to benign images.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 8: Images (top) and decision boundary distances in RMS distance (middle) and $L _ { \infty }$ distance (bottom) based of a validation example from ImageNet and adversarial examples. Original example correctly classified as EGGNOG (lime); OPTBRITTLE example misclassified as ESPRESSO (cyan); OPTMARGIN example misclassified as BEER GLASS (pink); and FGSM example misclassified as COFFEE MUG (blue).
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 9: Minimum (left) and median (middle) decision boundary distances and average purity of adjacent classes (right) around a sample of ImageNet validation images. Blue: Benign. Red: FGSM. Green: OPTMARGIN (ours). Orange: OPTBRITTLE. In distance plots, a black line is drawn at the expected distance of images sampled by region classification in RMS distance plots (top) and radius of region in $L _ { \infty }$ distance (bottom).
|
md/train/ByeMPlHKPH/ByeMPlHKPH.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LITE TRANSFORMER WITHLONG-SHORT RANGE ATTENTION
|
| 2 |
+
|
| 3 |
+
Zhanghao $\mathbf { W _ { u } } ^ { * 1 , 2 }$ Zhijian $\mathbf { L i u ^ { * 1 } }$ Ji Lin1 Yujun Lin1 Song Han1 1Massachusetts Institute of Technology 2Shanghai Jiao Tong University {zhwu, zhijian, songhan}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Transformer has become ubiquitous in natural language processing (e.g., machine translation, question answering); however, it requires enormous amount of computations to achieve high performance, which makes it not suitable for mobile applications that are tightly constrained by the hardware resources and battery. In this paper, we present an efficient mobile NLP architecture, Lite Transformer to facilitate deploying mobile NLP applications on edge devices. The key primitive is the Long-Short Range Attention (LSRA), where one group of heads specializes in the local context modeling (by convolution) while another group specializes in the long-distance relationship modeling (by attention). Such specialization brings consistent improvement over the vanilla transformer on three well-established language tasks: machine translation, abstractive summarization, and language modeling. Under constrained resources (500M/100M MACs), Lite Transformer outperforms transformer on WMT’14 English-French by $1 . 2 / 1 . 7$ BLEU, respectively. Lite Transformer reduces the computation of transformer base model by $2 . 5 \times$ with 0.3 BLEU score degradation. Combining with pruning and quantization, we further compressed the model size of Lite Transformer by $1 8 . 2 \times$ . For language modeling, Lite Transformer achieves 1.8 lower perplexity than the transformer at around 500M MACs. Notably, Lite Transformer outperforms the AutoML-based Evolved Transformer by 0.5 higher BLEU for the mobile NLP setting without the costly architecture search that requires more than 250 GPU years. Code has been made available at https://github.com/mit-han-lab/lite-transformer.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Transformer (Vaswani et al., 2017) is widely used in natural language processing due to its high training efficiency and superior capability in capturing long-distance dependencies. Building on top of them, modern state-of-the-art models, such as BERT (Devlin et al., 2019), are able to learn powerful language representations from unlabeled text and even surpass the human performance on the challenging question answering task.
|
| 12 |
+
|
| 13 |
+
However, the good performance comes at a high computational cost. For example, a single transformer model requires more than 10G Mult-Adds in order to translate a sentence of only 30 words. Such extremely high computational resources requirement is beyond the capabilities of many edge devices such as smartphones and IoTs. Therefore, it is of great importance to design efficient and fast transformer architecture specialized for real-time NLP applications on the edge. Automatic neural architecture search (Zoph & Le, 2017; So et al., 2019) is a choice for high accuracy model design, but the massive search cost (GPU hours and $C O _ { 2 }$ emission) raises severe environmental concerns (Strubell et al., 2019), shown in Figure 1b.
|
| 14 |
+
|
| 15 |
+
In this paper, we focus on the efficient inference for mobile devices, where the total number of MultAdds is constrained below 500M. A straightforward way to reduce the computation of the transformer is to shrink the embedding size directly. Although it can effectively reduce both model size and computation, it also weakens the model capacity capturing the long and short distance relationship at the same time. To this end, we systematically studied the computation breakdown of the transformer and observed that the computation (Mult-Adds) is dominated by the feed-forward network (FFN). We discovered that the prevailing bottleneck-structured transformer block is not efficient. We then present a novel Long-Short Range Attention (LSRA) primitive. LSRA trades off the computation in FFN for wider attention layers. It stretches the bottleneck to introduce more dependency capturing capability for the attention layer, and then shrink the embedding size to reduce the total computation amount while maintaining the same performance. Instead of having one module for “general” information, LSRA dedicates specialized heads to model long and short distance contexts. Inspired by Wu et al. (2019b), LSRA introduces convolution in a parallel branch to capture local dependencies so that the attention branch can focus on global context capture. By stacking this primitive, we build Lite Transformer for mobile NLP applications.
|
| 16 |
+
|
| 17 |
+
Extensive experiments demonstrate that our Lite Transformer model offers significant improvements over the transformer on three language tasks: machine translation, abstractive summarization, and language modeling. For machine translation, on IWSLT 2014 German-English, it outperforms the transformer by 3.1 BLEU under 100M Mult-Adds; on WMT 2014 English-German, it surpasses the transformer by 0.4 BLEU under 500M Mult-Adds and 1.2 BLEU under 100M Mult-Adds; on WMT 2014 English-French, it also achieves consistent improvements over the transformer: 1.2 BLEU under 500M Mult-Adds and 1.7 BLEU under 100M Mult-Adds. Further, combined with general model compression techniques (pruning and quantization), our Lite Transformer can achieve $1 8 . 2 \times$ model size compression. For the summarization task, on CNN-DailyMail, it reduces the computation of the transformer base model by $2 . 4 \times$ . For language modeling, it achieves 1.8 lower perplexity than the transformer around 500M Mult-Adds.
|
| 18 |
+
|
| 19 |
+
Guided by our design insights, our manually-designed Lite Transformer achieves 0.5 higher BLEU than the AutoML-based Evolved Transformer (So et al., 2019), which requires more than 250 GPU years to search, emitting as much carbon as five cars in their lifetimes (see Figure 1b). It indicates that AutoML is not a panacea: careful analysis and design insights (i.e., removing the bottleneck, specialized heads) can effectively prune the search space and improve the sample efficiency.
|
| 20 |
+
|
| 21 |
+
The contribution of this paper has four aspects:
|
| 22 |
+
|
| 23 |
+
1. We systematically analyze the commonly used computation bottleneck structure in modern neural networks and find that the bottleneck design is not optimal for 1-D attention if using FLOPs as figure of merit.
|
| 24 |
+
2. We propose a specialized multi-branch feature extractor, Long-Short Range Attention (LSRA), as the basic building block of our transformer, where convolution helps capture the local context and attention concentrates on global context.
|
| 25 |
+
3. We build Lite Transformer based on our LSRA. Under mobile computation resource constraints (500M Mult-Adds), our Lite Transformer demonstrates coherent improvement on three widely used machine translation datasets. With extra experiments on other tasks, Lite Transformer is efficient for multiple language applications.
|
| 26 |
+
4. Even compared to AutoML-searched Evolved Transformer, our Lite Transformer offers 0.5 higher BLEU score on WMT En-De dataset under the mobile setting, saving the design cost by $2 0 0 0 0 \times$ in $\mathrm { C O } _ { 2 }$ emissions. It alerts us to rethink the practicality of AutoML in terms of design cost and “green AI”.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
RNNs and CNNs. Recurrent neural networks (RNNs) have prevailed various sequence modeling tasks for a long time (Sutskever et al., 2014; Luong et al., 2015; Bahdanau et al., 2015; Wu et al., 2016). However, RNNs are not easy to parallelize across the sequence due to its temporal dependency. Recently, some work has demonstrated that RNN is not an essential component to achieve stateof-the-art performance. For instance, researchers have proposed highly-efficient convolution-based models (Kalchbrenner et al., 2016; Gehring et al., 2017; Kaiser et al., 2018; Wu et al., 2019b). Convolution is an ideal primitive to model the local context information; however, it lacks the ability to capture the long-distance relationship, which is critical in many sequence modeling tasks.
|
| 31 |
+
|
| 32 |
+
Transformers. As an alternative, attention is able to capture global-context information by pairwise correlation. Transformer (Vaswani et al., 2017) has demonstrated that it is possible to stack the
|
| 33 |
+
|
| 34 |
+
(a) Parameter numbers of modern NLP models.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
(b) The design cost measured in $\mathrm { C O } _ { 2 }$ emission (lbs).
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Left: the size of recent NLP models grows rapidly and exceeds the mobile constraints to a large extent. Right: the search cost of AutoML-based NLP model is prohibitive, which emits carbon dioxide nearly $5 \times$ the average lifetime emissions of the car.
|
| 41 |
+
|
| 42 |
+
self-attentions to achieve state-of-the-art performance. Recently, there have been a lot of variants to the transformer (Ahmed et al., 2017; Ott et al., 2018; Chen et al., 2018; Paulus et al., 2018; Shaw et al., 2018; Sukhbaatar et al., 2019a;b; Child et al., 2019). Among them, Ott et al. (2018) proposed to scale up the batch size; Shaw et al. (2018) leverages the relative position representations; Ahmed et al. (2017) introduces the weighted multi-head attention; Sukhbaatar et al. (2019a) applies adaptive masks for long-range information on character-level language modeling with very long sequences. All these attempts are orthogonal to our work, as their methods can also be applied in our architecture.
|
| 43 |
+
|
| 44 |
+
Automated Model Design. Due to the vast architecture design space, automating the design with neural architecture search (NAS) becomes popular (Zoph & Le, 2017; Zoph et al., 2018; Pham et al., 2018; Cai et al., 2019a). To make the design efficient, integrating the hardware resource constraints into the optimization loop begins to emerge, such as MnasNet (Tan et al., 2019), ProxylessNAS (Cai et al., 2019b) and FBNet (Wu et al., 2019a). In the NLP community, the evolved transformer (So et al., 2019) adopts the neural architecture search (Zoph & Le, 2017) to design basic blocks and finds a better #parameter-BLEU trade-off for the transformer. However, AutoML-based model designs require significant amount of GPU hours to find the ‘best’ model, which is not affordable for most researchers.
|
| 45 |
+
|
| 46 |
+
Model Acceleration. Apart from designing efficient models directly (Liu et al., 2019b; Li et al., 2020), another approach to achieve efficient inference is to compress and accelerate the existing large models. For instance, some have proposed to prune the separate neurons (Han et al., 2015b; 2016) or the entire channels (He et al., 2017; Liu et al., 2017; He et al., 2018); others have proposed to quantize the network (Courbariaux et al., 2016; Zhu et al., 2017; Krishnamoorthi, 2018; Wang et al., 2019) to accelerate the model inference. Recently, AutoML has also been used to automate the model compression and acceleration (He et al., 2018; Yang et al., 2018; Wang et al., 2019; Liu et al., 2019a). All these techniques are compressing existing models and are therefore orthogonal to our approach. We aim to explore how to make use of the domain knowledge to design an efficient architecture from the beginning, rather than compressing an existing model.
|
| 47 |
+
|
| 48 |
+
# 3 IS BOTTLENECK EFFECTIVE FOR 1-D ATTENTION?
|
| 49 |
+
|
| 50 |
+
The attention mechanism has been widely used in various applications, including 1-D (language processing (Vaswani et al., 2017)), 2-D (image recognition), and 3-D (video recognition (Wang et al., 2018)). It computes pairwise dot-product between all the input elements to model both short-term and long-term relationships. Despite its effectiveness, the operation introduces massive computation. Assume the number of elements (e.g., length of tokens in language processing, number of pixels in image, etc.) fed to attention layer is $N$ , and the dimension of features (i.e., channels) is $d$ , the computation needed for the dot-product is $N ^ { 2 } d$ . For images and videos, $N$ is usually very large. For example, the intermediate feature map in a video network (Wang et al., 2018) has 16 frames, each with $1 1 2 \times 1 1 2$ resolution, leading to $N = 2 \times 1 0 ^ { 5 }$ . The computation of convolution and fully-connected layers grows linearly w.r.t. $N$ , while the computation of attention layers grows quadratically w.r.t. $N$ . The computation of attention module will soon overwhelm with a large $N$ .
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Flattening the bottleneck of transformer blocks increases the proportion of the attention versus the FFN, which is good for further optimization for attention in our LSRA.
|
| 54 |
+
|
| 55 |
+
To address the dilemma, a common practice is first to reduce the number of channels $d$ using a linear projection layer before applying attention and increase the dimension afterwards (as shown in Figure 2). In the original design of transformer (Vaswani et al., 2017), the channel dimension in the attention module is $4 \times$ smaller than that in the FFN layer. Similarly, in the non-local video network (Wang et al., 2018), the channel number is first reduced by half before applying the non-local attention module. This practice saves the computation by $1 6 \times$ or $4 \times$ . Nevertheless, it also decreases the contexts capture ability of attention layers with a smaller feature dimension. The situation could be even worse for language processing, as attention is the major module for contexts capture (unlike images and videos where convolutions conduct the major information capture).
|
| 56 |
+
|
| 57 |
+
For tasks like translation, the length of the input sequence $N$ tends to be small, which is around 20-30 in common cases. A transformer block consists of an attention (or two for decoder), followed by a feed-forward network (FFN). For the attention layer, the Mult-Adds would be $\mathcal { O } ( 4 N d ^ { 2 } + N ^ { 2 } d )$ ; for FFN, the Mult-Adds is $\mathcal { O } ( 2 \times 4 N d ^ { 2 } )$ . Given a small $N$ , it is doubtful if the bottleneck design is a good trade-off between computation and accuracy on 1D attention. To verify the idea, we first profile the computation breakdown in the transformer in Figure 2. Surprisingly, for the original transformer (denoted as ‘Base’ in the figure), the FFN layer actually consumes much of the computation. This is not desirable since FFN itself cannot perform any contexts captures. In conclusion, due to the small $N$ , the bottleneck design cannot significantly reduce the computation in 1D attention, while the limited benefit for computation reduction is further compromised by the large FFN layer. It also harms the capacity of attention layer due to the smaller dimension, which is the major contexts capture unit in the transformer.
|
| 58 |
+
|
| 59 |
+
Therefore, we argue that the bottleneck design is not optimal for 1-D attention. We instead design a ‘flattened’ version of the transform block that does not reduce and increase the channel dimension. With the new design, the attention part now takes up the major computation in the flattened transformer model in Figure 2, leaving a larger space for further optimization. We also test the performance change of such modification on WMT’14 En-Fr dataset. We can achieve comparable performance at a slightly larger computation, which can be easily reduced with further optimization that is discussed in the next section.
|
| 60 |
+
|
| 61 |
+
# 4 LONG-SHORT RANGE ATTENTION (LSRA)
|
| 62 |
+
|
| 63 |
+
Researchers have tried to understand the contexts captured by attention. Kovaleva et al. (2019) and Clark et al. (2020) visualized the attention weights from different layers in BERT. As shown in Figure 3b, the weights $w$ illustrate the relationships between the words from the source sentence and the target sentence (the same for self-attention). With a larger weight $w _ { i j }$ (darker color), the $i$ -th word in the source sentence pays more attention to the $j$ -th word in the target sentence. And the attention maps typically have strong patterns: sparse and diagonal. They represent the relationships between some particular words: the sparse for the long-term information, and the diagonal for the correlation in small neighborhoods. We denote the former as “global” relationships and the latter as “local”.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 3: Lite Transformer architecture (a) and the visualization of attention weights. Conventional attention (b) puts too much emphasis on local relationship modeling (see the diagonal structure). We specialize the local feature extraction by a convolutional branch which efficiently models the locality so that the attention branch can specialize in global feature extraction (c). More visualizations are available in Figure A1.
|
| 67 |
+
|
| 68 |
+
For a translation task, the attention modules have to capture both global and local contexts, requiring a large capacity. That is not optimal compared with a specialized design. Taking the hardware design as an example, general-purpose hardware like CPUs is less efficient than specialized hardware like FPGAs. Here, we should specialize global and local contexts capture. When the model capacity is relatively large, the redundancy can be tolerated and may even provide better performance. However, when it comes to mobile applications, a model should be more efficient due to the computation and power constraints. Thus specialized contexts capture is more demanding. To tackle the problem, instead of having one module for “general” information, we propose a more specialized architecture, Long-Short Range Attention (LSRA), that captures the global and local contexts separately.
|
| 69 |
+
|
| 70 |
+
As shown in Figure 3a, our LSRA module follows a two-branch design. The left branch captures global contexts, while the right branch models local contexts. Instead of feeding the whole input to both branches, we split it into two parts along the channel dimension, which will be mixed by the following FFN layer. Such practice reduces the overall computation by $2 \times$ . The left branch is a normal attention module as in Vaswani et al. (2017), while the channel dimension is reduced by half. For the right branch of local relationships, one natural idea is to apply convolution over the sequence. With a sliding window, the diagonal groups can be easily covered by the module. To further reduce the computation, we replace the normal convolution with a lighter version (Wu et al., 2019b) consisting of linear layers and depth-wise convolution. In this manner, we place the attention and the convolutional module side by side, encouraging them to have a different perspective of the sentence, globally and locally, so that the architecture can then benefit from the specialization and achieve better efficiency.
|
| 71 |
+
|
| 72 |
+
To have a better insight, we visualized the average attention weights of the same layer for a fully trained basic transformer and our Lite Transformer in Figure 3. It can be easily distinguished that instead of attempting to model both global and local contexts, the attention module in LSRA only focuses on the global contexts capture (no diagonal pattern), leaving the local contexts capture to the convolution branch.
|
| 73 |
+
|
| 74 |
+
# 5 EXPERIMENTAL SETUP
|
| 75 |
+
|
| 76 |
+
# 5.1 MOBILE SETTINGS
|
| 77 |
+
|
| 78 |
+
Most of machine translation architectures benefit from the large model size and computational complexity. However, edge devices, such as mobile phones and IoTs, are highly computationally limited. Those massive architectures are no more suitable for real-world mobile applications. To formalize the problem, we define the mobile settings for NLP models in terms of the amount of computation and the parameter numbers:
|
| 79 |
+
|
| 80 |
+
• The floating-point performance of the ARM Cortex-A72 mobile CPU is about 48G FLOPS (4 cores $\mathbb { O } 1 . 5 \mathrm { G H z }$ ). To achieve the peak performance of 50 sentences per second, the model should be less than 960M FLOPs (480M Mult-Adds). That is a common constraint in the computer vision community. For example, Liu et al. (2018) also uses 500M Mult-Adds as the constraint of its mobile setting. Therefore, we define the mobile settings for machine translation tasks: the computation constraint should be under 500M Mult-Adds (or 1G FLOPs) with a sequence of 30 tokens (general length for machine translation).
|
| 81 |
+
|
| 82 |
+
• Additionally, we set a limitation for the parameters of the models. The constraint is based on the download and space limitation. Large mobile apps will take long time to be downloaded and even cost much money when using cellular networks. The run-time memory and disk size also constrain the parameter numbers. The parameters in MobileNet 7M parameters, we round it to the nearest magnitude, 10M parameters, as our mobile constraint.
|
| 83 |
+
|
| 84 |
+
# 5.2 DATASETS AND EVALUATION
|
| 85 |
+
|
| 86 |
+
Machine Translation. The results are based on three machine translation benchmarks: For IWSLT’14 German-English (De-En), we follow the settings in Grave et al. (2017) with 160K training sentence pairs and 10K joint byte pair encoding (BPE) (Sennrich et al., 2016) vocabulary in lower case. For WMT English to German (En-De), we train the model on WMT’16 training data with 4.5M sentence pairs, validate on newstest2013, and test on newstest2014, the same as Wu et al. (2019b). Moreover, the vocabulary used a 32K joint source and target BPE. For WMT English to Franch (En-Fr), we replicate the setup in Gehring et al. (2017) with 36M training sentence pairs from WMT’14, validate on newstest2012 and 2013, and test on newstest2014. Also, the 40K vocabulary is based on a joint source and target BPE factorization.
|
| 87 |
+
|
| 88 |
+
For evaluation, we use the same beam decoding configuration used by Vaswani et al. (2017), where there is a beam size of 4 and a length penalty of 0.6. All BLEUs are calculated with case-sensitive tokenization\*, but for WMT En-De, we also use the compound splitting BLEU†, the same as Vaswani et al. (2017). When testing, we average the last 10 model checkpoints for IWSLT De-En and take the model with the lowest perplexity on the validation set for the WMT datasets. We omit the word embedding lookup table from the model parameters since the number of entries in the table would highly differ for various tasks using transformer. For the Mult-Adds, we calculate the total number of multiplication-addition pairs for a model translating a sequence with the length of 30 to a sequence with the same length, which is the average length for sentence-level machine translation tasks.
|
| 89 |
+
|
| 90 |
+
Abstractive Summarization. We also evaluate our Lite Transformer on CNN-DailyMail dataset (Hermann et al., 2015) for abstractive summarization. The dataset contains 280K news articles paired with multi-sentence summaries. We truncate the articles to 1000 tokens and use a 30K BPE vocabulary. We use F1-Rouge as the metric, including Rouge-1 (R-1), Rouge-2 (R-2) and Rouge-L (R-L) (Lin, 2004)‡. We follow the generation settings in Lewis et al. (2019). We omit the word embedding lookup table and softmax layer from both the model parameters and #Mult-Adds calculation. #Mult-Adds is calculated for the documents with the input length of 30, 100, and 1000 and the output length of 60 (the average tokens for the output of CNN-DailyMail dataset).
|
| 91 |
+
|
| 92 |
+
Language Modeling. We test our Lite Transformer for language modeling task on WIKITEXT-103, which comprises about 100M tokens and a 260K BPE vocabulary. We evaluate the perplexity on both the validation set and the training set. The model parameters and #Mult-Adds are also computed for the input with a length of 30, 100, and 1000.
|
| 93 |
+
|
| 94 |
+
# 5.3 ARCHITECTURE
|
| 95 |
+
|
| 96 |
+
The model architecture is based on the sequence to sequence learning encoder-decoder (Sutskever et al., 2014). For machine translation, our baseline model is based on the one proposed by Vaswani et al. (2017) for WMT. For IWSLT, we follow the settings in Wu et al. (2019b). We also adopt the same model as on WMT for summarization task. For language modeling, our model is in line with Baevski & Auli (2019) but with smaller model dimension $d _ { \mathrm { m o d e l } } = 5 1 2$ and layer number
|
| 97 |
+
|
| 98 |
+
Table 1: Results on IWSLT’14 De-En. Our Lite Transformer outperforms the transformer (Vaswani et al., 2017) and the Lightweight convolution network (Wu et al., 2019b) especially in mobile settings.
|
| 99 |
+
|
| 100 |
+
<table><tr><td></td><td>#Parameters</td><td>#Mult-Adds</td><td>BLEU</td><td>△BLEU</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>2.8M</td><td>63M</td><td>27.8</td><td>1</td></tr><tr><td>LightConv (Wu et al.,2019b)</td><td>2.5M</td><td>52M</td><td>28.5</td><td>+0.7</td></tr><tr><td>Lite Transformer(Ours)</td><td>2.8M</td><td>54M</td><td>30.9</td><td>+3.1</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>5.7M</td><td>139M</td><td>31.3</td><td>1</td></tr><tr><td>LightConv (Wu et al., 2019b)</td><td>5.1M</td><td>115M</td><td>31.6</td><td>+0.3</td></tr><tr><td>Lite Transformer(Ours)</td><td>5.4M</td><td>119M</td><td>32.9</td><td>+1.6</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>8.5M</td><td>215M</td><td>32.7</td><td>1</td></tr><tr><td>LightConv (Wu et al., 2019b)</td><td>8.4M</td><td>204M</td><td>32.9</td><td>+0.2</td></tr><tr><td>Lite Transformer (Ours)</td><td>8.9M</td><td>209M</td><td>33.6</td><td>+0.9</td></tr></table>
|
| 101 |
+
|
| 102 |
+
<table><tr><td></td><td></td><td></td><td colspan="2">WMT'14 En-De</td><td colspan="2">WMT'14 En-Fr</td></tr><tr><td></td><td>#Parameters</td><td>#Mult-Adds</td><td>BLEU</td><td>△BLEU</td><td>BLEU</td><td>△BLEU</td></tr><tr><td>Transformer (Vas wani et al.,2017)</td><td>2.8M</td><td>87M</td><td>21.3</td><td>1</td><td>33.6</td><td>1</td></tr><tr><td>Lite Transformer (Ours)</td><td>2.9M</td><td>90M</td><td>22.5</td><td>+1.2</td><td>35.3</td><td>+1.7</td></tr><tr><td>Transformer (Vas wani et al., 2017)</td><td>11.1M</td><td>338M</td><td>25.1</td><td>1</td><td>37.6</td><td>1</td></tr><tr><td>Lite Transformer (Ours)</td><td>11.7M</td><td>360M</td><td>25.6</td><td>+0.5</td><td>39.1</td><td>+1.5</td></tr><tr><td>Transformer (Vas wani et al.,2017)</td><td>17.3M</td><td>527M</td><td>26.1</td><td>1</td><td>38.4</td><td>1</td></tr><tr><td>Lite Transformer (Ours)</td><td>17.3M</td><td>527M</td><td>26.5</td><td>+0.4</td><td>39.6</td><td>+1.2</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 2: Results on WMT’14 En-De and WMT’14 En-Fr. Our Lite Transformer improves the BLEU score over the transformer under similar Mult-Adds constraints.
|
| 105 |
+
|
| 106 |
+
$L = 1 2$ for the resource constraint. We use fairseq’s reimplementation (Ott et al., 2019) of the transformer base model as the backbone.
|
| 107 |
+
|
| 108 |
+
In our architecture, we first flatten the bottleneck from the transformer base model and then replace the self-attention with the LSRA. More specifically, we use two specialized modules, an attention branch and a convolutional branch. Both the input and the output of the convolution are transformed by fully connected layers (GLU is applied for the input on WMT), and the kernel is dynamically calculated from the input using a fully connected layer in the WMT models. The kernel sizes are [3, $5 , 7 , 3 1 \times 3 ]$ for both the encoder and the decoder (Wu et al., 2019b), and the number of heads for each module is 4 (half of the heads number in the transformer base model). The model for summarization is the same as the WMT model. For language modeling, the kernel sizes for the convolution branch are [15, 15, $3 1 \times 4$ , $6 3 \times 6 ]$ .
|
| 109 |
+
|
| 110 |
+
# 5.4 TRAINING SETTINGS
|
| 111 |
+
|
| 112 |
+
All of our training settings for machine translation are in line with Wu et al. (2019b). We use a dropout of 0.3 for both the WMT and IWSLT datasets and linearly scale down the dropout ratio when shrinking the dimension of the embeddings for the WMT datasets. Same as Wu et al. (2019b), we apply Adam optimizer and a cosine learning rate schedule (Kingma & Ba, 2015; Loshchilov & Hutter, 2017) for the WMT models, where the learning rate is first linearly warm up from $1 0 ^ { - 7 }$ to $1 0 ^ { - 3 }$ followed by a cosine annealing with a single cycle. For IWSLT De-En, we use inverse square root learning rate scheduling (Vaswani et al., 2017) with the linear warm-up. We use the same training settings for summarization. For the language modeling task, the training settings are in line with Baevski & Auli (2019). We decrease the dropout ratio for the FFN layer by half in our Lite Transformer due to the flattened layer.
|
| 113 |
+
|
| 114 |
+
We train WMT and summarization models on 16 NVIDIA RTX 2080Ti GPUs and IWSLT De-En on a single GPU for 50K steps. We also accumulate the gradients for 8 batches before each model update (Ott et al., 2018). The gradients of IWSLT models are not accumulated. The maximum number of tokens in a batch is 4K for all the models. Label smooth of 0.1 is applied for the prior
|
| 115 |
+
|
| 116 |
+
<table><tr><td></td><td></td><td>#Params #Mult-Adds BLEU</td><td></td><td>GPU Hours</td><td>CO2e (lbs)</td><td>Cloud Computation Cost</td></tr><tr><td>Transformer (Vaswani et al.,2017)</td><td>2.8M</td><td>87M</td><td>21.3</td><td>8×12</td><td>26</td><td>$68 - $227</td></tr><tr><td>Evolved Transformer (So et al.,2019)</td><td>3.0M</td><td>94M</td><td>22.0</td><td>8×274K</td><td>626K</td><td>$1.6M - $5.5M</td></tr><tr><td>Lite Transformer (Ours)</td><td>2.9M</td><td>90M</td><td>22.5</td><td>8×14</td><td>32</td><td>$83 - $278</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>11.1M</td><td>338M</td><td>25.1</td><td>8×16</td><td>36</td><td>$93.9 - $315</td></tr><tr><td>Evolved Transformer (So et al.,2019)</td><td>11.8M</td><td>364M</td><td>25.4</td><td>8×274K</td><td>626K</td><td>$1.6M - $5.5M</td></tr><tr><td>Lite Transformer (Ours)</td><td>11.7M</td><td>360M</td><td>25.6</td><td>8×19</td><td>43</td><td>$112 - $376</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 3: Performance and training cost of an NMT model in terms of $\mathrm { C O } _ { 2 }$ emissions (lbs) and cloud compute cost (USD). The training cost estimation is adapted from Strubell et al. (2019). The training time for transformer and our Lite Transformer is measured on NVIDIA V100 GPU. The cloud• Our Lite Transformer performs well on machine translation (a), abstractive computing cost is priced by AWS (lower price: spot instance; higher price: on-demand instance).summarization, and language modeling (b).summarization, and language modeling (b).
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Trade-off curve for machine learning on WMT En-Fr and language modeling on Lite Transformer with Long-Short Range Attention, ICLR’20WIKITEXT-103 dataset. Both curves illustrate that our Lite Transformer outperform the basic transformer under the mobile settings (blue region).
|
| 122 |
+
|
| 123 |
+
distribution over the vocabulary (Szegedy et al., 2016; Pereyra et al., 2017). For language modeling, we train the models on 24 GPUs for 286K steps, the same as the settings in Baevski & Auli (2019).
|
| 124 |
+
|
| 125 |
+
# 6 RESULTS
|
| 126 |
+
|
| 127 |
+
# 6.1 MACHINE TRANSLATION
|
| 128 |
+
|
| 129 |
+
Results on IWSLT. We first report the results on IWSLT’14 De-En dataset. The baseline model is in line with Wu et al. (2019b), which provides the best results in the literature with 512 model dimension, 1024 FFN hidden dimension, and 4 heads for the attentions. Our Lite Transformer generally outperforms the transformer base under mobile constraints. With tighter computation limitations, our model achieves more significant improvement. That is because, when the dimension of the features decreases, it becomes much harder for the “general” attention to extract both the global and local features from the rather more compact information within the features. On the contrary, with the specialized LSRA, our model can capture the information from the features more efficiently.
|
| 130 |
+
|
| 131 |
+
In Table 1, we present the quantitative results of our Lite Transformer on IWSLT’14 De-En dataset, comparing to the transformer baseline as well as the LightConv (Wu et al., 2019b). Around 100M Mult-Adds, our model even achieves 1.6 BLEU score improvement than the transformer.
|
| 132 |
+
|
| 133 |
+
Results on WMT. We also show the result on the WMT’14 En-De and WMT’14 En-Fr dataset. Similar to the IWSLT, our Lite Transformer achieves a better trade-off with regard to transformer (Vaswani et al., 2017) against the total computation and the number of model parameters under mobile settings. The quantitative results in Table 2 indicates that our specialized Lite Transformer has 1.2 and 1.7 BLEU score improvement under 100M Mult-Adds and 0.5 and 1.5 around 300M Mult-Adds for
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Lite Transformer with Long-Short Range Attention, ICLR’20 1Figure 5: The model size and BLEU score on WMT En-Fr dataset with model compression. Our Lite Transformer can be combined with general compression techniques and achieves $1 8 . 2 \times$ model size compression. ∗ ‘Quant’ indicates ‘Quantization’.
|
| 137 |
+
|
| 138 |
+
Table 4: Results on CNN-DailyMail dataset for abstractive summarization. Our Lite Transformer achieves similar F1-Rouge (R-1, R-2 and R-L) to the transformer (Vaswani et al., 2017) with more than $2 . 4 \times$ less computation and $2 . 5 \times$ less model size. “#MAdds $\mathbf { \rho } ( \mathbf { x } ) ^ { \mathbf { \gamma } }$ indicates the #Mult-Adds required by the model with the input length of $\mathbf { X }$ .
|
| 139 |
+
|
| 140 |
+
<table><tr><td></td><td>#Params</td><td>#MAdds (30)</td><td>#MAdds (100)</td><td>#MAdds (1000)</td><td>R-1</td><td>R-2</td><td>R-L</td></tr><tr><td>Transformer</td><td>44.1M</td><td>2.0G</td><td>3.6G</td><td>29.9G</td><td>41.4</td><td>18.9</td><td>38.3</td></tr><tr><td>Lite Transformer</td><td>17.3M</td><td>0.8G</td><td>1.5G</td><td>12.5G</td><td>41.3</td><td>18.8</td><td>38.3</td></tr></table>
|
| 141 |
+
|
| 142 |
+
<table><tr><td></td><td>#Params</td><td>#MAdds (100)</td><td>#MAdds (1000)</td><td>Speed (tokens/s)</td><td>Valid ppl.Test ppl.</td><td></td></tr><tr><td>Adaptive Inputs</td><td>37.8M</td><td>3.9G</td><td>50.3G</td><td>7.6K</td><td>23.2</td><td>24.0</td></tr><tr><td>Lite Transformer</td><td>37.2M</td><td>3.9G</td><td>48.7G</td><td>10.2K</td><td>21.4</td><td>22.2</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 5: Results on WIKITEXT-103 dataset for language modeling. We apply our Lite Transformer architecture on transformer base model with adaptive inputs (Baevski & Auli, 2019) and achieve 1.8 lower test perplexity under similar resource constraint.
|
| 145 |
+
|
| 146 |
+
WMT En-De dataset and WMT En-Fr dataset respectively. We also provide a tradeoff curve on WMT En-Fr in Figure 4a, where our Lite Transformer consistently outperforms the original transformer.
|
| 147 |
+
|
| 148 |
+
Amenable to Compression. As an efficient architecture, our Lite Transformer is orthogonal to general techniques for model compression (amenable to compression), e.g. pruning, and quantization. The results on WMT’14 En-Fr dataset with those techniques are shown in Figure 5. We quantize the model weight into 8 bits with K-means (Han et al., 2016) and prune the model according to the sensitivity of each layer (Han et al., 2015a). With the two model compression techniques, our method achieves $1 8 . 2 \times$ model size compression with negligible BLEU score degradation.
|
| 149 |
+
|
| 150 |
+
# 6.2 COMPARISON WITH AUTOMATED DESIGN
|
| 151 |
+
|
| 152 |
+
Comparing with the AutoML-based Evolved Transformer (ET) (So et al., 2019), our Lite Transformer also shows a significant improvement in mobile settings. Moreover, within mobile settings, the Lite Transformer outperforms the ET by 0.5 and 0.2 BLEU scores under 100M and 300M Mult-Adds, respectively, as shown in Table 3. Our architecture design is different from ET’s design: ET stacks attentions and convolutions sequentially, while our Lite Transformer puts them in parallel; also, ET does not flatten the FFN.
|
| 153 |
+
|
| 154 |
+
Though nowadays, neural architecture search has been proved to be very powerful for searching in a large design space, the huge cost, more than 626155 lbs $\mathrm { C O } _ { 2 }$ emissions and more than 250 GPU years, cannot be ignored. Instead, careful human design with intuitions for specific tasks can also be a great choice in practice to save a large number of resources for the earth.
|
| 155 |
+
|
| 156 |
+
6.3 ABSTRACTIVE SUMMARIZATION AND LANGUAGE MODELING
|
| 157 |
+
|
| 158 |
+
We also test our Lite Transformer on longer input. In Table 4, we report results on CNN-DailyMail dataset for abstractive summarization. Our model achieves a similar F1-Rouge score as the transformer base model but requires $2 . 4 \times$ less computation and $2 . 5 \times$ storage resources. In Table 5, we provides the results of our Lite Transformer on WIKITTEXT-103 for language modeling task, compared with the adaptive inputs Baevski & Auli (2019) baseline. Under similar resource constraints, our Lite Transformer can achieve 3.9 and 1.8 lower perplexity on valid and test set, respectively. In Figure 4b, we show the tradeoff curve for our model and the baseline transformer model on WIKITEXT-103 between the test perplexity and the #Multi-Adds for input sentence with 30 tokens. It indicates that our Lite Transformer achieves consistent improvement over the original transformer, especially under mobile settings. Despite the translation tasks, the specialization design of LSRA is effective for larger scale language tasks.
|
| 159 |
+
|
| 160 |
+
# 7 CONCLUSION
|
| 161 |
+
|
| 162 |
+
In this paper, we presented Long-Short Range Attention (LSRA), where some heads specialize in the local context modeling while the others specialize in the long-distance relationship modeling. Based on this primitive, we design Lite Transformer that is specialized for the mobile setting (under 500M Mult-Adds) to facilitate the deployment on the edge devices. Our Lite Transformer demonstrates consistent improvement over the transformer on multiple language applications. It also surpasses the Evolved Transformer that requires costly architecture search under mobile settings.
|
| 163 |
+
|
| 164 |
+
Acknowledgements. We sincerely thank MIT-IBM Watson AI Lab, Facebook Faculty Award, Google-Daydream Research Award, and AWS Machine Learning Research Award for supporting this research.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Karim Ahmed, Nitish Shirish Keskar, and Richard Socher. Weighted Transformer Network for Machine Translation. arXiv, 2017. 3 Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In ICLR, 2019.
|
| 169 |
+
6, 7, 8, 9, 10 Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In ICLR, 2015. 2 Han Cai, Ji Lin, Yujun Lin, Zhijian Liu, Kuan Wang, Tianzhe Wang, Ligeng Zhu, and Song Han. Automl for architecting efficient and specialized neural networks. IEEE Micro, 2019a. 3 Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware. In ICLR, 2019b. 3 Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Mike Schuster, Noam Shazeer, Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Zhifeng Chen, Yonghui Wu, and Macduff Hughes. The Best of Both Worlds: Combining Recent Advances in Neural Machine Translation. In ACL, 2018. 3 Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv, 2019. 3 Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D Manning. What Does BERT Look At? An Analysis of BERT’s Attention. In BlackboxNLP, 2020. 4 Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized Neural Networks: Training Deep Neural Networks with Weights and Activations Constrained to $+ 1$ or -1. arXiv,
|
| 170 |
+
2016. 3 Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL, 2019. 1
|
| 171 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann Dauphin. Convolutional Sequence to Sequence Learning. In ICML, 2017. 2, 6
|
| 172 |
+
Edouard Grave, Armand Joulin, Moustapha Cissé, Hervé Jégou, et al. Efficient softmax approximation for GPUs. In ICML, 2017. 6
|
| 173 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NeurIPS, 2015a. 9
|
| 174 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both Weights and Connections for Efficient Neural Networks. In NIPS, 2015b. 3
|
| 175 |
+
Song Han, Huizi Mao, and William Dally. Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding. In ICLR, 2016. 3, 9
|
| 176 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel Pruning for Accelerating Very Deep Neural Networks. In ICCV, 2017. 3
|
| 177 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. AMC: AutoML for Model Compression and Acceleration on Mobile Devices. In ECCV, 2018. 3
|
| 178 |
+
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In NeurIPS, 2015. 6
|
| 179 |
+
Lukasz Kaiser, Aidan N Gomez, and François Chollet. Depthwise Separable Convolutions for Neural Machine Translation. In ICLR, 2018. 2
|
| 180 |
+
Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Koray Kavukcuoglu. Neural Machine Translation in Linear Time. arXiv, 2016. 2
|
| 181 |
+
Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015. 7
|
| 182 |
+
Olga Kovaleva, Alexey Romanov, Anna Rogers, and Anna Rumshisky. Revealing the Dark Secrets of BERT. In EMNLP, 2019. 4
|
| 183 |
+
Raghuraman Krishnamoorthi. Quantizing Deep Convolutional Networks for Efficient Inference: A Whitepaper. arXiv, 2018. 3
|
| 184 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv, 2019. 6
|
| 185 |
+
Muyang Li, Ji Lin, Yaoyao Ding, Zhijian Liu, Jun-Yan Zhu, and Song Han. Gan compression: Efficient architectures for interactive conditional gans. In CVPR, 2020. 3
|
| 186 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out. ACL, 2004. 6
|
| 187 |
+
Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive Neural Architecture Search. In ECCV, 2018. 6
|
| 188 |
+
Zechun Liu, Haoyuan Mu, Xiangyu Zhang, Zichao Guo, Xin Yang, Tim Kwang-Ting Cheng, and Jian Sun. MetaPruning: Meta Learning for Automatic Neural Network Channel Pruning. arXiv, 2019a. 3
|
| 189 |
+
Zhijian Liu, Haotian Tang, Yujun Lin, and Song Han. Point-voxel cnn for efficient 3d deep learning. In NeurIPS, 2019b. 3
|
| 190 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning Efficient Convolutional Networks through Network Slimming. In ICCV, 2017. 3
|
| 191 |
+
Ilya Loshchilov and Frank Hutter. SGDR: Stochastic Gradient Descent with Warm Restarts. In ICLR, 2017. 7
|
| 192 |
+
Minh-Thang Luong, Hieu Pham, and Christopher Manning. Effective Approaches to Attention-based Neural Machine Translation. In EMNLP, 2015. 2
|
| 193 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling Neural Machine Translation. In WMT, 2018. 3, 7
|
| 194 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A Fast, Extensible Toolkit for Sequence Modeling. In NAACL Demo, 2019. 7
|
| 195 |
+
Romain Paulus, Caiming Xiong, and Richard Socher. A Deep Reinforced Model for Abstractive Summarization. In ICLR, 2018. 3
|
| 196 |
+
Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. In ICLR Workshop, 2017. 8
|
| 197 |
+
Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient Neural Architecture Search via Parameter Sharing. In ICML, 2018. 3
|
| 198 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural Machine Translation of Rare Words with Subword Units. In ACL, 2016. 6
|
| 199 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-Attention with Relative Position Representations. In NAACL, 2018. 3
|
| 200 |
+
David So, Quoc Le, and Chen Liang. The Evolved Transformer. In ICML, 2019. 1, 2, 3, 8, 9
|
| 201 |
+
Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and Policy Considerations for Deep Learning in NLP. In ACL, 2019. 1, 8
|
| 202 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive Attention Span in Transformers. In ACL, 2019a. 3
|
| 203 |
+
Sainbayar Sukhbaatar, Edouard Grave, Guillaume Lample, Herve Jegou, and Armand Joulin. Augmenting self-attention with persistent memory. arXiv, 2019b. 3
|
| 204 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to Sequence Learning with Neural Networks. In NeurIPS, 2014. 2, 6
|
| 205 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016. 8
|
| 206 |
+
Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. MnasNet: Platform-Aware Neural Architecture Search for Mobile. CVPR, 2019. 3
|
| 207 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In NeurIPS, 2017. 1, 2, 3, 4, 5, 6, 7, 8, 9
|
| 208 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. HAQ: Hardware-Aware Automated Quantization with Mixed Precision. In CVPR, 2019. 3
|
| 209 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local Neural Networks. In CVPR, 2018. 3, 4
|
| 210 |
+
Bichen Wu, Xiaoliang Dai, Peizhao Zhang, Yanghan Wang, Fei Sun, Yiming Wu, Yuandong Tian, Peter Vajda, Yangqing Jia, and Kurt Keutzer. FBNet: Hardware-Aware Efficient ConvNet Design via Differentiable Neural Architecture Search. In CVPR, 2019a. 3
|
| 211 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay Less Attention with Lightweight and Dynamic Convolutions. In ICLR, 2019b. 2, 5, 6, 7, 8
|
| 212 |
+
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, 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. arXiv, 2016. 2
|
| 213 |
+
Tien-Ju Yang, Andrew Howard, Bo Chen, Xiao Zhang, Alec Go, Mark Sandler, Vivienne Sze, and Hartwig Adam. NetAdapt: Platform-Aware Neural Network Adaptation for Mobile Applications. In ECCV, 2018. 3
|
| 214 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William Dally. Trained Ternary Quantization. In ICLR, 2017. 3
|
| 215 |
+
Barret Zoph and Quoc V Le. Neural Architecture Search with Reinforcement Learning. In ICLR, 2017. 1, 3
|
| 216 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning Transferable Architectures for Scalable Image Recognition. In CVPR, 2018. 3
|
| 217 |
+
|
| 218 |
+
# A.1 ADDITIONAL VISUALIZATION OF ATTENTION WEIGHTS
|
| 219 |
+
|
| 220 |
+
In this section, we show 3 more visualization of attention weights from both the base transformer and our LSRA. We use the smallest configuration in our paper for both models fully trained on WMT En-Fr translation and the attention weights are averaged among attention heads in the first layer. The sentences are sampled from this paper and the ICLR conference website.
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure A1: Conventional attention puts too much emphasis on local relationship modeling (see the diagonal structure). We specialize the local feature extraction by a convolutional branch which efficiently models locality so that the attention branch can specialize in global feature extraction (c). We provide some more visualizations in Section A.1.
|
md/train/BylIciRcYQ/BylIciRcYQ.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SGD CONVERGES TO GLOBAL MINIMUM IN DEEP LEARNING VIA STAR-CONVEX PATH
|
| 2 |
+
|
| 3 |
+
Yi Zhou∗, Junjie Yang†, Huishuai Zhang‡, Yingbin Liang§, Vahid Tarokh∗ ∗Duke University, †University of Science and Technology of China ‡Microsoft Research, Asia, §The Ohio State University
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Stochastic gradient descent (SGD) has been found to be surprisingly effective in training a variety of deep neural networks. However, there is still a lack of understanding on how and why SGD can train these complex networks towards a global minimum. In this study, we establish the convergence of SGD to a global minimum for nonconvex optimization problems that are commonly encountered in neural network training. Our argument exploits the following two important properties: 1) the training loss can achieve zero value (approximately), which has been widely observed in deep learning; 2) SGD follows a star-convex path, which is verified by various experiments in this paper. In such a context, our analysis shows that SGD, although has long been considered as a randomized algorithm, converges in an intrinsically deterministic manner to a global minimum.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Training neural networks has been proven to be NP-hard decades ago Blum & Rivest (1988). At that time, the limited computation power makes neural network training a “mission impossible”. However, as the development of computing device achieves several revolutionary milestones (e.g. GPUs), deep neural networks are found to be practically trainable and can generalize well on real datasets Krizhevsky et al. (2017). At the same time, deep learning technique starts to beat the performance of other conventional approaches in a variety of challenging tasks, e.g., computer vision, classification, natural language processing, etc.
|
| 12 |
+
|
| 13 |
+
Modern neural network training is typically performed by applying first-order algorithms such as stochastic gradient descent (SGD) (a.k.a backpropagation) (Linnainmaa, 1976) or its variants, e.g., Adam (Kingma & Ba, 2014), Adagrad (Duchi et al., 2011), etc. Traditional analysis of SGD in nonconvex optimization guarantees the convergence to a stationary point Bottou et al. (2016); Ghadimi et al. (2016). Recently, it has been shown that SGD has the capability to escape strict saddle points Ge et al. (2015); Jin et al. (2017); Reddi et al. (2018a); Daneshmand et al. (2018), and can escape even sharp local minima Kleinberg et al. (2018). While these works provide different insights towards understanding the performance of SGD, they cannot explain the success of SGD that has been widely observed in deep learning applications. Specifically, it is known that SGD is able to train a variety of deep neural networks to achieve zero training loss (either exactly or approximately) for non-negative loss functions. This implies that SGD can find a global minimum of deep neural networks at ease. The major challenges towards understanding this phenomenon are in two-fold: 1) deep neural networks have complex landscape that cannot be fully understood analytically (Zhou & Liang, 2018); 2) the randomness nature of SGD makes it hard to characterize its convergence on such a complex landscape. These factors prohibit a good understanding of the practical success of SGD in deep learning from a traditional optimization aspect.
|
| 14 |
+
|
| 15 |
+
In this study, we analyze the convergence of SGD in the above phenomenon by exploiting the following two critical properties. First, the fact that SGD can train neural networks to zero loss value implies that the non-negative loss functions on all data samples share a common global minimum. Second, our experiments establish strong empirical evidences that SGD (when training the loss to zero value) follows a star-convex path. Based on these properties, we formally establish the convergence of SGD to a global minimizer. Our work conveys a useful insight that although the landscape of neural networks can be complicated, the actual optimization path that SGD takes turns out to be remarkably simple and sufficient to guarantee the converge to a global minimum.
|
| 16 |
+
|
| 17 |
+
# 1.1 OUR CONTRIBUTIONS
|
| 18 |
+
|
| 19 |
+
We focus on the empirical observation that SGD can train various neural networks to achieve zero loss, and validate that SGD follows an epochwise star-convex path in empirical optimization processes. Based on such a property, we prove that the Euclidean distance between the variable sequence generated by SGD and a global minimizer decreases at an epoch level. We also show that the subsequences of iterations that correspond to the same data sample is a minimizing sequence of the loss corresponding to that sample.
|
| 20 |
+
|
| 21 |
+
By further empirical exploration, we validate that SGD follows an iterationwise star-convex path during the major part of the training process. Based on such a property, we prove that the entire variable sequence generated by SGD converges to a global minimizer of the objective function. Then, we show that the convergence of SGD induces a self-regularization on its variance, i.e., the variance of stochastic gradients vanishes as SGD converges in such a context.
|
| 22 |
+
|
| 23 |
+
From a technical perspective, we characterize the intrinsic deterministic convergence property of SGD when the optimization path is well regularized, rather than the performance on average or in probability established in the existing studies. Our results provide a novel and promising aspect to understand SGD-based optimization in deep learning. Furthermore, our analysis of SGD explores the limiting convergence property of the subsequences that correspond to individual data samples, which is in sharp contrast to the traditional treatment of SGD that depends on its random nature and bounds on variance. Hence, our proof technique can be of independent interest to the community.
|
| 24 |
+
|
| 25 |
+
# 1.2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
As there are extensive literature on SGD, we only mention the highly relevant studies here. Theoretical foundations of SGD have been developed in the optimization community (Robbins & Monro, 1951; Nemirovski et al., 2009; Lan, 2012; Ghadimi et al., 2016; Ghadimi & Lan, 2016), and have attracted much attention from the machine learning community in the past decade (Schmidt et al., 2017; Defazio et al., 2014; Johnson & Zhang, 2013; Li et al., 2017; Wang et al., 2018a). In general nonconvex optimization, it is known that SGD converges to a stationary point under a bounded variance assumption and a diminishing learning rate Bottou et al. (2016); Ghadimi et al. (2016). Other variants of SGD that are designed for deep learning have been proposed, e.g., Adam (Kingma & Ba, 2014), AMSgrad Reddi et al. (2018b), Adagrad (Duchi et al., 2011), etc, and their convergence properties have been studied in the context of online convex regret minimization.
|
| 28 |
+
|
| 29 |
+
Needell et al. (2014); Moulines & Bach (2011) show that SGD converges at a linear rate when the objective function is strongly convex and has a unique common global minimum. Recently, several studies show that SGD has the capability to escape strict saddle points Ge et al. (2015); Jin et al. (2017); Reddi et al. (2018a); Daneshmand et al. (2018). Other cubic-regularization-based methods have also been shown to be able to escape strict saddle points Nesterov & Polyak (2006); Zhou et al. (2018); Wang et al. (2018b). Kleinberg et al. (2018) considers functions with one-point strong convexity, and shows that the randomness of SGD has an intrinsic smoothing effect that can avoid convergence to sharp minimum. Our paper exploits a very different notion of star-convexity path of SGD, which is a much weaker condition than those in the previous studies.
|
| 30 |
+
|
| 31 |
+
# 2 PROBLEM SETUP AND PRELIMINARIES
|
| 32 |
+
|
| 33 |
+
Neural network training can be formulated as the following finite-sum optimization problem.
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell _ { i } ( x ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where there are in total $n$ training data samples. The loss function that corresponds to the $i$ -th data sample is denoted by $\ell _ { i } : \mathbb { R } ^ { \breve { d } } \to \mathbb { R }$ for $i = 1 , \ldots , n$ , and the vector to be minimized in the problem (e.g., network weights in deep learning) are denoted by $x \in \mathbb { R } ^ { d }$ . In general, problem $( \mathrm { P } )$ is a nonconvex optimization problem, and we make the following standard assumptions regarding the objective function.
|
| 40 |
+
|
| 41 |
+
Assumption 1. The loss functions $\ell _ { i } , i = 1 , \ldots , n$ in problem $( P )$ satisfy:
|
| 42 |
+
|
| 43 |
+
1. They are continuously differentiable, and their gradients are $L$ -Lipschitz continuous;
|
| 44 |
+
|
| 45 |
+
2. For every $i = 1 , \dots , n , \operatorname* { i n f } _ { x \in \mathbb { R } ^ { d } } \ell _ { i } ( x ) > 0 .$
|
| 46 |
+
|
| 47 |
+
The conditions imposed by Assumption 1 are standard in analysis of nonconvex optimization. In specific, item 1 is a standard smoothness assumption on nonconvex loss functions. Item 2 assumes that the loss functions are bounded below, which is satisfied by many loss functions in deep learning, e.g., MSE loss, crossentropy loss, NLL loss, etc, which are all non-negative.
|
| 48 |
+
|
| 49 |
+
Next, we introduce the following fact that is widely observed in training overparameterized deep neural networks, which we assume to hold throughout the paper.
|
| 50 |
+
|
| 51 |
+
Observation 1 (Global minimum in deep learning). The objective function $f$ in problem $( P )$ with non-negative loss can achieve zero value at certain $x ^ { * }$ . Thus, $x ^ { * }$ is also a common global minimizer for all individual loss $\{ \ell _ { i } \} _ { i = 1 } ^ { n }$ . More formally, denote $\mathcal { X } _ { i } ^ { \ast }$ as the set of global minimizers of $\ell _ { i }$ for $i = 1 , \ldots , n$ . Then, the set of common global minimizers, i.e., $\mathcal { X } ^ { * } : = \cap _ { i = 1 } ^ { n } \mathcal { X } _ { i } ^ { * }$ , is non-empty and bounded.
|
| 52 |
+
|
| 53 |
+
Observation 1 is a common observation in deep learning applications, because deep neural networks (especially in the overparameterized regime) typically have enough capacity to fit all training data samples, and therefore the model has a global minimum shared by the loss functions on all data samples. To elaborate more, if the total loss $f$ attains zero value at $x ^ { * }$ , then $\ell _ { i }$ for all $i$ must achieve zero value at $x ^ { * }$ as they are non-negative. Thus, $x ^ { * }$ is a common global minimum of all individual loss $\ell _ { i } ( x )$ for all $i$ . Such a fact plays a critical role in understanding the convergence of SGD in training neural networks.
|
| 54 |
+
|
| 55 |
+
Next, we introduce our algorithm of interest – stochastic gradient descent (SGD). Specifically, to solve problem (P), SGD starts at an initial vector $x _ { 0 } \in \mathbb { R } ^ { d }$ and generates a variable sequence $\{ x _ { k } \} _ { k }$ according to the following update rule.
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { r l } { \mathrm { ( S G D ) } } & { { } x _ { k + 1 } = x _ { k } - \eta \nabla \ell _ { \xi _ { k } } ( x _ { k } ) , \quad k = 0 , 1 , . . . , } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $\eta > 0$ denotes the learning rate, and $\xi _ { k } \in \{ 1 , \ldots , n \}$ corresponds to the sampled data index at iteration $k$ . In this study, we consider the practical cyclic sampling scheme with reshuffle (also referred to as the random sampling without replacement) to generate the random variable $\xi _ { k }$ . To elaborate the notation, we rewrite every iteration number $k$ as $n B + t$ , where $B = 0 , 1 , 2 , \ldots$ denotes the index of epoch that iteration $k$ belongs to and $t \in \{ 0 , 1 , . . . , n - 1 \}$ denotes the corresponding iteration index in that epoch. We further denote $\pi _ { B }$ as the random permutation of $1 , . . . , n$ in the $B$ -th epoch, and denote $\pi _ { B } ( j )$ as its $j$ -th element. Then, the sampled data index at iteration $k$ can be expressed as
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\xi _ { k } = \pi _ { B } ( t + 1 ) , \quad t = 0 , . . . , n - 1 .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
# 3 APPROACHING GLOBAL MINIMUM EPOCHWISELY
|
| 68 |
+
|
| 69 |
+
# 3.1 AN INTERESTING EMPIRICAL OBSERVATION OF SGD PATH
|
| 70 |
+
|
| 71 |
+
In this subsection, we provide empirical observations on the algorithm path of SGD in training neural networks. To be specific, we train a standard multi-layer perceptron (MLP) network Krizhevsky (2009), a variant of Alexnet and a variant of Inception network Zhang et al. (2017a) on the CIFAR10 dataset Krizhevsky (2009) using SGD under crossentropy loss. In all experiments, we adopt a constant learning rate (0.01 for MLP and Alexnet, 0.1 for Inception) and a constant mini-batch size 128. We discard all other optimization features such as momentum, weight decay, dropout and batch normalization, etc, in order to observe the essential property of SGD.
|
| 72 |
+
|
| 73 |
+
In each experiment, we train the network for a sufficient number of epochs to achieve near-zero training loss (i.e., almost global minimum), and record the weight parameters along the iteration path of SGD. We denote the weight parameters produced by SGD in the last iteration as $x ^ { * }$ , which has a near zero loss, and evaluate the Euclidean distance between the weight parameters produced by SGD and $x ^ { * }$ along the iteration path. We plot the results in Figure 1. It can be seen that the training losses for all three networks fluctuate along the iteration path, implying that the algorithm passes through complex landscapes. However, the Euclidean distance between the weight parameters and the final output $x ^ { * }$ is monotonically decreasing epochwise along the SGD path for all three networks. This shows that the variable sequence generated by SGD approaches the global minimum $x ^ { * }$ in a remarkably stable way. This motivates us to explore the underlying mechanism that yields such interesting observations.
|
| 74 |
+
|
| 75 |
+
In the next two subsections, we first propose a property that the algorithm path of SGD satisfies, based on which we formally prove that the variable sequence generated by SGD admits the behavior observed in Figure 1. Then, we provide empirical evidences to validate such a property of SGD path in practical SGD training.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 1: Distance to output of SGD in training neural networks.
|
| 79 |
+
|
| 80 |
+
# 3.2 EPOCHWISE STAR-CONVEX PATH
|
| 81 |
+
|
| 82 |
+
In this subsection, we introduce the notion of the epochwise star-convex path for SGD and establish its theoretical implications on the convergence of SGD. We validate that SGD satisfies such a property in practical neural network training in Section 3.3.
|
| 83 |
+
|
| 84 |
+
Recall the conventional definition of star-convexity. Let $x ^ { * }$ be a global minimizer of a smooth function $h$ . Then, $h$ is said to be star-convex at a point $x$ provided that
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
( { \mathrm { S t a r - c o n v e x i t y } } ) : \quad h ( x ) - h ( x ^ { * } ) + \langle x ^ { * } - x , \nabla h ( x ) \rangle \leq 0 .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Star-convexity can be intuitively understood as convexity between a reference point $x$ and a global minimizer $x ^ { * }$ . Such a property ensures that the negative gradient $- \nabla h ( x )$ points to the desired direction $x ^ { * } - x$ for minimization.
|
| 91 |
+
|
| 92 |
+
Next, we define the notion of epochwise star-convex path, which requires the star-convexity to be held cumulatively over each epoch.
|
| 93 |
+
|
| 94 |
+
Definition 1 (Epochwise star-convex path). We call a path generated by SGD epochwise star-convex if it satisfies: For all epochs $B = 0 , 1 , \ldots$ and for a fixed $x ^ { \ast } \in \mathcal { X } ^ { \ast }$ (see Observation 1 for definition),
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\sum _ { k = n B } ^ { n ( B + 1 ) - 1 } \left[ \ell _ { \xi _ { k } } ( x _ { k } ) - \ell _ { \xi _ { k } } ( x ^ { * } ) + \langle x ^ { * } - x _ { k } , \nabla \ell _ { \xi _ { k } } ( x _ { k } ) \rangle \right] \leq 0 .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
We note that the property introduced by Definition 1 is not about the landscape geometry of a loss function, which can be complex as observed in the training loss curves shown in Figure 1. Rather, it characterizes the interaction between the algorithm and the loss function along the optimization path. Such a property is generally weaker than the global star-convexity, and is observed to be held in practical neural network training (see Section 3.3).
|
| 101 |
+
|
| 102 |
+
Based on Definition 1, we obtain the following property of SGD.
|
| 103 |
+
|
| 104 |
+
Theorem 1 (Epochwise diminishing distance). Let Assumption 1 hold and apply SGD with learning rate $\begin{array} { r } { \eta < { \frac { 1 } { L } } } \end{array}$ to solve problem $( P )$ . Assume SGD follows an epochwise star-convex path for a certain $x ^ { * } \in \mathcal { X } ^ { * }$ . Then, the variable sequence $\{ x _ { k } \} _ { k }$ generated by SGD satisfies, for all epochs $B = 0 , 1 , . . . ,$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\| x _ { n ( B + 1 ) } - x ^ { * } \| \leq \| x _ { n B } - x ^ { * } \| .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Theorem 1 proves that the variable sequence generated by SGD approaches a global minimizer at an epoch level, which is consistent with the empirical observations made in Figure 1. Therefore, the property of epochwise star-convex path of SGD is sufficient to explain such desirable empirical observations, although the loss function can be highly nonconvex and has complex landscape.
|
| 111 |
+
|
| 112 |
+
Under the cyclic sampling scheme with reshuffle, SGD samples every data sample once per epoch. Consider the loss $\ell _ { v }$ on the $v$ -th data sample for a fixed $v \in \{ 1 , 2 , . . . , n \}$ . One can check that the iterations in which the loss $\ell _ { v }$ is sampled form a subsequence $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ , where $\pi _ { B } ^ { - 1 }$ is the inverse permutation mapping of $\pi _ { B }$ , i.e., $\pi _ { B } ^ { - 1 } ( u ) = v$ if and only if $\pi _ { B } ( v ) = u$ . Next, we characterize the convergence properties of these subsequences corresponding to the loss functions on individual data samples.
|
| 113 |
+
|
| 114 |
+
Theorem 2 (Minimizing subsequences). Under the same settings as those of Theorem 1, the subsequences $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ for $v = 1 , . . . , n$ satisfy
|
| 115 |
+
|
| 116 |
+
1. They are minimizing sequences for the corresponding loss functions, i.e.,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\operatorname* { l i m } _ { B \to \infty } \ell _ { v } ( x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } ) = \operatorname* { i n f } _ { x \in \mathbb { R } ^ { d } } \ell _ { v } ( x ) , \quad \forall v \in \{ 1 , . . . , n \} .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
2. Every limit point of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ is in $\mathcal { X } _ { v } ^ { \ast }$
|
| 123 |
+
|
| 124 |
+
Theorem 2 characterizes the limiting behavior of the subsequences that correspond to the loss functions on individual data samples. Essentially, the results in items 1 and 2 show that each subsequence $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ is a minimizing sequence for the corresponding loss $\ell _ { v }$ .
|
| 125 |
+
|
| 126 |
+
# DISCUSSION
|
| 127 |
+
|
| 128 |
+
We note that Theorems 1 and 2 characterize the epochwise convergence property of SGD in a deterministic way. The underlying technical reason is that the common global minimizer structure in Observation 1 suppresses the randomness induced by sampling and reshuffling of SGD, and ensures a common direction along which SGD can approach the global minimum on all individual data samples. Such a result is very different from traditional understanding of SGD where randomness and variance play a central role Nemirovski et al. (2009); Ghadimi et al. (2016).
|
| 129 |
+
|
| 130 |
+
# 3.3 VERIFYING EPOCHWISE STAR-CONVEX PATH OF SGD
|
| 131 |
+
|
| 132 |
+
In this subsection, we conduct experiments to validate the epochwise star-convex path of SGD introduced in Definition 1.
|
| 133 |
+
|
| 134 |
+
We train the aforementioned three types of neural networks, i.e., MLP, Alexnet and Inception, on CIFAR10 Krizhevsky (2009) and MNIST Lecun et al. (1998) dataset using SGD. The hyperparameter settings are the same as those mentioned in Section 3.1. We train these networks for a sufficient number of epochs to achieve a near-zero training loss (i.e., near-global minimum). We record the variable sequence generated by SGD along the entire algorithm path, and set $x ^ { * }$ to be the final output of SGD. Then, we evaluate the value of the summation term in Definition 1 for each epoch. The value of this summation term for each epoch $B$ is denoted as residual $e _ { B }$ . By Definition 1, SGD path in the $B$ -th epoch is epochwise star-convex provided that $e _ { B } < 0$ .
|
| 135 |
+
|
| 136 |
+
Figure 2 shows the results of our experiments. In all subfigures, the red horizontal curve denotes the zero value baseline, and the other curve denotes the residual $e _ { B }$ . It can be seen from Figure 2 that, on the MNIST dataset (second row), the entire path of SGD satisfies epochwise star-convexity for all three networks. On the CIFAR10 dataset (first row), we observe an epochwise star-convex path of SGD after several epochs of the initial phase of training. This can be due to the more complex landscape of the loss function on the CIFAR10 dataset, so that it takes SGD several epochs to enter a basin of attraction of the global minimum.
|
| 137 |
+
|
| 138 |
+
Our empirical findings strongly support the validity of the epochwise star-convex path of SGD in Definition 1. Therefore, Theorem 1 establishes an empirically-verified theory for characterizing the convergence property of SGD in training neural networks at an epoch level. In particular, it is well justified to successfully explain the stable epochwise convergence behavior observed in Figure 1.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Verification of epochwise star-convex path.
|
| 142 |
+
|
| 143 |
+
# 4 CONVERGENCE TO A GLOBAL MINIMIZER
|
| 144 |
+
|
| 145 |
+
The result developed in Theorem 1 shows that the variable sequence generated by SGD monotonically approaches a global minimizer at an epoch level. However, it does not guarantee the convergence of the variable sequence to a global minimizer (which requires the distance between SGD iterates and the global minimizer reduces to zero). We further explore such a convergence issue in the following two subsections. We first define a notion of an iterationwise star-convex path for SGD, based on which we formally establish the convergence of SGD to a global minimizer. Then, we provide empirical evidences to support the satisfaction of the iterationwise star-convex path by SGD.
|
| 146 |
+
|
| 147 |
+
# 4.1 ITERATIONWISE STAR-CONVEX PATH
|
| 148 |
+
|
| 149 |
+
We introduce the following definition of an iterationwise star-convex path for SGD.
|
| 150 |
+
|
| 151 |
+
Definition 2 (Iterationwise star-convex path). We call a path generated by SGD iterationwise starconvex if it satisfies: For all $k = 0 , 1 , \ldots$ and for every ${ \boldsymbol { x } } ^ { * } \in \mathcal { X } _ { \xi _ { k } } ^ { * }$ ,
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\ell _ { \xi _ { k } } ( x _ { k } ) - \ell _ { \xi _ { k } } ( x ^ { * } ) + \langle x ^ { * } - x _ { k } , \nabla \ell _ { \xi _ { k } } ( x _ { k } ) \rangle \leq 0 .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Compared to Definition 1 which defines the star-convex path of SGD at an epoch level, Definition 2 characterizes the star-convexity of SGD along the optimization path at a more refined iteration level. As we show in the result below, such a stronger property helps to regularize the convergence property of SGD at an iteration level, and is sufficient to guarantee convergence.
|
| 158 |
+
|
| 159 |
+
Theorem 3 (Convergence to global minimizer). Let Assumption 1 hold and apply SGD with learning rate $\begin{array} { r } { \eta < { \frac { 1 } { L } } } \end{array}$ to solve problem $( P )$ . Assume SGD follows an iterationwise star-convex path. Then, the sequence $\{ x _ { k } \} _ { k }$ generated by SGD converges to a global minimizer.
|
| 160 |
+
|
| 161 |
+
Theorem 3 formally establishes the convergence of SGD to a global minimizer along an iterationwise star-convex path. The main idea of the proof is to establish a consensus of the minimizing subsequences that are studied in Theorem 2, i.e., all these subsequences converge to the same limit – a common global minimizer of the loss functions over all the data samples. More specifically, our proof strategy consists of three steps: 1) show that every limit point of each subsequence is a common global minimizer; 2) prove that each subsequence has a unique limit point; 3) show that all these subsequences share the same unique limit point, which is a common global minimizer. We believe that the proof technique here can be of independent interest to the community.
|
| 162 |
+
|
| 163 |
+
Our analysis in Theorem 3 characterizes the intrinsic deterministic convergence property of SGD, which is an alternative view of the SGD path: It performs gradient descent on an individual loss component at each iteration. The star-convexity along the iteration path pushes the algorithm towards the common global minimizer. Such progress is shared across all data samples in every iteration and eventually leads to the convergence of SGD.
|
| 164 |
+
|
| 165 |
+
We also note that the convergence result in Theorem 3 is based on a constant learning rate, which is typically used in practical training. This is very different from and much more desirable than the diminishing learning rate adopted in traditional analysis of SGD Nemirovski et al. (2009), which is a necessity to mitigate the negative effects caused by the variance of SGD. Furthermore, Theorem 3 shows that SGD converges to a common global minimizer where the gradient of loss function on all data samples vanish, and we therefore obtain the following interesting corollary.
|
| 166 |
+
|
| 167 |
+
Corollary 1 (Vanishing variance). Under the same settings of those of Theorem 3, the variance of stochastic gradients sampled by SGD converges to zero as iteration k goes to infinity.
|
| 168 |
+
|
| 169 |
+
Thus, upon convergence, the common global minimizer structure in deep learning leads to a selfvariance-reducing effect on SGD. Such a desirable effect is the core property of stochastic variancereduced algorithms that reduces sample complexity Johnson & Zhang (2013). Hence, this justifies in part that SGD is a sample-efficient algorithm in learning deep models.
|
| 170 |
+
|
| 171 |
+
# DISCUSSION
|
| 172 |
+
|
| 173 |
+
We want to mention that many nonconvex sensing models have an underlying true signal and hence naturally have common global minimizers, e.g., phase retrieval Zhang et al. (2017b), low-rank matrix recovery Tu et al. (2016), blind deconvolution Li et al. (2018), etc. This is also the case for some neural network sensing problems Zhong et al. (2017). Also, these problems have been shown to satisfy the so-called gradient dominance condition and the regularity condition locally around the global minimizers Zhou et al. (2016); Tu et al. (2016); Li et al. (2018); Zhong et al. (2017); Zhou & Liang (2017). These two geometric properties imply the star-convexity of the objective function, which necessarily imply the epochwise and iterationwise star-convex path of SGD. Therefore, our results also have implications on the convergence guarantee of SGD for solving these problems as well.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: Verification of iterationwise star-convex path under crossentropy loss.
|
| 177 |
+
|
| 178 |
+
# 4.2 VERIFYING ITERATIONWISE STAR-CONVEX PATH OF SGD
|
| 179 |
+
|
| 180 |
+
In this subsection, we conduct experiments to validate the iterationwise star-convex path of SGD introduced in Definition 2.
|
| 181 |
+
|
| 182 |
+
We train the aforementioned three types of neural networks, i.e., MLP, Alexnet and Inception, on CIFAR10 and MNIST datasets using SGD. The hyperparameter settings are the same as those mentioned in Section 3.1. We train these networks for a sufficient number of epochs to achieve a near-zero training loss. Due to the demanding requirement for storage, we record the variable sequence generated by SGD for all iterations in every tenth epoch, and set $x ^ { * }$ to be the final output of SGD. Then, for all the iterations in every tenth epoch, we evaluate the corresponding values of the terms on the left hand side in eq. (2) (denoted as $e _ { k }$ ). Then, we report the fraction of number of iterations that satisfy the iterationwise star-convexity (i.e., $e _ { k } < 0$ ) within such an epoch.
|
| 183 |
+
|
| 184 |
+
In all subfigures of Figure 3, the red curves denote the training loss and the blue bars denote the fraction of iterations that satisfy the iterationwise star-convexity within such an epoch. It can be seen from Figure 3 that, for all three networks on the MNIST dataset (second row), the path of SGD satisfies iterationwise star-convexity for most of the iterations, except in the last several epochs where the training loss (see the red curve) already well saturates at zero value. In fact, the convergence is typically observed well before such a point. This is because when the training loss is very close to the global minimum (i.e., the gradient is very close to zero), small perturbation of the landscape easily deviates the SGD path from the desired star-convexity. Hence, our experiments demonstrate that SGD follows the iterationwise star-convex path up to the convergence occurs. Furthermore, on the CIFAR10 dataset (first row of Figure 3), we observe a strong evidence for the iterationwise star-convex path of SGD after several epochs of the initial phase of training. This implies that the loss landscape on a more challenging dataset can be more complex.
|
| 185 |
+
|
| 186 |
+
Our empirical findings support the validity of the iterationwise star-convex path of SGD in a major part of practical training processes. Therefore, our convergence guarantee developed in Theorem 3 for SGD well justifies its practical success.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: Iterationwise path on local minimum.
|
| 190 |
+
|
| 191 |
+
We next conduct further experiments to demonstrate that SGD follows the iterationwise star-convex path likely only for successful trainings to zero loss value, where a shared global minimum among all individual loss functions is achieved. To verify such a thought, we train an MLP using SGD on the CIFAR10 dataset under various settings with the number of hidden neurons ranging from 16 to 256. The results are shown in Figure 4, from which we observe that the training loss (i.e., red curves) converges to a non-zero value when the number of hidden neurons is small, implying that the algorithm likely attains a sub-optimal point which is not a common global minimum shared by all individual loss functions. In such trainings, we observe that the corresponding SGD paths have much fewer iterations satisfying the iterationwise star-convexity compared to the successful training instances shown in Figure 3. Thus, such empirical findings partially suggest that iterationwise star-convex SGD path more likely occurs when SGD can find a common global minimum, e.g., training overparameterized networks to zero loss value.
|
| 192 |
+
|
| 193 |
+
# 5 CONCLUSION
|
| 194 |
+
|
| 195 |
+
In this paper, we propose an epochwise star-convex property of the optimization path of SGD, which we validate in various experiments. Based on such a property, we show that SGD approaches a global minimum at an epoch level. Then, we further examine the property at an iteration level, and empirically show that it is satisfied in a major part of training processes. As we prove theoretically, such a more refined property guarantees the convergence of SGD to a global minimum, and the algorithm enjoys a self-variance-reducing effect. We believe that our study sheds light on the success of SGD in training neural networks from both empirical aspect and theoretical aspect.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
A. Blum and R. L. Rivest. Training a 3-node neural network is NP-complete. In Proc. 1st Annual Workshop on Computational Learning Theory (COLT), pp. 9–18, 1988.
|
| 200 |
+
L. Bottou, F. E. Curtis, and J. Nocedal. Optimization methods for large-scale machine learning. ArXiv: 1606.04838, June 2016.
|
| 201 |
+
H. Daneshmand, J. M. Kohler, A. Lucchi, and T. Hofmann. Escaping saddles with stochastic gradients. In Proc. International Conference on Machine Learning (ICML), 2018.
|
| 202 |
+
A. Defazio, F. Bach, and S. Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In Proc. Advances in Neural Information Processing Systems (NIPS), pp. 1646–1654. 2014.
|
| 203 |
+
J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research (JMLR), 12:2121–2159, July 2011.
|
| 204 |
+
R. Ge, F. Huang, C. Jin, and Y. Yuan. Escaping from saddle points — online stochastic gradient for tensor decomposition. In Proc. 28th Conference on Learning Theory (COLT), volume 40, pp. 797–842, 03–06 Jul 2015.
|
| 205 |
+
S. Ghadimi and G. Lan. Accelerated gradient methods for nonconvex nonlinear and stochastic programming. Mathematical Programming, 156(1):59–99, Mar 2016.
|
| 206 |
+
S. Ghadimi, G. Lan, and H. Zhang. Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization. Mathematical Programming, 155(1):267–305, Jan 2016.
|
| 207 |
+
C. Jin, R. Ge, P. Netrapalli, S. M. Kakade, and M. I. Jordan. How to escape saddle points efficiently. In Proc. 34th International Conference on Machine Learning (ICML), volume 70, pp. 1724–1732, Aug 2017.
|
| 208 |
+
R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Proc. 26th International Conference on Neural Information Processing Systems (NIPS), pp. 315–323, 2013.
|
| 209 |
+
D. Kingma and J. Ba. Adam: A method for stochastic optimization. Proc. International Conference on Learning Representations (ICLR), 12 2014.
|
| 210 |
+
B. Kleinberg, Y. Li, and Y. Yuan. An alternative view: When does SGD escape local minima? In Proc. 35th International Conference on Machine Learning (ICML), volume 80, pp. 2698–2707, Jul 2018.
|
| 211 |
+
A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 212 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, May 2017.
|
| 213 |
+
G. Lan. An optimal method for stochastic composite optimization. Mathematical Programming, 133 (1):365–397, Jun 2012.
|
| 214 |
+
Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, Nov 1998.
|
| 215 |
+
Q. Li, Y. Zhou, Y. Liang, and P. K. Varshney. Convergence analysis of proximal gradient with momentum for nonconvex optimization. In Proc. 34th International Conference on Machine Learning (ICML), volume 70, pp. 2111–2119, Aug 2017.
|
| 216 |
+
X. Li, S. Ling, T. Strohmer, and K. Wei. Rapid, robust, and reliable blind deconvolution via nonconvex optimization. Applied and Computational Harmonic Analysis, 2018.
|
| 217 |
+
S. Linnainmaa. Taylor expansion of the accumulated rounding error. Numerical Mathematics, 16: 146–160, 1976.
|
| 218 |
+
E. Moulines and F. R Bach. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. In Proc. Advances in Neural Information Processing Systems (NIPS), 2011.
|
| 219 |
+
D. Needell, R. Ward, and N. Srebro. Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. In Proc. Advances in Neural Information Processing Systems (NIPS), 2014.
|
| 220 |
+
A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009.
|
| 221 |
+
Y. Nesterov and B. Polyak. Cubic regularization of Newton’s method and its global performance. Mathematical Programming, 2006.
|
| 222 |
+
S. Reddi, M. Zaheer, S. Sra, B. Poczos, F. Bach, R. Salakhutdinov, and A. Smola. A generic approach for escaping saddle points. In Proc. 21st International Conference on Artificial Intelligence and Statistics (AISTATS), volume 84, pp. 1233–1242, Apr 2018a.
|
| 223 |
+
S. J. Reddi, S. Kale, and S. Kumar. On the convergence of Adam and beyond. In Proc. International Conference on Learning Representations (ICLR), 2018b.
|
| 224 |
+
H. Robbins and S. Monro. A stochastic approximation method. The Annals of Mathematical Statistics, 22(3):400–407, Sep 1951.
|
| 225 |
+
M. Schmidt, N. Le Roux, and F. Bach. Minimizing finite sums with the stochastic average gradient. Mathematical Programming, 162(1):83–112, Mar 2017.
|
| 226 |
+
S. Tu, R. Boczar, M. Simchowitz, M. Soltanolkotabi, and B. Recht. Low-rank solutions of linear matrix equations via Procrustes flow. In Proc. 33rd International Conference on Machine Learning (ICML), pp. 964–973, 2016.
|
| 227 |
+
Z. Wang, K. Ji, Y. Zhou, Y. Liang, and V. Tarokh. SpiderBoost: A class of faster variance-reduced algorithms for nonconvex optimization. ArXiv:1810.10690, October 2018a.
|
| 228 |
+
Z. Wang, Y. Zhou, Y. Liang, and G. Lan. Sample complexity of stochastic variance-reduced cubic regularization for nonconvex optimization. ArXiv:1802.07372v1, February 2018b.
|
| 229 |
+
C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. In Proc. International Conference on Learning Representations (ICLR), 2017a.
|
| 230 |
+
H. Zhang, Y. Zhou, Y. Liang, and Y. Chi. A nonconvex approach for phase retrieval: reshaped Wirtinger flow and incremental algorithms. Journal of Machine Learning Research (JMLR), 18 (141):1–35, 2017b.
|
| 231 |
+
K. Zhong, Z. Song, P. Jain, P. L. Bartlett, and I. S. Dhillon. Recovery guarantees for one-hidden-layer neural networks. In Proc. 34th International Conference on Machine Learning (ICML), volume 70, pp. 4140–4149, Aug 2017.
|
| 232 |
+
Y. Zhou and Y. Liang. Characterization of gradient dominance and regularity conditions for neural networks. ArXiv:1710.06910v2, Oct 2017.
|
| 233 |
+
Y. Zhou and Y. Liang. Critical points of linear neural networks: Analytical forms and landscape properties. In Proc. International Conference on Learning Representations (ICLR), 2018.
|
| 234 |
+
Y. Zhou, H. Zhang, and Y. Liang. Geometrical properties and accelerated gradient solvers of nonconvex phase retrieval. In Proc. 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 331–335, 2016.
|
| 235 |
+
Y. Zhou, Z. Wang, and Y. Liang. Convergence of cubic regularization for nonconvex optimization under KL property. In Proc. Advances in Neural Information Processing Systems (NIPS), 2018.
|
| 236 |
+
|
| 237 |
+
# Supplementary Materials
|
| 238 |
+
|
| 239 |
+
A PROOF OF THEOREM 1
|
| 240 |
+
|
| 241 |
+
Observe that the SGD update can be rewritten as the following optimization step
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
x _ { k + 1 } = \underset { u \in \mathbb { R } ^ { d } } { \mathrm { a r g m i n } } \Big \{ \underset { \ b { \xi } _ { k } } { \ell } ( x _ { k } ) + \langle u - x _ { k } , \nabla \ell _ { \xi _ { k } } ( x _ { k } ) \rangle + \frac { 1 } { 2 \eta } \| u - x _ { k } \| ^ { 2 } \Big \} .
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
Note that the function $f _ { \xi _ { k } } ( u )$ is linear, and we further obtain that for all $x ^ { \ast } \in \mathcal { X } _ { \xi _ { k } } ^ { \ast }$
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
\begin{array} { r l } { \eta \big ( f _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) = \eta \langle \nabla \ell _ { \xi _ { k } } ( x _ { k } ) , x _ { k + 1 } - x ^ { * } \rangle } & { } \\ { \overset { ( i ) } { = } \langle x _ { k } - x _ { k + 1 } , x _ { k + 1 } - x ^ { * } \rangle } & { } \\ { } & { = \cfrac { 1 } { 2 } \Big ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x _ { k } \| ^ { 2 } \Big ) , } \end{array}
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
where (i) uses the update rule of SGD. Rearranging the above inequality yields that
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
f _ { \xi _ { k } } ( x _ { k + 1 } ) \leq f _ { \xi _ { k } } ( x ^ { * } ) + \frac { 1 } { 2 \eta } \Big ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x _ { k } \| ^ { 2 } \Big ) .
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
On the other hand, by smoothness of the loss function, we obtain that
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
\begin{array} { r l } & { \ell _ { \xi _ { k } } ( x _ { k + 1 } ) \leq \ell _ { \xi _ { k } } ( x _ { k } ) + \langle x _ { k + 1 } - x _ { k } , \nabla \ell _ { \xi _ { k } } ( x _ { k } ) \rangle + \displaystyle \frac { L } { 2 } \| x _ { k + 1 } - x _ { k } \| ^ { 2 } } \\ & { \qquad = f _ { \xi _ { k } } ( x _ { k + 1 } ) + \displaystyle \frac { L } { 2 } \| x _ { k + 1 } - x _ { k } \| ^ { 2 } } \\ & { \qquad \overset { ( i ) } { \leq } f _ { \xi _ { k } } ( x ^ { * } ) + \displaystyle \frac { 1 } { 2 \eta } ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } ) - ( \displaystyle \frac { 1 } { 2 \eta } - \displaystyle \frac { L } { 2 } ) \| x _ { k + 1 } - x _ { k } \| ^ { 2 } } \\ & { \qquad \overset { ( i i ) } { \leq } f _ { \xi _ { k } } ( x ^ { * } ) + \displaystyle \frac { 1 } { 2 \eta } ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } ) , } \end{array}
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
where (i) follows from eq. (3) and (ii) is due to the choice of learning rate. Summing the above inequality over $k$ from $n B$ to $n ( B + 1 ) - 1$ yields that, for every $x ^ { * } \in \mathcal { X } ^ { * }$ in Definition 1,
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\begin{array} { r } { \| x _ { n ( B + 1 ) } - x ^ { * } \| ^ { 2 } \leq \| x _ { n B } - x ^ { * } \| ^ { 2 } - \displaystyle \sum _ { k = n B \atop n ( B + 1 ) - 1 } ^ { n ( B + 1 ) - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) } \\ { \leq \| x _ { n B } - x ^ { * } \| ^ { 2 } - \displaystyle \sum _ { k = n B } ^ { n ( B + 1 ) - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - \ell _ { \xi _ { k } } ( x ^ { * } ) \big ) , } \end{array}
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
where the last inequality follows from the star-convex path of SGD in Definition 1. The desired result follows from the above inequality and the fact that $\ell _ { \xi _ { k } } ( x ^ { * } ) = \operatorname* { i n f } _ { \boldsymbol { u } \in \mathbb { R } ^ { d } } \ell _ { \xi _ { k } } ( \boldsymbol { u } )$ for all $x ^ { * } \in \mathcal { X } ^ { * }$ Moreover, we conclude that the sequence $\{ x _ { n B } \} _ { B }$ is bounded. By continuity of $\nabla \ell _ { i }$ for all $i =$ $1 , . . . , n$ and the update rule of SGD, we further conclude that the entire sequence $\{ \boldsymbol { x } _ { k } \} _ { k }$ is bounded.
|
| 272 |
+
|
| 273 |
+
# B PROOF OF THEOREM 2
|
| 274 |
+
|
| 275 |
+
We first collect some facts. Recall that ${ { \mathcal X } ^ { * } } = \cap _ { i = 1 } ^ { n } { { \mathcal X } _ { i } ^ { * } }$ is non-empty and bounded. Consider any fixed $t \in \{ 0 , \ldots , n - 1 \}$ and recall that $k = n B + t$ , $\xi _ { k } = \pi _ { B } ( t + 1 )$ . Then, one can check that the iterations $k$ with $\xi _ { k } = \dot { v } \in \{ 1 , 2 , . . . , n \}$ form the subsequence $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) - 1 } \} _ { B }$ .
|
| 276 |
+
|
| 277 |
+
Next, we prove item 1. Fix any $t \in \{ 0 , \ldots , n - 1 \}$ and sum eq. (4) over $k$ from $n B + t$ to $n ( B + 1 ) + t - 1$ yields that, for every $x ^ { * } \in \mathcal { X } ^ { * }$ in Definition 1,
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
\| x _ { n ( B + 1 ) + t } - x ^ { * } \| ^ { 2 } \leq \| x _ { n B + t } - x ^ { * } \| ^ { 2 } - \sum _ { k = n B + t } ^ { n ( B + 1 ) + t - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) .
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
Further summing the above inequality over $B$ from 0 to $K$ and rearranging, we obtain that
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
\begin{array} { r l } { | x _ { n } ( K + 1 ) + t - x ^ { * } | | ^ { 2 } \le \| x _ { t } - x ^ { * } \| ^ { 2 } - } & { \displaystyle \sum _ { k = n } ^ { n ( K + 1 ) - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) } \\ & { \qquad - \displaystyle \sum _ { k = t } ^ { n - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) - \displaystyle \sum _ { k = n ( K + 1 ) } ^ { n ( K + 1 ) + t - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) , } \\ { \le \| x _ { t } - x ^ { * } \| ^ { 2 } - } & { \displaystyle \sum _ { k = n } ^ { n ( K + 1 ) - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - \ell _ { \xi _ { k } } ( x ^ { * } ) \big ) } \\ & { \qquad - \displaystyle \sum _ { k = t } ^ { n - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) - \displaystyle \sum _ { k = n ( K + 1 ) } ^ { n ( K + 1 ) + t - 1 } 2 \eta \big ( \ell _ { \xi _ { k } } ( x _ { k + 1 } ) - f _ { \xi _ { k } } ( x ^ { * } ) \big ) , } \end{array}
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
where the last inequality follows from the the star-convex path of SGD in Definition 1. Consider the term $\ell _ { \xi _ { k } } ( x _ { k + 1 } ) - \ell _ { \xi _ { k } } ( x ^ { * } )$ in eq. (6) along the iterations with $\xi _ { k } = v \in \{ 1 , 2 , . . . , n \}$ . Such term can be rewritten as $\ell _ { v } ( \bar { x } _ { n B + \pi _ { B } ^ { - 1 } ( v ) } ) - \ell _ { v } ( x ^ { * } )$ . Suppose for certain $v \in \{ 1 , 2 , . . . , n \}$ the sequence $\{ \ell _ { v } ( x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } ) \} _ { B }$ does not converge to its global minimum $\operatorname* { i n f } _ { \substack { x \in \mathbb { R } ^ { d } } } \ell _ { v } ( x )$ . Then, by the cyclic sampling scheme with reshuffle, we conclude that the first summation term in eq. (6) diverges to $+ \infty$ as $K \infty$ . Also, note that the last two summation terms have finite number of elements, which are all bounded as $\{ \boldsymbol { x } _ { k } \} _ { k }$ is bounded. Therefore, we conclude that the sequences $\{ x _ { n B + t } \} _ { B }$ for $t = 0 , . . . , n - 1$ converge to $x ^ { * }$ for all candidates $x ^ { * } \in \mathcal { X } ^ { * }$ in Definition 1. Next, consider the case in which there are multiple such candidate $x ^ { * } s$ in Definition 1. Then, the previous sentence states that $\{ x _ { n B + t } \} _ { B }$ converges to multiple limits, which cannot happen for a convergent sequence. This leads to a contradiction. Consider the other case that there is only one such candidate $x ^ { * }$ in Definition 1. Then, we conclude that all the sequences $\{ x _ { n B + t } \} _ { B }$ for $t = 0 , . . . , n - 1$ converge to $x ^ { * }$ , i.e., the entire sequence $\{ x _ { k } \} _ { k }$ converges to such unique common global minimizer. This contradicts with our assumption that $\{ \ell _ { v } ( x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } ) \} _ { B }$ does not converge to $\operatorname* { i n f } _ { \substack { x \in \mathbb { R } ^ { d } } } \ell _ { v } ( x )$ for certain $v$ . Combining both cases, we obtain the desired claim of item 1.
|
| 290 |
+
|
| 291 |
+
Next, we prove item 2. Note that sequence $\{ x _ { k } \} _ { k }$ is bounded . Fix any $v \in \{ 1 , \ldots , n \}$ and consider any limit point $z _ { v }$ of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ , i.e., $x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } \stackrel { j } { \to } z _ { v }$ along a proper subsequence. From item 1 we know that $\begin{array} { r } { \ell _ { v } \big ( x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } \big ) \stackrel { j } { \to } \operatorname* { i n f } _ { x \in \mathbb { R } ^ { d } } \ell _ { v } ( x ) } \end{array}$ . This, together with the continuity of the loss function, implies that $z _ { v } \in \mathcal { X } _ { v } ^ { * }$ for all $v$ .
|
| 292 |
+
|
| 293 |
+
# C PROOF OF THEOREM 3
|
| 294 |
+
|
| 295 |
+
Recall that eq. (4) shows that, for all $x ^ { \ast } \in \mathcal { X } _ { \xi _ { k } } ^ { \ast }$
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\begin{array} { r l r } & { } & { \ell _ { \xi _ { k } } ( x _ { k + 1 } ) \le f _ { \xi _ { k } } ( x ^ { * } ) + \displaystyle \frac { 1 } { 2 \eta } \Big ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } \Big ) } \\ & { } & { \stackrel { ( i ) } { \le } \ell _ { \xi _ { k } } ( x ^ { * } ) + \displaystyle \frac { 1 } { 2 \eta } \Big ( \| x _ { k } - x ^ { * } \| ^ { 2 } - \| x _ { k + 1 } - x ^ { * } \| ^ { 2 } \Big ) , } \end{array}
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where (i) follows from the iterationwise star-convex path in Definition 2. Since $\ell _ { \xi _ { k } } ( x _ { k + 1 } ) - \ell _ { \xi _ { k } } ( x ^ { * } ) \geq$ 0, we conclude that for all $k = 0 , 1 , \ldots$ and every $x ^ { \ast } \in \mathcal { X } _ { \xi _ { k } } ^ { \ast }$ ,
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
\lVert x _ { k + 1 } - x ^ { * } \rVert \leq \lVert x _ { k } - x ^ { * } \rVert .
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
Next, consider any $v \in \{ 1 , . . . , n \}$ , we show that every limit point $z _ { v }$ of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ is in $\mathcal { X } ^ { \ast }$ . By eq. (9), we know that $\{ \| x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } - x ^ { * } \| \} _ { B }$ is decreasing. Consider a limit point $z _ { v }$ associated with the subsequence such that $x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } \to z _ { v }$ . Then, for all $B _ { j } \geq B$ we know that, for any fixed $x ^ { * } \in \mathcal { X } ^ { * }$ ,
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\| z _ { v } - x ^ { * } \| \overset { j } { } \| x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } - x ^ { * } \| \leq \| x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } - x ^ { * } \| .
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
Next, we prove by contradiction. Suppose that $z _ { v } \notin \mathcal { X } ^ { \ast }$ . Then, eq. (10) implies that $\parallel x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } -$ $x ^ { * } \Vert > 0$ for all large $B$ and any $x ^ { \ast } \in \mathcal { X } ^ { \ast }$ . Combining this conclusion with item 2 of Theorem 2, it follows that all the limit points of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ are in ${ \mathcal { X } } _ { v } ^ { * } \mid { \mathcal { X } } ^ { * }$ . Since ${ { \mathcal X } ^ { * } } = \cap _ { i = 1 } ^ { n } { { \mathcal X } _ { i } ^ { * } }$ , it follows that the limit points of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( u ) } \} _ { B }$ are different from those of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ for any $u \ne v$ . Now consider a subsequence $x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } \to z _ { v } \in \mathcal { X } _ { v } ^ { * } \setminus \mathcal { X } ^ { * }$ . Also, consider the subsequence $\{ x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( u ) } \} _ { j }$ with bseq $u \ne v$ he of lic samplisuch that hat with probability(this occurs with a $B _ { j ( s ) }$ $B _ { j }$ $\pi _ { B _ { j ( s ) } } ^ { - 1 } ( u ) = \pi _ { B _ { j ( s ) } } ^ { - 1 } ( v ) + 1$ constant probability in every epoch). Applying eq. (9) along this subsequence, we conclude that
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\begin{array} { r } { \| x _ { n B _ { j ( s ) } + \pi _ { B _ { j ( s ) } } ^ { - 1 } ( u ) } - z _ { v } \| \leq \| x _ { n B _ { j ( s ) } + \pi _ { B _ { j ( s ) } } ^ { - 1 } ( v ) } - z _ { v } \| \overset { j } { } 0 . } \end{array}
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
Let j → ∞ in the above equation, we conclude that xnBj(s)+π−1Bj(s)(u ) → zv , i.e., zv is a limit point of $\{ x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( u ) } \} _ { B }$ . Note that $z _ { v }$ is a limit point of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ . This contradicts our previous conclusion that the limit points of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( u ) } \} _ { B }$ must be different from those of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ for $u \ne v$ . Thus, we must have for all $v = 1 , \ldots , n$ , every limit point $z _ { v }$ of $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ is in $\mathcal { X } ^ { \ast }$ Then, by eq. (9) we further conclude that for all $B = 0 , 1 , . . .$ .
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\| x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } - z _ { v } \| \leq \| x _ { n ( B - 1 ) + \pi _ { B - 1 } ^ { - 1 } ( v ) } - z _ { v } \| .
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Note that $x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } \overset { j } { \to } z _ { v }$ . Thus, for all $B \geq B _ { j }$ the above inequality implies that
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r } { \| x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } - z _ { v } \| \le \| x _ { n B _ { j } + \pi _ { B _ { j } } ^ { - 1 } ( v ) } - z _ { v } \| \overset { j } { } 0 . } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
This shows that $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ has a unique limit point $z _ { v }$ , which is an element of $\mathcal { X } ^ { \ast }$ . Next, consider the limits $z _ { u } , z _ { v } ( u \ne v )$ of the sequences $\{ x _ { n B + \pi _ { B } ^ { - 1 } ( u ) } \} _ { B } , \{ x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } \} _ { B }$ , respectively. By eq. (9) and the fact that $z _ { u } \in \mathcal { X } ^ { * }$ , we conclude that
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r } { \| x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } - z _ { u } \| \le \| x _ { n ( B - 1 ) + \pi _ { B - 1 } ^ { - 1 } ( v ) } - z _ { u } \| \le \| x _ { n ( B - 2 ) + \pi _ { B - 2 } ^ { - 1 } ( u ) } - z _ { u } \| \overset { B } { \to } 0 . } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Thus, $x _ { n B + \pi _ { B } ^ { - 1 } ( v ) } z _ { u }$ , and we conclude that $z _ { v } = z _ { u }$ for all $v \neq u$ , i.e., the whole sequence $\{ x _ { k } \}$ has a unique limit point in $\mathcal { X } ^ { \ast }$ .
|
| 338 |
+
|
| 339 |
+
# D SUPPLEMENTARY EXPERIMENTS
|
| 340 |
+
|
| 341 |
+
In this section, we provide more experiments to illustrate the star-convexity property of the SGD path from other different aspects.
|
| 342 |
+
|
| 343 |
+
# Verification of epochwise star-convexity with different reference points
|
| 344 |
+
|
| 345 |
+
In Figure 5 we verify the epochwise star-convexity of the SGD path by setting the reference point $x ^ { * }$ to be the output of SGD at different intermediate epochs (i.e., 60,80,100,120 epochs), where the SGD has already saturated close to zero loss. The experiments are conducted by training the Alexnet and MLP on Cifar10 using SGD. As can be seen from Figure 5, the epochwise star-convexity still hold (i.e., $e _ { B } < 0$ ) after certain epochs in the initial training phase. This shows that the observed star-convex path does not depend on the choice of reference point (so long as they achieve near-zero loss).
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 5: Verification of epochwise star-convexity when the reference point $x ^ { * }$ is taken at end of different epochs. Top plots correspond to the training of Alexnet with $x ^ { * }$ taken at 60th, 80th, 100th, and 120th epochs, and bottom plots correspond to the training of MLP with $x ^ { * }$ taken at 60th, 80th, $1 0 0 \mathrm { { t h } }$ , and $1 2 0 \mathrm { { t h } }$ epochs.
|
| 349 |
+
|
| 350 |
+
# Growth of weight norm in neural network training
|
| 351 |
+
|
| 352 |
+
In Figure 6, we present the growth of the $\ell _ { 2 }$ norm of network weights in training different neural networks on Cifar10 under the cross-entropy loss. It can be seen from the figure that the norm of the weights increases slowly (logarithmly) after the training loss achieves near-zero. This is because the gradient is nearly zero when the training is close to the global minimum, and therefore the updates of the weights are very small.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 6: $\ell _ { 2 }$ norm of network weights and training loss of different networks.
|
| 356 |
+
|
| 357 |
+
# Verification of star-convexity under MSE loss
|
| 358 |
+
|
| 359 |
+
In Figure 7, we verify the epochwise star-convexity by training different networks on MNIST dataset under the MSE loss (i.e., $\ell _ { 2 }$ loss). We note that unlike the cross-entropy loss, zero value can be achieved by the MSE loss. We set the reference point $x ^ { * }$ to be the output of SGD at the 40th epoch. It can be seen from the figure that the residue $e _ { B }$ is negative along the entire optimization path, demonstrating that the SGD path satisfies the epochwise star-convexity under the MSE loss.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 7: Verification of epochwise star-convexity under MSE loss (i.e., $\ell _ { 2 }$ loss).
|
md/train/HJxV-ANKDH/HJxV-ANKDH.md
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EFFICIENT RIEMANNIAN OPTIMIZATION ON THE STIEFEL MANIFOLD VIA THE CAYLEY TRANSFORM
|
| 2 |
+
|
| 3 |
+
Jun Li, Li Fuxin, Sinisa Todorovic
|
| 4 |
+
School of EECS
|
| 5 |
+
Oregon State University
|
| 6 |
+
Corvallis, OR 97331
|
| 7 |
+
{liju2,lif,sinisa}@oregonstate.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Strictly enforcing orthonormality constraints on parameter matrices has been shown advantageous in deep learning. This amounts to Riemannian optimization on the Stiefel manifold, which, however, is computationally expensive. To address this challenge, we present two main contributions: (1) A new efficient retraction map based on an iterative Cayley transform for optimization updates, and (2) An implicit vector transport mechanism based on the combination of a projection of the momentum and the Cayley transform on the Stiefel manifold. We specify two new optimization algorithms: Cayley SGD with momentum, and Cayley ADAM on the Stiefel manifold. Convergence of Cayley SGD is theoretically analyzed. Our experiments for CNN training demonstrate that both algorithms: (a) Use less running time per iteration relative to existing approaches that enforce orthonormality of CNN parameters; and (b) Achieve faster convergence rates than the baseline SGD and ADAM algorithms without compromising the performance of the CNN. Cayley SGD and Cayley ADAM are also shown to reduce the training time for optimizing the unitary transition matrices in RNNs.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Orthonormality has recently gained much interest, as there are significant advantages of enforcing orthonormality on parameter matrices of deep neural networks. For CNNs, Bansal et al. (2018) show that orthonormality constraints improve accuracy and gives a faster empirical convergence rate, Huang et al. (2018a) show that orthonormality stabilizes the distribution of neural activations in training, and Cogswell et al. (2015) show that orthonormality reduces overfitting and improves generalization. For RNNs, Arjovsky et al. (2016); Zhou et al. (2006) show that the orthogonal hidden-to-hidden matrix alleviates the vanishing and exploding-gradient problems.
|
| 16 |
+
|
| 17 |
+
Riemannian optimization on the Stiefel manifold, which represents the set of all orthonormal matrices of the same size, is an elegant framework for optimization under orthonormality constraints. But its high computational cost is limiting its applications, including in deep learning. Recent efficient approaches incorporate orthogonality in deep learning only for square parameter matrices (Arjovsky et al., 2016; Dorobantu et al., 2016), or indirectly through regularization (Bansal et al., 2018), which however does not guarantee the exact orthonormality of parameter matrices.
|
| 18 |
+
|
| 19 |
+
To address the aforementioned limitations, our first main contribution is an efficient estimation of the retraction mapping based on the Cayley transform for updating large non-square matrices of parameters on the Stiefel manifold. We specify an efficient iterative algorithm for estimating the Cayley transform that consists of only a few matrix multiplications, while the closed-form Cayley transform requires costly matrix inverse operations (Vorontsov et al., 2017; Wisdom et al., 2016). The efficiency of the retraction mapping is both theoretically proved and empirically verified in the paper.
|
| 20 |
+
|
| 21 |
+
Our second main contribution is aimed at improving convergence rates of training by taking into account the momentum in our optimization on the Stiefel manifold. We derive a new approach to move the tangent vector between tangent spaces of the manifold, instead of using the standard parallel transport. Specifically, we regard the Stiefel manifold as a submanifold of a Euclidean space. This allows for representing the vector transport (Absil et al., 2009) as a projection onto the tangent space. As we show, since the Cayley transform implicitly projects gradients onto the tangent space, the momentum updates result in an implicit vector transport. Thus, we first compute a linear combination of the momentum and the gradient in the Euclidean space, and then update the network parameters using the Cayley transform, without explicitly performing the vector transport.
|
| 22 |
+
|
| 23 |
+
We apply the above two contributions to generalize the standard SGD with momentum and ADAM (Kingma & Ba, 2014) to the Stiefel manifold, resulting in our two new optimization algorithms called Cayley SGD with momentum and Cayley ADAM. A theoretical analysis of the convergence of Cayley SGD is presented. Similar analysis for Cayley ADAM is omitted, since it is very similar to the analysis presented in (Becigneul & Ganea, 2019).
|
| 24 |
+
|
| 25 |
+
Cayley SGD and Cayley ADAM are empirically evaluated on image classification using VGG and Wide ResNet on the CIFAR-10 and CIFAR-100 datasets (Krizhevsky & Hinton, 2009). The experiments show that Cayley SGD and Cayley ADAM achieve better classification performance and faster convergence rate than the baseline SGD with momentum and ADAM. While the baselines take less time per epoch since they do not enforce the orthonormality constraint, they take more epochs until convergence than Cayley SGD and Cayley ADAM. In comparison with existing optimization methods that also account for orthonormality – e.g., Polar decomposition, QR decomposition, or closed-form Cayley transform – our Cayley SGD and Cayley ADAM run much faster and yield equally good or better performance in image classification.
|
| 26 |
+
|
| 27 |
+
Finally, we apply the aforementioned two contributions to training of the unitary RNNs. Wisdom et al. (2016) proposes the full capacity unitary RNN that updates the hidden-to-hidden transition matrix with the closed-form Cayley transform. In contrast, for our RNN training, we use the more efficient Cayley SGD with momentum and Cayley ADAM. The results show that our RNN training takes less running time per iteration without compromising performance.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
There is a host of literature on using orthonormality constraints in neural-network training. This section reviews closely related work, which can be broadly divided in two groups: orthonormality regularization and Riemannian optimization.
|
| 32 |
+
|
| 33 |
+
Regularization approaches can be divided as hard, which strictly enforce orthonormality, and soft. Hard regularizations are computationally expensive. For example, Huang et al. (2018b) extend Batch Normalization (Ioffe & Szegedy, 2015) with ZCA, and hence require costly eigenvalue decomposition. Huang et al. (2018a) derive a closed-form solution that also requires eigenvalue decomposition. Bansal et al. (2018); Cisse et al. (2017); Xiong et al. (2016) introduce mutual coherence regularization and spectral restricted isometry regularization; however, these regularizations are soft in that they can not guarantee orthonormality.
|
| 34 |
+
|
| 35 |
+
Riemannian optimization guarantees that the solution respects orthonormality constraints. For example, Cho & Lee (2017) replace Batch Normalization layers in a CNN with Riemannian optimization on the Grassmann manifold $G ( n , 1 )$ , where the parameters are normalized but not orthonormalized. Also, Vorontsov et al. (2017); Wisdom et al. (2016); Lezcano-Casado & Mart´ınez-Rubio (2019); Helfrich et al. (2017) perform Riemannian optimization on the group of unitary matrices to stablize RNNs training, but their technique cannot be applied to non-square parameter matrices. Becigneul & Ganea (2019) introduce a more general Riemannian optimization, but do not show how to efficiently perform this optimization on the Stiefel manifold.
|
| 36 |
+
|
| 37 |
+
The key challenge of Riemannian optimization is that exponential mapping — the standard step for estimating the next update point — is computationally expensive on the Stiefel manifold. Some methods use an efficient pseudo-geodesic retraction instead of the exponential mapping. For example, Absil & Malick (2012); Gawlik & Leok (2018); Manton (2002) use a projection-based method to map the gradient back to the Stiefel manifold that rely on computational expensive SVD. Other approaches are based on the closed-form Cayley transform (Fiori et al., 2012; Jiang & Dai, 2015; Nishimori & Akaho, 2005; Zhu, 2017), but require the costly matrix inversion. Also, Wen & Yin (2013) reduce the cost of the Cayley transform by making the restrictive assumption that the matrix size $n \times p$ is such that $2 p \ll n$ . Unfortunately, this algorithm is not efficient when $2 p \geq n$ .
|
| 38 |
+
|
| 39 |
+
# 3 PRELIMINARY
|
| 40 |
+
|
| 41 |
+
This section briefly reviews some well-known properties of the Riemannian and Stiefel manifolds.
|
| 42 |
+
The interested reader is referred to Boothby (1986); Edelman et al. (1998) and references therein.
|
| 43 |
+
|
| 44 |
+
# 3.1 RIEMANNIAN MANIFOLD
|
| 45 |
+
|
| 46 |
+
Definition 1. Riemannian Manifold: A Riemannian manifold $( \mathcal { M } , \rho )$ is a smooth manifold $\mathcal { M }$ equipped with a Riemannian metric $\rho$ defined as the inner product on the tangent space $T _ { x } { \mathcal { M } }$ for each point $x$ , $\rho _ { x } ( \cdot , \cdot ) : T _ { x } \mathcal { M } \times T _ { x } \mathcal { M } \mathbb { R }$ .
|
| 47 |
+
|
| 48 |
+
Definition 2. Geodesic, Exponential map and Retraction map: $A$ geodesic is a locally shortest curve on a manifold. An exponential map, $E x p _ { x } ( \cdot )$ , maps a tangent vector, $v \in T _ { x }$ , to a manifold, $\mathcal { M }$ . $E x p _ { x } ( t v )$ represents a geodesic $\gamma ( t ) : t \in [ 0 , 1 ]$ on a manifold, s.t. $\gamma ( 0 ) = x , \dot { \gamma } ( 0 ) = v$ . A retraction map is defined as a smooth mapping $R _ { x } : T _ { x } { \mathcal { M } } \to { \mathcal { M } }$ on a manifold iff $R _ { x } ( 0 ) = x$ and $D R _ { x } ( 0 ) = i d _ { T _ { x } , M }$ , where $D R _ { x }$ denotes the derivative of $R _ { x }$ , $i d _ { T _ { x } , M }$ denotes an identity map defined on $T _ { x } { \mathcal { M } }$ . It is easy to show that any exponential map is a retraction map. As computing an exponential map is usually expensive, a retraction map is often used as an efficient alternative.
|
| 49 |
+
|
| 50 |
+
Definition 3. Parallel transport and vector transport: Parallel transport is a method to translate a vector along a geodesic on a manifold while preserving norm. $A$ vector transport $\tau$ is a smooth map defined on a retraction $R$ of a manifold $\mathcal { M }$ , $\tau : T _ { x } \mathcal { M } \times T _ { x } \mathcal { M } \to T _ { R ( \eta _ { x } ) } , ( \eta _ { x } , \xi _ { x } ) \mapsto \tau _ { \eta _ { x } } ( \xi _ { x } )$ . $\tau$ satisfies the following properties: $( l )$ Underlying retraction: $\tau _ { \eta _ { x } } ( \xi _ { x } ) \in T _ { R ( \eta _ { x } ) }$ ; (2) Consistency: $\tau _ { 0 _ { x } } \xi _ { x } = \xi _ { x } , \forall \xi _ { x } \in T _ { x } \mathcal { M }$ ; (3) Linearity: $\begin{array} { r } { \tau _ { \eta _ { x } } ( a \xi _ { x } + b \zeta _ { x } ) = a \tau _ { \eta _ { x } } ( \xi _ { x } ) + b \tau _ { \eta _ { x } } ( \zeta _ { x } ) } \end{array}$ . Usually, a vector transport is a computationally efficient alternative to a parallel transport.
|
| 51 |
+
|
| 52 |
+
# 3.2 STIEFEL MANIFOLD
|
| 53 |
+
|
| 54 |
+
The Stiefel manifold $\operatorname { S t } ( n , p )$ , $n \geq p ,$ is a Riemannian manifold that is composed of all $n \times p$ orthonormal matrices $\{ X \in \mathbb { R } ^ { n \times p } : X ^ { T } X = I \}$ . In the rest of the paper, we will use notation $\mathcal { M } =$ $\operatorname { S t } ( n , p )$ to denote the Stiefel manifold. We regard $\mathcal { M }$ as an embeded submanifold of a Euclidean space. Hence, the Riemannian metric $\rho$ is the Euclidean metric as: $\rho _ { X } ( Z _ { 1 } , Z _ { 2 } ) = t r ( Z _ { 1 } ^ { \top } Z _ { 2 } )$ , where $Z _ { 1 } , Z _ { 2 }$ are tangent vectors in $T _ { X } { \mathcal { M } }$ . The tangent space of $\mathcal { M }$ at $X$ is defined as
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
T _ { X } { \mathcal { M } } = \{ Z : Z ^ { \top } X + X ^ { \top } Z = 0 \}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
The projection of a matrix $Z \in \mathbb { R } ^ { n \times p }$ to $T _ { X } { \mathcal { M } }$ can be computed as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { \quad \pi _ { T _ { X } } ( Z ) = W X } \\ { \mathrm { w h e r e : ~ } W = \hat { W } - \hat { W } ^ { \top } , \quad \hat { W } = Z X ^ { \top } - \cfrac { 1 } { 2 } X ( X ^ { \top } Z X ^ { \top } ) . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Given a derivative of the objective function $\nabla f ( X )$ at $X$ in the Euclidean space, we can compute the Riemannian gradient $\nabla _ { \boldsymbol { \mathcal { M } } } f ( \boldsymbol { \cal X } )$ on the Stiefel manifold as a projection onto $T _ { X } { \mathcal { M } }$ using $\overset { \vartriangle } { \pi } _ { T _ { X } } ( \boldsymbol { \nabla } f ( \boldsymbol { X } ) )$ given by Eq.(2). It follows that optimization of $f$ on the Riemannian manifold can be computed as follows. First, compute $\nabla _ { \boldsymbol { \mathcal { M } } } f ( \boldsymbol { \cal X } _ { t } )$ in $T _ { X } { \mathcal { M } }$ . Second, transport the momentum $M _ { t }$ to the current tangent space $T _ { X } { \mathcal { M } }$ and combine it linearly with the current Riemannian gradient $\nabla _ { \boldsymbol { \mathcal { M } } } f ( \boldsymbol { \cal X } _ { t } )$ to update the momentum $M _ { t + 1 }$ . Finally, third, update the new parameter $X _ { t + 1 }$ along a curve on the manifold with the initial direction as $M _ { t + 1 }$ .
|
| 67 |
+
|
| 68 |
+
While the exponential map and parallel transport can be used to update parameters and momentums in optimization on the Riemannian manifold, they are computationally infeasible on the Stiefel manifold. In the following section, we specify our computationally efficient alternatives.
|
| 69 |
+
|
| 70 |
+
# 3.2.1 PARAMETER UPDATES BY ITERATIVE CAYLEY TRANSFORM
|
| 71 |
+
|
| 72 |
+
The Cayley transform computes a parametric curve on the Stiefel manifold using a skew-symmetric matrix (Nishimori $\&$ Akaho, 2005). The closed-form of the Cayley transform is given by:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
Y ( \alpha ) = ( I - \frac { \alpha } { 2 } W ) ^ { - 1 } ( I + \frac { \alpha } { 2 } W ) X ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $W$ is a skew-symmetric matrix, i.e. $W ^ { \top } = - W$ , $X$ is on the Stiefel manifold, and $\alpha \geq 0$ is a parameter that represents the length on the curve. It is straightforward to verify that
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
Y ( 0 ) = X \quad a n d \quad Y ^ { ' } ( 0 ) = W X .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
From Definition 2 and the definition of the tangent space of the Stiefel manifold given by Eq.(1), the Cayley transform is a valid retraction map on the Stiefel manifold. By choosing $W = \hat { W } - \hat { W } ^ { \top }$ , where $\begin{array} { r } { \hat { W } = \nabla f ( X ) X ^ { \top } - \frac { 1 } { 2 } X ( X ^ { \top } \nabla f ( X ) X ^ { \top } ) } \end{array}$ as in Eq.(2), we see that the Cayley transform implicitly projects gradient on the tangent space as its initial direction. Therefore, the Cayley transform can represent an update for the parameter matrices on the Stiefel manifold.
|
| 85 |
+
|
| 86 |
+
However, the closed-form Cayley transform in Eq.(3) involves computing the expensive matrix inversion, which cannot be efficiently performed in large deep neural networks.
|
| 87 |
+
|
| 88 |
+
Our first contribution is an iterative estimation of the Cayley transform that efficiently uses only matrix multiplications, and thus is more efficient than the closed form in Eq.(3). We represent the Cayley transform with the following fixed-point iteration:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
Y ( \alpha ) = X + { \frac { \alpha } { 2 } } W \left( X + Y ( \alpha ) \right) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
which can be proved by moving $Y ( \alpha )$ on the right-hand side to the left-hand side in Eq.(3). The expression in Eq.(5) is an efficient approximation of Eq.(3). In Sec. 5, we will analyze its convergence rate to the closed-form Eq.(3).
|
| 95 |
+
|
| 96 |
+
# 3.2.2 MOMENTUM UPDATES BY THE IMPLICIT VECTOR TRANSPORT
|
| 97 |
+
|
| 98 |
+
Our second contribution is an efficient way to perform momentum updates on the Stiefel manifold. We specify an implicit vector transport by combining the Cayley transform and momentum updates in an elegant way without explicitly computing the vector transport. As the Stiefel manifold can be viewed as a submanifold of the Euclidean space $\mathbb { R }$ , we have a natural inclusion of the tangent space $T _ { X } { \mathcal { M } } \subset \mathbb { R }$ . Consequently, the vector transport on the Stiefel manifold is the projection on the tangent space. Formally, for two tangent vectors $\xi _ { X } , \eta _ { X } \in T _ { X } { \mathcal { M } }$ , the vector transport of $\xi _ { X }$ along a retraction map $r ( \eta _ { X } )$ , denoted as $\tau _ { \eta _ { X } } ( \xi _ { X } )$ , can be computed as:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\tau _ { \eta _ { X } } ( \xi _ { X } ) = \pi _ { T _ { r ( \eta _ { X } ) } } ( \xi _ { X } ) .
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
We specify the retraction map $r ( \cdot )$ as the Cayley transform $Y$ in Eq.(3). At optimization step $k$ , in Eq.(6), we choose $\xi _ { X } = \eta _ { X } = M _ { k }$ , where $M _ { k }$ is the momentum in step $k - 1$ . Then, we compute the vector transport of $M _ { k }$ as $\tau _ { M _ { k } } ( M _ { k } ) = \pi _ { T _ { X _ { k } } } ( M _ { k } )$ . As the projection onto a tangent space is a linear map, then $\begin{array} { r } { \alpha \tau _ { M _ { k } } ( M _ { k } ) + \beta \nabla _ { \boldsymbol { \mathcal { M } } } f ( \boldsymbol { X } _ { k } ) = \mathrm { \tilde { \alpha } } \pi _ { T _ { \boldsymbol { X } _ { k } } } ( M _ { k } ) + \beta \pi _ { T _ { \boldsymbol { X } _ { k } } } ( \nabla f ( \boldsymbol { X } _ { k } ) ) = \pi _ { T _ { \boldsymbol { X } _ { k } } } ( \alpha M _ { k } + \beta ) \tau _ { T _ { \boldsymbol { X } _ { k } } } ( \nabla f ( \boldsymbol { X } _ { k } ) ) . } \end{array}$ $\beta \nabla f ( X _ { k } ) )$ . Thus we first compute a linear combination of the Euclidean gradient $\nabla f ( X )$ and the momentum $M _ { k }$ , as in the Euclidean space, and then use the iterative Cayley transform to update the parameters, without explicitly estimating the vector transport, since the Cayley transform implicitly project a vector onto the tangent space.
|
| 105 |
+
|
| 106 |
+
# 4 ALGORITHMS
|
| 107 |
+
|
| 108 |
+
This section specifies our Cayley SGD and Cayley ADAM algorithms. Both represent our efficient Riemannian optimization on the Stiefel manifold that consists of two main steps. As the Cayley transform implicitly projects gradient and momentum vectors onto the tangent space, we first linearly combine the momentum of the previous iteration with the stochastic gradient of the objective function $f$ at the current point $X$ , denoted as $\mathcal G ( X )$ . Then, we use the iterative Cayley transform to estimate the next optimization point based on the updated momentum. This is used to generalize the conventional SGD with momentum and ADAM algorithms to our two new Riemannian optimizations on the Stiefel manifold, as described in Section 4.1 and Section 4.2.
|
| 109 |
+
|
| 110 |
+
# Algorithm 1 Cayley SGD with Momentum
|
| 111 |
+
|
| 112 |
+
1: Input: learning rate $l$ , momentum coefficient $\beta$ , $\epsilon { = } 1 0 ^ { - 8 }$ , $q = 0 . 5$ , $s = 2$ .
|
| 113 |
+
2: Initialize $X _ { 1 }$ as an orthonormal matrix; and $M _ { 1 } = 0$
|
| 114 |
+
3: for $k = 0$ to $T$ do
|
| 115 |
+
4: Mk+1 ← βMk − G(Xk), . Update the momentum
|
| 116 |
+
5: $\begin{array} { r } { \hat { W _ { k } } \gets M _ { k + 1 } X _ { k } ^ { \top } - \frac { 1 } { 2 } X _ { k } ( X _ { k } ^ { \top } M _ { k + 1 } X _ { k } ^ { \top } ) } \end{array}$ . Compute the auxiliary matrix
|
| 117 |
+
6: Wk ← Wˆk − Wˆ>k
|
| 118 |
+
7: Mk+1 ← WkXk. . Project momentum onto the tangent space
|
| 119 |
+
8: $\alpha \operatorname* { m i n } \{ l , 2 q / ( \| W _ { k } \| + \epsilon ) \}$ . Select adaptive learning rate for contraction mapping
|
| 120 |
+
9: Initialize $Y ^ { 0 } \gets X + \alpha M _ { k + 1 }$ . Iterative estimation of the Cayley Transform
|
| 121 |
+
10: for i = 1 to s do
|
| 122 |
+
11: Y i ← Xk + α Wk(Xk + Y i−1)
|
| 123 |
+
2
|
| 124 |
+
12: Update $X _ { k + 1 } Y ^ { s }$
|
| 125 |
+
|
| 126 |
+
# Algorithm 2 Cayley ADAM
|
| 127 |
+
|
| 128 |
+
1: Input: learning rate $l$ , momentum coefficients $\beta _ { 1 }$ and $\beta _ { 2 }$ , $\epsilon = { 1 0 } ^ { - 8 }$ , $q = 0 . 5$ , $s = 2$ .
|
| 129 |
+
2: Initialize $X _ { 1 }$ as an orthonormal matrix. $M _ { 1 } = 0$ , $v _ { 1 } = 1$
|
| 130 |
+
3: for $k = 0$ to $T$ do
|
| 131 |
+
4: Mk+1 ← β1Mk + (1 − β1)G(Xk) . Estimate biased momentum
|
| 132 |
+
5: vk+1 ← β2vk + (1 − β2)kG(Xk)k2
|
| 133 |
+
6: vˆk+1 ← vk+1/(1 − βk2 ) . Update biased second raw moment estimate
|
| 134 |
+
7: r ← (1 − βk1 )pvkˆ+1 + . Estimate biased-corrected ratio
|
| 135 |
+
8: Wˆ k ← Mk+1X>k − 12 Xk(X>k Mk+1X>k ) . Compute the auxiliary skew-symmetric matrix
|
| 136 |
+
9: Wk ← (Wˆ k − Wˆ >k )/r
|
| 137 |
+
10: Mk+1 ← rWkXk . Project momentum onto the tangent space
|
| 138 |
+
11: α ← min{l, 2q/(kWkk + )} . Select adaptive learning rate for contraction mapping
|
| 139 |
+
12: Initialize $Y ^ { 0 } \gets X _ { k } - \alpha M _ { k + 1 }$ . Iterative estimation of the Cayley Transform
|
| 140 |
+
13: for i = 1 to s do
|
| 141 |
+
14: Y i ← Xk − α W (Xk + Y i−1)
|
| 142 |
+
15: Update $X _ { k + 1 } Y ^ { s }$
|
| 143 |
+
|
| 144 |
+
# 4.1 CAYLEY SGD WITH MOMENTUM
|
| 145 |
+
|
| 146 |
+
We generalize the heavy ball (HB) momentum update (Ghadimi et al., 2015; Zavriev & Kostyuk, 1993) in the $k$ th optimization step1 to the Stiefel manifold. Theoretically, it can be represented as:
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
M _ { k + 1 } = \beta \pi _ { \mathcal T _ { k } } ( M _ { k } ) - \mathcal G _ { \mathcal M } ( X _ { k } ) , \quad X _ { k + 1 } = Y ( \alpha , X _ { k } , W _ { k } )
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
where $Y ( \alpha , X _ { k } , W _ { k } )$ is a curve that starts at $X _ { k }$ with length $\alpha$ on the Stiefel manifold, specified by the Cayley transform in Eq.(3). In practice, we efficiently perform the updates in Eq.(7) by the proposed iterative Cayley transform and implicit vector transport on the Stiefel manifold. Specially, we first update the momentum as if it were in the Euclidean space. Then, we update the new parameters by iterative Cayley transform. Finally, we correct the momentum $M _ { k + 1 }$ by projecting it to $T _ { X _ { k } } { \mathcal { M } }$ . The details of our Cayley SGD algorithm are shown in Alg. 1.
|
| 153 |
+
|
| 154 |
+
# 4.2 ADAM ON THE STIEFEL MANIFOLD
|
| 155 |
+
|
| 156 |
+
ADAM is a recent first-order optimization method for stochastic objective functions. It estimates adaptive lower-order moments and uses adaptive learning rate. The algorithm is designed to combine the advantages of both AdaGrad, which performs well in sparse-gradient cases, and RMSProp, which performs well in non-stationary cases.
|
| 157 |
+
|
| 158 |
+
We generalize ADAM to the Stiefel manifold by making three modifications to the vanilla ADAM. First, we replace the standard gradient and momentum with the corresponding ones on the Stiefel manifold, as described in Section 4.1. Second, we use a manifold-wise adaptive learning rate that assign a same learning rate for all entries in a parameter matrix as in (Absil et al., 2009). Third, we use the Cayley transform to update the parameters. Cayley ADAM is summarized in Alg 2.
|
| 159 |
+
|
| 160 |
+
# 5 CONVERGENCE ANALYSIS
|
| 161 |
+
|
| 162 |
+
In this section, we analyze convergence of the iterative Cayley transform and Cayley SGD with momentum. To facilitate our analysis, we make the following common assumption.
|
| 163 |
+
|
| 164 |
+
Assumption 1. The gradient $\nabla f$ of the objective function $f$ is Lipschitz continuous
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r } { \| \nabla f ( X ) - \nabla f ( Y ) \| \leq L \| X - Y \| , \quad \forall X , Y , w h e r e L > 0 i s a c o n s t a n t . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
Lipschitz continity is widely applicable to deep learning architectures. For some models using ReLU, the derivative of ReLU is Lipschitz continuous almost everywhere with an appropriate Lipschitz constant $L$ in Assumption 1 , except for a small neighbourhood around 0, whose measure tends to 0. Such cases do not affect either analysis in theory or training in practice.
|
| 171 |
+
|
| 172 |
+
The above assumption allows proving the following contraction mapping theorem.
|
| 173 |
+
|
| 174 |
+
Theorem 1. For $\alpha \in ( 0 , \operatorname* { m i n } \{ 1 , \frac 2 { \| W \| } \} )$ , the iteration $\begin{array} { r } { Y ^ { i + 1 } = X + \frac { \alpha } { 2 } W \left( X + Y ^ { i } \right) } \end{array}$ is a contraction mapping and converges to the closed-form Cayley transform $Y ( \alpha )$ given by Eq.(3). Specifically, at iteration $i$ , $| | Y ^ { i } - Y ( \alpha ) | | = o ( \alpha ^ { 2 + i } )$ .
|
| 175 |
+
|
| 176 |
+
Theorem 1 shows the iterative Cayley transform will converge. Specially, it converges faster than other approximation algorithms, such as, e.g., the Newton iterative and Neumann Series which achieves error bound $o ( \hat { \alpha } ^ { i } )$ at the $i ^ { t h }$ iteration. We further prove the following result on convergence:
|
| 177 |
+
|
| 178 |
+
Theorem 2. Given an objective function $f ( X )$ that satisfies Assumption $I$ , let Cayley SGD with momentum run for $t$ iterations with $\mathcal { G } ( X _ { k } )$ . For $\begin{array} { r } { \alpha = \operatorname* { m i n } \{ \frac { 1 - \beta } { L } , \frac { A } { \sqrt { t + 1 } } \} } \end{array}$ , where $A$ is a positive constant, we have: $\begin{array} { r } { \operatorname* { m i n } _ { k = 0 , \cdots , t } E [ \| \nabla _ { \mathcal { M } } f ( X _ { k } ) \| ^ { 2 } ] = o ( \frac { 1 } { \sqrt { t + 1 } } ) 0 , \dot { a } s t \infty . } \end{array}$ .
|
| 179 |
+
|
| 180 |
+
The proofs of Theorem 1 and Theorem 2 are presented in the appendix.
|
| 181 |
+
|
| 182 |
+
# 6 EXPERIMENTS
|
| 183 |
+
|
| 184 |
+
# 6.1 ORTHONORMALITY IN CNNS
|
| 185 |
+
|
| 186 |
+
In CNNs, for a convolutional layer with kernel $\hat { K } \in \mathbb { R } ^ { c _ { o u t } \times c _ { i n } \times h \times w }$ , we first reshape $\hat { K }$ into a matrix $K$ of size $p \times n$ , where $p = c _ { o u t }$ , $n = c _ { i n } \times h \times w$ . In most cases, we have $p \leq n$ . Then, we restrict the matrix $K$ on the Stiefel manifold using Cayley SGD or Cayley ADAM, while other parameters are optimized with SGD and ADAM.
|
| 187 |
+
|
| 188 |
+
Datasets: We evaluate Cayley SGD or Cayley ADAM in image classification on the CIFAR10 and CIFAR100 datasets (Krizhevsky & Hinton, 2009). CIFAR10 and CIFAR100 consist of of 50,000 training images and 10,000 test images, and have 10 and 100 mutually exclusive classes.
|
| 189 |
+
|
| 190 |
+
Models: We use two networks — VGG (Simonyan & Zisserman, 2014) and Wide ResNet (Zagoruyko & Komodakis, 2016) — that obtain state of the art performance on CIFAR10 and CIFAR100. For VGG, every convolutional layer is followed by a batch normalization layer and a ReLU. For Wide ResNet, we use basic blocks, where two consecutive 3-by-3 convolutional layers are followed by the batch normalization and ReLU activation, respectively.
|
| 191 |
+
|
| 192 |
+
Training Strategies: We use different learning rates $l _ { e }$ and $l _ { s t }$ for weights on the Euclidean space and the Stiefel manifold, respectively. We set the weight decay as 0.0005, momentum as 0.9, and minibatch size as 128. The initial learning rates are set as $l _ { e } = 0 . 0 1$ and $l _ { s t } = 0 . 2$ for Cayley SGD and $l _ { e } = 0 . 0 1$ and $l _ { s t } = 0 . 4$ for Cayley ADAM. During training, we reduce the learning rates by a factor of 0.2 at 60, 120, and 160 epochs. The total number of epochs in training is 200. In training, the data samples are normalized using the mean and variance of the training set, and augmented by randomly flipping training images.
|
| 193 |
+
|
| 194 |
+
Our baselines include SGD with momentum and ADAM. We follow the same training strategies as mentioned above, except for the initial learning rates set to 0.1 and 0.001, respectively.
|
| 195 |
+
|
| 196 |
+
Table 1: Classification errors $( \% )$ on CIFAR10.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>METHOD</td><td>VGG-13</td><td>VGG-16</td><td>VGG-19</td><td>WRN 52-1</td><td>WRN 16-4</td><td>WRN 28-10</td></tr><tr><td>SGD</td><td>5.88</td><td>6.32</td><td>6.49</td><td>6.23</td><td>4.96</td><td>3.89</td></tr><tr><td>ADAM</td><td>6.43</td><td>6.61</td><td>6.92</td><td>6.77</td><td>5.32</td><td>3.86</td></tr><tr><td>CAYLEY SGD</td><td>5.90</td><td>5.77</td><td>5.85</td><td>6.35</td><td>5.15</td><td>3.66</td></tr><tr><td>CAYLEY ADAM</td><td>5.93</td><td>5.88</td><td>6.03</td><td>6.44</td><td>5.22</td><td>3.57</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 2: Classification errors $( \% )$ on CIFAR100.
|
| 201 |
+
|
| 202 |
+
<table><tr><td>METHOD</td><td>VGG-13</td><td>VGG-16</td><td>VGG-19</td><td>WRN 52-1</td><td>WRN 16-4</td><td>WRN 28-10</td></tr><tr><td>SGD</td><td>26.17</td><td>26.84</td><td>27.62</td><td>27.44</td><td>23.41</td><td>18.66</td></tr><tr><td>ADAM</td><td>26.58</td><td>27.10</td><td>27.88</td><td>27.89</td><td>24.45</td><td>18.45</td></tr><tr><td>CAYLEY SGD</td><td>24.86</td><td>25.48</td><td>25.68</td><td>27.64</td><td>23.71</td><td>18.26</td></tr><tr><td>CAYLEY ADAM</td><td>25.10</td><td>25.61</td><td>25.70</td><td>27.91</td><td>24.18</td><td>18.10</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Performance: Table 1 and Table 2 show classification errors on CIFAR10 and CIFAR100 respectively using different optimization algorithms. As shown in the tables, the proposed two algorithms achieve competitive performance, and for certain deep architectures, the best performance. Specifically, the network WRN-28-10 trained with Cayley ADAM achieves the best error rate of ${ \bar { 3 } } . { 5 } 7 \%$ and $1 8 . 1 0 \%$ on CIFAR10 and CIFAR100 respectively. Fig. 1 compares training curves of our algorithms and baselines in terms of epochs, and shows that both Cayley SGD and Cayley ADAM converge faster than the baselines. In particular, the training curves of the baselines tend to get stuck in a plateau before the learning rate drops, which is not the case with our algorithms. This might be because the baselines do not enforce orthonormality of network parameters. In training, the backpropagation of orthonormal weight vectors, in general, does not affect each other, and thus has greater chances to explore new parameter regions. Fig. 2 also compares the training loss curve in terms of time. Our Cayley SGD and Cayley ADAM converge the fastest among methods that also address orthonormality. Although the baselines SGD and ADAM converge faster at the beginning due to their training efficiency, our Cayley SGD and Cayley ADAM can catch up with the baseline after 12000 seconds, which corresponds to the 120th epoch of SGD and ADAM, and the 60th epoch of Cayley SGD and Cayley ADAM.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 1: Training loss curves of different optimization algorithms for WRN-28-10 for epoach 40- 200. (a) Results on CIFAR10. (b) Results on CIFAR100. Both figures show that our Cayley SGD and Cayley ADAM achieve the top two fastest convergence rates.
|
| 208 |
+
|
| 209 |
+
Comparison with State of the Art. We compare the proposed algorithms with two sets of state of the art. The first set of approaches are soft orthonormality regularization approaches (Bansal et al., 2018). Specially, for a weight matrix $K \in \mathbb { R } ^ { n \times p }$ , SO penalizes $| | K K ^ { \top } - I | | _ { F } ^ { 2 }$ , DSO penalizes $( | | K K ^ { \top } - I | | _ { F } ^ { 2 } + | | K ^ { \top } K - I | | _ { F } ^ { 2 } )$ , the SRIP penalizes the spectral norm of $( K K ^ { \top } - I )$ . The second set of approaches includes the following hard orthonormality methods: Polar decomposition(Absil et al., 2009), QR decomposition(Absil et al., 2009), closed-form Cayley transform, Wen&Yin (Wen & Yin, 2013), OMDSM(Huang et al., 2018a), DBN(Huang et al., 2018b). Note that we do not include momentum in Polar decomposition and QR decomposition as previous work does not specify the momentum. Also, we use the closed-form Cayley transform without momentum as an ablation study of the momentum effect. All experiments are evaluated on the benchmark network WRN28-10. Table 3 shows that our algorithms achieve comparable error rates with state of the art. All algorithms are run on one TITAN Xp GPU, and their average training time are compared per epoch. Table 3 shows that our algorithms run much faster than existing algorithms, except for the baseline SGD and ADAM which do not impose orthonormality constraints.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 2: Training loss curves of different optimization algorithms for WRN-28-10 in terms of seconds. (a) Results on CIFAR10. (b) Results on CIFAR100.
|
| 213 |
+
|
| 214 |
+
# 6.2 ORTHONORMALITY IN RNNS
|
| 215 |
+
|
| 216 |
+
In RNNs, the hidden-to-hidden transition matrix $K$ can be modeled as a unitary matrix (Arjovsky et al., 2016). Wisdom et al. (2016) model the hidden-to-hidden transition matrix as a full-capacity unitary matrix on the complex Stiefel manifold: $\mathsf { S t } ( \mathbb { C } ^ { N } ) = \{ K \in \mathbb { C } ^ { N \times N } : K ^ { H } K = I \}$ .
|
| 217 |
+
|
| 218 |
+
Pixel-by-pixel MNIST: We evaluate the proposed algorithms on the challenging pixel-by-pixel MNIST task for long-term memory. The task was used to test the capacity of uRNNs (Arjovsky et al., 2016; Wisdom et al., 2016). Following the same setting as in Wisdom et al. (2016), we reshape MNIST images of $2 8 \times 2 8$ pixels to a $T = 7 8 4$ pixel-by-pixel sequences, and select 5,000 out of the 60,000 training examples for the early stopping validation.
|
| 219 |
+
|
| 220 |
+
Training: Wisdom et al. (2016) restricted the transition unitary matrix on the Stiefel manifold via a closed-form Cayley transform. On the contrary, we use Cayley SGD with momentum and Cayley ADAM to reduce the training time. Table 4 shows that the proposed algorithms reduce the training time by about $3 5 \%$ for all settings of the network, while maintaining the same level of accuracy. All experiments are performed on one TITAN $\mathrm { X p }$ GPU.
|
| 221 |
+
|
| 222 |
+
Table 3: Error rate and training time per epoch comparison to baselines with WRN-28-10 on CIFAR10 and CIFAR100. All experiments are performed on one TITAN Xp GPU.
|
| 223 |
+
|
| 224 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2"></td><td colspan="2">Error Rate(%)</td><td rowspan="2">Training time(s)</td></tr><tr><td>CIFAR10</td><td>CIFAR100</td></tr><tr><td rowspan="2">Baselines</td><td>SGD</td><td>3.89</td><td>18.66</td><td>102.5</td></tr><tr><td>ADAM</td><td>3.85</td><td>18.52</td><td>115.2</td></tr><tr><td rowspan="3">Soft orthonormality</td><td>SO (Bansal et al., 2018)</td><td>3.76</td><td>18.56</td><td>297.3</td></tr><tr><td>DSO (Bansal et al.,2018)</td><td>3.86</td><td>18.21</td><td>311.0</td></tr><tr><td>SRIP (Bansal et al., 2018)</td><td>3.60</td><td>18.19</td><td>321.8</td></tr><tr><td rowspan="8">Hard orthonormality</td><td>OMDSM(Huang et al.,2018a)</td><td>3.73</td><td>18.61</td><td>943.6</td></tr><tr><td>DBN (Huang et al., 2018b)</td><td>3.79</td><td>18.36</td><td>889.4</td></tr><tr><td>Polar(Absil et al.,2009)</td><td>3.75</td><td>18.50</td><td>976.5</td></tr><tr><td>QR (Absil et al., 2009)</td><td>3.75</td><td>18.65</td><td>469.3</td></tr><tr><td>Wen&Yin(Wen& Yin,2013)</td><td>3.82</td><td>18.70</td><td>305.8</td></tr><tr><td>Cayley closed form w/o momentum</td><td>3.80</td><td>18.68</td><td>1071.5</td></tr><tr><td>Cayley SGD (Ours)</td><td>3.66</td><td>18.26</td><td>218.7</td></tr><tr><td>Cayley ADAM (Ours)</td><td>3.57</td><td>18.10</td><td>224.4</td></tr></table>
|
| 225 |
+
|
| 226 |
+
Table 4: Pixel-by-pixel MNIST accuracy and training time per iteration of the closed-form Cayley Transform, Cayley SGD, and Cayley ADAM for Full-uRNNs (Wisdom et al., 2016). All experiments are performed on one TITAN Xp GPU.
|
| 227 |
+
|
| 228 |
+
<table><tr><td></td><td></td><td colspan="2">Closed-Form</td><td colspan="2">Cayley SGD</td><td colspan="2">Cayley ADAM</td></tr><tr><td>Model</td><td>Hidden Size</td><td>Acc(%)</td><td>Time(s)</td><td>Acc(%)</td><td>Time(s)</td><td>Acc(%)</td><td>Time(s)</td></tr><tr><td>Full-uRNN</td><td>116</td><td>92.8</td><td>2.10</td><td>92.6</td><td>1.42</td><td>92.7</td><td>1.50</td></tr><tr><td>Full-uRNN</td><td>512</td><td>96.9</td><td>2.44</td><td>96.7</td><td>1.67</td><td>96.9</td><td>1.74</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Checking Unitariness: To show that the proposed algorithms are valid optimization algorithms on the Stiefel manifold, we check the unitariness of the hidden-to-hidden matrix $K$ by computing the error term $| | K ^ { H } K - I | | _ { F }$ during training. Table 5 compares average errors for varying numbers of iterations $s$ . As can be seen, the iterative Cayley transform can approximate the unitary matrix when $s = 2$ . The iterative Cayley transform performs even better than the closed form Cayley transform, which might be an effect of the rounding error of the matrix inversion as in Eq.(3).
|
| 231 |
+
|
| 232 |
+
Table 5: Checking unitariness by computing the error $| | K ^ { H } K - I | | _ { F }$ for varying numbers of iterations in the iterative Cayley transform and the closed-form Cayley transform.
|
| 233 |
+
|
| 234 |
+
<table><tr><td>Hidden Size</td><td>s=0</td><td>s=1</td><td>s=2</td><td>s=3</td><td>s=4</td><td>Closed-form</td></tr><tr><td>n=116</td><td>3.231e-3</td><td>2.852e-4</td><td>7.384e-6</td><td>7.353e-6</td><td>7.338e-6</td><td>8.273e-5</td></tr><tr><td>n=512</td><td>6.787e-3</td><td>5.557e-4</td><td>2.562e-5</td><td>2.547e-5</td><td>2.544e-5</td><td>3.845e-5</td></tr></table>
|
| 235 |
+
|
| 236 |
+
# 7 CONCLUSION
|
| 237 |
+
|
| 238 |
+
We proposed an efficient way to enforce the exact orthonormal constraints on parameters by optimization on the Stiefel manifold. The iterative Cayley transform was applied to the conventional SGD and ADAM for specifying two new algorithms: Cayley SGD with momentum and Cayley ADAM, and the theoretical analysis of convergence of the former. Experiments show that both algorithms achieve comparable performance and faster convergence over the baseline SGD and ADAM in training of the standard VGG and ResNet on CIFAR10 and CIFAR100, as well as RNNs on the pixel-by-pixel MNIST task. Both Cayley SGD with momentum and Cayley ADAM take less runtime per iteration than all existing hard orthonormal methods and soft orthonormal methods, and can be applied to non-square parameter matrices.
|
| 239 |
+
|
| 240 |
+
# ACKNOWLEDGEMENTS
|
| 241 |
+
|
| 242 |
+
This work was supported in part by NSF grant IIS-1911232, DARPA XAI Award N66001-17-2-4029 and AFRL STTR AF18B-T002.
|
| 243 |
+
|
| 244 |
+
# REFERENCES
|
| 245 |
+
|
| 246 |
+
P-A Absil and Jer´ ome Malick. Projection-like retractions on matrix manifolds. ˆ SIAM Journal on Optimization, 22(1):135–158, 2012.
|
| 247 |
+
|
| 248 |
+
P-A Absil, Robert Mahony, and Rodolphe Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2009.
|
| 249 |
+
|
| 250 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pp. 1120–1128, 2016.
|
| 251 |
+
|
| 252 |
+
Nitin Bansal, Xiaohan Chen, and Zhangyang Wang. Can we gain more from orthogonality regularizations in training deep cnns? arXiv preprint arXiv:1810.09102, 2018.
|
| 253 |
+
|
| 254 |
+
Gary Becigneul and Octavian-Eugen Ganea. Riemannian adaptive optimization methods. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ . } = { }$ r1eiqi09K7.
|
| 255 |
+
|
| 256 |
+
William M Boothby. An introduction to differentiable manifolds and Riemannian geometry, volume 120. Academic press, 1986.
|
| 257 |
+
|
| 258 |
+
Minhyung Cho and Jaehyung Lee. Riemannian approach to batch normalization. In Advances in Neural Information Processing Systems, pp. 5225–5235, 2017.
|
| 259 |
+
|
| 260 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 854–863. JMLR. org, 2017.
|
| 261 |
+
|
| 262 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. arXiv preprint arXiv:1511.06068, 2015.
|
| 263 |
+
|
| 264 |
+
Victor Dorobantu, Per Andre Stromhaug, and Jess Renteria. Dizzyrnn: Reparameterizing recurrent neural networks for norm-preserving backpropagation. arXiv preprint arXiv:1612.04035, 2016.
|
| 265 |
+
|
| 266 |
+
Alan Edelman, Tomas A Arias, and Steven T Smith. The geometry of algorithms with orthogonality´ constraints. SIAM journal on Matrix Analysis and Applications, 20(2):303–353, 1998.
|
| 267 |
+
|
| 268 |
+
Simone Fiori, Tetsuya Kaneko, and Toshihisa Tanaka. Learning on the compact stiefel manifold by a cayley-transform-based pseudo-retraction map. In The 2012 International Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2012.
|
| 269 |
+
|
| 270 |
+
Evan S Gawlik and Melvin Leok. High-order retractions on matrix manifolds using projected polynomials. SIAM Journal on Matrix Analysis and Applications, 39(2):801–828, 2018.
|
| 271 |
+
|
| 272 |
+
Euhanna Ghadimi, Hamid Reza Feyzmahdavian, and Mikael Johansson. Global convergence of the heavy-ball method for convex optimization. In Control Conference (ECC), 2015 European, pp. 310–315. IEEE, 2015.
|
| 273 |
+
|
| 274 |
+
Kyle Helfrich, Devin Willmott, and Qiang Ye. Orthogonal recurrent neural networks with scaled cayley transform. arXiv preprint arXiv:1707.09520, 2017.
|
| 275 |
+
|
| 276 |
+
Lei Huang, Xianglong Liu, Bo Lang, Adams Wei Yu, Yongliang Wang, and Bo Li. Orthogonal weight normalization: Solution to optimization over multiple dependent Stiefel manifolds in deep neural networks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
|
| 277 |
+
|
| 278 |
+
Lei Huang, Dawei Yang, Bo Lang, and Jia Deng. Decorrelated batch normalization. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018b.
|
| 279 |
+
|
| 280 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. 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. 448–456, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings. mlr.press/v37/ioffe15.html.
|
| 281 |
+
|
| 282 |
+
Bo Jiang and Yu-Hong Dai. A framework of constraint preserving update schemes for optimization on stiefel manifold. Mathematical Programming, 153(2):535–575, 2015.
|
| 283 |
+
|
| 284 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 285 |
+
|
| 286 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 287 |
+
|
| 288 |
+
Mario Lezcano-Casado and David Mart´ınez-Rubio. Cheap orthogonal constraints in neural networks: A simple parametrization of the orthogonal and unitary group. arXiv preprint arXiv:1901.08428, 2019.
|
| 289 |
+
|
| 290 |
+
Jonathan H Manton. Optimization algorithms exploiting unitary constraints. IEEE Transactions on Signal Processing, 50(3):635–650, 2002.
|
| 291 |
+
|
| 292 |
+
Yasunori Nishimori and Shotaro Akaho. Learning algorithms utilizing quasi-geodesic flows on the stiefel manifold. Neurocomputing, 67:106–135, 2005.
|
| 293 |
+
|
| 294 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 295 |
+
|
| 296 |
+
Eugene Vorontsov, Chiheb Trabelsi, Samuel Kadoury, and Chris Pal. On orthogonality and learning recurrent networks with long term dependencies. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3570–3578. JMLR. org, 2017.
|
| 297 |
+
|
| 298 |
+
Zaiwen Wen and Wotao Yin. A feasible method for optimization with orthogonality constraints. Mathematical Programming, 142(1-2):397–434, 2013.
|
| 299 |
+
|
| 300 |
+
Scott Wisdom, Thomas Powers, John Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 4880–4888, 2016.
|
| 301 |
+
|
| 302 |
+
Wei Xiong, Bo Du, Lefei Zhang, Ruimin Hu, and Dacheng Tao. Regularizing deep convolutional neural networks with a structured decorrelation constraint. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pp. 519–528. IEEE, 2016.
|
| 303 |
+
|
| 304 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 305 |
+
|
| 306 |
+
SK Zavriev and FV Kostyuk. Heavy-ball method in nonconvex optimization problems. Computational Mathematics and Modeling, 4(4):336–341, 1993.
|
| 307 |
+
|
| 308 |
+
Jianping Zhou, Minh N. Do, and Jelena Kovacevic. Special paraunitary matrices, Cayley transform, and multidi- mensional orthogonal filter banks. IEEE Trans. Image Processing, 15(2):511–519, 2006.
|
| 309 |
+
|
| 310 |
+
Xiaojing Zhu. A riemannian conjugate gradient method for optimization on the stiefel manifold. Computational Optimization and Applications, 67(1):73–110, 2017.
|
| 311 |
+
|
| 312 |
+
# A PRELIMINARY
|
| 313 |
+
|
| 314 |
+
In this section, we derive some properties of the Stiefel manifold in this section to facilitate the proofs of Theorem 1 and Theorem 2 in the main paper.
|
| 315 |
+
|
| 316 |
+
Considering the Stiefel manifold $\mathcal { M }$ is a bounded set and Lipschitz Assumption 1 on the gradient in Sec. 5, one straightforward conclusion is that both $\nabla f ( X )$ and its Stiefel manifold gradient $\nabla _ { \boldsymbol { \mathcal { M } } } f ( \boldsymbol { \cal X } )$ that is a projection onto the tangent space are bounded. Formally, there exists a positive constant $G$ , such that
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
| | \nabla _ { \mathcal { M } } f ( X ) | | \leq | | \nabla f ( X ) | | \leq G , \forall X \in \mathcal { M }
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
As stochastic gradient $\mathcal { G } ( X ) = \mathcal { G } ( X ; \xi )$ is the gradient of a sub-dataset, where $\xi$ is a stochastic variable for data samples and we are working are a finite dataset, it’s straightforward to show that $\mathcal G ( X )$ and its Riemannian stochastic gradient ${ \mathcal { G } } _ { { \mathcal { M } } } ( X )$ are also bounded. For brevity, we still use the same upper bound $G$ , such that:
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
| | \mathcal { G } _ { \mathcal { M } } ( X ) | | \leq | | \mathcal { G } ( X ) | | \leq G , \forall X \in \mathcal { M }
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
Recall the recursion in Eq.(7), we show that the momentum is also bounded:
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { l } { \displaystyle | | M _ { k + 1 } | | \leq \beta | | M _ { k } | | + | | \mathcal { G } _ { \mathcal { M } } ( X _ { k } ) | | } \\ { \displaystyle \leq \sum _ { i = 0 } ^ { k } \beta ^ { k - i } | | \mathcal { G } _ { \mathcal { M } } ( X _ { i } ) | | } \\ { \displaystyle \leq \frac { 1 } { 1 - \beta } G } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Therefore, we know that $W _ { k }$ in Eq.(7) is bounded.
|
| 335 |
+
|
| 336 |
+
# B PROOF OF THEOREM 1
|
| 337 |
+
|
| 338 |
+
Proof. By subtracting the iterative relationship Eq.(5) by its $i ^ { t h }$ iteration $\begin{array} { r c l } { { Y ^ { i + 1 } } } & { { = } } & { { X \ + } } \end{array}$ $\scriptstyle { \frac { \alpha } { 2 } } W \left( X + Y ^ { i } \right)$ , we have:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
| | Y ^ { i + 1 } - Y ( \alpha ) | | \leq \frac { \alpha | | W | | } { 2 } | | Y ^ { i } - Y ( \alpha ) | |
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Therefore, since $W$ is bounded, for $\alpha < { \frac { 2 } { \| W \| } }$ , such that $\begin{array} { r } { \frac { \alpha \| W \| } { 2 } < 1 } \end{array}$ , the iteration in Eq.(5) is a contraction mapping, and it will converge to the closed-from solution $Y ( \alpha )$ .
|
| 345 |
+
|
| 346 |
+
By differentiate Eq.(5), we have:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { l } { \displaystyle \frac { d Y ( \alpha ) } { d \alpha } = W ( \frac { X + Y ( \alpha ) } { 2 } ) + \frac { \alpha } { 2 } W \frac { d Y ( \alpha ) } { d \alpha } } \\ { \displaystyle \frac { d ^ { 2 } Y ( \alpha ) } { d \alpha ^ { 2 } } = ( I - \frac { \alpha } { 2 } W ) ^ { - 1 } W \frac { d Y ( \alpha ) } { d \alpha } } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
therefore, $\frac { d Y ( \alpha ) } { d \alpha }$ and $\frac { d ^ { 2 } Y ( \alpha ) } { d \alpha ^ { 2 } }$ are bounded, i.e. there exist a positive constant $C$ , such that:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\vert \vert \frac { d ^ { 2 } Y ( \alpha ) } { d \alpha ^ { 2 } } \vert \vert \leq C
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Using the Taylor expansion of $Y$ in Eq.(3), we have:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
Y ( \alpha ) = X _ { k } + \alpha M _ { k + 1 } + { \frac { 1 } { 2 } } \alpha ^ { 2 } { \frac { d ^ { 2 } Y ( \gamma _ { k } \alpha ) } { d \alpha ^ { 2 } } }
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
where $\gamma _ { k } \in ( 0 , 1 )$ . Given $Y ^ { 0 } = X _ { k } + \alpha M _ { k + 1 }$ , we have:
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
| | Y ^ { 0 } - Y ( \alpha ) | | = o ( \alpha ^ { 2 } )
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
Since $W$ is bounded and $\frac { \alpha | | W | | } { 2 } < 1$ , then,
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
| | Y ^ { i } - Y ( \alpha ) | | \leq ( { \frac { \alpha | | W | | } { 2 } } ) ^ { i } | | Y ^ { 0 } - Y ( \alpha ) | | = o ( \alpha ^ { 2 + i } )
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
# C PROOF OF THEOREM 2
|
| 377 |
+
|
| 378 |
+
Proof. Use Taylor expansion of $Y ( \alpha )$ , the process of Cayley SGD with momentum Eq.(7) can be written as:
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\begin{array} { l } { { M _ { k + 1 } = \pi _ { \mathcal { T } _ { X _ { k } } } ( \beta M _ { k } ) - \mathcal { G } _ { \mathcal { M } } ( X _ { k } ) } } \\ { { { } } } \\ { { X _ { k + 1 } = X _ { k } + \alpha M _ { k + 1 } + { \displaystyle \frac { 1 } { 2 } } \alpha ^ { 2 } \displaystyle \frac { d ^ { 2 } Y ( \gamma _ { k } \alpha ) } { d \alpha ^ { 2 } } } } \end{array}
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
where $\gamma _ { k } \in ( 0 , 1 )$ .
|
| 385 |
+
|
| 386 |
+
Using the fact that
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
M = \pi _ { \mathcal { T } _ { X } } ( M ) + \pi _ { \mathcal { N } _ { X } } ( M )
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
where $\pi _ { \mathcal { N } _ { X } } ( M )$ is the projection onto the normal space, and
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\pi _ { \mathcal { N } _ { X } } ( M ) = X \frac { X ^ { \top } M + M ^ { \top } X } { 2 }
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
Then, the projection of momentum can be represented as:
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\begin{array} { r l } { \pi _ { T _ { k } } ( M _ { k } ) = M _ { k } - \pi _ { N _ { x _ { k } } } ( M _ { k } ) } & { } \\ { = M _ { k } - X _ { k } \frac { X _ { k } ^ { \top } M _ { k } + M _ { k } ^ { \top } X _ { k } } { 2 } } & { } \\ { = M _ { k } - \frac { 1 } { 2 } X _ { k } \{ [ X _ { k - 1 } + \alpha M _ { k } + \frac { 1 } { 2 } \alpha ^ { 2 } \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ] ^ { \top } M _ { k } } & { } \\ { + M _ { k } ^ { \top } [ X _ { k - 1 } + \alpha M _ { k } + \frac { 1 } { 2 } \alpha ^ { 2 } \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ] \} } & { } \\ { = M _ { k } - \alpha X _ { k } M _ { k } ^ { \top } M _ { k } - \frac { 1 } { 4 } \alpha ^ { 2 } X _ { k } [ \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ^ { \top } M _ { k } + M _ { k } ^ { \top } \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ] . } \end{array}
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
Then the momentum update in Eq.(7) is equivalent to:
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { l } { { M _ { k + 1 } = \beta M _ { k } - \alpha \beta X _ { k } M _ { k } ^ { \top } M _ { k } - \mathcal { G } _ { \mathcal { M } } ( X _ { k } ) } } \\ { { \mathrm { ~ } - { \frac { 1 } { 4 } } \alpha ^ { 2 } \beta X _ { k } [ { \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } } ^ { \top } M _ { k } + { M _ { k } ^ { \top } \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } } ] } } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Therefore, the paramter update in Eq.(7) can be represented as:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\begin{array} { l } { { X _ { k + 1 } = X _ { k } + \alpha \beta M _ { k } - \alpha \mathcal { G } _ { \mathcal { M } } ( X _ { k } ) } } \\ { { \ \displaystyle ~ - \frac { 1 } { 4 } \alpha ^ { 3 } \beta X _ { k } [ \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ^ { \top } M _ { k } + M _ { k } ^ { \top } \frac { d ^ { 2 } Y \left( \gamma _ { k - 1 } \alpha \right) } { d \alpha ^ { 2 } } ] } } \\ { { \ \displaystyle ~ - \alpha ^ { 2 } \beta X _ { k } M _ { k } ^ { \top } M _ { k } + \frac { 1 } { 2 } \alpha ^ { 2 } \frac { d ^ { 2 } Y \left( \gamma _ { k } \alpha \right) } { d \alpha ^ { 2 } } } } \\ { { \ \displaystyle ~ = X _ { k } + \beta ( X _ { k } - X _ { k - 1 } ) - \alpha \mathcal { G } _ { \mathcal { M } } ( X _ { k } ) + \alpha ^ { 2 } U } } \end{array}
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
where
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { c } { { U = - \displaystyle \frac { 1 } { 4 } \alpha \beta X _ { k } [ \frac { d ^ { 2 } Y ( \gamma _ { k - 1 } \alpha ) } { d \alpha ^ { 2 } } ^ { \top } M _ { k } + M _ { k } ^ { \top } \frac { d ^ { 2 } Y ( \gamma _ { k - 1 } \alpha ) } { d \alpha ^ { 2 } } ] } } \\ { { - \beta X _ { k } M _ { k } ^ { \top } M _ { k } + \displaystyle \frac { 1 } { 2 } \frac { d ^ { 2 } Y ( \gamma _ { k } \alpha ) } { d \alpha ^ { 2 } } - \displaystyle \frac { \beta } { 2 } \frac { d ^ { 2 } Y ( \gamma _ { k - 1 } \alpha ) } { d \alpha ^ { 2 } } } } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Since $\left| \left| M \right| \right| , \left| \left| X \right| \right|$ , and $\parallel \frac { d ^ { 2 } Y } { d \alpha ^ { 2 } } \parallel$ are bounded, there is a positive constant $D$ , such that
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
| | U | | \leq D
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
To facilitate the analysis of Cayle SGD with momentum, we introduce auxiliary variables $\{ P _ { k } \}$ , such that:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
Z _ { k + 1 } = Z _ { k } - { \frac { \alpha } { 1 - \beta } } { \mathcal { G } } _ { { \mathcal { M } } } ( X _ { k } ) + { \frac { \alpha ^ { 2 } } { 1 - \beta } } U
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
Z _ { k } = X _ { k } + P _ { k }
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
and
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
P _ { k } = \left\{ { \frac { \beta } { 1 - \beta } } ( X _ { k } - X _ { k - 1 } ) , k \geq 1 \right.
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
Since $f ( X )$ is a smooth function according to Assumption 1, we have:
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { r l } & { \quad f ( Y ) - f ( X ) - t r ( \nabla f ( X ) ^ { \top } ( Y - X ) ) } \\ & { = \displaystyle \int _ { 0 } ^ { 1 } \nabla t r ( f ( Y + t ( Y - X ) ) ^ { \top } ( Y - X ) ) d t - t r ( \nabla f ( X ) ^ { \top } ( Y - X ) ) } \\ & { \le | | \displaystyle \int _ { 0 } ^ { 1 } ( \nabla f ( Y + t ( Y - X ) ) - \nabla f ( X ) ) d t | | \times | | Y - X | | } \\ & { \le \displaystyle \int _ { 0 } ^ { 1 } L | | t ( Y - X ) | | d t \times | | Y - X | | } \\ & { \le \displaystyle \frac { L } { 2 } | | Y - X | | ^ { 2 } } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Then, we have
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { r l } & { I ( Z _ { k + 1 } ) \leq I ( Z _ { k } ) + \nu ( Z _ { k } ) \leq \nu ( X _ { k } ) \geq \frac { \nu } { 2 } \leq \nu ( X _ { k } ) - Z _ { k } \geq \nu ( X _ { k } ) - \frac { \nu } { 2 } \leq \nu ( X _ { k } ) - \frac { \nu ^ { 2 } } { 1 - \beta } \leq Z _ { k } \geq \nu ( X _ { k } ) - \frac { \nu ^ { 2 } } { 1 - \beta } \leq V _ { k } ^ { \prime } , } \\ & { \quad - \ell ( Z _ { k } ) + \nu ( Z _ { k } ) \leq \nu ^ { 1 } \leq Z _ { k } ^ { \prime } \geq \nu ( X _ { k + 1 } - Z _ { k } ) + \frac { \nu } { 2 } \leq \nu ^ { 1 } \leq W _ { k } ^ { \prime } \leq \nu ( X _ { k } ) - \frac { \nu ^ { 2 } } { 1 - \beta } \leq V _ { k } ^ { \prime } \geq \nu ( X _ { k } ) } \\ & { \quad < \ell ( Z _ { k } ) + I \nu ( Z _ { k } ) \geq \nu ( Z _ { k } ) - I \leq \nu ( X _ { k } ) - \frac { \nu } { 1 - \beta } \geq V _ { k } ^ { \prime } \geq \nu ( X _ { k } ) \geq - \frac { \nu ^ { 2 } } { 1 - \beta } \leq V _ { k } ^ { \prime } \geq \nu ( Z _ { k } ) } \\ & { \quad \leq I ( Z _ { k } ) - \frac { \nu } { 1 - \beta } \leq V _ { k } ^ { \prime } \leq \nu ( X _ { k } ) - \overline { { \nu } } \leq Z _ { k } ^ { \prime } \leq I \leq I \leq \nu ( Z _ { k } ) + \frac { \nu ^ { 2 } } { 1 - \beta } \leq I ( Z _ { k } ) - \frac { \nu ^ { 2 } } { 1 - \beta } \leq I ( Z _ { k } ) } \\ & { \quad + \frac { \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } \geq \nu ^ { 1 } \leq I ( Z _ { k } ) \leq \nu ( X _ { k } ) - \frac { \nu ^ { 2 } } { 1 - \beta } \leq I ( Z _ { k } ) \geq \nu ( Z _ { k } ) - \frac { \nu ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } } \\ & \quad \leq I ( Z _ { k } ) - \frac { \nu } { 1 - \beta } \leq V ( Z _ { k } ) \leq \nu ( X _ { k } ) - \frac { \nu ^ { 2 } } ( 1 - \beta ) ^ 2 \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
By taking expectation over the both sides, we have:
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { r l r } & { \quad \mathbb { E } [ f ( Z _ { k + 1 } ) - f ( Z _ { k } ) ] } \\ & { \le \mathbb { E } [ - \displaystyle \frac { \alpha } { 1 - \beta } t ^ { t r } ( \nabla f ( Z _ { k } ) ^ { \top } \nabla _ { M } f ( X _ { k } ) ) ] + \displaystyle \frac { \alpha ^ { 2 } } { 2 ( 1 - \beta ) } ( D ^ { 2 } + G ^ { 2 } ) + \displaystyle \frac { L \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } G ^ { 2 } + \displaystyle \frac { L \alpha ^ { 4 } } { ( 1 - \beta ) ^ { 2 } } D ^ { 2 } } \\ & { \le \mathbb { E } [ - \displaystyle \frac { \alpha } { 1 - \beta } t ^ { t r } ( \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) ) ^ { \top } \nabla _ { M } f ( X _ { k } ) - \displaystyle \frac { \alpha } { 1 - \beta } t r ( \nabla f ( X _ { k } ) ^ { \top } \nabla _ { M } f ( X _ { k } ) ) ] } \\ & { + \displaystyle \frac { \alpha ^ { 2 } } { 2 ( 1 - \beta ) } ( D ^ { 2 } + G ^ { 2 } ) + \displaystyle \frac { L \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } G ^ { 2 } + \displaystyle \frac { L \alpha ^ { 4 } } { ( 1 - \beta ) ^ { 2 } } D ^ { 2 } } \\ & { = \mathbb { E } [ - \displaystyle \frac { \alpha } { 1 - \beta } t r ( \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) ) ^ { \top } \nabla _ { M } f ( X _ { k } ) - \displaystyle \frac { \alpha } { 1 - \beta } \| \nabla _ { M } f ( X _ { k } ) \| ^ { 2 } ] } \\ & { + \displaystyle \frac { \alpha ^ { 2 } } { 2 ( 1 - \beta ) } ( D ^ { 2 } + G ^ { 2 } ) + \displaystyle \frac { L \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } G ^ { 2 } + \displaystyle \frac { L \alpha ^ { 4 } } { ( 1 - \beta ) ^ { 2 } } D ^ { 2 } } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
By noticing that:
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array} { l } { \displaystyle - \frac { \alpha } { 1 - \beta } ( \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) ) ^ { \top } \nabla _ { \mathcal { M } } f ( X _ { k } ) } \\ { \displaystyle \leq \frac { 1 } { 2 L } \| \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) \| ^ { 2 } + \frac { L \alpha ^ { 2 } } { 2 ( 1 - \beta ) ^ { 2 } } \| \nabla _ { \mathcal { M } } f ( X _ { k } ) \| ^ { 2 } } \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
Then
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\begin{array} { r l } & { \quad \mathbb { E } [ f ( Z _ { k + 1 } ) - f ( Z _ { k } ) ) ] } \\ & { \le \displaystyle \frac { 1 } { 2 L } \mathbb { E } | | \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) | | ^ { 2 } + ( \frac { L \alpha ^ { 2 } } { 2 ( 1 - \beta ) ^ { 2 } } - \frac { \alpha } { 1 - \beta } ) \mathbb { E } | | \nabla _ { \mathcal { M } } f ( X _ { k } ) | | ^ { 2 } } \\ & { + \displaystyle \frac { \alpha ^ { 2 } } { 2 ( 1 - \beta ) } ( D ^ { 2 } + G ^ { 2 } ) + \frac { L \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } G ^ { 2 } + \frac { L \alpha ^ { 4 } } { ( 1 - \beta ) ^ { 2 } } D ^ { 2 } } \end{array}
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
According to the Lipschitz continuous property in Assumption 1, we have:
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\begin{array} { r l } { \| \nabla f ( Z _ { k } ) - \nabla f ( X _ { k } ) \| ^ { 2 } \le L ^ { 2 } \| Z _ { k } - X _ { k } \| ^ { 2 } } & { } \\ & { \quad = \frac { L ^ { 2 } \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } \| X _ { k } - X _ { k - 1 } \| ^ { 2 } } \\ & { \quad = \frac { L ^ { 2 } \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } \| \alpha M _ { k } + \frac 1 2 \alpha ^ { 2 } \frac { d ^ { 2 } Y ( \gamma _ { k } \alpha ) } { d \alpha ^ { 2 } } \| ^ { 2 } } \\ & { \quad \le \frac { 2 L ^ { 2 } \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } ( \| \alpha M _ { k } \| ^ { 2 } + \| \frac 1 2 \alpha ^ { 2 } \frac { d ^ { 2 } Y ( \gamma _ { k } \alpha ) } { d \alpha ^ { 2 } } \| ^ { 2 } ) } \\ & { \quad \le \frac { 2 L ^ { 2 } \alpha ^ { 2 } \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } ( \frac { G ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } + \frac { \alpha ^ { 2 } C ^ { 2 } } { 4 } ) } \end{array}
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Therefore,
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\begin{array} { r l } & { \mathbb { E } [ f ( Z _ { k + 1 } ) - f ( Z _ { k } ) ) ] } \\ & { \le - B \mathbb { E } \vert \vert \nabla _ { \mathcal { M } } f ( X _ { k } ) \vert \vert ^ { 2 } + \alpha ^ { 2 } B ^ { ' } } \end{array}
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
where
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { l } { { { \cal { B } } = \displaystyle \frac { \alpha } { 1 - \beta } - \frac { L \alpha ^ { 2 } } { 2 ( 1 - \beta ) ^ { 2 } } } } \\ { { { \cal { B } } ^ { ' } = \displaystyle \frac { L \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } ( \frac { G ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } + \frac { \alpha ^ { 2 } C ^ { 2 } } { 4 } ) + \frac { D ^ { 2 } + G ^ { 2 } } { 2 ( 1 - \beta ) } + \frac { L G ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } + \frac { L \alpha ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } D ^ { 2 } } } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
Since $\begin{array} { r } { \alpha \leq \frac { 1 - \beta } { L } } \end{array}$ , then
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\begin{array} { l } { \displaystyle B = \frac \alpha { 1 - \beta } - \frac { L \alpha ^ { 2 } } { 2 ( 1 - \beta ) ^ { 2 } } } \\ { \displaystyle \quad = \frac \alpha { 1 - \beta } ( 1 - \frac { \alpha L } { 2 ( 1 - \beta ) } ) } \\ { \displaystyle \quad \geq \frac \alpha { 2 ( 1 - \beta ) } > 0 } \end{array}
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
By summing Eq.(34) over all $k$ , we have
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\begin{array} { r l r } { { B \sum _ { k = 0 } ^ { t } \mathbb { E } | | \nabla _ { \mathcal { M } } f ( X _ { k } ) | | ^ { 2 } \le \mathbb { E } [ f ( Z _ { 0 } ) - f ( Z _ { t + 1 } ) ] + ( t + 1 ) \alpha ^ { 2 } B ^ { ' } } } \\ & { } & \\ & { } & { \le f ( Z _ { 0 } ) - f _ { * } + ( t + 1 ) \alpha ^ { 2 } B ^ { ' } } \end{array}
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
Then
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\operatorname* { m i n } _ { k = 0 , \cdots , t } \mathbb { E } [ | | \nabla _ { \mathcal { M } } f ( X _ { k } ) | | ^ { 2 } ] \leq \frac { f ( Z _ { 0 } ) - f _ { * } } { ( t + 1 ) B } + \alpha ^ { 2 } \frac { B ^ { ' } } { B }
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\operatorname* { m i n } _ { k = 0 , \cdots , t } \mathbb { E } [ | | \nabla _ { \mathcal { M } } f ( X _ { k } ) | | ^ { 2 } ] \leq \frac { 2 ( f ( Z _ { 0 } ) - f _ { * } ) ( 1 - \beta ) } { ( t + 1 ) \alpha } + \alpha 2 B ^ { ' } ( 1 - \beta )
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
Use the fact that $\begin{array} { r } { \alpha = \operatorname* { m i n } \{ \frac { 1 - \beta } { L } , \frac { A } { \sqrt { t + 1 } } \} } \end{array}$ , and notice that $Z _ { 0 } = X _ { 0 }$
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { r l } & { \quad \underset { k = 0 , \cdots , t } { \operatorname* { m i n } } \mathbb { E } [ | | \nabla _ { M } f ( x _ { k } ) | | ^ { 2 } ] } \\ & { \le \frac { 2 ( f ( X _ { 0 } ) - f _ { * } ) ( 1 - \beta ) } { t + 1 } \operatorname* { m a x } \{ \frac { L } { 1 - \beta } , \frac { \sqrt { t + 1 } } { A } \} + \frac { 2 A B ^ { ' } ( 1 - \beta ) } { \sqrt { t + 1 } } } \\ & { \le \frac { 2 ( f ( X _ { 0 } ) - f _ { * } ) ( 1 - \beta ) } { t + 1 } \operatorname* { m a x } \{ \frac { L } { 1 - \beta } , \frac { \sqrt { t + 1 } } { A } \} } \\ & { + \frac { 2 A ( 1 - \beta ) } { \sqrt { t + 1 } } \lbrack \frac { L \beta ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } ( \frac { G ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } + \frac { A ^ { 2 } C ^ { 2 } } { 4 ( t + 1 ) } ) } \\ & { + \frac { D ^ { 2 } + G ^ { 2 } } { 2 ( 1 - \beta ) } + \frac { L G ^ { 2 } } { ( 1 - \beta ) ^ { 2 } } + \frac { L A ^ { 2 } } { ( t + 1 ) ( 1 - \beta ) ^ { 2 } } D ^ { 2 } \rbrack } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
Therefore, $\operatorname* { m i n } _ { k = 0 , \cdots , t } \mathbb { E } [ | | \nabla _ { \mathcal { M } } f ( X _ { k } ) | | ^ { 2 } ] = o ( \frac { 1 } { \sqrt { t + 1 } } ) \to 0$ , as $t \to \infty$ .
|
md/train/HkE0Nvqlg/HkE0Nvqlg.md
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STRUCTURED ATTENTION NETWORKS
|
| 2 |
+
|
| 3 |
+
Yoon $\mathbf { K i m } ^ { * }$ Carl Denton∗ Luong Hoang Alexander M. Rush
|
| 4 |
+
|
| 5 |
+
{yoonkim@seas,carldenton@college,lhoang@g,srush@seas}.harvard.edu
|
| 6 |
+
School of Engineering and Applied Sciences
|
| 7 |
+
Harvard University
|
| 8 |
+
Cambridge, MA 02138, USA
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Attention networks have proven to be an effective approach for embedding categorical inference within a deep neural network. However, for many tasks we may want to model richer structural dependencies without abandoning end-to-end training. In this work, we experiment with incorporating richer structural distributions, encoded using graphical models, within deep networks. We show that these structured attention networks are simple extensions of the basic attention procedure, and that they allow for extending attention beyond the standard softselection approach, such as attending to partial segmentations or to subtrees. We experiment with two different classes of structured attention networks: a linearchain conditional random field and a graph-based parsing model, and describe how these models can be practically implemented as neural network layers. Experiments show that this approach is effective for incorporating structural biases, and structured attention networks outperform baseline attention models on a variety of synthetic and real tasks: tree transduction, neural machine translation, question answering, and natural language inference. We further find that models trained in this way learn interesting unsupervised hidden representations that generalize simple attention.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Attention networks are now a standard part of the deep learning toolkit, contributing to impressive results in neural machine translation (Bahdanau et al., 2015; Luong et al., 2015), image captioning (Xu et al., 2015), speech recognition (Chorowski et al., 2015; Chan et al., 2015), question answering (Hermann et al., 2015; Sukhbaatar et al., 2015), and algorithm-learning (Graves et al., 2014; Vinyals et al., 2015), among many other applications (see Cho et al. (2015) for a comprehensive review). This approach alleviates the bottleneck of compressing a source into a fixed-dimensional vector by equipping a model with variable-length memory (Weston et al., 2014; Graves et al., 2014; 2016), thereby providing random access into the source as needed. Attention is implemented as a hidden layer which computes a categorical distribution (or hierarchy of categorical distributions) to make a soft-selection over source elements.
|
| 17 |
+
|
| 18 |
+
Noting the empirical effectiveness of attention networks, we also observe that the standard attentionbased architecture does not directly model any structural dependencies that may exist among the source elements, and instead relies completely on the hidden layers of the network. While one might argue that these structural dependencies can be learned implicitly by a deep model with enough data, in practice, it may be useful to provide a structural bias. Modeling structural dependencies at the final, output layer has been shown to be important in many deep learning applications, most notably in seminal work on graph transformers (LeCun et al., 1998), key work on NLP (Collobert et al., 2011), and in many other areas (Peng et al., 2009; Do & Artieres, 2010; Jaderberg et al., 2014; Chen ´ et al., 2015; Durrett & Klein, 2015; Lample et al., 2016, inter alia).
|
| 19 |
+
|
| 20 |
+
In this work, we consider applications which may require structural dependencies at the attention layer, and develop internal structured layers for modeling these directly. This approach generalizes categorical soft-selection attention layers by specifying possible structural dependencies in a soft manner. Key applications will be the development of an attention function that segments the source input into subsequences and one that takes into account the latent recursive structure (i.e. parse tree) of a source sentence.
|
| 21 |
+
|
| 22 |
+
Our approach views the attention mechanism as a graphical model over a set of latent variables. The standard attention network can be seen as an expectation of an annotation function with respect to a single latent variable whose categorical distribution is parameterized to be a function of the source. In the general case we can specify a graphical model over multiple latent variables whose edges encode the desired structure. Computing forward attention requires performing inference to obtain the expectation of the annotation function, i.e. the context vector. This expectation is computed over an exponentially-sized set of structures (through the machinery of graphical models/structured prediction), hence the name structured attention network. Notably each step of this process (including inference) is differentiable, so the model can be trained end-to-end without having to resort to deep policy gradient methods (Schulman et al., 2015).
|
| 23 |
+
|
| 24 |
+
The differentiability of inference algorithms over graphical models has previously been noted by various researchers (Li & Eisner, 2009; Domke, 2011; Stoyanov et al., 2011; Stoyanov & Eisner, 2012; Gormley et al., 2015), primarily outside the area of deep learning. For example, Gormley et al. (2015) treat an entire graphical model as a differentiable circuit and backpropagate risk through variational inference (loopy belief propagation) for minimium risk training of dependency parsers. Our contribution is to combine these ideas to produce structured internal attention layers within deep networks, noting that these approaches allow us to use the resulting marginals to create new features, as long as we do so a differentiable way.
|
| 25 |
+
|
| 26 |
+
We focus on two classes of structured attention: linear-chain conditional random fields (CRFs) (Lafferty et al., 2001) and first-order graph-based dependency parsers (Eisner, 1996). The initial work of Bahdanau et al. (2015) was particularly interesting in the context of machine translation, as the model was able to implicitly learn an alignment model as a hidden layer, effectively embedding inference into a neural network. In similar vein, under our framework the model has the capacity to learn a segmenter as a hidden layer or a parser as a hidden layer, without ever having to see a segmented sentence or a parse tree. Our experiments apply this approach to a difficult synthetic reordering task, as well as to machine translation, question answering, and natural language inference. We find that models trained with structured attention outperform standard attention models. Analysis of learned representations further reveal that interesting structures emerge as an internal layer of the model. All code is available at http://github.com/harvardnlp/struct-attn.
|
| 27 |
+
|
| 28 |
+
# 2 BACKGROUND: ATTENTION NETWORKS
|
| 29 |
+
|
| 30 |
+
A standard neural network consist of a series of non-linear transformation layers, where each layer produces a fixed-dimensional hidden representation. For tasks with large input spaces, this paradigm makes it hard to control the interaction between components. For example in machine translation, the source consists of an entire sentence, and the output is a prediction for each word in the translated sentence. Utilizing a standard network leads to an information bottleneck, where one hidden layer must encode the entire source sentence. Attention provides an alternative approach.1 An attention network maintains a set of hidden representations that scale with the size of the source. The model uses an internal inference step to perform a soft-selection over these representations. This method allows the model to maintain a variable-length memory and has shown to be crucially important for scaling systems for many tasks.
|
| 31 |
+
|
| 32 |
+
Formally, let $\boldsymbol { x } ~ = ~ [ x _ { 1 } , \dots , x _ { n } ]$ represent a sequence of inputs, let $q$ be a query, and let $z$ be a categorical latent variable with sample space $\{ 1 , \ldots , n \}$ that encodes the desired selection among these inputs. Our aim is to produce a context $c$ based on the sequence and the query. To do so, we assume access to an attention distribution $z \sim p ( z \mid x , q )$ , where we condition $p$ on the inputs $x$ and a query $q$ . The context over a sequence is defined as expectation, $c = \mathbb { E } _ { z \sim p ( z \mid x , q ) } [ f ( x , z ) ]$ where $f ( x , z )$ is an annotation function. Attention of this form can be applied over any type of input, however, we will primarily be concerned with “deep” networks, where both the annotation function and attention distribution are parameterized with neural networks, and the context produced is a vector fed to a downstream network.
|
| 33 |
+
|
| 34 |
+
For example, consider the case of attention-based neural machine translation (Bahdanau et al., 2015). Here the sequence of inputs $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right]$ are the hidden states of a recurrent neural network (RNN), running over the words in the source sentence, $\mathbf { q }$ is the RNN hidden state of the target decoder (i.e. vector representation of the query $q$ ), and $z$ represents the source position to be attended to for translation. The attention distribution $p$ is simply $p ( z = i \mid x , q ) = \operatorname { s o f t m a x } ( \theta _ { i } )$ where $\boldsymbol \theta \in \mathbb { R } ^ { n }$ is a parameterized potential typically based on a neural network, e.g. $\theta _ { i } = \mathrm { M L P } ( [ \mathbf { x } _ { i } ; \mathbf { q } ] )$ . The annotation function is defined to simply return the selected hidden state, $f ( \mathbf { x } , z ) = \mathbf { x } _ { z }$ . The context vector can then be computed using a simple sum,
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbf { c } = \mathbb { E } _ { z \sim p ( z \mid x , q ) } [ f ( x , z ) ] = \sum _ { i = 1 } ^ { n } p ( z = i \mid x , q ) \mathbf { x } _ { i }
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
Other tasks such as question answering use attention in a similar manner, for instance by replacing source $[ x _ { 1 } , \ldots , x _ { n } ]$ with a set of potential facts and $q$ with a representation of the question.
|
| 41 |
+
|
| 42 |
+
In summary we interpret the attention mechanism as taking the expectation of an annotation function $f ( x , z )$ with respect to a latent variable $z \sim p$ , where $p$ is parameterized to be function of $x$ and $q$ .
|
| 43 |
+
|
| 44 |
+
# 3 STRUCTURED ATTENTION
|
| 45 |
+
|
| 46 |
+
Attention networks simulate selection from a set using a soft model. In this work we consider generalizing selection to types of attention, such as selecting chunks, segmenting inputs, or even attending to latent subtrees. One interpretation of this attention is as using soft-selection that considers all possible structures over the input, of which there may be exponentially many possibilities. Of course, this expectation can no longer be computed using a simple sum, and we need to incorporate the machinery of inference directly into our neural network.
|
| 47 |
+
|
| 48 |
+
Define a structured attention model as being an attention model where $z$ is now a vector of discrete latent variables $[ z _ { 1 } , \ldots , z _ { m } ]$ and the attention distribution is $p ( z \mid x , q )$ is defined as a conditional random field (CRF), specifying the independence structure of the $z$ variables. Formally, we assume an undirected graph structure with $m$ vertices. The CRF is parameterized with clique (log-)potentials $\theta _ { C } ( z _ { C } ) \in \mathbb { R }$ , where the $z _ { C }$ indicates the subset of $z$ given by clique $C$ . Under this definition, the attention probability is defined as, $p ( z \mid x , q ; \theta ) = \mathrm { s o f t m a x } ( \sum _ { C } \theta _ { C } ( z _ { C } ) )$ , where for symmetry we use softmax in a general sense, i.e. $\begin{array} { r } { \mathrm { s o f t m a x } ( g ( z ) ) = \frac { 1 } { Z } \exp ( g ( z ) ) } \end{array}$ where $\begin{array} { r } { Z = \sum _ { z ^ { \prime } } \exp ( g ( z ^ { \prime } ) ) } \end{array}$ is the implied partition function. In practice we use a neural CRF, where $\theta$ comes from a deep model over $x , q$ .
|
| 49 |
+
|
| 50 |
+
In structured attention, we also assume that the annotation function $f$ factors (at least) into clique annotation functions $\begin{array} { r } { f ( x , z ) = \sum _ { C } f _ { C } ( x , z _ { C } ) } \end{array}$ . Under standard conditions on the conditional independence structure, inference techniques from graphical models can be used to compute the forwardpass expectations and the context:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
c = \mathbb { E } _ { z \sim p ( z \mid x , q ) } [ f ( x , z ) ] = \sum _ { C } \mathbb { E } _ { z \sim p ( z _ { C } \mid x , q ) } [ f _ { C } ( x , z _ { C } ) ]
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
# 3.1 EXAMPLE 1: SUBSEQUENCE SELECTION
|
| 57 |
+
|
| 58 |
+
Suppose instead of soft-selecting a single input, we wanted to explicitly model the selection of contiguous subsequences. We could naively apply categorical attention over all subsequences, or hope the model learns a multi-modal distribution to combine neighboring words. Structured attention provides an alternate approach.
|
| 59 |
+
|
| 60 |
+
Concretely, let $m = n$ , define $z$ to be a random vector $z = [ z _ { 1 } , \dots , z _ { n } ]$ with $z _ { i } \in \{ 0 , 1 \}$ , and define our annotation function to be, $\begin{array} { r } { f ( x , z ) = \sum _ { i = 1 } ^ { n } f _ { i } ( x , z _ { i } ) } \end{array}$ where $f _ { i } ( x , z _ { i } ) = \mathbb { 1 } \{ z _ { i } = 1 \} \mathbf { x } _ { i }$ . The explicit expectation is then,
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathbb { E } _ { z _ { 1 } , \dots , z _ { n } } [ f ( x , z ) ] = \sum _ { i = 1 } ^ { n } p ( z _ { i } = 1 | x , q ) \mathbf { x } _ { i }
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 1: Three versions of a latent variable attention model: (a) A standard soft-selection attention network, (b) A Bernoulli (sigmoid) attention network, (c) A linear-chain structured attention model for segmentation. The input and query are denoted with $x$ and $q$ respectively.
|
| 68 |
+
|
| 69 |
+
Equation (2) is similar to equation (1)—both are a linear combination of the input representations where the scalar is between $[ 0 , 1 ]$ and represents how much attention should be focused on each input. However, (2) is fundamentally different in two ways: (i) it allows for multiple inputs (or no inputs) to be selected for a given query; (ii) we can incorporate structural dependencies across the $z _ { i }$ ’s. For instance, we can model the distribution over $z$ with a linear-chain CRF with pairwise edges,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
p ( z _ { 1 } , \dots , z _ { n } | x , q ) = \mathrm { s o f t m a x } \left( \sum _ { i = 1 } ^ { n - 1 } \theta _ { i , i + 1 } ( z _ { i } , z _ { i + 1 } ) \right)
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\theta _ { k , l }$ is the pairwise potential for $z _ { i } = k$ and $z _ { i + 1 } = l$ . This model is shown in Figure 1c. Compare this model to the standard attention in Figure 1a, or to a simple Bernoulli (sigmoid) selection method, $p ( z _ { i } = 1 | x , q ) = \mathrm { s i g m o i d } ( \theta _ { i } )$ , shown in Figure 1b. All three of these methods can use potentials from the same neural network or RNN that takes $x$ and $q$ as inputs.
|
| 76 |
+
|
| 77 |
+
In the case of the linear-chain CRF in (3), the marginal distribution $p ( z _ { i } = 1 | x )$ can be calculated efficiently in linear-time for all $i$ using message-passing, i.e. the forward-backward algorithm. These marginals allow us to calculate (2), and in doing so we implicitly sum over an exponentially-sized set of structures (i.e. all binary sequences of length $n$ ) through dynamic programming. We refer to this type of attention layer as a segmentation attention layer.
|
| 78 |
+
|
| 79 |
+
Note that the forward-backward algorithm is being used as parameterized pooling (as opposed to output computation), and can be thought of as generalizing the standard attention softmax. Crucially this generalization from vector softmax to forward-backward is just a series of differentiable steps,2 and we can compute gradients of its output (marginals) with respect to its input (potentials). This will allow the structured attention model to be trained end-to-end as part of a deep model.
|
| 80 |
+
|
| 81 |
+
# 3.2 EXAMPLE 2: SYNTACTIC TREE SELECTION
|
| 82 |
+
|
| 83 |
+
This same approach can be used for more involved structural dependencies. One popular structure for natural language tasks is a dependency tree, which enforces a structural bias on the recursive dependencies common in many languages. In particular a dependency tree enforces that each word in a source sentence is assigned exactly one parent word (head word), and that these assignments do not cross (projective structure). Employing this bias encourages the system to make a soft-selection based on learned syntactic dependencies, without requiring linguistic annotations or a pipelined decision.
|
| 84 |
+
|
| 85 |
+
A dependency parser can be partially formalized as a graphical model with the following cliques (Smith & Eisner, 2008): latent variables $z _ { i j } \in \{ 0 , 1 \}$ for all $i \neq j$ , which indicates that the $i$ -th word is the parent of the $j$ -th word (i.e. $x _ { i } \to x _ { j } ,$ ); and a special global constraint that rules out configurations of $z _ { i j }$ ’s that violate parsing constraints (e.g. one head, projectivity).
|
| 86 |
+
|
| 87 |
+
The parameters to the graph-based CRF dependency parser are the potentials $\theta _ { i j }$ , which reflect the score of selecting $x _ { i }$ as the parent of $x _ { j }$ . The probability of a parse tree $z$ given the sentence
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
|
| 91 |
+
Figure 2: Algorithms for linear-chain CRF: (left) computation of forward-backward tables $\alpha , \beta$ , and marginal probabilities $p$ from potentials $\theta$ (forward-backward algorithm); (right) backpropagation of loss gradients with respect to the marginals $\nabla _ { p } ^ { \mathcal { L } }$ . $\mathcal { C }$ denotes the state space and $\langle t \rangle$ is the special start/stop state. Backpropagation uses the identity $\nabla _ { \log p } ^ { \mathcal { L } } = p \odot \nabla _ { p } ^ { \mathcal { L } }$ to calculate $\nabla _ { \theta } ^ { \mathcal { L } } = \nabla _ { \log p } ^ { \mathcal { L } } \nabla _ { \theta } ^ { \log p }$ , where $\odot$ is the element-wise multiplication. Typically the forward-backward with marginals is performed in the log-space semifield $\mathbb { R } \cup \{ \pm \infty \}$ with binary operations $\oplus = \log \mathrm { a d d }$ and $\otimes = +$ for numerical precision. However, backpropagation requires working with the log of negative values (since $\nabla _ { p } ^ { \mathcal { L } }$ could be negative), so we extend to a field $[ \mathbb { R } \cup \{ \pm \infty \} ] \times \{ + , - \}$ with special $+ / -$ log-space operations. Binary operations applied to vectors are implied to be element-wise. The signexp function is defined as $\mathrm { s i g n e x p } ( l _ { a } ) = s _ { a } \exp ( l _ { a } )$ . See Section 3.3 and Table 1 for more details.
|
| 92 |
+
|
| 93 |
+
$x = [ x _ { 1 } , \ldots , x _ { n } ]$ is,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
p ( z \mid x , q ) = { \mathrm { s o f t m a x } } \left( \mathbb { 1 } \{ z { \mathrm { ~ i s ~ v a l i d } } \} \sum _ { i \neq j } \mathbb { 1 } \{ z _ { i j } = 1 \} \theta _ { i j } \right)
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $z$ is represented as a vector of $z _ { i j }$ ’s for all $i \neq j$ . It is possible to calculate the marginal probability of each edge $p ( z _ { i j } = 1 | x , q )$ for all $i , j$ in $O ( n ^ { 3 } )$ time using the inside-outside algorithm (Baker, 1979) on the data structures of Eisner (1996).
|
| 100 |
+
|
| 101 |
+
The parsing contraints ensure that each word has exactly one head (i.e. $\textstyle \sum _ { i = 1 } ^ { n } z _ { i j } = 1 )$ ). Therefore if we want to utilize the soft-head selection of a position $j$ , the context vector is defined as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
f _ { j } ( x , z ) = \sum _ { i = 1 } ^ { n } \mathbb { 1 } \{ z _ { i j } = 1 \} \mathbf { x } _ { i } \qquad \mathbf { c } _ { j } = \mathbb { E } _ { z } [ f _ { j } ( x , z ) ] = \sum _ { i = 1 } ^ { n } p ( z _ { i j } = 1 | x , q ) \mathbf { x } _ { i }
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Note that in this case the annotation function has the subscript $j$ to produce a context vector for each word in the sentence. Similar types of attention can be applied for other tree properties (e.g. soft-children). We refer to this type of attention layer as a syntactic attention layer.
|
| 108 |
+
|
| 109 |
+
# 3.3 END-TO-END TRAINING
|
| 110 |
+
|
| 111 |
+
Graphical models of this form have been widely used as the final layer of deep models. Our contribution is to argue that these networks can be added within deep networks in place of simple attention layers. The whole model can then be trained end-to-end.
|
| 112 |
+
|
| 113 |
+
The main complication in utilizing this approach within the network itself is the need to backpropagate the gradients through an inference algorithm as part of the structured attention network. Past work has demonstrated the techniques necessary for this approach (see Stoyanov et al. (2011)), but to our knowledge it is very rarely employed.
|
| 114 |
+
|
| 115 |
+
Consider the case of the simple linear-chain CRF layer from equation (3). Figure 2 (left) shows the standard forward-backward algorithm for computing the marginals $p ( z _ { i } = 1 | x , q ; \theta )$ . If we treat the forward-backward algorithm as a neural network layer, its input are the potentials $\theta$ , and its output after the forward pass are these marginals.3 To backpropagate a loss through this layer we need to compute the gradient of the loss $\mathcal { L }$ with respect to $\theta$ , $\grave { \nabla } _ { \theta } ^ { \mathcal { L } }$ , as a function of the gradient of the loss with respect to the marginals, $\nabla _ { p } ^ { \mathcal { L } }$ .4 As the forward-backward algorithm consists of differentiable steps, this function can be derived using reverse-mode automatic differentiation of the forward-backward algorithm itself. Note that this reverse-mode algorithm conveniently has a parallel structure to the forward version, and can also be implemented using dynamic programming.
|
| 116 |
+
|
| 117 |
+
However, in practice, one cannot simply use current off-the-shelf tools for this task. For one, efficiency is quite important for these models and so the benefits of handoptimizing the reverse-mode implementation still outweighs simplicity of automatic differentiation. Secondly, numerical precision becomes a major issue for structured attention networks. For computing the forward-pass and the marginals, it is important to use the standard log-space semifield over $\mathbb { R } \cup \{ \pm \infty \}$ with binary operations $\oplus = \mathrm { { l o g a d d } , \otimes = + ) }$ to avoid underflow of probabilities. For computing the backward-pass, we need to remain in log
|
| 118 |
+
|
| 119 |
+
Table 1: Signed log-space semifield (from Li & Eisner (2009)). Each real number $a$ is represented as a pair $( l _ { a } , s _ { a } )$ where $l _ { a } = \log \left| a \right|$ and $s _ { a } = \bar { \mathrm { s i g n } } ( a )$ . Therefore $a = s _ { a } \exp ( l _ { a } )$ . For the above we let $d = \exp ( l _ { b } - l _ { a } )$ and assume $| a | > | b |$ .
|
| 120 |
+
|
| 121 |
+
<table><tr><td></td><td colspan="3"></td><td colspan="2">区</td></tr><tr><td>Sa</td><td>Sb</td><td>④ la+b</td><td>Sa+b</td><td>la·b</td><td>Sa·b</td></tr><tr><td>+</td><td>+</td><td>la +log(1+d)</td><td>+</td><td>la+lb</td><td>十</td></tr><tr><td>+</td><td>1</td><td>la+log(1-d)</td><td>+</td><td>la+lb</td><td></td></tr><tr><td>1</td><td>+</td><td>la+log(1-d)</td><td></td><td>la+lb</td><td></td></tr><tr><td>1</td><td>1</td><td>la +log(1+d)</td><td></td><td>la+lb</td><td>+</td></tr></table>
|
| 122 |
+
|
| 123 |
+
space, but also handle log of negative values (since $\nabla _ { p } ^ { \mathcal { L } }$ could be negative). This requires extending to the signed log-space semifield over $[ \mathbb { R } \cup \{ \pm \infty \} ] \stackrel { \cdot } { \times } \{ + , - \}$ with special $+ / -$ operations. Table 1, based on Li & Eisner (2009), demonstrates how to handle this issue, and Figure 2 (right) describes backpropagation through the forward-backward algorithm. For dependency parsing, the forward pass can be computed using the inside-outside implementation of Eisner’s algorithm (Eisner, 1996). Similarly, the backpropagation parallels the inside-outside structure. Forward/backward pass through the inside-outside algorithm is described in Appendix B.
|
| 124 |
+
|
| 125 |
+
# 4 EXPERIMENTS
|
| 126 |
+
|
| 127 |
+
We experiment with three instantiations of structured attention networks on four different tasks: (a) a simple, synthetic tree manipulation task using the syntactic attention layer, (b) machine translation with segmentation attention (i.e. two-state linear-chain CRF), (c) question answering using an $n$ - state linear-chain CRF for multi-step inference over $n$ facts, and (d) natural language inference with syntactic tree attention. These experiments are not intended to boost the state-of-the-art for these tasks but to test whether these methods can be trained effectively in an end-to-end fashion, can yield improvements over standard selection-based attention, and can learn plausible latent structures. All model architectures, hyperparameters, and training details are further described in Appendix A.
|
| 128 |
+
|
| 129 |
+
# 4.1 TREE TRANSDUCTION
|
| 130 |
+
|
| 131 |
+
The first set of experiments look at a tree-transduction task. These experiments use synthetic data to explore a failure case of soft-selection attention models. The task is to learn to convert a random formula given in prefix notation to one in infix notation, e.g.,
|
| 132 |
+
|
| 133 |
+
The alphabet consists of symbols $\{ ( , ) , + , * \}$ , numbers between 0 and 20, and a special root symbol $\$ 1$ . This task is used as a preliminary task to see if the model is able to learn the implicit tree structure on the source side. The model itself is an encoder-decoder model, where the encoder is defined below and the decoder is an LSTM. See Appendix A.2 for the full model.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 3: Visualization of the source self-attention distribution for the simple (left) and structured (right) attention models on the tree transduction task. $\$ 8$ is the special root symbol. Each row delineates the distribution over the parents (i.e. each row sums to one). The attention distribution obtained from the parsing marginals are more able to capture the tree structure—e.g. the attention weights of closing parentheses are generally placed on the opening parentheses (though not necessarily on a single parenthesis).
|
| 137 |
+
|
| 138 |
+
Training uses 15K prefix-infix pairs where the maximum nesting depth is set to be between 2-4 (the above example has depth 3), with 5K pairs in each depth bucket. The number of expressions in each parenthesis is limited to be at most 4. Test uses 1K unseen sequences with depth between 2-6 (note specifically deeper than train), with 200 sequences for each depth. The performance is measured as the average proportion of correct target tokens produced until the first failure (as in Grefenstette et al. (2015)).
|
| 139 |
+
|
| 140 |
+
For experiments we try using different forms of self -attention over embedding-only encoders. Let $\mathbf { x } _ { j }$ be an embedding for each source symbol; our three variants of the source representation $\hat { \mathbf { x } } _ { j }$ are: (a) no atten, just symbol embeddings by themselves, i.e. $\hat { \mathbf { x } } _ { j } = \mathbf { x } _ { j }$ ; (b) simple attention, symbol embeddings and soft-pairing for each symbol, i.e. $\hat { \mathbf { x } } _ { j } = [ \mathbf { x } _ { j } ; \mathbf { \bar { c } } _ { j } ]$ where $\begin{array} { r } { \mathbf { c } _ { j } = \dot { \sum } _ { i = 1 } ^ { n } \mathrm { s o f t m a x } ( \mathbf { \dot { \boldsymbol { \theta } } } _ { i j } ) \mathbf { x } _ { i } } \end{array}$ is calculated using soft-selection; (c) structured attention, symbol embeddings and soft-parent, i.e. $\hat { \bf x } _ { j } = [ { \bf x } _ { j } ; { \bf c } _ { j } ]$ where $\begin{array} { r } { \mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } p ( z _ { i j } = 1 | x ) \mathbf { x } _ { i } } \end{array}$ is calculated using parsing marginals, obtained from the syntactic attention layer. None of these models use an explicit query value—the potentials come from running a bidirectional LSTM over the source, producing hidden vectors $\mathbf { h } _ { i }$ , and then computing
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\theta _ { i j } = \operatorname { t a n h } ( \mathbf { s } ^ { \top } \operatorname { t a n h } ( \mathbf { W } _ { 1 } \mathbf { h } _ { i } + \mathbf { W } _ { 2 } \mathbf { h } _ { j } + \mathbf { b } ) )
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $\mathbf { s } , \mathbf { b } , \mathbf { W } _ { 1 } , \mathbf { W } _ { 2 }$ are parameters (see Appendix A.1).
|
| 147 |
+
|
| 148 |
+
The source representation $\left[ \hat { \mathbf { x } } _ { 1 } , \ldots , \hat { \mathbf { x } } _ { n } \right]$ are attended over using the standard attention mechanism at each decoding step by an LSTM decoder.5 Additionally, symbol embedding parameters are shared between the parsing LSTM and the source encoder.
|
| 149 |
+
|
| 150 |
+
Table 2: Performance (average length to failure $\%$ ) of models on the tree-transduction task.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Depth</td><td>No Atten</td><td>Simple</td><td>Structured</td></tr><tr><td>2</td><td>7.6</td><td>87.4</td><td>99.2</td></tr><tr><td>3</td><td>4.1</td><td>49.6</td><td>87.0</td></tr><tr><td>4</td><td>2.8</td><td>23.3</td><td>64.5</td></tr><tr><td>5</td><td>2.1</td><td>15.0</td><td>30.8</td></tr><tr><td>6</td><td>1.5</td><td>8.5</td><td>18.2</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Results Table 2 has the results for the task. Note that this task is fairly difficult as the encoder is quite simple. The baseline model (unsurprisingly) performs poorly as it has no information about the source ordering. The simple attention model performs better, but is significantly outperformed by the structured model with a tree structure bias. We hypothesize that the model is partially reconstructing the arithmetic tree. Figure 3 shows the attention distribution for the simple/structured models on the same source sequence, which indicates that the structured model is able to learn boundaries (i.e. parentheses).
|
| 155 |
+
|
| 156 |
+
# 4.2 NEURAL MACHINE TRANSLATION
|
| 157 |
+
|
| 158 |
+
Our second set of experiments use a full neural machine translation model utilizing attention over subsequences. Here both the encoder/decoder are LSTMs, and we replace standard simple attention with a segmentation attention layer. We experiment with two settings: translating directly from unsegmented Japanese characters to English words (effectively using structured attention to perform soft word segmentation), and translating from segmented Japanese words to English words (which can be interpreted as doing phrase-based neural machine translation). Japanese word segmentation is done using the KyTea toolkit (Neubig et al., 2011).
|
| 159 |
+
|
| 160 |
+
The data comes from the Workshop on Asian Translation (WAT) (Nakazawa et al., 2016). We randomly pick 500K sentences from the original training set (of 3M sentences) where the Japanese sentence was at most 50 characters and the English sentence was at most 50 words. We apply the same length filter on the provided validation/test sets for evaluation. The vocabulary consists of all tokens that occurred at least 10 times in the training corpus.
|
| 161 |
+
|
| 162 |
+
The segmentation attention layer is a two-state CRF where the unary potentials at the $j$ -th decoder step are parameterized as
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\theta _ { i } ( k ) = \left\{ \begin{array} { l l } { \mathbf { h } _ { i } \mathbf { W } \mathbf { h } _ { j } , } & { k = 1 } \\ { 0 , } & { k = 0 } \end{array} \right.
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
Here $[ \mathbf { h } _ { 1 } , \ldots , \mathbf { h } _ { n } ]$ are the encoder hidden states and $\mathbf { h } _ { j } ^ { \prime }$ is the $j$ -th decoder hidden state (i.e. the query vector). The pairwise potentials are parameterized linearly with $\mathbf { b }$ , i.e. all together
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\theta _ { i , i + 1 } ( z _ { i } , z _ { i + 1 } ) = \theta _ { i } ( z _ { i } ) + \theta _ { i + 1 } ( z _ { i + 1 } ) + \mathbf { b } _ { z _ { i } , z _ { i + 1 } }
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
Therefore the segmentation attention layer requires just 4 additional parameters. Appendix A.3 describes the full model architecture.
|
| 175 |
+
|
| 176 |
+
We experiment with three attention configurations: (a) standard simple attention, i.e. $\mathrm { ~ \bf ~ c ~ } _ { j } = { \bf \frac { \pi } { \pi } }$ $\sum _ { i = 1 } ^ { n } \mathrm { { { s o f t m a x } } } ( \theta _ { i } ) \mathbf { h } _ { i }$ ; (b) sigmoid attention: multiple selection with Bernoulli random variables, i.e. $\begin{array} { r } { \mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } \mathrm { s i g m o i d } ( \theta _ { i } ) \mathbf { h } _ { i } } \end{array}$ ; (c) structured attention, encoded with normalized CRF marginals,
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } \frac { p ( z _ { i } = 1 | x , q ) } { \gamma } \mathbf { h } _ { i } \qquad \gamma = \frac { 1 } { \lambda } \sum _ { i = 1 } ^ { n } p ( z _ { i } = 1 | x , q )
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
The normalization term $\gamma$ is not ideal but we found it to be helpful for stable training.6 $\lambda$ is a hyperparameter (we use $\lambda = 2$ ) and we further add an $l _ { 2 }$ penalty of 0.005 on the pairwise potentials b. These values were found via grid search on the validation set.
|
| 183 |
+
|
| 184 |
+
Table 3: Translation performance as measured by BLEU (higher is better) on characterto-word and word-to-word Japanese-English translation for the three different models.
|
| 185 |
+
|
| 186 |
+
<table><tr><td></td><td>Simple</td><td>Sigmoid</td><td> Structured</td></tr><tr><td>CHAR</td><td>12.6</td><td>13.1</td><td>14.6</td></tr><tr><td>WORD</td><td>14.1</td><td>13.8</td><td>14.3</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Results Results for the translation task on the test set are given in Table 3. Sigmoid attention outperforms simple (softmax) attention on the character-toword task, potentially because it is able to learn manyto-one alignments. On the word-to-word task, the opposite is true, with simple attention outperforming sigmoid attention. Structured attention outperforms both models on both tasks, although improvements on the word-to-word task are modest and unlikely to be statistically significant.
|
| 189 |
+
|
| 190 |
+
For further analysis, Figure 4 shows a visualization of the different attention mechanisms on the character-to-word setup. The simple model generally focuses attention heavily on a single character. In contrast, the sigmoid and structured models are able to spread their attention distribution on contiguous subsequences. The structured attention learns additional parameters (i.e. b) to smooth out this type of attention.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 4: Visualization of the source attention distribution for the simple (top left), sigmoid (top right), and structured (bottom left) attention models over the ground truth sentence on the character-to-word translation task. Manually-annotated alignments are shown in bottom right. Each row delineates the attention weights over the source sentence at each step of decoding. The sigmoid/structured attention models are able learn an implicit segmentation model and focus on multiple characters at each time step.
|
| 194 |
+
|
| 195 |
+
# 4.3 QUESTION ANSWERING
|
| 196 |
+
|
| 197 |
+
Our third experiment is on question answering (QA) with the linear-chain CRF attention layer for inference over multiple facts. We use the bAbI dataset (Weston et al., 2015), where the input is a set of sentences/facts paired with a question, and the answer is a single token. For many of the tasks the model has to attend to multiple supporting facts to arrive at the correct answer (see Figure 5 for an example), and existing approaches use multiple ‘hops’ to greedily attend to different facts. We experiment with employing structured attention to perform inference in a non-greedy way. As the ground truth supporting facts are given in the dataset, we are able to assess the model’s inference accuracy.
|
| 198 |
+
|
| 199 |
+
The baseline (simple) attention model is the End-To-End Memory Network (Sukhbaatar et al., 2015) (MemN2N), which we briefly describe here. See Appendix A.4 for full model details. Let $\mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n }$ be the input embedding vectors for the $n$ sentences/facts and let $\mathbf { q }$ be the query embedding. In MemN2N, $z _ { k }$ is the random variable for the sentence to select at the $k$ -th inference step (i.e. $k$ -th hop), and thus $z _ { k } \in \{ 1 , \ldots , n \}$ . The probability distribution over $z _ { k }$ is given by $p ( z _ { k } =$ $i \mid x , q ) = \mathrm { s o f t m a x } ( ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k } )$ , and the context vector is given by $\begin{array} { r } { \mathbf { c } ^ { k } = \sum _ { i = 1 } ^ { n } p ( \bar { z } _ { k } = i \bar { | x , q ) } \mathbf { o } _ { i } ^ { k } } \end{array}$ , where $\mathbf { x } _ { i } ^ { k } , \mathbf { o } _ { i } ^ { k }$ are the input and output embedding for the $i$ -th sentence at the $k$ -th hop, respectively. The $k$ -th context vector is used to modify the query $\mathbf { q } ^ { k + 1 } = \mathbf { q } ^ { k } + \mathbf { c } ^ { k }$ , and this process repeats for $k = 1 , \ldots , K$ (for $k = 1$ we have $\mathbf { x } _ { i } ^ { k } = \mathbf { \bar { x } } _ { i } , \mathbf { q } ^ { k ^ { - } } = \mathbf { \bar { q } } , \bar { \mathbf { c } } ^ { k } = \mathbf { 0 } )$ . The $K$ -th context and query vectors are used to obtain the final answer. The attention mechanism for a $K$ -hop MemN2N network can therefore be interpreted as a greedy selection of a length- $K$ sequence of facts (i.e. $z _ { 1 } , \dotsc , z _ { K } )$ .
|
| 200 |
+
|
| 201 |
+
For structured attention, we use an $n$ -state, $K$ -step linear-chain CRF.7 We experiment with two different settings: (a) a unary CRF model with node potentials
|
| 202 |
+
|
| 203 |
+
$$
|
| 204 |
+
\theta _ { k } ( i ) = ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k }
|
| 205 |
+
$$
|
| 206 |
+
|
| 207 |
+
Table 4: Answer accuracy (Ans $\%$ ) and supporting fact selection accuracy (Fact $\%$ ) of the three QA models on the 1K bAbI dataset. $K$ indicates the number of hops/inference steps used for each task. Task 7 and 8 both contain variable number of facts and hence they are excluded from the fact accuracy measurement. Supporting fact selection accuracy is calculated by taking the average of 10 best runs (out of 20) for each task.
|
| 208 |
+
|
| 209 |
+
<table><tr><td></td><td></td><td colspan="2">MemN2N</td><td colspan="2">Binary CRF</td><td colspan="2">Unary CRF</td></tr><tr><td>Task</td><td>K</td><td>Ans %</td><td>Fact %</td><td>Ans %</td><td>Fact %</td><td>Ans %</td><td>Fact %</td></tr><tr><td>TASK O2-TWO SUPPORTING FACTS</td><td>2</td><td>87.3</td><td>46.8</td><td>84.7</td><td>81.8</td><td>43.5</td><td>22.3</td></tr><tr><td>TASK O3 -THREE SUPPORTING FACTS</td><td>3</td><td>52.6</td><td>1.4</td><td>40.5</td><td>0.1</td><td>28.2</td><td>0.0</td></tr><tr><td>TASK 07 - COUNTING</td><td>3</td><td>83.2</td><td>1</td><td>83.5</td><td>1</td><td>79.3</td><td>1</td></tr><tr><td>TASK O8 -LISTS SETS</td><td>3</td><td>94.1</td><td>1</td><td>93.3</td><td>1</td><td>87.1</td><td>一</td></tr><tr><td>TASK11- INDEFINITE KNOWLEDGE</td><td>2</td><td>97.8</td><td>38.2</td><td>97.7</td><td>80.8</td><td>88.6</td><td>0.0</td></tr><tr><td>TASK 13 - COMPOUND COREFERENCE</td><td>2</td><td>95.6</td><td>14.8</td><td>97.0</td><td>36.4</td><td>94.4</td><td>9.3</td></tr><tr><td>TASK14 - TIME REASONING</td><td>2</td><td>99.9</td><td>77.6</td><td>99.7</td><td>98.2</td><td>90.5</td><td>30.2</td></tr><tr><td>TASK 15 - BASIC DEDUCTION</td><td>2</td><td>100.0</td><td>59.3</td><td>100.0</td><td>89.5</td><td>100.0</td><td>51.4</td></tr><tr><td>TASK 16 -BASIC INDUCTION</td><td>3</td><td>97.1</td><td>91.0</td><td>97.9</td><td>85.6</td><td>98.0</td><td>41.4</td></tr><tr><td>TASK17 - POSITIONAL REASONING</td><td>2</td><td>61.1</td><td>23.9</td><td>60.6</td><td>49.6</td><td>59.7</td><td>10.5</td></tr><tr><td>TASK 18 - SIZE REASONING</td><td>2</td><td>86.4</td><td>3.3</td><td>92.2</td><td>3.9</td><td>92.0</td><td>1.4</td></tr><tr><td>TASK 19 - PATH FINDING</td><td>2</td><td>21.3</td><td>10.2</td><td>24.4</td><td>11.5</td><td>24.3</td><td>7.8</td></tr><tr><td>AVERAGE</td><td>1</td><td>81.4</td><td>39.6</td><td>81.0</td><td>53.7</td><td>73.8</td><td>17.4</td></tr></table>
|
| 210 |
+
|
| 211 |
+
and (b) a binary CRF model with pairwise potentials
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
\theta _ { k , k + 1 } ( i , j ) = ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k } + ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { x } _ { j } ^ { k + 1 } + ( \mathbf { x } _ { j } ^ { k + 1 } ) ^ { \top } \mathbf { q } ^ { k + 1 }
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
The binary CRF model is designed to test the model’s ability to perform sequential reasoning. For both (a) and (b), a single context vector is computed: $\begin{array} { r } { \mathbf { c } = \sum _ { z _ { 1 } , \dots , z _ { K } } p ( z _ { 1 } , \dots , z _ { K } \mid x , q ) f ( x , z ) } \end{array}$ (unlike MemN2N which computes $K$ context vectors). Evaluating c requires summing over all $n ^ { K }$ possible sequences of length $K$ , which may not be practical for large values of $K$ . However, if $f ( x , z )$ factors over the components of $z$ (e.g. $\begin{array} { r } { f ( x , z ) = \sum _ { k = 1 } ^ { K } f _ { k } ( x , z _ { k } ) ) } \end{array}$ then one can rewrite the above sum in terms of marginals: $\begin{array} { r } { \mathbf { c } = \sum _ { k = 1 } ^ { K } \sum _ { i = 1 } ^ { n } p ( z _ { k } = i | x , q ) f _ { k } ( x , z _ { k } ) } \end{array}$ . In our experiments, we use $f _ { k } ( x , z _ { k } ) = \mathbf { o } _ { z _ { k } } ^ { k }$ . All three models are described in further detail in Appendix A.4.
|
| 218 |
+
|
| 219 |
+
Results We use the version of the dataset with 1K questions for each task. Since all models reduce to the same network for tasks with 1 supporting fact, they are excluded from our experiments. The number of hops (i.e. $K$ ) is task-dependent, and the number of memories (i.e. $^ { n ) }$ is limited to be at most 25 (note that many question have less than 25 facts—e.g. the example in Figure 5 has 9 facts). Due to high variance in model performance, we train 20 models with different initializations for each task and report the test accuracy of the model that performed the best on a $1 0 \%$ held-out validation set (as is typically done for bAbI tasks).
|
| 220 |
+
|
| 221 |
+
Results of the three different models are shown in Table 4. For correct answer seletion (Ans $\%$ ), we find that MemN2N and the Binary CRF model perform similarly while the Unary CRF model does worse, indicating the importance of including pairwise potentials. We also assess each model’s ability to attend to the correct supporting facts in Table 4 (Fact $\%$ ). Since ground truth supporting facts are provided for each query, we can check the sequence accuracy of supporting facts for each model (i.e. the rate of selecting the exact correct sequence of facts) by taking the highest probability sequence $\hat { z } =$ argmax $p ( z _ { 1 } , \dots , z _ { K } \mid x , q )$ from the model and checking against the ground truth. Overall the Binary CRF is able to recover supporting facts better than MemN2N. This improvement is significant and can be up to two-fold as seen for task 2, 11, 13 & 17. However we observed that on many tasks it is sufficient to select only the last (or first) fact correctly to predict the answer, and thus higher sequence selection accuracy does not necessarily imply better answer accuracy (and vice versa). For example, all three models get $1 0 0 \%$ answer accuracy on task 15 but have different supporting fact accuracies.
|
| 222 |
+
|
| 223 |
+
Finally, in Figure 5 we visualize of the output edge marginals produced by the Binary CRF model for a single question in task 16. In this instance, the model is uncertain but ultimately able to select the right sequence of facts $5 6 8$ .
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Correct Facts:5.6.8
|
| 227 |
+
Figure 5: Visualization of the attention distribution over supporting fact sequences for an example question in task 16 for the Binary CRF model. The actual question is displayed at the bottom along with the correct answer and the ground truth supporting facts $5 6 8$ ). The edges represent the marginal probabilities $p ( z _ { k } , z _ { k + 1 } \mid x , q )$ , and the nodes represent the $n$ supporting facts (here we have $n = 9$ ). The text for the supporting facts are shown on the left. The top three most likely sequences are: $p ( z _ { 1 } = 5 , z _ { 2 } = 6 , z _ { 3 } =$ $8 \hat { | x , q ) = } 0 . 0 5 6 4$ , $p ( z _ { 1 } = 5 , z _ { 2 } = 6 , z _ { 3 } = 3 | { \bar { x } } , q ) = 0 . 0 3 6 4 , p ( z _ { 1 } = 5 , z _ { 2 } = 2 , z _ { 3 } = 3 | x , q ) = 0 . 0 3 5 6$ .
|
| 228 |
+
|
| 229 |
+
# 4.4 NATURAL LANGUAGE INFERENCE
|
| 230 |
+
|
| 231 |
+
The final experiment looks at the task of natural language inference (NLI) with the syntactic attention layer. In NLI, the model is given two sentences (hypothesis/premise) and has to predict their relationship: entailment, contradiction, neutral.
|
| 232 |
+
|
| 233 |
+
For this task, we use the Stanford NLI dataset (Bowman et al., 2015) and model our approach off of the decomposable attention model of Parikh et al. (2016). This model takes in the matrix of word embeddings as the input for each sentence and performs inter-sentence attention to predict the answer. Appendix A.5 describes the full model.
|
| 234 |
+
|
| 235 |
+
As in the transduction task, we focus on modifying the input representation to take into account soft parents via self-attention (i.e. intra-sentence attention). In addition to the three baselines described for tree transduction (No Attention, Simple, Structured), we also explore two additional settings: (d) hard pipeline parent selection, i.e. $\hat { \mathbf { x } } _ { j } = [ \mathbf { x } _ { j } ; \mathbf { x } _ { \mathrm { h e a d } ( j ) } ]$ , where ${ \mathrm { h e a d } } ( j )$ is the index of $x _ { j }$ ’s parent8; (e) pretrained structured attention: structured attention where the parsing layer is pretrained for one epoch on a parsed dataset (which was enough for convergence).
|
| 236 |
+
|
| 237 |
+
Results Results of our models are shown in Table 5. Simple attention improves upon the no attention model, and this is consistent with improvements observed by Parikh et al. (2016) with their intra-sentence attention model. The pipelined model with hard parents also slightly improves upon the baseline. Structured attention outperforms both models, though surprisingly, pretraining the syntactic attention layer on the parse trees performs worse than training it from scratch—it is possible that the pretrained attention is too strict for this task.
|
| 238 |
+
|
| 239 |
+
We also obtain the hard parse for an example sentence by running the Viterbi algorithm on the syntactic attention layer with the non-pretrained model:
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
|
| 243 |
+
Table 5: Results of our models (bottom) and others (top) on the Stanford NLI test set. Our baseline model has the same architecture as Parikh et al. (2016) but the performance is slightly different due to different settings (e.g. we train for 100 epochs with a batch size of 32 while Parikh et al. (2016) train for 400 epochs with a batch size of 4 using asynchronous SGD.)
|
| 244 |
+
|
| 245 |
+
<table><tr><td>Model</td><td>Accuracy %</td></tr><tr><td>Handcrafted features (Bowman et al.,2015)</td><td>78.2</td></tr><tr><td>LSTM encoders (Bowman et al.,2015)</td><td>80.6</td></tr><tr><td>Tree-Based CNN (Mou et al.,2016)</td><td>82.1</td></tr><tr><td>Stack-Augmented Parser-Interpreter Neural Net (Bowman et al., 2016)</td><td>83.2</td></tr><tr><td>LSTM with word-by-word attention (Rocktäschel et al., 2016)</td><td>83.5</td></tr><tr><td>MatchingLSTMs (Wang & Jiang,2016)</td><td>86.1</td></tr><tr><td>Decomposable attention over word embeddings (Parikh et al., 2016)</td><td>86.3</td></tr><tr><td>Decomposable attention + intra-sentence attention (Parikh et al.,2016)</td><td>86.8</td></tr><tr><td>Attention over constituency tree nodes (Zhao et al.,2016)</td><td>87.2</td></tr><tr><td>Neural Tree Indexers (Munkhdalai & Yu,2016)</td><td>87.3</td></tr><tr><td>Enhanced BiLSTMInference Model (Chen et al.,2016)</td><td>87.7</td></tr><tr><td>Enhanced BiLSTM Inference Model + ensemble (Chen et al.,2016)</td><td>88.3</td></tr><tr><td>No Attention</td><td>85.8</td></tr><tr><td>No Attention +Hard parent</td><td>86.1</td></tr><tr><td>Simple Attention</td><td>86.2</td></tr><tr><td>Structured Attention</td><td>86.8</td></tr><tr><td>Pretrained Structured Attention</td><td>86.5</td></tr></table>
|
| 246 |
+
|
| 247 |
+
Despite being trained without ever being exposed to an explicit parse tree, the syntactic attention layer learns an almost plausible dependency structure. In the above example it is able to correctly identify the main verb fighting, but makes mistakes on determiners (e.g. head of The should be men). We generally observed this pattern across sentences, possibly because the verb structure is more important for the inference task.
|
| 248 |
+
|
| 249 |
+
# 5 CONCLUSION
|
| 250 |
+
|
| 251 |
+
This work outlines structured attention networks, which incorporate graphical models to generalize simple attention, and describes the technical machinery and computational techniques for backpropagating through models of this form. We implement two classes of structured attention layers: a linear-chain CRF (for neural machine translation and question answering) and a more complicated first-order dependency parser (for tree transduction and natural language inference). Experiments show that this method can learn interesting structural properties and improve on top of standard models. Structured attention could also be a way of learning latent labelers or parsers through attention on other tasks.
|
| 252 |
+
|
| 253 |
+
It should be noted that the additional complexity in computing the attention distribution increases run-time—for example, structured attention was approximately $5 \times$ slower to train than simple attention for the neural machine translation experiments, even though both attention layers have the same asymptotic run-time (i.e. $O ( n )$ ).
|
| 254 |
+
|
| 255 |
+
Embedding differentiable inference (and more generally, differentiable algorithms) into deep models is an exciting area of research. While we have focused on models that admit (tractable) exact inference, similar technique can be used to embed approximate inference methods. Many optimization algorithms (e.g. gradient descent, LBFGS) are also differentiable (Domke, 2012; Maclaurin et al., 2015), and have been used as output layers for structured prediction in energy-based models (Belanger & McCallum, 2016; Wang et al., 2016). Incorporating them as internal neural network layers is an interesting avenue for future work.
|
| 256 |
+
|
| 257 |
+
# ACKNOWLEDGMENTS
|
| 258 |
+
|
| 259 |
+
We thank Tao Lei, Ankur Parikh, Tim Vieira, Matt Gormley, Andre Martins, Jason Eisner, Yoav ´ Goldberg, and the anonymous reviewers for helpful comments, discussion, notes, and code. We additionally thank Yasumasa Miyamoto for verifying Japanese-English translations.
|
| 260 |
+
|
| 261 |
+
# REFERENCES
|
| 262 |
+
|
| 263 |
+
Daniel Andor, Chris Alberti, David Weiss, Aliaksei Severyn, Alessandro Presta, Kuzman Ganchev, Slav Petrov, and Michael Collins. Globally Normalized Transition-Based Neural Networks. In Proceedings of ACL, 2016.
|
| 264 |
+
|
| 265 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In Proceedings of ICLR, 2015.
|
| 266 |
+
|
| 267 |
+
James K. Baker. Trainable Grammars for Speech Recognition. Speech Communication Papers for the 97th Meeting of the Acoustical Society, 1979.
|
| 268 |
+
|
| 269 |
+
David Belanger and Andrew McCallum. Structured Prediction Energy Networks. In Proceedings of ICML, 2016.
|
| 270 |
+
|
| 271 |
+
Samuel R. Bowman, Christopher D. Manning, and Christopher Potts. Tree-Structured Composition in Neural Networks without Tree-Structured Architectures. In Proceedings of the NIPS workshop on Cognitive Computation: Integrating Neural and Symbolic Approaches, 2015.
|
| 272 |
+
|
| 273 |
+
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 Proceedings of ACL, 2016.
|
| 274 |
+
|
| 275 |
+
William Chan, Navdeep Jaitly, Quoc Le, and Oriol Vinyals. Listen, Attend and Spell. arXiv:1508.01211, 2015.
|
| 276 |
+
|
| 277 |
+
Liang-Chieh Chen, Alexander G. Schwing, Alan L. Yuille, and Raquel Urtasun. Learning Deep Structured Models. In Proceedings of ICML, 2015.
|
| 278 |
+
|
| 279 |
+
Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, and Hui Jiang. Enhancing and Combining Sequential and Tree LSTM for Natural Language Inference. arXiv:1609.06038, 2016.
|
| 280 |
+
|
| 281 |
+
Kyunghyun Cho, Aaron Courville, and Yoshua Bengio. Describing Multimedia Content using Attention-based Encoder-Decoder Networks. In IEEE Transactions on Multimedia, 2015.
|
| 282 |
+
|
| 283 |
+
Jan Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-Based Models for Speech Recognition. In Proceedings of NIPS, 2015.
|
| 284 |
+
|
| 285 |
+
Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natural Language Processing (almost) from Scratch. Journal of Machine Learning Research, 12:2493–2537, 2011.
|
| 286 |
+
|
| 287 |
+
Trinh-Minh-Tri Do and Thierry Artieres. Neural Conditional Random Fields. In ´ Proceedings of AISTATS, 2010.
|
| 288 |
+
|
| 289 |
+
Justin Domke. Parameter Learning with Truncated Message-Passing. In Proceedings of CVPR, 2011.
|
| 290 |
+
|
| 291 |
+
Justin Domke. Generic methods for optimization-based modeling. In AISTATS, pp. 318–326, 2012.
|
| 292 |
+
|
| 293 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12:2021–2159, 2011.
|
| 294 |
+
|
| 295 |
+
Greg Durrett and Dan Klein. Neural CRF Parsing. In Proceedings of ACL, 2015.
|
| 296 |
+
|
| 297 |
+
Jason M. Eisner. Three New Probabilistic Models for Dependency Parsing: An Exploration. In Proceedings of ACL, 1996.
|
| 298 |
+
|
| 299 |
+
Jason M. Eisner. Inside-Outside and Forward-Backward Algorithms are just Backprop. In Proceedings of Structured Prediction Workshop at EMNLP, 2016.
|
| 300 |
+
|
| 301 |
+
Matthew R. Gormley, Mark Dredze, and Jason Eisner. Approximation-Aware Dependency Parsing by Belief Propagation. In Proceedings of TACL, 2015.
|
| 302 |
+
|
| 303 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural Turing Machines. arXiv:1410.5401, 2014.
|
| 304 |
+
|
| 305 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio Gomez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adria Puigdomenech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid Computing Using a Neural Network with Dynamic External Memory. Nature, October 2016.
|
| 306 |
+
|
| 307 |
+
Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to Transduce with Unbounded Memory. In Proceedings of NIPS, 2015.
|
| 308 |
+
|
| 309 |
+
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching Machines to Read and Comprehend. In Proceedings of NIPS, 2015.
|
| 310 |
+
|
| 311 |
+
Max Jaderberg, Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep Structured Output Learning for Unconstrained Text Recognition. In Proceedings of ICLR, 2014.
|
| 312 |
+
|
| 313 |
+
Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In Proceedings of ICLR, 2015.
|
| 314 |
+
|
| 315 |
+
Eliyahu Kipperwasser and Yoav Goldberg. Simple and Accurate Dependency Parsing using Bidirectional LSTM Feature Representations. In TACL, 2016.
|
| 316 |
+
|
| 317 |
+
Lingpeng Kong, Chris Dyer, and Noah A. Smith. Segmental Recurrent Neural Networks. In Proceedings of ICLR, 2016.
|
| 318 |
+
|
| 319 |
+
John Lafferty, Andrew McCallum, and Fernando Pereira. Conditional Random Fields: Probabilistic Models for Segmenting and Labeling Sequence Data. In Proceedings of ICML, 2001.
|
| 320 |
+
|
| 321 |
+
Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural Architectures for Named Entity Recognition. In Proceedings of NAACL, 2016.
|
| 322 |
+
|
| 323 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based Learning Applied to Document Recognition. In Proceedings of IEEE, 1998.
|
| 324 |
+
|
| 325 |
+
Zhifei Li and Jason Eisner. First- and Second-Order Expectation Semirings with Applications to Minimum-Risk Training on Translation Forests. In Proceedings of EMNLP 2009, 2009.
|
| 326 |
+
|
| 327 |
+
Liang Lu, Lingpeng Kong, Chris Dyer, Noah A. Smith, and Steve Renals. Segmental Recurrent Neural Networks for End-to-End Speech Recognition. In Proceedings of INTERSPEECH, 2016.
|
| 328 |
+
|
| 329 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D. Manning. Effective Approaches to Attentionbased Neural Machine Translation. In Proceedings of EMNLP, 2015.
|
| 330 |
+
|
| 331 |
+
Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Gradient-based Hyperparameter Optimization through Reversible Learning. In Proceedings of ICML, 2015.
|
| 332 |
+
|
| 333 |
+
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 Proceedings of ACL, 2016.
|
| 334 |
+
|
| 335 |
+
Tsendsuren Munkhdalai and Hong Yu. Neural Tree Indexers for Text Understanding. arxiv:1607.04492, 2016.
|
| 336 |
+
|
| 337 |
+
Toshiaki Nakazawa, Manabu Yaguchi, Kiyotaka Uchimoto, Masao Utiyama, Eiichiro Sumita, Sadao Kurohashi, and Hitoshi Isahara. Aspec: Asian scientific paper excerpt corpus. In Nicoletta Calzolari (Conference Chair), Khalid Choukri, Thierry Declerck, Marko Grobelnik, Bente Maegaard, Joseph Mariani, Asuncion Moreno, Jan Odijk, and Stelios Piperidis (eds.), Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC 2016), pp. 2204– 2208, Portoro, Slovenia, may 2016. European Language Resources Association (ELRA). ISBN 978-2-9517408-9-1.
|
| 338 |
+
|
| 339 |
+
Graham Neubig, Yosuke Nakata, and Shinsuke Mori. Pointwise Prediction for Robust, Adaptable Japanese Morphological Analysis. In Proceedings of ACL, 2011.
|
| 340 |
+
|
| 341 |
+
Ankur P. Parikh, Oscar Tackstrom, Dipanjan Das, and Jakob Uszkoreit. A Decomposable Attention Model for Natural Language Inference. In Proceedings of EMNLP, 2016.
|
| 342 |
+
|
| 343 |
+
Jian Peng, Liefeng Bo, and Jinbo Xu. Conditional Neural Fields. In Proceedings of NIPS, 2009.
|
| 344 |
+
|
| 345 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. GloVe: Global Vectors for Word Representation. In Proceedings of EMNLP, 2014.
|
| 346 |
+
|
| 347 |
+
Tim Rocktaschel, Edward Grefenstette, Karl Moritz Hermann, Tomas Kocisky, and Phil Blunsom. ¨ Reasoning about Entailment with Neural Attention. In Proceedings of ICLR, 2016.
|
| 348 |
+
|
| 349 |
+
John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In Advances in Neural Information Processing Systems, pp. 3528– 3536, 2015.
|
| 350 |
+
|
| 351 |
+
David A. Smith and Jason Eisner. Dependency Parsing as Belief Propagation. In Proceedings of EMNLP, 2008.
|
| 352 |
+
|
| 353 |
+
Veselin Stoyanov and Jason Eisner. Minimum-Risk Training of Approximate CRF-based NLP Systems. In Proceedings of NAACL, 2012.
|
| 354 |
+
|
| 355 |
+
Veselin Stoyanov, Alexander Ropson, and Jason Eisner. Empirical Risk Minimization of Graphical Model Parameters Given Approximate Inference, Decoding, and Model Structure. In Proceedings of AISTATS, 2011.
|
| 356 |
+
|
| 357 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-To-End Memory Networks. In Proceedings of NIPS, 2015.
|
| 358 |
+
|
| 359 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer Networks. In Proceedings of NIPS, 2015.
|
| 360 |
+
|
| 361 |
+
Shenlong Wang, Sanja Fidler, and Raquel Urtasun. Proximal Deep Structured Models. In Proceedings of NIPS, 2016.
|
| 362 |
+
|
| 363 |
+
Shuohang Wang and Jing Jiang. Learning Natural Language Inference with LSTM. In Proceedings of NAACL, 2016.
|
| 364 |
+
|
| 365 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory Networks. arXiv:1410.3916, 2014.
|
| 366 |
+
|
| 367 |
+
Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merrienboer, Armand ¨ Joulin, and Tomas Mikolov. Towards Ai-complete Question Answering: A Set of Prerequisite Toy Tasks. arXiv preprint arXiv:1502.05698, 2015.
|
| 368 |
+
|
| 369 |
+
Kelvin Xu, Jimma Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, Attend and Tell: Neural Image Caption Generation with Visual Attention. In Proceedings of ICML, 2015.
|
| 370 |
+
|
| 371 |
+
Lei Yu, Jan Buys, and Phil Blunsom. Online Segment to Segment Neural Transduction. In Proceedings of EMNLP, 2016.
|
| 372 |
+
|
| 373 |
+
Lei Yu, Phil Blunsom, Chris Dyer, Edward Grefenstette, and Tomas Kocisky. The Neural Noisy Channel. In Proceedings of ICLR, 2017.
|
| 374 |
+
|
| 375 |
+
Kai Zhao, Liang Huang, and Minbo Ma. Textual Entailment with Structured Attentions and Composition. In Proceedings of COLING, 2016.
|
| 376 |
+
|
| 377 |
+
# APPENDICES
|
| 378 |
+
|
| 379 |
+
A MODEL DETAILS
|
| 380 |
+
|
| 381 |
+
# A.1 SYNTACTIC ATTENTION
|
| 382 |
+
|
| 383 |
+
The syntactic attention layer (for tree transduction and natural language inference) is similar to the first-order graph-based dependency parser of Kipperwasser & Goldberg (2016). Given an input sentence $[ x _ { 1 } , \ldots , x _ { n } ]$ and the corresponding word vectors $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right]$ , we use a bidirectional LSTM to get the hidden states for each time step $i \in [ 1 , \ldots , n ]$ ,
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r } { \mathbf { h } _ { i } ^ { \mathrm { f w d } } = \mathrm { L S T M } ( \mathbf { x } _ { i } , \mathbf { h } _ { i - 1 } ^ { \mathrm { f w d } } ) \qquad \mathbf { h } _ { i } ^ { \mathrm { b w d } } = \mathrm { L S T M } ( \mathbf { x } _ { i } , \mathbf { h } _ { i + 1 } ^ { \mathrm { b w d } } ) \qquad \mathbf { h } _ { i } = [ \mathbf { h } _ { i } ^ { \mathrm { f w d } } ; \mathbf { h } _ { i } ^ { \mathrm { b w d } } ] } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
where the forward and backward LSTMs have their own parameters. The score for $x _ { i } \to x _ { j }$ (i.e. $x _ { i }$ is the parent of $x _ { j }$ ), is given by an MLP
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\theta _ { i j } = \operatorname { t a n h } ( \mathbf { s } ^ { \top } \operatorname { t a n h } ( \mathbf { W } _ { 1 } \mathbf { h } _ { i } + \mathbf { W } _ { 2 } \mathbf { h } _ { j } + \mathbf { b } ) )
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
These scores are used as input to the inside-outside algorithm (see Appendix B) to obtain the probability of each word’s parent $p ( z _ { i j } = 1 | x )$ , which is used to obtain the soft-parent $\mathbf { c } _ { j }$ for each word $x _ { j }$ . In the non-structured case we simply have $p ( z _ { i j } = 1 | x ) = \mathrm { s o f t m a x } ( \theta _ { i j } )$ .
|
| 396 |
+
|
| 397 |
+
# A.2 TREE TRANSDUCTION
|
| 398 |
+
|
| 399 |
+
Let $[ x _ { 1 } , \ldots , x _ { n } ]$ , $[ y _ { 1 } , \dots , y _ { m } ]$ be the sequence of source/target symbols, with the associated embeddings $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right]$ , $\left[ \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { m } \right]$ with $\bar { \mathbf { \eta } } _ { \bar { \mathbf { \eta } } _ { i } , \mathbf { \bar { y } } _ { j } } \in \mathbb { R } ^ { l }$ . In the simplest baseline model we take the source representation to be the matrix of the symbol embeddings. The decoder is a one-layer LSTM which produces the hidden states $\mathbf h _ { j } ^ { \prime } = \mathrm { L S T M } ( \mathbf y _ { j } , \mathbf h _ { j - 1 } ^ { \prime } )$ , with $\mathbf { h } _ { j } ^ { \prime } \in \mathbb { R } ^ { l }$ . The hidden states are combined with the input representation via a bilinear map $\mathbf { W } \in \mathbb { R } ^ { l \times l }$ to produce the attention distribution used to obtain the vector $\mathbf { m } _ { i }$ , which is combined with the decoder hidden state as follows,
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\alpha _ { i } = { \frac { \exp \mathbf { x } _ { i } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } } { \sum _ { k = 1 } ^ { n } \exp \mathbf { x } _ { k } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } } } { \mathbf { m } _ { i } = \sum _ { i = 1 } ^ { n } \alpha _ { i } \mathbf { x } _ { i } } { \hat { \mathbf { h } } } _ { j } = { \mathrm { t a n h } } ( \mathbf { U } [ \mathbf { m } _ { i } ; \mathbf { h } _ { j } ^ { \prime } ] )
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Here we have $\mathbf { W } \in \mathbb { R } ^ { l \times l }$ and $\mathbf { U } \in \mathbb { R } ^ { 2 l \times l }$ . Finally, $\hat { \mathbf { h } } _ { j }$ is used to to obtain a distribution over the next symbol $y _ { j + 1 }$ ,
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
p ( y _ { j + 1 } \mid x _ { 1 } , \dots , x _ { n } , y _ { 1 } , \dots , y _ { j } ) = \mathrm { s o f t m a x } ( \mathbf { V } \hat { \mathbf { h } } _ { j } + \mathbf { b } )
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
For structured/simple models, the $j$ -th source representation are respectively
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\hat { \mathbf { x } } _ { i } = \left[ \mathbf { x } _ { i } ; \sum _ { k = 1 } ^ { n } p ( z _ { k i } = 1 | x ) \mathbf { x } _ { k } \right] \qquad \quad \hat { \mathbf { x } } _ { i } = \left[ \mathbf { x } _ { i } ; \sum _ { k = 1 } ^ { n } \mathrm { s o f t m a x } ( \theta _ { k i } ) \mathbf { x } _ { k } \right]
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
where $\theta _ { i j }$ comes from the bidirectional LSTM described in A.1. Then $\alpha _ { i }$ and $\mathbf { m } _ { i }$ changed accordingly,
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\alpha _ { i } = \frac { \exp \hat { \mathbf { x } } _ { i } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } } { \sum _ { k = 1 } ^ { n } \exp \hat { \mathbf { x } } _ { k } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } } \qquad \quad \mathbf { m } _ { i } = \sum _ { i = 1 } ^ { n } \alpha _ { i } \hat { \mathbf { x } } _ { i }
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Note that in this case we have $\mathbf { W } \in \mathbb { R } ^ { 2 l \times l }$ and $\mathbf { U } \in \mathbb { R } ^ { 3 l \times l }$ . We use $l = 5 0$ in all our experiments. The forward/backward LSTMs for the parsing LSTM are also 50-dimensional. Symbol embeddings are shared between the encoder and the parsing LSTMs.
|
| 424 |
+
|
| 425 |
+
Additional training details include: batch size of 20; training for 13 epochs with a learning rate of 1.0, which starts decaying by half after epoch 9 (or the epoch at which performance does not improve on validation, whichever comes first); parameter initialization over a uniform distribution $U [ - 0 . 1 , 0 . 1 ]$ ; gradient normalization at 1 (i.e. renormalize the gradients to have norm 1 if the $l _ { 2 }$ norm exceeds 1). Decoding is done with beam search (beam size $= 5$ ).
|
| 426 |
+
|
| 427 |
+
# A.3 NEURAL MACHINE TRANSLATION
|
| 428 |
+
|
| 429 |
+
The baseline NMT system is from Luong et al. (2015). Let $[ x _ { 1 } , \ldots , x _ { n } ]$ , $[ y _ { 1 } , \dots , y _ { m } ]$ be the source/target sentence, with the associated word embeddings $[ { \bf x } _ { 1 } , \ldots , { \bf x } _ { n } ] , [ { \bf y } _ { 1 } , \ldots , { \bf y } _ { m } ] .$ The encoder is an LSTM over the source sentence, which produces the hidden states $[ \mathbf { h } _ { 1 } , \ldots , \mathbf { h } _ { n } ]$ where
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\mathbf h _ { i } = \mathrm { L S T M } ( \mathbf x _ { i } , \mathbf h _ { i - 1 } )
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
and $\mathbf { h } _ { i } \in \mathbb { R } ^ { l }$ . The decoder is another LSTM which produces the hidden states $\mathbf { h } _ { j } ^ { \prime } \in \mathbb { R } ^ { l }$ . In the simple attention case with categorical attention, the hidden states are combined with the input representation via a bilinear map $\mathbf { W } \in \mathbb { R } ^ { l \times l }$ and this distribution is used to obtain the context vector at the $j$ -th time step,
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\theta _ { i } = \mathbf { h } _ { i } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } \ \mathbf { \epsilon } \qquad \mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } \mathrm { s o f t m a x } ( \theta _ { i } ) \mathbf { h } _ { i }
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
The Bernoulli attention network has the same $\theta _ { i }$ but instead uses a sigmoid to obtain the weights of the linear combination, i.e.,
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } \mathrm { s i g m o i d } ( \theta _ { i } ) \mathbf { h } _ { i }
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
And finally, the structured attention model uses a bilinear map to parameterize one of the unary potentials
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
\theta _ { i } ( k ) = \left\{ \begin{array} { l l } { \mathbf { h } _ { i } \mathbf { W } \mathbf { h } _ { j } ^ { \prime } , } & { k = 1 } \\ { 0 , } & { k = 0 } \end{array} \right.
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\theta _ { i , i + 1 } ( z _ { i } , z _ { i + 1 } ) = \theta _ { i } ( z _ { i } ) + \theta _ { i + 1 } ( z _ { i + 1 } ) + \mathbf { b } _ { z _ { i } , z _ { i + 1 } }
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
where $\mathbf { b }$ are the pairwise potentials. These potentials are used as inputs to the forward-backward algorithm to obtain the marginals $p ( z _ { i } = 1 | x , q )$ , which are further normalized to obtain the context vector
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\mathbf { c } _ { j } = \sum _ { i = 1 } ^ { n } \frac { p ( z _ { i } = 1 | x , q ) } { \gamma } \mathbf { h } _ { i } \qquad \gamma = \frac { 1 } { \lambda } \sum _ { i } ^ { n } p ( z _ { i } = 1 | x , q )
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
We use $\lambda = 2$ and also add an $l _ { 2 }$ penalty of 0.005 on the pairwise potentials $\mathbf { b }$ . The context vector is then combined with the decoder hidden state
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\hat { \mathbf { h } } _ { j } = \operatorname { t a n h } ( \mathbf { U } [ \mathbf { c } _ { j } ; \mathbf { h } _ { j } ^ { \prime } ] )
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
and $\hat { \mathbf { h } } _ { j }$ is used to obtain the distribution over the next target word $y _ { j + 1 }$
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
p ( y _ { j + 1 } \mid x _ { 1 } , \ldots , x _ { n } , y _ { 1 } , \ldots y _ { j } ) = \mathrm { s o f t m a x } ( \mathbf { V } \hat { \mathbf { h } } _ { j } + \mathbf { b } )
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
The encoder/decoder LSTMs have 2 layers and 500 hidden units (i.e. $l = 5 0 0$ ).
|
| 476 |
+
|
| 477 |
+
Additional training details include: batch size of 128; training for 30 epochs with a learning rate of 1.0, which starts decaying by half after the first epoch at which performance does not improve on validation; dropout with probability 0.3; parameter initialization over a uniform distribution $U [ - 0 . 1 , 0 . 1 ]$ ; gradient normalization at 1. We generate target translations with beam search (beam $\mathrm { s i z e } = 5$ ), and evaluate with multi-bleu.perl from Moses.9
|
| 478 |
+
|
| 479 |
+
# A.4 QUESTION ANSWERING
|
| 480 |
+
|
| 481 |
+
Our baseline model (MemN2N) is implemented following the same architecture as described in Sukhbaatar et al. (2015). In particular, let $x = [ x _ { 1 } , \ldots , x _ { n } ]$ represent the sequence of $n$ facts with the associated embeddings $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right]$ and let $\mathbf { q }$ be the embedding of the query $q$ . The embeddings
|
| 482 |
+
|
| 483 |
+
are obtained by simply adding the word embeddings in each sentence or query. The full model with $K$ hops is as follows:
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\begin{array} { r l } & { p ( z _ { k } = i | x , q ) = \mathrm { s o f t m a x } ( ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k } ) } \\ & { \mathbf { c } ^ { k } = \displaystyle \sum _ { i = 1 } ^ { n } p ( z _ { k } = i | x , q ) \mathbf { o } _ { i } ^ { k } } \\ & { \mathbf { q } ^ { k + 1 } = \mathbf { q } ^ { k } + \mathbf { c } ^ { k } } \\ & { p ( y | x , q ) = \mathrm { s o f t m a x } ( \mathbf { W } ( \mathbf { q } ^ { K } + \mathbf { c } ^ { K } ) ) } \end{array}
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
where $p ( y \mid x , q )$ is the distribution over the answer vocabulary. At each layer, $\{ \mathbf { x } _ { i } ^ { k } \}$ and $\{ \mathbf { o } _ { i } ^ { k } \}$ are computed using embedding matrices $\mathbf { X } ^ { k }$ and $\mathbf { O } ^ { k }$ . We use the adjacent weight tying scheme from the paper so that $\mathbf { X } ^ { k + 1 } = \mathbf { \check { O } } ^ { k }$ , $\mathbf { W } ^ { T } = \mathbf { O } ^ { K }$ . $\mathbf { X } ^ { 1 }$ is also used to compute the query embedding at the first hop. For $k = 1$ we have $\mathbf { x } _ { i } ^ { k } = \mathbf { x } _ { i } , \mathbf { q } ^ { k } = \mathbf { q } , \mathbf { c } ^ { k } = \mathbf { 0 }$ .
|
| 490 |
+
|
| 491 |
+
For both the Unary and the Binary CRF models, the same input fact and query representations are computed (i.e. same embedding matrices with weight tying scheme). For the unary model, the potentials are parameterized as
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\theta _ { k } ( i ) = ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k }
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
and for the binary model we compute pairwise potentials as
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\theta _ { k , k + 1 } ( i , j ) = ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { q } ^ { k } + ( \mathbf { x } _ { i } ^ { k } ) ^ { \top } \mathbf { x } _ { j } ^ { k + 1 } + ( \mathbf { x } _ { j } ^ { k + 1 } ) ^ { \top } \mathbf { q } ^ { k + 1 }
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
The $\mathbf { q } ^ { k }$ ’s are updated simply with a linear mapping, i.e.
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\mathbf { q } ^ { k + 1 } = \mathbf { Q } \mathbf { q } ^ { k }
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
In the case of the Binary CRF, to discourage the model from selecting the same fact again we additionally set $\theta _ { k , k + 1 } ( i , i ) = - \infty$ for all $i \in \{ 1 , \ldots , n \}$ . Given these potentials, we compute the marginals $p ( z _ { k } = i , z _ { k + 1 } = j | x , q )$ using the forward-backward algorithm, which is then used to compute the context vector:
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
\mathbf { c } = \sum _ { z _ { 1 } , \ldots , z _ { K } } p ( z _ { 1 } , \ldots , z _ { K } | x , q ) f ( x , z ) \qquad f ( x , z ) = \sum _ { k = 1 } ^ { K } f _ { k } ( x , z _ { k } ) \qquad f _ { k } ( x , z _ { k } ) = \mathbf { o } _ { z _ { k } } ^ { k }
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
Note that if $f ( x , z )$ factors over the components of $z$ (as is the case above) then computing c only requires evaluating the marginals $p ( \boldsymbol { z } _ { k } | \boldsymbol { x } , \boldsymbol { q } )$ .
|
| 516 |
+
|
| 517 |
+
Finally, given the context vector the prediction is made in a similar fashion to MemN2N:
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
p ( \boldsymbol { y } \mid \boldsymbol { x } , \boldsymbol { q } ) = \mathrm { s o f t m a x } ( \mathbf { W } ( \mathbf { q } ^ { K } + \mathbf { c } ) )
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+
Other training setup is similar to Sukhbaatar et al. (2015): we use stochastic gradient descent with learning rate 0.01, which is divided by 2 every 25 epochs until 100 epochs are reached. Capacity of the memory is limited to 25 sentences. The embedding vectors are of size 20 and gradients are renormalized if the norm exceeds 40. All models implement position encoding, temporal encoding, and linear start from the original paper. For linear start, the softmax $( \cdot )$ function in the attention layer is removed at the beginning and re-inserted after 20 epochs for MemN2N, while for the CRF models we apply a $\log ( \operatorname { s o f t m a x } ( \cdot ) )$ layer on the $\mathbf { q } ^ { k }$ after 20 epochs. Each model is trained separately for each task.
|
| 524 |
+
|
| 525 |
+
# A.5 NATURAL LANGUAGE INFERENCE
|
| 526 |
+
|
| 527 |
+
Our baseline model/setup is essentially the same as that of Parikh et al. (2016). Let $[ x _ { 1 } , \ldots , x _ { n } ]$ , $[ y _ { 1 } , \dots , y _ { m } ]$ be the premise/hypothesis, with the corresponding input representations $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right]$ , $[ \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { m } ]$ . The input representations are obtained by a linear transformation of the 300-dimensional pretrained GloVe embeddings (Pennington et al., 2014) after normalizing the GloVe embeddings to have unit norm.10 The pretrained embeddings remain fixed but the linear layer (which is also 300-dimensional) is trained. Words not in the pretrained vocabulary are hashed to one of 100 Gaussian embeddings with mean 0 and standard deviation 1.
|
| 528 |
+
|
| 529 |
+
We concatenate each input representation with a convex combination of the other sentence’s input representations (essentially performing inter-sentence attention), where the weights are determined through a dot product followed by a softmax,
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
e _ { i j } = f ( \mathbf { x } _ { i } ) ^ { \top } f ( \mathbf { y } _ { j } ) \quad \bar { \mathbf { x } } _ { i } = \left[ \mathbf { x } _ { i } ; \sum _ { j = 1 } ^ { m } \frac { \exp e _ { i j } } { \sum _ { k = 1 } ^ { m } \exp e _ { i k } } \mathbf { y } _ { j } \right] \quad \bar { \mathbf { y } } _ { j } = \left[ \mathbf { y } _ { j } ; \sum _ { i = 1 } ^ { n } \frac { \exp e _ { i j } } { \sum _ { k = 1 } ^ { n } \exp e _ { k j } } \mathbf { x } _ { i } \right]
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
Here $f ( \cdot )$ is an MLP. The new representations are fed through another $\mathrm { { M L P } } g ( \cdot )$ , summed, combined with the final MLP $h ( \cdot )$ and fed through a softmax layer to obtain a distribution over the labels $l$ ,
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\begin{array} { c } { \displaystyle { \bar { \bf x } = \sum _ { i = 1 } ^ { n } g ( \bar { \bf x } _ { i } ) \qquad \bar { \bf y } = \sum _ { j = 1 } ^ { m } g ( \bar { \bf y } _ { j } ) } } \\ { { p ( l \mid x _ { 1 } , \dots , x _ { n } , y _ { 1 } , \dots , y _ { m } ) = \mathrm { s o f t m a x } ( { \bf V } h ( [ \bar { \bf x } ; \bar { \bf y } ] ) + { \bf b } ) } } \end{array}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
All the MLPs have 2-layers, 300 ReLU units, and dropout probability of 0.2. For structured/simple models, we first employ the bidirectional parsing LSTM (see A.1) to obtain the scores $\theta _ { i j }$ . In the structured case each word representation is simply concatenated with its soft-parent
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
{ \hat { \mathbf { x } } } _ { i } = \left[ \mathbf { x } _ { i } ; \sum _ { k = 1 } ^ { n } p ( z _ { k i } = 1 | x ) \mathbf { x } _ { k } \right]
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
and $\hat { \mathbf { x } } _ { i }$ (and analogously $\hat { \mathbf { y } } _ { j }$ ) is used as the input to the above model. In the simple case (which closely corresponds to the intra-sentence attention model of Parikh et al. (2016)), we have
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
{ \hat { \mathbf { x } } } _ { i } = \left[ \mathbf { x } _ { i } ; \sum _ { k = 1 } ^ { n } { \frac { \exp { \theta _ { k i } } } { \sum _ { l = 1 } ^ { n } { \exp { \theta _ { l i } } } } } \mathbf { x } _ { k } \right]
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
The word embeddings for the parsing LSTMs are also initialized with GloVe, and the parsing layer is shared between the two sentences. The forward/backward LSTMs for the parsing layer are 100- dimensional.
|
| 554 |
+
|
| 555 |
+
Additional training details include: batch size of 32; training for 100 epochs with Adagrad (Duchi et al., 2011) where the global learning rate is 0.05 and sum of gradient squared is initialized to 0.1; parameter intialization over a Gaussian distribution with mean 0 and standard deviation 0.01; gradient normalization at 5. In the pretrained scenario, pretraining is done with Adam (Kingma & Ba, 2015) with learning rate equal to 0.01, and $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ .
|
| 556 |
+
|
| 557 |
+
# B FORWARD/BACKWARD THROUGH THE INSIDE-OUTSIDE ALGORITHM
|
| 558 |
+
|
| 559 |
+
Figure 6 shows the procedure for obtaining the parsing marginals from the input potentials. This corresponds to running the inside-outside version of Eisner’s algorithm (Eisner, 1996). The intermediate data structures used during the dynamic programming algorithm are the (log) inside tables $\alpha$ , and the (log) outside tables $\beta$ . Both $\alpha , \beta$ are of size $n \times n \times 2 \times 2$ , where $n$ is the sentence length. First two dimensions encode the start/end index of the span (i.e. subtree). The third dimension encodes whether the root of the subtree is the left $( L )$ or right $( R )$ index of the span. The fourth dimension indicates if the span is complete (1) or incomplete (0). We can calculate the marginal distribution of each word’s parent (for all words) in $O ( n ^ { 3 } ) $ using this algorithm.
|
| 560 |
+
|
| 561 |
+
Backward pass through the inside-outside algorithm is slightly more involved, but still takes $O ( n ^ { 3 } )$ time. Figure 7 illustrates the backward procedure, which receives the gradient of the loss $\mathcal { L }$ with respect to the marginals, $\nabla _ { p } ^ { \mathcal { L } }$ , and computes the gradient of the loss with respect to the potentials $\nabla _ { \theta } ^ { \mathcal { L } }$ . The computations must be performed in the signed log-space semifield to handle log of negative values. See section 3.3 and Table 1 for more details.
|
| 562 |
+
|
| 563 |
+
rocedure INSIDEOUTSIDE(θ) $\alpha , \beta \gets - \infty$ . Initialize log of inside $( \alpha )$ , outside $( \beta )$ tables for $i = 1 , \ldots , n$ do α[i, i, L, 1] ← 0 α[i, i, R, 1] ← 0 $\beta [ 1 , n , R , 1 ] \gets 0$ for $k = 1 , \dots , n$ do . Inside step for $s = 1 , \ldots , n - k$ do t ← s + k $\begin{array} { r l } & { t s + k } \\ & { \alpha [ s , t , R , 0 ] \bigoplus _ { u \in [ s , t - 1 ] } \alpha [ s , u , R , 1 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { s t } } \\ & { \alpha [ s , t , L , 0 ] \bigoplus _ { u \in [ s , t - 1 ] } \alpha [ s , u , R , 1 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { t s } } \\ & { \alpha [ s , t , R , 1 ] \bigoplus _ { u \in [ s + 1 , t ] } \alpha [ s , u , R , 0 ] \otimes \alpha [ u , t , R , 1 ] } \\ & { \alpha [ s , t , L , 1 ] \bigoplus _ { u \in [ s , t - 1 ] } \alpha [ s , u , L , 1 ] \otimes \alpha [ u , t , L , 0 ] } \end{array}$ for $k = n , \ldots , 1$ do . Outside step for f $\begin{array} { r l } & { \mathrm { ~ \beta ~ = 1 , \dots , } n - k { \bf d o } } \\ & { \mathrm { ~ \beta ~ ~ } s + k } \\ & { \mathrm { ~ \bf \delta r ~ } u = s + 1 , \dots , t { \bf d o } } \\ & { \mathrm { ~ \beta ~ \beta ~ \beta ~ \geq ~ } \phi \mathrm { ~ \beta ~ } \beta [ s , t , R , 1 ] \otimes \alpha [ u , t , R , 1 ] } \\ & { \mathrm { ~ \beta ~ \beta ~ \geq ~ } \phi [ u , t , R , 1 ] _ { \Phi } \mathrm { ~ \beta ~ } \beta [ s , t , R , 1 ] \otimes \alpha [ s , u , R , 0 ] } \end{array}$ if $s > 1$ then for $u = s , \ldots , t - 1$ do fo $\begin{array} { r l } & { \qquad \mathrm { s o r ~ } \qquad \omega \mathrm { , ~ } \qquad \mathrm { , ~ } \qquad \mathrm { ~ } \qquad \mathrm { , ~ } \qquad \qquad \mathrm { ~ } \qquad } \\ & { \qquad \beta [ s , u , L , 1 ] \gets \oplus \beta [ s , t , L , 1 ] \otimes \alpha [ u , t , L , 0 ] } \\ & { \qquad \beta [ u , t , L , 0 ] \gets \oplus \beta [ s , t , L , 1 ] \otimes \alpha [ s , u , L , 1 ] } \\ & { \qquad \cdot u = s , \qquad , \mathrm { ~ } t - 1 \mathrm { ~ d } \mathbf { 0 } } \\ & { \qquad \beta [ s , u , R , 1 ] \gets \oplus \beta [ s , t , R , 0 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { s t } } \\ & { \qquad \beta [ u + 1 , t , L , 1 ] \gets \oplus \beta [ s , t , R , 0 ] \otimes \alpha [ s , u , R , 1 ] \otimes \theta _ { s t } } \end{array}$ if $s > 1$ then fo $\begin{array} { r l } & { \mathbf { \langle } u = s , \ldots , t - 1 \mathbf { { d } 0 } } \\ & { \mathbf { \langle } \beta [ s , u , R , 1 ] \gets \oplus \beta [ s , t , L , 0 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { t s } } \\ & { \mathbf { \ } \beta [ u + 1 , t , L , 1 ] \gets \oplus \beta [ s , t , L , 0 ] \otimes \alpha [ s , u , R , 1 ] \otimes \theta _ { t s } } \end{array}$ $A \alpha [ 1 , n , R , 1 ]$ . Log partition
|
| 564 |
+
for $s = 1 , \ldots , n - 1$ do . Compute marginals. Note that $p [ s , t ] = p ( z _ { s t } = 1 | x )$ for $t = s + 1 , \ldots , n$ do $\begin{array} { r l } & { p [ s , t ] \ell \mathrm { e x p } ( \alpha [ s , t , R , 0 ] \otimes \beta [ s , t , R , 0 ] \otimes - A ) } \\ & { \mathbf { i f } s > 1 \mathbf { t h e n } } \\ & { \qquad p [ t , s ] \mathrm { e x p } ( \alpha [ s , t , L , 0 ] \otimes \beta [ s , t , L , 0 ] \otimes - A ) } \end{array}$
|
| 565 |
+
return p
|
| 566 |
+
rocedure BACKPROPINSIDEOUTSIDE $( \theta , p , \nabla _ { p } ^ { \mathcal { L } } )$
|
| 567 |
+
for $s , t = 1 , . . . , n ; s \neq t$ do . Backpropagation uses the identity $\nabla _ { \theta } ^ { \mathcal { L } } = ( p \odot \nabla _ { p } ^ { \mathcal { L } } ) \nabla _ { \theta } ^ { \log p }$ $\delta [ s , t ] \longleftrightarrow \log p [ s , t ] \otimes \log \nabla _ { p } ^ { \mathcal { L } } [ s , t ]$ $\ u \triangleright \delta = \log ( p \odot \nabla _ { p } ^ { \mathcal { L } } )$
|
| 568 |
+
$\nabla _ { \alpha } ^ { \mathcal { L } } , \nabla _ { \beta } ^ { \mathcal { L } } , \log \nabla _ { \theta } ^ { \mathcal { L } } \infty$ . Initialize inside $( \nabla _ { \alpha } ^ { \mathcal { L } } )$ , outside $( \nabla _ { \beta } ^ { \mathcal { L } } )$ gradients, and log of $\nabla _ { \theta } ^ { \mathcal { L } }$
|
| 569 |
+
for $s = 1 , \ldots , n - 1$ do . Backpropagate $\delta$ to $\nabla _ { \alpha } ^ { \mathcal { L } }$ and $\nabla _ { \beta } ^ { \mathcal { L } }$ for $t = s + 1 , \ldots , n$ do $\begin{array} { r l } & { \nabla _ { \alpha } ^ { \mathcal { L } } [ s , t , R , 0 ] , \nabla _ { \beta } ^ { \mathcal { L } } [ s , t , R , 0 ] \delta [ s , t ] } \\ & { \nabla _ { \alpha } ^ { \mathcal { L } } [ 1 , n , R , 1 ] _ { \oplus } - \delta [ s , t ] } \\ & { \mathbf { i f } s > 1 \mathrm { t h e n } } \\ & { \qquad \nabla _ { \alpha } ^ { \mathcal { L } } [ s , t , L , 0 ] , \nabla _ { \beta } ^ { \mathcal { L } } [ s , t , L , 0 ] \delta [ t , s ] } \\ & { \qquad \nabla _ { \alpha } ^ { \mathcal { L } } [ 1 , n , R , 1 ] _ { \oplus } - \delta [ s , t ] } \end{array}$
|
| 570 |
+
for $k = 1 , \dots , n$ do . Backpropagate through outside step for $s = 1 , \ldots , n - k$ do $\begin{array} { r l } & { t s + k } \\ & { \nu \nabla _ { \beta } ^ { \mathcal { L } } [ s , t , R , 0 ] \otimes \beta [ s , t , R , 0 ] } \\ & { { \bf f o r } u = t , \ldots , n { \bf d o } } \\ & { \quad \nabla _ { \beta } ^ { \mathcal { L } } [ s , u , R , 1 ] , \nabla _ { \alpha } ^ { \mathcal { L } } [ t , u , R , 1 ] _ { \oplus } \nu \otimes \beta [ s , u , R , 1 ] \otimes \alpha [ t , u , R , 1 ] } \end{array}$ $\nu , \gamma$ are temporary values if $\begin{array} { r l } & { \mathbf { f } _ { \mathbf { x } _ { 0 } } = \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 0 } } = \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 0 } } = \beta \left( g _ { \mathbf { x } _ { 1 } } , g _ { \mathbf { x } _ { 1 } } , g _ { \mathbf { x } _ { 1 } } \right) } \\ & { \quad + \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 0 } } - \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 0 } } = \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 0 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } = \alpha \beta \left( g _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right) \beta \alpha \mathbf { f } _ { \mathbf { x } _ { 0 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } , } \\ & { \quad + \gamma \mathbf { f } _ { \mathbf { x } _ { 0 } } \left[ g _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right] \mathbf { f } _ { \mathbf { x } _ { 0 } } \beta \left( g _ { \mathbf { x } _ { 2 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right) } \\ & { \quad - \beta \left( g _ { \mathbf { x } _ { 0 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right) \mathbf { f } _ { \mathbf { x } _ { 0 } } \beta \left( g _ { \mathbf { x } _ { 2 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right) } \\ & { \quad + \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 0 } } - \frac { 1 } { N } \mathbf { f } _ { \mathbf { x } _ { 0 } } , } \\ & \quad + \alpha \left( g _ { \mathbf { x } _ { 1 } } , \mathbf { f } _ { \mathbf { x } _ { 0 } } , \mathbf { f } _ { \mathbf { x } _ { 1 } } \right) \mathbf { f } _ { \mathbf { x } _ { 0 } } \\ & \quad + \end{array}$
|
| 571 |
+
for $k = n , \ldots , 1$ do . Backpropagate through inside step for $s = 1 , \ldots , n - k$ do $t s + k$ $\begin{array} { r l } & { t \gets s + \kappa } \\ & { \nu \gets \nabla _ { \alpha } ^ { \mathcal { L } } [ s , t , R , 1 ] \otimes \alpha [ s , t , R , 1 ] } \\ & { { \bf f o r } u = s + 1 , . . . , t { \bf d o } } \\ & { \qquad \nabla _ { \alpha } ^ { \mathcal { L } } [ u , t , R , 0 ] , \nabla _ { \alpha } ^ { \mathcal { L } } [ u , t , R , 1 ] \gets _ { \oplus } \nu \otimes \alpha [ s , u , R , 0 ] \otimes \alpha [ u , t , R , 1 ] } \end{array}$ if $s > 1$ then
|
| 572 |
+
r $\begin{array} { r l } & { \quad _ { \nu } \gets \nabla _ { \mathbf { x } } ^ { C } [ s , t , L , 1 ] \otimes \alpha [ s , t , L , 1 ] } \\ & { \quad \mathrm { f o r ~ } u = s , \dots , t - 1 \mathrm { ~ d } \mathbf { 0 } } \\ & { \quad \quad \mathrm { V a } [ s , u , L , 1 ] , \nabla _ { \mathbf { x } } ^ { C } [ u , l , L , 0 ] \longleftrightarrow \nu \otimes \alpha [ s , u , L , 1 ] \otimes \alpha [ u , t , L , 0 ] } \\ & { \quad _ { \nu } \gets \nabla _ { \mathbf { x } } ^ { C } [ s , t , L , 0 ] \otimes \alpha [ s , t , L , 0 ] } \\ & { \quad \mathrm { f o r ~ } u = s , \dots , t - 1 \mathrm { ~ d } \mathbf { 0 } } \\ & { \quad \quad \gamma \gets \alpha [ s , u , R , 1 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { t s } } \\ & { \quad \quad \quad \nabla _ { \mathbf { x } } ^ { C } [ s , u , R , 1 ] , \nabla _ { \mathbf { x } } ^ { C } [ u + 1 , t , L , 1 ] , \log \nabla _ { \mathbf { x } } ^ { C } [ t , s ] \gets _ { \Phi } \nu \otimes \gamma } \\ & { \quad \quad _ { \nu } \gets \nabla _ { \mathbf { x } } ^ { C } [ s , t , R , 0 ] \otimes \alpha [ s , t , R , 0 ] } \\ & { \quad \quad _ { \nu } \mathrm { f o r ~ } u = s , \dots , t - 1 \mathrm { ~ d } \mathbf { 0 } } \\ & { \quad \quad \gamma \neq \alpha [ s , u , R , 1 ] \otimes \alpha [ u + 1 , t , L , 1 ] \otimes \theta _ { s t } } \\ & { \quad \quad \quad \nabla _ { \mathbf { x } } ^ { C } [ s , u , R , 1 ] , \nabla _ { \mathbf { x } } ^ { C } [ u + 1 , t , L , 1 ] , \log \nabla _ { \mathbf { x } } ^ { C } [ s , t ] \gets _ { \Phi } \nu \otimes \gamma } \\ & { \quad \quad \quad \mathrm { e x p o n e r y ~ l o g ~ V a r ~ { \alpha } } } \end{array}$ y sign, and return $\nabla _ { \theta } ^ { \mathcal { L } }$
|
md/train/J_VRu0ZFVX-/J_VRu0ZFVX-.md
ADDED
|
@@ -0,0 +1,549 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RotoGrad: Gradient Homogenization in Multi-Task Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Multi-task learning is being increasingly adopted in applications domains like
|
| 11 |
+
2 computer vision and reinforcement learning. However, optimally exploiting its ad
|
| 12 |
+
3 vantages remains a major challenge due to the effect of negative transfer. Previous
|
| 13 |
+
4 works have tracked down this issue to the disparities in gradient magnitudes and
|
| 14 |
+
5 directions across tasks, when optimizing the shared network parameters. While
|
| 15 |
+
6 recent work has acknowledged that negative transfer is a two-fold problem, exist
|
| 16 |
+
7 ing approaches fall short as they focus only on either homogenizing the gradient
|
| 17 |
+
8 magnitude across tasks; or greedily change the gradient directions, overlooking
|
| 18 |
+
9 future conflicts. In this work, we introduce RotoGrad, an algorithm that tackles
|
| 19 |
+
10 negative transfer as a whole: it jointly homogenizes gradient magnitudes and direc
|
| 20 |
+
11 tions, while ensuring training convergence. We show that RotoGrad outperforms
|
| 21 |
+
12 competing methods in complex problems, including multi-label classification in
|
| 22 |
+
13 CelebA and computer vision tasks in the NYUv2 dataset.
|
| 23 |
+
|
| 24 |
+
# 14 1 Introduction
|
| 25 |
+
|
| 26 |
+
15 As neural network architectures get larger in order to solve increasingly more complex tasks, the
|
| 27 |
+
16 idea of jointly learning multiple tasks (for example, depth estimation and semantic segmentation in
|
| 28 |
+
17 computer vision) with a single network is becoming more and more appealing. This is precisely the
|
| 29 |
+
18 idea of multi-task learning (MTL) [3], which promises higher performance in the individual tasks
|
| 30 |
+
19 and better generalization to unseen data, while drastically reducing the number of parameters [27].
|
| 31 |
+
20 Unfortunately, sharing parameters between tasks may also lead to difficulties during training as
|
| 32 |
+
21 tasks compete for shared resources, often resulting in poorer results than solving individual tasks, a
|
| 33 |
+
22 phenomenon known as negative transfer [27]. Previous works have tracked down this issue to the
|
| 34 |
+
23 two types of differences between task gradients. First, differences in magnitude across tasks can make
|
| 35 |
+
24 some tasks dominate the others during the learning process. Several methods have been proposed to
|
| 36 |
+
25 homogenize gradient magnitudes such as MGDA [28], GradNorm [6], or IMTL-G [18]. However,
|
| 37 |
+
26 little attention has been put towards the second source of the problem: conflicting directions of the
|
| 38 |
+
27 gradients for different tasks. Due to the way gradients are added up, gradients of different tasks may
|
| 39 |
+
28 cancel each other out if they point to opposite directions of the parameter space, thus leading to a poor
|
| 40 |
+
29 update direction for a subset or even all tasks. Only very recently a handful of works have started to
|
| 41 |
+
30 propose methods to mitigate the conflicting gradients problem, for example, by removing conflicting
|
| 42 |
+
31 parts of the gradients [33], or randomly ‘dropping’ some elements of the gradient vector [7].
|
| 43 |
+
32 In this work we propose RotoGrad, an algorithm that tackles negative transfer as a whole by ho
|
| 44 |
+
33 mogenizing both gradient magnitudes and directions across tasks. RotoGrad addresses the gradient
|
| 45 |
+
34 magnitude discrepancies by re-weighting task gradients at each step of the learning, while encourag
|
| 46 |
+
35 ing learning those tasks that have converged the least thus far. In that way, it makes sure that no task is
|
| 47 |
+
36 overlooked during training. Additionally, instead of directly modifying gradient directions, RotoGrad
|
| 48 |
+
37 smoothly rotates the shared feature space differently for each task, seamlessly aligning gradients in
|
| 49 |
+
38 the long run. As shown by our theoretical insights, the cooperation between gradient magnitude
|
| 50 |
+
39 and direction-homogenization ensures the stability of the overall learning process. Finally, we run
|
| 51 |
+
40 extensive experiments to empirically demonstrate that RotoGrad leads to stable (convergent) learning,
|
| 52 |
+
41 scales up to complex network architectures, and outperforms competing methods in multi-label
|
| 53 |
+
42 classification settings in CIFAR10 and CelebA, as well as in computer vision tasks using the NYUv2
|
| 54 |
+
43 dataset. Alongside this paper, we will provide a simple-to-use library to include RotoGrad in any
|
| 55 |
+
44 Pytorch pipeline with a few lines of code.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 1: Level plots showing the evolution of two regression MTL problems with/without RotoGrad, see Section 4. RotoGrad is able to reach the optimum $( \sum )$ for both tasks. (a) In the space of $_ z$ , RotoGrad rotates the function-spaces to align task gradients (blue/orange arrows), finding shared features $_ { z }$ (green arrow) closer to the (matched) optima. $( b )$ In the space of $\mathbfit { r } _ { k }$ , RotoGrad rotates the shared feature $_ z$ , providing per-task features $\mathbf { \nabla } r _ { k }$ that better fit each task.
|
| 59 |
+
Figure 2: Hard-parameter sharing architecture including the rotation matrices $\scriptstyle { \mathbf { } } _ { R _ { k } }$ of RotoGrad.
|
| 60 |
+
|
| 61 |
+
# 45 2 Multi-task learning and negative transfer
|
| 62 |
+
|
| 63 |
+
46 The goal of MTL is to simultaneously learn $K$ different tasks, that is, finding $K$ mappings from a
|
| 64 |
+
47 common input dataset $\pmb { X } \in \mathbb { R } ^ { N \times D }$ to a task-specific set of labels $\boldsymbol { Y _ { k } } \in \mathbb { Y } _ { k } ^ { N }$ . Most settings consider
|
| 65 |
+
48 a hard-parameter sharing architecture, which is characterized by two components: the backbone and
|
| 66 |
+
49 heads networks. The backbone uses a set of shared parameters, $\pmb { \theta }$ , to transform each input $\pmb { x } \in \pmb { X }$
|
| 67 |
+
50 into a shared intermediate representation $z = f ( \pmb { x } ; \mathbf { \widetilde { \theta } } ) \in \mathbb { R } ^ { d }$ , where $d$ is the dimensionality of $_ z$ .
|
| 68 |
+
51 Additionally, each task $k = 1 , 2 , \ldots , K$ has a head network $h _ { k }$ , with exclusive parameters $\phi _ { k }$ , that
|
| 69 |
+
52 takes this intermediate feature $_ z$ and outputs the prediction $h _ { k } ( { \pmb x } ) = h _ { k } ( { \pmb z } ; \phi _ { k } )$ for the corresponding
|
| 70 |
+
53 task. This architecture is illustrated in Figure 2, where we have added task-specific rotation matrices
|
| 71 |
+
54 $\scriptstyle R _ { k }$ that will be necessary for the proposed approach, RotoGrad. Note that the general architecture
|
| 72 |
+
55 described above is equivalent to the one in Figure 2 when all rotations $\scriptstyle { R _ { k } }$ correspond to identity
|
| 73 |
+
56 matrices, such that $r _ { k } = z$ for all $k$ .
|
| 74 |
+
57 MTL aims to learn the architecture parameters
|
| 75 |
+
58 $\theta , \phi _ { 1 } , \phi _ { 2 } , \ldots , \phi _ { K }$ by simultaneously minimiz
|
| 76 |
+
59 ing all task losses, that is, $L _ { k } ( h _ { k } ( \dot { \pmb x } ) , \pmb y _ { k } )$ for
|
| 77 |
+
60 $k = 1 , \ldots , K$ . Although this is a priori a multi
|
| 78 |
+
61 objective optimization problem [28], in practice
|
| 79 |
+
62 a single surrogate loss consisting of a linear com
|
| 80 |
+
63 bination of the task losses, $\begin{array} { r } { L = \sum _ { k } \omega _ { k } L _ { k } } \end{array}$ , is op
|
| 81 |
+
64 timized. While this approach leads to a simpler
|
| 82 |
+
65 optimization problem, it may also trigger nega
|
| 83 |
+
66 tive transfer between tasks, hurting the overall
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r l r } & { } & { { \bf \Phi } _ { R _ { 1 } } \to r _ { 1 } \xrightarrow [ ] { h _ { \phi _ { 1 } } } L _ { 1 } ( h _ { 1 } ( r _ { 1 } ) , y _ { 1 } ) } \\ & { } & { \qquad \quad \int _ { - \infty } ^ { \infty } \frac { \int _ { - \infty } ^ { \infty } d y _ { 2 } } { r _ { 2 } } \frac { h _ { \phi _ { 2 } } } { \int _ { - \infty } ^ { \infty } \int _ { - \infty } ^ { \infty } \int _ { - \infty } ^ { \infty } d y _ { 2 } } } \\ & { } & { \qquad \quad \sum _ { R _ { K } } \dots \frac { h _ { \phi _ { K } } } { r _ { K } } L _ { K } ( h _ { K } ( r _ { K } ) , y _ { K } ) } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
67 MTL performance due to an imbalanced competition among tasks for the shared parameters [27].
|
| 90 |
+
|
| 91 |
+
68 The negative transfer problem can be studied through the updates of the shared parameters $\pmb { \theta }$ . At each
|
| 92 |
+
69 training step, $\pmb { \theta }$ is updated according to a linear combination of task gradients, $\begin{array} { r } { \dot { \nabla } _ { \pmb { \theta } } L = \sum _ { k } \omega _ { k } \nabla _ { \pmb { \theta } } L _ { k } } \end{array}$
|
| 93 |
+
70 which may suffer from two problems. First, magnitude differences of the gradients across tasks
|
| 94 |
+
71 may lead to a subset of tasks dominating the total gradient, and therefore to the model prioritizing
|
| 95 |
+
72 them over the others. Second, conflicting directions of the gradients across tasks may lead to update
|
| 96 |
+
73 directions that do not improve any of the tasks. Figure 1 shows an example of poor direction updates
|
| 97 |
+
74 (left) as well as magnitude dominance (right).
|
| 98 |
+
75 In this work, we tackle negative transfer as a whole by homogenizing tasks gradients both in magnitude
|
| 99 |
+
76 and direction. Note that homogenizing gradients with respect to $\pmb \theta$ is equivalent to homogenizing
|
| 100 |
+
77 gradients with respect to the shared feature $_ z$ due to the chain rule, $\nabla _ { \pmb { \theta } } L _ { k } = \nabla _ { \pmb { \theta } } \pmb { z } \cdot \nabla _ { z } L _ { k }$ . Thus,
|
| 101 |
+
78 from now on we focus on homogenizing the feature-level task gradients $\nabla _ { z } L _ { k }$ .
|
| 102 |
+
|
| 103 |
+
# 79 3 RotoGrad
|
| 104 |
+
|
| 105 |
+
80 In this section we introduce RotoGrad, a novel algorithm that addresses the negative transfer problem
|
| 106 |
+
81 as a whole. RotoGrad consists of two building blocks which, respectively, homogenize task-gradient
|
| 107 |
+
82 magnitudes and directions. Moreover, these blocks complement each other and provide convergence
|
| 108 |
+
83 guarantees of the network training. Next, we detail each of these building blocks and show how they
|
| 109 |
+
84 are combined towards an effective MTL learning process.
|
| 110 |
+
|
| 111 |
+
# 85 3.1 Gradient-magnitude homogenization
|
| 112 |
+
|
| 113 |
+
86 As discussed in Section 2, we aim to homogenize gradient magnitudes across tasks, as large magnitude
|
| 114 |
+
87 disparities can lead to a subset of tasks dominating the learning process. Thus, the first goal of
|
| 115 |
+
88 RotoGrad is to homogenize the magnitude of the gradients across tasks at each step of the training.
|
| 116 |
+
89 Let us denote the feature-level task gradient of the $k$ -th task for the $n$ -th datapoint, at iteration $t$ , by
|
| 117 |
+
90 $\pmb { g } _ { n , k } : = \nabla _ { z } L _ { k } ( h _ { k } ( \pmb { x } _ { n } ) , \pmb { y } _ { n , k } )$ , and its batch versions by $\pmb { G } _ { k } ^ { \top } : = [ \pmb { g } _ { 1 , k } , \pmb { g } _ { 2 , k } , \dots , \pmb { g } _ { B , k } ]$ , where $B$ is
|
| 118 |
+
91 the batch size. Then, equalizing gradient magnitudes amounts to finding weights $\omega _ { k }$ that normalize
|
| 119 |
+
92 and scale each gradient $G _ { k }$ , that is,
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
| | \omega _ { k } G _ { k } | | = | | \omega _ { i } G _ { i } | | \quad \forall i \ \Longleftrightarrow \ \omega _ { k } G _ { k } = { \frac { C } { | | G _ { k } | | } } G _ { k } = C U _ { k } \quad \forall k ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where Uk := Gk||Gk||93 denotes the normalized task gradient and $C$ is the target magnitude for all tasks.
|
| 126 |
+
94 Note that, in the above expression, $C$ is a free parameter that we need to select.
|
| 127 |
+
|
| 128 |
+
95 In RotoGrad, we select $C$ such that all tasks converge at a similar rate. We motivate this choice
|
| 129 |
+
96 by the fact that, by scaling all gradients, we change their individual step size, interfering with the
|
| 130 |
+
97 convergence guarantees provided by their Lipschitz-smoothness (for an introduction to non-convex
|
| 131 |
+
98 optimization see, for example, [25]). Therefore, we seek for the value of $C$ providing the best
|
| 132 |
+
99 step-size for those tasks that have converged the least up to iteration $t$ . Specifically, we set $C$ to be a
|
| 133 |
+
100 convex combination of the task-wise gradient magnitudes, $\begin{array} { r } { C : = \sum _ { k } \tilde { \alpha _ { k } } | | G _ { k } | | } \end{array}$ , where the weights
|
| 134 |
+
101 ${ \alpha } _ { 1 } , { \alpha } _ { 2 } , \ldots , { \alpha } _ { K }$ measure the relative convergence of each task and sum up to one, that is,
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\alpha _ { k } = \frac { { { | { | { { G _ { k } } } | } \mathord { | { \vphantom { { G _ { k } } } } | } \kern - delimiterspace } { | { G _ { k } ^ { 0 } } | } } \mathord { | { \vphantom { { G _ { k } ^ { 0 } } } } | } | } { { \sum _ { i } { { | { | { { G _ { i } } } | } | } \mathord { / { \vphantom { { G _ { i } ^ { 0 } } } } | } | } \mathord { / { \vphantom { { G _ { i } ^ { 0 } } } } | } } \mathord { | { \vphantom { { G _ { k } ^ { 0 } } } } | } } ,
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
with 102 $G _ { k } ^ { 0 }$ being the initial gradient of the $k$ -th task, i.e., the gradient at iteration $t = 0$ of the training.
|
| 141 |
+
|
| 142 |
+
103 As a result, we obtain a (hyper)parameter-free approach that equalizes the gradient magnitude across
|
| 143 |
+
104 tasks to encourage learning slow-converging tasks. Note that the resulting approach resembles
|
| 144 |
+
105 Normalized Gradient Descent (NGD) [8] for single-task learning, which has been proved to quickly
|
| 145 |
+
106 escape saddle points during optimization [24]. Thus, we expect a similar behavior for RotoGrad,
|
| 146 |
+
107 where slow-converging tasks will force quick-converging tasks to escape from saddle points.
|
| 147 |
+
108 The resulting training algorithm may however diverge as a consequence of constantly oscillating
|
| 148 |
+
109 between (slow-converging) tasks. For example, in scenarios where one task improves, there is always
|
| 149 |
+
110 another task(s) that deteriorates. Fortunately, as shown in the following result (proof in Appendix A),
|
| 150 |
+
111 such a phenomenon does not appear in the absence of conflicting gradients.
|
| 151 |
+
|
| 152 |
+
12 Proposition 3.1. Let $G _ { 1 } , G _ { 2 } , \dots , G _ { K }$ be the task gradients with respect to $z$ as defined above. If 3 $K = 2$ ; or cos_ $\mathrm { s i m } ( G _ { i } , G _ { j } ) \geq 0$ pairwise; then there exists a small-enough step size $\varepsilon > 0$ such that, for all tasks, we have that 14 $\begin{array} { r } { L _ { k } \big ( h _ { k } \big ( \pmb { Z } - \pmb { \varepsilon } \cdot \pmb { C } \sum _ { k } \pmb { U } _ { k } ; \phi _ { k } \big ) ; \pmb { Y } _ { k } \big ) < L _ { k } \big ( h _ { k } \big ( \pmb { Z } ; \phi _ { k } \big ) ; \pmb { Y } _ { k } \big ) } \end{array}$ .
|
| 153 |
+
|
| 154 |
+
115 In other words, Proposition 3.1 shows that, when gradients do not conflict in direction with each other, following the feature-level gradient 116 $C \textstyle \sum _ { k } \bar { U _ { k } }$ improves all (lower-bounded) task losses for
|
| 155 |
+
|
| 156 |
+
117 the given batch. This result, while restricted to the given batch and to the gradient with respect to
|
| 157 |
+
118 the shared representation $z$ , still provides useful insights in favor of having as desideratum of an
|
| 158 |
+
119 efficient MTL pipeline the absence of conflicting gradients.
|
| 159 |
+
|
| 160 |
+
# 3.2 Gradient-direction homogenization
|
| 161 |
+
|
| 162 |
+
121 In the previous subsection, we have shown that avoiding conflicting gradients may not only be
|
| 163 |
+
122 necessary to avoid negative transfer, but also to ensure the stability of the training. In this section
|
| 164 |
+
123 we introduce the second building block of RotoGrad, an algorithm that homogenizes task-gradient
|
| 165 |
+
124 directions. The main idea of this approach is to smoothly rotate the feature-space $_ z$ in order to reduce
|
| 166 |
+
125 the gradient conflict between tasks—in following iterations—of the training by bringing (local)
|
| 167 |
+
126 optima for different tasks closer to each other (in the parameter space). As a result, it complements
|
| 168 |
+
127 the previous magnitude-scaling approach and reduces the likelihood of the training to diverge.
|
| 169 |
+
128 In order to homogenize gradients, for each task $k = 1 , \ldots , K$ , RotoGrad introduces a matrix $\scriptstyle { \mathbf { } } _ { R _ { k } }$
|
| 170 |
+
129 so that, instead of optimizing $L _ { k } ( z )$ with $_ z$ being the last shared representation, we optimize an
|
| 171 |
+
130 equivalent loss function $L _ { k } ( R _ { k } z )$ . As we are only interested in changing directions (not the gradient
|
| 172 |
+
131 magnitudes), we choose $\pmb { R } _ { k } \in \mathring { S O ( d ) }$ to be a rotation matrix1 leading to per-task representations
|
| 173 |
+
132 $\pmb { r } _ { k } : = \pmb { R } _ { k } z$ . RotoGrad thus extends the standard MTL architecture by adding task-specific rotations
|
| 174 |
+
133 before each head, as depicted in Figure 2.
|
| 175 |
+
134 Unlike all other network parameters, matrices $\scriptstyle { \mathbf { } } _ { R _ { k } }$ do not seek to reduce their task’s loss. Instead,
|
| 176 |
+
135 these additional parameters are optimized to reduce the direction conflict of the gradients across
|
| 177 |
+
136 tasks. To this end, for each task we optimize $\scriptstyle { \mathbf { } } _ { R _ { k } }$ to maximize the batch-wise cosine similarity or,
|
| 178 |
+
137 equivalently, to minimize
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\mathcal { L } _ { \mathrm { r o t } } ^ { k } : = - \sum _ { n } \langle \pmb { R } _ { k } ^ { \top } \widetilde { \pmb { g } } _ { n , k } , \pmb { v } _ { n } \rangle ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
138 where $\widetilde { \pmb { g } } _ { n , k } : = \nabla _ { \pmb { r } _ { k } } L _ { k } \big ( h _ { k } ( \pmb { x } _ { n } ) , \pmb { y } _ { n , k } \big ) \big )$ (which holds that $\pmb { g } _ { n , k } = \pmb { R } _ { k } ^ { \top } \widetilde { \pmb { g } } _ { n , k } )$ and ${ \pmb v } _ { n }$ is the target vector
|
| 185 |
+
139 e ethat we want all task gradients pointing towards. We set the target vector ${ \pmb v } _ { n }$ to be the gradient we
|
| 186 |
+
140 would have followed if all task gradients weighted the same, that is, $\begin{array} { r } { \pmb { v } _ { n } : = \frac { 1 } { K } \sum _ { k } \pmb { u } _ { n , k } } \end{array}$ , where $\mathbf { \Delta } \mathbf { u } _ { n , k }$
|
| 187 |
+
141 is a row vector of the normalized batch gradient matrix $U _ { k }$ , as defined before.
|
| 188 |
+
|
| 189 |
+
142 As a result, in each training step of RotoGrad we simultaneously optimize the following two problems:
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\mathcal { N } \mathrm { e t w o r k : ~ } \operatorname* { m i n i m i z e } _ { \theta , \{ \phi \} _ { k } } ~ \sum _ { k } \omega _ { k } L _ { k } . , \qquad \mathcal { R } \mathrm { o t a t i o n : ~ } \operatorname* { m i n i m i z e } _ { \{ R _ { k } \} _ { k } } ~ \sum _ { k } \mathcal { L } _ { \mathrm { r o t } } ^ { k }
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
144 The above problem can be interpreted as a Stackelberg game: a two player-game in which leader
|
| 196 |
+
145 and follower alternately make moves in order to minimize their respective losses, $L _ { l }$ and $L _ { f }$ , and the
|
| 197 |
+
146 leader knows what will be the follower’s response to their moves. Such an interpretation allows us to
|
| 198 |
+
147 derive simple guidelines to guarantee training convergence—that is, that the network loss does not
|
| 199 |
+
148 oscillate as a result of optimizing the two different objectives in Equation 4. Specifically, following
|
| 200 |
+
149 Fiez et al. [10], we can ensure that problem 4 converges as long as the rotations’ optimizer (leader)
|
| 201 |
+
150 is a slow-learner compared with the network optimizer (follower). That is, as long as we make the
|
| 202 |
+
151 rotations’ learning rate decrease faster than that of the network, we know that RotoGrad will converge
|
| 203 |
+
152 to a local optimum for both objectives. A more extensive discussion can be found in Appendix B.
|
| 204 |
+
|
| 205 |
+
# 3.3 RotoGrad: the full picture
|
| 206 |
+
|
| 207 |
+
After the two main building blocks of RotoGrad, we can now summarize the overall proposed approach in Algorithm 1. At each step, RotoGrad first homogenizes the gradient magnitudes such that there is no dominant task and the step size is set by the slow-converging tasks. Additionally, RotoGrad smoothly updates the rotation matrices—using the local information given by the task gradients—to seamlessly align task gradients in the following steps, thus reducing direction conflicts.
|
| 208 |
+
|
| 209 |
+
# 3.4 Practical considerations
|
| 210 |
+
|
| 211 |
+
In this section, we discuss the main practical considerations to account for when implementing RotoGrad and propose efficient solutions.
|
| 212 |
+
|
| 213 |
+
# Algorithm 1 Training step with RotoGrad
|
| 214 |
+
|
| 215 |
+
Input input samples $\boldsymbol { X }$ , task labels $\left\{ \mathbf { Y } _ { k } \right\}$ , network’s (RotoGrad’s) learning rate $\eta$ $( \eta _ { \mathrm { r o t o } } )$ Output backbone (heads) parameters $\pmb { \theta }$ $( \{ \phi _ { k } \} )$ , RotoGrad’s parameters $\{ R _ { k } \}$
|
| 216 |
+
|
| 217 |
+
1: compute shared feature ${ Z = f ( \boldsymbol { X } ; \boldsymbol { \theta } ) }$
|
| 218 |
+
2: for $k = 1 , 2 , \ldots , K$ do
|
| 219 |
+
3: compute task-specific loss $\begin{array} { r } { L _ { k } = \sum _ { n } L _ { k } \big ( h _ { k } ( { \pmb R } _ { k } z _ { n } ; \phi _ { k } ) , { \pmb y } _ { n , k } \big ) } \end{array}$
|
| 220 |
+
4: compute gradient of shared feature $G _ { k } = \nabla _ { z } L _ { k }$
|
| 221 |
+
5: compute gradient of task-specific feature $\widetilde { G } _ { k } = R _ { k } G _ { k }$ $\triangleright$ Treated as constant w.r.t. $\scriptstyle R _ { k }$ .
|
| 222 |
+
6: compute unitary gradients $\mathbf { \bar { \mathbf { U } } } _ { k } = G _ { k } / | | G _ { k } | |$
|
| 223 |
+
7: compute relative task convergence $\alpha _ { k } = | | G _ { k } | | / | | G _ { k } ^ { 0 } | |$
|
| 224 |
+
8: end for
|
| 225 |
+
9: make $\{ \alpha _ { k } \}$ sum up to one $[ \alpha _ { 1 } , \alpha _ { 2 } , \ldots , \alpha _ { K } ] = [ \alpha _ { 1 } , \alpha _ { 2 } , \ldots , \alpha _ { K } ] / { \sum _ { k } \alpha _ { k } }$
|
| 226 |
+
10: compute shared magnitude $\begin{array} { r } { C = \sum _ { k } \alpha _ { k } \vert \vert G _ { k } \vert \vert } \end{array}$
|
| 227 |
+
11: update backbone parameters $\begin{array} { r } { \pmb { \theta } = \pmb { \theta } - \eta C \sum _ { k } U _ { k } } \end{array}$
|
| 228 |
+
12: compute target vector $\begin{array} { r } { V = \frac { 1 } { K } \sum _ { k } U _ { k } } \end{array}$
|
| 229 |
+
14: 13: for compute RotoGrad’s loss $k = 1 , 2 , \ldots , K$ do $\begin{array} { r } { L _ { k } ^ { \mathrm { r o t o } } = - \sum _ { n } \langle \pmb { R } _ { k } ^ { \top } \widetilde { \pmb { g } } _ { n , k } , \pmb { v } _ { n } \rangle } \end{array}$
|
| 230 |
+
15: k update RotoGrad’s parameters $R _ { k } = R _ { k } - \eta _ { \mathrm { r o t o } } \nabla _ { R _ { k } } L _ { k } ^ { \mathrm { r o t o } }$
|
| 231 |
+
16: update head’s parameters $\phi _ { k } = \phi _ { k } - \eta \nabla _ { \phi _ { k } } L _ { k }$
|
| 232 |
+
17: end for
|
| 233 |
+
162 Unconstrained optimization. As previously discussed, parameters $\scriptstyle { \mathbf { } } _ { R _ { k } }$ are defined as rotation
|
| 234 |
+
163 matrices, and thus the Rotation optimization in problem 4 is a constrained problem. While this would
|
| 235 |
+
164 typically imply using expensive algorithms like Riemannian gradient descent [1], we can leverage
|
| 236 |
+
165 recent work on manifold parametrization [5] and, instead, apply unconstrained optimization methods
|
| 237 |
+
166 by automatically2 parametrizing $\scriptstyle R _ { k }$ via exponential maps on the Lie algebra of $S O ( d )$ .
|
| 238 |
+
167 Memory efficiency and time complexity. Second, as we need one rotation matrix per task, we have
|
| 239 |
+
168 to store $\scriptstyle { \dot { O } } ( K d ^ { 2 } )$ additional parameters. In practice, we only need $K d ( d - 1 ) / 2$ parameters due to the
|
| 240 |
+
169 aforementioned parametrization and, in most cases, this amounts to a small part of the total number
|
| 241 |
+
170 of parameters. Moreover, as described by Casado et al. [5], parametrizing $\scriptstyle { \mathbf { } } _ { R _ { k } }$ enables efficient
|
| 242 |
+
171 computations compared with traditional methods, with a time complexity of $O ( d ^ { 3 } )$ independently of
|
| 243 |
+
172 the batch size. In our case, the time complexity is of $O ( K d ^ { 3 } )$ , which scales better with respect to the
|
| 244 |
+
173 number of tasks than existing methods (for example, $O ( K ^ { 2 } d )$ for PCGrad [33]). Moreover, caching
|
| 245 |
+
174 $\scriptstyle R _ { k }$ in the forward pass and GPU parallelization can further reduce training time.
|
| 246 |
+
175 Scaling-up RotoGrad. Even though we can efficiently compute and optimize the rotation matrix $\scriptstyle { \cal R } _ { k }$ ,
|
| 247 |
+
176 in some application domains, like computer vision, in which the size $d$ of the shared representation $_ { z }$
|
| 248 |
+
177 is large, the time complexity for updating the rotation matrix may become comparable to the one of
|
| 249 |
+
178 the network updates. In those cases, we propose to only rotate a subspace of the feature space, that
|
| 250 |
+
179 is, rotate only $m < < d$ dimensions of $_ z$ . Then, we can simply apply a transformation of the form
|
| 251 |
+
180 $r _ { k } = [ R _ { k } z _ { 1 : m } , z _ { m + 1 : d } ]$ , where $z _ { a : b }$ denotes the elements of $_ z$ with indexes $a , a + 1 , \ldots , b$ . While
|
| 252 |
+
181 there exist other possible solutions, such as using block-diagonal rotation matrices $\scriptstyle { R _ { k } }$ , we defer them
|
| 253 |
+
182 to future work.
|
| 254 |
+
|
| 255 |
+
# 183 4 Illustrative examples
|
| 256 |
+
|
| 257 |
+
184 In this section, we illustrate the behavior of RotoGrad in two synthetic scenarios, providing clean
|
| 258 |
+
85 qualitative results about its effect on the optimization process. Appendix C.1 provides a detailed
|
| 259 |
+
86 description of the experimental setups.
|
| 260 |
+
|
| 261 |
+
187 To this end, we propose two different multi-task regression problems of the form
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
L ( \pmb { x } ) = L _ { 1 } ( \pmb { x } ) + L _ { 2 } ( \pmb { x } ) = \varphi ( R _ { 1 } f ( \pmb { x ; \theta } ) , 0 ) + \varphi ( R _ { 2 } f ( \pmb { x ; \theta } ) , 1 ) ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
188 where $\varphi$ is a test function with a single global optimum whose position is parametrized by the second
|
| 268 |
+
189 argument, that is, both tasks are identical (and thus related) up to a translation. We use a single input
|
| 269 |
+
|
| 270 |
+
90 $\pmb { x } \in \mathbb { R } ^ { 2 }$ and drop task-specific network parameters. As backbone, we take a simple network of the form 191 $z = W _ { 2 } \bar { \operatorname* { m a x } } ( \bar { W _ { 1 } x } + b _ { 1 } , 0 ) + b _ { 2 }$ with $b _ { 1 } \in \mathbb { R } ^ { 1 0 } , b _ { 2 } \in \mathbb { R } ^ { 2 }$ , and $W _ { 1 } , W _ { 2 } ^ { \top } \dot { \in } \mathbb { R } ^ { 1 0 \times 2 }$ .
|
| 271 |
+
|
| 272 |
+
192 For the first experiment we choose a simple (avocado-shaped) convex objective function and, for
|
| 273 |
+
193 the second one, we opt for a non-convex function with several local optima and a single global
|
| 274 |
+
194 optimum. Figure 1 shows the training trajectories in the presence (and absence) of RotoGrad in both
|
| 275 |
+
195 experiments, depicted as level plots in the space of $_ z$ and $\mathbfit { r } _ { k }$ , respectively. We can observe that in
|
| 276 |
+
196 the first experiment (Figure 1a), RotoGrad finds both optima—which is in stark contrast to the vanilla
|
| 277 |
+
197 case—by rotating the feature space and matching the (unique) local optima of the tasks. Similarly,
|
| 278 |
+
198 the second experiment (Figure 1b) shows that, as we have two symmetric tasks and a non-equidistant
|
| 279 |
+
199 starting point, in the vanilla case the optimization is dominated by the task with an optimum closest to
|
| 280 |
+
200 the starting point. RotoGrad avoids this behavior by equalizing gradients and, by aligning gradients,
|
| 281 |
+
201 is able to find the optima of both functions.
|
| 282 |
+
|
| 283 |
+
# 02 5 Related Work
|
| 284 |
+
|
| 285 |
+
Understanding and improving the interaction between tasks is one of the most fundamental problems of MTL, since any improvement in this regard would translate to all MTL systems. Consequently, several approaches to address this problem have been adopted in the literature. Among the different lines of work, the one most related to the present work is gradient homogenization.
|
| 286 |
+
|
| 287 |
+
Gradient homogenization. Since the problem is two-fold, there are two main lines of work. On the one hand, we have task-weighting approaches that focus on alleviating magnitude differences. Similar to us, GradNorm [6] attempts to learn all tasks at a similar rate, yet they propose to learn these weights as parameters. Instead, we provide a closed-form solution in Equation 1, and so does IMTL-G [18]. However, IMTL-G scales all task gradients such that all projections of $G$ onto $G _ { k }$ are equal. MGDA [28], instead, adopts an iterative method based on the Frank-Wolfe algorithm in order to find the set of weights $\left\{ \omega _ { k } \right\}$ (with $\textstyle \sum _ { k } \omega _ { k } = 1 )$ such that $\sum _ { k } \omega _ { k } G _ { k }$ has minimum norm. On the other hand, recent works have started to put attention on the conflicting direction problem. Maninis et al. [22] first proposed adversarial training to make task gradients statistically indistinguishable as part of a bigger image-tailored architecture. More recently, PCGrad [33] proposed to drop the projection of one task gradient onto another if they are in conflict, whereas GradDrop [7] randomly drops elements of the task gradients based on a sign-purity score.
|
| 288 |
+
|
| 289 |
+
219 In the literature, we can also find other approaches which, while orthogonal to the gradient homoge
|
| 290 |
+
220 nization, are complementary to our work and thus could be used along with RotoGrad. Next, we
|
| 291 |
+
221 provide a brief overview of them.
|
| 292 |
+
|
| 293 |
+
A prominent approach for MTL is task clustering, that is, selecting which tasks should be learned together. This approach dates back to the original task-clustering algorithm [31], but new work in this direction keeps coming out [29, 35]. Alternative approaches, for example, scale the loss of each task differently based on different criteria such as task uncertainty [14], task prioritization [11], or similar loss magnitudes [18]. Moreover, while most models fall into the hard-parameter sharing umbrella, there exists other architectures in the literature. Soft-parameter sharing architectures [27], for example, do not have shared parameters but instead impose some kind of shared restrictions to the entire set of parameters. An interesting approach consists in letting the model itself learn which parts of the architecture should be used for each of the tasks [12, 23, 30, 32]. Other architectures, such as MTAN [19], make use of task-specific attention to select relevant features for each task. Finally, problems triggered by the differences between task gradients (in magnitude and direction) have also been studied in other domains like meta-learning [34] and continual learning [21].
|
| 294 |
+
|
| 295 |
+
# 34 6 Experiments
|
| 296 |
+
|
| 297 |
+
In this section we assess the performance of RotoGrad on a wide range of datasets and MTL architectures. First, we check the effect of the learning rates of the rotation and network updates on the stability of the learning process of RotoGrad. Then, with the goal of applying RotoGrad in scenarios with extremely large sizes of $_ z$ , we explore the effect of rotating a subspace of $_ { z }$ instead of the whole shared representation. Finally, we compare our approach with competing MTL solutions in the literature, showing that RotoGrad consistently outperforms all other methods. Refer to Appendix C for a more detailed description of the experimental setups and additional results.
|
| 298 |
+
|
| 299 |
+
242 Relative task improvement. Since MTL uses different metrics for different tasks, throughout this
|
| 300 |
+
243 section we group results by means of the relative task improvement, first introduced in [22]. Given a
|
| 301 |
+
244 task $k$ , and the metrics obtained during test time by our model, $M _ { k }$ , and by a baseline model, $S _ { k }$ ,
|
| 302 |
+
245 which consists of $K$ networks trained on each task individually, the relative task improvement for the
|
| 303 |
+
246 $k$ -th task is defined as
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\Delta _ { k } : = 1 0 0 \cdot ( - 1 ) ^ { l _ { k } } \frac { M _ { k } - S _ { k } } { S _ { k } } ,
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
where $l _ { k } = 1$ if $M _ { k } < S _ { k }$ means that our model performs better than the baseline in the $k$ -th task, and $l _ { k } = 0$ otherwise. We depict our results using different statistics of $\Delta _ { k }$ such as its mean $( \mathrm { a v g } _ { k } \Delta _ { k } )$ , maximum $( \operatorname* { m a x } _ { k } \Delta _ { k } )$ , and median $( { \mathrm { m e d } } _ { k } \Delta _ { k } )$ across tasks.
|
| 310 |
+
|
| 311 |
+
# 6.1 Training stability
|
| 312 |
+
|
| 313 |
+
At the end of Section 3.2 we discussed that, by casting problem 4 as a Stackelberg game, we have convergence guarantees when the rotation optimizer is the slow-learner. Next, we empirically show this necessary condition.
|
| 314 |
+
|
| 315 |
+
Experimental setup. Similar to [28], we use a multi-task version of MNIST [16] where each image is composed of a left and right digit, and use as backbone a reduced version of LeNet [17] with light-weight heads. Besides the left- and right-digit classification proposed in [28], we consider three other quantities to predict: i) sum of digits; ii) parity of the digit product; and iii) number of active pixels. The idea here is to enforce all digit-related tasks to cooperate (positive transfer), while the (orthogonal) image-related task should not disrupt these learning dynamics. We use negative cross-entropy and accuracy for the left- and right-digit tasks, binary cross-entropy and f1-score for the parity task, and mean squared error (MSE) as loss and metric for both regression tasks.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 3: Test error on the sum of digits task for different values of RotoGrad’s learning rate.
|
| 319 |
+
|
| 320 |
+
Results. Figure 3 shows the effect averaged over ten independent runs—in terms of test error in the sum task, while the rest of tasks are shown in Appendix C.2—of changing the rotations’ learning rate. We can observe that, the bigger the learning rate is in comparison to that of the network’s parameters $\left( 1 \mathrm { { e } - 3 } \right)$ , the higher and more noisy the test error becomes. MSE keeps decreasing as we lower the learning rate, reaching a sweet-spot at half the network’s learning rate $\mathrm { ( 5 e - 4 ) }$ . For smaller values, the rotations’ learning is too slow and results start to resemble those of the vanilla case, in which no rotations are applied (leftmost box in Figure 3).
|
| 321 |
+
|
| 322 |
+
# 6.2 Rotating a subspace
|
| 323 |
+
|
| 324 |
+
Next, we evaluate the effect of subspace rotations as described at the end of Section 3.4, assessing the trade-off between avoiding negative transfer and size of the subspace considered by RotoGrad.
|
| 325 |
+
|
| 326 |
+
Experimental setup. We test RotoGrad on a 10-task classification problem on CIFAR10 [15], using binary cross-entropy and f1-score as loss and metric, respectively, for all tasks. We use ResNet18 [13] without pre-training as backbone $\acute { d } = 5 1 2$ ), and linear layers with sigmoids as task-specific heads.
|
| 327 |
+
|
| 328 |
+
Results are summarized at the bottom part of Table 1. We can observe that rotating the entire space provides the best results, and they worsen as we decrease the size of $\scriptstyle R _ { k }$ . However, rotating only 64 features $2 . 5 \%$ of the shared feature space) still yields better results than vanilla optimization.
|
| 329 |
+
|
| 330 |
+
# 6.3 Methods comparison
|
| 331 |
+
|
| 332 |
+
We now proceed to compare RotoGrad with the different existing approaches to gradient conflict (for both magnitude and direction) in different real-world datasets, showing how RotoGrad outperforms existing methods while being on par with existing methods in training time.
|
| 333 |
+
|
| 334 |
+
Experimental setup. In order to provide fair comparisons among methods, all experiments use identical configurations and random initializations. For all methods we performed a hyper-parameter search and chose the best ones based on validation error. Our results are reported using the median and standard deviation computed over 5-10 random seeds. Further details can be found in Appendix C.1.
|
| 335 |
+
|
| 336 |
+
Table 1: Task performance on CIFAR10 for different competing methods (top) and RotoGrad with matrices $\scriptstyle R _ { k }$ of different sizes (bottom). Table shows median and standard deviation over five runs.
|
| 337 |
+
|
| 338 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>avgk △k ↑ medk△k ↑ maxk △k↑</td></tr><tr><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>2.58 ± 0.54 2.73 ± 1.3711.14 ± 3.35</td></tr><tr><td rowspan=1 colspan=1>GradDrop</td><td rowspan=5 colspan=1>3.07 ± 0.48 3.18 ± 1.0714.03 ± 2.832.86± 0.81 3.33 ± 1.6812.01 ± 3.19-1.75 ± 0.43-4.48 ± 2.35 3.67 ± 0.98-0.08 ± 0.95 0.09 ± 2.23 8.82 ± 3.412.73 ± 0.27 1.95 ± 2.2110.20 ± 2.983.02 ± 0.69 4.38 ± 1.1112.76 ± 1.77</td></tr><tr><td rowspan=3 colspan=1>PCGradMGDAGradNorm</td></tr><tr><td rowspan=1 colspan=1>一</td></tr><tr><td rowspan=1 colspan=1>-0.08 ± 0.95</td></tr><tr><td rowspan=1 colspan=1>IMTL-GIMTL-G+Rk</td></tr><tr><td rowspan=1 colspan=1>RotoGrad 64</td><td rowspan=1 colspan=1>2.90± 0.49 3.44 ± 1.5113.16 ± 2.40</td></tr><tr><td rowspan=1 colspan=1>RotoGrad 128RotoGrad 256RotoGrad 512</td><td rowspan=1 colspan=1>2.97 ±1.08 3.73 ±2.1412.64 ± 3.563.68± 0.68 3.29 ± 2.1814.01 ± 3.224.48 ± 0.99 4.72 ± 2.84 15.57 ± 3.99</td></tr></table>
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 4: Task improvement (median over five runs) of different methods on CIFAR10. RotoGrad outperforms competing methods on all tasks.
|
| 342 |
+
|
| 343 |
+
291 MNIST and SVHN. We reuse
|
| 344 |
+
292 the experimental setting from
|
| 345 |
+
293 Section 6.1—now with multi
|
| 346 |
+
294 task versions of MNIST [16] and
|
| 347 |
+
295 SVHN [26]—in order to evalu
|
| 348 |
+
296 ate how disruptive the orthogonal
|
| 349 |
+
297 image-related task is for differ
|
| 350 |
+
298 ent methods. We can observe in
|
| 351 |
+
299 the results from Table 2 that the
|
| 352 |
+
300 effect of the image-related task
|
| 353 |
+
301 is more disruptive in MNIST,
|
| 354 |
+
302 in which MGDA utterly fails.
|
| 355 |
+
303 Direction-aware methods (Grad
|
| 356 |
+
304 Drop and PCGrad) do not im
|
| 357 |
+
305 prove the vanilla results, whereas
|
| 358 |
+
|
| 359 |
+
Table 2: Test performance (median and standard deviation) on two set of unrelated tasks, across ten different runs.
|
| 360 |
+
|
| 361 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNIST</td><td colspan="2">SVHN</td></tr><tr><td>Digits avgk△k ↑</td><td>Act Pix MSE↓</td><td>Digits avgk△k ↑</td><td>Act Pix MSE↓</td></tr><tr><td>Method Single</td><td></td><td>0.01±0.01</td><td></td><td>0.17 ± 0.06</td></tr><tr><td>Vanilla</td><td>-2.51 ± 3.01</td><td>0.11± 0.01</td><td>1 5.14±0.83</td><td>2.75 ± 3.17</td></tr><tr><td>GradDrop</td><td>-2.51 ± 1.73</td><td>0.13 ±0.02</td><td>5.68 ±1.05</td><td>1.91 ± 0.86</td></tr><tr><td>PCGrad</td><td>-3.12±3.88</td><td>0.12 ±0.02</td><td>5.50 ± 0.75</td><td>2.26 ±0.85</td></tr><tr><td>MGDA</td><td>-12.57±9.97</td><td>0.06 ±0.02</td><td>5.99 ±1.48</td><td>0.66 ± 0.75</td></tr><tr><td>GradNorm</td><td>0.13 ± 2.27</td><td>0.08 ± 0.01</td><td>6.67 ± 1.02</td><td>1.41 ± 0.74</td></tr><tr><td>IMTL-G</td><td>1.17 ± 2.77</td><td>0.07 ± 0.01</td><td>5.81 ± 0.85</td><td>2.47 ± 1.65</td></tr><tr><td>RotoGrad</td><td>2.12 ± 2.23</td><td>0.08 ±0.02</td><td>6.08 ±0.48</td><td>1.61 ± 2.72</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 362 |
+
|
| 363 |
+
IMTL-G, GradNorm, and RotoGrad obtain the best results.
|
| 364 |
+
|
| 365 |
+
CIFAR10. We reuse the setting in Section 6.2 and compare the different MTL methods using five different seeds. Results are shown in Table 1 and Figure 4. Unlike the previous setting, scaling gradients is not enough to solve the problem. Among existing methods, both direction-aware solutions (PCGrad and GradDrop) improve over the vanilla case on all the statistics, whereas most magnitudeaware solutions substantially worsen task performance. In stark contrast, RotoGrad improves task performance across all ten tasks, as it can be observed both in Table 1 and Figure 4. To further show that this is a consequence of gradient homogenization in terms of both magnitudes and directions, we introduced an extra-baseline, IMTL- $\mathbf { \nabla } \cdot \mathbf { G } + \mathbf { R } _ { k }$ , which applies IMTL-G to the extended MTL architecture (Figure 2), that is, with matrix $\scriptstyle { \mathbf { } } _ { R _ { k } }$ optimizing the $k$ -th task loss (instead of Equation 3).
|
| 366 |
+
|
| 367 |
+
NYUv2. Now, we test all methods using NYUv2 [9] on three different tasks: 13-class semantic segmentation; depth estimation; and surface normals. To speed up training, all images were resized to $2 8 8 \times 3 8 4$ resolution; and data augmentation was applied to alleviate overfitting. As MTL architecture, we use SegNet [2] where the decoder is splitted into three convolutational heads. We use the same setup as Liu et al. [19]. Like in previous experiments, we observe in Table 3 that RotoGrad results in a consistent improvement over all tasks with respect to the vanilla case. MGDA obtains the best results in surface normals at the expense of overlooking the other tasks, while GradDrop worsens all results and PCGrad obtains minor improvements in all tasks. GradNorm finds a trade-off solution instead, improving results in depth estimation and surface normals, yet with worse results in semantic segmentation. RotoGrad obtains the best results followed by IMTL-G and, more importantly, RotoGrad is the only method resulting in a average positive task improvement—across the three tasks—over training three single-task models independently. It is worth mentioning that, with only
|
| 368 |
+
|
| 369 |
+
Table 3: Results for different methods on the NYUv2 dataset with a SegNet model. RotoGrad obtains the best performance in segmentation and depth tasks on all metrics, while significantly improving the results on normal surfaces with respect to the vanilla case.
|
| 370 |
+
|
| 371 |
+
<table><tr><td></td><td colspan="3">Semantic Segmenation ↑</td><td colspan="3">Depth</td><td colspan="6">Surface Normal</td><td></td></tr><tr><td>Method</td><td colspan="3">mIoU Pix Acc avg △k ↑|Abs Err Rel Err avgk△k ↑l</td><td colspan="3">Estimation ↓</td><td colspan="2">Angle Distance↓ Median</td><td colspan="3">Within t↑</td><td></td><td></td></tr><tr><td>Single</td><td>0.38</td><td>0.63</td><td>1</td><td>0.59</td><td>0.23</td><td>1</td><td>Mean 24.76</td><td>18.99</td><td>11.25 30.11</td><td>22.5 57.81</td><td>30</td><td>avgk△k ↑</td><td>Hours 11.37</td></tr><tr><td>Vanilla</td><td>0.37</td><td>0.64</td><td>-0.62</td><td>0.56</td><td>0.22</td><td>3.68</td><td>30.09</td><td>26.09</td><td>19.74</td><td>43.62</td><td>69.90 57.07</td><td>- -27.26</td><td>3.45</td></tr><tr><td>GradDrop</td><td>0.37</td><td>0.63</td><td>-1.55</td><td>0.59</td><td>0.24</td><td>-2.22</td><td>30.81</td><td>27.19</td><td>17.68</td><td>41.44</td><td>55.15</td><td>-31.67</td><td>3.55</td></tr><tr><td>PCGrad</td><td>0.39</td><td>0.64</td><td>1.50</td><td>0.54</td><td>0.22</td><td>4.99</td><td>29.85</td><td>25.81</td><td>19.41</td><td>44.02</td><td>57.64</td><td>-26.68</td><td>3.51</td></tr><tr><td>MGDA</td><td>0.20</td><td>0.51</td><td>-32.75</td><td>0.73</td><td>0.28</td><td>-22.33</td><td>24.98</td><td>19.02</td><td>30.57</td><td>57.61</td><td>69.41</td><td>-0.11</td><td>3.55</td></tr><tr><td>GradNorm</td><td>0.36</td><td>0.64</td><td>-1.74</td><td>0.55</td><td>0.23</td><td>3.31</td><td>25.80</td><td>20.30</td><td>28.22</td><td>54.91</td><td>67.21</td><td>-5.25</td><td>3.54</td></tr><tr><td>IMTL-G</td><td>0.38</td><td>0.65</td><td>1.92</td><td>0.55</td><td>0.23</td><td>3.64</td><td>26.83</td><td>21.96</td><td>25.14</td><td>51.74</td><td>64.76</td><td>-11.67</td><td>3.60</td></tr><tr><td>RotoGrad</td><td>0.40</td><td>0.66</td><td>5.33</td><td>0.54</td><td>0.20</td><td>9.06</td><td>26.35</td><td>21.27</td><td>26.25</td><td>53.11</td><td>65.99</td><td>-8.99</td><td>3.85</td></tr></table>
|
| 372 |
+
|
| 373 |
+
Table 4: Task f1-score statistics and training hours in CelebA for all competing methods and two different architectures/settings. RotoGrad obtains the best performance in both setups with comparable training time as existing methods.
|
| 374 |
+
|
| 375 |
+
<table><tr><td></td><td colspan="4">Convolutional (d = 512) task f1-scores (%) 个</td><td colspan="4">ResNet18 (d = 2048) task f1-scores (%) ↑</td></tr><tr><td>Method</td><td>mink medk</td><td>avgk</td><td></td><td>stdk ↓|Hours</td><td>mink</td><td>medk</td><td>avgk</td><td>stdk|Hours</td></tr><tr><td>Vanilla</td><td>1.62</td><td>54.74 58.69</td><td>24.18</td><td>4.06</td><td>15.45</td><td>61.52</td><td>61.25 22.09</td><td>1.49</td></tr><tr><td>GradDrop</td><td>3.94</td><td>55.80 58.62</td><td>23.98</td><td>4.42</td><td>4.46</td><td>63.52 63.61</td><td>21.79</td><td>1.60</td></tr><tr><td>PCGrad</td><td>2.69 60.30</td><td>59.83</td><td>23.85</td><td>17.03</td><td>17.23</td><td>61.82 62.74</td><td>20.84</td><td>5.90</td></tr><tr><td>GradNorm</td><td>1.83 52.17</td><td>54.68</td><td>24.94</td><td>11.02</td><td>14.43</td><td>64.10 63.51</td><td>21.20</td><td>3.59</td></tr><tr><td>IMTL-G</td><td>3.31 53.05</td><td>56.05</td><td>26.92</td><td>4.90</td><td>21.52</td><td>62.12 61.98</td><td>21.62</td><td>1.72</td></tr><tr><td>RotoGrad</td><td>9.11 62.31</td><td>62.45</td><td>22.14</td><td>11.00</td><td>25.72</td><td>63.84 65.17</td><td>18.99</td><td>6.90</td></tr></table>
|
| 376 |
+
|
| 377 |
+
328 three tasks, all methods trained in less than 4 hours; and that this result consolidates RotoGrad’s
|
| 378 |
+
329 scalability, as we only rotate the first 1024 dimensions of $_ z$ , out of a total of 7 millions.
|
| 379 |
+
330 CelebA. Last, we apply all methods to a 40-class multi-classification problem in CelebA [20] on
|
| 380 |
+
331 two different settings: one using a convolutional network as backbone $\acute { \iota } = 5 1 2$ ); and another using
|
| 381 |
+
332 ResNet18 [13] as backbone $\zeta = 2 0 4 8 )$ ). Similar to CIFAR10, we use binary cross-entropy and
|
| 382 |
+
333 f1-score as loss and metric for all tasks. Even though we face two completely different architectures,
|
| 383 |
+
334 results in Table 4 show that RotoGrad convincingly outperforms all competing methods in all f1-score
|
| 384 |
+
335 statistics, independently of the model. Furthermore, since this is a computationally demanding task
|
| 385 |
+
336 with 40 tasks—in fact, we omit MGDA as it takes several days to train—we also compare methods in
|
| 386 |
+
337 terms of training time. On the one hand, GradDrop and IMTL-G produce little overhead compared
|
| 387 |
+
338 with the vanilla case, as expected. On the other hand, GradNorm and PCGrad take, respectively, 2.5
|
| 388 |
+
339 and 4 times longer to train than the vanilla setting. More importantly, RotoGrad outperforms existing
|
| 389 |
+
340 methods while staying on par with them in training time, rotating $5 0 \%$ and $7 5 \%$ of the shared
|
| 390 |
+
341 feature $_ z$ for the convolutional and residual backbones, respectively, which further demonstrates that
|
| 391 |
+
342 RotoGrad can scale-up to real-world settings.
|
| 392 |
+
|
| 393 |
+
# 7 Conclusions
|
| 394 |
+
|
| 395 |
+
In this work, we have introduced RotoGrad, an algorithm that tackles negative transfer in MTL by homogenizing task gradients in terms of both magnitudes and directions. RotoGrad enforces a similar convergence rate for all tasks, while at the same time smoothly rotates the shared representation differently for each task in order to avoid conflicting gradients. As a result, RotoGrad leads to stable and accurate MTL. Our empirical results have shown the effectiveness of RotoGrad in many scenarios, staying on top of all competing methods in performance, while being on par in terms of computational complexity with those that better scale to complex networks.
|
| 396 |
+
|
| 397 |
+
We believe our work opens up interesting venues for future work. For example, it would be interesting to study alternative approaches to further scale up RotoGrad using, for example, diagonal-block or sparse rotation matrices; to rotate the feature space in application domains with structured features (e.g., channel-wise rotations in images); and to combine different methods, for example, by scaling gradients using the direction-awareness of IMTL-G and the “favor slow-learners” policy of RotoGrad.
|
| 398 |
+
|
| 399 |
+
# 356 References
|
| 400 |
+
|
| 401 |
+
357 [1] Pierre-Antoine Absil, Robert E. Mahony, and Rodolphe Sepulchre. Optimization Algorithms
|
| 402 |
+
358 on Matrix Manifolds. Princeton University Press, 2008.
|
| 403 |
+
359 [2] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. “SegNet: A Deep Convolutional
|
| 404 |
+
360 Encoder-Decoder Architecture for Image Segmentation.” In: IEEE Trans. Pattern Anal. Mach.
|
| 405 |
+
361 Intell. 39.12 (2017), pp. 2481–2495. DOI: 10.1109/TPAMI.2016.2644615.
|
| 406 |
+
362 [3] Rich Caruana. “Multitask Learning: A Knowledge-Based Source of Inductive Bias.” In:
|
| 407 |
+
363 Machine Learning, Proceedings of the Tenth International Conference, University of Mas
|
| 408 |
+
364 sachusetts, Amherst, MA, USA, June 27-29, 1993. Ed. by Paul E. Utgoff. Morgan Kaufmann,
|
| 409 |
+
365 1993, pp. 41–48. DOI: 10.1016/b978-1-55860-307-3.50012-5.
|
| 410 |
+
366 [4] Mario Lezcano Casado. “Trivializations for Gradient-Based Optimization on Manifolds.”
|
| 411 |
+
367 In: Advances in Neural Information Processing Systems 32: Annual Conference on Neural
|
| 412 |
+
368 Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC,
|
| 413 |
+
369 Canada. Ed. by Hanna M. Wallach et al. 2019, pp. 9154–9164.
|
| 414 |
+
370 [5] Mario Lezcano Casado and David Martínez-Rubio. “Cheap Orthogonal Constraints in Neural
|
| 415 |
+
371 Networks: A Simple Parametrization of the Orthogonal and Unitary Group.” In: Proceedings of
|
| 416 |
+
372 Machine Learning Research 97 (2019). Ed. by Kamalika Chaudhuri and Ruslan Salakhutdinov,
|
| 417 |
+
373 pp. 3794–3803.
|
| 418 |
+
374 [6] Zhao Chen et al. “GradNorm: Gradient Normalization for Adaptive Loss Balancing in Deep
|
| 419 |
+
375 Multitask Networks.” In: Proceedings of the 35th International Conference on Machine
|
| 420 |
+
376 Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018. Ed. by
|
| 421 |
+
377 Jennifer G. Dy and Andreas Krause. Vol. 80. Proceedings of Machine Learning Research.
|
| 422 |
+
378 PMLR, 2018, pp. 793–802.
|
| 423 |
+
379 [7] Zhao Chen et al. “Just Pick a Sign: Optimizing Deep Multitask Models with Gradient Sign
|
| 424 |
+
380 Dropout.” In: Advances in Neural Information Processing Systems 33: Annual Conference on
|
| 425 |
+
381 Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual.
|
| 426 |
+
382 Ed. by Hugo Larochelle et al. 2020.
|
| 427 |
+
383 [8] Jorge Cortés. “Finite-time convergent gradient flows with applications to network consensus.”
|
| 428 |
+
384 In: Autom. 42.11 (2006), pp. 1993–2000. DOI: 10.1016/j.automatica.2006.06.015.
|
| 429 |
+
385 [9] Camille Couprie et al. “Indoor Semantic Segmentation using depth information.” In: 1st
|
| 430 |
+
386 International Conference on Learning Representations, ICLR 2013, Scottsdale, Arizona, USA,
|
| 431 |
+
387 May 2-4, 2013, Conference Track Proceedings. Ed. by Yoshua Bengio and Yann LeCun. 2013.
|
| 432 |
+
388 [10] Tanner Fiez, Benjamin Chasnov, and Lillian J. Ratliff. “Convergence of Learning Dynamics in
|
| 433 |
+
389 Stackelberg Games.” In: CoRR abs/1906.01217 (2019).
|
| 434 |
+
390 [11] Michelle Guo et al. “Dynamic Task Prioritization for Multitask Learning.” In: Computer
|
| 435 |
+
391 Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018,
|
| 436 |
+
392 Proceedings, Part XVI. Ed. by Vittorio Ferrari et al. Vol. 11220. Lecture Notes in Computer
|
| 437 |
+
393 Science. Springer, 2018, pp. 282–299. DOI: 10.1007/978-3-030-01270-0\_17.
|
| 438 |
+
394 [12] Pengsheng Guo, Chen-Yu Lee, and Daniel Ulbricht. “Learning to Branch for Multi-Task
|
| 439 |
+
395 Learning.” In: Proceedings of the 37th International Conference on Machine Learning, ICML
|
| 440 |
+
396 2020, 13-18 July 2020, Virtual Event. Vol. 119. Proceedings of Machine Learning Research.
|
| 441 |
+
397 PMLR, 2020, pp. 3854–3863.
|
| 442 |
+
398 [13] Kaiming He et al. “Deep Residual Learning for Image Recognition.” In: 2016 IEEE Conference
|
| 443 |
+
399 on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30,
|
| 444 |
+
400 2016. IEEE Computer Society, 2016, pp. 770–778. DOI: 10.1109/CVPR.2016.90.
|
| 445 |
+
401 [14] Alex Kendall, Yarin Gal, and Roberto Cipolla. “Multi-task learning using uncertainty to weigh
|
| 446 |
+
402 losses for scene geometry and semantics.” In: Proceedings of the IEEE conference on computer
|
| 447 |
+
403 vision and pattern recognition. 2018, pp. 7482–7491.
|
| 448 |
+
404 [15] Alex Krizhevsky, Geoffrey Hinton, et al. “Learning multiple layers of features from tiny
|
| 449 |
+
405 images.” In: (2009).
|
| 450 |
+
406 [16] Yann LeCun, Corinna Cortes, and CJ Burges. “MNIST handwritten digit database.” In: ATT
|
| 451 |
+
407 Labs [Online] 2 (2010).
|
| 452 |
+
408 [17] Yann LeCun et al. “Gradient-based learning applied to document recognition.” In: Proceedings
|
| 453 |
+
409 of the IEEE 86.11 (1998), pp. 2278–2324.
|
| 454 |
+
410 [18] Liyang Liu et al. “Towards Impartial Multi-task Learning.” In: International Conference on
|
| 455 |
+
411 Learning Representations. 2021.
|
| 456 |
+
412 [19] Shikun Liu, Edward Johns, and Andrew J. Davison. “End-To-End Multi-Task Learning With
|
| 457 |
+
413 Attention.” In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019,
|
| 458 |
+
414 Long Beach, CA, USA, June 16-20, 2019. Computer Vision Foundation / IEEE, 2019, pp. 1871–
|
| 459 |
+
415 1880. DOI: 10.1109/CVPR.2019.00197.
|
| 460 |
+
416 [20] Ziwei Liu et al. “Deep Learning Face Attributes in the Wild.” In: 2015 IEEE International
|
| 461 |
+
417 Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015. IEEE
|
| 462 |
+
418 Computer Society, 2015, pp. 3730–3738. DOI: 10.1109/ICCV.2015.425.
|
| 463 |
+
419 [21] David Lopez-Paz and Marc’Aurelio Ranzato. “Gradient Episodic Memory for Continual
|
| 464 |
+
420 Learning.” In: Advances in Neural Information Processing Systems 30: Annual Conference on
|
| 465 |
+
421 Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA.
|
| 466 |
+
422 Ed. by Isabelle Guyon et al. 2017, pp. 6467–6476.
|
| 467 |
+
423 [22] Kevis-Kokitsi Maninis, Ilija Radosavovic, and Iasonas Kokkinos. “Attentive Single-Tasking of
|
| 468 |
+
424 Multiple Tasks.” In: IEEE Conference on Computer Vision and Pattern Recognition, CVPR
|
| 469 |
+
425 2019, Long Beach, CA, USA, June 16-20, 2019. Computer Vision Foundation / IEEE, 2019,
|
| 470 |
+
426 pp. 1851–1860. DOI: 10.1109/CVPR.2019.00195.
|
| 471 |
+
427 [23] Ishan Misra et al. “Cross-Stitch Networks for Multi-task Learning.” In: 2016 IEEE Conference
|
| 472 |
+
428 on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30,
|
| 473 |
+
429 2016. IEEE Computer Society, 2016, pp. 3994–4003. DOI: 10.1109/CVPR.2016.433.
|
| 474 |
+
430 [24] Ryan W. Murray, Brian Swenson, and Soummya Kar. “Revisiting Normalized Gradient
|
| 475 |
+
431 Descent: Fast Evasion of Saddle Points.” In: IEEE Trans. Autom. Control. 64.11 (2019),
|
| 476 |
+
432 pp. 4818–4824. DOI: 10.1109/TAC.2019.2914998.
|
| 477 |
+
433 [25] Yurii E. Nesterov. Introductory Lectures on Convex Optimization - A Basic Course. Vol. 87.
|
| 478 |
+
434 Applied Optimization. Springer, 2004. DOI: 10.1007/978-1-4419-8853-9.
|
| 479 |
+
435 [26] Yuval Netzer et al. “Reading digits in natural images with unsupervised feature learning.” In:
|
| 480 |
+
436 NeurIPS Workshop on Deep Learning and Unsupervised Feature Learning (2011).
|
| 481 |
+
437 [27] Sebastian Ruder. “An Overview of Multi-Task Learning in Deep Neural Networks.” In: CoRR
|
| 482 |
+
438 abs/1706.05098 (2017).
|
| 483 |
+
439 [28] Ozan Sener and Vladlen Koltun. “Multi-Task Learning as Multi-Objective Optimization.”
|
| 484 |
+
440 In: Advances in Neural Information Processing Systems 31: Annual Conference on Neural
|
| 485 |
+
441 Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada.
|
| 486 |
+
442 Ed. by Samy Bengio et al. 2018, pp. 525–536.
|
| 487 |
+
443 [29] Trevor Standley et al. “Which Tasks Should Be Learned Together in Multi-task Learning?” In:
|
| 488 |
+
444 Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18
|
| 489 |
+
445 July 2020, Virtual Event. Vol. 119. Proceedings of Machine Learning Research. PMLR, 2020,
|
| 490 |
+
446 pp. 9120–9132.
|
| 491 |
+
447 [30] Ximeng Sun et al. “AdaShare: Learning What To Share For Efficient Deep Multi-Task Learn
|
| 492 |
+
448 ing.” In: Advances in Neural Information Processing Systems 33: Annual Conference on Neural
|
| 493 |
+
449 Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. Ed. by
|
| 494 |
+
450 Hugo Larochelle et al. 2020.
|
| 495 |
+
451 [31] Sebastian Thrun and Joseph O’Sullivan. “Discovering Structure in Multiple Learning Tasks:
|
| 496 |
+
452 The TC Algorithm.” In: Machine Learning, Proceedings of the Thirteenth International
|
| 497 |
+
453 Conference (ICML ’96), Bari, Italy, July 3-6, 1996. Ed. by Lorenza Saitta. Morgan Kaufmann,
|
| 498 |
+
454 1996, pp. 489–497.
|
| 499 |
+
455 [32] Simon Vandenhende et al. “Branched Multi-Task Networks: Deciding what layers to share.”
|
| 500 |
+
456 In: 31st British Machine Vision Conference 2020, BMVC 2020, Virtual Event, UK, September
|
| 501 |
+
457 7-10, 2020. BMVA Press, 2020.
|
| 502 |
+
458 [33] Tianhe Yu et al. “Gradient Surgery for Multi-Task Learning.” In: Advances in Neural Informa
|
| 503 |
+
459 tion Processing Systems. Ed. by H. Larochelle et al. Vol. 33. Curran Associates, Inc., 2020,
|
| 504 |
+
460 pp. 5824–5836.
|
| 505 |
+
461 [34] Tianhe Yu et al. “Meta-World: A Benchmark and Evaluation for Multi-Task and Meta Re
|
| 506 |
+
462 inforcement Learning.” In: 3rd Annual Conference on Robot Learning, CoRL 2019, Osaka,
|
| 507 |
+
463 Japan, October 30 - November 1, 2019, Proceedings. Ed. by Leslie Pack Kaelbling, Danica
|
| 508 |
+
464 Kragic, and Komei Sugiura. Vol. 100. Proceedings of Machine Learning Research. PMLR,
|
| 509 |
+
465 2019, pp. 1094–1100.
|
| 510 |
+
|
| 511 |
+
[35] Amir Roshan Zamir et al. “Taskonomy: Disentangling Task Transfer Learning.” In: 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018. IEEE Computer Society, 2018, pp. 3712–3722. DOI: 10.1109/CVPR. 2018.00391.
|
| 512 |
+
|
| 513 |
+
# 470 Checklist
|
| 514 |
+
|
| 515 |
+
1. For all authors...
|
| 516 |
+
|
| 517 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] RotoGrad homogenizes both magnitudes (Equation 1) and direction (Equation 4), and empirical results in Section 6 and Appendix C demonstrate our claims.
|
| 518 |
+
(b) Did you describe the limitations of your work? [Yes] In Section 6.1.
|
| 519 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 520 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 521 |
+
|
| 522 |
+
2. If you are including theoretical results...
|
| 523 |
+
|
| 524 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Proposition 3.1’s assumptions are stated in Appendix A, and those regarding RotoGrad’s stability appear in Appendix B.
|
| 525 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Proof of Proposition 3.1 appears in Appendix A. For the proofs related to Stackelberg games, which are not a direct contribution of our paper, please refer to [10].
|
| 526 |
+
|
| 527 |
+
3. If you ran experiments...
|
| 528 |
+
|
| 529 |
+
(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] We provide instructions and code to reproduce our experiments in the supplemental material.
|
| 530 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In Appendix C.1.
|
| 531 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We provide statistics for most of our experiments computed over 5-10 independent runs. Due to time complexity required by larger datasets on NYUv2 and CelebA, we only report the results for a single random seed, but still compare the different methods using several performance metrics.
|
| 532 |
+
(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] All details are provided in Appendix C.1.
|
| 533 |
+
|
| 534 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 535 |
+
|
| 536 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 537 |
+
(b) Did you mention the license of the assets?[Yes] We only use code from previous research and licence MIT, which we inherit and acknowledge in our extended version of the code.
|
| 538 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We release the code implementation to reproduce our experiments together with the supplementary material, and will make it publicly available after the paper acceptance.
|
| 539 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We only use publicly available datasets with no personal information. Moreover, our experiments only report statistics on the results.
|
| 540 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We only use publicly available and broadly used image datasets.
|
| 541 |
+
|
| 542 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 543 |
+
|
| 544 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 545 |
+
|
| 546 |
+
518 (b) Did you describe any potential participant risks, with links to Institutional Review
|
| 547 |
+
519 Board (IRB) approvals, if applicable? [N/A]
|
| 548 |
+
520 (c) Did you include the estimated hourly wage paid to participants and the total amount
|
| 549 |
+
521 spent on participant compensation? [N/A]
|
md/train/KJNcAkY8tY4/KJNcAkY8tY4.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DO WIDE AND DEEP NETWORKS LEARN THE SAME THINGS? UNCOVERING HOW NEURAL NETWORK REPRESENTATIONS VARY WITH WIDTH AND DEPTH
|
| 2 |
+
|
| 3 |
+
Thao Nguyen∗, Maithra Raghu, & Simon Kornblith Google Research {thaotn,maithra,skornblith}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
A key factor in the success of deep neural networks is the ability to scale models to improve performance by varying the architecture depth and width. This simple property of neural network design has resulted in highly effective architectures for a variety of tasks. Nevertheless, there is limited understanding of effects of depth and width on the learned representations. In this paper, we study this fundamental question. We begin by investigating how varying depth and width affects model hidden representations, finding a characteristic block structure in the hidden representations of larger capacity (wider or deeper) models. We demonstrate that this block structure arises when model capacity is large relative to the size of the training set, and is indicative of the underlying layers preserving and propagating the dominant principal component of their representations. This discovery has important ramifications for features learned by different models, namely, representations outside the block structure are often similar across architectures with varying widths and depths, but the block structure is unique to each model. We analyze the output predictions of different model architectures, finding that even when the overall accuracy is similar, wide and deep models exhibit distinctive error patterns and variations across classes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural network architectures are typically tailored to available computational resources by scaling their width and/or depth. Remarkably, this simple approach to model scaling can result in state-of-the-art networks for both high- and low-resource regimes (Tan & Le, 2019). However, despite the ubiquity of varying depth and width, there is limited understanding of how varying these properties affects the final model beyond its performance. Investigating this fundamental question is critical, especially with the continually increasing compute resources devoted to designing and training new network architectures.
|
| 12 |
+
|
| 13 |
+
More concretely, we can ask, how do depth and width affect the final learned representations? Do these different model architectures also learn different intermediate (hidden layer) features? Are there discernible differences in the outputs? In this paper, we study these core questions, through detailed analysis of a family of ResNet models with varying depths and widths trained on CIFAR-10 (Krizhevsky et al., 2009), CIFAR-100 and ImageNet (Deng et al., 2009).
|
| 14 |
+
|
| 15 |
+
We show that depth/width variations result in distinctive characteristics in the model internal representations, with resulting consequences for representations and outputs across different model initializations and architectures. Specifically, our contributions are as follows:
|
| 16 |
+
|
| 17 |
+
• We develop a method based on centered kernel alignment (CKA) to efficiently measure the similarity of the hidden representations of wide and deep neural networks using minibatches.
|
| 18 |
+
|
| 19 |
+
• We apply this method to different network architectures, finding that representations in wide or deep models exhibit a characteristic structure, which we term the block structure. We study how the block structure varies across different training runs, and uncover a connection between block structure and model overparametrization — block structure primarily appears in overparameterized models.
|
| 20 |
+
|
| 21 |
+
• Through further analysis, we find that the block structure corresponds to hidden representations having a single principal component that explains the majority of the variance in the representation, which is preserved and propagated through the corresponding layers. We show that some hidden layers exhibiting the block structure can be pruned with minimal impact on performance.
|
| 22 |
+
• With this insight on the representational structures within a single network, we turn to compar
|
| 23 |
+
ing representations across different architectures, finding that models without the block structure show reasonable representation similarity in corresponding layers, but block structure representations are unique to each model.
|
| 24 |
+
Finally, we look at how different depths and widths affect model outputs. We find that wide and deep models make systematically different mistakes at the level of individual examples. Specifically, on ImageNet, even when these networks achieve similar overall accuracy, wide networks perform slightly better on classes reflecting scenes, whereas deep networks are slightly more accurate on consumer goods.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Neural network models of different depth and width have been studied through the lens of universal approximation theorems (Cybenko, 1989; Hornik, 1991; Pinkus, 1999; Lu et al., 2017; Hanin & Sellke, 2017; Lin & Jegelka, 2018) and functional expressivity (Telgarsky, 2015; Raghu et al., 2017b). However, this line of work only shows that such networks can be constructed, and provides neither a guarantee of learnability nor a characterization of their performance when trained on finite datasets. Other work has studied the behavior of neural networks in the infinite width limit by relating architectures to their corresponding kernels (Matthews et al., 2018; Lee et al., 2018; Jacot et al., 2018), but substantial differences exist between behavior in this infinite width limit and the behavior of finite-width networks (Novak et al., 2018; Wei et al., 2019; Chizat et al., 2019; Lewkowycz et al., 2020). In contrast to this theoretical work, we attempt to develop empirical understanding of the behavior of practical, finite-width neural network architectures after training on real-world data.
|
| 29 |
+
|
| 30 |
+
Previous empirical work has studied the effects of width and depth upon model accuracy in the context of convolutional neural network architecture design, finding that optimal accuracy is typically achieved by balancing width and depth (Zagoruyko & Komodakis, 2016; Tan & Le, 2019). Further study of accuracy and error sets have been conducted in (Hacohen & Weinshall, 2020) (error sets over training), and (Hooker et al., 2019) (error after pruning). Other work has demonstrated that it is often possible for narrower or shallower neural networks to attain similar accuracy to larger networks when the smaller networks are trained to mimic the larger networks’ predictions (Ba & Caruana, 2014; Romero et al., 2015). We instead seek to study the impact of width and depth on network internal representations and (per-example) outputs, by applying techniques for measuring similarity of neural network hidden representations (Kornblith et al., 2019; Raghu et al., 2017a; Morcos et al., 2018). These techniques have been very successful in analyzing deep learning, from properties of neural network training (Gotmare et al., 2018; Neyshabur et al., 2020), objectives (Resnick et al., 2019; Thompson et al., 2019; Hermann & Lampinen, 2020), and dynamics (Maheswaranathan et al., 2019) to revealing hidden linguistic structure in large language models (Bau et al., 2019; Kudugunta et al., 2019; Wu et al., 2019; 2020) and applications in neuroscience (Shi et al., 2019; Li et al., 2019; Merel et al., 2019; Zhang & Bellec, 2020) and medicine (Raghu et al., 2019).
|
| 31 |
+
|
| 32 |
+
# 3 EXPERIMENTAL SETUP AND BACKGROUND
|
| 33 |
+
|
| 34 |
+
Our goal is to understand the effects of depth and width on the function learned by the underlying neural network, in a setting representative of the high performance models used in practice. Reflecting this, our experimental setup consists of a family of ResNets (He et al., 2016; Zagoruyko & Komodakis, 2016) trained on standard image classification datasets CIFAR-10, CIFAR-100 and ImageNet.
|
| 35 |
+
|
| 36 |
+
For standard CIFAR ResNet architectures, the network’s layers are evenly divided between three stages (feature map sizes), with numbers of channels increasing by a factor of two from one stage to the next. We adjust the network’s width and depth by increasing the number of channels and layers respectively in each stage, following Zagoruyko & Komodakis (2016). For ImageNet ResNets,
|
| 37 |
+
|
| 38 |
+
ResNet-50 and ResNet-101 architectures differ only by the number of layers in the third $( 1 4 \times 1 4 )$ stage. Thus, for experiments on ImageNet, we scale only the width or depth of layers in this stage. More details on training parameters, as well as the accuracies of all investigated models, can be found in Appendix B.
|
| 39 |
+
|
| 40 |
+
We observe that increasing depth and/or width indeed yields better-performing models. However, we will show in the following sections how they exhibit characteristic differences in internal representations and outputs, beyond their comparable accuracies.
|
| 41 |
+
|
| 42 |
+
# 3.1 MEASURING REPRESENTATIONAL SIMILARITY USING MINIBATCH CKA
|
| 43 |
+
|
| 44 |
+
Neural network hidden representations are challenging to analyze for several reasons including (i) their large size; (ii) their distributed nature, where important features in a layer may rely on multiple neurons; and (iii) lack of alignment between neurons in different layers. Centered kernel alignment (CKA) (Kornblith et al., 2019; Cortes et al., 2012) addresses these challenges, providing a robust way to quantitatively study neural network representations by computing the similarity between pairs of activation matrices. Specifically, we use linear CKA, which Kornblith et al. (2019) have previously validated for this purpose, and adapt it so that it can be efficiently estimated using minibatches. We describe both the conventional and minibatch estimators of CKA below.
|
| 45 |
+
|
| 46 |
+
Let $\mathbf { X } \in \mathbb { R } ^ { m \times p _ { 1 } }$ and $\mathbf { Y } \in \mathbb { R } ^ { m \times p _ { 2 } }$ contain representations of two layers, one with $p _ { 1 }$ neurons and another $p _ { 2 }$ neurons, to the same set of $m$ examples. Each element of the $m \times m$ Gram matrices $K = X X ^ { \mathsf { T } }$ and $L = Y Y ^ { \top }$ reflects the similarities between a pair of examples according to ionsand $\boldsymbol { X }$ or efle $\mathbf { Y }$ . Let the si $\begin{array} { r } { \pmb { H } = \pmb { I _ { n } } - \frac { 1 } { n } \pmb { 1 1 } ^ { \top } } \end{array}$ be the centering matrix. Thenith their column and row means $K ^ { \prime } = H K H$ $L ^ { \prime } = H L H$ subtracted. HSIC measures the similarity of these centered similarity matrices by reshaping them to vectors and taking the dot product between these vectors, $\mathrm { H S I C } _ { 0 } ( K , L ) = \mathrm { v e c } ( K ^ { \prime } ) \cdot \mathrm { v e c } ( L ^ { \prime } ) / ( m -$ $1 ) ^ { 2 }$ . HSIC is invariant to orthogonal transformations of the representations and, by extension, to permutation of neurons, but it is not invariant to scaling of the original representations. CKA further normalizes HSIC to produce a similarity index between 0 and 1 that is invariant to isotropic scaling,
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname { C K A } ( K , L ) = { \frac { \operatorname { H S I C } _ { 0 } ( K , L ) } { { \sqrt { \operatorname { H S I C } _ { 0 } ( K , K ) \operatorname { H S I C } _ { 0 } ( L , L ) } } } } .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Kornblith et al. (2019) show that, when measured between layers of architecturally identical networks trained from different random initializations, linear CKA reliably identifies architecturally corresponding layers, whereas several other proposed representational similarity measures do not. However, naive computation of linear CKA requires maintaining the activations across the entire dataset in memory, which is challenging for wide and deep networks. To reduce memory consumption, we propose to compute linear CKA by averaging HSIC scores over $k$ minibatches:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathrm { C K A } _ { \mathrm { m i n i b a t c h } } = \frac { \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathrm { H S I C } _ { \mathrm { 1 } } ( \mathbf { X } _ { i } \mathbf { X } _ { i } ^ { \top } , \mathbf { Y } _ { i } \mathbf { Y } _ { i } ^ { \top } ) } { \sqrt { \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathrm { H S I C } _ { \mathrm { 1 } } ( \mathbf { X } _ { i } \mathbf { X } _ { i } ^ { \top } , \mathbf { X } _ { i } \mathbf { X } _ { i } ^ { \top } ) } \sqrt { \frac { 1 } { k } \sum _ { i = 1 } ^ { k } \mathrm { H S I C } _ { \mathrm { 1 } } ( \mathbf { Y } _ { i } \mathbf { Y } _ { i } ^ { \top } , \mathbf { Y } _ { i } \mathbf { Y } _ { i } ^ { \top } ) } } ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\mathbf { X } _ { i } \in \mathbb { R } ^ { n \times p _ { 1 } }$ and $\mathbf { Y } _ { i } \in \mathbb { R } ^ { n \times p _ { 2 } }$ are now matrices containing activations of the $i ^ { \mathrm { { t h } } }$ minibatch of $n$ examples sampled without replacement. In place of $\mathrm { H S I C _ { 0 } }$ , which is a biased estimator of HSIC, we use an unbiased estimator of HSIC (Song et al., 2012) so that the value of CKA is independent of the batch size:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathrm { H S I C _ { 1 } } ( \mathbf { K } , \mathbf { L } ) = \frac { 1 } { n ( n - 3 ) } \left( \mathrm { t r } ( \tilde { \mathbf { K } } \tilde { \mathbf { L } } ) + \frac { \mathbf { 1 } ^ { \mathsf { T } } \tilde { \mathbf { K } } \mathbf { 1 } \mathbf { 1 } ^ { \mathsf { T } } \tilde { \mathbf { L } } \mathbf { 1 } } { ( n - 1 ) ( n - 2 ) } - \frac { 2 } { n - 2 } \mathbf { 1 } ^ { \mathsf { T } } \tilde { \mathbf { K } } \tilde { \mathbf { L } } \mathbf { 1 } \right) ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\tilde { \bf K }$ and $\tilde { \bf L }$ are obtained by setting the diagonal entries of similarity matrices $\mathbf { K }$ and $\mathbf { L }$ to zero.
|
| 65 |
+
|
| 66 |
+
This approach of estimating HSIC based on minibatches is equivalent to the bagging block HSIC approach of Yamada et al. (2018), and converges to the same value as if the entire dataset were considered as a single minibatch, as proven in Appendix A. We use minibatches of size $n = 2 5 6$ obtained by iterating over the test dataset 10 times, sampling without replacement within each time.
|
| 67 |
+
|
| 68 |
+
# 4 DEPTH, WIDTH AND MODEL INTERNAL REPRESENTATIONS
|
| 69 |
+
|
| 70 |
+
We begin our study by investigating how the depth and width of a model architecture affects its internal representation structure. How do representations evolve through the hidden layers in different architectures? How similar are different hidden layer representations to each other? To answer these questions, we use the CKA representation similarity measure outlined in Section 3.1.
|
| 71 |
+
|
| 72 |
+
We find that as networks become wider and/or deeper, their representations show a characteristic block structure: many (almost) consecutive hidden layers that have highly similar representations. By training with reduced dataset size, we pinpoint a connection between block structure and model overparametrization — block structure emerges in models that have large capacity relative to the training dataset.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
4.1 INTERNAL REPRESENTATIONS AND THE BLOCK STRUCTURE
|
| 76 |
+
Figure 1: Emergence of the block structure with increasing width or depth. As we increase the depth or width of neural networks, we see the emergence of a large, contiguous set of layers with very similar representations — the block structure. Each of the panes of the figure computes the CKA similarity between all pairs of layers in a single neural network and plots this as a heatmap, with $\mathbf { X }$ and y axes indexing layers. See Appendix Figure C.1 for block structure in wide networks without residual connections.
|
| 77 |
+
|
| 78 |
+
In Figure 1, we show the results of training ResNets of varying depths (top row) and widths (bottom row) on CIFAR-10. For each ResNet, we use CKA to compute the representation similarity of all pairs of layers within the same model. Note that the total number of layers is much greater than the stated depth of the ResNet, as the latter only accounts for the convolutional layers in the network but we include all intermediate representations. We can visualize the result as a heatmap, with the $\mathbf { X }$ and y axes representing the layers of the network, going from the input layer to the output layer.
|
| 79 |
+
|
| 80 |
+
The heatmaps start off as showing a checkerboard-like representation similarity structure, which arises because representations after residual connections are more similar to other post-residual representations than representations inside ResNet blocks. As the model gets wider or deeper, we see the emergence of a distinctive block structure — a considerable range of hidden layers that have very high representation similarity (seen as a yellow square on the heatmap). This block structure mostly appears in the later layers (the last two stages) of the network. We observe similar results in networks without residual connections (Appendix Figure C.1).
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: Block structure emerges in narrower networks when trained on less data. We plot CKA similarity heatmaps as we increase network width (going right along each row) and also decrease the dataset size (down each column). As a result of the increased model capacity (with respect to the task) from smaller dataset size, smaller (narrower) models now also exhibit the block structure.
|
| 84 |
+
|
| 85 |
+
Block structure across random seeds: In Appendix Figure D.1, we plot CKA heatmaps across multiple random seeds of a deep network and a wide network. We observe that while the exact size and position of the block structure can vary, it is present across all training runs.
|
| 86 |
+
|
| 87 |
+
# 4.2 THE BLOCK STRUCTURE AND MODEL OVERPARAMETRIZATION
|
| 88 |
+
|
| 89 |
+
Having observed that the block structure emerges as models get deeper and/or wider (Figure 1), we next study whether block structure is a result of this increase in model capacity — namely, is block structure connected to the absolute model size, or to the size of the model relative to the size of the training data?
|
| 90 |
+
|
| 91 |
+
Commonly used neural networks have many more parameters than there are examples in their training sets. However, even within this overparameterized regime, larger networks frequently achieve higher performance on held out data (Zagoruyko & Komodakis, 2016; Tan & Le, 2019). Thus, to explore the connection between relative model capacity and the block structure, we fix a model architecture, but decrease the training dataset size, which serves to inflate the relative model capacity.
|
| 92 |
+
|
| 93 |
+
The results of this experiment with varying network widths are shown in Figure 2, while the corresponding plot with varying network depths (which supports the same conclusions) can be found in Appendix Figure D.2. Each column of Figure 2 shows the internal representation structure of a fixed architecture as the amount of training data is reduced, and we can clearly see the emergence of the block structure in narrower (lower capacity) networks as less training data is used. Refer to Figures D.3 and D.4 in the Appendix for a similar set of experiments on CIFAR-100. Together, these observations indicate that block structure in the internal representations arises in models that are heavily overparameterized relative to the training dataset.
|
| 94 |
+
|
| 95 |
+
# 5 PROBING THE BLOCK STRUCTURE
|
| 96 |
+
|
| 97 |
+
In the previous section, we show that wide and/or deep neural networks exhibit a block structure in the CKA heatmaps of their internal representations, and that this block structure arises from the large capacity of the models in relation to the learned task. While this latter result provides some insight into the block structure, there remains a key open question, which this section seeks to answer: what is happening to the neural network representations as they propagate through the block structure?
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 3: Block structure arises from preserving and propagating the (dominant) first principal component of the layer representations. Above are two sets of four plots, for layers of a deep network (left) and a wide network (right). CKA of the representations (top right), shows block structure in both networks. By comparing this to the variance explained by the top principal component of each layer representation (bottom left), we see that layers in the block structure have a highly dominant first principal component. This principal component is also preserved throughout the block structure, seen by comparing the squared cosine similarity of the first principal component across pairs of layers (top left), to the CKA representation similarity (top right). Compared to the latter, after removing the first principal component from the representations (bottom right), the block structure is highly reduced — the block structure arises from propagating the first principal component.
|
| 101 |
+
|
| 102 |
+
Through further analysis, we show that the block structure arises from the preservation and propagation of the first principal component of its constituent layer representations. Additional experiments with linear probes (Alain & Bengio, 2016) further support this conclusion and show that some layers that make up the block structure can be removed with minimal performance loss.
|
| 103 |
+
|
| 104 |
+
5.1 THE BLOCK STRUCTURE AND THE FIRST PRINCIPAL COMPONENT
|
| 105 |
+
|
| 106 |
+
For centered matrices of activations $\ b { X } \in \mathbb { R } ^ { n \times p _ { 1 } }$ , $\ b { Y } \in \mathbb { R } ^ { n \times p _ { 2 } }$ , linear CKA may be written as:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathrm { C K A } ( X X ^ { \mathrm { T } } , Y Y ^ { \mathrm { T } } ) = \frac { \sum _ { i = 1 } ^ { p _ { 1 } } \sum _ { j = 1 } ^ { p _ { 2 } } \lambda _ { X } ^ { i } \lambda _ { Y } ^ { j } \langle { \bf u } _ { X } ^ { i } , { \bf u } _ { Y } ^ { j } \rangle ^ { 2 } } { \sqrt { \sum _ { i = 1 } ^ { p _ { 1 } } ( \lambda _ { X } ^ { i } ) ^ { 2 } } \sqrt { \sum _ { j = 1 } ^ { p _ { 2 } } ( \lambda _ { Y } ^ { j } ) ^ { 2 } } }
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\boldsymbol { u } _ { X } ^ { i } \in \mathbb { R } ^ { n }$ and $\ b u _ { Y } ^ { i } \in \mathbb { R } ^ { n }$ are the $i ^ { \mathrm { t h } }$ normalized principal components of $\boldsymbol { X }$ and $\mathbf { Y }$ and $\lambda _ { X } ^ { i }$ and $\lambda _ { Y } ^ { i }$ are the corresponding squared singular values (Kornblith et al., 2019). As the fraction of the variance explained by the first principal components approaches 1, CKA reflects the squared alignment between these components $\langle \mathbf { u } _ { X } ^ { 1 } , \mathbf { u } _ { Y } ^ { 1 } \rangle ^ { 2 }$ . We find that, in networks with a visible block structure, the first principal component explains a large fraction of the variance, whereas in networks with no visible block structure, it does not (Appendix Figure D.5), suggesting that the block structure reflects the behavior of the first principal component of the representations.
|
| 113 |
+
|
| 114 |
+
Figure 3 explores this relationship between the block structure and the first principal components of the corresponding layer representations, demonstrated on a deep network (left group) and a wide network (right group). By comparing the variance explained by the first principal component (bottom left) to the location of the block structure (top right) we observe that layers belonging to the block structure have a highly dominant first principal component. Cosine similarity of the first principal components across all pairs of layers (top left) also shows a similarity structure resembling the block structure (top right), further demonstrating that the principal component is preserved throughout the block structure. Finally, removing the first principal component from the representations nearly eliminates the block structure from the CKA heatmaps (bottom right). A full picture of how this process impacts models of increasing depth and width can be found in Appendix Figure D.6.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 4: Linear probe accuracy. Top: CKA between layers of individual ResNet models, for different architectures and initializations. Bottom: Accuracy of linear probes for each of the layers before (orange) and after (blue) the residual connections.
|
| 118 |
+
Figure 5: Effect of deleting blocks on accuracy for models with and without block structure. Blue lines show the effect of deleting blocks backwards one-by-one within each ResNet stage. (Note the plateau at the block structure.) Vertical green lines reflect boundaries between ResNet stages. Horizontal gray line reflects accuracy of the full model.
|
| 119 |
+
|
| 120 |
+
In contrast, for models that do not contain the block structure, we find that cosine similarity of the first principal components across all pairs of layers bears little resemblance to the representation similarity structure measured by CKA, and the fractions of variance explained by the first principal components across all layers are relatively small (see Appendix Figure D.7). Together these results demonstrate that the block structure arises from preserving and propagating the first principal component across its constituent layers.
|
| 121 |
+
|
| 122 |
+
Although layers inside the block structure have representations with high CKA and similar first principal components, each layer nonetheless computes a nonlinear transformation of its input. Appendix Figure D.8 shows that the sparsity of ReLU activations inside and outside of the block structure is similar. In particular, ReLU activations in the block structure are sometimes in the linear regime and sometimes in the saturating regime, just like activations elsewhere in the network.
|
| 123 |
+
|
| 124 |
+
# 5.2 LINEAR PROBES AND COLLAPSING THE BLOCK STRUCTURE
|
| 125 |
+
|
| 126 |
+
With the insight that the block structure is preserving key components of the representations, we next investigate how these preserved representations impact task performance throughout the network, and whether the block structure can be collapsed in a way that minimally affects performance.
|
| 127 |
+
|
| 128 |
+
In Figure 4, we train a linear probe (Alain & Bengio, 2016) for each layer of the network, which maps from the layer representation to the output classes. In models without the block structure (first 2 panes), we see a monotonic increase in accuracy throughout the network, but in models with the block structure (last 2 panes), linear probe accuracy shows little improvement inside the block structure. Comparing the accuracies of probes for layers pre- and post-residual connections, we find that these connections play an important role in preserving representations in the block structure.
|
| 129 |
+
|
| 130 |
+
Informed by these results, we proceed to pruning blocks one-by-one from the end of each residual stage, while keeping the residual connections intact, and find that there is little impact on test accuracy when blocks are dropped from the middle stage (Figure 5), unlike what happens in models without block structure. When compared across different seeds, the magnitude of the drop in accuracy appears to be connected to the size and the clarity of the block structure present. This result suggests that block structure could be an indication of redundant modules in model design, and that the similarity of its constituent layer representations could be leveraged for model compression.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Representations within “block structure” differ across initializations. Each group of plots shows CKA between layers of models with the same architecture but different initializations (off the diagonal) or within a single model (on the diagonal). For narrow, shallow models such as ResNet-38 $( 1 \times )$ , there is no block structure, and CKA across initializations closely resembles CKA within a single model. For wider (middle) and deeper (right) models, representations within the block structure are unique to each model.
|
| 134 |
+
|
| 135 |
+
# 6 DEPTH AND WIDTH EFFECTS ON REPRESENTATIONS ACROSS MODELS
|
| 136 |
+
|
| 137 |
+
The results of the previous sections help characterize effects of varying depth and width on a (single) model’s internal representations, specifically, the emergence of the block structure with increased capacity, and its impacts on how representations are propagated through the network. With these insights, we next look at how depth and width affect the hidden representations across models. Concretely, are learned representations similar across models of different architectures and different random initializations? How is this affected as model capacity is changed?
|
| 138 |
+
|
| 139 |
+
We begin by studying the variations in representations across different training runs of the same model architecture. Figure 6 illustrates CKA heatmaps for a smaller model (left), wide model (middle) and deep model (right), trained from random initializations. The smaller model does not have the block structure, and representations across seeds (off diagonal plots) exhibit the same grid-like similarity structure as within a single model. The wide and deep models show block structure in all their seeds (as seen in plots along the diagonal), and comparisons across seeds (off-diagonal plots) show that while layers not in the block structure exhibit some similarity, the block structure representations are highly dissimilar across models.
|
| 140 |
+
|
| 141 |
+
Appendix Figure E.1 shows results of comparing CKA across different architectures, controlled for accuracy. Wide and deep models without the block structure do exhibit representation similarity with each other, with corresponding layers broadly being of the same proportional depth in the model. However, similar to what we observe in Figure 6, the block structure representations remain unique to each model.
|
| 142 |
+
|
| 143 |
+
# 7 DEPTH, WIDTH AND EFFECTS ON MODEL PREDICTIONS
|
| 144 |
+
|
| 145 |
+
To conclude our investigation on the effects of depth and width, we turn to understanding how the characteristic properties of internal representations discussed in the previous sections influence the outputs of the model. How diverse are the predictions of different architectures? Are there examples that wide networks are more likely to do well on compared to deep networks, and vice versa?
|
| 146 |
+
|
| 147 |
+
By training populations of networks on CIFAR-10 and ImageNet, we find that there is considerable diversity in output predictions at the individual example level, and broadly, architectures that are more similar in structure have more similar output predictions. On ImageNet we also find that there are statistically significant differences in class-level error rates between wide and deep models, with the former exhibiting a small advantage in identifying classes corresponding to scenes over objects.
|
| 148 |
+
|
| 149 |
+
Figure 7a compares per-example accuracy for groups of 100 architecturally identical deep models (ResNet-62) and wide models (ResNet-14 $( 2 \times ) )$ , all trained from different random initializations on CIFAR-10. Although the average accuracy of these groups is statistically indistinguishable, they tend to make different errors, and differences between groups are substantially larger than expected by chance (Figure 7b). Examples of images with large accuracy differences are shown in Appendix Figure F.1, while Appendix Figures F.2 and F.3 further explore patterns of example accuracy for networks of different depths and widths, respectively. As the architecture becomes wider or deeper, accuracy on many examples increases, and the effect is most pronounced for examples where smaller networks were often but not always correct. At the same time, there are examples that larger networks are less likely to get right than smaller networks. We show similar results for ImageNet networks in Appendix Figure F.4.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 7: Systematic per-example and per-class performance differences between wide and deep models. a: Comparison of accuracy on individual examples for 100 ResNet-62 $( 1 \times )$ and ResNet-14 $( 2 \times )$ models, which have statistically indistinguishable accuracy on the CIFAR-10 test set. b: Same as (a), for disjoint sets of 100 architecturally identical ResNet-62 models trained from different initializations. See Figure F.1 for a similar plot for ResNet-14 $( 2 \times )$ models. c: Accuracy differences on ImageNet classes for ResNets between models with increased width (y-axis) or depth ( $\mathbf { \bar { x } }$ -axis) in the third stage. Orange dots reflect difference between two sets of 50 architecturally identical deep models (i.e., different random initializations of ResNet-83).
|
| 153 |
+
|
| 154 |
+
We next ask whether wide and deep ImageNet models have systematic differences in accuracy at the class level. As shown in Figure 7c, there are small but statistically significant differences in accuracy for $4 1 9 / 1 0 0 0$ classes $\mathit { p } < 0 . 0 5$ , Welch’s $t$ -test), accounting for $11 \%$ of the variance in the differences in example-level accuracy (see Appendix F.3). Three of the top 5 classes that are more likely to be correctly classified by wide models reflect scenes rather than objects (seashore, library, bookshop). Indeed, the wide architecture is significantly more accurate on the 68 ImageNet classes descending from “structure” or “geological formation” $( 7 4 . 9 \% \pm 0 . 0 5$ vs. $7 4 . 6 \% \pm \mathrm { { \bar { 0 } } . 0 6 }$ , $p = 6 \times 1 0 ^ { - 5 }$ , Welch’s t-test). Looking at synsets containing $> 5 0$ ImageNet classes, the deep architecture is significantly more accurate on the 62 classes descending from “consumer goods” $( 7 2 . 4 \% \pm 0 . 0 7$ vs. $7 2 . 1 \% \pm 0 . 0 6$ , $p = 0 . 0 0 1$ ; Table F.2). In other parts of the hierarchy, differences are smaller; for instance, both models achieve $8 1 . 6 \%$ accuracy on the 118 dog classes $\gamma = 0 . 4 8 )$ ).
|
| 155 |
+
|
| 156 |
+
# 8 CONCLUSION
|
| 157 |
+
|
| 158 |
+
In this work, we study the effects of width and depth on neural network representations. Through experiments on CIFAR-10, CIFAR-100 and ImageNet, we have demonstrated that as either width or depth increases relative to the size of the dataset, analysis of hidden representations reveals the emergence of a characteristic block structure that reflects the similarity of a dominant first principal component, propagated across many network hidden layers. Further analysis finds that while the block structure is unique to each model, other learned features are shared across different initializations and architectures, particularly across relative depths of the network. Despite these similarities in representational properties and performance of wide and deep networks, we nonetheless observe that width and depth have different effects on network predictions at the example and class levels. There remain interesting open questions on how the block structure arises through training, and using the insights on network depth and width to inform optimal task-specific model design.
|
| 159 |
+
|
| 160 |
+
# ACKNOWLEDGEMENTS
|
| 161 |
+
|
| 162 |
+
We thank Gamaleldin Elsayed for helpful feedback on the manuscript.
|
| 163 |
+
|
| 164 |
+
REFERENCES
|
| 165 |
+
|
| 166 |
+
Guillaume Alain and Yoshua Bengio. Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644, 2016.
|
| 167 |
+
|
| 168 |
+
Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In Advances in neural information processing systems, pp. 2654–2662, 2014.
|
| 169 |
+
|
| 170 |
+
Anthony Bau, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Identifying and controlling important neurons in neural machine translation. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum? id=H1z-PsR5KX.
|
| 171 |
+
|
| 172 |
+
Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems, pp. 2937–2947, 2019.
|
| 173 |
+
|
| 174 |
+
Corinna Cortes, Mehryar Mohri, and Afshin Rostamizadeh. Algorithms for learning kernels based on centered alignment. The Journal of Machine Learning Research, 13(1):795–828, 2012.
|
| 175 |
+
|
| 176 |
+
George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303–314, 1989.
|
| 177 |
+
|
| 178 |
+
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.
|
| 179 |
+
|
| 180 |
+
Bradley Efron. Regression and anova with zero-one data: Measures of residual variation. Journal of the American Statistical Association, 73(361):113–121, 1978.
|
| 181 |
+
|
| 182 |
+
Akhilesh Gotmare, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. A closer look at deep learning heuristics: Learning rate restarts, warmup and distillation. arXiv preprint arXiv:1810.13243, 2018.
|
| 183 |
+
|
| 184 |
+
Guy Hacohen and Daphna Weinshall. Let’s agree to agree: Neural networks share classification order on real datasets. In ICML, 2020.
|
| 185 |
+
|
| 186 |
+
Boris Hanin and Mark Sellke. Approximating continuous functions by relu nets of minimal width. arXiv preprint arXiv:1710.11278, 2017.
|
| 187 |
+
|
| 188 |
+
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.
|
| 189 |
+
|
| 190 |
+
Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? exploring datasets, architectures, and training. arXiv preprint arXiv:2006.12433, 2020.
|
| 191 |
+
|
| 192 |
+
Sara Hooker, Aaron Courville, Yann Dauphin, and Andrea Frome. Selective brain damage: Measuring the disparate impact of model pruning. arXiv preprint arXiv:1911.05248, 2019.
|
| 193 |
+
|
| 194 |
+
Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4 (2):251–257, 1991.
|
| 195 |
+
|
| 196 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and gen- ´ eralization in neural networks. In Advances in neural information processing systems, pp. 8571– 8580, 2018.
|
| 197 |
+
|
| 198 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
| 199 |
+
|
| 200 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 201 |
+
|
| 202 |
+
Sneha Reddy Kudugunta, Ankur Bapna, Isaac Caswell, Naveen Arivazhagan, and Orhan Firat. Investigating multilingual nmt representations at scale. arXiv preprint arXiv:1909.02197, 2019.
|
| 203 |
+
|
| 204 |
+
Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ B1EA-M-0Z.
|
| 205 |
+
|
| 206 |
+
Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. arXiv preprint arXiv:2003.02218, 2020.
|
| 207 |
+
|
| 208 |
+
Zhe Li, Wieland Brendel, Edgar Walker, Erick Cobos, Taliah Muhammad, Jacob Reimer, Matthias Bethge, Fabian Sinz, Zachary Pitkow, and Andreas Tolias. Learning from brains how to regularize machines. In Advances in Neural Information Processing Systems, pp. 9529–9539, 2019.
|
| 209 |
+
|
| 210 |
+
Hongzhou Lin and Stefanie Jegelka. Resnet with one-neuron hidden layers is a universal approximator. In Advances in neural information processing systems, pp. 6169–6178, 2018.
|
| 211 |
+
|
| 212 |
+
Zhou Lu, Hongming Pu, Feicheng Wang, Zhiqiang Hu, and Liwei Wang. The expressive power of neural networks: A view from the width. In Advances in neural information processing systems, pp. 6231–6239, 2017.
|
| 213 |
+
|
| 214 |
+
Niru Maheswaranathan, Alex Williams, Matthew Golub, Surya Ganguli, and David Sussillo. Universality and individuality in neural dynamics across large populations of recurrent networks. In Advances in neural information processing systems, pp. 15629–15641, 2019.
|
| 215 |
+
|
| 216 |
+
Alexander G de G Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018.
|
| 217 |
+
|
| 218 |
+
Josh Merel, Diego Aldarondo, Jesse Marshall, Yuval Tassa, Greg Wayne, and Bence Olveczky. Deep ¨ neuroethology of a virtual rodent. arXiv preprint arXiv:1911.09451, 2019.
|
| 219 |
+
|
| 220 |
+
Ari Morcos, Maithra Raghu, and Samy Bengio. Insights on representational similarity in neural networks with canonical correlation. In Advances in Neural Information Processing Systems, pp. 5727–5736, 2018.
|
| 221 |
+
|
| 222 |
+
Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? arXiv preprint arXiv:2008.11687, 2020.
|
| 223 |
+
|
| 224 |
+
Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. arXiv preprint arXiv:1810.05148, 2018.
|
| 225 |
+
|
| 226 |
+
Allan Pinkus. Approximation theory of the mlp model in neural networks. Acta numerica, 8(1): 143–195, 1999.
|
| 227 |
+
|
| 228 |
+
Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. In Advances in Neural Information Processing Systems, pp. 6076–6085, 2017a.
|
| 229 |
+
|
| 230 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. In international conference on machine learning, pp. 2847–2854. PMLR, 2017b.
|
| 231 |
+
|
| 232 |
+
Maithra Raghu, Chiyuan Zhang, Jon Kleinberg, and Samy Bengio. Transfusion: Understanding transfer learning for medical imaging. In Advances in neural information processing systems, pp. 3347–3357, 2019.
|
| 233 |
+
|
| 234 |
+
Cinjon Resnick, Zeping Zhan, and Joan Bruna. Probing the state of the art: A critical look at visual representation evaluation. arXiv preprint arXiv:1912.00215, 2019.
|
| 235 |
+
|
| 236 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In ICLR, 2015.
|
| 237 |
+
|
| 238 |
+
Jianghong Shi, Eric Shea-Brown, and Michael Buice. Comparison against task driven artificial neural networks reveals functional properties in mouse visual cortex. In Advances in Neural Information Processing Systems, pp. 5764–5774, 2019.
|
| 239 |
+
|
| 240 |
+
Le Song, Alex Smola, Arthur Gretton, Justin Bedo, and Karsten Borgwardt. Feature selection via dependence maximization. The Journal of Machine Learning Research, 13(1):1393–1434, 2012.
|
| 241 |
+
|
| 242 |
+
Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pp. 6105–6114, 2019.
|
| 243 |
+
|
| 244 |
+
Matus Telgarsky. Representation benefits of deep feedforward networks. arXiv preprint arXiv:1509.08101, 2015.
|
| 245 |
+
|
| 246 |
+
Jessica AF Thompson, Yoshua Bengio, and Marc Schoenwiesner. The effect of task and training on intermediate representations in convolutional neural networks revealed with modified rv similarity analysis. arXiv preprint arXiv:1912.02260, 2019.
|
| 247 |
+
|
| 248 |
+
Colin Wei, Jason D Lee, Qiang Liu, and Tengyu Ma. Regularization matters: Generalization and optimization of neural nets vs their induced kernel. In Advances in Neural Information Processing Systems, pp. 9712–9724, 2019.
|
| 249 |
+
|
| 250 |
+
John M Wu, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Similarity analysis of contextual word representation models. arXiv preprint arXiv:2005.01172, 2020.
|
| 251 |
+
|
| 252 |
+
Shijie Wu, Alexis Conneau, Haoran Li, Luke Zettlemoyer, and Veselin Stoyanov. Emerging crosslingual structure in pretrained language models. arXiv preprint arXiv:1911.01464, 2019.
|
| 253 |
+
|
| 254 |
+
Makoto Yamada, Yuta Umezu, Kenji Fukumizu, and Ichiro Takeuchi. Post selection inference with kernels. In International Conference on Artificial Intelligence and Statistics, pp. 152–160. PMLR, 2018.
|
| 255 |
+
|
| 256 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference (BMVC), pp. 87.1–87.12, September 2016.
|
| 257 |
+
|
| 258 |
+
Yu Zhang and Pierre Bellec. Transferability of brain decoding using graph convolutional networks. bioRxiv, 2020.
|
| 259 |
+
|
| 260 |
+
# Appendix
|
| 261 |
+
|
| 262 |
+
# A CONVERGENCE OF MINIBATCH HSIC
|
| 263 |
+
|
| 264 |
+
Proposition 1. Let $\pmb { K } \in \mathbb { R } ^ { m \times m }$ and $\pmb { L } \in \mathbb { R } ^ { m \times m }$ be two kernel matrices constructed by applying kernel functions $k$ and $l$ respectively to all pairs of examples in a dataset $\mathcal { D }$ . Form c random partitionings p of D into m/n minibatches b of size n, and let K˜ b,p ∈ Rn×n and L˜ b,p ∈ Rn×n be kernel matrices constructed by applying kernels $k$ and $l$ to all pairs of examples within each minibatch. Define $U _ { 0 } ~ = ~ \mathrm { H S I C } _ { 1 } ( K , L )$ , the value of $\mathrm { H S I C _ { 1 } }$ applied to the full dataset, and $\begin{array} { r } { \tilde { U } _ { p } = \frac { n } { m } \sum _ { b = 1 } ^ { m / n } \mathrm { H S I C _ { 1 } } ( K ^ { b , p } , L ^ { b , p } ) } \end{array}$ , the average value of $\mathrm { H S I C _ { 1 } }$ over the minibatches in partitioning (epoch) $p .$ . Then $\begin{array} { r } { \frac { 1 } { c } \sum _ { p = 1 } ^ { c } \tilde { U } _ { p } \overset { P } { \longrightarrow } U _ { 0 } } \end{array}$ as $c \to \infty$ .
|
| 265 |
+
|
| 266 |
+
Proof. Let ${ \bf { \ell } } _ { { \bf { \ell } } _ { 4 } } ^ { m }$ be the set of all 4-tuples of indices between 1 and $\mathbf { m }$ where each index occurs exactly once. As proven in Theorem 3 of Song et al. (2012), $U _ { 0 }$ is a U-statistic:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
U _ { 0 } = \mathrm { H S I C _ { 1 } } ( { \pmb K } , { \pmb L } ) = \frac { ( m - 4 ) ! } { m ! } \sum _ { S \in i _ { 4 } ^ { m } } h ( K _ { S } , L _ { S } ) ,
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
where $K _ { ( i , j , q , r ) } = ( K _ { i , j } , K _ { i , q } , K _ { i , r } , K _ { j , q } , K _ { j , r } , K _ { q , r } )$ and the kernel of the U-statistic $h$ is defined in Song et al. (2012). Let $\delta _ { S } ^ { b }$ be 1 if the 4-tuple of dataset indices $S$ is selected in minibatch $b$ and 0 otherwise. Then:
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\tilde { U } _ { p } = { \frac { ( n - 4 ) ! } { n ! } } { \frac { n } { m } } \sum _ { b = 1 } ^ { m / n } \sum _ { S \in i _ { 4 } ^ { m } } \delta _ { S } ^ { b } h ( K _ { S } , L _ { S } ) .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Taking the expectation with respect to $\delta$ , and noting that $\delta$ is independent of $h ( K _ { S } , L _ { S } )$
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\begin{array} { c } { { \mathbb { E } _ { \delta } [ \tilde { U } _ { p } ] = \displaystyle \frac { ( n - 4 ) ! } { n ! } \frac { n } { m } \sum _ { b = 1 } ^ { m / n } \sum _ { S \in i _ { 4 } ^ { m } } \mathbb { E } _ { \delta } \left[ \delta _ { S } ^ { b } h ( K _ { S } , L _ { S } ) \right] } } \\ { { = \displaystyle \frac { ( n - 4 ) ! } { n ! } \frac { n } { m } \sum _ { b = 1 } ^ { m / n } \sum _ { S \in i _ { 4 } ^ { m } } \mathbb { E } _ { \delta } \left[ \delta _ { S } ^ { b } \right] h ( K _ { S } , L _ { S } ) . } } \end{array}
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
By symmetry, $\mathbb { E } _ { \delta } \left[ \delta _ { S } ^ { b } \right]$ is the same for all example and batch indices. Specifically, there are $n ! / ( n -$ 4)! 4-tuples that can be formed from each batch and $m ! / ( m - 4 )$ ! 4-tuples that can be formed from the entire dataset, so the probability that a given 4-tuple is in a given batch is $\mathbb { E } _ { \delta } \left[ \delta _ { S } ^ { b } \right] =$ $( n ! / ( n - 4 ) ! ) / ( m ! / ( m - 4 ) ! )$ . Thus:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathbb { E } _ { \delta } [ \tilde { U } _ { p } ] = \frac { ( m - 4 ) ! } { m ! } \sum _ { S \in i _ { 4 } ^ { m } } h ( K _ { S } , L _ { S } ) = U _ { 0 } .
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
The minibatch indicators $\delta _ { S } ^ { b }$ are either 0 or 1, so their variances and covariances are bounded, and the weighted sum in Eq. 6 has finite variance. Thus, by the law of large numbers, $\begin{array} { r } { \frac { 1 } { c } \sum _ { p = 1 } ^ { c } \tilde { U } _ { p } \overset { P } { \longrightarrow } U _ { 0 } } \end{array}$ as $p \infty$ . □
|
| 291 |
+
|
| 292 |
+
# B TRAINING DETAILS
|
| 293 |
+
|
| 294 |
+
Our CIFAR-10 and CIFAR-100 networks follow the same architecture as He et al. (2016); Zagoruyko & Komodakis (2016). We train a set of models where we fix the width multiplier of deep networks to 1 and experiment with models of depths 32, 44, 56, 110, 164. On CIFAR-100, the block structure only appears at a greater depth so we also include depths 218 and 224 in our investigation. For wide networks, we examine width multipliers of 1, 2, 4, 8 and 10 and depths of 14, 20, 26, and 38. We use SGD with momentum of 0.9, together with a cosine decay learning rate schedule and batch size of 128, to train each model for 300 epochs. Models are trained with standard CIFAR-10 data augmentation comprising random flips and translations of up to 4 pixels.
|
| 295 |
+
|
| 296 |
+
Each depth and width configuration is trained with 10 different seeds for CKA analysis, and 200 seeds for model predictions comparison.
|
| 297 |
+
|
| 298 |
+
On ImageNet, we start with the ResNet-50 architecture and increase depth or width in the third stage only, following the scaling approach of (He et al., 2016). We train for 120 epochs using SGD with momentum of 0.9 and a cosine decay learning rate schedule at a batch size of 256. We use 100 seeds for model prediction comparison.
|
| 299 |
+
|
| 300 |
+
For experiments with reduced dataset size, we subsample the training data from the original CIFAR training set by the corresponding proportion, keeping the number of samples for each class the same. All CKA results are then computed based on the full CIFAR test set.
|
| 301 |
+
|
| 302 |
+
Table B.1: Accuracy of examined neural networks on CIFAR-10 and CIFAR-100.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Depth</td><td>Width</td><td>CIFAR-10 Test Accuracy (%)</td><td>CIFAR-100 Test Accuracy (%)</td></tr><tr><td>32</td><td>1</td><td>93.5</td><td>71.2</td></tr><tr><td>44</td><td>1</td><td>94.0</td><td>72.0</td></tr><tr><td>56</td><td>1</td><td>94.2</td><td>73.3</td></tr><tr><td>110</td><td>1</td><td>94.3</td><td>74.0</td></tr><tr><td>164</td><td>1</td><td>94.4</td><td>73.9</td></tr><tr><td>14</td><td>1</td><td>92.0</td><td>67.8</td></tr><tr><td>14</td><td>2</td><td>94.1</td><td>72.9</td></tr><tr><td>14</td><td>4</td><td>95.4</td><td>77.0</td></tr><tr><td>14</td><td>8</td><td>95.9</td><td>80.0</td></tr><tr><td>14</td><td>10</td><td>96.0</td><td>80.2</td></tr><tr><td>20</td><td>1</td><td>92.8</td><td>69.4</td></tr><tr><td>20</td><td>2</td><td>94.6</td><td>74.4</td></tr><tr><td>20</td><td>4</td><td>95.4</td><td>77.6</td></tr><tr><td>20</td><td>8</td><td>96.0</td><td>80.2</td></tr><tr><td>20</td><td>10</td><td>95.8</td><td>80.8</td></tr><tr><td>26</td><td>1</td><td>93.3</td><td>70.5</td></tr><tr><td>26</td><td>2</td><td>94.9</td><td>75.8</td></tr><tr><td>26</td><td>4</td><td>95.6</td><td>79.3</td></tr><tr><td>26</td><td>8</td><td>95.9</td><td>80.9</td></tr><tr><td>26</td><td>10</td><td>95.8</td><td>81.0</td></tr><tr><td>38</td><td>1</td><td>93.8</td><td>72.3</td></tr><tr><td>38</td><td>2</td><td>95.1</td><td>75.9</td></tr><tr><td>38</td><td>4</td><td>95.5</td><td>78.6</td></tr><tr><td>38</td><td>8</td><td>95.7</td><td>79.8</td></tr><tr><td>38</td><td>10</td><td>95.7</td><td>80.5</td></tr></table>
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure C.1: Block structure also appears in models without residual connections. We remove residual connections from existing CIFAR-10 ResNets and plot CKA heatmaps for layers in the resulting architecture after training. Since the lack of residual connections prevents deep networks from performing well on the task, here we only show the representational similarity for models of increasing width. As previously observed in Figure 1, the block structure emerges in higher capacity models.
|
| 308 |
+
|
| 309 |
+
# D PROBING THE BLOCK STRUCTURE
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure D.1: Block structure varies across random initializations. We plot CKA heatmaps as in Figure 1 for 5 random seeds of a deep model (top row) and a wide model (bottom row) trained on CIFAR-10. While the size and position vary, the block structure is clearly visible in all seeds.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure D.2: Block structure emerges in shallower networks when trained on less data (CIFAR-10). We plot CKA similarity heatmaps as we increase network depth (going right along each row) and also decrease the size (down each column) of training data. Similar to the observation made in Figure 2, as a result of the increased model capacity (with respect to the task) from smaller dataset size, smaller (shallower) models now also exhibit the block structure.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure D.3: Block structure emerges in shallower networks when trained on less data (CIFAR-100). We plot CKA similarity heatmaps as we increase network depth (going right along each row) and also decrease the size of training data (down each column). Similar to the observation made in Figure 2, as a result of the increased model capacity (with respect to the task) from smaller dataset size, smaller (shallower) models now also exhibit the block structure.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure D.4: Block structure emerges in narrower networks when trained on less data (CIFAR-100). We plot CKA similarity heatmaps as we increase network width (going right along each row) and also decrease the size (down each column) of training data. Similar to the observation made in Figure 2, as a result of the increased model capacity (with respect to the task) from smaller dataset size, smaller (narrower) models now also exhibit the block structure.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure D.5: Top principal component explains a large fraction of variance in the activations of models with block structure. Each row shows a different model configuration that is trained on CIFAR-10, with the first 5 rows showing models of increasing depth, and the last 5 rows models of increasing width. Columns correspond to different seeds. Each heatmap is labeled with the fraction of variance explained by the top principal component of activations combined from the last 2 stages of the model (where block structure is often found). Rows (seeds belonging to the same architecture) are sorted by decreasing value of the proportion of variance explained. We observe that this variance measure is significantly higher in model seeds where the block structure is present.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure D.6: How the representational structure evolves with increasing depth and width when the first principal component is removed. We plot CKA similarity heatmaps as models become deeper (top row) and wider (bottom row), with the top principal component of their internal representations removed. Compared to Figure 1, we observe that while this process significantly eliminates the block structure in large capacity models (as also shown in Figure 3), it has negligible impact on the representational structures of smaller models (where no block structure is present). The latter is not surprising, since the first principal component doesn’t account for a large fraction of the variance in representations of these models, as demonstrated in Appendix Figure D.5 above.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure D.7: Relationship between the representation similarity structure and the first principal component in networks without block structure. Above are two sets of four plots, for layers of a deep network (left) and a wide network (right), that don’t contain block structure. In contrast to Figure 3, the first principal component of each layer representation only accounts for a small fraction of variance in the representation (bottom left). Comparing the squared cosine similarity of the first principal component across pairs of layers (top left), to the CKA representation similarity (top right), we find that these two structures don’t resemble each other. Last but not least, the representational structure of each model remains mostly unchanged after the first principal component is removed (bottom right).
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure D.8: ReLU activations inside and outside the block structure are similarly sparse. To rule out the possibility that the block structure arises because layers inside it behave linearly, we measured the sparsity of the ReLU activations. We observe that a significant proportion of activations are always non-zero, and the proportion is similar inside and outside the block structure. Thus, although layers inside the block structure have similar representations, each layer still applies a nonlinear transformation to its input.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure E.1: Representations align between models of different widths and depths when no block structure is present. In each group of heatmaps, top left and bottom right show CKA within a single model trained on CIFAR-10. Bottom left shows CKA for all pairs of layers between these (non-architecturally-identical) models, which have similar test performance. In the absence of block structure (left group), representations at the same relative depths are similar across models. But when comparison involves models with block structure (right group), representations within the block structure are dissimilar to those of the other model.
|
| 337 |
+
|
| 338 |
+
# F EXAMPLE- AND CLASS-LEVEL ACCURACY DIFFERENCES
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
F.1 EFFECT OF VARYING WIDTH AND DEPTH ON CIFAR-10 PREDICTIONS
|
| 342 |
+
Figure F.1: Systematic per-example performance differences between wide and deep models on CIFAR10. Comparison of predictions of 200 ResNet-62 $( 1 \times )$ and ResNet-14 $( 2 \times )$ models, which have statistically indistinguishable accuracy on the CIFAR-10 test set (mean $\pm$ SEM $9 4 . 0 9 \pm 0 . 0 1$ vs. $9 4 . 0 8 \pm 0 . 0 1$ , $t ( 1 9 9 ) =$ 0.73, $p = 0 . 4 7 $ . a Scatter plots of per-example accuracy for 100 ResNet-14 $( 2 \times )$ models vs. 100 ResNet62 $( 1 \times )$ models (left) show substantially higher dispersion than corresponding plots for disjoint sets of 100 architecturally identical models trained from different initializations (middle and right). b: Examples with the highest accuracy differences between the two types of models. Accuracies are reported on a subset of models that is disjoint from those used to select the examples.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure F.2: Effect of depth on example accuracy. Scatter plots of per-example accuracies of ResNet models with different depths on CIFAR-10. Blue dots indicate per-example accuracies of two groups of 100 networks each with different architectures indicated by axes labels. Orange dots show the distribution for groups of architecturally identical models, copied from the plot on the diagonal above. Accuracy of each model is shown at the top.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure F.3: Effect of width on example accuracy. Scatter plots of per-example accuracies of ResNet models with different widths on CIFAR-10. Blue dots indicate per-example accuracies of two groups of 100 networks each with different architectures indicated by axes labels. Orange dots show the expected distribution for groups of architecturally identical models, copied from the plot on the diagonal above. Accuracy of each model is shown at the top.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure F.4: Systematic per-example performance differences between wide and deep models on ImageNet. Scatter plots of per-example accuracy averaged across 50 vanilla ResNet-50 $( 1 \times )$ models versus that for groups of 50 models with increased depth $6 1 7$ blocks, “ResNet-83”) or width $2 . 8 \times$ wider) in the 3rd stage. Orange dots in plots show the expected distribution for two groups of 50 architecturally identical models, copied from the plot on the diagonal above. The deeper and wider models have very similar but statistically distinguishable accuracy (mean $\pm$ SEM for deeper model: $7 8 . 0 0 \pm 0 . 0 1$ , wider model: $7 7 . 9 7 \pm 0 . 0 1$ , $t ( 9 9 ) = 2 . 0$ , $p = 0 . 0 4 7 )$ .
|
| 352 |
+
|
| 353 |
+
# F.3 EFFECT SIZES FOR CLASS-LEVEL EFFECTS
|
| 354 |
+
|
| 355 |
+
We measure how much of the difference between the example-level predictions of the wide and deep ImageNet ResNets in Section 7 could be explained by the classes to which they belonged by fitting a set of three models. Model A attempts to model whether each prediction was correct or incorrect as a linear combination factors corresponding to the example ID and whether the prediction came from a wide or deep model (statsmodels formula y ˜ C(example_id) $+ \mathrm { ~ \textsf ~ { ~ C ~ } ~ }$ (wide_or_deep)). Model B includes a factor corresponding to the example ID as well as factors corresponding to the interaction between the class ID and the type of model the prediction came from (statsmodels formula y ˜ C(example_id) $+ \mathrm { ~ \subset ~ }$ (wide_or_deep) $\star$ C(class_id)). Model C includes the interaction between the example ID and the type of model, and corresponds to simply measuring the average accuracy separately for both types of models (statsmodels formula y ˜ C(example_id) $\begin{array} { r l } { \star } & { { } \ C } \end{array}$ (wide_or_deep)). Note that model C is nested inside model B, which is nested inside model A.
|
| 356 |
+
|
| 357 |
+
We seek to measure how much of the variability in predictions that can be explained by model C but not model A can be explained by model B. We fit these models with logistic regression and measure the residual variance $\begin{array} { r } { \bar { \mathrm { V a r } } _ { Q } = \bar { \sum _ { i = 1 } ^ { n } } ( y _ { i } - \pi _ { i } ) ^ { 2 } / n } \end{array}$ , where $n$ is the number of examples $\times$ the number of models, $y _ { i }$ is either 1 or 0 depending on whether the CNN’s prediction was correct or incorrect, and $\pi _ { i }$ is the output probability from logistic regression model $Q$ . We then compute the squared differences between $y$ and the predictions of the logistic regression model:
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
v ^ { 2 } = { \frac { \mathrm { V a r } _ { A } - \mathrm { V a r } _ { B } } { \mathrm { V a r } _ { A } - \mathrm { V a r } _ { C } } } = 0 . 1 1 .
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
This approach is analogous to the pseudo- $R ^ { 2 }$ of Efron (1978).
|
| 364 |
+
|
| 365 |
+
Finally, we can compare the AIC values of the logistic regression models, shown in the table below. Because the models are nested GLMs, we can also test for statistical significance using a $\chi ^ { 2 }$ test, which is highly significant for each pair of nested models. We do not report p-values because they are 0 to within machine precision.
|
| 366 |
+
|
| 367 |
+
Table F.1: AIC for models A, B, and C, described above
|
| 368 |
+
|
| 369 |
+
<table><tr><td>Model</td><td>AIC</td></tr><tr><td>A: Example + Model</td><td>3011367</td></tr><tr><td>B:Example + Class * Model</td><td>3006889</td></tr><tr><td>C:Example * 1 Model</td><td>2969410</td></tr></table>
|
| 370 |
+
|
| 371 |
+
# F.4 PERFORMANCE DIFFERENCES AMONG IMAGENET SYNSETS
|
| 372 |
+
|
| 373 |
+
Table F.2: Differeces between wide and deep architectures on ImageNet synsets with many classes. Comparison of accuracy of wide (ResNet-50 with $2 . 8 \times$ width in 3rd stage) and deep (ResNet-83) ImageNet models on synsets with ${ > } 5 0$ classes. Note that some synsets are descendants (hyponyms) of others. p-values are computed using a t-test with multiple testing (Holm-Sidak) correction. Results are for the sets of models used to generate blue dots in Figures F.4 and 7. Post-selection effect sizes and testing in the main text use a disjoint set of models.
|
| 374 |
+
|
| 375 |
+
<table><tr><td>Class</td><td># Classes</td><td>Wide Acc.</td><td>Deep Acc.</td><td>Diff.</td><td>p-value</td></tr><tr><td>entity</td><td>1000</td><td>78.0±0.01</td><td>78.0±0.01</td><td>-0.03</td><td>0.89</td></tr><tr><td>physical entity</td><td>997</td><td>78.0±0.01</td><td>78.0± 0.01</td><td>-0.03</td><td>0.89</td></tr><tr><td>object</td><td>958</td><td>78.1 ±0.01</td><td>78.1± 0.01</td><td>-0.04</td><td>0.76</td></tr><tr><td>whole</td><td>949</td><td>78.2 ±0.02</td><td>78.2 ±0.01</td><td>-0.05</td><td>0.48</td></tr><tr><td>artifact</td><td>522</td><td>73.8±0.02</td><td>73.8 ± 0.02</td><td>-0.01</td><td>1</td></tr><tr><td>living thing</td><td>410</td><td>83.5 ±0.02</td><td>83.6±0.02</td><td>-0.10</td><td>0.023</td></tr><tr><td>organism</td><td>410</td><td>83.5 ±0.02</td><td>83.6 ±0.02</td><td>-0.10</td><td>0.023</td></tr><tr><td>animal</td><td>398</td><td>83.3 ±0.02</td><td>83.4±0.02</td><td>-0.09</td><td>0.032</td></tr><tr><td>instrumentality</td><td>358</td><td>73.9 ±0.03</td><td>74.0 ±0.02</td><td>-0.02</td><td>1</td></tr><tr><td>vertebrate</td><td>337</td><td>83.3±0.02</td><td>83.3 ± 0.02</td><td>-0.08</td><td>0.22</td></tr><tr><td>chordate</td><td>337</td><td>83.3±0.02</td><td>83.3 ±0.02</td><td>-0.08</td><td>0.22</td></tr><tr><td>mammal</td><td>218</td><td>82.0±0.03</td><td>82.1± 0.03</td><td>-0.09</td><td>0.47</td></tr><tr><td>placental</td><td>212</td><td>81.9 ±0.03</td><td>81.9 ± 0.03</td><td>-0.08</td><td>0.66</td></tr><tr><td>carnivore</td><td>158</td><td>81.1±0.03</td><td>81.2 ± 0.03</td><td>-0.09</td><td>0.73</td></tr><tr><td>device</td><td>130</td><td>72.9 ±0.05</td><td>72.9 ± 0.04</td><td>-0.00</td><td>1</td></tr><tr><td>canine</td><td>130</td><td>81.3 ± 0.03</td><td>81.4 ± 0.04</td><td>-0.04</td><td>1</td></tr><tr><td>domestic animal</td><td>123</td><td>81.0±0.04</td><td>81.0 ± 0.04</td><td>-0.00</td><td>1</td></tr><tr><td>dog</td><td>118</td><td>81.6 ± 0.04</td><td>81.6 ± 0.04</td><td>-0.01</td><td>1</td></tr><tr><td>container</td><td>100</td><td>72.7±0.05</td><td>72.7 ± 0.04</td><td>0.00</td><td>1</td></tr><tr><td>covering</td><td>90</td><td>72.0±0.05</td><td>72.2 ± 0.05</td><td>-0.19</td><td>0.13</td></tr><tr><td>conveyance</td><td>72</td><td>83.5 ± 0.04</td><td>83.4± 0.05</td><td>0.13</td><td>0.65</td></tr><tr><td>vehicle</td><td>67</td><td>83.2±0.04</td><td>83.1± 0.05</td><td>0.11</td><td>0.76</td></tr><tr><td>hunting dog</td><td>63</td><td>81.2 ±0.05</td><td>81.2 ± 0.05</td><td>0.01</td><td>1</td></tr><tr><td>commodity</td><td>63</td><td>72.2 ±0.06</td><td>72.6±0.07</td><td>-0.42</td><td>5.1 × 10-5</td></tr><tr><td>consumer goods</td><td>62</td><td>72.3 ± 0.06</td><td>72.7 ± 0.07</td><td>-0.41</td><td>6.7 × 10-5</td></tr><tr><td>invertebrate</td><td>61</td><td>83.6 ±0.05</td><td>83.8±0.04</td><td>-0.16</td><td>0.37</td></tr><tr><td>bird</td><td>59</td><td>92.5 ± 0.04</td><td>92.7± 0.05</td><td>-0.21</td><td>0.0018</td></tr><tr><td>structure</td><td>58</td><td>75.9 ±0.06</td><td>75.5 ± 0.07</td><td>0.42</td><td>5.7 ×10-5</td></tr><tr><td>matter</td><td>50</td><td>77.6 ± 0.05</td><td>77.4 ± 0.05</td><td>0.17</td><td>0.74</td></tr></table>
|
md/train/Mh1Abj33qI/Mh1Abj33qI.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DATA-DRIVEN LEARNING OF GEOMETRIC SCATTERING NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Many popular graph neural network (GNN) architectures, which are often considered as the current state of the art, rely on encoding graph structure via smoothness or similarity between neighbors. While this approach performs well on a surprising number of standard benchmarks, the efficacy of such models does not translate consistently to more complex domains, such as graph data in the biochemistry domain. We argue that these more complex domains require priors that encourage learning of longer range features rather than oversmoothed signals of standard GNN architectures. Here, we propose an alternative GNN architecture, based on a relaxation of recently proposed geometric scattering transforms, which consists of a cascade of graph wavelet filters. Our learned geometric scattering (LEGS) architecture adaptively tunes these wavelets and their scales to encourage band-pass features to emerge in learned representations. This results in a simplified GNN with significantly fewer learned parameters compared to competing methods. We demonstrate the predictive performance of our method on several biochemistry graph classification benchmarks, as well as the descriptive quality of its learned features in biochemical graph data exploration tasks. Our results show that the proposed LEGS network matches or outperforms popular GNNs, as well as the original geometric scattering construction, while retaining certain mathematical properties of its handcrafted (nonlearned) design.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Geometric deep learning has recently emerged as an increasingly prominent branch of machine learning in general, and deep learning in particular (Bronstein et al., 2017). It is based on the observation that many of the impressive achievements of neural networks come in applications where the data has an intrinsic geometric structure which can be used to inform network design and training procedures. For example, in computer vision, convolutional neural networks use the spatial organization of pixels to define convolutional filters that hierarchically aggregate local information at multiple scales that in turn encode shape and texture information in data and task-driven representations. Similarly, in time-series analysis, recurrent neural networks leverage memory mechanisms based on the temporal organization of input data to collect multiresolution information from local subsequences, which can be interpreted geometrically via tools from dynamical systems and spectral analysis. While these examples only leverage Euclidean spatiotemporal structure in data, they exemplify the potential benefits of incorporating information about intrinsic data geometry in neural network design and processing. Indeed, recent advances have further generalized the utilization of geometric information in neural networks design to consider non-Euclidean structures, with particular interest in graphs that represent data geometry, either directly given as input or constructed as an approximation of a data manifold.
|
| 12 |
+
|
| 13 |
+
At the core of geometric deep learning is the use of graph neural networks (GNNs) in general, and graph convolutional networks (GCNs) in particular, which ensure neuron activations follow the geometric organization of input data by propagating information across graph neighborhoods (Bruna et al., 2014; Defferrard et al., 2016; Kipf & Welling, 2016; Hamilton et al., 2017; Xu et al., 2019; Abu-El-Haija et al., 2019). However, recent work has shown the difficulty in generalizing these methods to more complex structures, identifying common problems and phrasing them in terms of oversmoothing (Li et al., 2018), oversquashing (Alon & Yahav, 2020) or under-reaching (Barcelo´ et al., 2020). Using graph signal processing terminology from Kipf & Welling (2016), these issues can be partly attributed to the limited construction of convolutional filters in many commonly used GCN architectures. Inspired by the filters learned in convolutional neural networks, GCNs consider node features as graph signals and aim to aggregate information from neighboring nodes. For example, Kipf & Welling (2016) presented a typical implementation of a GCN with a cascade of averaging (essentially low pass) filters. We note that more general variations of GCN architectures exist (Defferrard et al., 2016; Hamilton et al., 2017; Xu et al., 2019), which are capable of representing other filters, but as investigated in Alon & Yahav (2020), they too often have difficulty in learning long range connections.
|
| 14 |
+
|
| 15 |
+
Recently, an alternative approach was presented to provide deep geometric representation learning by generalizing Mallat’s scattering transform (Mallat, 2012), originally proposed to provide a mathematical framework for understanding convolutional neural networks, to graphs (Gao et al., 2019; Gama et al., 2019a; Zou & Lerman, 2019) and manifolds (Perlmutter et al., 2018). Similar to traditional scattering, which can be seen as a convolutional network with nonlearned wavelet filters, geometric scattering is defined as a GNN with handcrafted graph filters, typically constructed as diffusion wavelets over the input graph (Coifman & Maggioni, 2006), which are then cascaded with pointwise absolute-value nonlinearities. This wavelet cascade results in permutation equivariant node features that are typically aggregated via statistical moments over the graph nodes, as explained in detail in Sec. 2, to provide a permutation invariant graph-level representation. The efficacy of geometric scattering features in graph processing tasks was demonstrated in Gao et al. (2019), with both supervised learning and data exploration applications. Moreover, their handcrafted design enables rigorous study of their properties, such as stability to deformations and perturbations, and provides a clear understanding of the information extracted by them, which by design (e.g., the cascaded band-pass filters) goes beyond low frequencies to consider richer notions of regularity (Gama et al., 2019b; Perlmutter et al., 2019).
|
| 16 |
+
|
| 17 |
+
However, while graph scattering transforms provide effective universal feature extractors, their rigid handcrafted design does not allow for the automatic task-driven representation learning that naturally arises in traditional GNNs. To address this deficiency, recent work has proposed a hybrid scattering-GCN (Min et al., 2020) model for obtaining node-level representations, which ensembles a GCN model with a fixed scattering feature extractor. In Min et al. (2020), integrating channels from both architectures alleviates the well-known oversmoothing problem and outperforms popular GNNs on node classification tasks. Here, we focus on improving the geometric scattering transform by learning, in particular its scales. We focus on whole-graph representations with an emphasis on biochemical molecular graphs, where relatively large diameters and non-planar structures usually limit the effectiveness of traditional GNNs. Instead of the ensemble approach of Min et al. (2020), we propose a native neural network architecture for learned geometric scattering (LEGS), which directly modifies the scattering architecture from Gao et al. (2019); Perlmutter et al. (2019), via relaxations described in Sec. 3, to allow a task-driven adaptation of its wavelet configuration via backpropagation implemented in Sec. 4. We note that other recent graph spectrum-based methods approach the learning of long range connections by approximating the spectrum of the graph with the Lancoz algorithm Liao et al. (2019), or learning in block Krylov subspaces Luan et al. (2019). Such methods are complementary to the work presented here, in that their spectral approximation can also be applied in the computation of geometric scattering when considering very long range scales (e.g., via spectral formulation of graph wavelet filters). However, we find that such approximations are not necessary in the datasets considered here and in other recent work focusing on whole-graph tasks, where direct computation of polynomials of the Laplacian is sufficient.
|
| 18 |
+
|
| 19 |
+
The resulting learnable geometric scattering network balances the mathematical properties inherited from the scattering transform (as shown in Sec. 3) with the flexibility enabled by adaptive representation learning. The benefits of our construction over standard GNNs, as well as pure geometric scattering, are discussed and demonstrated on graph classification and regression tasks in Sec. 5. In particular, we find that our network maintains the robustness to small training sets present in graph scattering while improving classification on biological graph classification and regression tasks, and we show that in tasks where the graphs have a large diameter relative to their size, learnable scattering features improve performance over competing methods.
|
| 20 |
+
|
| 21 |
+
# 2 PRELIMINARIES: GEOMETRIC SCATTERING FEATURES
|
| 22 |
+
|
| 23 |
+
Let $\mathcal { G } = ( V , E , w )$ be a weighted graph with $V : = \{ v _ { 1 } , \ldots , v _ { n } \}$ the set of nodes, $E \subset \{ \{ v _ { i } , v _ { j } \} \in$ $V \times V , i \ne j \}$ the set of (undirected) edges and $w : E \to ( 0 , \infty )$ assigning (positive) edge weights to the graph edges. Note that $w$ can equivalently be considered as a function of $V \times V$ , where we set the weights of non-adjacent node pairs to zero. We define a graph signal as a function $x : V \to \mathbb { R }$ on the nodes of $\mathcal { G }$ and aggregate them in a signal vector $\pmb { x } \in \mathbb { R } ^ { n }$ with the $i ^ { t h }$ entry being $x [ v _ { i } ]$ .
|
| 24 |
+
|
| 25 |
+
We define the weighted adjacency matrix $W \in \mathbb { R } ^ { n \times n }$ of the graph $\mathcal { G }$ as
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
W [ v _ { i } , v _ { j } ] : = { \left\{ \begin{array} { l l } { w ( v _ { i } , v _ { j } ) } & { { \mathrm { i f ~ } } \{ v _ { i } , v _ { j } \} \in E } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. } ,
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
and the degree matrix $\ b { D } \in \mathbb { R } ^ { n \times n }$ of $\mathcal { G }$ as $D : = \mathrm { d i a g } ( d _ { 1 } , . . . , d _ { n } )$ with $d _ { i } : = \deg ( v _ { i } ) : =$ $\textstyle \sum _ { j = 1 } ^ { n } W [ v _ { i } , v _ { j } ]$ being the degree of the node $v _ { i }$ .
|
| 32 |
+
|
| 33 |
+
The geometric scattering transform (Gao et al., 2019) relies on a cascade of graph filters constructed from a row stochastic diffusion matrix $P : = { \textstyle { \frac { 1 } { 2 } } } \big ( I _ { n } + W D ^ { - 1 } \big )$ , which corresponds to transition probabilities of a lazy random walk Markov process. The laziness of the process signifies that at each step it has equal probability of either staying at the current node or transitioning to a neighbor, where transition probabilities in the latter case are determined by (normalized) edge weights. Scattering filters are then defined via the graph-wavelet matrices $\Psi _ { j } \in \mathbb { R } ^ { n \times n }$ of scale $j \in { \mathbb { N } } _ { 0 }$ , as
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r l } & { \Psi _ { 0 } : = I _ { n } - P , } \\ & { \Psi _ { j } : = { P ^ { 2 ^ { j - 1 } } } - { P ^ { 2 ^ { j } } } = { P ^ { 2 ^ { j - 1 } } } \big ( I _ { n } - { P ^ { 2 ^ { j - 1 } } } \big ) , \quad j \geq 1 . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
These diffusion wavelet operators partition the frequency spectrum into dyadic frequency bands, which are then organized into a full wavelet filter bank $\mathcal { W } _ { J } : = \{ \Psi _ { j } , \Phi _ { J } \} _ { 0 \leq j \leq J }$ , where $\Phi _ { J } : = P ^ { 2 ^ { J } }$ is a pure low-pass filter, similar to the one used in GCNs. It is easy to verify that the resulting wavelet transform is invertible, since a simple sum of filter matrices in $\mathcal { W } _ { J }$ yields the identity. Moreover, as discussed in Perlmutter et al. (2019), this filter bank forms a nonexpansive frame, which provides energy preservation guarantees as well as stability to perturbations, and can be generalized to a wider family of constructions that encompasses the variations of scattering transforms on graphs from Gama et al. $( 2 0 1 9 \mathrm { a } ; \mathrm { b } )$ and Zou & Lerman (2019).
|
| 40 |
+
|
| 41 |
+
Given the wavelet filter bank $\mathcal { W } _ { J }$ , node-level scattering features are computed by stacking cascades of bandpass filters and element-wise absolute value nonlinearities to form
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
U _ { p } \pmb { x } : = \Psi _ { j _ { m } } | \Psi _ { j _ { m - 1 } } \cdot . . . | \Psi _ { j _ { 2 } } | \Psi _ { j _ { 1 } } \pmb { x } | | . . . | ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
indexed (or parametrized) by the scattering path $p : = ( j _ { 1 } , \ldots , j _ { m } ) \in \cup _ { m \in \mathbb { N } } \mathbb { N } _ { 0 } ^ { m }$ that determines the filter scales captured by each scattering coefficient. Then, a whole-graph scattering representation is obtained by aggregating together node-level features via statistical moments over the nodes of the graph (Gao et al., 2019). This construction yields the geometric scattering features
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
S _ { p , q } { \pmb x } : = \sum _ { i = 1 } ^ { n } | U _ { p } { \pmb x } [ v _ { i } ] | ^ { q } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
indexed by the scattering path $p$ and moment order $q$ . Finally, we note that it can be shown that the graph-level scattering transform $S _ { p , q }$ guarantees node-permutation invariance, while $U _ { p }$ is permutation equivariant (Perlmutter et al., 2019; Gao et al., 2019).
|
| 54 |
+
|
| 55 |
+
# 3 RELAXED GEOMETRIC SCATTERING CONSTRUCTION TO ALLOW TRAINING
|
| 56 |
+
|
| 57 |
+
The geometric scattering construction, described in Sec. 2, can be seen as a particular GNN with handcrafted layers, rather than learned ones. This provides a solid mathematical framework for understanding the encoding of geometric information in GNNs, as shown in Perlmutter et al. (2019), while also providing effective unsupervised graph representation learning for data exploration, which also has some advantages even in supervised learning task, as shown in Gao et al. (2019). While the handcrafted design in Perlmutter et al. (2019); Gao et al. (2019) is not a priori amenable to task-driven tuning provided by end-to-end GNN training, we note that the cascade in Eq. 3 does conform to a neural network architecture suitable for backpropagation. Therefore, in this section, we show how and under what conditions a relaxation of the laziness of the random walk and the selection of the scales preserves some of the useful mathematical properties established in Perlmutter et al. (2019). We then establish in section 5 the empirical benefits of learning the diffusion scales over a purely handcrafted design.
|
| 58 |
+
|
| 59 |
+
We first note that the construction of the diffusion matrix $_ { P }$ that forms the lowpass filter used in the fixed scattering construction can be relaxed to encode adaptive laziness by setting $P _ { \alpha } : =$ $\alpha pmb { I } _ { n } + ( 1 - \alpha ) \pmb { W } \pmb { D } ^ { - \top }$ . Where $\alpha \in [ 1 / 2 , 1 )$ controls the reluctance of the random walk to transition from one node to another. $\alpha = 1 / 2$ gives an equal probability to stay in the same node as to transition to one of its neighbors. At this point, we note that one difference between the diffusion lowpass filter here and the one typically used in GCN and its variation is the symmetrization applied in Kipf & Welling (2016). However, Perlmutter et al. (2019) established that for the original construction, this is only a technical difference since $_ { P }$ can be regarded as self-adjoint under an appropriate measure which encodes degree variations in the graph. This is then used to generate a Hilbert space $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ of graph signals with inner product $\langle \pmb { x } , \pmb { y } \rangle _ { D ^ { - 1 / 2 } } : = \langle D ^ { - 1 / 2 } \pmb { x } , D ^ { - 1 / 2 } \pmb { y } \rangle$ . The following lemma shows that a similar property is retained for our adaptive lowpass filter $P _ { \alpha }$ .
|
| 60 |
+
|
| 61 |
+
Lemma 1. The matrix $P _ { \alpha }$ is self-adjoint on the Hilbert space $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ from Perlmutter et al.
|
| 62 |
+
(2019).
|
| 63 |
+
|
| 64 |
+
We note that the self-adjointness shown here is interesting, as it links models that use symmetric and asymmetric versions of the Laplacian or adjacency matrix. Namely, Lemma 1 shows that the diffusion matrix $_ { r }$ (which is column normalized but not row normalized) is self-adjoint, as an operator, and can thus be considered as “symmetric” in a suitable inner product space, thus establishing a theoretical link between these design choices.
|
| 65 |
+
|
| 66 |
+
As a second relaxation, we propose to replace the handcrafted dyadic scales in Eq. 1 with an adaptive monotonic sequence of integer diffusion time scales tuned via training. Then, an adaptive filter bank is co $0 < t _ { 1 } < \cdots < t _ { J }$ $\mathcal { W } _ { J } ^ { \prime } : = \{ \boldsymbol { \Psi } _ { j } ^ { \prime } , \boldsymbol { \Phi } _ { J } ^ { \prime } \} _ { j = 0 } ^ { J - 1 }$ selected or, with
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } & { \Phi _ { J } ^ { \prime } : = P _ { \alpha } ^ { t _ { J } } , } \\ & { \Psi _ { 0 } ^ { \prime } : = I _ { n } - P _ { \alpha } ^ { t _ { 1 } } , } \\ & { \Psi _ { j } ^ { \prime } : = P _ { \alpha } ^ { t _ { j } } - P _ { \alpha } ^ { t _ { j + 1 } } , \quad 1 \leq j \leq J - 1 . } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The following theorem shows that for any selection of scales, the relaxed construction of $\mathcal { W } _ { J } ^ { \prime }$ constructs a nonexpansive frame, similar to the result from Perlmutter et al. (2019) shown for the original handcrafted construction.
|
| 73 |
+
|
| 74 |
+
Theorem 1. There exist a constant $C > 0$ that only depends on $t _ { 1 }$ and $t _ { J }$ such that for all ${ \textbf { \em x } } \in$ $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ ,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
C \| \pmb { x } \| _ { { D ^ { - 1 / 2 } } } ^ { 2 } \leqslant \| \pmb { \Phi } _ { J } ^ { \prime } \pmb { x } \| _ { { D ^ { - 1 / 2 } } } ^ { 2 } + \sum _ { j = 0 } ^ { J } \| \pmb { \Psi } _ { j } ^ { \prime } \pmb { x } \| _ { { D ^ { - 1 / 2 } } } ^ { 2 } \leqslant \| \pmb { x } \| _ { { D ^ { - 1 / 2 } } } ^ { 2 } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where the norm considered here is the one induced by the space $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$
|
| 81 |
+
|
| 82 |
+
Intuitively, the upper (i.e., nonexpansive) frame bound implies stability in the sense that small perturbations in the input graph signal will only result in small perturbations in the representation extracted by the constructed filter bank. Further, the lower frame bound ensures certain energy preservation by the constructed filter bank, thus indicating the nonexpansiveness is not implemented in a trivial fashion (e.g., by constant features independent of input signal).
|
| 83 |
+
|
| 84 |
+
In the next section we leverage the two relaxations described here to design a neural network architecture for learning the configuration $\alpha , t _ { 1 } , \ldots , t _ { J }$ of this relaxed construction via backpropagation through the resulting scattering filter cascade. The following theorem establishes that for any such configuration, extracted from $\mathcal { W } _ { J } ^ { \prime }$ via Eqs. 2-3, is permutation equivariant at the node-level and permutation invariant at the graph level. This guarantees that the extracted (in this case learned) features indeed encode intrinsic graph geometry rather than a priori indexation.
|
| 85 |
+
|
| 86 |
+
Theorem 2. Let $U _ { p } ^ { \prime }$ and $S _ { p , q } ^ { \prime }$ be defined as in Eq. 2 and 3 (correspondingly), with the filters from $\mathcal { W } _ { J } ^ { \prime }$ with an arbitrary configuration $0 < \alpha < 1$ , $0 < t _ { 1 } < \cdots < t _ { J }$ . Then, for any permutation Π over the nodes of $\mathcal { G }$ , and any graph signal $\pmb { x } \in L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { U _ { p } ^ { \prime } \Pi \boldsymbol { x } = \Pi U _ { p } ^ { \prime } \boldsymbol { x } \quad a n d \quad S _ { p , q } ^ { \prime } \Pi \boldsymbol { x } = S _ { p , q } ^ { \prime } \boldsymbol { x } \qquad p \in \cup _ { m \in \mathbb { N } } \mathbb { N } _ { 0 } ^ { m } , q \in \mathbb { N } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where geometric scattering implicitly considers here the node ordering supporting its input signal.
|
| 93 |
+
|
| 94 |
+
We note that the results in Lemma 1 and Theorems 1-2, as well as their proofs, closely follow the theoretical framework proposed by Perlmutter et al. (2019). We carefully account here for the relaxed learned configuration, which replaces the originally handcrafted configuration there. For completeness, the adjusted proofs appear in Sec. A of the Appendix.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 1: LEGSNet learns to select the appropriate scattering scales from the data.
|
| 98 |
+
|
| 99 |
+
# 4 LEARNABLE GEOMETRIC SCATTERING NETWORK ARCHITECTURE
|
| 100 |
+
|
| 101 |
+
In order to implement the relaxed geometric scattering construction (Sec. 3) via a trainable neural network, throughout this section, we consider an input graph signal $\ b { x } \in \mathbb { R } ^ { n }$ or, equivalently, a collection of graph signals $\pmb { X } \in \mathbb { R } ^ { n \times N _ { \ell - 1 } }$ . The propagation of these signals can be divided into three major modules. First, a diffusion module implements the Markov process that forms the basis of the filter bank and transform, while allowing learning of the laziness parameter $\alpha$ . Then, a scattering module implements the filters and the corresponding cascade, while allowing the learning of the scales $t _ { 1 } , \ldots , t _ { J }$ . Finally, the aggregation module collects the extracted features to provide a graph and produces the task-dependent output.
|
| 102 |
+
|
| 103 |
+
Building a diffusion process. We build a set of $m \in \mathbb { N }$ subsequent diffusion steps of the signal $_ { \textbf { \em x } }$ by iteratively multiplying the diffusion matrix $P _ { \alpha }$ to the left of the signal, resulting in
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\left[ P _ { \alpha } x , P _ { \alpha } ^ { 2 } x , P _ { \alpha } ^ { 3 } x , . . . , P _ { \alpha } ^ { m } x \right] ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Since $P _ { \alpha }$ is often sparse, for efficiency reasons these filter responses are implemented via an RNN structure consisting of $m$ RNN modules. Each module propagates the incoming hidden state $h _ { t - 1 } , t = 1 , \ldots , m$ with $P _ { \alpha }$ with the readout $\mathbf { } _ { o _ { t } }$ equal to the produced hidden state,
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
h _ { t } : = P _ { \alpha } h _ { t - 1 } , \quad o _ { t } : = h _ { t } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Our architecture and theory enable the implementation of either trainable or nontrainable $\alpha$ , which we believe will be useful for future work as indicated, for example, in Gao & Ji (2019). However, in the applications considered here (see Sec. 5), we find that training $\alpha$ made training unstable and did not improve performance. Therefore, for simplicity, we leave it fixed as $\alpha = 1 / 2$ for the remainder of this work. In this case, the RNN portion of the network contains no trainable parameters, thus speeding up the computation, but still enables a convenient gradient flow back to the model input.
|
| 116 |
+
|
| 117 |
+
Learning diffusion filter bank. Next, we consider the selection of $J \le m$ diffusion scales for the relaxed filter bank construction with the wavelets defined according to Eq. 5. We found this was the most influential part of the architecture. We experimented with methods of increasing flexibility:
|
| 118 |
+
|
| 119 |
+
1. Selection of $\{ t _ { j } \} _ { j = 1 } ^ { J - 1 }$ as dyadic scales (as in Sec. 2 and Eq. 1), fixed for all datasets (LEGSFIXED),
|
| 120 |
+
2. Selection of each $t _ { j }$ using softmax and sorting by $j$ , learnable per model (LEGS-FCN and LEGS-RBF, depending on output layer explained below).
|
| 121 |
+
|
| 122 |
+
For the softmax selection, we use a selection matrix $\pmb { F } \in \mathbb { R } ^ { J \times m }$ , where each row $F _ { ( j , \cdot ) } , j \ =$ $1 , \ldots , J$ is dedicated to identifying the diffusion scale of the wavelet $P _ { \alpha } ^ { t _ { j } }$ via a one-hot encoding. This is achieved by setting
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\boldsymbol F : = \mathrm { s o f t m a x } ( \boldsymbol \Theta ) = [ \mathrm { s o f t m a x } ( \pmb \theta _ { 1 } ) , \mathrm { s o f t m a x } ( \pmb \theta _ { 2 } ) , \dots , \mathrm { s o f t m a x } ( \pmb \theta _ { J } ) ] ^ { T }
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $\pmb { \theta } _ { j } \in \mathbb { R } ^ { m }$ constitute the rows of the trainable weight matrix $\Theta$ . While this construction may not strictly guarantee an exact one-hot encoding, we assume that the softmax activations yield a sufficient approximation. Further, without loss of generality, we assume that the rows of $\pmb { F }$ are ordered according to the position of the leading “one” activated in every row. In practice, this can be easily enforced by reordering the rows. We now construct the filter bank with the filters $\widetilde { \mathcal { W } } _ { F } : = \{ \widetilde { \Psi } _ { j } , \widetilde { \Phi } _ { J } \} _ { j = 0 } ^ { J - 1 }$
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r l r l } & { \widetilde { \Phi } _ { J } \pmb { x } = \sum _ { t = 1 } ^ { m } F _ { ( J , t ) } { \pmb { P } } _ { \alpha } ^ { t } \pmb { x } , } \\ & { \widetilde { \Psi } _ { 0 } \pmb { x } = { \pmb { I } } _ { n } - \sum _ { t = 1 } ^ { m } F _ { ( 1 , t ) } { \pmb { P } } _ { \alpha } ^ { t } \pmb { x } } \\ & { \widetilde { \Psi } _ { j } \pmb { x } = \sum _ { t = 1 } ^ { m } \left[ F _ { ( j , t ) } { \pmb { P } } _ { \alpha } ^ { t } \pmb { x } - F _ { j + 1 , t } { \pmb { P } } _ { \alpha } ^ { t } \pmb { x } \right] } & & { 1 \leq j \leq J - 1 } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
matching and implementing the construction of $\mathcal { W } _ { J } ^ { \prime }$ from Eq. 4.
|
| 135 |
+
|
| 136 |
+
Aggregating and classifying scattering features. While many approaches may be applied to aggregate node-level features into graph-level features such as max, mean, sum pooling, and the more powerful TopK (Gao & Ji, 2019) or attention pooling (Velickovi ˇ c et al., 2018), we follow the ´ statistical-moment aggregation explained in Secs. 2-3 (motivated by Gao et al., 2019; Perlmutter et al., 2019) and leave exploration of other pooling methods to future work. As shown in Gao et al. (2019) on graph classification, this aggregation works particularly well in conjunction with support vector machines (SVMs) based on the radial basis function (RBF) kernel.
|
| 137 |
+
|
| 138 |
+
Here, we consider two configurations for the task-dependent output layer of the network, either using a small neural network with two fully connected layers, which we denote LEGS-FCN, or using a modified RBF network (Broomhead & Lowe, 1988), which we denote LEGS-RBF, to produce the final classification. The latter configuration more accurately processes scattering features as shown in Table 2. Our RBF network works by first initializing a fixed number of movable anchor points. Then, for every point, new features are calculated based on the radial distances to these anchor points. In previous work on radial basis networks these anchor points were initialized independent of the data. We found that this led to training issues if the range of the data was not similar to the initialization of the centers. Instead, we first use a batch normalization layer to constrain the scale of the features and then pick anchors randomly from the initial features of the first pass through our data. This gives an RBF-kernel network with anchors that are always in the range of the data. Our RBF layer is then $\mathrm { R B F } ( { \pmb x } ) = \phi ( \| \mathrm { B a t c h N o r m } ( { \pmb x } ) - { \pmb c } \| )$ with $\phi ( \pmb { x } ) = e ^ { - \| \pmb { x } \| ^ { 2 } }$ .
|
| 139 |
+
|
| 140 |
+
# 5 EMPIRICAL RESULTS
|
| 141 |
+
|
| 142 |
+
Here we show results of LEGSNet on whole graph classification and graph regression tasks, that arise in a variety of contexts, with emphasis on the more complex biochemic datasets. We use biochemical graph datasets as they represent a new challenge in the field of graph learning. Unlike
|
| 143 |
+
|
| 144 |
+
Table 1: Dataset statistics, diameter, nodes, edges, and clustering coefficient averaged over graphs.
|
| 145 |
+
|
| 146 |
+
<table><tr><td></td><td># Graphs</td><td># Classes</td><td>Diameter</td><td>Nodes</td><td>Edges</td><td>Clust. Coeff</td></tr><tr><td>DD</td><td>1178</td><td>2</td><td>19.81</td><td>284.32</td><td>715.66</td><td>0.48</td></tr><tr><td>ENZYMES</td><td>600</td><td>6</td><td>10.92</td><td>32.63</td><td>62.14</td><td>0.45</td></tr><tr><td>MUTAG</td><td>188</td><td>2</td><td>8.22</td><td>17.93</td><td>19.79</td><td>0.00</td></tr><tr><td>NCI1</td><td>4110</td><td>2</td><td>13.33</td><td>29.87</td><td>32.30</td><td>0.00</td></tr><tr><td>NCI109</td><td>4127</td><td></td><td>13.14</td><td>29.68</td><td>32.13</td><td>0.00</td></tr><tr><td>PROTEINS</td><td>1113</td><td>22</td><td>11.62</td><td>39.06</td><td>72.82</td><td>0.51</td></tr><tr><td>PTC</td><td>344</td><td>2</td><td>7.52</td><td>14.29</td><td>14.69</td><td>0.01</td></tr></table>
|
| 147 |
+
|
| 148 |
+
other types of data, these datasets do not exhibit the small-world structure of social datasets and may have large graph diameters for their size. Further, the connectivity patterns of biomolecules are very irregular due to 3D folding and long range connections, and thus ordinary local node aggregation methods may miss such connectivity differences.
|
| 149 |
+
|
| 150 |
+
# 5.1 WHOLE GRAPH CLASSIFICATION
|
| 151 |
+
|
| 152 |
+
We perform whole graph classification by using eccentricity and clustering coefficient as node features as is done in Gao et al. (2019). We compare against graph convolutional networks (GCN) (Kipf & Welling, 2016), GraphSAGE (Hamilton et al., 2017), graph attention network (GAT) (Velickovi ˇ c´ et al., 2018), graph isomorphism network (GIN) (Xu et al., 2019), Snowball network (Luan et al., 2019), and fixed geometric scattering with a support vector machine classifier (GS-SVM) as in Gao et al. (2019), and a baseline which is a 2-layer neural network on the features averaged across nodes (disregarding graph structure). These comparisons are meant to inform when including learnable graph scattering features are helpful in extracting whole graph features. Specifically, we are interested in the types of graph datasets where existing graph neural network performance can be improved upon with scattering features. We evaluate these methods across 7 benchmark biochemical datasets: DD, ENZYMES, MUTAG, NCI1, NCI109, PROTEINS, and PTC where the goal is to classify between two or more classes of compounds with hundreds to thousands of graphs and tens to hundreds of nodes (See Table 1). For completeness we also show results on six social network datasets in Table S2. For more specific information on individual datasets see Appendix B. We use 10-fold cross validation on all models which is elaborated on in Appendix C. For an ensembling comparison to Scattering-GCN (Min et al., 2020) see Appendix D.
|
| 153 |
+
|
| 154 |
+
Table 2: Mean $\pm$ standard deviation test set accuracy on biochemical datasets. Time limit expired (TLE) individual denotes models that did not finish in 10 hours.
|
| 155 |
+
|
| 156 |
+
<table><tr><td></td><td>DD</td><td>ENZYMES</td><td>MUTAG</td><td>NCI1</td><td>NCI109</td><td>PROTEINS</td><td>PTC</td></tr><tr><td>LEGS-RBF</td><td>72.58 ± 3.35</td><td>36.33 ± 4.50</td><td>33.51 ± 4.34</td><td>74.26 ± 1.53</td><td>72.47 ± 2.11</td><td>70.89 ± 3.91</td><td>57.26± 5.54</td></tr><tr><td>LEGS-FCN</td><td>72.07 ± 2.37</td><td>38.50 ± 8.18</td><td>82.98 ± 9.85</td><td>70.83 ± 2.65</td><td>70.17 ± 1.46</td><td>71.06 ± 3.17</td><td>56.92 ± 9.36</td></tr><tr><td>LEGS-FIXED</td><td>69.09 ± 4.82</td><td>32.33 ±5.04</td><td>81.84 ±11.24</td><td>71.24 ± 1.63</td><td>69.25 ± 1.75</td><td>67.30 ± 2.94</td><td>54.31 ±6.92</td></tr><tr><td>GCN</td><td>67.82 ± 3.81</td><td>31.33 ± 6.89</td><td>79.30 ± 9.66</td><td>60.80 ± 4.26</td><td>61.30 ± 2.99</td><td>74.03 ± 3.20</td><td>56.34 ± 10.29</td></tr><tr><td>GraphSAGE</td><td>66.37 ± 4.45</td><td>15.83 ± 9.10</td><td>81.43 ± 11.64</td><td>57.54 ± 3.33</td><td>55.15 ± 2.58</td><td>71.87 ± 3.50</td><td>55.22 ±9.13</td></tr><tr><td>GAT</td><td>68.50 ± 3.62</td><td>25.83 ± 4.73</td><td>79.85 ± 9.44</td><td>62.19 ± 2.18</td><td>61.28 ± 2.24</td><td>73.22 ± 3.55</td><td>55.50 ± 6.90</td></tr><tr><td>GIN</td><td>42.37 ± 4.32</td><td>36.83 ± 4.81</td><td>83.57 ± 9.68</td><td>66.67 ± 2.90</td><td>65.23 ± 1.82</td><td>75.02 ± 4.55</td><td>55.82 ± 8.07</td></tr><tr><td>Snowball</td><td>TLE</td><td>18.00 ± 1.89</td><td>50.56 ± 20.87</td><td>48.56 ± 2.92</td><td>50.86 ± 2.65</td><td>39.36± 4.29</td><td>50.84 ±9.32</td></tr><tr><td>GS-SVM</td><td>72.66± 4.94</td><td>27.33 ±5.10</td><td>85.09 ± 7.44</td><td>69.68 ± 2.38</td><td>68.55 ± 2.06</td><td>70.98 ± 2.67</td><td>56.96 ± 7.09</td></tr><tr><td>Baseline</td><td>75.98 ± 2.81</td><td>20.50± 5.99</td><td>79.80 ± 9.92</td><td>56.69 ± 3.07</td><td>57.38 ± 2.20</td><td>73.22 ± 3.76</td><td>56.71 ± 5.54</td></tr></table>
|
| 157 |
+
|
| 158 |
+
LEGS outperforms on biological datasets. A somewhat less explored domain for GNNs is in biochemical graphs that represent molecules and tend to be overall smaller and less connected (see Tables 1 and S1) than social networks. In particular we find that LEGSNet outperforms other methods by a significant margin on biochemical datasets with relatively small but high diameter graphs (NCI1, NCI109, ENZYMES, PTC), as shown in Table 2. On extremely small graphs we find that GS-SVM performs best, which is expected as other methods with more parameters can easily overfit the data. We reason that the performance increases exhibited by LEGSNet, and to a lesser extent GS-SVM, on these chemical and biological benchmarks is due the ability of geometric scattering to compute complex connectivity features via its multiscale diffusion wavelets. Thus, methods that rely on a scattering construction would in general perform better, with the flexibility and trainability LEGSNet giving it an edge on most tasks.
|
| 159 |
+
|
| 160 |
+
LEGS performs consistently on social network datasets. On the social network datasets LEGSNet performs consistently well, although its benefits here are not as clear as in the biochemical datasets. Ignoring the fixed scattering transform GS-SVM, which was tuned in Gao et al. (2019) with a focus on these particular social network datasets, a version of LEGSNet is best on three out of the six social datasets and second best on the other three. Since the advantages are clearer in the biochemical domain, we focus on this in the remainder of this section. However, for completeness, we provide results on social network datasets in Table S2, and leave further discussion to Appendix B.1.
|
| 161 |
+
|
| 162 |
+
LEGS preserves enzyme exchange preferences while increasing performance. One advantage of geometric scattering over other graph embedding techniques lies in the rich information present within the scattering feature space. This was demonstrated in Gao et al. (2019) where it was shown that the embeddings created through fixed geometric scattering can be used to accurately infer inter-graph relationships. Scattering features of enzyme graphs within the ENZYMES dataset (Borgwardt et al., 2005) possessed sufficient
|
| 163 |
+
|
| 164 |
+
global information to recreate the enzyme class exchange preferences observed empirically by Cuesta et al. (2015), using only linear methods of analysis, and despite working with a much smaller and artificially balanced dataset. We demonstrate here that LEGSNet retains similar descriptive capabilities, as shown in Figure 2 via chord diagrams where each exchange preference between enzyme classes (estimated as suggested in Gao et al., 2019) is represented as a ribbon of the corresponding size. Our results here (and in Table S5, which provides complementary quantitative comparison) show that, with relaxations on the scattering parameters, LEGS-FCN achieves better classification accuracy than both LEGS-FIXED and GCN (see Table 1) while also retaining a more descriptive embedding that maintains the global structure of relations between enzyme classes. We ran two varieties of LEGSNet on the ENZYMES dataset: LEGS-FIXED and LEGSFCN, which allows the diffusion scales to be learned. For comparison, we also ran a standard GCN whose graph embeddings were obtained via mean pooling. To infer enzyme ex
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 2: Enzyme class exchange preferences empirically observed in Cuesta et al. (2015), and estimated from LEGS and GCN embeddings.
|
| 168 |
+
|
| 169 |
+
change preferences from their embeddings, we followed Gao et al. (2019) in defining the distance from an enzyme $e$ to the enzyme class $\mathrm { E C } _ { j }$ as $\mathrm { d i s t } ( e , \mathrm { E C } _ { j } ) : = \| v _ { e } - \mathrm { p r o j } _ { C _ { j } } ( v _ { e } ) \|$ , where $v _ { i }$ is the embedding of $e$ , and $C _ { j }$ is the PCA subspace of the enzyme feature vectors within $\mathrm { E C } _ { j }$ . The distance between the enzyme classes $\operatorname { E C } _ { i }$ and $\mathrm { E C } _ { j }$ is the average of the individual distances, mean $\{ \mathrm { d i s t } ( e , \mathbf { E C } _ { j } ) : e \in \mathbf { E C } _ { i } \}$ . From here, the affinity between two enzyme classes is computed as pref $\begin{array} { r } { ( \mathrm { E C } _ { i } , \mathrm { E C } _ { j } ) = w _ { i } / \operatorname* { m i n } ( \frac { D _ { i , i } } { D _ { i , j } } , \frac { D _ { j , j } } { D _ { j , i } } ) , } \end{array}$ , where $w _ { i }$ is the percentage of enzymes in class $i$ which are closer to another class than their own, and $D _ { i , j }$ is the distance between $\mathrm { E C } _ { i }$ and $\mathrm { E C } _ { j }$ .
|
| 170 |
+
|
| 171 |
+
Robustness to reduced training set size. We remark that similar to the robustness shown in (Gao et al., 2019) for handcrafted scattering, LEGSNet is able to maintain accuracy even when the training set size is shrunk to as low as $20 \%$ of the dataset, with a median decrease of $4 . 7 \%$ accuracy as when $80 \%$ of the data is used for training, as discussed in the supplement (see Table S3).
|
| 172 |
+
|
| 173 |
+
# 5.2 GRAPH REGRESSION
|
| 174 |
+
|
| 175 |
+
We next evaluate learnable scattering on two graph regression tasks, the QM9 (Gilmer et al., 2017; Wu et al., 2018) graph regression dataset, and a new task from the critical assessment of structure prediction (CASP) challenge (Moult et al., 2018). On the CASP task, the main objective is to score protein structure prediction/simulation models in terms of the discrepancy between their predicted structure and the actual structure of the protein (which is known a priori). The accuracy of such 3D structure predictions are evaluated using a variety of met
|
| 176 |
+
|
| 177 |
+
Table 3: Train and test set mean squared error on CASP GDT regression task over three seeds.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>(μ±σ)</td><td>Train MSE</td><td>Test MSE</td></tr><tr><td>LEGS-FCN</td><td>134.34 ± 8.62</td><td>144.14 ± 15.48</td></tr><tr><td>LEGS-RBF</td><td>140.46 ± 9.76</td><td>152.59 ± 14.56</td></tr><tr><td>LEGS-FIXED</td><td>136.84 ± 15.57</td><td>160.03 ± 1.81</td></tr><tr><td>GCN</td><td>289.33 ± 15.75</td><td>303.52 ± 18.90</td></tr><tr><td>GraphSAGE</td><td>221.14 ± 42.56</td><td>219.44 ± 34.84</td></tr><tr><td>GIN</td><td>221.14 ± 42.56</td><td>219.44 ± 34.84</td></tr><tr><td>Baseline</td><td>393.78 ± 4.02</td><td>402.21 ± 21.45</td></tr></table>
|
| 180 |
+
|
| 181 |
+
rics, but we focus on the global distance test (GDT) score (Modi et al., 2016). The GDT score measures the similarity between tertiary structures of two proteins with amino-acid correspondence. A higher score means two structures are more similar. For a set of predicted 3D structures for a protein, we would like to score their quality as quantified by the GDT score.
|
| 182 |
+
|
| 183 |
+
For this task we use the CASP12 dataset (Moult et al., 2018) and preprocess the data similarly to Ingraham et al. (2019), creating a KNN graph between proteins based on the 3D coordinates of each amino acid. From this KNN graph we regress against the GDT score. We evaluate on 12 proteins from the CASP12 dataset and choose random (but consistent) splits with $80 \%$ train, $10 \%$ validation, and $10 \%$ test data out of 4000 total structures. We are only concerned with structure similarity so use no non-structural node features.
|
| 184 |
+
|
| 185 |
+
LEGSNet outperforms on all CASP targets Across all CASP targets we find that LEGSNet significantly outperforms GNN and baseline methods (See Table S4). This performance improvement is particularly stark on the easiest structures (measured by average GDT) but is consistent across all structures. In Figure 3 we show the relationship between percent improvement of LEGSNet over the GCN model and the average GDT score across the target structures. We draw attention to target t0879, where LEGSNet shows the greatest improvement over other methods. This target has long range dependencies (Ovchinnikov et al., 2018) as it exhibits metal coupling (Li et al., 2015)
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 3: CASP dataset LEGS-FCN $\%$ improvement over GCN in MSE of GDT prediction vs. Average GDT score.
|
| 189 |
+
|
| 190 |
+
creating long range connections over the sequence. Since other methods are unable to model these long range connections LEGSNet is particularly important on these more difficult to model targets.
|
| 191 |
+
|
| 192 |
+
LEGSNet outperforms on the QM9 dataset We evaluate the performance of LEGSNet on the quantum chemistry dataset QM9 (Gilmer et al., 2017; Wu et al., 2018), which consists of 130,000 molecules with ${ \sim } 1 8$ nodes per molecule. We use the node features from Gilmer et al. (2017), with the addition of eccentricity and clustering coefficient features, and ignore the edge features. We whiten all targets to have zero mean and unit standard deviation. We train each network against all 19 targets and evaluate the mean squared error on the test set with mean and std. over four runs. We find that learning the scales improves the overall MSE, and particularly improves the results over difficult targets (see Table 4 for overall results and Table S7 for results by target). Indeed, on more difficult targets (i.e., those with large test error) LEGS-FCN is able to perform better, where on easy targets GIN is the best. Overall, scattering features offer a robust signal over many targets, and while perhaps less flexible (by construction), they achieve good average performance with significantly fewer parameters.
|
| 193 |
+
|
| 194 |
+
Table 4: Mean $\pm$ std. over four runs of mean squared error over 19 targets for the QM9 dataset, lower is better.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>(μ±σ)</td><td>Test MSE</td></tr><tr><td>LEGS-FCN</td><td>0.216 ± 0.009</td></tr><tr><td>LEGS-FIXED</td><td>0.228 ± 0.019</td></tr><tr><td>GraphSAGE</td><td>0.524 ± 0.224</td></tr><tr><td>GCN GIN</td><td>0.417 ± 0.061</td></tr><tr><td>Baseline</td><td>0.247 ± 0.037 0.533 ± 0.041</td></tr></table>
|
| 197 |
+
|
| 198 |
+
# 6 CONCLUSION
|
| 199 |
+
|
| 200 |
+
In this work we have established a relaxation from fixed geometric scattering with strong guarantees to a more flexible network with better performance by learning data dependent scales. Allowing the network to choose data-driven diffusion scales leads to improved performance particularly on biochemical datasets, while keeping strong guarantees on extracted features. This parameterization has advantages in representing long range connections with a small number of weights, which are necessary in complex biochemical data. This also opens the possibility to provide additional relaxation to enable node-specific or graph-specific tuning via attention mechanisms, which we regard as an exciting future direction, but out of scope for the current work.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
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
|
| 205 |
+
|
| 206 |
+
Architectures via Sparsified Neighborhood Mixing. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 207 |
+
|
| 208 |
+
Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. arXiv preprint arXiv:2006.05205, 2020.
|
| 209 |
+
|
| 210 |
+
Pablo Barcelo, Egor V Kostylev, Mikael Monet, Jorge P ´ erez, Juan Reutter, and Juan Pablo Silva. ´ The logical expressiveness of graph neural networks. In International Conference on Learning Representations, 2020.
|
| 211 |
+
|
| 212 |
+
K. M. Borgwardt, C. S. Ong, S. Schonauer, S. V. N. Vishwanathan, A. J. Smola, and H.-P. Kriegel. Protein function prediction via graph kernels. Bioinformatics, 21(Suppl 1):i47–i56, June 2005. ISSN 1367-4803, 1460-2059. doi: 10.1093/bioinformatics/bti1007.
|
| 213 |
+
|
| 214 |
+
Michael M. Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: Going beyond Euclidean data. IEEE Signal Process. Mag., 34(4):18–42, 2017. ISSN 1053-5888. doi: 10.1109/MSP.2017.2693418.
|
| 215 |
+
|
| 216 |
+
D. S. Broomhead and D Lowe. Radial Basis Functions, Multi-Variable Functional Interpolation and Adaptive Networks. R. Signals Raar Establ., Memorandum 4148, 1988.
|
| 217 |
+
|
| 218 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral Networks and Locally Connected Networks on Graphs. In ICLR, 2014.
|
| 219 |
+
|
| 220 |
+
Ronald R. Coifman and Mauro Maggioni. Diffusion wavelets. Applied and Computational Harmonic Analysis, 21(1):53–94, July 2006. ISSN 10635203. doi: 10.1016/j.acha.2006.04.004.
|
| 221 |
+
|
| 222 |
+
Sergio Martinez Cuesta, Syed Asad Rahman, Nicholas Furnham, and Janet M. Thornton. The Classification and Evolution of Enzyme Function. Biophysical Journal, 109(6):1082–1086, 2015. ISSN 00063495. doi: 10.1016/j.bpj.2015.04.020.
|
| 223 |
+
|
| 224 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional Neural Networks on ¨ Graphs with Fast Localized Spectral Filtering. Adv. Neural Inf. Process. Syst. 30, 2016.
|
| 225 |
+
|
| 226 |
+
Paul D. Dobson and Andrew J. Doig. Distinguishing Enzyme Structures from Non-enzymes Without Alignments. Journal of Molecular Biology, 330(4):771–783, July 2003. ISSN 0022-2836. doi: 10.1016/S0022-2836(03)00628-4.
|
| 227 |
+
|
| 228 |
+
Fernando Gama, Joan Bruna, and Alejandro Ribeiro. Diffusion Scattering Transforms on Graphs. Int. Conf. Mach. Learn., 2019a.
|
| 229 |
+
|
| 230 |
+
Fernando Gama, Joan Bruna, and Alejandro Ribeiro. Stability of Graph Scattering Transforms. Adv. Neural Inf. Process. Syst. 33, 2019b.
|
| 231 |
+
|
| 232 |
+
Feng Gao, Guy Wolf, and Matthew Hirn. Geometric scattering for graph data analysis. In Proceedings of the 36th International Conference on Machine Learning, pp. 2122–2131, 2019.
|
| 233 |
+
|
| 234 |
+
Hongyang Gao and Shuiwang Ji. Graph U-Nets. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 235 |
+
|
| 236 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural Message Passing for Quantum Chemistry. In Proceedings of the 34th International Conference on Machine Learning, 2017.
|
| 237 |
+
|
| 238 |
+
William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive Representation Learning on Large Graphs. Adv. Neural Inf. Process. Syst. 31, 2017.
|
| 239 |
+
|
| 240 |
+
John Ingraham, Vikas Garg, Regina Barzilay, and Tommi Jaakkola. Generative Models for GraphBased Protein Design. In H. Wallach, H. Larochelle, A. Beygelzimer, F. Alche-Buc, E. Fox, ´ and R. Garnett (eds.), Advances in Neural Information Processing Systems 33, pp. 15820–15831, 2019.
|
| 241 |
+
|
| 242 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In 3rd International Conference on Learning Representations, 2015.
|
| 243 |
+
|
| 244 |
+
Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. 4th Int. Conf. Mach. Learn., September 2016.
|
| 245 |
+
|
| 246 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI-18), pp. 3538–3545. Association for the Advancement of Artificial Intelligence, 2018.
|
| 247 |
+
|
| 248 |
+
Wenfei Li, Jun Wang, Jian Zhang, and Wei Wang. Molecular simulations of metal-coupled protein folding. Current Opinion in Structural Biology, 30:25–31, February 2015. ISSN 0959-440X. doi: 10.1016/j.sbi.2014.11.006.
|
| 249 |
+
|
| 250 |
+
Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. LanczosNet: Multi-Scale Deep Graph Convolutional Networks. In ICLR, 2019.
|
| 251 |
+
|
| 252 |
+
Sitao Luan, Mingde Zhao, Xiao-Wen Chang, and Doina Precup. Break the Ceiling: Stronger Multiscale Deep Graph Convolutional Networks. In Advances in Neural Information Processing Systems 33, 2019.
|
| 253 |
+
|
| 254 |
+
Stephane Mallat. Group Invariant Scattering. ´ Commun. Pure Appl. Math., LXV:1331–1398, 2012.
|
| 255 |
+
|
| 256 |
+
Yimeng Min, Frederik Wenkel, and Guy Wolf. Scattering gcn: Overcoming oversmoothness in graph convolutional networks. arXiv preprint arXiv:2003.08414, 2020.
|
| 257 |
+
|
| 258 |
+
Vivek Modi, Qifang Xu, Sam Adhikari, and Roland L. Dunbrack. Assessment of Template-Based Modeling of Protein Structure in CASP11. Proteins, 84(Suppl 1):200–220, September 2016. ISSN 0887-3585. doi: 10.1002/prot.25049.
|
| 259 |
+
|
| 260 |
+
John Moult, Krzysztof Fidelis, Andriy Kryshtafovych, Torsten Schwede, and Anna Tramontano. Critical assessment of methods of protein structure prediction (CASP)—Round XII. Proteins Struct. Funct. Bioinforma., 86(S1):7–15, 2018. ISSN 1097-0134. doi: 10.1002/prot.25415.
|
| 261 |
+
|
| 262 |
+
Sergey Ovchinnikov, Hahnbeom Park, David E. Kim, Frank DiMaio, and David Baker. Protein structure prediction using Rosetta in CASP12. Proteins Struct. Funct. Bioinforma., 86(S1):113– 121, 2018. ISSN 1097-0134. doi: 10.1002/prot.25390.
|
| 263 |
+
|
| 264 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems 33, pp. 8026– 8037, 2019.
|
| 265 |
+
|
| 266 |
+
Michael Perlmutter, Guy Wolf, and Matthew Hirn. Geometric scattering on manifolds. In NeurIPS 2018 Workshop on Integration of Deep Learning Theories, 2018.
|
| 267 |
+
|
| 268 |
+
Michael Perlmutter, Feng Gao, Guy Wolf, and Matthew Hirn. Understanding graph neural networks with asymmetric geometric scattering transforms. arXiv preprint arXiv:1911.06253, 2019.
|
| 269 |
+
|
| 270 |
+
H. Toivonen, A. Srinivasan, R. D. King, S. Kramer, and C. Helma. Statistical evaluation of the Predictive Toxicology Challenge 2000-2001. Bioinformatics, 19(10):1183–1193, July 2003. ISSN 1367-4803, 1460-2059. doi: 10.1093/bioinformatics/btg130.
|
| 271 |
+
|
| 272 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. 6th Int. Conf. Learn. Represent., 2018.
|
| 273 |
+
|
| 274 |
+
Nikil Wale, Ian A Watson, and George Karypis. Comparison of Descriptor Spaces for Chemical Compound Retrieval and Classification. Knowl. Inf. Syst., 2008.
|
| 275 |
+
|
| 276 |
+
Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: A benchmark for molecular machine learning. Chem. Sci., 9(2):513–530, 2018. ISSN 2041-6520, 2041-6539. doi: 10.1039/C7SC02664A.
|
| 277 |
+
|
| 278 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful Are Graph Neural Networks? ICLR, 2019.
|
| 279 |
+
|
| 280 |
+
Pinar Yanardag and S.V.N. Vishwanathan. Deep Graph Kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining - KDD ’15, pp. 1365–1374, Sydney, NSW, Australia, 2015. ACM Press. ISBN 978-1-4503-3664-2. doi: 10. 1145/2783258.2783417.
|
| 281 |
+
|
| 282 |
+
Dongmian Zou and Gilad Lerman. Graph convolutional neural networks via scattering. Applied and Computational Harmonic Analysis, 2019. ISSN 10635203. doi: 10.1016/j.acha.2019.06.003.
|
| 283 |
+
|
| 284 |
+
# APPENDIX
|
| 285 |
+
|
| 286 |
+
# A PROOFS FOR SECTION 3
|
| 287 |
+
|
| 288 |
+
A.1 PROOF OF LEMMA 1
|
| 289 |
+
|
| 290 |
+
Let $M _ { \alpha } = D ^ { - 1 / 2 } P _ { \alpha } D ^ { 1 / 2 }$ then it can be verified that $M _ { \alpha }$ is a symmetric conjugate of $P _ { \alpha }$ , and by construction is self-adjoint with respect to the standard inner product of $L ^ { \bar { 2 } } ( \bar { \mathcal { G } } )$ . Let $\mathbf { { } _ { \pmb { x } } , { \pmb y } _ { \mathbf { \mu } } \in }$ $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ then we have
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { r l } & { \langle P _ { \alpha } x , y \rangle _ { D ^ { - 1 / 2 } } = \langle D ^ { - 1 / 2 } P _ { \alpha } x , D ^ { - 1 / 2 } y \rangle } \\ & { \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
which gives the result of the lemma.
|
| 297 |
+
|
| 298 |
+
# A.2 PROOF OF THEOREM 1
|
| 299 |
+
|
| 300 |
+
As shown in the previous proof (Sec. A.1), $P _ { \alpha }$ has a symmetric conjugate $M _ { \alpha }$ . Given the eigendecomposition $M _ { \alpha } = Q \Lambda Q ^ { T }$ , we can write $P _ { \alpha } ^ { t } = D ^ { 1 / \bar { 2 } } Q \Lambda ^ { t } Q ^ { T } D ^ { - \bar { 1 } / 2 }$ , giving the eigendecomposition of the propagated diffusion matrices. Furthermore, it can be verified that the eigenvalues on the diagonal of $\Lambda$ are nonnegative. Briefly, this results from graph Laplacian eigenvalues being within the range $[ 0 , 1 ]$ , which means those of $W D ^ { - 1 }$ are in $[ - 1 , 1 ]$ , which combined with $1 / 2 \bar { \le } \alpha \le 1$ result in $\lambda _ { i } : = [ \Lambda ] _ { i i } \in [ 0 , 1 ]$ for every $j$ . Next, given this decomposition we can write:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\begin{array} { r l } & { \Phi _ { J } ^ { \prime } = D ^ { 1 / 2 } Q \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } , } \\ & { \Psi _ { j } ^ { \prime } = D ^ { 1 / 2 } Q ( \Lambda ^ { t _ { j } } - \Lambda ^ { t _ { j + 1 } } ) Q ^ { T } D ^ { - 1 / 2 } , \quad 0 \leq j \leq J - 1 . } \end{array}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
where we set $t _ { 0 } = 0$ to simplify notations. Then, we have:
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { l } { \| \Phi _ { J } ^ { \prime } x \| _ { D ^ { - 1 / 2 } } ^ { 2 } = \langle \Phi _ { J } ^ { \prime } x , \Phi _ { J } ^ { \prime } x \rangle _ { D ^ { - 1 / 2 } } } \\ { = \langle D ^ { - 1 / 2 } D ^ { 1 / 2 } Q \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } x , D ^ { - 1 / 2 } D ^ { 1 / 2 } Q \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } x \rangle } \\ { = x ^ { T } D ^ { - 1 / 2 } Q \Lambda ^ { t _ { J } } Q ^ { T } Q \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } x = ( x ^ { T } D ^ { - 1 / 2 } Q \Lambda ^ { t _ { J } } ) ( \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } x ) } \\ { = \| \Lambda ^ { t _ { J } } Q ^ { T } D ^ { - 1 / 2 } x \| _ { 2 } ^ { 2 } } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
Further, since $Q$ is orthogonal (as it is constructed from an eigenbasis of a symmetric matrix), if we consider a change of variable to $\pmb { y } = \pmb { Q } ^ { T } \pmb { D } ^ { - 1 / 2 } \pmb { x }$ , we have $\| \pmb { x } \| _ { D ^ { - 1 / 2 } } ^ { 2 } = \| \pmb { D } ^ { - 1 / 2 } \pmb { x } \| _ { 2 } ^ { 2 } = \| \pmb { y } \| _ { 2 } ^ { 2 }$ while $\| \Phi _ { J } ^ { \prime } \pmb { x } \| _ { D ^ { - 1 / 2 } } ^ { 2 } = \| \Lambda ^ { t _ { J } } \pmb { y } \| _ { 2 } ^ { 2 }$ . Similarly, we can also reformulate the operation of other filters in terms of diagonal matrices applied to $\textbf { { y } }$ as $\mathcal { W } _ { J } ^ { \prime }$ as $\| \Psi _ { j } ^ { \prime } \pmb { x } \| _ { D ^ { - 1 / 2 } } ^ { 2 } = \| ( \Lambda ^ { t _ { j } } - \Lambda ^ { t _ { j + 1 } } ) \pmb { y } \| _ { 2 } ^ { 2 }$ .
|
| 313 |
+
|
| 314 |
+
Given the reformulation in terms of $\textbf { { y } }$ and standard $L ^ { 2 } ( { \mathcal { G } } )$ , we can now write
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\| \Lambda ^ { t , \ j } y \| _ { 2 } ^ { 2 } + \sum _ { j = 0 } ^ { J - 1 } \| ( \Lambda ^ { t _ { j } } - \Lambda ^ { t _ { j + 1 } } ) y \| _ { 2 } ^ { 2 } = \sum _ { i = 1 } ^ { n } y _ { i } ^ { 2 } \cdot \left( \lambda ^ { 2 t _ { J } } + \sum _ { j = 0 } ^ { J - 1 } ( \lambda _ { i } ^ { t _ { j } } - \lambda _ { i } ^ { t _ { j + 1 } } ) ^ { 2 } \right) .
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
Then, since $0 \leq \lambda _ { i } \leq 1$ and $0 = t _ { 0 } < t _ { 1 } < \cdot \cdot \cdot < t _ { J }$ we have
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\lambda ^ { 2 t , t } + \sum _ { j = 0 } ^ { J - 1 } ( \lambda _ { i } ^ { t _ { j } } - \lambda _ { i } ^ { t _ { j + 1 } } ) ^ { 2 } \leq \left( \lambda ^ { t , t } + \sum _ { j = 0 } ^ { J - 1 } \lambda _ { i } ^ { t _ { j } } - \lambda _ { i } ^ { t _ { j + 1 } } \right) ^ { 2 } = \left( \lambda ^ { t , t } + \lambda _ { i } ^ { t _ { 0 } } - \lambda _ { i } ^ { t _ { j } } \right) ^ { 2 } = 1 ,
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
which yields the upper bound $\begin{array} { r } { \| \boldsymbol { \Lambda } ^ { t _ { J } } \pmb { y } \| _ { 2 } ^ { 2 } + \sum _ { j = 0 } ^ { J - 1 } \| \big ( \boldsymbol { \Lambda } ^ { t _ { j } } - \boldsymbol { \Lambda } ^ { t _ { j + 1 } } \big ) \pmb { y } \| _ { 2 } ^ { 2 } \leq \| \pmb { y } \| _ { 2 } ^ { 2 } } \end{array}$ . On the other hand, since $t _ { 1 } > 0 = t _ { 0 }$ , then we also have
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\lambda ^ { 2 t _ { J } } + \sum _ { j = 0 } ^ { J - 1 } ( \lambda _ { i } ^ { t _ { j } } - \lambda _ { i } ^ { t _ { j + 1 } } ) ^ { 2 } \geq \lambda ^ { 2 t _ { J } } + ( 1 - \lambda _ { i } ^ { t _ { 1 } } ) ^ { 2 }
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
and therefore, by setting $C : = \mathrm { m i n } _ { 0 \le \xi \le 1 } ( \xi ^ { 2 t _ { J } } + ( 1 - \xi ^ { t _ { 1 } } ) ^ { 2 } ) > 0$ , whose positivity is not difficult to verify, we get the lower bound $\begin{array} { r } { \| \boldsymbol { \Lambda } ^ { t _ { J } } \pmb { y } \| _ { 2 } ^ { 2 } + \sum _ { j = 0 } ^ { J - 1 } \| \big ( \boldsymbol { \Lambda } ^ { t _ { j } } - \boldsymbol { \Lambda } ^ { t _ { j + 1 } } \big ) \pmb { y } \| _ { 2 } ^ { 2 } \geq C \| \pmb { y } \| _ { 2 } ^ { 2 } } \end{array}$ . Finally, applying the reverse change of variable to $_ { \textbf { \em x } }$ and $L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ yields the result of the theorem. □
|
| 333 |
+
|
| 334 |
+
# A.3 PROOF OF THEOREM 2
|
| 335 |
+
|
| 336 |
+
Denote the permutation group on $n$ elements as $S _ { n }$ , then for a permutation $\Pi \in S _ { n }$ we let ${ \overline { { \mathcal { G } } } } = \Pi ( { \mathcal { G } } )$ be the graph obtained by permuting the vertices of $\mathcal { G }$ with $\Pi$ . The corresponding permutation operation on a graph signal $\pmb { x } \in L ^ { 2 } ( \mathcal { G } , D ^ { - 1 / 2 } )$ gives a signal $\Pi { \pmb x } \in L ^ { 2 } ( \overline { { \mathcal { G } } } , \bar { D ^ { - 1 / 2 } } )$ , which we implicitly considered in the statement of the theorem, without specifying these notations for simplicity. Rewriting the statement of the theorem more rigorously with the introduced notations, we aim to show that $\overline { { U } } _ { p } ^ { \prime } \Pi \pmb { x } = \Pi U _ { p } ^ { \prime } \pmb { x }$ and $\overline { { S } } _ { p , q } ^ { \prime } \Pi \pmb { x } = S _ { p , q } ^ { \prime } \pmb { x }$ under suitable conditions, where the operation $U _ { p } ^ { \prime }$ from $\mathcal { G }$ on the permuted graph $\overline { { \mathcal { G } } }$ is denoted here by $\overline { { U } } _ { p } ^ { \prime }$ and likewise for $S _ { p , q } ^ { \prime }$ we have $\overline { { S } } _ { p , q } ^ { \prime }$ .
|
| 337 |
+
|
| 338 |
+
We start by showing $U _ { p } ^ { \prime }$ is permutation equivariant. First, we notice that for any $\Psi _ { j }$ , $0 < j < J$ we have that $\overline { { \Psi } } _ { j } \Pi \pmb { x } = \Pi \bar { \Psi _ { j } } \pmb { x }$ , as for $1 \leq j \leq J - 1$
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\begin{array} { r l } & { \overline { { \Psi } } _ { j } \Pi \pmb { x } = ( \Pi P ^ { t _ { j } } \Pi ^ { T } - \Pi P ^ { t _ { j + 1 } } \Pi ^ { T } ) \Pi \pmb { x } } \\ & { \qquad = \Pi ( \pmb { P } ^ { t _ { j } } - \pmb { P } ^ { t _ { j + 1 } } ) \pmb { x } } \\ & { \qquad = \Pi \Psi _ { j } \pmb { x } . } \end{array}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Similar reasoning also holds for $j \in \{ 0 , J \}$ . Further, notice that for the element-wise nature of the absolute value nonlinearity yields $| \Pi { \pmb x } | = \Pi | { \pmb x } |$ for any permutation matrix $\Pi$ . Using these two observations, it follows inductively that
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\begin{array} { r l } & { \overline { { U } } _ { p } ^ { \prime } \Pi x : = \Psi _ { j _ { m } } ^ { \prime } | \Psi _ { j _ { m - 1 } } ^ { \prime } \cdot . . . | \Psi _ { j _ { 2 } } ^ { \prime } | \Psi _ { j _ { 1 } } ^ { \prime } \Pi x | | \cdot . . . | } \\ & { \qquad = \Psi _ { j _ { m } } ^ { \prime } | \Psi _ { j _ { m - 1 } } ^ { \prime } \cdot . . . | \Psi _ { j _ { 2 } } ^ { \prime } \Pi | \Psi _ { j _ { 1 } } ^ { \prime } x | | \cdot . . . | } \\ & { \qquad \vdots } \\ & { \qquad = \Pi \Psi _ { j _ { m } } ^ { \prime } | \Psi _ { j _ { m - 1 } } ^ { \prime } \cdot . . . | \Psi _ { j _ { 2 } } ^ { \prime } | \Psi _ { j _ { 1 } } ^ { \prime } x | | \cdot . . . | } \\ & { \qquad = \Pi U _ { p } ^ { \prime } x . } \end{array}
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
To show $S _ { p , q } ^ { \prime }$ is permutation invariant, first notice that for any statistical moment $q > 0$ , we have $| \Pi { \pmb x } | ^ { q } = \Pi | { \pmb x } | ^ { q }$ and further as sums are commutative, $\begin{array} { r } { \sum _ { j } ( \Pi \pmb { x } ) _ { j } = \sum _ { j } \pmb { x } _ { j } } \end{array}$ . We then have
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\overline { { S } } _ { p , q } ^ { ' } \Pi \boldsymbol { x } = \sum _ { i = 1 } ^ { n } | \overline { { U } } _ { p } ^ { ' } \Pi \boldsymbol { x } [ v _ { i } ] | ^ { q } = \sum _ { i = 1 } ^ { n } | \Pi U _ { p } ^ { \prime } \boldsymbol { x } [ v _ { i } ] | ^ { q } = \sum _ { i = 1 } ^ { n } | U _ { p } ^ { \prime } \boldsymbol { x } [ v _ { i } ] | ^ { q } = S _ { p , q } ^ { ' } \boldsymbol { x } ,
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
which, together with the previous result, completes the proof of the theorem.
|
| 357 |
+
|
| 358 |
+
# B DATASETS
|
| 359 |
+
|
| 360 |
+
In this section we further analyze individual datasets. Relating composition of the dataset as shown in Table S1 to the relative performance of our models as shown in Table S2.
|
| 361 |
+
|
| 362 |
+
DD Dobson & Doig (2003): Is a dataset extracted from the protein data bank (PDB) of 1178 high resolution proteins. The task is to distinguish between enzymes and non-enzymes. Since these are high resolution structures, these graphs are significantly larger than those found in our other biochemical datasets with a mean graph size of 284 nodes with the next largest biochemical dataset with a mean size of 39 nodes.
|
| 363 |
+
|
| 364 |
+
ENZYMES Borgwardt et al. (2005): Is a dataset of 600 enzymes divided into 6 balanced classes of 100 enzymes each. As we analyzed in the main text, scattering features are better able to preserve the structure between classes. LEGS-FCN slightly relaxes this structure but improves accuracy from 32 to $39 \%$ over LEGS-FIXED.
|
| 365 |
+
|
| 366 |
+
NCI1, NCI109 Wale et al. (2008): Contains slight variants of 4100 chemical compounds encoded as graphs. Each compound is separated into one of two classes based on its activity against nonsmall cell lung cancer and ovarian cancer cell lines. Graphs in this dataset are 30 nodes with a similar number of edges. This makes for long graphs with high diameter.
|
| 367 |
+
|
| 368 |
+
PROTEINS Borgwardt et al. (2005): Contains 1178 protein structures with the goal of classifying enzymes vs. non enzymes. GCN outperforms all other models on this dataset, however the Baseline model, where no structure is used also performs very similarly. This suggests that the graph structure within this dataset does not add much information over the structure encoded in the eccentricity and clustering coefficient.
|
| 369 |
+
|
| 370 |
+
PTC Toivonen et al. (2003): Contains 344 chemical compound graphs divided into two classes based on whether or not they cause cancer in rats. This dataset is very difficult to classify without features however LEGS-RBF and LEGS-FCN are able to capture the long range connections slightly better than other methods.
|
| 371 |
+
|
| 372 |
+
COLLAB Yanardag & Vishwanathan (2015): 5000 ego-networks of different researchers from high energy physics, condensed matter physics or astrophysics. The goal is to determine which field the research belongs to. The GraphSAGE model performs best on this dataset although the LEGS-RBF network performs nearly as well. Ego graphs have a very small average diameter. Thus shallow networks can perform quite well on them as is the case here.
|
| 373 |
+
|
| 374 |
+
IMDB Yanardag & Vishwanathan (2015): For each graph nodes represent actresses/actors and there is an edge between them if they are in the same move. These graphs are also ego graphs around specific actors. IMDB-BINARY classifies between action and romance genres. IMDB-MULTI classifies between 3 classes. Somewhat surprisingly GS-SVM performs the best with other LEGS networks close behind. This could be due to oversmoothing on the part of GCN and GraphSAGE when the graphs are so small.
|
| 375 |
+
|
| 376 |
+
REDDIT Yanardag & Vishwanathan (2015): Graphs in REDDIT-BINARY/MULTI-5K/MULTI12K datasets each graph represents a discussion thread where nodes correspond to users and there is an edge between two nodes if one replied to the other’s comment. The task is to identify which subreddit a given graph came from. On these datasets GCN outperforms other models.
|
| 377 |
+
|
| 378 |
+
QM9 Gilmer et al. (2017); Wu et al. (2018): Graphs in the QM9 dataset each represent chemicals with 18 atoms. Regression targets represent chemical properties of the molecules.
|
| 379 |
+
|
| 380 |
+
# B.1 PERFORMANCE OF LEGSNET ON SOCIAL NETWORK DATASETS
|
| 381 |
+
|
| 382 |
+
Table S2 shows that our model outperforms other GNNs on some biomedical benchmarks and that it performs comparably on social network datasets. Out of the six social network datasets, ignoring the fixed scattering model GS-SVM, which has been hand tuned with these datasets in mind, our model outperforms both GNN models on three of them, and is second best on the other three. This is at least comparable if not slightly superior performance. GraphSAGE does a bit better on Collab, but much worse on IMDB-Binary and Reddit-Binary. GCN does a bit better on Reddit-Multi, but worse on Collab, IMDB-Binary, and Reddit-Binary.
|
| 383 |
+
|
| 384 |
+
LEGSNet has significantly fewer parameters and achieves comparable or superior accuracy on common benchmarks. Even when our method shows comparable results, and definitely when it outperforms other GNNs, we believe that its smaller number of parameters could be useful in applications with limited compute or limited training examples.
|
| 385 |
+
|
| 386 |
+
Table S1: Dataset statistics, diameter, nodes, edges, clustering coefficient averaged over all graphs. Split into bio-chemical and social network types.
|
| 387 |
+
|
| 388 |
+
<table><tr><td></td><td># Graphs</td><td># Classes</td><td>Diameter</td><td>Nodes</td><td>Edges</td><td>Clust. Coeff</td></tr><tr><td>DD</td><td>1178</td><td>2</td><td>19.81</td><td>284.32</td><td>715.66</td><td>0.48</td></tr><tr><td>ENZYMES</td><td>600</td><td>6</td><td>10.92</td><td>32.63</td><td>62.14</td><td>0.45</td></tr><tr><td>MUTAG</td><td>188</td><td>2</td><td>8.22</td><td>17.93</td><td>19.79</td><td>0.00</td></tr><tr><td>NCI1</td><td>4110</td><td>2</td><td>13.33</td><td>29.87</td><td>32.30</td><td>0.00</td></tr><tr><td>NCI109</td><td>4127</td><td>2</td><td>13.14</td><td>29.68</td><td>32.13</td><td>0.00</td></tr><tr><td>PROTEINS</td><td>1113</td><td>2</td><td>11.62</td><td>39.06</td><td>72.82</td><td>0.51</td></tr><tr><td>PTC</td><td>344</td><td>2</td><td>7.52</td><td>14.29</td><td>14.69</td><td>0.01</td></tr><tr><td>COLLAB</td><td>5000</td><td>3</td><td>1.86</td><td>74.49</td><td>2457.22</td><td>0.89</td></tr><tr><td>IMDB-BINARY</td><td>1000</td><td>2</td><td>1.86</td><td>19.77</td><td>96.53</td><td>0.95</td></tr><tr><td>IMDB-MULTI</td><td>1500</td><td>3</td><td>1.47</td><td>13.00</td><td>65.94</td><td>0.97</td></tr><tr><td>REDDIT-BINARY</td><td>2000</td><td>2</td><td>8.59</td><td>429.63</td><td>497.75</td><td>0.05</td></tr><tr><td>REDDIT-MULTI-12K</td><td>11929</td><td>11</td><td>9.53</td><td>391.41</td><td>456.89</td><td>0.03</td></tr><tr><td>REDDIT-MULTI-5K</td><td>4999</td><td>5</td><td>10.57</td><td>508.52</td><td>594.87</td><td>0.03</td></tr></table>
|
| 389 |
+
|
| 390 |
+
Table S2: Mean $\pm$ std. over 10 test sets on bio-chemical and social datasets.
|
| 391 |
+
|
| 392 |
+
<table><tr><td></td><td>LEGS-RBF</td><td>LEGS-FCN</td><td>LEGS-FIXED</td><td>GCN</td><td>GraphSAGE</td><td>GAT</td><td>GIN</td><td>GS-SVM</td><td>Baseline</td></tr><tr><td>DD</td><td>72.58 ± 3.35</td><td>72.07 ± 2.37</td><td>69.09 ± 4.82</td><td>67.82 ± 3.81</td><td>66.37 ± 4.45</td><td>68.50± 3.62</td><td>42.37 ± 4.32</td><td>72.66 ± 4.94</td><td>75.98 ± 2.81</td></tr><tr><td>ENZYMES</td><td>36.33 ± 4.50</td><td>38.50 ± 8.18</td><td>32.33 ± 5.04</td><td>31.33 ± 6.89</td><td>15.83 ± 9.10</td><td>25.83 ± 4.73</td><td>36.83 ± 4.81</td><td>27.33 ± 5.10</td><td>20.50 ± 5.99</td></tr><tr><td>MUTAG</td><td>33.51 ± 4.34</td><td>82.98 ± 9.85</td><td>81.84 ± 11.24</td><td>79.30 ± 9.66</td><td>81.43 ± 11.64</td><td>79.85 ± 9.44</td><td>83.57 ± 9.68</td><td>85.09 ± 7.44</td><td>79.80 ± 9.92</td></tr><tr><td>NCI1</td><td>74.26± 1.53</td><td>70.83 ± 2.65</td><td>71.24 ± 1.63</td><td>60.80 ± 4.26</td><td>57.54 ± 3.33</td><td>62.19 ± 2.18</td><td>66.67 ± 2.90</td><td>69.68 ± 2.38</td><td>56.69 ± 3.07</td></tr><tr><td>NCI109</td><td>72.47 ± 2.11</td><td>70.17 ± 1.46</td><td>69.25 ± 1.75</td><td>61.30 ± 2.99</td><td>55.15 ± 2.58</td><td>61.28 ± 2.24</td><td>65.23 ± 1.82</td><td>68.55 ± 2.06</td><td>57.38 ± 2.20</td></tr><tr><td>PROTEINS</td><td>70.89 ± 3.91</td><td>71.06 ± 3.17</td><td>67.30 ± 2.94</td><td>74.03 ± 3.20</td><td>71.87 ± 3.50</td><td>73.22 ± 3.55</td><td>75.02 ± 4.55</td><td>70.98 ± 2.67</td><td>73.22 ± 3.76</td></tr><tr><td>PTC</td><td>57.26± 5.54</td><td>56.92 ± 9.36</td><td>54.31 ± 6.92</td><td>56.34 ± 10.29</td><td>55.22 ± 9.13</td><td>55.50 ± 6.90</td><td>55.82 ± 8.07</td><td>56.96 ± 7.09</td><td>56.71 ± 5.54</td></tr><tr><td>COLLAB</td><td>75.78 ± 1.95</td><td>75.40 ± 1.80</td><td>72.94 ± 1.70</td><td>73.80 ±1.73</td><td>76.12 ± 1.58</td><td>72.88 ± 2.06</td><td>62.98 ± 3.92</td><td>74.54 ± 2.32</td><td>64.76 ± 2.63</td></tr><tr><td>IMDB-BINARY</td><td>64.90 ± 3.48</td><td>64.50± 3.50</td><td>64.30 ± 3.68</td><td>47.40 ± 6.24</td><td>46.40 ± 4.03</td><td>45.50 ± 3.14</td><td>64.20 ± 5.77</td><td>66.70 ± 3.53</td><td>47.20 ± 5.67</td></tr><tr><td>IMDB-MULTI</td><td>41.93 ± 3.01</td><td>40.13 ± 2.77</td><td>41.67 ± 3.19</td><td>39.33 ± 3.13</td><td>39.73 ± 3.45</td><td>39.73 ± 3.61</td><td>38.67± 3.93</td><td>42.13 ± 2.53</td><td>39.53 ± 3.63</td></tr><tr><td>REDDIT-BINARY</td><td>86.10 ± 2.92</td><td>78.15 ± 5.42</td><td>85.00 ± 1.93</td><td>81.60 ± 2.32</td><td>73.40 ± 4.38</td><td>73.35 ± 2.27</td><td>71.40 ± 6.98</td><td>85.15 ± 2.78</td><td>69.30 ± 5.08</td></tr><tr><td>REDDIT-MULTI-12K</td><td>38.47 ± 1.07</td><td>38.46 ± 1.31</td><td>39.74 ± 1.31</td><td>42.57 ± 0.90</td><td>32.17 ± 2.04</td><td>32.74 ± 0.75</td><td>24.45 ± 5.52</td><td>39.79 ± 1.11</td><td>22.07 ± 0.98</td></tr><tr><td>REDDIT-MULTI-5K</td><td>47.83 ± 2.61</td><td>46.97 ± 3.06</td><td>47.17 ± 2.93</td><td>52.79 ± 2.11</td><td>45.71 ± 2.88</td><td>44.03 ± 2.57</td><td>35.73 ± 8.35</td><td>48.79 ± 2.95</td><td>36.41 ± 1.80</td></tr></table>
|
| 393 |
+
|
| 394 |
+
# C TRAINING DETAILS
|
| 395 |
+
|
| 396 |
+
We train all models for a maximum of 1000 epochs with an initial learning rate of $1 e ^ { - 4 }$ using the ADAM optimizer (Kingma & Ba, 2015). We terminate training if validation loss does not improve for 100 epochs testing every 10 epochs. Our models are implemented with Pytorch Paszke et al. (2019) and Pytorch geometric. Models were run on a variety of hardware resources. For all models we use $q \ : = \ : 4$ normalized statistical moments for the node to graph level feature extraction and $m = 1 6$ diffusion scales in line with choices in Gao et al. (2019).
|
| 397 |
+
|
| 398 |
+
# C.1 CROSS VALIDATION PROCEDURE
|
| 399 |
+
|
| 400 |
+
For all datasets we use 10-fold cross validation with $80 \%$ training data $10 \%$ validation data and $10 \%$ test data for each model. We first split the data into 10 (roughly) equal partitions. For each model we take exactly one of the partitions to be the test set and one of the remaining nine to be the validation set. We then train the model on the remaining eight partitions using the cross-entropy loss on the validation for early stopping checking every ten epochs. For each test set, we use majority voting of the nine models trained with that test set. We then take the mean and standard deviation across these test set scores to average out any variability in the particular split chosen. This results in 900 models trained on every dataset. With mean and standard deviation over 10 ensembled models each with a separate test set.
|
| 401 |
+
|
| 402 |
+
# D ENSEMBLING EVALUATION
|
| 403 |
+
|
| 404 |
+
Recent work by Min et al. (2020) combines the features from a fixed scattering transform with a GCN network, showing that this has empirical advantages in semi-supervised node classification, and theoretical representation advantages over a standard Kipf & Welling (2016) style GCN. We ensemble the learned features from a learnable scattering network (LEGS-FCN) with those of GCN and compare this to ensembling fixed scattering features with GCN as in Min et al. (2020), as well as the solo features. Our setting is slightly different in that we use the GCN features from pretrained networks, only training a small 2-layer ensembling network on the combined graph level features. This network consists of a batch norm layer, a 128 width fully connected layer, a leakyReLU activation, and a final classification layer down to the number of classes. In Table S6 we see that combining GCN features with fixed scattering features in LEGS-FIXED or learned scattering features in LEGS-FCN always helps classification. Learnable scattering features help more than fixed scattering features overall and particularly in the biochemical domain.
|
| 405 |
+
|
| 406 |
+
Table S3: Mean $\pm$ std. over test set selection on cross-validated LEGS-RBF Net with reduced training set size.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Train, Val, Test %</td><td>80%,10%,10%</td><td>70%, 10%,20%</td><td>40%, 10%,50%</td><td>20%,10%,70%</td></tr><tr><td>COLLAB</td><td>75.78 ± 1.95</td><td>75.00 ± 1.83</td><td>74.00 ± 0.51</td><td>72.73 ± 0.59</td></tr><tr><td>DD</td><td>72.58 ± 3.35</td><td>70.88 ± 2.83</td><td>69.95 ± 1.85</td><td>69.43 ± 1.24</td></tr><tr><td>ENZYMES</td><td>36.33 ± 4.50</td><td>34.17 ± 3.77</td><td>29.83 ± 3.54</td><td>23.98 ± 3.32</td></tr><tr><td>IMDB-BINARY</td><td>64.90 ± 3.48</td><td>63.00 ± 2.03</td><td>63.30 ±1.27</td><td>57.67 ± 6.04</td></tr><tr><td>IMDB-MULTI</td><td>41.93 ± 3.01</td><td>40.80 ± 1.79</td><td>41.80 ± 1.23</td><td>36.83 ± 3.31</td></tr><tr><td>MUTAG</td><td>33.51 ± 4.34</td><td>33.51 ± 1.14</td><td>33.52 ± 1.26</td><td>33.51 ± 0.77</td></tr><tr><td>NCI1</td><td>74.26 ± 1.53</td><td>74.38 ± 1.38</td><td>72.07 ± 0.28</td><td>70.30 ± 0.72</td></tr><tr><td>NCI109</td><td>72.47 ± 2.11</td><td>72.21 ± 0.92</td><td>70.44 ± 0.78</td><td>68.46 ± 0.96</td></tr><tr><td>PROTIENS</td><td>70.89 ± 3.91</td><td>69.27 ± 1.95</td><td>69.72 ± 0.27</td><td>68.96 ± 1.63</td></tr><tr><td>PTC</td><td>57.26 ± 5.54</td><td>57.83 ± 4.39</td><td>54.62 ± 3.21</td><td>55.45 ± 2.35</td></tr><tr><td>REDDIT-BINARY</td><td>86.10 ± 2.92</td><td>86.05 ± 2.51</td><td>85.15 ± 1.77</td><td>83.71 ± 0.97</td></tr><tr><td>REDDIT-MULTI-12K</td><td>38.47 ± 1.07</td><td>38.60 ± 0.52</td><td>37.55 ± 0.05</td><td>36.65 ± 0.50</td></tr><tr><td>REDDIT-MULTI-5K</td><td>47.83 ± 2.61</td><td>47.81 ± 1.32</td><td>46.73 ± 1.46</td><td>44.59 ± 1.02</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table S4: Test set mean squared error on CASP GDT regression task across targets over 3 nonoverlapping test sets.
|
| 411 |
+
|
| 412 |
+
<table><tr><td></td><td>LEGS-RBF</td><td>LEGS-FCN</td><td>LEGS-FIXED</td><td>GCN</td><td>GraphSAGE</td><td>GIN</td><td>Baseline</td></tr><tr><td>t0860</td><td>197.68 ± 34.29</td><td>164.22 ±10.28</td><td>206.20 ± 28.46</td><td>314.90 ± 29.66</td><td>230.45 ± 79.72</td><td>262.35 ± 66.88</td><td>414.41 ± 26.96</td></tr><tr><td>t0868</td><td>131.42 ± 8.12</td><td>127.71 ± 14.26</td><td>178.45 ± 5.64</td><td>272.14± 26.34</td><td>191.08 ± 21.96</td><td>170.05 ± 27.26</td><td>411.98 ± 57.39</td></tr><tr><td>t0869</td><td>106.69 ± 9.97</td><td>132.12 ± 31.37</td><td>104.47 ±14.16</td><td>317.22 ± 12.75</td><td>244.38 ± 40.58</td><td>217.02 ± 57.01</td><td>393.12 ± 48.70</td></tr><tr><td>t0872</td><td>144.11 ± 24.88</td><td>148.20 ± 23.63</td><td>134.48 ± 8.25</td><td>293.96 ± 19.00</td><td>221.13 ± 28.74</td><td>240.89 ± 24.17</td><td>374.48 ± 33.70</td></tr><tr><td>t0879</td><td>89.00± 44.94</td><td>80.14 ± 16.21</td><td>64.63±15.92</td><td>309.23 ± 69.40</td><td>172.41 ± 73.07</td><td>147.77 ± 15.72</td><td>364.79±144.32</td></tr><tr><td>t0900</td><td>193.74± 10.78</td><td>171.05 ± 25.41</td><td>158.56 ± 9.87</td><td>254.11 ± 18.63</td><td>209.07 ±11.90</td><td>265.77 ± 79.99</td><td>399.16 ± 83.48</td></tr><tr><td>t0912</td><td>113.00 ± 22.31</td><td>169.55 ± 27.35</td><td>150.70 ± 8.53</td><td>227.17 ± 22.11</td><td>192.28 ± 39.45</td><td>271.30 ± 28.89</td><td>406.25 ± 31.42</td></tr><tr><td>t0920</td><td>80.46 ± 14.98</td><td>136.94 ± 36.43</td><td>84.83 ± 19.70</td><td>361.19 ± 71.25</td><td>261.72 ± 59.67</td><td>191.86 ± 37.85</td><td>398.22 ± 25.60</td></tr><tr><td>t0921</td><td>187.89 ± 46.15</td><td>165.97 ± 42.39</td><td>142.97 ± 27.09</td><td>382.69 ± 20.27</td><td>260.49 ±16.09</td><td>207.19 ± 24.84</td><td>363.92 ± 35.79</td></tr><tr><td>t0922</td><td>254.83 ± 91.28</td><td>110.54 ± 43.99</td><td>227.73 ± 26.41</td><td>366.72 ± 8.10</td><td>290.71 ± 7.22</td><td>130.46 ± 11.64</td><td>419.14 ± 45.49</td></tr><tr><td>t0942</td><td>188.55 ± 11.10</td><td>167.53 ± 22.01</td><td>137.21 ± 7.43</td><td>371.31 ± 9.90</td><td>233.78± 84.95</td><td>254.38 ± 47.21</td><td>393.03± 24.93</td></tr><tr><td>t0944</td><td>146.59 ± 8.41</td><td>138.67 ± 50.36</td><td>245.79 ± 58.16</td><td>263.03 ±9.43</td><td>199.40 ± 51.11</td><td>157.90 ± 2.57</td><td>404.12 ± 40.82</td></tr></table>
|
| 413 |
+
|
| 414 |
+
Table S5: Quantified distance between the empirically observed enzyme class exchange preferences of Cuesta et al. (2015) and the class exchange preferences inferred from LEGS-FIXED, LEGS-FCN, and a GCN. We measure the cosine distance between the graphs represented by the chord diagrams in Figure 2. As before, the self-affinities were discarded. LEGS-Fixed reproduces the exchange preferences the best, but LEGS-FCN still reproduces well and has significantly better classification accuracy.
|
| 415 |
+
|
| 416 |
+
<table><tr><td>LEGS-FIXED</td><td>LEGS-FCN</td><td>GCN</td></tr><tr><td>0.132</td><td>0.146</td><td>0.155</td></tr></table>
|
| 417 |
+
|
| 418 |
+
Table S6: Mean $\pm$ standard deviation test set accuracy on biochemical and social network datasets.
|
| 419 |
+
|
| 420 |
+
<table><tr><td></td><td>GCN</td><td>GCN-LEGS-FIXED</td><td>GCN-LEGS-FCN</td></tr><tr><td>DD</td><td>67.82 ± 3.81</td><td>74.02 ± 2.79</td><td>73.34 ± 3.57</td></tr><tr><td>ENZYMES</td><td>31.33 ± 6.89</td><td>31.83 ± 6.78</td><td>35.83 ± 5.57</td></tr><tr><td>MUTAG</td><td>79.30 ± 9.66</td><td>82.46 ± 7.88</td><td>83.54 ± 9.39</td></tr><tr><td>NCI1</td><td>60.80 ± 4.26</td><td>70.80 ± 2.27</td><td>72.21 ± 2.32</td></tr><tr><td>NCI109</td><td>61.30 ± 2.99</td><td>68.82 ± 1.80</td><td>69.52 ± 1.99</td></tr><tr><td>PROTEINS</td><td>74.03 ± 3.20</td><td>73.94 ± 3.88</td><td>74.30 ± 3.41</td></tr><tr><td>PTC</td><td>56.34 ± 10.29</td><td>58.11 ± 6.06</td><td>56.64 ± 7.34</td></tr><tr><td>COLLAB</td><td>73.80 ± 1.73</td><td>76.60 ± 1.75</td><td>75.76 ± 1.83</td></tr><tr><td>IMDB-BINARY</td><td>47.40 ± 6.24</td><td>65.10 ± 3.75</td><td>65.90 ± 4.33</td></tr><tr><td>IMDB-MULTI</td><td>39.33 ± 3.13</td><td>39.93 ± 2.69</td><td>39.87 ± 2.24</td></tr><tr><td>REDDIT-BINARY</td><td>81.60 ± 2.32</td><td>86.90 ± 1.90</td><td>87.00 ± 2.36</td></tr><tr><td>REDDIT-MULTI-12K</td><td>42.57 ± 0.90</td><td>45.41 ± 1.24</td><td>45.55 ± 1.00</td></tr><tr><td>REDDIT-MULTI-5K</td><td>52.79 ± 2.11</td><td>53.87 ± 2.75</td><td>53.41 ± 3.07</td></tr></table>
|
| 421 |
+
|
| 422 |
+
Table S7: Mean $\pm$ std. over four runs of mean squared error over 19 targets for the QM9 dataset, lower is better.
|
| 423 |
+
|
| 424 |
+
<table><tr><td></td><td>LEGS-FCN</td><td>LEGS-FIXED</td><td>GCN</td><td>GraphSAGE</td><td>GIN</td><td>Baseline</td></tr><tr><td>Target 0</td><td>0.749 ± 0.025</td><td>0.761 ± 0.026</td><td>0.776 ± 0.021</td><td>0.876 ± 0.083</td><td>0.786 ± 0.032</td><td>0.985 ± 0.020</td></tr><tr><td>Target 1</td><td>0.158 ± 0.014</td><td>0.164 ± 0.024</td><td>0.448 ± 0.007</td><td>0.555 ± 0.295</td><td>0.191 ± 0.060</td><td>0.593 ± 0.013</td></tr><tr><td>Target 2</td><td>0.830 ± 0.016</td><td>0.856 ± 0.026</td><td>0.899 ± 0.051</td><td>0.961 ± 0.057</td><td>0.903 ±0.033</td><td>0.982 ± 0.027</td></tr><tr><td>Target 3</td><td>0.511 ± 0.012</td><td>0.508 ± 0.005</td><td>0.549 ± 0.010</td><td>0.688 ± 0.216</td><td>0.555 ± 0.006</td><td>0.805 ± 0.025</td></tr><tr><td>Target 4</td><td>0.587 ± 0.007</td><td>0.587 ± 0.006</td><td>0.609 ± 0.009</td><td>0.755 ± 0.177</td><td>0.613 ± 0.013</td><td>0.792 ± 0.010</td></tr><tr><td>Target 5</td><td>0.646 ± 0.013</td><td>0.674 ± 0.047</td><td>0.889 ± 0.014</td><td>0.882 ± 0.118</td><td>0.699 ± 0.033</td><td>0.833 ± 0.026</td></tr><tr><td>Target 6</td><td>0.018 ±0.012</td><td>0.020 ± 0.011</td><td>0.099 ± 0.011</td><td>0.321 ± 0.454</td><td>0.012 ± 0.006</td><td>0.468 ± 0.005</td></tr><tr><td>Target7</td><td>0.017 ± 0.005</td><td>0.024 ± 0.008</td><td>0.368 ± 0.015</td><td>0.532 ± 0.405</td><td>0.015 ± 0.005</td><td>0.379 ± 0.013</td></tr><tr><td>Target 8</td><td>0.017 ± 0.005</td><td>0.024 ± 0.008</td><td>0.368 ± 0.015</td><td>0.532 ± 0.404</td><td>0.015 ± 0.005</td><td>0.378 ± 0.013</td></tr><tr><td>Target 9</td><td>0.017 ± 0.005</td><td>0.024 ± 0.008</td><td>0.368 ± 0.015</td><td>0.532 ± 0.404</td><td>0.015 ± 0.005</td><td>0.378 ± 0.013</td></tr><tr><td>Target 10</td><td>0.017 ± 0.005</td><td>0.024 ± 0.008</td><td>0.368 ± 0.015</td><td>0.533 ± 0.404</td><td>0.015 ± 0.005</td><td>0.380 ± 0.014</td></tr><tr><td>Target 11</td><td>0.254 ± 0.013</td><td>0.279 ± 0.023</td><td>0.548 ± 0.023</td><td>0.617 ± 0.282</td><td>0.294 ± 0.003</td><td>0.631± 0.013</td></tr><tr><td>Target 12</td><td>0.034 ± 0.014</td><td>0.033 ± 0.010</td><td>0.215 ± 0.009</td><td>0.356 ± 0.437</td><td>0.020 ± 0.002</td><td>0.478 ± 0.014</td></tr><tr><td>Target 13</td><td>0.033 ± 0.014</td><td>0.033 ± 0.010</td><td>0.214 ± 0.009</td><td>0.356 ± 0.438</td><td>0.020 ±0.002</td><td>0.478 ± 0.014</td></tr><tr><td>Target 14</td><td>0.033 ± 0.014</td><td>0.033 ± 0.010</td><td>0.213 ± 0.009</td><td>0.355 ± 0.438</td><td>0.020 ±0.002</td><td>0.478 ± 0.014</td></tr><tr><td>Target 15</td><td>0.036 ± 0.014</td><td>0.036 ± 0.011</td><td>0.219 ± 0.009</td><td>0.359 ± 0.436</td><td>0.023 ± 0.002</td><td>0.479 ± 0.014</td></tr><tr><td>Target 16</td><td>0.002 ± 0.002</td><td>0.001 ± 0.001</td><td>0.017 ± 0.034</td><td>0.012 ± 0.022</td><td>0.000 ± 0.000</td><td>0.033 ± 0.013</td></tr><tr><td>Target 17</td><td>0.083 ± 0.047</td><td>0.079 ± 0.033</td><td>0.280 ± 0.354</td><td>0.264 ± 0.347</td><td>0.169 ± 0.206</td><td>0.205 ± 0.220</td></tr><tr><td>Target 18</td><td>0.062 ± 0.005</td><td>0.176 ± 0.231</td><td>0.482 ± 0.753</td><td>0.470± 0.740</td><td>0.321 ± 0.507</td><td>0.368 ± 0.525</td></tr></table>
|
md/train/QHUUrieaqai/QHUUrieaqai.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LIME: LEARNING INDUCTIVE BIAS FOR PRIMITIVES OF MATHEMATICAL REASONING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While designing inductive bias in neural architectures has been widely studied, we hypothesize that transformer networks are flexible enough to learn inductive bias from suitable generic tasks. Here, we replace architecture engineering by encoding inductive bias in the form of datasets. Inspired by Peirce’s view that deduction, induction, and abduction form an irreducible set of reasoning primitives, we design three synthetic tasks that are intended to require the model to have these three abilities. We specifically design these synthetic tasks in a way that they are devoid of mathematical knowledge to ensure that only the fundamental reasoning biases can be learned from these tasks. This defines a new pre-training methodology called “LIME” (Learning Inductive bias for Mathematical rEasoning). Models trained with LIME significantly outperform vanilla transformers on three very different large mathematical reasoning benchmarks. Unlike dominating the computation cost as traditional pre-training approaches, LIME requires only a small fraction of the computation cost of the typical downstream task.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Inductive bias is essential for successful neural network learning. Many of the breakthroughs in machine learning are accompanied by new neural architectures with better inductive biases, such as locality bias in convolutional neural networks (LeCun et al., 1999), recurrence and memory in LSTMs (Hochreiter and Schmidhuber, 1997), and structural bias in graph neural networks (Scarselli et al., 2008). However, existing designs of inductive biases need to be explicitly encoded in neural architecture. This is sometimes difficult as one may not know the exact mechanism for an abstract ability, in order to describe the architectural bias explicitly. In particular, designing proper inductive bias for abstract concepts such as mathematical reasoning becomes an extremely challenging task. Moreover, attempts to design elaborate architectures for reasoning often fall short of the performance of more generic transformer architecture. In this work, we aim to avoid the search for new architectures and investigate whether one can learn useful inductive bias for mathematical reasoning through pretraining.
|
| 12 |
+
|
| 13 |
+
Large-scale unsupervised pretraining of language models revolutionized the field of natural language processing (NLP), improving the state-of-the-art in question answering, name entity recognition, text classification, and other domains, e.g. (Radford et al., 2018; Devlin et al., 2019; Yang et al., 2019; Liu et al., 2019; Raffel et al., 2020; Brown et al., 2020). As a result, pretraining has become a common practice for modern neural network based NLP. One plausible explanation for the benefit of pretraining is that the model can learn world knowledge by memorizing the contents of the natural language corpus. This can be useful in various natural language downstream tasks, such as question answering and text classification. However, there is another potential advantage of pre-training—it may distill inductive biases into the model that are helpful for training on downstream tasks (Brown et al., 2020; Warstadt and Bowman, 2020). We focus on the latter and design pre-training tasks that are intentionally devoid of knowledge and only allow the model to learn inductive bias for reasoning.
|
| 14 |
+
|
| 15 |
+
Inspired by the logician Charles Peirce (Peirce, 1992), we believe that the following three primitives are the most crucial for reasoning:
|
| 16 |
+
|
| 17 |
+
1. Deduction: the ability to deduce new truths from given facts and inference rules.
|
| 18 |
+
2. Induction: the ability to induce general inference rules from a set of known facts.
|
| 19 |
+
3. Abduction: the ability to explain the relationship between the evidences and inference rules.
|
| 20 |
+
|
| 21 |
+
To endow the models with an inductive bias for mathematical reasoning, we design a synthetic task for each of the three inductive biases. We hypothesize that the transformer networks are flexible enough to learn strong inductive bias from the three synthetic reasoning tasks and consequently improving the downstream tasks. Although such inductive bias may be useful in general reasoning tasks (e.g., NLP tasks), in this work, we focus on mathematical reasoning benchmarks, for which we expect to observe the largest gains. We call training on these tasks LIME – an acronym for “Learning Inductive Bias for Mathematical rEasoning”. Note that there is only a limited amount of pretraining data available for formal mathematical benchmarks, therefore the study of generic pre-training techniques is particularly important for the success of machine learning in mathematical reasoning.
|
| 22 |
+
|
| 23 |
+
We demonstrate that LIME pretrained models provide significant gains across three large mathematical reasoning benchmarks: IsarStep (Li et al., 2020), HOList Skip-tree (Rabe et al., 2020) and MetaMathStep (Polu and Sutskever, 2020). Notably, on the IsarStep benchmark, pre-training improved the top-1 accuracy from $2 0 . 4 \%$ to $2 6 . 9 \%$ and top-10 accuracy from $3 3 . 1 \%$ to $4 1 . 0 \%$ . Compared to the traditional pre-training tasks, there are two major differences. First, we do not load the input embeddings or the weights in the output layer for finetuning on downstream tasks. This allows us to use the same pre-trained model for a variety of downstream tasks, which can have vastly different vocabularies due to language or tokenization differences. Also, it prevents the transfer of content knowledge from the pretraining to downstream tasks, supporting the evidence of learning inductive biases. Furthermore, pretraining on synthetic tasks require only a fraction of the computational cost of downstream tasks. With only about two hours of training on a single modern GPU, one already obtains all the benefits, in contrast to days of training on a large natural language corpus with hundreds of GPUs/TPUs.
|
| 24 |
+
|
| 25 |
+
Our method can also be regarded as a form of curriculum learning, in which the model is taught basic, extremely generic but general skills before being trained on the specific problem domain.
|
| 26 |
+
|
| 27 |
+
To summarize, the contributions of the paper are:
|
| 28 |
+
|
| 29 |
+
1. Providing the first method to design inductive biases in the form of datasets for mathematical reasoning.
|
| 30 |
+
2. Demonstrating significant improvements in the reasoning performance of transformer models on three large mathematical reasoning benchmarks with negligible extra computation cost.
|
| 31 |
+
3. By showing how pretraining brings benefits other than learning content knowledge, disentangling the study of its working mechanism.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Learning Models Applied to Mathematics There has been increasing interest in applying deep learning methods to Interactive Theorem Provers (ITP) (Bansal et al.; 2019; Gauthier et al., 2020; Huang et al., 2019; Yang and Deng, 2019; Wu et al., 2020; Li et al., 2020; Polu and Sutskever, 2020). The work that is most related to ours is GPT- $f$ (Polu and Sutskever, 2020). The authors performed pretraining on several natural language corpora and showed significant improvements for an ITP system – MetaMath. Different from ours, they used GPT-style large-scale language modeling pretraining, which dominates the computation cost compared to the downstream task. We, on the other hand, propose pretraining on a few lightweight synthetic tasks costing only a minor fraction of the computation spent on the downstream task.
|
| 36 |
+
|
| 37 |
+
Lample and Charton (2020) have demonstrated that transformer models can be used for symbolic mathematics by successfully predicting the integrals of formulas from a randomly generated dataset. Similar observations are made for logical problems relevant to verification: that transformer networks can learn the semantics of logics (Hahn et al., 2020). Rabe et al. (2020) have shown that mathematical reasoning can emerge from self-supervised training alone. Li et al. (2020) show that language models can learn to synthesize missing high-level intermediate propositions given a local context. Piotrowski and Urban (2020) used RNNs in automated theorem provers for first-order logic. Wang et al. (2020) explored the use of machine translation to translate between synthetically generated natural language descriptions of proofs and formally represented proofs. Urban and Jakub˚uv (2020) present initial experiments on generating mathematical conjectures with a Transformer model.
|
| 38 |
+
|
| 39 |
+
Saxton et al. (2019) suggest a dataset for the analysis of mathematical reasoning skills. In contrast to the datasets considered here, their dataset is synthetic, focuses on calculation with concrete numbers, and only contains relatively few symbolic tasks.
|
| 40 |
+
|
| 41 |
+
Language Model Pretraining The advent of the transformer architecture (Vaswani et al., 2017) and the BERT style pretraining (Devlin et al., 2019) represented a huge improvement in the quality of language modeling. Since then, an explosion of research activity in the area pushed the quality of language models through better pretraining tasks. Where BERT (Devlin et al., 2019) masks out a fraction of the input tokens, later works demonstrated the advantages of masking out subsequences (Song et al., 2019; Dong et al., 2019; Joshi et al., 2020; Raffel et al., 2020; Conneau and Lample, 2019) and whole sentences (Zhang et al., 2020).
|
| 42 |
+
|
| 43 |
+
Besides the choice of pretraining tasks, the scale of language models is also an important factor. Language models improve in quality and develop new abilities as they grow larger while trained on the same data (Radford et al., 2018; Raffel et al., 2020; Brown et al., 2020).
|
| 44 |
+
|
| 45 |
+
Inductive Biases in General There have been works studying learning inductive biases in other contexts. In particular, McCoy et al. (2020) studied whether one can learn linguistic inductive biases on synthetic datasets via meta-learning. Papadimitriou and Jurafsky (2020) shows inductive biases learned in music data can be useful for natural language. They further designed several synthetic tasks and showed similar kind of improvements for natural language tasks. From a more theoretical point of view, Xu et al. (2020) formalize an aspect of inductive (architectural) bias under the context of GNNs, with a notation called architectural alignment. The architecture is aligned when the architecture can perfectly simulates the ground truth solution. But their work is limited to showing alignment in combinatorial problems, whose ground truth solutions are known. In contrast, our work tries to learn architectural bias by relying on the flexible Transformer architecture and training on synthetic datasets.
|
| 46 |
+
|
| 47 |
+
Inductive Biases for Mathematics Previous work studying inductive biases for logical reasoning has focused on encoding bias in the neural architecture. Initial works focused on encoding the tree structure of expressions using TreeRNNs (Evans et al., 2018). Graph neural networks are shown to provide a much stronger performance than tree models in premise selection (Wang et al., 2017) and theorem proving (Paliwal et al., 2020). GNNs also scale to larger formulas in SAT (Selsam et al., 2019; Selsam and Bjørner, 2019; Han, 2020), QBF (Lederman et al., 2020), and #SAT (Vaezipoor et al., 2020). Crouse et al. (2019) have shown that pooling mechanisms can have an impact on the performance of GNNs on logical formulas as well. Closely related, Hellendoorn et al. (2020) have shown that it can be helpful to hard-code the tree structure of programs in the attention mask of transformers. Schlag et al. (2019) developed an architecture for encoding relational information using tensor product representation for mathematical reasoning.
|
| 48 |
+
|
| 49 |
+
# 3 METHODS
|
| 50 |
+
|
| 51 |
+
In this section, we first discuss the primitives of reasoning, inspired by Peirce’s views, and design one synthetic task for each reasoning primitive.
|
| 52 |
+
|
| 53 |
+
# 3.1 REASONING PRIMITIVES
|
| 54 |
+
|
| 55 |
+
In Peirce’s view, there are exactly three kinds of reasoning: deduction, abduction, and induction. Deduction is known as the workhorse for mathematics. It is the process of deriving new facts by applying logical inference rules to known facts or premises. On the other hand, abduction and induction can be thought of as the inverses of deduction. If we call the premise used in deduction as Case, its logical rule as Rule, and its conclusion as Result, then abduction is equivalently the inference of a Case from a Rule and a Result, while induction may be said to be the inference of a Rule from a Case and a Result. We summarize the three reasoning primitives in the following table:
|
| 56 |
+
|
| 57 |
+
<table><tr><td rowspan=1 colspan=1>Reasoning Primitives</td><td rowspan=1 colspan=1>Inference Map</td></tr><tr><td rowspan=1 colspan=1>Deduction</td><td rowspan=1 colspan=1>Rule, Case→Result</td></tr><tr><td rowspan=1 colspan=1>Abduction</td><td rowspan=1 colspan=1>Rule,Result→Case</td></tr><tr><td rowspan=1 colspan=1>Induction</td><td rowspan=1 colspan=1>Case,Result→Rule</td></tr></table>
|
| 58 |
+
|
| 59 |
+
To give an example, we let Rule be “All the beans in this bag are white”, Case be “These beans are from this bag”, and Result be “These beans are white”. Deduction is to derive the fact that these beans are white (Re) from knowing all the beans from this bag are white (R) and these beans are from this bag (C). Abduction explains why the beans are white (Re) from knowing that all the beans in the bag are white (R) – because these beans must be from the bag (C). Lastly, induction aims to provide a general principle to observing the fact that the beans are white (Re) and they come from this bag (C), which is that all the beans in the bag must be white (R). We refer to Peirce (1992) and Bellucci and Pietarinen (2015) for more elaborate discussions on the primitives of reasoning.
|
| 60 |
+
|
| 61 |
+
Mathematical reasoning exhibits nontrivial uses of these reasoning primitives. Deduction happens when one needs to derive new valid statements from the given premise (Case) and theorems in the library (Rule). Abduction is used to postulate conjectures from the known facts and theorems, allowing one to decompose the challenging theorem into subgoals for proof. Induction, the ability to extract general principles from known facts and theorems is also one of the major activities of mathematical reasoning. It is used when one derives theorems from special cases and proposes new definitions and general frameworks to encapsulate existing knowledge.
|
| 62 |
+
|
| 63 |
+
# 3.2 LIME SYNTHETIC TASKS FOR REASONING PRIMITIVES
|
| 64 |
+
|
| 65 |
+
We design three synthetic tasks inspired by the three reasoning primitives. As discussed in the previous section, all of the reasoning primitives consist of three essential elements: Rule, Case, and Result. Inspired by this, we first design a method to generate those elements. Once they are generated, we can construct tasks that predict one element from the other two. In the following, we describe one simple way to generate those three elements, though we acknowledge that there are many other possible approaches.
|
| 66 |
+
|
| 67 |
+
We require two types of symbols: 1. math symbols, 2. rule symbols. In general, these symbols can take any forms (e.g., integer representations). But for the ease of discussion, we will think of math symbols as the union of those operators used in mathematics (e.g., $^ { * * } + - * = ( ) \ell \boldsymbol { \mathrm { v } } )$ and lower case letters (e.g., $a , b , c \ldots )$ , and rule symbols as upper case letters (e.g., $A , B , C \dots )$ . We now construct Rule, Case, and Result in order:
|
| 68 |
+
|
| 69 |
+
1. Rule is a randomly sampled string that consists of i) rule symbols and ii) math symbols. The length of the string is randomly sampled from a range. For instance, a randomly sampled rule can be: $A * A + B = C$ with rule symbols $A , B$ , and $C$ .
|
| 70 |
+
2. Case is a dictionary that represents substitutions. For each rule symbol used in the Rule string, we sample a random string of random length that consists of math symbols. This forms a dictionary, whose keys are all rule symbols, and the values are the corresponding sampled string. To illustrate, following the previous example, for each $A$ , $B$ and $C$ , we sample a random string to form a dictionary as: $\left\{ A : a , B : b , { \bar { C } } : d + e \right\}$ .
|
| 71 |
+
3. Result is the outcome of the substitution. For each rule symbol in the Rule string, we replace it with the corresponding value stored in the Case dictionary. This gives rise to the Result string. As per the previous example, we now substitute $A$ with $a$ , $B$ with $b$ , and $C$ with $d + e$ into the Rule string, generating the Result string: $a * a + b = d + e$ .
|
| 72 |
+
|
| 73 |
+
After Rule, Case, and Result are generated, we can construct three tasks for deduction, abduction, and induction respectively. We define the three synthetic tasks as follows:
|
| 74 |
+
|
| 75 |
+
• Deduct: Source: Rule string and Case dictionary. Target: Result string.
|
| 76 |
+
• Abduct: Source: Rule string and Result string. Target: Case dictionary.
|
| 77 |
+
• Induct: Source: Case dictionary and Result string. Target: Rule string.
|
| 78 |
+
|
| 79 |
+
We also consider a task called Mix, which is a uniform mix of three tasks. Namely, during generation, we randomly select a task and sample an example from that task. To formulate them as sequence to sequence tasks, we represent the Case dictionary also as a string, e.g., $\ ^ { * } \{ A : a , B : b , C : d + e \} ^ { , }$ . An example of Abduct using the examples of Rule, Case, and Result above is to predict the target $\{ A : a , { \bar { B } } : b , C : d + e \}$ from the source $A * A + B = C < s > a * a + b = d + e .$ .
|
| 80 |
+
|
| 81 |
+
Pre-training on our synthetic tasks can be seen as a form of skip-component learning. There are three essential components: Rule, Case and Result, and we skip one of them and use the remaining two elements to reconstruct the missing one. Past work has shown that learning to predict missing words (Devlin et al., 2019), subsequences (Song et al., 2019; Raffel et al., 2020), or subtrees (Rabe et al., 2020) are strong pre-training tasks.
|
| 82 |
+
|
| 83 |
+
# 3.3 SYMBOL-AGNOSTIC REPRESENTATION
|
| 84 |
+
|
| 85 |
+
In order to solve the synthetic tasks, the model needs to distinguish which set of symbols can be substituted (rule symbols). As a result, the model may memorize information about the symbols that is irrelevant to the inductive biases encoded in the task. To prevent such memorization, we propose a way to make the synthetic tasks agnostic to the choice of symbols.
|
| 86 |
+
|
| 87 |
+
We first note that the choice of symbols is irrelevant to our synthetic tasks. To avoid symbol-specific memorization, for each training and evaluation example, we randomly sample two sets of symbols to be used in Rules and in the rest of the example. But for the Abduct task, the model needs to know which symbols are replaced by the Rule part of the example and which symbols are in the Result language. We simply list the split of the symbols used in the example at the beginning of the input string, marked by two special symbols, ${ \mathrm { < R u l e > } }$ and <Math>. They are followed by the original source string. The target string remains unchanged. For example, the previous example in the Abduct task becomes,
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
< \mathtt { R u l e } > A \ B \ C < \mathtt { M a t h } > * + = a b d e < \mathtt { s } > A * A + B = C < \mathtt { s } > a * a + b = d + e ^ { - }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Target: $\{ A : a , B : b , C : d + e \}$
|
| 94 |
+
|
| 95 |
+
In our implementation, we use integers to represent symbols. Specifically, for each example, we sample two disjoint sets of integers from the set $\{ 1 , \ldots , S \}$ to represent the math symbols and the rule symbols, where $S$ is the size of the vocabulary. In our experiments, we sample 44 math symbols and 24 rule symbols for each problem. The complete pseudo-code of generating the symbols, Rule, Case, and Result for one task example is provided in Appendix Algorithm 1.
|
| 96 |
+
|
| 97 |
+
# 4 EXPERIMENTS
|
| 98 |
+
|
| 99 |
+
In this section, we present results on three large mathematical reasoning tasks that are especially useful in the context of automated theorem proving. Our results show significant gains in learning inductive biases from synthetic tasks. We have selected three tasks to cover three different styles of interactive theorem provers: The HOL-Light (skip-tree) corpus was created from very high-level tactic-based proofs, but it is less interpretable than IsarStep’s declarative style corpus. We also evaluate the next proof-step prediction task on the set.mm library of MetaMath, which consists of very granular, basic proof steps. Namely, the proof steps are more predicable and average proof lengths have significantly increased.
|
| 100 |
+
|
| 101 |
+
# 4.1 EXPERIMENT DETAILS
|
| 102 |
+
|
| 103 |
+
LIME Pretraining We generate datasets of our synthetic tasks for pretraining: Deduct, Abduct, Induct, Mix. For pretraining of IsarStep, we used a vocabulary size $S$ of 1000. For the other two downstream tasks, we used a vocabulary size of 100. The reason we used different vocabulary sizes was that we found (cf. appendix) the discrepancy in vocabulary size affects the performance of a downstream task if it has a very large vocabulary size (IsarStep has 28K). We use 44 math symbols and 24 rule symbols. The length of the Rule string is sampled from 5 to 20, the length of the string for each substitution (the values of Case dictionary) is sampled from 2 to 8. We used word-level tokenization for all the tasks. We pretrained the model for 20K updates. For tasks with larger vocabulary size (i.e., 1000), we found the learning became more difficult. Hence we used a curriculum learning scheme: we first trained the model for 10K steps on the same task with a vocabulary size of 100, then continue training for another 10K step on vocabulary size of 1000. The pretraining was done on a single Nvidia Tesla T4 GPU with 4 CPU cores for 2 hours. We set the maximum number of tokens in a batch to 4096, and accumulate four batches of gradients for one parameter update. We used the Adam optimizer (Kingma and Ba, 2015) with learning rate $3 \cdot 1 0 ^ { - 4 }$ We used a dropout rate of 0.1 and label smoothing (Szegedy et al., 2016) with a coefficient 0.1.
|
| 104 |
+
|
| 105 |
+
Table 1: Test top-1, top-10 $( \% )$ accuracy on the IsarStep task.
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc.</td></tr><tr><td>No pretrain (Li et al., 2020)</td><td>20.4</td><td>33.1</td></tr><tr><td>HAT (Li et al., 2020)</td><td>22.8</td><td>35.2</td></tr><tr><td>LIME Deduct</td><td>24.7</td><td>37.7</td></tr><tr><td>LIME Abduct</td><td>26.7</td><td>41.0</td></tr><tr><td>LIMEInduct</td><td>23.9</td><td>38.8</td></tr><tr><td>LIME Mix</td><td>26.9</td><td>40.4</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 2: Test top-8 Accuracy on Skip-Tree HOList $( \% )$ .
|
| 110 |
+
|
| 111 |
+
<table><tr><td>Model</td><td>Equation completion</td><td>Hard type inference</td><td>Missing assumptions</td><td>Easy type inference</td></tr><tr><td>No pretrain (Rabe et al., 2020)</td><td>46.3</td><td>95.0</td><td>41.8</td><td>95.9</td></tr><tr><td>LIME Deduct</td><td>50.3</td><td>94.8</td><td>47.9</td><td>97.0</td></tr><tr><td>LIME Abduct</td><td>48.4</td><td>94.8</td><td>46.1</td><td>96.3</td></tr><tr><td>LIME Induct</td><td>44.8</td><td>94.9</td><td>42.6</td><td>96.4</td></tr><tr><td>LIME Mix</td><td>51.7</td><td>95.6</td><td>46.1</td><td>97.6</td></tr></table>
|
| 112 |
+
|
| 113 |
+
Fine-tuning For all the downstream tasks in this section, when loading the pretrained models for fine-tuning, we do not load in the vocabulary embeddings nor the output layer weights. For the downstream task IsarStep and MetaMathStep, we used four Nvidia Tesla T4 GPU with $1 6 \mathrm { \ C P U }$ cores for training. We set the maximum number of tokens in a batch to 4096, and accumulated four batches of gradients for one parameter update. We trained the model for 200K updates. We used the Adam optimizer, and we searched over the learning rates $\{ 3 \cdot 1 0 ^ { - 4 } , 7 \cdot 1 0 ^ { - 4 } \}$ , and warmup steps $\{ 4 0 0 0 , \bar { 8 0 0 0 } \}$ . We used a dropout rate of 0.1 and label smoothing with a coefficient 0.1. For the HOList skip-tree task, we used TPUs for running the experiments. We used a batch size of 256 sequences and trained the model for 1 million updates.
|
| 114 |
+
|
| 115 |
+
Architecture All experiments used the transformer base model from Vaswani et al. (2017), i.e. 512 hidden size, 2048 filter size, 8 attention heads. For the IsarStep and MetaMathStep task, we used 6 layers for both the encoder and decoder, implemented using fairseq (Ott et al., 2019). For the HOList skip-tree experiment, we used a somewhat modified transformer architecture with 8 encoder and 4 decoder layers of the same size as above in which the self-attention and attention over the encoder output were merged.
|
| 116 |
+
|
| 117 |
+
Evaluation During training, we kept track of the best validation tokenized BLEU score 1, and we used the model with validation BLEU for evaluation on the test set. We report top-1 and top-10 accuracies. We consider an output sequence as correct if it matches the target sequence exactly. We performed a beam search with width 10. The top-1 accuracy is then defined as the percentage of the best output sequences that are correct. The top- $\mathbf { \nabla } \cdot n$ accuracy is defined as the percentage of target sequences appearing in the top $n$ generated sequences.
|
| 118 |
+
|
| 119 |
+
# 4.2 ISARSTEP
|
| 120 |
+
|
| 121 |
+
The IsarStep task is taken from Li et al. (2020). IsarStep is a task of predicting the missing intermediate propositions given surrounding propositions to bridge the gap between the goal and the current state of the proof. The dataset was mined from the public repository of formal proofs of the Isabelle proof assistant (Paulson, 1994). Unlike HOList and MetaMath, IsarStep contains mostly declarative proofs, a proof style close to humans’ prose proofs. The dataset has a broad coverage of undergraduate and research-level mathematics and computer science theorems. There are 820K, 5000, 5000 sequence pairs for the training, validation, and test sets with a maximum of 800 tokens in source sequences and 200 tokens in the target sequences. Following Li et al. (2020), during training, we use 512 as the
|
| 122 |
+
|
| 123 |
+
Table 3: Test top-1, top-10 $( \% )$ accuracy on the MetaMathStep task.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc.</td></tr><tr><td>No pretrain</td><td>67.7</td><td>76.5</td></tr><tr><td>LIME Deduct</td><td>68.8</td><td>77.4</td></tr><tr><td>LIME Abduct</td><td>68.8</td><td>76.1</td></tr><tr><td>LIME Induct</td><td>69.9</td><td>78.0</td></tr><tr><td>LIME Mix</td><td>69.1</td><td>77.9</td></tr></table>
|
| 126 |
+
|
| 127 |
+
maximum length for both the source and target, and truncated those that exceed the length to 512.
|
| 128 |
+
For reporting, we evaluate all 5000 test examples regardless of their lengths.
|
| 129 |
+
|
| 130 |
+
The results on the IsarStep task for four pretrained models and the baseline transformer model without pretraining is shown in Table 1. We also include another baseline, HAT transformer introduced in Li et al. (2020), which is a specially designed hierarchical transformer architecture tailored to this task. We see the pretrained model achieved substantial improvement over the model trained from scratch as well as HAT. Notably, the model that was pretrained on Abduct improved the top-10 accuracy from $3 3 . 1 \%$ to $4 1 . 0 \%$ , for almost $8 \%$ absolute improvement. The model pretrained on $\mathbb { M } \mathrm { i } \times$ performed the best on top-1 accuracy, improving the baseline by $6 . 5 \%$ accuracy. We also showed the validation BLEU scores along training in Figure 1. We can see that the pretrained models learned much faster than the model trained from scratch. With around 50K steps of updates, the pretrained model already obtained better BLEU scores than the best score achieved by the un-pretrained model. Moreover, since the downstream task requires 200K steps of training with 4 GPUs, the amount of computation spent on pretraining is only $2 . 5 \%$ of the downstream task, strongly demonstrating the efficiency of the proposed pretraining method.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 1: Validation BLEU along training on the IsarStep task.
|
| 134 |
+
|
| 135 |
+
# 4.3 HOLIST SKIP-TREE
|
| 136 |
+
|
| 137 |
+
As the second mathematical reasoning benchmark we consider the HOList skip-tree evaluation tasks by Rabe et al. (2020). These tasks include two variants of type inference, predicting under which assumptions theorems hold, and completing equalities. All source expressions for these tasks are taken from the validation set of the theorem database of the HOList proof logs (Bansal et al.). The evaluations are done on a random sample of 1000 instances from the full evaluation sets. We initialized the model parameters with the pretrained weights and then repeated the experiments by Rabe et al. (2020). That is, we trained the models for up to 1M parameter updates on the training set with batch size 256 and repeat the evaluation every 100K steps. In Table 2 we present the best result from these 10 evaluation runs. We see a significant improvement in these reasoning tasks when the models are initialized with the pretrained weights. Notably, on equation completion and missing assumptions task, we improved the beam search (with width 8) exact match rate performance from $4 6 . 3 \%$ to $5 1 . 7 \%$ and $4 1 . 8 \%$ to $4 7 . 9 \%$ . Note that this is despite the amount of pretraining compute cost being negligible: it takes less than 1 percent of the cost of the downstream task training. Pretraining used $1 / 2 0$ number of the update steps (50K vs 1M) with 8 (and 4) times smaller batches (pretraining has much shorter sequence lengths, 128 vs. 1024 and 512, respectively).
|
| 138 |
+
|
| 139 |
+
# 4.4 METAMATHSTEP
|
| 140 |
+
|
| 141 |
+
Compared to other ITPs, MetaMath is a low-level proving system: each proof step makes only a small step towards the goal. As such, each proof contains many more proof steps than in other ITPs: with 37, 000 theorems in the human-written theorem library, there are around 3 million proof steps.
|
| 142 |
+
|
| 143 |
+
Table 4: Comparisons to other pretraining tasks on IsarStep task.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc</td></tr><tr><td>No pretrain (Li et al., 2020)</td><td>20.4</td><td>33.1</td></tr><tr><td>LIME Mix</td><td>26.9</td><td>40.4</td></tr><tr><td>Pretrain on MetaMathStep</td><td>23.1</td><td>35.7</td></tr><tr><td>Pretrain on WMT En-De</td><td>17.2</td><td>30.3</td></tr></table>
|
| 146 |
+
|
| 147 |
+
We extract the proof steps and use them to construct a sequence-to-sequence task following Polu and Sutskever (2020) (their proof step training objective).
|
| 148 |
+
|
| 149 |
+
In this task, the model is asked to generate PROOFSTEPS given a GOAL, namely, the GOAL string is the source input, and PROOFSTEPS is the target output. We follow Polu and Sutskever (2020) and use their string representation for the GOAL and the PROOFSTEPS. Instead of using subword tokenization in Polu and Sutskever (2020), we use a character-level representation for our task. Following Polu and Sutskever (2020), we split theorems into train/valid/test theorems of size 35K, 1K, 1K, and associate all proof steps of a theorem with that split. For each dataset, we filter examples with lengths longer than 1024. This reduced the total number of proof steps to 1.4 million. For validation and test set, we randomly sample 3000 examples out of 40K (after filtering) and perform validation and test evaluations on them. In Table 3 we present the impact of pretraining on our synthetic reasoning tasks on MetaMathStep. We also observe gains from pretraining on this dataset, with the model trained on Induct task achieving $2 . 2 \%$ top-1 and $1 . 5 \%$ top-10 test accuracy improvement. Similarly, as for the IsarStep task, the computation spent on pretraining is only $2 . 5 \%$ of the downstream task.
|
| 150 |
+
|
| 151 |
+
# 5 ABLATION STUDIES
|
| 152 |
+
|
| 153 |
+
In this section, we perform ablation studies. Additional ablation studies can be found in Appendix C.
|
| 154 |
+
|
| 155 |
+
# 5.1 PRETRAINING ON FORMAL REASONING AND NATURAL LANGUAGE TASKS
|
| 156 |
+
|
| 157 |
+
Here we investigate how LIME compares to pretraining on natural language or existing formal reasoning datasets. In this set of experiments, we pretrained three models on Mix, MetaMathStep, and on the WMT 2016 English-to-Germany (WMT En-De) translation task, and then we fine-tuned and evaluated these models on the IsarStep task. We pretrained the model on MetaMathStep and WMT EN-DE for 200K steps with 4 GPUs, which is 40 times more computation spent than on LIME. Due to the mismatch between vocabularies of the pretraining task and the downstream task, we do not load the vocabulary embeddings nor output layer weights. The results in Table 4 show that pretraining on MetaMathStep did provide gains, though significantly smaller than gains provided by LIME Mix, despite their 40 times higher computational cost. Moreover, pre-training on WMT translation had even a negative effect on the performance. We also conducted an analogous experiment with an evaluation on the MetaMathStep, which we present in Appendix C.
|
| 158 |
+
|
| 159 |
+
# 5.2 DO WE NEED VOCABULARY EMBEDDINGS FOR FINE-TUNING?
|
| 160 |
+
|
| 161 |
+
As mentioned earlier, we did not load in the vocabulary embeddings from the pretrained models when we switched to fine-tuning on downstream tasks. Even without loading the vocab embeddings, the pretrained models still improved the performance. In this ablation study, we investigate how much this decision has affected the results and whether vocabulary embeddings can help improve the performance even further. We performed the comparisons on IsarStep. The task contains a token vocabulary of size 28336. We generated new synthetic tasks for the same vocabulary size, such that we can load the vocabulary embeddings and output layers when initializing the model for IsarStep. Table 5 shows that this led to similar performance. This aligns with our expectation that the model should not learn content specific knowledge that is potentially stored in the vocabulary. These weights turn out to be non-essential for the final performance, supporting the evidence that the transformer learns inductive biases from the pretraining task.
|
| 162 |
+
|
| 163 |
+
Table 5: Whether one needs to load vocabulary embeddings and output layer weights on IsarStep tasks.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc</td></tr><tr><td>No pretrain (Li et al., 2020)</td><td>20.4</td><td>33.1</td></tr><tr><td>LIME Mix</td><td>26.9</td><td>40.4</td></tr><tr><td>LIME Mix + Loading All Weights</td><td>26.7</td><td>40.6</td></tr></table>
|
| 166 |
+
|
| 167 |
+
6 DOES LIME ENCODE INDUCTION, DEDUCTION AND ABDUCTION?
|
| 168 |
+
|
| 169 |
+
Although LIME has shown to achieve substantial improvements across various benchmarks, it is not entirely clear that the specific synthetic tasks necessarily enforce the reasoning ability of induction, deduction and abduction. We would like to note that deduction, induction, and abduction are highlevel and philosophical concepts, and serve only as an inspiration for us to design the synthetic tasks. We do not expect the model will necessarily learn exactly these three capabilities. After all, we have chosen a particular implementation of "Case", "Rule" and "Result". Furthermore, we also design tasks mimic proof steps in formal theorem proving (see the rewrite task in Appendix B.1), which also achieved excellent results. Nevertheless, we believe LIME is a first step towards building reasoning inductive biases, and provides many inspirations and directions for future work.
|
| 170 |
+
|
| 171 |
+
# 7 CONCLUSION
|
| 172 |
+
|
| 173 |
+
In this work, we encoded inductive biases for mathematical reasoning in the form of datasets. We created three synthetic tasks inspired by three reasoning primitives of deduction, induction, and abduction. We demonstrated that pretraining on these tasks (LIME) significantly improved the performances across three mathematical reasoning benchmarks. Notably, LIME requires negligible computation compared to the downstream task, unlike being the dominating factor in previous pretraining methods. Our work naturally poses many future research questions. Could the primitive tasks provide similar gains for NLP tasks? Are there similar primitive tasks for natural language reasoning? We also look forward to disentangling the effects of pretraining between learning content knowledge and inductive bias for all downstream tasks to better understand pre-training.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Kshitij Bansal, Sarah M. Loos, Markus N. Rabe, Christian Szegedy, and Stewart Wilcox. HOList: An Environment for Machine Learning of Higher Order Logic Theorem Proving. In 36th International Conference on Machine Learning, ICML 2019, Long Beach, California, USA, June 9-15, 2019. URL http://proceedings.mlr.press/v97/bansal19a.html.
|
| 178 |
+
|
| 179 |
+
Kshitij Bansal, Christian Szegedy, Markus N. Rabe, Sarah M. Loos, and Viktor Toman. Learning to Reason in Large Theories without Imitation. arXiv preprint arXiv:1905.10501, 2019.
|
| 180 |
+
|
| 181 |
+
Francesco Bellucci and Ahti-Veikko Pietarinen. Charles Sanders Peirce: Logic. In The Internet Encyclopedia of Philosophy, 2015. URL https://iep.utm.edu/peir-log/.
|
| 182 |
+
|
| 183 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. CoRR, abs/2005.14165, 2020. URL https://arxiv.org/abs/2005.14165.
|
| 184 |
+
|
| 185 |
+
Alexis Conneau and Guillaume Lample. Cross-lingual Language Model Pretraining. In Advances in Neural Information Processing Systems, NeurIPS 2019, Vancouver, BC, Canada, December 8-14, 2019, pages 7057–7067, 2019. URL http://papers.nips.cc/paper/ 8928-cross-lingual-language-model-pretraining.
|
| 186 |
+
|
| 187 |
+
Maxwell Crouse, Ibrahim Abdelaziz, Cristina Cornelio, Veronika Thost, Lingfei Wu, Kenneth Forbus, and Achille Fokoue. Improving Graph Neural Network Representations of Logical Formulae with Subgraph Pooling. arXiv preprint arXiv:1911.06904, 2019.
|
| 188 |
+
|
| 189 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171– 4186. Association for Computational Linguistics, 2019. doi: 10.18653/v1/n19-1423. URL https://doi.org/10.18653/v1/n19-1423.
|
| 190 |
+
|
| 191 |
+
Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified Language Model Pre-training for Natural Language Understanding and Generation. In Advances in Neural Information Processing Systems, NeurIPS 2019, Vancouver, BC, Canada, December 8-14, 2019, pages 13063–13075, 2019.
|
| 192 |
+
|
| 193 |
+
Richard Evans, David Saxton, David Amos, Pushmeet Kohli, and Edward Grefenstette. Can Neural Networks Understand Logical Entailment? In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ SkZxCk-0Z.
|
| 194 |
+
|
| 195 |
+
Thibault Gauthier, Cezary Kaliszyk, Josef Urban, Ramana Kumar, and Michael Norrish. TacticToe: Learning to Prove with Tactics. Journal of Automated Reasoning, pages 1–30, 2020.
|
| 196 |
+
|
| 197 |
+
Christopher Hahn, Frederik Schmitt, Jens U. Kreber, Markus N. Rabe, and Bernd Finkbeiner. Transformers Generalize to the Semantics of Logics. arXiv preprint arXiv:2003.04218, 2020.
|
| 198 |
+
|
| 199 |
+
Jesse Michael Han. Enhancing SAT solvers with glue variable predictions. arXiv preprint arXiv:2007.02559, 2020.
|
| 200 |
+
|
| 201 |
+
Vincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis, and David Bieber. Global relational models of source code. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https: //openreview.net/forum?id=B1lnbRNtwr.
|
| 202 |
+
|
| 203 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 204 |
+
|
| 205 |
+
Daniel Huang, Prafulla Dhariwal, Dawn Song, and Ilya Sutskever. GamePad: A learning environment for theorem proving. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview. net/forum?id $=$ r1xwKoR9Y7.
|
| 206 |
+
|
| 207 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64–77, 2020. doi: 10.1162/tacl\_a\_00300. URL https: //doi.org/10.1162/tacl_a_00300.
|
| 208 |
+
|
| 209 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 210 |
+
|
| 211 |
+
Guillaume Lample and François Charton. Deep learning for symbolic mathematics. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id $=$ Ske31kBtPr.
|
| 212 |
+
|
| 213 |
+
Yann LeCun, Patrick Haffner, Léon Bottou, and Yoshua Bengio. Object recognition with gradientbased learning. In Shape, Contour and Grouping in Computer Vision, page 319, Berlin, Heidelberg, 1999. Springer-Verlag. ISBN 3540667229.
|
| 214 |
+
|
| 215 |
+
Gil Lederman, Markus Rabe, Sanjit Seshia, and Edward A Lee. Learning heuristics for quantified boolean formulas through reinforcement learning. In International Conference on Learning Representations, 2020.
|
| 216 |
+
|
| 217 |
+
Wenda Li, Lei Yu, Yuhuai Wu, and Lawrence C. Paulson. Modelling High-Level Mathematical Reasoning in Mechanised Declarative Proofs. arXiv preprint arXiv:2006.09265, 2020.
|
| 218 |
+
|
| 219 |
+
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. CoRR, abs/1907.11692, 2019. URL http://arxiv.org/abs/1907.11692.
|
| 220 |
+
|
| 221 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In Lluís Màrquez, Chris Callison-Burch, Jian Su, Daniele Pighin, and Yuval Marton, editors, Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, pages 1412– 1421. The Association for Computational Linguistics, 2015. doi: 10.18653/v1/d15-1166. URL https://doi.org/10.18653/v1/d15-1166.
|
| 222 |
+
|
| 223 |
+
R. Thomas McCoy, E. Grant, P. Smolensky, T. Griffiths, and Tal Linzen. Universal linguistic inductive biases via meta-learning. Proceedings of CogSci, abs/2006.16324, 2020.
|
| 224 |
+
|
| 225 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Waleed Ammar, Annie Louis, and Nasrin Mostafazadeh, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Demonstrations, pages 48–53. Association for Computational Linguistics, 2019. doi: 10.18653/v1/n19-4009. URL https://doi.org/10.18653/v1/n19-4009.
|
| 226 |
+
|
| 227 |
+
Aditya Paliwal, Sarah M. Loos, Markus N. Rabe, Kshitij Bansal, and Christian Szegedy. Graph representations for higher-order logic and theorem proving. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 2967–2974. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/article/view/5689.
|
| 228 |
+
|
| 229 |
+
Isabel Papadimitriou and Dan Jurafsky. Learning Music Helps You Read: Using transfer to study linguistic structure in language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6829–6839, Online, November 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020. emnlp-main.554.
|
| 230 |
+
|
| 231 |
+
Charles Sanders Peirce. Reasoning and the logic of things: The Cambridge conferences lectures of 1898. Harvard University Press, 1992.
|
| 232 |
+
|
| 233 |
+
Bartosz Piotrowski and Josef Urban. Guiding Inferences in Connection Tableau by Recurrent Neural Networks. In Christoph Benzmüller and Bruce Miller, editors, Intelligent Computer Mathematics, pages 309–314, Cham, 2020. Springer International Publishing. ISBN 978-3-030-53518-6.
|
| 234 |
+
|
| 235 |
+
Stanislas Polu and Ilya Sutskever. Generative Language Modeling for Automated Theorem Proving. CoRR, abs/2009.03393, 2020. URL https://arxiv.org/abs/2009.03393.
|
| 236 |
+
|
| 237 |
+
Markus N. Rabe, Dennis Lee, Kshitij Bansal, and Christian Szegedy. Mathematical Reasoning via Self-supervised Skip-tree Training. arXiv preprint arXiv:2006.04757, 2020.
|
| 238 |
+
|
| 239 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. In OpenAI Blog, 2018. URL https://d4mucfpksywv.cloudfront.net/better-language-models/ language_models_are_unsupervised_multitask_learners.pdf.
|
| 240 |
+
|
| 241 |
+
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-toText Transformer. J. Mach. Learn. Res., 21:140:1–140:67, 2020. URL http://jmlr.org/ papers/v21/20-074.html.
|
| 242 |
+
|
| 243 |
+
David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. In Proceedings of International Conference on Learning Representations (ICLR), 2019.
|
| 244 |
+
|
| 245 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
|
| 246 |
+
|
| 247 |
+
Imanol Schlag, Paul Smolensky, Roland Fernandez, Nebojsa Jojic, Jürgen Schmidhuber, and Jianfeng Gao. Enhancing the transformer with explicit relational encoding for math problem solving. CoRR, abs/1910.06611, 2019. URL http://arxiv.org/abs/1910.06611.
|
| 248 |
+
|
| 249 |
+
Daniel Selsam and Nikolaj Bjørner. Guiding High-Performance SAT solvers with Unsat-Core Predictions. In International Conference on Theory and Applications of Satisfiability Testing, pages 336–353. Springer, 2019.
|
| 250 |
+
|
| 251 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bünz, Percy Liang, Leonardo de Moura, and David L. Dill. Learning a SAT solver from single-bit supervision. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJMC_iA5tm.
|
| 252 |
+
|
| 253 |
+
Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and Tie-Yan Liu. MASS: masked sequence to sequence pre-training for language generation. In 36th International Conference on Machine Learning, ICML 2019, Long Beach, California, USA, June 9-15, 2019, 2019. URL http://proceedings. mlr.press/v97/song19d.html.
|
| 254 |
+
|
| 255 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 256 |
+
|
| 257 |
+
Josef Urban and Jan Jakub˚uv. First Neural Conjecturing Datasets and Experiments. In Christoph Benzmüller and Bruce Miller, editors, Intelligent Computer Mathematics, pages 315–323, Cham, 2020. Springer International Publishing. ISBN 978-3-030-53518-6.
|
| 258 |
+
|
| 259 |
+
Pashootan Vaezipoor, Gil Lederman, Yuhuai Wu, Chris J. Maddison, Roger B. Grosse, Edward A. Lee, Sanjit A. Seshia, and Fahiem Bacchus. Learning Branching Heuristics for Propositional Model Counting. CoRR, abs/2007.03204, 2020. URL https://arxiv.org/abs/2007.03204.
|
| 260 |
+
|
| 261 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 262 |
+
|
| 263 |
+
Mingzhe Wang, Yihe Tang, Jian Wang, and Jia Deng. Premise selection for theorem proving by deep graph embedding. In Advances in Neural Information Processing Systems, pages 2786–2796, 2017.
|
| 264 |
+
|
| 265 |
+
Qingxiang Wang, Chad Brown, Cezary Kaliszyk, and Josef Urban. Exploration of neural machine translation in autoformalization of mathematics in mizar. Proceedings of ACM SIGPLAN International Conference on Certified Programs and Proofs, 2020.
|
| 266 |
+
|
| 267 |
+
Alex Warstadt and Samuel R. Bowman. Can neural networks acquire a structural bias from raw linguistic data? Proceedings of CogSci, 2020.
|
| 268 |
+
|
| 269 |
+
Yuhuai Wu, Albert Jiang, Jimmy Ba, and Roger Grosse. INT: An Inequality Benchmark for Evaluating Generalization in Theorem Proving. arXiv preprint arXiv:2007.02924, 2020.
|
| 270 |
+
|
| 271 |
+
Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In ICLR 2020, 2020.
|
| 272 |
+
|
| 273 |
+
Kaiyu Yang and Jia Deng. Learning to Prove Theorems via Interacting with Proof Assistants. In Proceedings of International Conference on Machine Learning (ICML), 2019.
|
| 274 |
+
|
| 275 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in Neural Information Processing Systems, NeurIPS 2019, Vancouver, BC, Canada, December 8-14, 2019, 2019.
|
| 276 |
+
|
| 277 |
+
Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J. Liu. PEGASUS: pre-training with extracted gap-sentences for abstractive summarization. In 37th International Conference on Machine Learning, ICML 2020, Vienna, Austria, 2020, volume 119. PMLR, 2020.
|
| 278 |
+
|
| 279 |
+
# APPENDIX A SYNTHETIC TASK GENERATION PSEUDOCODE
|
| 280 |
+
|
| 281 |
+
# Algorithm 1
|
| 282 |
+
|
| 283 |
+
1: function GENERATE_TUPLE( Vocabulary size $S$ )
|
| 284 |
+
2: Vocabulary $\mathcal { V } \{ 1 , 2 , \dotsc , S \}$ . . Use an integer representation of symbols.
|
| 285 |
+
3: Math symbol set $\mathcal { M } \mathrm { S A M P L E } ( \mathcal { V } , n { = } 4 4 $ , replacement=False). $\triangleright$ Sample 44 distinct symbols.
|
| 286 |
+
4: Rule symbol set $\mathcal { R } \gets \mathtt { S A M P L E } ( \mathcal { V } \backslash \mathcal { M }$ , $n { = } 2 0$ , replacement=False). $\triangleright$ Sample 20 distinct symbols.
|
| 287 |
+
5: Rule $R \operatorname { S A M P L E } ( \mathcal { M } \cup \mathcal { R }$ , $n { = }$ RANDOM(5,20), replacement=False). . Sample a sequence of
|
| 288 |
+
symbols of length between 5 and 20.
|
| 289 |
+
6: Case dictionary $C \gets \{ \}$ .
|
| 290 |
+
7: for $s$ in $\mathcal { R }$ do
|
| 291 |
+
8: Case dictionary $C [ s ] \gets \mathtt { S A M P L E } ( \mathcal { M } , n \mathop { = } \mathrm { R A N D C }$ M(2,8), replacement=True). . Sample a sequence
|
| 292 |
+
of symbols for each rule symbol, of length of length between 2 and 8.
|
| 293 |
+
9: end for
|
| 294 |
+
10: Result $R ^ { \prime } \gets { \sf R u l e } R$ . . Set result string $R ^ { \prime }$ to be the same as rule string $R$ .
|
| 295 |
+
11: for $s$ in $\mathcal { R }$ do
|
| 296 |
+
12: SUBSTITUTE $( R ^ { \prime } , s , C [ s ] )$ . $\triangleright$ Substitute every rule symbol $s$ in result string $R ^ { \prime }$ with previously
|
| 297 |
+
randomly sampled string $C [ s ]$ .
|
| 298 |
+
13: end for
|
| 299 |
+
14: return Math symbol set $\mathcal { M }$ , Rule symbol set $\mathcal { R }$ , Rule $R$ , Case $C$ , Result $R ^ { \prime }$ .
|
| 300 |
+
15: end function
|
| 301 |
+
|
| 302 |
+
# APPENDIX B OTHER SYNTHETIC TASKS
|
| 303 |
+
|
| 304 |
+
In this section, we give descriptions of other variants of the synthetic tasks we considered than the ones introduced in the main paper.
|
| 305 |
+
|
| 306 |
+
APPENDIX B.1 RE W R I T E AND RE W R I T E_M U L T I S T E P
|
| 307 |
+
|
| 308 |
+
We propose a rewrite task, inspired by the rewrite tactic used in interactive theorem provers. The Rewrite task requires the model to rewrite a string according to a rule transformation. One example of the task is:
|
| 309 |
+
|
| 310 |
+
Source: $a + b - c < s > A + B = B + A$
|
| 311 |
+
|
| 312 |
+
Target: $b + a - c$
|
| 313 |
+
|
| 314 |
+
“ $\dot { \boldsymbol { A } } + \boldsymbol { B } = \boldsymbol { B } + \boldsymbol { A } ^ { \ast }$ “ is the rule transformation, which is applied to the LHS string $\mathbf { \dot { \boldsymbol { a } } } + \boldsymbol { b } - \boldsymbol { c } ^ { \flat }$ . The model needs to predict the RHS string as the result of the rule application, i.e., $b + a - c$ . Besides rule symbols and math symbols, we also require the third set of symbols, named as "string symbols". For the ease of our discussion, we we will think of math symbols as the union of those operators used in mathematics (e.g., $^ { 6 6 } + - * = ( ) \& ^ { 3 } )$ , rule symbols as upper case letters (e.g., $A , B , C \dots )$ , and string symbols as lower case letters (e.g., $a , b , c \ldots )$ . We first sample a random string as the LHS string, consisting of math symbols and string symbols (e.g., $a + b - c )$ . We sample a sub-string of the LHS string, and replace the string symbols in the sub-string with rule symbols. For example, we sample and obtain the substring $a + b$ from $a + b - c $ , and we replace $a , b$ with rule symbols $A , B$ . This then forms the LHS of the rule transformation, $A + B$ , with the substitution dictionary $\{ A : a , B : b \}$ . We then sample the RHS of the rule transformation from the union of rule symbols $A$ and $B$ , and all math symbols, e.g., $B + A$ . This gives the rule transformation $A + B = B + A$ . We substitute the value of the substitution dictionary for each rule symbol in the RHS rule, and then substitute back to the original LHS string to obtain $b + a - c$ . The task example is constructed by using the LHS string and the rule transformation as the source input, and use the result of the rule transformation as the target.
|
| 315 |
+
|
| 316 |
+
We further introduce a multi-step version of the rewrite task: Rewrite_multistep. In this task, the source may contain more than one rewrite rule, and the target is the result of applying all the rewrite rules in a sequence. This task is motivated from the need to perform multi-step planning in mathematical reasoning tasks. During pre-training, for each training example, we uniformly sample the number of rewrite steps from 1 to 5.
|
| 317 |
+
|
| 318 |
+
Table 6: Test top-1, top-10 $( \% )$ accuracy on the IsarStep task.
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc.</td></tr><tr><td>No pretrain (Li et al., 2020)</td><td>20.4</td><td>33.1</td></tr><tr><td>HAT (Li et al., 2020)</td><td>22.8</td><td>35.2</td></tr><tr><td>LIME Deduct</td><td>24.7</td><td>37.7</td></tr><tr><td>LIME Abduct</td><td>26.7</td><td>41.0</td></tr><tr><td>LIME Induct</td><td>23.9</td><td>38.8</td></tr><tr><td>LIME Mix</td><td>26.9</td><td>40.4</td></tr><tr><td>LIME Rewrite</td><td>26.0</td><td>38.6</td></tr><tr><td>LIMERewrite_multistep</td><td>28.6</td><td>43.9</td></tr><tr><td>LIMEInduct_v2</td><td>25.6</td><td>39.8</td></tr><tr><td>LIMEInduct_v3</td><td>25.0</td><td>38.8</td></tr><tr><td>LIMEInduct_rewrite</td><td>25.8</td><td>39.5</td></tr></table>
|
| 321 |
+
|
| 322 |
+
# APPENDIX B.2 OTHER VARIANTS OF IN D U C T TASK
|
| 323 |
+
|
| 324 |
+
We introduce three other variants of the Induct task.
|
| 325 |
+
|
| 326 |
+
1. Induct_v2: We move the Case dictionary from the source input to the target output. This makes the task significantly harder, which requires the agent to synthesize a rule and a possible explanation (Case) to explain the Result.
|
| 327 |
+
2. Induct_v3: Instead of providing the Case dictionary, we provide two Result strings, coming from the same Rule. Namely, we sample two Case dictionaries, and applying each to the Rule string to obtain two Result strings. Both Result strings are used as source, and the target is the Rule string.
|
| 328 |
+
3. Induct_rewrite: We also create a “induction” version of the Rewrite task. In this task, the source is the LHS string concatenated with the RHS string, that is the result of the rewrite. The target is the rewrite rule that is used to do the rewrite.
|
| 329 |
+
|
| 330 |
+
# APPENDIX B.3 A FULL COMPARISON OF ALL SYNTHETIC TASKS
|
| 331 |
+
|
| 332 |
+
In this section we present a full comparison for all synthetic tasks. We followed the training protocol in 4.1 and evaluate the method on IsarStep. The results are reported in Table 6. We can see that the Rewrite_multistep achieved the best performance across all synthetic tasks, surpassing the baseline by $8 . 2 \%$ for Top-1 accuracy and $1 0 . 8 \%$ for Top-10 accuracy. This indicates the inductive bias for long horizon reasoning encoded in Rewrite_multistep is very useful for the reasoning task.
|
| 333 |
+
|
| 334 |
+
# APPENDIX C MORE ABLATION STUDIES
|
| 335 |
+
|
| 336 |
+
APPENDIX C.1 DOES THE VOCABULARY SIZE MATTER?
|
| 337 |
+
|
| 338 |
+
In this section, we investigate whether the vocabulary size $S$ in the synthetic task generation algorithm has an effect on the performance. We used the REWRITE task for the experiment in this section. We generated datasets of various vocabulary sizes, 100, 512, 1000, 5000, 25000. We used the same curriculum learning for pre-training as described in 4.1 on larger vocabulary sizes: first training on the Rewrite task of vocabulary size 100 for 10K steps, then training on each individual dataset for another 10K steps. We compare the performance on the downstream task Isarstep. The results are presented in Table 7. We see that when the vocabulary size is equal or larger than 512, the performance were similar. The smallest vocabulary size 100 obtained the worst performance among all, and all the other four models achieved similar BLEU scores. The model trained on the largest vocabulary achieved best performance on top-1 accuracy and top-10 accuracy. The results show there is a non-trivial effect of the vocabulary size of the synthetic task to the performance of the
|
| 339 |
+
|
| 340 |
+
downstream task. Hence we use vocabulary size of 1000 for all the experiments in the main paper.
|
| 341 |
+
We leave investigations of the causes to future work.
|
| 342 |
+
|
| 343 |
+
Table 7: Vocabulary sizes’ effects on the IsarStep task.
|
| 344 |
+
APPENDIX C.2 PRE-TRAINING ON ISARSTEP FOR METAMATHSTEP
|
| 345 |
+
|
| 346 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc</td></tr><tr><td>No pretrain</td><td>20.4</td><td>33.1</td></tr><tr><td>LIME on Rewrite,S= 100</td><td>24.1</td><td>37.5</td></tr><tr><td>LIME on Rewrite,S= 512</td><td>25.4</td><td>38.8</td></tr><tr><td>LIME on Rewrite,S= 1000</td><td>26.0</td><td>38.6</td></tr><tr><td>LIME on Rewrite,S= 5000</td><td>25.8</td><td>38.5</td></tr><tr><td>LIME on Rewrite,S= 25000</td><td>27.4</td><td>40.9</td></tr></table>
|
| 347 |
+
|
| 348 |
+
Following Section 5.1, we performed pre-training on IsarStep for MetaMathStep. The result is shown in Table 8. In contrast to MetaMath helping IsarStep, we see that pretraining on IsarStep task did not help the downstream task MetaMathStep. We hypothesize that this could be due to MetaMathStep task is closer to the LIME tasks than IsarStep, and hence providing more gains than the opposite direction. We leave investigations to the future versions.
|
| 349 |
+
|
| 350 |
+
Table 8: Pretraining on IsarStep for the MetaMathStep task.
|
| 351 |
+
|
| 352 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc.</td></tr><tr><td>No pretrain</td><td>67.7</td><td>76.5</td></tr><tr><td>LIME Mix</td><td>69.1</td><td>77.9</td></tr><tr><td>Pretrain on IsarStep</td><td>67.0</td><td>76.1</td></tr></table>
|
| 353 |
+
|
| 354 |
+
# APPENDIX C.3 DOES LIME HELP LSTMS?
|
| 355 |
+
|
| 356 |
+
In this section, we investigate if LIME also helps other architectures than transformers. In particular, we applied LIME to two LSTM based architectures: 1. vanilla LSTM, 2. LSTM with attention mechanism. The vanilla LSTM is a stacking LSTM with 4 layers, each with 1000 cells, and 1000- dimensional embeddings. The LSTM with attention architecture is taken from Luong et al. (2015), also with 4 layers, 1000 cells and 1000-dimensional embeddings. We evaluate on the IsarStep task, and compared a model trained from scratch and a model pre-trained on LIME abduct task. We used the same training protocol as described in 4.1. The results are shown in Table 9, along with the results on transformer. We observe that LIME improved LSTM as well as LSTM with attention, but the improvements were small compared to transformer. Specifically, if we compare Top-1 accuracy, we can see that LIME improved LSTM from $5 . 5 \%$ to $6 . { \dot { 9 } } \%$ , LSTM with attention from $1 2 . 3 \%$ to $1 3 . 4 \%$ , and transformer from $2 0 . 4 \%$ to $2 6 . 7 \%$ . This observation is aligned with our hypothesis that the transformer is a malleable architecture and hence it is capable of learning architectural inductive biases from datasets. This is mainly attributed to the potential of learning dynamic attention graphs in self-attention layers. We note that this still warrants further investigation as the performance of these architectures are not at the same level, and that may also lead to different improvements.
|
| 357 |
+
|
| 358 |
+
Table 9: Comparing LIME’s benefits on LSTMs on the IsarStep Task
|
| 359 |
+
|
| 360 |
+
<table><tr><td>Model</td><td>Top-1 Acc.</td><td>Top-10 Acc.</td></tr><tr><td>LSTM</td><td>5.5</td><td>11.3</td></tr><tr><td>LSTM+LIME Abduct</td><td>6.9</td><td>14.3</td></tr><tr><td>LSTM+attention</td><td>12.3</td><td>22.7</td></tr><tr><td>LSTM+attention+LIME Abduct</td><td>13.4</td><td>26.3</td></tr><tr><td>Transformer</td><td>20.4</td><td>33.1</td></tr><tr><td>Transformer+LIME Abduct</td><td>26.7</td><td>41.0</td></tr></table>
|
md/train/QgX15Mdi1E_/QgX15Mdi1E_.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Space-time Mixing Attention for Video Transformer
|
| 2 |
+
|
| 3 |
+
Adrian Bulat Samsung AI Cambridge adrian@adrianbulat.com
|
| 4 |
+
|
| 5 |
+
Juan-Manuel Perez-Rua Samsung AI Cambridge j.perez-rua@samsung.com
|
| 6 |
+
|
| 7 |
+
Swathikiran SudhakaranSamsung AI Cambridgeswathikir.s@samsung.com
|
| 8 |
+
|
| 9 |
+
Brais Martinez Samsung AI Cambridge brais.a@samsung.com
|
| 10 |
+
|
| 11 |
+
Georgios Tzimiropoulos Samsung AI Cambridge
|
| 12 |
+
Queen Mary University of London
|
| 13 |
+
g.tzimiropoulos@qmul.ac.uk
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
This paper is on video recognition using Transformers. Very recent attempts in this area have demonstrated promising results in terms of recognition accuracy, yet they have been also shown to induce, in many cases, significant computational overheads due to the additional modelling of the temporal information. In this work, we propose a Video Transformer model the complexity of which scales linearly with the number of frames in the video sequence and hence induces no overhead compared to an image-based Transformer model. To achieve this, our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. We also show how to integrate 2 very lightweight mechanisms for global temporal-only attention which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model produces very high recognition accuracy on the most popular video recognition datasets while at the same time being significantly more efficient than other Video Transformer models. Code for our method is made available here.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Video recognition – in analogy to image recognition – refers to the problem of recognizing events of interest in video sequences such as human activities. Following the tremendous success of Transformers in sequential data, specifically in Natural Language Processing (NLP) [39, 5], Vision Transformers were very recently shown to outperform CNNs for image recognition too [48, 13, 35], signaling a paradigm shift on how visual understanding models should be constructed. In light of this, in this paper, we propose a Video Transformer model as an appealing and promising solution for improving the accuracy of video recognition models.
|
| 22 |
+
|
| 23 |
+
A direct, natural extension of Vision Transformers to the spatio-temporal domain is to perform the self-attention jointly across all $S$ spatial locations and $T$ temporal locations. Full space-time attention though has complexity ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ making such a model computationally heavy and, hence, impractical even when compared with the 3D-based convolutional models. As such, our aim is to exploit the temporal information present in video streams while minimizing the computational burden within the Transformer framework for efficient video recognition.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Different approaches to space-time self-attention for video recognition. In all cases, the key locations that the query vector, located at the center of the grid in red, attends are shown in orange. Unlike prior work, our key vector is constructed by mixing information from tokens located at the same spatial location within a local temporal window. Our method then performs self-attention with these tokens. Note that our mechanism allows for an efficient approximation of local space-time attention at no extra cost.
|
| 27 |
+
|
| 28 |
+
A baseline solution to this problem is to consider spatial-only attention followed by temporal averaging, which has complexity ${ \cal O } ( T S ^ { 2 } )$ . Similar attempts to reduce the cost of full space-time attention have been recently proposed in [3, 1]. These methods have demonstrated promising results in terms of video recognition accuracy, yet they have been also shown to induce, in most of the cases, significant computational overheads compared to the baseline (spatial-only) method due to the additional modelling of the temporal information.
|
| 29 |
+
|
| 30 |
+
Our main contribution in this paper is a Video Transformer model that has complexity $O ( T S ^ { 2 } )$ and, hence, is as efficient as the baseline model, yet, as our results show, it outperforms recently/concurrently proposed work [3, 1] in terms of efficiency (i.e. accuracy/FLOP) by significant margins. To achieve this our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. Fig. 1 shows the proposed approximation to space-time attention. We also show how to integrate two very lightweight mechanisms for global temporal-only attention, which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model is surprisingly effective in terms of capturing long-term dependencies and producing very high recognition accuracy on the most popular video recognition datasets, including Something-Something-v2 [17], Kinetics [4] and Epic Kitchens [9], while at the same time being significantly more efficient than other Video Transformer models.
|
| 31 |
+
|
| 32 |
+
# 2 Related work
|
| 33 |
+
|
| 34 |
+
Video recognition: Standard solutions are based on CNNs and can be broadly classified into two categories: 2D- and 3D-based approaches. 2D-based approaches process each frame independently to extract frame-based features which are then aggregated temporally with some sort of temporal modeling (e.g. temporal averaging) performed at the end of the network [42, 26, 27]. The works of [26, 27] use the “shift trick” [45] to have some temporal modeling at a layer level. 3D-based approaches [4, 16, 36] are considered the current state-of-the-art as they can typically learn stronger temporal models via 3D convolutions. However, they also incur higher computational and memory costs. To alleviate this, a large body of works attempt to improve their efficiency via spatial and/or temporal factorization [38, 37, 15].
|
| 35 |
+
|
| 36 |
+
CNN vs ViT: Historically, video recognition approaches tend to mimic the architectures used for image classification (e.g. from AlexNet [23] to [20] or from ResNet [18] and ResNeXt [47] to [16]). After revolutionizing NLP [39, 32], very recently, Transformer-based architectures showed promising results on large scale image classification too [13]. While self-attention and attention were previously used in conjunction with CNNs at a layer or block level [6, 50, 33], the Vision Transformer (ViT)
|
| 37 |
+
|
| 38 |
+
of Dosovitskiy et al. [13] is the first convolution-free, Transformer-based architecture that achieves state-of-the-art on ImageNet [11].
|
| 39 |
+
|
| 40 |
+
Video Transformer: Recently/concurrently with our work, vision transformer architectures, derived from [13], were used for video recognition [3, 1], too. Because performing full space-time attention is computationally prohibitive (i.e. $\bar { O } ( T ^ { 2 } S ^ { 2 } ) )$ , their main focus is on reducing this via temporal and spatial factorization. In TimeSformer [3], the authors propose applying spatial and temporal attention in an alternating manner reducing the complexity to $\bar { O } ( \bar { T ^ { 2 } } S + \bar { T } \bar { S ^ { 2 } } )$ . In a similar fashion, ViViT [1] explores several avenues for space-time factorization. In addition, they also proposed to adapt the patch embedding process from [13] to 3D (i.e. video) data. Our work proposes a completely different approximation to full space-time attention that is also efficient. To this end, we firstly restrict full space-time attention to a local temporal window which is reminiscent of [2] but applied here to space-time attention and video recognition 1. Secondly, we define a local joint space-time attention which we show that can be implemented efficiently via the “shift trick” [45].
|
| 41 |
+
|
| 42 |
+
# 3 Method
|
| 43 |
+
|
| 44 |
+
Video Transformer: We are given a video clip $\mathbf { X } \in \mathbb { R } ^ { T \times H \times W \times C }$ $C = 3$ ). Following ViT [13], each frame is divided into $K \times K$ non-overlapping patches which are then mapped into visual tokens using a linear embedding layer $\mathbf { E } \in \mathbb { R } ^ { 3 K ^ { 2 } \times d }$ . Since self-attention is permutation invariant, in order to preserve the information regarding the location of each patch within space and time we also learn two positional embeddings, one for space: $\mathbf { p } _ { s } \in \mathbb { R } ^ { 1 \times S \times d }$ and one for time: $\mathbf { p } _ { t } \in \mathbb { R } ^ { T \times 1 \times d }$ . These are then added to the initial visual tokens. Finally, the token sequence is processed by $L$ Transformer layers.
|
| 45 |
+
|
| 46 |
+
The visual token at layer $l$ , spatial location $s$ and temporal location $t$ is denoted as:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \mathbf { z } _ { s , t } ^ { l } \in \mathbb { R } ^ { d } , l = 0 , \ldots , L - 1 , s = 0 , \ldots , S - 1 , t = 0 , \ldots , T - 1 . } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
In addition to the $S T$ visual tokens extracted from the video, a special classification token $\mathbf { z } _ { c l s } ^ { l } \in \mathbb { R } ^ { d }$ is prepended to the token sequence [12]. The $l -$ th Transformer layer processes the visual tokens $\mathbf { Z } ^ { l ^ { - } } \in \mathsf { \bar { R } } ^ { ( S T + 1 ) \times d }$ of the previous layer using a series of Multi-head Self-Attention (MSA), Layer Normalization (LN), and MLP $\mathbb { R } ^ { d } \overset { \cdot } { \to } \mathbb { R } ^ { 4 d } \overset { \cdot } { \to } \mathbb { R } ^ { d }$ ) layers as follows:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r c l } { { \mathbf { Y } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M S A } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Z } } ^ { l - 1 } ) ) + { \mathbf { Z } } ^ { l - 1 } , } } \\ { { \mathbf { Z } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M L P } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Y } } ^ { l } ) ) + { \mathbf { Y } } ^ { l } . } } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The main computation of a single full space-time Self-Attention (SA) head boils down to calculating:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\mathbf { q } _ { s , t } ^ { l } , \mathbf { k } _ { s , t } ^ { l } , \mathbf { v } _ { s , t } ^ { l } \in \mathbb { R } ^ { d _ { h } }$ are the query, key, and value vectors computed from $\mathbf { z } _ { s , t } ^ { l }$ (after LN) using embedding matrices $\mathbf { W _ { q } } , \mathbf { W _ { k } } , \mathbf { W _ { v } } \in \mathbb { R } ^ { d \times d _ { h } }$ . Finally, the output of the $h$ heads is concatenated and projected using embedding matrix Wh ∈ Rhdh×d.
|
| 65 |
+
|
| 66 |
+
The complexity of the full model is: $O ( 3 h T S d d _ { h } )$ $( q k v$ projections) $+ O ( 2 h T ^ { 2 } S ^ { 2 } d _ { h } )$ (MSA for $h$ attention heads) $+ O ( T S ( h d _ { h } ) d )$ (multi-head projection) $+ \hat { O } ( 4 T S d ^ { 2 } )$ (MLP) 2. From these terms, our goal is to reduce the cost $\tilde { O ( 2 T ^ { 2 } S ^ { 2 } d _ { h } ) }$ (for a single attention head) of the full space-time attention which is the dominant term 3. For clarity, from now on, we will drop constant terms and $d _ { h }$ to report complexity unless necessary. Hence, the complexity of the full space-time attention is $O ( T ^ { 2 } S ^ { 2 } )$ .
|
| 67 |
+
|
| 68 |
+
Our baseline is a model that performs a simple approximation to the full space-time attention by applying, at each Transformer layer, spatial-only attention:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
the complexity of which is ${ \cal O } ( T S ^ { 2 } )$ . Notably, the complexity of the proposed space-time mixing attention is also ${ \cal O } ( T S ^ { 2 } )$ . Following spatial-only attention, simple temporal averaging is performed on the class tokens $\begin{array} { r } { { \bf z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } { \bf z } _ { t , c l s } ^ { L - 1 } } \end{array}$ to obtain a single feature that is fed to the linear classifier.
|
| 75 |
+
|
| 76 |
+
Recent work by [3, 1] has focused on reducing the cost ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ of the full space-time attention of Eq. 4. Bertasius et al. [3] proposed the factorised attention:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l r } & { \tilde { \mathbf { y } } _ { s , t } ^ { l } = \displaystyle \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s , t ^ { \prime } } ^ { l } , } & \\ & { \mathbf { y } _ { s , t } ^ { l } = \displaystyle \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ \tilde { \mathbf { q } } _ { s , t } ^ { l } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l } , } & \end{array} \quad \begin{array} { r l } & { \left\{ s = 0 , \dots , S - 1 \right\} , } \\ & { \left\{ t = 0 , \dots , T - 1 \right\} , } \\ & \left\{ \begin{array} { r l } & { s = 0 , \dots , T - 1 \} \\ & { s ^ { \prime } = 0 } \end{array} \right\} , } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\tilde { \mathbf { q } } _ { s , t } ^ { l } , \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l }$ are new query, key and value vectors calculated from $\tilde { \mathbf { y } } _ { s , t } ^ { l }$ 4. The above model reduces complexity to $O ( T ^ { 2 } S + T S ^ { 2 } )$ . However, temporal attention is performed for a fixed spatial location which is ineffective when there is camera or object motion and there is spatial misalignment between frames.
|
| 83 |
+
|
| 84 |
+
The work of [1] is concurrent to ours and proposes the following approximation: $L _ { s }$ Transformer layers perform spatial-only attention as in Eq. 5 (each with complexity $O ( S ^ { 2 } ) _ { \ l }$ ). Following this, there are $L _ { t }$ Transformer layers performing temporal-only attention on the class tokens $\mathbf { z } _ { t } ^ { L _ { s } }$ . The complexity of the temporal-only attention is, in general, $\overset { \cdot } { O ( T ^ { 2 } ) }$ .
|
| 85 |
+
|
| 86 |
+
Our model aims to better approximate the full space-time self-attention (SA) of Eq. 4 while keeping complexity to ${ \cal O } ( T S ^ { 2 } )$ , i.e. inducing no further complexity to a spatial-only model.
|
| 87 |
+
|
| 88 |
+
To achieve this, we make a first approximation to perform full space-time attention but restricted to a local temporal window $[ - t _ { w } , t _ { w } ]$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathbf { V } _ { t ^ { \prime } } ^ { l } \mathbf { a } _ { t ^ { \prime } } ^ { l } , \{ \mathbf { \phi } _ { t = 0 , \dots , T - 1 } ^ { s = 0 , \dots , S - 1 } \}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where ${ \bf V } _ { t ^ { \prime } } ^ { l } = [ { \bf v } _ { 0 , t ^ { \prime } } ^ { l } ; { \bf v } _ { 1 , t ^ { \prime } } ^ { l } ; \ldots ; { \bf v } _ { S - 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { d _ { h } \times S }$ and $\mathbf { a } _ { t ^ { \prime } } ^ { l } = [ a _ { 0 , t ^ { \prime } } ^ { l } , a _ { 1 , t ^ { \prime } } ^ { l } , \ldots , a _ { S = 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { S }$ is the vector with the corresponding attention weights. Eq. 7 shows that, for a single Transformer layer, $\mathbf { y } _ { s , t } ^ { l }$ is a spatio-temporal combination of the visual tokens in the local window $[ - t _ { w } , t _ { w } ]$ . It follows that, after k Transformer layers, yl+ks,t will be a spatio-temporal combination of the visual tokens in the local window $[ - k t _ { w } , k t _ { w } ]$ which in turn conveniently allows to perform spatio-temporal attention over the whole clip. For example, for $t _ { w } = 1$ and $k = 4$ , the local window becomes $[ - 4 , 4 ]$ which spans the whole video clip for the typical case $T = 8$ .
|
| 95 |
+
|
| 96 |
+
The complexity of the local self-attention of Eq. 7 is $O ( T ( 2 t _ { w } + 1 ) ^ { 2 } S ^ { 2 } )$ . To reduce this even further, we make a second approximation on top of the first one as follows: the attention between spatial locations $s$ and $s ^ { \prime }$ according to the model of Eq. 7 is:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathrm { S o f t m a x } \{ ( { \bf q } _ { s , t } ^ { l } \cdot { \bf k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} { \bf v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
i.e. it requires the calculation of $2 t _ { w } + 1$ attentions, one per temporal location over $[ - t _ { w } , t _ { w } ]$ . Instead, we propose to calculate a single attention over $[ - t _ { w } , t _ { w } ]$ which can be achieved by $\mathbf { q } _ { s , t } ^ { l }$ attending $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ; \hdots ; \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ] \in \mathbb { R } ^ { ( 2 t _ { w } + 1 ) d _ { h } }$ . Note that to match the dimensions of $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ a further projection of $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ to $\mathbb { R } ^ { d _ { h } }$ is normally required which has complexity $O ( ( 2 t _ { w } + 1 ) d _ { h } ^ { 2 } )$ and hence compromises the goal of an efficient implementation. To alleviate this we use the “shift trick” [45, 26] which allows to perform both zero-cost dimensionality reduction, spacetime mixing and attention (between $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { \Delta } \mathbf { \bar { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } )$ in $O ( d _ { h } )$ . In particular, each $t ^ { \prime } \in [ - t _ { w } , t _ { w } ]$ is assigned $d _ { h } ^ { t ^ { \prime } }$ channels from $d _ { h }$ (i.e. $\textstyle \sum _ { t ^ { \prime } } d _ { h } ^ { t ^ { \prime } } = d _ { h } )$ ). Let $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ( d _ { h } ^ { t ^ { \prime } } ) \in \mathbb { R } ^ { d _ { h } ^ { t ^ { \prime } } }$ denote the operator for indexing the $d _ { h } ^ { t ^ { \prime } }$ channels from $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l }$ . Then, a new key vector is constructed as:
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
|
| 106 |
+
Figure 2: Detailed self-attention computation graph for (a) full space-time attention and (b) the proposed space-time mixing approximation. Notice that in our case only S tokens participate instead of ST. The temporal information is aggregated by indexing channels from adjacent frames. Tokens of identical colors share the same temporal index.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
(b) Proposed space-time mixing attention.
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ( d _ { h } ^ { t - t _ { w } } ) , \hdots , \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ( d _ { h } ^ { t + t _ { w } } ) ] \in \mathbb { R } ^ { d _ { h } } . } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Fig. 2 shows how the key vector $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t w : t _ { w } } ^ { l }$ is constructed. In a similar way, we also construct a new value vector $\tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ . Finally, the proposed approximation to the full space-time attention is given by:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathbf { y } _ { s , t } ^ { l _ { s } } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l _ { s } } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\} .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
This has the complexity of a spatial-only attention $( O ( T S ^ { 2 } ) )$ and hence it is more efficient than previously proposed video transformers [3, 1]. Our model also provides a better approximation to the full space-time attention and as shown by our results it significantly outperforms [3, 1].
|
| 122 |
+
|
| 123 |
+
Temporal Attention aggregation: The final set of the class tokens $\mathbf { z } _ { t , c l s } ^ { L - 1 } , 0 \leq t \leq L - 1$ are used to generate the predictions. To this end, we propose to consider the following options: (a) simple temporal averaging $\begin{array} { r } { \mathbf { z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } \mathbf { z } _ { t , c l s } ^ { L - 1 } } \end{array}$ as in the case of our baseline. (b) An obvious limitation of temporal averaging is that the output is treated purely as an ensemble of per-frame features and, hence, completely ignores the temporal ordering between them. To address this, we propose to use a lightweight Temporal Attention (TA) mechanism that will attend to the $T$ classification tokens. In particular a $\mathbf { z } _ { f i n a l }$ token attends the sequence $[ \mathbf { z } _ { 0 , c l s } ^ { L - 1 } , \ldots , \mathbf { z } _ { T - 1 , c l s } ^ { L - 1 } ]$ using a temporal Transformer layer and then fed as input to the classifier. This is akin to the (concurrent) work of [1] with the difference being that in our model we found that a single TA layer suffices whereas [1] uses $L _ { t }$ . A consequence of this is that the complexity of our layer is $O ( T )$ vs $O ( 2 ( L _ { t } - 1 ) T ^ { 2 } + \bar { T } )$ of [1].
|
| 124 |
+
|
| 125 |
+
Summary token: As an alternative to TA, herein, we also propose a simple lightweight mechanism for information exchange between different frames at intermediate layers of the network. Given the set of tokens for each frame $t$ , $\mathbf { Z } _ { t } ^ { l - 1 } \in \mathbb { R } ^ { ( S + 1 ) \times d _ { h } }$ (constructed by concatenating all tokens $\mathbf { z } _ { s , t } ^ { l - 1 } , s = 0 , \ldots , S )$ , we compute a new set of $R$ tokens $\mathbf { Z } _ { r , t } ^ { l } = \phi ( \mathbf { Z } _ { \underline { { t } } } ^ { l - 1 } ) \in \mathbb { R } ^ { R \times d _ { h } }$ which summarize the frame information and hence are named “Summary” tokens. These are then, appended to the visual tokens of all frames to calculate the keys and values so that the query vectors attend the original keys plus the Summary tokens. Herein, we explore the case that $\phi ( . )$ performs simple spatial averaging $\begin{array} { r } { \mathbf { \tilde { z } } _ { 0 , t } ^ { l } = \frac { 1 } { S } \sum _ { s } \mathbf { z } _ { s , t } ^ { l } } \end{array}$ over the tokens of each frame ( $R = 1$ for this case). Note that, for $R = 1$ , the extra cost that the Summary token induces is $O ( T S )$ .
|
| 126 |
+
|
| 127 |
+
X-ViT: We call the Video Transformer based on the proposed (a) space-time mixing attention and (b) lightweight global temporal attention (or summary token) as $\mathbf { X }$ -ViT.
|
| 128 |
+
|
| 129 |
+
# 4 Results
|
| 130 |
+
|
| 131 |
+
# 4.1 Experimental setup
|
| 132 |
+
|
| 133 |
+
Datasets: We train and evaluate the proposed models on the following datasets (all datasets are publicly available for research purposes):
|
| 134 |
+
|
| 135 |
+
Kinetics-400 and 600: The Kinetics [21] dataset consists of short clips (typically 10 sec long sampled from YouTube) labeled using 400 and 600 classes, respectively. Due to the removal of some videos from YouTube, the version of the dataset used in this paper consists of approximately 261K clips for Kinetics-400. Note, that these amounts are lower than the original version of the datasets and thus might represent a negative performance bias when compared with prior works.
|
| 136 |
+
|
| 137 |
+
Something-Something- $\cdot \nu 2$ $( S S \nu 2 )$ : The SSv2 [17] dataset consists of 220,487 short videos (of duration between 2 and 6 sec) that depict humans performing pre-defined basic actions with everyday objects. Because the objects and backgrounds in the videos are consistent across different action classes, this dataset tends to require stronger temporal modeling. Due to this, we conducted most of our ablation studies on SSv2 to better analyze the importance of the proposed components.
|
| 138 |
+
|
| 139 |
+
Epic Kitchens-100 (Epic-100): is an egocentric large scale action recognition dataset consisting of more than 90,000 action segments spanning 100 hours of recordings in home environments, capturing daily activities [10]. The dataset is labeled using 97 verb classes and 300 noun classes. The evaluation results are reported using the standard action recognition protocol: the network predicts the “verb” and the “noun” using two heads. The predictions are then merged to construct an “action” which is used to report the accuracy.
|
| 140 |
+
|
| 141 |
+
Training details: All models, unless otherwise stated, were trained using the following scheduler and training procedure: specifically, our models were trained using SGD with momentum (0.9) and a cosine scheduler [28] (with linear warmup) for 35 epochs on SSv2, 50 on Epic-100 and 30 on Kinetics. The base learning rate, set at a batch size of 128, was 0.05 (0.03 for Kinetics). To prevent over-fitting we made use of the following augmentation techniques: random scaling $( 0 . 9 \times$ to $1 . 3 \times$ ) and cropping, random flipping (with probability of 0.5; not for SSv2) and autoaugment [8]. In addition, for SSv2 and Epic-100, we also applied random erasing (probability $= 0 . 5$ , min. area $_ { = 0 . 0 2 }$ , max. area $_ { = 1 / 3 }$ , min. aspec $\scriptstyle \mathrm { \ t = 0 . 3 }$ ) [52] and label smoothing $\lambda = 0 . 3 )$ ) [34] while, for Kinetics, we used mixup [51] $\langle \alpha = 0 . 4 \rangle$ ).
|
| 142 |
+
|
| 143 |
+
Table 1: Effect of local window size. To isolate its effect from that of temporal aggregation, the models were trained using temporal averaging. Note, that $( B o . )$ indicates that only features from the boundaries of the local window were used, ignoring the intermediate ones.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>tw=0</td><td>45.2</td><td>71.4</td></tr><tr><td>tw=1</td><td>62.5</td><td>87.8</td></tr><tr><td>tw=2</td><td>60.5</td><td>86.4</td></tr><tr><td>tw =2(Bo.)</td><td>60.4</td><td>86.2</td></tr></table>
|
| 146 |
+
|
| 147 |
+
The backbone models follow closely the ViT architecture of Dosovitskiy et al. [13]. Most experiments were performed using the ViT-B/16 variant $L = 1 2$ , $h = 1 2$ , $d = 7 6 8$ , $K = 1 6$ ), where $L$ represents the number of transformer layers, $h$ the number of heads, $d$ the embedding dimension and $K$ the patch size. We initialized our models from a pretrained ImageNet-21k [11] ViT model. The spatial positional encoding $\mathbf { p } _ { s }$ was initialized from the pretrained 2D model and the temporal one, $\mathbf { p } _ { t }$ , with zeros so that it does not have a great impact on the tokens early on during training. The models were trained on 8 V100 GPUs using PyTorch [30].
|
| 148 |
+
|
| 149 |
+
Testing details: Unless otherwise stated, we used ViT-B/16 and $T = 8$ frames. We mostly used Temporal Attention (TA) for temporal aggregation. We report accuracy results for $1 \times 3$ views (1 temporal clip and 3 spatial crops) departing from the common approach of using up to $1 0 \times 3$ views [26, 16]. The $1 \times 3$ views setting was also used in Bertasius et al. [3]. To measure the variation between runs, we trained one of the 8–frame models 5 times. The results varied by $\pm 0 . 4 \%$ .
|
| 150 |
+
|
| 151 |
+
# 4.2 Ablation studies
|
| 152 |
+
|
| 153 |
+
Throughout this section, we study the effect of varying certain design choices and different components of our method. Because SSv2 tends to require a more fine-grained temporal modeling, unless otherwise specified, all results reported, in this section, are on the SSv2.
|
| 154 |
+
|
| 155 |
+
Table 2: Effect of: (a) proposed SA position, (b) temporal aggregation and number of Temporal Attention (TA) layers, (c) space-time mixing qkv vectors and (d) amount of mixed channels on SSv2.
|
| 156 |
+
(a) Effect of applying the proposed SA to certain layers.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Transform. layers</td><td>Top-1 Top-5</td></tr><tr><td>1st half</td><td>61.7 86.5</td></tr><tr><td>2nd half</td><td>61.6 86.3</td></tr><tr><td>Half (odd. pos)</td><td>61.2 86.4</td></tr><tr><td>All</td><td>62.6 87.8</td></tr></table>
|
| 159 |
+
|
| 160 |
+
(c) Effect of space-time mixing. x denotes the input token before $q k v$ projection. Query produces equivalent results with key and thus omitted.
|
| 161 |
+
(d) Effect of amount of mixed channels. \* uses temp. avg. aggregation.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>X</td><td>key</td><td>value</td><td>Top-1</td><td>Top-5</td></tr><tr><td>x>xxx</td><td>X</td><td>X</td><td>56.6</td><td>83.5</td></tr><tr><td></td><td>X</td><td>X</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td>√</td><td>×</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td></td><td>√</td><td>62.5</td><td>88.6</td></tr><tr><td></td><td>×</td><td>√</td><td>64.4</td><td>89.3</td></tr></table>
|
| 164 |
+
|
| 165 |
+
(b) Effect of number of TA layers. 0 corresponds to temporal averaging.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>#. TA layers</td><td>Top-1</td><td>Top-5</td></tr><tr><td>0 (temp. avg.)</td><td>62.4</td><td>87.8</td></tr><tr><td>1</td><td>64.4</td><td>89.3</td></tr><tr><td>2</td><td>64.5</td><td>89.3</td></tr><tr><td>3</td><td>64.5</td><td>89.3</td></tr></table>
|
| 168 |
+
|
| 169 |
+
<table><tr><td>0%*</td><td>0%</td><td>25%</td><td>50%</td><td>100%</td></tr><tr><td>45.2</td><td>56.6</td><td>64.3</td><td>64.4</td><td>62.5</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Effect of local window size: Table 1 shows the accuracy of our model by varying the local window size $[ - t _ { w } , t _ { w } ]$ used in the proposed space-time mixing attention. Firstly, we observe that the proposed model is significantly superior to our baseline ${ { t } _ { w } } = 0$ ) which uses spatial-only attention. Secondly, a window of $t _ { w } = 1$ produces the best results. This shows that more gradual increase of the effective window size that is attended is more beneficial compared to more aggressive ones, i.e. the case where $t _ { w } = 2$ . A performance degradation for the case $t _ { w } = 2$ could be attributed to boundary effects (handled by filling with zeros) which are aggravated as $t _ { w }$ increases. Based on these results, we chose to use $t _ { w } = 1$ for the models reported hereafter. For short to medium long videos, it seems that $t _ { w } = 1$ suffices as the temporal receptive field size increases as we advance in depth in the model allowing it to capture a larger effective temporal window. For the datasets used, as explained earlier, after a few transformer layers the whole clip is effectively covered. However, for significantly longer video sequences, larger window sizes may perform better.
|
| 172 |
+
|
| 173 |
+
Effect of SA position: We explored which layers should the proposed space-time mixing attention be applied to within the network. Specifically, we explored the following variants: Applying it to the first $L / 2$ layers, to the last $L / 2$ layers, to every odd indexed layer and, finally, to all layers. As the results from Table 2a show, the exact layers within the network that self-attention is applied to do not matter; what matters is the number of layers it is applied to. We attribute this result to the increased temporal receptive field and cross-frame interactions.
|
| 174 |
+
|
| 175 |
+
Effect of temporal aggregation: Herein, we compare the two methods used for temporal aggregation: simple temporal averaging [41] and the proposed Temporal Attention (TA) mechanism. Given that our model already incorporates temporal information through the proposed space-time attention, we also explored how many TA layers are needed. As shown in Table 2b, replacing temporal averaging with one TA layer improves the Top-1 accuracy from $6 2 . 5 \%$ to $6 4 . 4 \%$ . Increasing the number of layers further yields no additional benefits. In Table 2d, we also report the accuracy of spatial-only attention $0 \%$ mixing) plus TA aggregation. In the absence of the proposed space-time mixing attention, the TA layer alone is unable to compensate, scoring only $5 6 . 6 \%$ . In the same table, $4 5 . 2 \%$ is the accuracy of a model trained without the proposed local attention and TA layer (i.e. using a temporal pooling for aggregation). Overall, the results highlight the need of having both components in our final model. For the next two ablation studies, we used 1 TA layer.
|
| 176 |
+
|
| 177 |
+
Table 3: Effect of number of tokens on SSv2.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>XViT-T/16</td><td>54.7</td><td>82.8</td></tr><tr><td>XViT-S/32</td><td>57.0</td><td>84.6</td></tr><tr><td>XViT-S/16</td><td>61.1</td><td>88.0</td></tr><tr><td>XViT-B/32</td><td>60.5</td><td>87.4</td></tr><tr><td>XViT-L/32</td><td>61.8</td><td>88.3</td></tr><tr><td>XViT-B/16</td><td>64.4</td><td>89.3</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Effect of space-time mixing qkv vectors: Paramount to our work is the proposed space-time mixing attention of Eq. 10 which is implemented by constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ w and v˜ ls0,−tw :tw efficiently via channel indexing (see Eq. 9). Space-time mixing though can be applied in several different ways in the model. For completeness, herein, we study the effect of applying space-time mixing to various combinations for the key, value and to the input token prior to qkv projection. As shown in Table 2c, the combination corresponding to our model (i.e. space-time mixing applied to the key and value) significantly outperforms all other variants by up to $2 \%$ . This result is important as it confirms that our model, derived from the proposed approximation to the local space-time attention, gives the best results when compared to other non-well motivated variants.
|
| 182 |
+
|
| 183 |
+
Table 4: Comparison between TA and Summary token on SSv2 (left) and Kinetics-400 (right).
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>X</td><td>62.4</td><td>87.8</td></tr><tr><td>√</td><td>×</td><td>63.7</td><td>88.9</td></tr><tr><td>√</td><td></td><td>63.4</td><td>88.9</td></tr><tr><td>X</td><td>交</td><td>64.4</td><td>89.3</td></tr></table>
|
| 186 |
+
|
| 187 |
+
<table><tr><td> Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>×</td><td>77.8</td><td>93.7</td></tr><tr><td>√</td><td>x>></td><td>78.7</td><td>93.7</td></tr><tr><td>√</td><td></td><td>78.0</td><td>93.2</td></tr><tr><td>X</td><td></td><td>78.5</td><td>93.7</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 5: Comparison with state-of-the-art on the Kinetics-400.
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>Params</td><td>FLOPs (×109)</td></tr><tr><td>bLVNet [14]</td><td>73.5</td><td>91.2</td><td>24×2</td><td>3×3</td><td>25M</td><td>840</td></tr><tr><td>STM[19]</td><td>73.7</td><td>91.6</td><td>16</td><td>1</td><td>24M</td><td>1</td></tr><tr><td>TEA [25]</td><td>76.1</td><td>92.5</td><td>16</td><td>10×3</td><td>25.6M</td><td>2,100</td></tr><tr><td>TSM R50 [26]</td><td>74.7</td><td>=</td><td>16</td><td>10×3</td><td>25.6M</td><td>650</td></tr><tr><td>I3D NL [44]</td><td>77.7</td><td>93.3</td><td>128</td><td>10×3</td><td>1</td><td>10,800</td></tr><tr><td>CorrNet-101 [40]</td><td>79.2</td><td>-</td><td>32</td><td>10×3</td><td>=</td><td>6,700</td></tr><tr><td>ip-CSN-152[38]</td><td>79.2</td><td>93.8</td><td>8</td><td>10×3</td><td></td><td>3,270</td></tr><tr><td>LGD-3D R101 [31]</td><td>79.4</td><td>94.4</td><td>16</td><td>1</td><td>=</td><td>1</td></tr><tr><td>SlowFast 8×8 R101+NL [16]</td><td>78.7</td><td>93.5</td><td>8</td><td>10×3</td><td></td><td>3,480</td></tr><tr><td>SlowFast 16×8 R101+NL [16]</td><td>79.8</td><td>93.9</td><td>16</td><td>10×3</td><td>=</td><td>7,020</td></tr><tr><td>X3D-XXL [15]</td><td>80.4</td><td>94.6</td><td>1</td><td>10×3</td><td>20.3M</td><td>5,823</td></tr><tr><td>TimeSformer-L [3]</td><td>80.7</td><td>94.7</td><td>96</td><td>1×3</td><td>121M</td><td>7,140</td></tr><tr><td>ViViT-L/16x2[1]</td><td>80.6</td><td>94.7</td><td>32</td><td>4×3</td><td>312M</td><td>17,352</td></tr><tr><td>X-ViT (Ours)</td><td>78.5</td><td>93.7</td><td>8</td><td>1×3</td><td>92M</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>79.4</td><td>93.9</td><td>8</td><td>2×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.2</td><td>94.7</td><td>16</td><td>1×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.7</td><td>94.7</td><td>16</td><td>2×3</td><td>92M</td><td>1700</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Effect of amount of space-time mixing: We definefrom the adjacent frames in the local temporal window $\rho d _ { h }$ ming when $\begin{array} { r } { - t _ { w } , t _ { w } ] \left( i . e . \sum _ { t ^ { \prime } = - t _ { w } , t \neq 0 } ^ { t _ { w } } d _ { h } ^ { t ^ { \prime } } = \rho d _ { h } \right) } \end{array}$ constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ (see Section 3). Herein, we study the effect of $\rho$ on the model’s accuracy. As the results from Table 2d show, the optimal $\rho$ is between $2 5 \%$ and $50 \%$ . Increasing $\rho$ to $100 \%$ (i.e. all channels are coming from adjacent frames) unsurprisingly degrades the performance as it excludes the case $t ^ { \prime } = t$ when performing the self-attention.
|
| 194 |
+
|
| 195 |
+
Effect of Summary token: Herein, we compare Temporal Attention with Summary token on SSv2 and Kinetics-400. We used both datasets for this case as they require different type of understanding: fine-grained temporal (SSv2) and spatial content (Kinetics-400). From Table 4, we conclude that the Summary token compares favorable on Kinetics-400 but not on SSv2 showing that it is more useful in terms of capturing spatial information. Since the improvement is small, we conclude that 1 TA layer is the best global attention-based mechanism for improving the accuracy of our method adding also negligible computational cost.
|
| 196 |
+
|
| 197 |
+
Effect of number of input frames: Herein we evaluate the impact of increasing the number of input frames $T$ from 8 to 16 and 32. We note that, for our method, this change results in a linear increase in complexity. As the results from Table 7 show, increasing the number of frames from 8 to 16 offers a $1 . 8 \%$ boost in Top-1 accuracy on SSv2. Moreover, increasing the number of frames to 32 improves the performance by a further $0 . 2 \%$ , offering diminishing returns. Similar behavior can be observed on Kinetics and Epic-100 in Tables 5 and 8.
|
| 198 |
+
|
| 199 |
+
Table 6: Comparison with state-of-the-art on the Kinetics-600 dataset. $T \times$ is the number of frames used by our method.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>AttentionNAS [43]</td><td>79.8</td><td>94.4</td><td>=</td><td>1,034</td></tr><tr><td>LGD-3D R101 [31]</td><td>81.5</td><td>95.6</td><td>10×3</td><td>1</td></tr><tr><td>SlowFast R101+NL [16]</td><td>81.8</td><td>95.1</td><td>10×3</td><td>3,480</td></tr><tr><td>X3D-XL [15]</td><td>81.9</td><td>95.5</td><td>10×3</td><td>1,452</td></tr><tr><td>TimeSformer-HR [3]</td><td>82.4</td><td>96.0</td><td>1×3</td><td>5,110</td></tr><tr><td>ViViT-L/16x2[1]</td><td>82.5</td><td>95.6</td><td>4×3</td><td>17,352</td></tr><tr><td>X-ViT (8x) (Ours)</td><td>82.5</td><td>95.4</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (16×) (Ours)</td><td>84.5</td><td>96.3</td><td>1×3</td><td>850</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Effect of number of tokens and different model sizes: Herein, we vary the number of input tokens by changing the patch size $K$ . As the results from Table 3 show, even when the number of tokens decreases significantly (e.g. ViT-B/32 or ViT-S/32) our approach is still able to produce results of satisfactory accuracy. The benefit of that is having a model which is significantly more efficient. Similar concusions can be observed when the model size (in terms of parameters and FLOPs) is varied. Our approach provides consistent results in all cases, showcasing its ability to scale well from tiny (XViT-T) to large (XViT-L) models.
|
| 204 |
+
|
| 205 |
+
Latency and throughput considerations: While the channel shifting operation used by the proposed space-time mixing attention is zero-FLOP, there is still a small cost associated with memory movement operations. In order to ascertain that the induced cost does not introduce noticeable performance degradation, we benchmarked a Vit-B/16 ( $8 \times$ frames) model using spatial-only attention and the proposed space-time mixing attention on 8 V100 GPUs and a batch size of 128. A model with spatial-only attention has a throughput of 312 fps while our model has 304 fps.
|
| 206 |
+
|
| 207 |
+
Table 7: Comparison with state-of-the-art on SSv2. \* - pretrained on Kinetics 600
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>TRN [53]</td><td>48.8</td><td>77.6</td><td>8</td><td></td><td></td></tr><tr><td>SlowFast+multigrid [46]</td><td>61.7</td><td>1</td><td>1</td><td>1×3</td><td></td></tr><tr><td>TimeSformer-L [3]</td><td>62.4</td><td>1</td><td>96</td><td>1×3</td><td>7,140</td></tr><tr><td>TSMR50 [26]</td><td>63.3</td><td>88.5</td><td>16</td><td>2×3</td><td>-</td></tr><tr><td>STM[19]</td><td>64.2</td><td>89.8</td><td>16</td><td>-</td><td>-</td></tr><tr><td>MSNet [24]</td><td>64.7</td><td>89.4</td><td>16</td><td>=</td><td>-</td></tr><tr><td>TEA [25]</td><td>65.1</td><td>89.9</td><td>16</td><td></td><td></td></tr><tr><td>ViViT-L/16x2 [3]</td><td>65.4</td><td>89.8</td><td>32</td><td>4×3</td><td>11,892</td></tr><tr><td>X-ViT (Ours)</td><td>64.4</td><td>89.3</td><td>8</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>66.2</td><td>90.6</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT* (Ours)</td><td>67.2</td><td>90.8</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>66.4</td><td>90.7</td><td>32</td><td>1×3</td><td>1,270</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 4.3 Comparison to state-of-the-art
|
| 212 |
+
|
| 213 |
+
Our best model uses the proposed space-time mixing attention in all the Transformer layers and performs temporal aggregation using a single lightweight temporal transformer layer as described in Section 3. Unless otherwise specified, we report the results using the $1 \times 3$ configuration for the views (1 temporal and 3 spatial) for all datasets. Regarding related work on transformer-based video recognition [1, 3], we included their very best models trained on the same data as our models. For TimeSformer, this is typically the TimeSformer-L version. For ViVit, we used the 16x2 configuration, with factorized-encoding for Epic-100 and SS-v2 (as reported in Tables 6d and 6e in [1]) and the full version for Kinetics (as reported in Table 6a in [1]).
|
| 214 |
+
|
| 215 |
+
On Kinetics-400, we match the current state-of-the-art while having significantly lower computational complexity than the next two best recently proposed methods that also use Transformer-based architectures: $2 0 \times$ fewer FLOPs than ViVit [1] and $8 \times$ fewer than TimeSformer-L [3]. Note that both models from [1, 3] and ours were initialized from a ViT model pretrained on ImageNet-21k [11] and take as input frames at a resolution of $2 2 4 \times 2 2 4 \mathrm { p x }$ . Similar conclusions can be drawn from Table 6 which reports our results on Kinetics-600.
|
| 216 |
+
|
| 217 |
+
On SSv2, we match and surpass the current state-of-the-art, especially in terms of Top-5 accuracy (ours: $9 0 . 7 \%$ vs ViViT: $8 9 . 8 \%$ [1]) using models that are $1 4 \times$ (16 frames) and $9 \times$ (32 frames) faster.
|
| 218 |
+
|
| 219 |
+
Finally, we observe similar outcomes on Epic-100 where we set a new state-of-the-art, showing large improvements especially for “Verb” accuracy, while again being more efficient.
|
| 220 |
+
|
| 221 |
+
# 5 Ethical considerations and broader impact
|
| 222 |
+
|
| 223 |
+
Current high-performing video recognition models tend to have high computational demands for both training and testing and, by extension, significant environmental costs. This is especially true for the transformer-based architectures. Our research introduces a novel approach that matches and surpasses the current state-ofthe-art while being significantly more efficient thanks to the linear scaling of the complexity with respect to the number of frames. We hope such models will offer noticeable reduction in power consumption while setting at the same time a solid base for future research. We will release code and models to facilitate this. Moreover, and similarly to most data-driven systems,
|
| 224 |
+
|
| 225 |
+
Table 8: Comparison with state-of-the-art on Epic100. $T \times$ is the #frames used by our method. Results for other methods are taken from [1].
|
| 226 |
+
|
| 227 |
+
<table><tr><td>Method</td><td>Action</td><td>Verb</td><td>Noun</td></tr><tr><td>TSN [41] TRN [53]</td><td>33.2 35.3</td><td>60.2 65.9</td><td>46.0 45.4</td></tr><tr><td>TBN [22] TSM[22] SlowFast [16]</td><td>36.7 38.3 38.5</td><td>66.0 67.9 65.6</td><td>47.2 49.0 50.0</td></tr><tr><td>ViViT-L/16x2[1] X-ViT (8×) (Ours) X-ViT(16×) (Ours)</td><td>44.0 41.5</td><td>66.4 66.7</td><td>56.8 53.3</td></tr></table>
|
| 228 |
+
|
| 229 |
+
bias from the training data can potentially affect the fairness of the model. As such, we suggest to take this aspect into consideration when deploying the models into real-world scenarios.
|
| 230 |
+
|
| 231 |
+
# 6 Conclusions
|
| 232 |
+
|
| 233 |
+
We presented a novel approximation to the full space-time attention that is amenable to an efficient implementation and applied it to video recognition. Our approximation has the same computational cost as spatial-only attention yet the resulting video Transformer model was shown to be significantly more efficient than recently proposed Video Transformers [3, 1]. By no means this paper proposes a complete solution to video recognition using video Transformers. Future efforts could include combining our approaches with other architectures than the standard ViT, removing the dependency on pre-trained models and applying the model to other video-related tasks like detection and segmentation. Finally, further research is required for deploying our models on low power/resource devices.
|
| 234 |
+
|
| 235 |
+
References
|
| 236 |
+
[1] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia Schmid. Vivit: A ´ video vision transformer. arXiv preprint arXiv:2103.15691, 2021.
|
| 237 |
+
[2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
|
| 238 |
+
[3] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021.
|
| 239 |
+
[4] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017.
|
| 240 |
+
[5] Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018.
|
| 241 |
+
[6] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. A2-nets: Double attention networks. arXiv preprint arXiv:1810.11579, 2018.
|
| 242 |
+
[7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 243 |
+
[8] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018.
|
| 244 |
+
[9] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling egocentric vision: The epic-kitchens dataset. In ECCV, 2018.
|
| 245 |
+
[10] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Antonino Furnari, Evangelos Kazakos, Jian Ma, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Rescaling egocentric vision. arXiv preprint arXiv:2006.13256, 2020.
|
| 246 |
+
[11] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 247 |
+
[12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 248 |
+
[13] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 249 |
+
[14] Quanfu Fan, Chun-Fu Chen, Hilde Kuehne, Marco Pistoia, and David Cox. More is less: Learning efficient video representations by big-little network and depthwise temporal aggregation. arXiv preprint arXiv:1912.00869, 2019.
|
| 250 |
+
[15] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 203–213, 2020.
|
| 251 |
+
[16] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6202–6211, 2019.
|
| 252 |
+
[17] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The" something something" video database for learning and evaluating visual common sense. In Proceedings of the IEEE International Conference on Computer Vision, pages 5842–5850, 2017.
|
| 253 |
+
[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 254 |
+
[19] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2000–2009, 2019.
|
| 255 |
+
[20] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014.
|
| 256 |
+
[21] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 257 |
+
[22] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Epic-fusion: Audio-visual temporal binding for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5492–5501, 2019.
|
| 258 |
+
[23] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 259 |
+
[24] Heeseung Kwon, Manjin Kim, Suha Kwak, and Minsu Cho. Motionsqueeze: Neural motion feature learning for video understanding. In European Conference on Computer Vision, pages 345–362. Springer, 2020.
|
| 260 |
+
[25] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 909–918, 2020.
|
| 261 |
+
[26] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7083–7093, 2019.
|
| 262 |
+
[27] Zhaoyang Liu, Limin Wang, Wayne Wu, Chen Qian, and Tong Lu. Tam: Temporal adaptive module for video recognition. arXiv preprint arXiv:2005.06803, 2020.
|
| 263 |
+
[28] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 264 |
+
[29] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 265 |
+
[30] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
|
| 266 |
+
[31] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12056–12065, 2019.
|
| 267 |
+
[32] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 268 |
+
[33] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 269 |
+
[34] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 270 |
+
[35] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 271 |
+
[36] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015.
|
| 272 |
+
[37] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450–6459, 2018.
|
| 273 |
+
[38] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5552–5561, 2019.
|
| 274 |
+
[39] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 275 |
+
[40] Heng Wang, Du Tran, Lorenzo Torresani, and Matt Feiszli. Video modeling with correlation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 352–361, 2020.
|
| 276 |
+
[41] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In European conference on computer vision, pages 20–36. Springer, 2016.
|
| 277 |
+
[42] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks for action recognition in videos. IEEE transactions on pattern analysis and machine intelligence, 41(11):2740–2755, 2018.
|
| 278 |
+
[43] Xiaofang Wang, Xuehan Xiong, Maxim Neumann, AJ Piergiovanni, Michael S Ryoo, Anelia Angelova, Kris M Kitani, and Wei Hua. Attentionnas: Spatiotemporal attention cell search for video classification. In European Conference on Computer Vision, pages 449–465. Springer, 2020.
|
| 279 |
+
[44] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 280 |
+
[45] Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR, 2018.
|
| 281 |
+
[46] Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, and Philipp Krahenbuhl. A multigrid method for efficiently training video models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 153–162, 2020.
|
| 282 |
+
[47] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
|
| 283 |
+
[48] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 284 |
+
[49] Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. In NeurIPS, 2020.
|
| 285 |
+
[50] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International conference on machine learning, pages 7354–7363. PMLR, 2019.
|
| 286 |
+
[51] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 287 |
+
[52] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020.
|
| 288 |
+
[53] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803–818, 2018.
|
| 289 |
+
|
| 290 |
+
# Checklist
|
| 291 |
+
|
| 292 |
+
1. For all authors...
|
| 293 |
+
|
| 294 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 295 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6
|
| 296 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5
|
| 297 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 298 |
+
|
| 299 |
+
2. If you are including theoretical results...
|
| 300 |
+
|
| 301 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 302 |
+
|
| 303 |
+
3. If you ran experiments...
|
| 304 |
+
|
| 305 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] We include however all implementation details required to reproduce our work. We will make the code and the models available. The datasets used are already publicly available.
|
| 306 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1
|
| 307 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Due to prohibitive costs, we reported the variations between multiple training runs for a single 8 frames model in Section 4.1. This should be representative for the rest of the trained models.
|
| 308 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1
|
| 309 |
+
|
| 310 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 311 |
+
|
| 312 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 313 |
+
(b) Did you mention the license of the assets? [Yes] See Section 4.1
|
| 314 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 315 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] No data was collected, publicly available datasets were used
|
| 316 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] To our knowledge the datasets used do not contain such info
|
| 317 |
+
|
| 318 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 319 |
+
|
| 320 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 321 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 322 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/RLRXCV6DbEJ/RLRXCV6DbEJ.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VERY DEEP VAES GENERALIZE AUTOREGRESSIVE MODELS AND CAN OUTPERFORM THEM ON IMAGES
|
| 2 |
+
|
| 3 |
+
Rewon Child
|
| 4 |
+
OpenAI
|
| 5 |
+
San Francisco, CA
|
| 6 |
+
rewon@openai.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We present a hierarchical VAE that, for the first time, generates samples quickly and outperforms the PixelCNN in log-likelihood on all natural image benchmarks. We begin by observing that, in theory, VAEs can actually represent autoregressive models, as well as faster, better models if they exist, when made sufficiently deep. Despite this, autoregressive models have historically outperformed VAEs in loglikelihood. We test if insufficient depth explains why by scaling a VAE to greater stochastic depth than previously explored and evaluating it CIFAR-10, ImageNet, and FFHQ. In comparison to the PixelCNN, these very deep VAEs achieve higher likelihoods, use fewer parameters, generate samples thousands of times faster, and are more easily applied to high-resolution images. Qualitative studies suggest this is because the VAE learns efficient hierarchical visual representations. We release our source code and models at https://github.com/openai/vdvae.
|
| 11 |
+
|
| 12 |
+

|
| 13 |
+
Figure 1: Selected samples from our very deep VAE on FFHQ-256, and a demonstration of the learned generative process. VAEs can learn to first generate global features at low resolution, then fill in local details in parallel at higher resolutions. When made sufficiently deep, this learned, parallel, multiscale generative procedure attains a higher log-likelihood than the PixelCNN.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
One potential path to increased data-efficiency, generalization, and robustness of machine learning methods is to train generative models. These models can learn useful representations without human supervision by learning to create examples of the data itself. Many types of generative models have flourished in recent years, including likelihood-based generative models, which include autoregressive models (Uria et al., 2013), variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), and invertible flows (Dinh et al., 2014; 2016). Their objective, the negative log-likelihood, is equivalent to the KL divergence between the data distribution and the model distribution. A wide variety of models can be compared and assessed along this criteria, which corresponds to how well they fit the data in an information-theoretic sense.
|
| 18 |
+
|
| 19 |
+
Starting with the PixelCNN (Van den Oord et al., 2016), autoregressive models have long achieved the highest log-likelihoods across many modalities, despite counterintuitive modeling assumptions. For example, although natural images are observations of latent scenes, autoregressive models learn dependencies solely between observed variables. That process can require complex function approximators that integrate long-range dependencies (Oord et al., 2016; Child et al., 2019). In contrast, VAEs and invertible flows incorporate latent variables and can thus, in principle, learn a simpler model that mirrors how images are actually generated. Despite this theoretical advantage, on the landmark ImageNet density estimation benchmark, the Gated PixelCNN still achieves higher likelihoods than all flows and VAEs, corresponding to a better fit with the data.
|
| 20 |
+
|
| 21 |
+
Is the autoregressive modeling assumption actually a better inductive bias for images, or can VAEs, sufficiently improved, outperform autoregressive models? The answer has significant practical stakes, because large, compute-intensive autoregressive models (Strubell et al., 2019) are increasingly used for a variety of applications (Oord et al., 2016; Brown et al., 2020; Dhariwal et al., 2020; Chen et al., 2020). Unlike autoregressive models, latent variable models only need to learn dependencies between latent and observed variables; such models can not only support faster synthesis and higher-dimensional data, but may also do so using smaller, less powerful architectures.
|
| 22 |
+
|
| 23 |
+
We start this work with a simple but (to the best of our knowledge) unstated observation: hierarchical VAEs should be able to at least match autoregressive models, because autoregressive models are equivalent to VAEs with a powerful prior and restricted approximate posterior (which merely outputs observed variables). In the worst case, VAEs should be able to replicate the functionality of autoregressive models; in the best case, they should be able to learn better latent representations, possibly with much fewer layers, if such representations exist.
|
| 24 |
+
|
| 25 |
+
We formalize this observation in Section 3, showing it is only true for VAEs with more stochastic layers than previous work has explored. Then we experimentally test it on competitive natural image benchmarks. Our contributions are the following:
|
| 26 |
+
|
| 27 |
+
• We provide theoretical justification for why greater depth (up to the data dimension $D$ , but also as low as some value $K \ll D$ ) could improve VAE performance (Section 3)
|
| 28 |
+
• We introduce an architecture capable of scaling past 70 layers, when previous work explored at most 30 (Section 4)
|
| 29 |
+
• We verify that depth, independent of model capacity, improves log-likelihood, and allows VAEs to outperform the PixelCNN on all benchmarks (Section 5.1)
|
| 30 |
+
• Compared to the PixelCNN, we show the model also uses fewer parameters, generates samples thousands of times more quickly, and can be scaled to larger images. We show evidence these qualities may emerge from the model learning an efficient hierarchical representation of images (Section 5.2)
|
| 31 |
+
• We release code and models at https://github.com/openai/vdvae.
|
| 32 |
+
|
| 33 |
+
# 2 PRELIMINARIES
|
| 34 |
+
|
| 35 |
+
We review prior work and introduce some of the basic terminology used in the field.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 2: Different possible learned generative models in a VAE. Left: A hierarchical VAE can learn an autoregressive model by using the deterministic identity function as an encoder, and learning the autoregression in the prior. Right: Learning the encoder can lead to efficient hierarchies of latent variables (black). If the bottom group of three latent variables is conditionally independent given the first, they can be generated in parallel within a single layer, potentially leading to faster sampling.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
# 2.1 VARIATIONAL AUTOENCODERS
|
| 43 |
+
|
| 44 |
+
Variational autoencoders (Kingma & Welling, 2014; Rezende et al., 2014) consist of a generator $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , a prior $p _ { \theta } ( z )$ , and an approximate posterior $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . Neural networks $\phi$ and $\theta$ are trained end-to-end with backpropagation and the reparameterization trick in order to maximize the evidence lower bound (ELBO):
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { \log p _ { \theta } ( \mathbf { x } ) \geq E _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) - D _ { K L } [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } ) ] } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
See Kingma & Welling (2019) for an in-depth introduction. There are many choices for what networks are used for $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , $q _ { \phi } ( \pmb { z } | \pmb { x } )$ , and whether $p _ { \theta } ( z )$ is also learned or set to a simple distribution.
|
| 51 |
+
|
| 52 |
+
We study VAEs with independent $p _ { \theta } ( { \pmb x } | { \pmb z } )$ – that is, where each observed $x _ { i }$ is output without conditioning on any other $x _ { j }$ . This ensures generation time does not increase linearly with the dimensionality of the data, and requires that these VAEs learn to incorporate the complexity of the data into a rich distribution over latent variables $_ { z }$ . It is possible to have autoregressive $p _ { \theta } ( { \pmb x } | { \pmb z } )$ (Gulrajani et al., 2016), but generation is slow for these models. They also sometimes ignore latent variables entirely, becoming equivalent to normal autoregressive models (Chen et al. (2016)).
|
| 53 |
+
|
| 54 |
+
# 2.2 HIERARCHICAL VARIATIONAL AUTOENCODERS
|
| 55 |
+
|
| 56 |
+
Much of the early work on VAEs incorporate fully-factorized Gaussian $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( z )$ . This can lead to poor outcomes if the latent variables required for good generation take on a more complex distribution, as is common with independent $p _ { \theta } ( \pmb { x } | \pmb { z } )$ . One of the simplest methods of gaining greater expressivity in both distributions is to use a hierarchical VAE, which has several stochastic layers of latent variables. These variables are emitted in groups $z _ { 0 } , z _ { 1 } , . . . , z _ { N }$ , which are conditionally dependent upon each other in some way. For images, latent variables are typically output in feature maps of varying resolutions, with $z _ { \mathrm { 0 } }$ corresponding to a small number of latent variables at low resolution at the “top” of the network, and $z _ { N }$ corresponding to a larger number of latent variables at high resolution at the “bottom”.
|
| 57 |
+
|
| 58 |
+
One particularly elegant conditioning structure is the top-down $V A E$ , introduced in Sønderby et al. (2016). In this model, both the prior and the approximate posterior generate latent variables in the same order:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { c } { { p _ { \theta } ( z ) = p _ { \theta } ( z _ { 0 } ) p _ { \theta } ( z _ { 1 } | z _ { 0 } ) . . . p _ { \theta } ( z _ { N } | z _ { < N } ) } } \\ { { q _ { \phi } ( z | x ) = q _ { \phi } ( z _ { 0 } | x ) q _ { \phi } ( z _ { 1 } | z _ { 0 } , x ) . . . q _ { \phi } ( z _ { N } | z _ { < N } , x ) } } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
A diagram of this process appears in Figure 3. A typical implementation of this model has $\phi$ first perform a deterministic “bottom-up” pass on the data to generate features, then processes the groups of latent variables from top to bottom, using feedforward networks to generate features which are shared between the approximate posterior, prior, and reconstruction network $p _ { \theta } ( { \pmb x } | { \pmb z } )$ . We adopt this base architecture as it is simple, empirically effective, and has been postulated to resemble biological processes of perception (Dayan et al., 1995).
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 3: A diagram of our top-down VAE architecture. Residual blocks are similar to bottleneck ResNet blocks (He et al., 2016). Each convolution is preceded by the GELU nonlinearity (Hendrycks & Gimpel, 2016). $q _ { \phi } ( . )$ and $p _ { \theta } ( . )$ are diagonal Gaussian distributions. $\mathbf { z }$ is sampled from $\dot { q } _ { \phi } ( . )$ during training, and $p _ { \theta } ( . )$ when sampling. We use average pooling and nearest-neighbor upsampling for pool and unpool layers.
|
| 68 |
+
|
| 69 |
+
# 3 WHY DEPTH MATTERS FOR HIERARCHICAL VAES
|
| 70 |
+
|
| 71 |
+
We find that hierarchical VAEs with sufficient depth can not only learn arbitrary orderings over observed variables, but also learn more effective latent variable distributions, if such distributions exist. We present these results below.
|
| 72 |
+
|
| 73 |
+
Definition ( $N$ -layer VAE). A deep hierarchical VAE with $N$ stochastic layers, independent $p ( { \pmb x } | z )$ , and the top-down factorization of the prior and approximate posterior in Equations 2-3.
|
| 74 |
+
|
| 75 |
+
Proposition 1. N-layer VAEs generalize autoregressive models when N is the data dimension
|
| 76 |
+
|
| 77 |
+
Proposition 2. $N$ -layer VAEs are universal approximators of $N$ -dimensional latent densities
|
| 78 |
+
|
| 79 |
+
Proposition 1 (proof in Appendix, also visualized in Figure 2, left) leads to a possible explanation of why autoregressive models to date have outperformed VAEs: they are deeper, in the sense of statistical dependence. A VAE must be as deep as the data dimension $D$ (3072 layers in the case of $3 2 \mathrm { x } 3 2$ images) if the images truly require $D$ steps to generate.
|
| 80 |
+
|
| 81 |
+
Luckily, however, Proposition 2 (proof and further technical requirements in Appendix) suggests that shorter procedures, if they exist, are also learnable. $N = D$ is an extreme case, where the most effective latent variables $z \in \mathbb { R } ^ { D }$ may simply be copies of the observed variables. But if for some $K < D$ there exist latent variables $z \in \mathbb { R } ^ { K }$ that the generator can use to more efficiently compress the data, Proposition 2 states a $K$ -layer VAE can learn the posterior and prior distribution over those variables.
|
| 82 |
+
|
| 83 |
+
Such shorter generative paths could emerge in two ways. First, as depicted in Figure 2 (right), if the model discovers that certain variables are conditionally independent given others, the model can generate them in parallel inside a single layer, where $\begin{array} { r } { q _ { \phi } ( z _ { N } \vert z _ { < N } , \pmb { x } ) = \prod _ { d } q _ { \phi } ( z _ { N } ^ { ( d ) } \vert z _ { < N } , \pmb { x } ) } \end{array}$ . We hypothesize these efficient hierarchies should emerge in images, as they contain many spatially independent textures, and study this in Section 5.2. Second, the model could learn a low-dimensional representation of the data. Dai & Wipf (2019) recently showed that when a VAE is trained on data distributed on a $K$ -dimensional manifold embedded in $\mathbb { R } ^ { D }$ , a VAE will only activate $K$ dimensions in its latent space, meaning that the VAE will require fewer layers unless the manifold dimension is $D$ , which is unlikely to be the case for images.
|
| 84 |
+
|
| 85 |
+
It is difficult to ascertain the lowest possible value of $K$ for a given dataset, but it may be deeper than most hierarchical VAEs to date. Images have many thousands of observed variables, but early hierarchical VAEs did not exceed 3 layers, until Maaløe et al. (2019) investigated a Gaussian VAE with 15 layers and found it displayed impressive performance along a variety of measures. Kingma et al. (2016) and Vahdat & Kautz (2020) additionally explored networks up to 12 and 30 layers. (These additionally incorporated additional statistical dependencies in the approximate posterior through the usage of inverse autoregressive flow (Kingma et al., 2016), an alternative approach which we contrast with our approach in Section A.4). Nevertheless, given these results we hypothesize that greater depth may improve the performance of VAEs. In the next section, we introduce an architecture capable of scaling to a greater number of stochastic layers. In Section 5.1 we show depth indeed improves performance.
|
| 86 |
+
|
| 87 |
+
# 4 AN ARCHITECTURE FOR VERY DEEP VAES
|
| 88 |
+
|
| 89 |
+
We consider a “very deep” VAE to simply be one with greater depth than has previously been explored (and do not define it to be a specific number of layers). As existing implementations of VAEs did not support many more stochastic layers than they were trained on, we reimplemented a minimal VAE with the sole aim of increasing the number of stochastic layers. This VAE consists only of convolutions, nonlinearities, and Gaussian stochastic layers. It does not exhibit posterior collapse even for large numbers of stochastic layers. We describe key architectural choices here and refer readers to our source code for more details.
|
| 90 |
+
|
| 91 |
+
# 4.1 ARCHITECTURAL COMPONENTS AND INITIALIZATION
|
| 92 |
+
|
| 93 |
+
A diagram of our network appears in Figure 3. It resembles the ResNet VAE in Kingma et al. (2016), but with bottleneck residual blocks. For each stochastic layer, the prior and posterior are diagonal Gaussian distributions, as used in prior work (Maaløe et al., 2019).
|
| 94 |
+
|
| 95 |
+
As an alternative to weight normalization and data-dependent initialization (Salimans & Kingma, 2016), we adopt the default PyTorch weight intialization. The one exception is the final convolutional layer in each residual bottleneck block, which we scale by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ , where $_ \mathrm { N }$ is the depth (similar to Radford et al. (2019); Child et al. (2019); Zhang et al. (2019)). This residual scaling improves stability and performance with many layers, as we show in the Appendix (Table 3).
|
| 96 |
+
|
| 97 |
+
Additionally, we use nearest-neighbor upsampling for our “unpool” layer, which when paired with our ResNet architecture, allows us to completely remove the “free bits” and KL “warming up” terms that appear in related work. As we detail in the Appendix (Figure 5), when upsampling is done through transposed convolutional layer, the network may ignore layers at low resolution (for instance, 1x1 or 4x4 layers). We found no evidence of posterior collapse in any networks trained with nearest neighbor interpolation.
|
| 98 |
+
|
| 99 |
+
# 4.2 STABILIZING TRAINING WITH GRADIENT SKIPPING
|
| 100 |
+
|
| 101 |
+
VAEs have notorious “optimization difficulties,” which are not frequently discussed in the literature but nevertheless well-known by practitioners. These manifest as extremely high reconstruction or KL losses and corresponding large gradient norms (up to 1e15). We address this by skipping updates with a gradient norm above a certain threshold, set by hyperparameter. Though we select high thresholds that affect fewer than $0 . 0 1 \%$ of updates, this technique almost entirely eliminates divergence, and allows networks to train smoothly. We plot the evolution of grad norms and the values we select in (Figure 6). An alternative approach to stabilizing networks may be the spectral regularization method introduced in Vahdat & Kautz (2020).
|
| 102 |
+
|
| 103 |
+
Table 1: Loss by network with different configurations of stochastic layers on ImageNet-32 (similar trends appear on CIFAR-10). Left: Networks with equal number of layers, but with lower stochastic depth as described in Section 5.1. Increasing depth up to 48 layers still shows gains, which is farther than previous work has explored. Right: Networks with 48 layers, but distributed at different resolutions. We find higher resolutions benefit more from layers.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Depth</td><td>Params</td><td>Test Loss</td><td colspan="5">Distribution of 48 layers</td><td rowspan="2">Test Loss</td></tr><tr><td>3</td><td>41M</td><td>4.30</td><td>32x32</td><td>2 16x16</td><td>8x8</td><td>4x4</td><td>1x1</td></tr><tr><td>6</td><td>41M</td><td>4.18</td><td>10</td><td>10</td><td>10</td><td>10</td><td>8</td><td>3.98</td></tr><tr><td>12</td><td>41M</td><td>4.06</td><td>12</td><td>12</td><td>10</td><td>8</td><td>6</td><td>3.97</td></tr><tr><td>24</td><td>41M</td><td>3.98</td><td>14</td><td>14</td><td>10</td><td>6</td><td>4</td><td>3.96</td></tr><tr><td>48</td><td>41M</td><td>3.95</td><td>16</td><td>16</td><td>10</td><td>4</td><td>2</td><td>3.95</td></tr></table>
|
| 106 |
+
|
| 107 |
+
# 5 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
We trained very deep VAEs on challenging natural image datasets. All hyperparameters for experiments are available in the Appendix and in our source code.
|
| 110 |
+
|
| 111 |
+
# 5.1 STATISTICAL DEPTH, INDEPENDENT OF CAPACITY, IMPROVES PERFORMANCE
|
| 112 |
+
|
| 113 |
+
We first tested whether greater statistical depth, independent of other factors, can result in improved performance. We trained a network with 48 layers for 600k steps on ImageNet-32, grouping layers to output variables independently instead of conditioning on each other. If the input for the ith topdown block is $x _ { i }$ , we can make $K$ consecutive blocks independent by setting $x _ { i + 1 } , . . . , x _ { i + K }$ all equal to $x _ { i }$ . (Normally, $x _ { i + 1 } = x _ { i } + f ( \mathrm { b l o c k } ( x _ { i } ) ) )$ . This technique reduces the stochastic depth without affecting parameter count. Stochastic depth shows a clear correlation with performance, even up to 48 layers, which is past what previous work has explored (Table 1, left).
|
| 114 |
+
|
| 115 |
+
We then tested our hypothesis at scale. We trained networks on CIFAR-10, ImageNet-32, and ImageNet-64 with greater numbers of stochastic layers, but with fewer parameters than related work (see Table 2). On CIFAR-10, we trained a model with 45 stochastic layers and only 39M parameters, and found it achieved a test log-likelihood of 2.87 bits per dim (average of 4 seeds). On ImageNet32 and ImageNet-64, we trained networks with 78 and 75 stochastic layers and only approximately 120M parameters, and achieved likelihoods of 3.80 and 3.52.
|
| 116 |
+
|
| 117 |
+
On all tasks, these results outperform all GatedPixelCNN/PixelCNN $^ { + + }$ models, and all nonautoregressive models, while using similar or fewer parameters. These results support our hypothesis that stochastic depth, as opposed to other factors, explains the gap between VAEs and autoregressive models.
|
| 118 |
+
|
| 119 |
+
# 5.2 VERY DEEP VAES LEARN AN EFFICIENT HIERARCHICAL ORDERING
|
| 120 |
+
|
| 121 |
+
One question that emerges from the analysis in Section 3 is whether VAEs need to be as deep as autoregressive models, or whether they can learn a latent hierarchy of conditionally independent variables which are able to be synthesized in parallel. We qualitatively show this is true in Figure 4. For FFHQ-256 images, the first several layers at low resolution almost wholly determine the global features of the image, even though they only account for less than $1 \%$ of the latent variables. The rest of the high-resolution variables appear to be spatially independent, meaning they can be emitted in parallel in a number of layers much lower than the dimensionality of the image. This efficient hierarchical representation may underlie the VAE’s ability to achieve better log-likelihoods than the PixelCNN while simultaneously sampling thousands of times faster. This can be viewed as a learned parallel multiscale generation method, unlike the handcrafted approaches of Kolesnikov & Lampert (2017); Menick & Kalchbrenner (2018); Reed et al. (2017).
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 4: Cumulative percentage of latent variables at a given resolution, and reconstructions of samples on FFHQ-256. We sample latent variables from the approximate posterior until the given resolution, and sample the rest from the prior at low temperature. This shows what images are likely given a subset of latent variables. Low-resolution latents comprise a small fraction of the total latents, but encode significant portions of the global structure. This suggests deep VAEs learn efficient, hierarchical representations of the data.
|
| 125 |
+
|
| 126 |
+
Additionally, we found that on all datasets we tested, very deep VAEs used roughly $30 \%$ fewer parameters than the PixelCNN (Table 2). One possible explanation is that the learned hierarchical generation procedure involves fewer long-range dependencies, or may otherwise be simpler to learn.
|
| 127 |
+
|
| 128 |
+
We found that networks in general benefited from more layers at higher resolutions (Table 1, right). This suggests that global features may account for a smaller fraction of information than local details and textures, and that it is important to have many latent variables at high resolution.
|
| 129 |
+
|
| 130 |
+
# 5.2.1 VERY DEEP VAES ARE EASILY SCALED TO HIGH DIMENSIONAL DATA
|
| 131 |
+
|
| 132 |
+
Scaling autoregressive models to higher resolutions presents several challenges. First, the sampling time and memory requirements of autoregressive models increase linearly with resolution. This scaling makes datasets like FFHQ-256 and FFHQ-1024 intractable for naive approaches. Although clever factorization techniques have been adopted for $2 5 6 \mathrm { x } 2 5 6$ images (Menick & Kalchbrenner, 2018), such factorizations may not be as effective for alternate datasets or higher-resolution images.
|
| 133 |
+
|
| 134 |
+
Our VAE, in contrast, readily scales to higher resolutions. The same network used for $3 2 \mathrm { x } 3 2 $ images can be applied to 1024x1024 images by introducing a greater number of upsampling layers throughout the network. We found we could train an equal number of steps (1.5M) using a similar number of training resources (32 GPUs for 2.5 weeks) on both $3 2 \mathrm { x } 3 2 $ and 1024x1024 images with few hyperparameter changes (see Appendix for hyperparameters). Samples from both models (displayed in Appendix) require a single forward pass of the model to generate, with only minor differences in runtime. An autoregressive model, on the other hand, would require a thousand times more network evaluations to sample 1024x1024 images and likely require a custom training procedure.
|
| 135 |
+
|
| 136 |
+
# 6 RELATED WORK AND DISCUSSION
|
| 137 |
+
|
| 138 |
+
Our work is inspired by previous and concurrent work in hierarchical VAEs (Sønderby et al., 2016; Maaløe et al., 2019; Vahdat & Kautz, 2020). Relative to these works, we provide some justification for why deeper networks may perform better, introduce a new architecture, and empirically demonstrate gains in log-likelihood. Many aspects of prior work are complementary with ours and could be combined. Maaløe et al. (2019), for instance, incorporates a “bottom-up” stochastic path that doubles the depth of the approximate posterior, and Vahdat & Kautz (2020) introduces a number of powerful architecture components and improved training techniques. We seek here not to introduce a significantly better method than these alternatives, but to demonstrate that depth is a key overlooked factor in most prior approaches to VAEs.
|
| 139 |
+
|
| 140 |
+
Table 2: Our main results on standard benchmark datasets. Very deep VAEs outperform PixelCNN-based autoregressive models with fewer parameters while maintaining fast sampling. “Depth” refers to the number of stochastic layers for hierarchical VAEs (although BIVA and IAFbased networks have additional statistical dependencies). Sampling refers to the number of network evaluations per sample, and $D$ designates the dimensionality of the data. An asterisk $( ^ { * } )$ denotes our estimate of parameters. Samples for ImageNet and CIFAR-10 are in the Appendix.
|
| 141 |
+
|
| 142 |
+
<table><tr><td></td><td>Model type</td><td>Params</td><td>Depth</td><td>Sampling</td><td>NLL</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CIFAR-10 PixelCNN++ (Salimans et al., 2017)</td><td>AR</td><td>53M*</td><td></td><td>D</td><td>2.92</td></tr><tr><td>PixelSNAIL (Chen et al., 2017)</td><td>AR</td><td></td><td></td><td>D</td><td>2.85</td></tr><tr><td>Sparse Transformer (Child et al.,2019)</td><td>AR</td><td>59M</td><td></td><td>D</td><td>2.80</td></tr><tr><td></td><td>VAE</td><td></td><td></td><td></td><td></td></tr><tr><td>VLAE (Chen et al., 2016)</td><td>VAE</td><td></td><td>12</td><td>D</td><td>≤2.95</td></tr><tr><td>IAF-VAE (Kingma et al., 2016) Flow++ (Ho et al.,2019)</td><td>Flow</td><td>31M</td><td></td><td>1</td><td>≤3.11</td></tr><tr><td>BIVA (Maalpe et al.,2019)</td><td>VAE</td><td>103M</td><td>15</td><td>1</td><td>≤3.08</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.08</td></tr><tr><td>NVAE (Vahdat & Kautz, 2020) Very Deep VAE (ours)</td><td>VAE VAE</td><td>131M 39M</td><td>30 45</td><td>1 1</td><td>≤ 2.91 ≤ 2.87</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-32 Gated PixelCNN</td><td>AR</td><td>177M*</td><td>10</td><td></td><td></td></tr><tr><td>Image Transformer (Parmar et al., 2018)</td><td>AR</td><td></td><td></td><td>D</td><td>3.83</td></tr><tr><td>BIVA</td><td>VAE</td><td>103M*</td><td>15</td><td>D</td><td>3.77</td></tr><tr><td>NVAE</td><td></td><td>268M</td><td>28</td><td>1</td><td>≤3.96</td></tr><tr><td>Flow++</td><td>VAE</td><td>169M</td><td></td><td>1</td><td>≤3.92</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>119M</td><td>78</td><td>1 1</td><td>≤3.86 ≤3.80</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-64 Gated PixelCNN</td><td></td><td>177M*</td><td></td><td></td><td></td></tr><tr><td>SPN (Menick & Kalchbrenner, 2018)</td><td>AR AR</td><td>150M</td><td></td><td>D</td><td>3.57</td></tr><tr><td>Sparse Transformer</td><td>AR</td><td>152M</td><td></td><td>D</td><td>3.52</td></tr><tr><td>Glow (Kingma & Dhariwal, 2018)</td><td>Flow</td><td></td><td></td><td>D</td><td>3.44</td></tr><tr><td>Flow++</td><td></td><td>73M</td><td></td><td>1</td><td>3.81</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>125M</td><td>75</td><td>1</td><td>≤3.69</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.52</td></tr><tr><td>FFHQ-256 (5 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>NVAE</td><td>VAE</td><td></td><td>36</td><td>1</td><td>≤0.68</td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>62</td><td>1</td><td>≤0.61</td></tr><tr><td>FFHQ-1024 (8 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>72</td><td>1</td><td>≤ 2.42</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Diffusion models can be seen as deep VAEs that, like autoregressive models, have a specific analytical posterior. Ho et al. (2020) showed that such models achieve impressive sample quality with great depth, which is in line with our observations that greater depth is helpful for VAEs. One benefit of the VAEs we outline in this work over diffusion models is that our VAEs generate samples with a single network evaluation, whereas diffusion models currently require a large number of network evaluations per sample.
|
| 145 |
+
|
| 146 |
+
Inverse autoregressive flows (IAF) are also closely related, and we discuss the differences with hierarchical models in Section A.4. The work of Zhao et al. (2017) may also appear to contradict our findings, and we discuss that work in Section A.5.
|
| 147 |
+
|
| 148 |
+
# 7 CONCLUSION
|
| 149 |
+
|
| 150 |
+
We argue deeper VAEs should perform better, introduce a deeper architecture, and show it outperforms all PixelCNN-based autoregressive models in likelihood while being more efficient. We hope this encourages work in further improving VAEs and latent variable models.
|
| 151 |
+
|
| 152 |
+
# ACKNOWLEDGMENTS
|
| 153 |
+
|
| 154 |
+
We thank Aditya Ramesh, Pranav Shyam, Johannes Otterbach, Heewoo Jun, Mark Chen, Prafulla Dhariwal, Alec Radford, Yura Burda, Bowen Baker, Raul Puri, and Ilya Sutskever for helpful discussions. We also thank the anonymous reviewers for helping improve our work.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 159 |
+
|
| 160 |
+
Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 161 |
+
|
| 162 |
+
Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016.
|
| 163 |
+
|
| 164 |
+
Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. arXiv preprint arXiv:1712.09763, 2017.
|
| 165 |
+
|
| 166 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 167 |
+
|
| 168 |
+
Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019.
|
| 169 |
+
|
| 170 |
+
Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995.
|
| 171 |
+
|
| 172 |
+
Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
|
| 173 |
+
|
| 174 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 175 |
+
|
| 176 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
|
| 177 |
+
|
| 178 |
+
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
|
| 179 |
+
|
| 180 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 181 |
+
|
| 182 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 183 |
+
|
| 184 |
+
Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019.
|
| 185 |
+
|
| 186 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arxiv:2006.11239, 2020.
|
| 187 |
+
|
| 188 |
+
Chin-Wei Huang, Ahmed Touati, Laurent Dinh, Michal Drozdzal, Mohammad Havaei, Laurent Charlin, and Aaron Courville. Learnable explicit density for continuous latent space and variational inference. arXiv preprint arXiv:1710.02248, 2017.
|
| 189 |
+
|
| 190 |
+
Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018.
|
| 191 |
+
|
| 192 |
+
Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, volume 19, 2014.
|
| 193 |
+
|
| 194 |
+
Diederik P Kingma and Max Welling. An introduction to variational autoencoders. arXiv preprint arXiv:1906.02691, 2019.
|
| 195 |
+
|
| 196 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
|
| 197 |
+
|
| 198 |
+
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
|
| 199 |
+
|
| 200 |
+
Alexander Kolesnikov and Christoph H Lampert. Pixelcnn models with auxiliary variables for natural image modeling. In International Conference on Machine Learning, pp. 1905–1914. PMLR, 2017.
|
| 201 |
+
|
| 202 |
+
Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of ´ latent variables for generative modeling. In Advances in neural information processing systems, pp. 6548–6558, 2019.
|
| 203 |
+
|
| 204 |
+
Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018.
|
| 205 |
+
|
| 206 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 207 |
+
|
| 208 |
+
George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762, 2019.
|
| 209 |
+
|
| 210 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 211 |
+
|
| 212 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
|
| 213 |
+
|
| 214 |
+
Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio G ¨ omez Colmenarejo, Ziyu Wang, Dan ´ Belov, and Nando De Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017.
|
| 215 |
+
|
| 216 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 217 |
+
|
| 218 |
+
Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in neural information processing systems, pp. 901– 909, 2016.
|
| 219 |
+
|
| 220 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
|
| 221 |
+
|
| 222 |
+
Table 3: Effects of scaling residual initialization on very deep VAEs. We trained networks with varying depths for $8 0 \mathrm { k }$ iterations. Scaling the last layer in the residual block by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ results in higher losses for shallower networks, but lower losses and greater stability for deeper networks. The number of updates which are skipped because the gradient norm would destabilize the network is significantly reduced with scaling.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Depth</td><td>Without scaling Loss</td><td>Skipped Updates</td><td>With scaling Loss</td><td>Skipped Updates</td></tr><tr><td>15</td><td>2.50</td><td>13</td><td>2.51</td><td>0</td></tr><tr><td>30</td><td>2.36</td><td>41</td><td>2.38</td><td>1</td></tr><tr><td>45</td><td>2.31</td><td>48</td><td>2.30</td><td>0</td></tr><tr><td>60</td><td>2.30</td><td>76</td><td>2.29</td><td>1</td></tr><tr><td>75</td><td>Diverged</td><td>1</td><td>2.28</td><td>0</td></tr></table>
|
| 225 |
+
|
| 226 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016.
|
| 227 |
+
|
| 228 |
+
Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
|
| 229 |
+
|
| 230 |
+
Benigno Uria, Iain Murray, and Hugo Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pp. 2175–2183, 2013.
|
| 231 |
+
|
| 232 |
+
Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. arXiv preprint arXiv:2007.03898, 2020.
|
| 233 |
+
|
| 234 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
|
| 235 |
+
|
| 236 |
+
Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. arXiv preprint arXiv:1901.09321, 2019.
|
| 237 |
+
|
| 238 |
+
Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017.
|
| 239 |
+
|
| 240 |
+
# A APPENDIX
|
| 241 |
+
|
| 242 |
+
# A.1 ABLATIONS OF ARCHITECTURAL COMPONENTS
|
| 243 |
+
|
| 244 |
+
First, we visualize data that suggests upsampling layers and residual connections have an impact on posterior collapse (Figure 5). Architectural differences may explain why our VAEs do not need “free bits” or KL warmups to avoid posterior collapse.
|
| 245 |
+
|
| 246 |
+
In Table 3, we show residual initialization leads to smoother and better training of very deep VAEs. Without residual initialization, very deep VAEs encounter a high number of unstable updates and have higher losses.
|
| 247 |
+
|
| 248 |
+
In Figure 6, we show the max gradient norms experienced throughout training, and show that our skipping criterion avoids a small number of updates that would destabilize the network.
|
| 249 |
+
|
| 250 |
+
A.2 PROPOSITION 1: N-LAYER VAES GENERALIZE AUTOREGRESSIVE MODELS WHEN N IS THE DATA DIMENSION
|
| 251 |
+
|
| 252 |
+
Proposition 1 shows that an autoregressive model with an arbitrary ordering over observed variables in $\dot { \boldsymbol { x } } \in \mathbb { R } ^ { N }$ is equivalent to an $N$ -layer VAE with an approximate posterior that simply outputs the observed variables in the given order, and a generator that performs the identity function (see Figure 2).
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 5: Relationship between architecture and posterior collapse. We visualize the cumulative KL divergence (or “rate”, in bits per dimension) for several different architectures across a 73 layer network on ImageNet-32. When residual connections are removed from the “res block” in the topdown path (Figure 3), the model encodes no information in the first 45 layers of the network and the loss is highest (”FFN”). When a learned convolutional upsampler is used as the “unpool” layer, the first 13 layers of the network encode no information. When nearest-neighbor upsampling is used, the first layers all encode information, and the loss is the lowest.
|
| 256 |
+
|
| 257 |
+
Without loss of generality, we simplify notation by assuming each vector-valued latent variable $z _ { i }$ only has one element, which we write as $z _ { i } \in \mathbb { R }$ . We assume a prior and approximate posterior distribution following Equation 2 and 3.
|
| 258 |
+
|
| 259 |
+
Proof. Let $q ( z _ { i } ~ = ~ x _ { i } | \boldsymbol { z } _ { < i } , \pmb { x } ) ~ = ~ 1$ , and $p ( x _ { i } ~ = ~ z _ { i } | z ) ~ = ~ 1$ . Then $p ( z | \mathbf { x } ) ~ = ~ q ( z | \mathbf { x } ) .$ , which is well-known to imply equality in the evidence lower bound (ELBO) of Eq. 1. Since $\log q ( z | \pmb { x } ) = \log p ( \pmb { x } | z ) = 0$ , the ELBO becomes $\begin{array} { r } { \log p _ { \theta } ( { \pmb x } ) = \log p _ { \theta } ( { \pmb z } ) = \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( z _ { i } | z _ { < i } ) = } \end{array}$ $\textstyle \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( x _ { i } | \boldsymbol { x } _ { < i } )$ , which is equivalent to an autoregressive model over the observed variables. □
|
| 260 |
+
|
| 261 |
+
# A.3 PROPOSITION 2: $N$ -LAYER VAES ARE UNIVERSAL APPROXIMATORS OF $N$ -DIMENSIONAL LATENT DENSITIES
|
| 262 |
+
|
| 263 |
+
Proposition 2 shows that hierarchical VAEs learn depthwise autoregressive flows, and under certain conditions (described in Huang et al. (2017)) can express any density over latent variables of $N$ dimensions, given enough capacity.
|
| 264 |
+
|
| 265 |
+
Proof. We omit full proof, and refer readers to Huang et al. (2017); Papamakarios et al. (2019), where universality is established for autoregressive flows. Here we only note that the prior and approximate posterior in an $N$ -layer VAE are autoregressive flows: Let $p _ { \theta } ( z )$ be the prior distribution. $p _ { \theta } ( z )$ can be written using the reparameterization trick as a deterministic function of noise $\epsilon$ drawn from a known base density $p _ { N }$ $\begin{array} { r } { \mathrm { : ~ } p _ { \theta } ( z ) = p _ { N } ( \epsilon ) \left| \operatorname* { d e t } \frac { \partial f ( \epsilon , \theta ) } { \partial \epsilon } \right| } \end{array}$ where $f$ is a neural network that implements the factorization in Eq. 2. Since $f$ is autoregressive and its Jacobian is lower triangular, $p _ { \theta } ( z )$ can approximate any $p ( z )$ that fits the criteria in Huang et al. (2017). The same logic applies to $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p ( \boldsymbol { z } | \boldsymbol { x } )$ . It should be noted that this result depends on $f$ being able to implement the inverse CDF of an arbitrary probability density, and so using Gaussian distributions will restrict the densities the VAE can express in practice. This is a limitation of our architecture that we nevertheless adopt since we hypothesize depth, not the elementwise density, is the more important factor. More discussion on this subject, and options for removing this restriction, are described in Huang et al. (2017) and Huang et al. (2018), and we defer studying more expressive elementwise densities to future work. □
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 6: Effect of gradient skipping. We plot the max gradient norm encountered per 500 updates for our best models across datasets. The dashed black line indicates the “skip threshold”, or value above which the update is skipped. We choose a high threshold that affects fewer than 0.01 percent of training updates. Without this skip heuristic, networks will diverge when extreme updates are encountered. These updates can have norm as high as 1e15.
|
| 269 |
+
|
| 270 |
+
# A.4 A NOTE ON INVERSE AUTOREGRESSIVE FLOW
|
| 271 |
+
|
| 272 |
+
Inverse autoregressive flows (IAF, Kingma et al. (2016)) and are similar to very deep VAEs in that they are universal approximators of posterior distributions in VAEs, even with just a single layer and sufficiently expressive univariate density (Huang et al., 2018).
|
| 273 |
+
|
| 274 |
+
There are several practical differences between IAFs and deep hierarchical VAEs, however, which can result in qualitatively very different behavior. First, the masked autoregressive components in IAF build statistical dependencies spatially, whereas a very deep hierarchical VAE builds dependencies depthwise, and these inductive biases may better suit different domains. Additionally, IAFs spend an equal amount of computation and parameters on each variable. In contrast, a deep VAE can specify a structure, like a hierarchy of global-to-local variables, which have different computational and modeling capacities for each stage. For images, these differences may result in qualitatively different behavior, and it is not clear whether a single layer IAF can readily learn the sort of rich hierarchical decomposition of images that appear with very deep VAEs.
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 7: Non-cherrypicked, temperature 1.0 samples on FFHQ-256. Cover images were each cherrypicked from a batch of 16 (unadjusted temperature) samples. Here we show a random batch of 16 images for comparison.
|
| 278 |
+
|
| 279 |
+
Nevertheless, the two techniques are complementary – IAF was introduced in a deep hierarchical VAE (Kingma et al., 2016), in fact, and it is likely that introducing IAF into our architecture (as in Vahdat & Kautz (2020)) would improve performance.
|
| 280 |
+
|
| 281 |
+
# A.5 A NOTE ON LEARNING HIERARCHICAL FEATURES
|
| 282 |
+
|
| 283 |
+
The work of Zhao et al. (2017) may appear to contradict our work, by suggesting that additional layers in hierarchical VAEs do not lead to additional expressivity, based off their finding that Gibbs sampling from the last stochastic layer is sufficient to recover the data. For high dimensional data like images, however, the last stochastic layer may have many thousands of variables, and Gibbs sampling may take unacceptably long to converge. A hierarchy of latent variables as in our model allows efficient and tractable sampling from this distribution. Additionally, assumptions regarding global maximization of the ELBO may not apply in practice. Nevertheless, we think further clarifying these contradictory statements would be useful future work.
|
| 284 |
+
|
| 285 |
+
# A.6 BROADER IMPACT
|
| 286 |
+
|
| 287 |
+
Broadly speaking, any generative model will reflect the biases of the datasets they are trained on. If deployed without careful consideration, generative models (including but not limited to VAEs) trained on research datasets like ImageNet, CIFAR-10, and FFHQ may inadvertently cause harm by propagating or otherwise reinforcing harmful biases in the dataset. Further work is required to improve and debias research benchmark datasets to mitigate this source of negative impact.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 8: Non-cherrypicked, temperature 0.85 samples on FFHQ-256. Lower temperature samples result in greater regularity in images.
|
| 291 |
+
|
| 292 |
+
Some VAEs are distinguished from other generative models by their fast synthesis of new data examples. Generative models with fast synthesis can allow for realtime synthesis of high dimensional data, such as music, speech, and video. These models could be used to augment human creativity and lead to a number of helpful applications in real-time media applications. Such models could also be used for compression, which could assist in delivering content to bandwidth-constrained regions of the world. They can also be used for spreading disinformation, generally making it less possible to distinguish real from generated data. An additional potential harm is that fast, high quality synthesis of data could end up economically displacing individuals who rely upon creative work, such as musicians, visual artists, and more.
|
| 293 |
+
|
| 294 |
+
VAEs also are distinguished by their usage of latent variables. Generative models with useful latent variables could have positive impacts in scientific domains, where density estimation could lead to novel insights about chemical, physical, or biological data. Latent variable representations of data could also be helpful in efforts to debias, interpret, or otherwise increase understandibility of models and their representations.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 9: Non-cherrypicked, temperature 0.60 samples on FFHQ-256. We visualize temperature 0.60 samples for comparison with Vahdat & Kautz (2020)
|
| 298 |
+
|
| 299 |
+
Table 4: Key hyperparameters for experiments. We detail here the main hyperparameters used in training. FFHQ-1024 has reduced hidden size for higher resolutions; see code for details.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>Parameter</td><td>CIFAR-10</td><td>ImageNet-32</td><td>ImageNet-64</td><td>FFHQ-256</td><td>FFHQ-1024</td></tr><tr><td>Num layers</td><td>45</td><td>78</td><td>75</td><td>62</td><td>72</td></tr><tr><td>Hidden size</td><td>384</td><td>512</td><td>512</td><td>512</td><td>Varies</td></tr><tr><td>Bottleneck size</td><td>96</td><td>128</td><td>128</td><td>128</td><td>Varies</td></tr><tr><td>Latent dim per layer</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td></tr><tr><td>Batch size</td><td>32</td><td>256</td><td>128</td><td>32</td><td>32</td></tr><tr><td>Learning rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00007</td></tr><tr><td>Optimizer</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td></tr><tr><td>Skip threshold</td><td>400</td><td>300</td><td>380</td><td>180</td><td>500</td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td></tr><tr><td>EMA rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00015</td></tr><tr><td>Training iterations</td><td>1.1M</td><td>1.7M</td><td>1.6M</td><td>1.7M</td><td>1.7M</td></tr><tr><td>GPUs</td><td>2 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td></tr><tr><td>Training time</td><td>6 days</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td></tr><tr><td>Parameters</td><td>39M</td><td>119M</td><td>125M</td><td>115M</td><td>115M</td></tr></table>
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10: ImageNet-32 (left) and ImageNet-64 (right) reconstructions and samples. Reconstructions of validation images from various stages in the latent hierarchy (top), and unconditional samples from the model at temperature 1.0 (bottom).
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 11: FFHQ-1024 samples. These are generated with reduced temperature (top) and temperature 1.0 (bottom). The model we train has similar capacity to smaller ones we use on $3 2 \mathrm { x } 3 2 $ , 64x64, and $2 5 6 \times 2 5 6$ images, and so fails to capture the intricacies of this more complex distribution well. A larger model, trained for longer, may achieve better sample quality.
|
md/train/S1MB-3RcF7/S1MB-3RcF7.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-OBJECTIVE TRAINING OF GENERATIVE ADVERSARIAL NETWORKS WITH MULTIPLE DISCRIMINATORS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent literature has demonstrated promising results on the training of Generative Adversarial Networks by employing a set of discriminators, as opposed to the traditional game involving one generator against a single adversary. Those methods perform single-objective optimization on some simple consolidation of the losses, e.g. an average. In this work, we revisit the multiple-discriminator approach by framing the simultaneous minimization of losses provided by different models as a multi-objective optimization problem. Specifically, we evaluate the performance of multiple gradient descent and the hypervolume maximization algorithm on a number of different datasets. Moreover, we argue that the previously proposed methods and hypervolume maximization can all be seen as variations of multiple gradient descent in which the update direction computation can be done efficiently. Our results indicate that hypervolume maximization presents a better compromise between sample quality and diversity, and computational cost than previous methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) offer a new approach to generative modeling, using game-theoretic training schemes to implicitly learn a given probability density. Prior to the emergence of GAN architectures, realistic generative modeling remained elusive. When offering unparalleled realism, GAN training remains fraught with stability issues. Commonly reported shortcomings involved in the GAN game are the lack of useful gradients provided by the discriminator, and mode collapse, i.e. lack of diversity in the generator’s samples.
|
| 12 |
+
|
| 13 |
+
Considerable research effort has been devoted in recent literature in order to overcome training instability 1 within the GAN framework. Some architectures such as BEGAN (Berthelot et al., 2017) have applied auto-encoders as discriminators and proposed a new loss to help stabilize training. Methods such as TTUR (Heusel et al., 2017), in turn, have attempted to define schedules for updating the generator and discriminator differently. The PacGAN algorithm (Lin et al., 2017) proposes to modify the discriminator’s architecture which will receive m concatenated samples as input, while modifications to alternate updates in SGD were introduced in (Yadav et al., 2017). These samples are jointly classified as either real or generated, and authors show that this enforces sample diversity. In SNGAN (Miyato et al., 2018), authors introduce spectral normalization on the discriminator aiming to ensure Lipschitz continuity, which is empirically shown to consistently yield high quality samples when different sets of hyperparameters are used.
|
| 14 |
+
|
| 15 |
+
Recent works have proposed to tackle GANs instability issues using multiple discriminators. Neyshabur et al. (2017) propose a GAN variation in which one generator is trained against a set of discriminators, where each discriminator sees a fixed random projection of the inputs. Prior work, including GMAN (Durugkar et al., 2016) has also explored training against multiple discriminators.
|
| 16 |
+
|
| 17 |
+
In this paper, we build upon Neyshabur et al.’s introduced framework and propose reformulating the average loss minimization aiming to further stabilize GAN training. Specifically, we propose treating the loss signal provided by each discriminator as an independent objective function. To achieve this, we simultaneously minimize the losses using multi-objective optimization techniques. Namely, we exploit previously introduced methods in literature such as the multiple gradient descent algorithm (MGD) (Désidéri, 2012). However, due to MGD’s prohibitively high cost in the case of large neural networks, we propose the use of more efficient alternatives such as maximization of the hypervolume of the region defined between a fixed, shared upper bound on those losses, which we will refer to as the nadir point $\eta ^ { * }$ , and each of the component losses.
|
| 18 |
+
|
| 19 |
+
In contrast to Neyshabur et al. (2017)’s approach, where the average loss is minimized when training the generator, hypervolume maximization (HV) optimizes a weighted loss, and the generator’s training will adaptively assign greater importance to feedback from discriminators against which it performs poorly.
|
| 20 |
+
|
| 21 |
+
Experiments performed on MNIST show that HV presents a good compromise in the computational cost-samples quality trade-off, when compared to average loss minimization or GMAN’s approach (low quality and cost), and MGD (high quality and cost). Also, the sensitivity to introduced hyperparameters is studied and results indicate that increasing the number of discriminators consequently increases the generator’s robustness along with sample quality and diversity. Experiments on CIFAR10 indicate the method described produces higher quality generator samples in terms of quantitative evaluation. Moreover, image quality and sample diversity are once more shown to consistently improve as we increase the number of discriminators.
|
| 22 |
+
|
| 23 |
+
In summary, our main contributions are the following:
|
| 24 |
+
|
| 25 |
+
1. We offer a new perspective on multiple-discriminator GAN training by framing it in the context of multi-objective optimization, and draw similarities between previous research in GANs variations and MGD, commonly employed as a general solver for multi-objective optimization.
|
| 26 |
+
2. We propose a new method for training multiple-discriminator GANs: Hypervolume maximization, which weighs the gradient contributions of each discriminator by its loss.
|
| 27 |
+
|
| 28 |
+
The remainder of this document is organized as follows: Section 2 introduces definitions on multiobjective optimization and MGD. In Section 3 we describe prior relevant literature. Hypervolume maximization is detailed in Section 4, with experiments and results presented in Section 5. Conclusions and directions for future work are drawn in Section 6.
|
| 29 |
+
|
| 30 |
+
# 2 PRELIMINARIES
|
| 31 |
+
|
| 32 |
+
In this section we provide some definitions regarding multi-objective optimization literature which will be useful in the next sections. Henceforth, the boldface notation will be used to indicate vector-valued variables.
|
| 33 |
+
|
| 34 |
+
Multi-objective optimization. A multi-objective optimization problem is defined as (Deb, 2001):
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\begin{array} { r l } & { \operatorname* { m i n } \mathbf { F } ( \mathbf { x } ) = [ f _ { 1 } ( \mathbf { x } ) , f _ { 2 } ( \mathbf { x } ) , . . . , f _ { K } ( \mathbf { x } ) ] ^ { T } , } \\ & { \quad \quad \quad \mathbf { x } \in \Omega , } \end{array}
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where $K$ is the number of objectives, $\Omega$ is the variables space and $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , . . . , x _ { n } ] ^ { T } \in \Omega$ is a decision vector or possible solution to the problem. $\mathbf { F } : \Omega \stackrel { * } { \to } \mathbb { R } ^ { K }$ is a set of $K$ -objective functions that maps the $n$ -dimensional variables space to the $K$ -dimensional objective space.
|
| 41 |
+
|
| 42 |
+
Pareto-dominance. Let $\mathbf { X } _ { 1 }$ and $\mathbf { X } _ { 2 }$ be two decision vectors. $\mathbf { X } _ { 1 }$ is said to dominate $\mathbf { X } _ { 2 }$ (denoted by $\mathbf { x } _ { 1 } \prec \mathbf { x } _ { 2 } )$ if and only if $f _ { i } ( \mathbf { x } _ { 1 } ) \leq f _ { i } ( \mathbf { x } _ { 2 } )$ for all $i \in \{ 1 , 2 , \ldots , K \}$ and $f _ { j } ( \mathbf { x } _ { 1 } ) < f _ { j } ( \mathbf { x } _ { 2 } )$ for some $j \in \{ 1 , 2 , \dots , K \}$ . If a decision vector $\mathbf { X }$ is dominated by no other vector in $\Omega$ , $\mathbf { X }$ is said to be non-dominated.
|
| 43 |
+
|
| 44 |
+
Pareto-optimality. A decision vector $\mathbf { x } ^ { * } \in \Omega$ is said to be Pareto-optimal if and only if there is no $\mathbf { x } \in \Omega$ such that $\mathbf { X } \prec \mathbf { X } ^ { * }$ , i.e. $\mathbf { x } ^ { * }$ is a non-dominated solution. The Pareto-optimal Set (PS) is defined as the set of all Pareto-optimal solutions $\mathbf { x } \in \Omega$ , i.e., $P S = \{ \mathbf { x } \in \Omega | \mathbf { x }$ is Pareto optimal}. The set of all objective vectors $\mathbf { F } ( \mathbf { x } )$ such that $\mathbf { X }$ is Pareto-optimal is called Pareto front (PF), that is $P F = \{ \mathbf { F } ( \mathbf { x } ) \in \mathbf { \bar { \mathbb { R } } } ^ { K } | \mathbf { x } \in P S \}$ .
|
| 45 |
+
|
| 46 |
+
Pareto-stationarity. Pareto-stationarity is a necessary condition for Pareto-optimality. For $f _ { k }$ differentiable everywhere for all $k$ , $\mathbf { F }$ is said to be Pareto-stationary at the point $\mathbf { X }$ if there exists a set of scalars $\alpha _ { k } , k \in \{ 1 , \ldots , K \}$ , such that:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla f _ { k } = \mathbf { 0 } , \quad \sum _ { k = 1 } ^ { K } \alpha _ { k } = 1 , \quad \alpha _ { k } \geq 0 \quad \forall k .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Multiple Gradient Descent. Multiple gradient descent (Désidéri, 2012; Schäffler et al., 2002; Peitz & Dellnitz, 2018) was proposed for the unconstrained case of multi-objective optimization of $\mathbf { F } ( \mathbf { x } )$ assuming a convex, continuously differentiable and smooth $f _ { k } ( { \bf x } )$ for all $k$ . MGD finds a common descent direction for all $f _ { k }$ by defining the convex hull of all $\nabla f _ { k } ( { \mathbf { x } } )$ and finding the minimum norm element within it. Consider $\mathbf { w } ^ { * }$ given by:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathbf { w } ^ { * } = \mathrm { a r g m i n } | | \mathbf { w } | | , \quad \mathbf { w } = \sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla f _ { k } ( \mathbf { x } ) , \quad \mathrm { s . t . } \quad \sum _ { k = 1 } ^ { K } \alpha _ { k } = 1 , \quad \alpha _ { k } \geq 0 \quad \forall k .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
$\mathbf { w } ^ { * }$ will be either 0 in which case $\mathbf { X }$ is a Pareto-stationary point, or $\mathbf { w } ^ { * } \neq \mathbf { 0 }$ and then $\mathbf { w } ^ { * }$ is a descent direction for all $f _ { i } ( \mathbf { x } )$ . Similar to gradient descent, MGD consists in finding the common steepest descent direction $\mathbf { w } _ { t } ^ { * }$ at each iteration $t$ , and then updating parameters with a learning rate $\lambda$ according to $\begin{array} { r } { \mathbf { x } _ { t + 1 } = \mathbf { x } _ { t } - \lambda \frac { \mathbf { w } _ { t } ^ { * } } { | | \mathbf { w } _ { t } ^ { * } | | } } \end{array}$ .
|
| 59 |
+
|
| 60 |
+
# 3 RELATED WORK
|
| 61 |
+
|
| 62 |
+
# 3.1 TRAINING GANS WITH MULTIPLE DISCRIMINATORS
|
| 63 |
+
|
| 64 |
+
While we would prefer to always have strong gradients from the discriminator during training, the vanilla GAN makes this difficult to ensure, as the discriminator quickly learns to distinguish real and generated samples (Goodfellow, 2016), thus providing no meaningful error signal to improve the generator thereafter. Durugkar et al. (2016) proposed the Generative Multi-Adversarial Networks (GMAN) which consist in training the generator against a softmax weighted arithmetic average of $K$ different discriminators, according to Eq. 4.
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathcal { L } _ { G } = \sum _ { k = 1 } ^ { K } \alpha _ { k } \mathcal { L } _ { D _ { k } } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\begin{array} { r } { \alpha _ { k } = \frac { e ^ { \beta \mathcal { L } _ { D _ { k } } } } { \sum _ { j = 1 } ^ { K } e ^ { \beta \mathcal { L } _ { D _ { j } } } } , \beta \ge 0 } \end{array}$ , and $\mathcal { L } _ { D _ { k } }$ is the loss of discriminator $k$ and defined as
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathcal { L } _ { D _ { k } } = - \mathbb { E } _ { { \mathbf { x } } \sim p _ { \mathrm { d a t a } } } \log D _ { k } ( { \mathbf { x } } ) - \mathbb { E } _ { { \mathbf { z } } \sim p _ { z } } \log ( 1 - D _ { k } ( G ( { \mathbf { z } } ) ) ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $D _ { k } ( { \mathbf x } )$ and $G ( \mathbf { z } )$ are the outputs of the $k$ -th discriminator and the generator, respectively. The goal of using the proposed averaging scheme is to privilege worse discriminators and thus providing more useful gradients to the generator during training. Experiments were performed with $\beta = 0$ (equal weights), $\beta \to \infty$ (only worst discriminator is taken into account), $\beta = 1$ , and $\beta$ learned by the generator. Models with $K = \{ 2 , 5 \}$ were tested and evaluated using a proposed metric and the Inception score (Salimans et al., 2016). However, results showed that the simple average of discriminator’s losses provided the best values for both metrics in most of the considered cases.
|
| 77 |
+
|
| 78 |
+
Opposed to GMAN, Neyshabur et al. (2017) proposed training a GAN with $K$ discriminators using the same architecture. Each discriminator $D _ { k }$ sees a different randomly projected lower-dimensional version of the input image. Random projections are defined by a randomly initialized matrix $W _ { k }$ , which remains fixed during training. Theoretical results provided show that the distribution induced by the generator $G$ will converge to the real data distribution $p _ { \mathrm { d a t a } }$ , as long as there is a sufficient number of discriminators. Moreover, discriminative tasks in the projected space are harder, i.e. real and fake samples are more alike, thus avoiding early convergence of discriminators, which leads to common stability issues in GAN training such as mode-collapse (Goodfellow, 2016). Essentially, the authors trade one hard problem for $K$ easier subproblems. The losses of each discriminator $\mathcal { L } _ { D _ { k } }$ are the same as shown in Eq. 5. However, the generator loss $\mathcal { L } _ { G }$ is defined as simply the sum of the losses provided by each discriminator, as shown in Eq. 6. This choice of $\mathcal { L } _ { G }$ does not exploit available information such as the performance of the generator with respect to each discriminator.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal { L } _ { G } = - \sum _ { k = 1 } ^ { K } \mathbb { E } _ { \mathbf { z } \sim p _ { z } } \log D _ { k } ( G ( \mathbf { z } ) ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
# 3.2 HYPERVOLUME MAXIMIZATION
|
| 85 |
+
|
| 86 |
+
Consider a set of solutions $S$ for a multi-objective optimization problem. The hypervolume $\mathcal { H }$ of $S$ is defined as (Fleischer, 2003): $\mathcal { H } ( S ) = \mu \big ( \cup _ { \mathbf { x } \in S } [ \mathbf { F } ( \mathbf { x } ) , \pmb { \eta } ^ { * } ] \big )$ , where $\mu$ is the Lebesgue measure and $\eta ^ { * }$ is a point dominated by all $\mathbf { x } \in S$ (i.e. $f _ { i } ( \mathbf { x } )$ is upper-bounded by $\eta$ ), referred to as nadir point. $\mathcal { H } ( S )$ can be understood as the size of the space covered by $\{ \mathbf { F } ( \mathbf { x } ) | \mathbf { x } \in S \}$ (Bader & Zitzler, 2011).
|
| 87 |
+
|
| 88 |
+
The hypervolume was originally introduced as a quantitative metric for coverage and convergence of Pareto-optimal fronts obtained through population based algorithms (Beume et al., 2007). Methods based on direct maximization of $\mathcal { H }$ exhibit favorable convergence even in challenging scenarios, such as simultaneous minimization of 50 objectives (Bader & Zitzler, 2011). In the context of Machine Learning, a single-solution hypervolume maximization has been applied to neural networks as a surrogate loss for mean squared error (Miranda & Zuben, 2016), i.e. the loss provided by each example in a training batch is treated as a single cost and the multi-objective approach aims to minimize costs over all examples. Authors show that such method provides an inexpensive boosting-like training.
|
| 89 |
+
|
| 90 |
+
# 4 MULTI-OBJECTIVE TRAINING OF GANS WITH MULTIPLE DISCRIMINATORS
|
| 91 |
+
|
| 92 |
+
We introduce a variation of the GAN game such that the generator solves the following multi-objective problem:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\operatorname* { m i n } \pmb { \mathcal { L } } _ { G } ( \mathbf { x } ) = [ l _ { 1 } ( \mathbf { z } ) , l _ { 2 } ( \mathbf { z } ) , . . . , l _ { K } ( \mathbf { z } ) ] ^ { T } ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where each $l _ { k } = - \mathbb { E } _ { z \sim p _ { z } } \log D _ { k } ( G ( z ) ) , k \in \{ 1 , . . . , K \}$ , is the loss provided by the $k$ -th discriminator. Training proceeds as the usual formulation (Goodfellow et al., 2014), i.e. with alternate updates between the discriminators and the generator. Updates of each discriminator are performed to minimize the loss described in Eq. 5.
|
| 99 |
+
|
| 100 |
+
A natural choice for generator’s updates is the MGD algorithm, described in Section 2. However, computing the direction of steepest descent $\mathbf { w } ^ { * }$ before every parameter update step, as required in MGD, can be prohibitively expensive for large neural networks. Therefore, we propose an alternative scheme for multi-objective optimization and argue that both our proposal and previously published methods can all be viewed as performing computationally more efficient versions of MGD update rule without the burden of having to solve a quadratric program, i.e. computing $\mathbf { w } ^ { * }$ , every iteration.
|
| 101 |
+
|
| 102 |
+
# 4.1 HYPERVOLUME MAXIMIZATION FOR TRAINING GANS
|
| 103 |
+
|
| 104 |
+
Fleischer (Fleischer, 2003) has shown that maximizing $\mathcal { H }$ yields Pareto-optimal solutions. Since MGD converges to a set of Pareto-stationary points, i.e. a super-set of the Pareto-optimal solutions, hypervolume maximization yields a sub-set of the solutions obtained using MGD.
|
| 105 |
+
|
| 106 |
+
We exploit the above mentioned property and define the generator loss as the negative loghypervolume, as defined in Eq. 8:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathcal { L } _ { G } = - \mathcal { V } = - \sum _ { k = 1 } ^ { K } \log ( \eta - l _ { k } ) ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where the nadir point coordinate $\eta$ is an upper bound for all $l _ { k }$ . In Fig. 1 we provide an illustrative example for the case where $K = 2$ . The highlighted region corresponds to $e ^ { \nu }$ . Since the nadir point $\eta ^ { * }$ is fixed, $\nu$ will only be maximized, and consequently $\mathcal { L } _ { G }$ minimized, if each $l _ { k }$ is minimized.
|
| 113 |
+
|
| 114 |
+
Moreover, by adapting the results shown in (Miranda & Zuben, 2016), the gradient of $\mathcal { L } _ { G }$ with respect to any generator’s parameter $\theta$ is given by:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\frac { \partial \mathcal { L } _ { G } } { \partial \theta } = \sum _ { k = 1 } ^ { K } \frac { 1 } { \eta - l _ { k } } \frac { \partial l _ { k } } { \partial \theta } .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 1: 2D example of the objective space where the generator loss is being optimized.
|
| 122 |
+
|
| 123 |
+
In other words, the gradient can be obtained by computing a weighted sum of the gradients of the losses provided by each discriminator, whose weights are defined as the inverse distance to the nadir point components. This formulation will naturally assign more importance to higher losses in the final gradient, which is another useful property of hypervolume maximization.
|
| 124 |
+
|
| 125 |
+
Nadir point selection. It is evident from Eq. 9 that the selection of $\eta$ directly affects the importance assignment of gradients provided by different discriminators. Particularly, as the quantity $\mathrm { m i n } _ { k } \{ \eta - l _ { k } \}$ grows, the multi-objective GAN game approaches the one defined by the simple average of $l _ { k }$ . Previous literature has discussed in depth the effects of the selection of $\eta$ in the case of population-based methods (Auger et al., 2009; 2012). However, those results are not readily applicable for the single-solution case. As will be shown in Section 5, our experiments indicate that the choice of $\eta$ plays an important role in the final quality of samples. Nevertheless, this effect becomes less relevant as the number of discriminators increases.
|
| 126 |
+
|
| 127 |
+
Nadir point adaptation. Similarly to (Miranda & Zuben, 2016), we propose an adaptive scheme for $\eta$ such that at iteration $t$ : $\eta _ { t } = \delta \operatorname* { m a x } _ { k } \{ l _ { k , t } \}$ , where $\delta > 1$ is a user-defined parameter which will be referred to as slack. This enforces $\mathrm { m i n } _ { k } \{ \eta - l _ { k } \}$ to be higher when $\operatorname* { m i x } _ { k } \{ l _ { k , t } \}$ is high and low otherwise, which induces a similar behavior as an average loss when training begins and automatically places more importance on the discriminators in which performance is worse as training progresses. Extra discussion and an illustrative example of the adaptation scheme adopted is presented in Appendix G.
|
| 128 |
+
|
| 129 |
+
Comparison to average loss minimization. The upper bound proven by Neyshabur et al. (2017) assumes that the marginals of the real and generated distributions are identical along all random projections. Average loss minimization does not ensure equally good approximation between the marginals along all directions. In case of a trade-off between discriminators, i.e. if decreasing the loss on a given projection increases the loss with respect to another one, the distribution of losses can be uneven. With HV on the other hand, especially when $\eta$ is reduced throughout training, overall loss will be kept high as long as there are discriminators with high loss. This objective tends to prefer central regions of a trade-off, in which all discriminators present a roughly equally low loss.
|
| 130 |
+
|
| 131 |
+
# 4.2 RELATIONSHIP BETWEEN MULTIPLE DISCRIMINATOR GANS AND MGD
|
| 132 |
+
|
| 133 |
+
All methods described previously for the solution of GANs with multiple discriminators, i.e. average loss minimization (Neyshabur et al., 2017), GMAN’s weighted average (Durugkar et al., 2016) and hypervolume maximization can be defined as MGD-like two-step algorithms consisting of: Step 1 - consolidating all gradients into a single update direction (compute the set $\alpha _ { 1 , \ldots , K } )$ ; Step 2 - updating parameters in the direction returned in step 1. Definition of Step $^ { l }$ for the different methods studied here can be seen in the following:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r } { \alpha _ { 1 : K } = \operatorname * { a r g m i n } _ { \alpha } | | \mathbf { w } | | , \quad \mathrm { s . t . } \quad \sum _ { k = 1 } ^ { K } \alpha _ { k } = 1 , \quad \alpha _ { k } \geq 0 \forall k \in \{ 1 , . . . , K \} } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
2. Average loss minimization (Neyshabur et al., 2017): $\textstyle \alpha _ { k } = { \frac { 1 } { K } }$
|
| 140 |
+
|
| 141 |
+
3. GMAN (Durugkar et al., 2016): $\alpha _ { k } = \mathrm { s o f t m a x } ( l _ { 1 : K } ) _ { k }$
|
| 142 |
+
|
| 143 |
+
# 5 EXPERIMENTS
|
| 144 |
+
|
| 145 |
+
We performed three sets of experiments aiming to analyze the following aspects: (i) How alternative methods for training GANs with multiple discriminators perform in comparison to MGD; (ii) How alternative methods perform in comparison to each other in terms of sample quality and coverage; and (iii) Whether the behavior induced by HV improves the results with respect to the baseline methods.
|
| 146 |
+
|
| 147 |
+
Firstly, we exploited the relatively low dimensionality of MNIST and used it as testbed for a comparison of MGD with the other approaches, i.e. average loss minimization (AVG), GMAN’s weighted average loss, and HV, proposed in this work. Moreover, multiple initializations and slack combinations were evaluated in order to investigate how varying the number of discriminators affects robustness to those factors.
|
| 148 |
+
|
| 149 |
+
Then, experiments were performed with CIFAR-10 while increasing the number of discriminators. We evaluated HV’s performance compared to baseline methods, and the effect in samples quality. We also analyzed the impact on the diversity of generated samples by using the stacked MNIST dataset (Srivastava et al., 2017). Samples of generators trained on stacked MNIST, CIFAR-10, CelebA, and Cats dataset are shown in the Appendix.
|
| 150 |
+
|
| 151 |
+
In all experiments performed, the same architecture, set of hyperparameters and initialization were used for both AVG, GMAN and our proposed method. The only different aspect is the generator loss. Unless stated otherwise, Adam (Kingma & Ba, 2014) was used to train all the models with learning rate, $\beta _ { 1 }$ and $\beta _ { 2 }$ set to 0.0002, 0.5 and 0.999, respectively. Mini-batch size was set to 64. The Fréchet Inception Distance (FID) (Heusel et al., 2017) was employed for comparison. Details on FID computation can be found in Appendix A.
|
| 152 |
+
|
| 153 |
+
# 5.1 MGD COMPARED WITH ALTERNATIVE METHODS
|
| 154 |
+
|
| 155 |
+
We employed MGD in our experiments with MNIST. In order to do so, a quadratic program has to be solved prior to every parameters update. For this, we used the Scipy’s implementation of the Serial Least Square Quadratic Program solver2.
|
| 156 |
+
|
| 157 |
+
Three and four fully connected layers with LeakyReLU activations were used for the generator and discriminator, respectively. Dropout was also employed in the discriminator and the random projection layer was implemented as a randomly initialized norm-1 fully connected layer, reducing the vectorized dimensionality of MNIST from 784 to 512. A pretrained LeNet (LeCun et al., 1998) was used for FID computation.
|
| 158 |
+
|
| 159 |
+
Experiments over 100 epochs with 8 discriminators are reported in Fig. 2 and Fig. 3. In Fig. 2, box-plots refer to 30 independent computations of FID over 10000 images sampled from the generator which achieved the minimum FID at train time. FID results are measured at train time over 1000 images and the best values are reported in Fig. 3 along with the necessary time to achieve it.
|
| 160 |
+
|
| 161 |
+
MGD outperforms all tested methods. However, its cost per iteration does not allow its use in more relevant datasets other than MNIST. Hypervolume maximization, on the other hand, performs closest to MGD than the considered baselines, while introducing no relevant extra cost. In Fig. 4, we analyze convergence in the Pareto-stationarity sense by plotting the norm of the update direction for each method, given by $\begin{array} { r l } { { \vert \vert \sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla l _ { k } \vert \vert } } \end{array}$ . All methods converged to similar norms, leading to the conclusion that different Pareto-stationary solutions will perform differently in terms of quality of samples. FID as a function of wall-clock time is shown in Figure 22 (Appendix H).
|
| 162 |
+
|
| 163 |
+
HV sensitivity to initialization and choice of $\delta$ . Analysis of the sensitivity of the performance with the choice of the slack parameter $\delta$ and initialization was performed under the following setting: models were trained for 50 epochs on MNIST with hypervolume maximization using 8, 16, 24 discriminators. Three independent runs (different initializations) were executed with each $\delta = \{ 1 . 0 5 , 1 . 5 , 1 . 7 5 , 2 \}$ and number of discriminators, totalizing 36 final models. Fig. 5 reports the box-plots obtained for 5 FID independent computations using 10000 images, for each of the 36 models obtained under the setting previously described. Results clearly indicate that increasing the number of discriminators yields much smaller variation in the FID obtained by the final model.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 2: Box-plots corresponding to 30 independent FID computations with 10000 images. MGD performs consistently better than other methods, followed by hypervolume maximization. Models that achieved minimum FID at train time were used. Red and blue dashed lines are the FIDs of a random generator and real data, respectively.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 3: Time vs. best FID achieved during training for each approach. FID values are computed over 1000 generated images after every epoch. MGD performs relevantly better than others in terms of FID, followed by HV. However, MGD is approximately 7 times slower than HV. HV is well-placed in the time-quality trade-off.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 4: Norm of the update direction over time for each method. While Pareto-stationarity is approximately achieved by all methods, performance varies relevantly in terms of FID.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 5: Independent FID evaluations for models obtained with different runs using distinct slack parameter $\delta$ . Sensitivity reduces as the number of discriminators increases.
|
| 176 |
+
|
| 177 |
+
# 5.2 HV AS AN ALTERNATIVE FOR MGD
|
| 178 |
+
|
| 179 |
+
We evaluate the performance of HV compared to baseline methods using the CIFAR-10 dataset. FID was computed with a pretrained ResNet (He et al., 2016). ResNet was trained on the 10-class classification task of CIFAR-10 up to approximately $9 5 \%$ test accuracy. DCGAN (Radford et al., 2015) and WGAN-GP (Gulrajani et al., 2017) were included in the experiments for FID reference. Same architectures as in (Neyshabur et al., 2017) were employed for all multi-discriminators settings. An increasing number of discriminators was used. Inception score as well as FID computed with other models are included in Appendix C.
|
| 180 |
+
|
| 181 |
+
In Fig. 6, we report the box-plots of 15 independent evaluations of FID on 10000 images for the best model obtained with each method across 3 independent runs. Results once more indicate that HV outperforms other methods in terms of quality of the generated samples. Moreover, performance clearly improves as the number of discriminators grows. Fig. 7 shows the FID at train time, i.e. measured with 1000 generated samples after each epoch, for the best models across runs. Models trained against more discriminators clearly converge to smaller values. We report the norm of the update direction $\begin{array} { r l } { { \vert \vert \sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla l _ { k } \vert \vert } } & { { } } \end{array}$ for each method in Fig. 9, Appendix C.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 6: Box-plots of 15 independent FID com- Figure 7: FID estimated over 1000 generated imputations with 10000 images. Dashed lines are ages at train time. Models trained against more real data (blue) and random generator (red) FIDs. discriminators achieve lower FID.
|
| 185 |
+
|
| 186 |
+
Cost under the multiple discriminator setting. We highlight that even though training with multiple discriminators may be more computationally expensive when compared to conventional approaches, such framework supports fully parallel training of the discriminators, a feature which is not trivially possible in other GAN settings. For example in WGAN, the discriminator is serially updated multiple times for each generator update. In Fig. 10 at Appendix C, we provide a comparison between the wall-clock time per iteration between all methods evaluated. Serial implementations of discriminators updates with 8 and 16 discriminators were faster than WGAN-GP.
|
| 187 |
+
|
| 188 |
+
# 5.3 EFFECT OF THE NUMBER OF DISCRIMINATORS ON SAMPLE DIVERSITY
|
| 189 |
+
|
| 190 |
+
We repeat the experiments in (Srivastava et al., 2017) aiming to analyze how the number of discriminators impacts the sample diversity of the corresponding generator when trained using hypervolume maximization. The stacked MNIST dataset is employed and results reported in (Lin et al., 2017) are used for comparison. HV results for 8, 16, and 24 discriminators were obtained with 10k and 26k generator images averaged over 10 runs. The number of covered modes along with the KL divergence between the generated mode distribution and test data are reported in Table 1.
|
| 191 |
+
|
| 192 |
+
Table 1: Number of covered modes and reverse KL divergence for stacked MNIST.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Test samples</td><td>Model</td><td>Modes (Max 1000)</td><td>KL</td></tr><tr><td rowspan="5">26k</td><td>DCGAN (Radford etal.,2015)</td><td>99.0</td><td>3.400</td></tr><tr><td>ALI (Dumoulin et al., 2016)</td><td>16.0</td><td>5.400</td></tr><tr><td>Unrolled GAN (Metz et al., 2016)</td><td>48.7</td><td>4.320</td></tr><tr><td>VEEGAN (Srivastava et al., 2017)</td><td>150.0</td><td>2.950</td></tr><tr><td>PacDCGAN2 (Lin et al.,2017)</td><td>1000.0± 0.0</td><td>0.060 ±0.003</td></tr><tr><td rowspan="3">10k</td><td>HV-8 disc.</td><td>679.2± 5.9</td><td>1.139 ± 0.011</td></tr><tr><td>HV - 16 disc.</td><td>998.0±1.8</td><td>0.120 ± 0.004</td></tr><tr><td>HV - 24 disc.</td><td>998.3 ± 1.1</td><td>0.116 ± 0.003</td></tr><tr><td rowspan="3">26k</td><td>HV -8 disc.</td><td>776.8 ±6.4</td><td>1.115 ± 0.007</td></tr><tr><td>HV - 16 disc.</td><td>1000.0± 0.0</td><td>0.088 ±0.002</td></tr><tr><td>HV - 24 disc.</td><td>1000.0 ± 0.0</td><td>0.084 ±0.002</td></tr></table>
|
| 195 |
+
|
| 196 |
+
As in previous experiments, results improved as we increased the number of discriminators. All evaluated models using HV outperformed DCGAN, ALI, Unrolled GAN and VEEGAN. Moreover, HV with 16 and 24 discriminators achieved state-of-the-art coverage values. Thus, the increase in models’ capacity via using more discriminators directly resulted in an improvement in generator’s coverage. Training details as well as architectures information are presented in Appendix B.
|
| 197 |
+
|
| 198 |
+
# 6 CONCLUSION
|
| 199 |
+
|
| 200 |
+
In this work we have shown that employing multiple discriminators is a practical approach allowing us to trade extra capacity, and thereby extra computational cost, for higher quality and diversity of generated samples. Such an approach is complimentary to other advances in GANs training and can be easily used together with other methods. We introduced a multi-objective optimization framework for studying multiple discriminator GANs, and showed strong similarities between previous work and the multiple gradient descent algorithm. The proposed approach was observed to consistently yield higher quality samples in terms of FID. Furthermore, increasing the number of discriminators was shown to increase sample diversity and generator robustness.
|
| 201 |
+
|
| 202 |
+
Deeper analysis of the quantity that using it as a penalty term $\begin{array} { r l } { { \vert \vert \sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla l _ { k } \vert \vert } } & { { } } \end{array}$ is the subject of future investigation. We hypothesize necessity of a high number of discriminators.
|
| 203 |
+
|
| 204 |
+
# REFERENCES
|
| 205 |
+
|
| 206 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017.
|
| 207 |
+
|
| 208 |
+
Anne Auger, Johannes Bader, Dimo Brockhoff, and Eckart Zitzler. Theory of the hypervolume indicator: optimal $\mu$ -distributions and the choice of the reference point. In Proceedings of the tenth ACM SIGEVO workshop on Foundations of genetic algorithms, pp. 87–102. ACM, 2009.
|
| 209 |
+
|
| 210 |
+
Anne Auger, Johannes Bader, Dimo Brockhoff, and Eckart Zitzler. Hypervolume-based multiobjective optimization: Theoretical foundations and practical implications. Theoretical Computer Science, 425:75–103, 2012.
|
| 211 |
+
|
| 212 |
+
Johannes Bader and Eckart Zitzler. HypE: An algorithm for fast hypervolume-based many-objective optimization. Evolutionary computation, 19(1):45–76, 2011.
|
| 213 |
+
|
| 214 |
+
David Berthelot, Tom Schumm, and Luke Metz. BEGAN: boundary equilibrium generative adversarial networks. CoRR, abs/1703.10717, 2017. URL http://arxiv.org/abs/1703.10717.
|
| 215 |
+
|
| 216 |
+
Nicola Beume, Boris Naujoks, and Michael Emmerich. SMS-EMOA: Multiobjective selection based on dominated hypervolume. European Journal of Operational Research, 181(3):1653–1669, 2007.
|
| 217 |
+
|
| 218 |
+
Kalyanmoy Deb. Multi-objective optimization using evolutionary algorithms, volume 16. John Wiley & Sons, 2001.
|
| 219 |
+
|
| 220 |
+
Jean-Antoine Désidéri. Multiple-gradient descent algorithm (MGDA) for multiobjective optimization. Comptes Rendus Mathematique, 350(5-6):313–318, 2012.
|
| 221 |
+
|
| 222 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
|
| 223 |
+
|
| 224 |
+
Ishan Durugkar, Ian Gemp, and Sridhar Mahadevan. Generative multi-adversarial networks. arXiv preprint arXiv:1611.01673, 2016.
|
| 225 |
+
|
| 226 |
+
Mark Fleischer. The measure of pareto optima applications to multi-objective metaheuristics. In International Conference on Evolutionary Multi-Criterion Optimization, pp. 519–533. Springer, 2003.
|
| 227 |
+
|
| 228 |
+
Maurice Fréchet. Sur la distance de deux lois de probabilité. COMPTES RENDUS HEBDOMADAIRES DES SEANCES DE L ACADEMIE DES SCIENCES, 244(6):689–692, 1957.
|
| 229 |
+
|
| 230 |
+
Ian Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 231 |
+
|
| 232 |
+
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.
|
| 233 |
+
|
| 234 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems, pp. 5769–5779, 2017.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
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. 6629–6640, 2017.
|
| 239 |
+
|
| 240 |
+
Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. arXiv preprint arXiv:1807.00734, 2018.
|
| 241 |
+
|
| 242 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Zinan Lin, Ashish Khetan, Giulia Fanti, and Sewoong Oh. PacGAN: The power of two samples in generative adversarial networks. arXiv preprint arXiv:1712.04086, 2017.
|
| 247 |
+
|
| 248 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2813–2821. IEEE, 2017.
|
| 249 |
+
|
| 250 |
+
Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016.
|
| 251 |
+
|
| 252 |
+
Conrado Silva Miranda and Fernando José Von Zuben. Single-solution hypervolume maximization and its use for improving generalization of neural networks. CoRR, abs/1602.01164, 2016. URL http://arxiv.org/abs/1602.01164.
|
| 253 |
+
|
| 254 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018.
|
| 255 |
+
|
| 256 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, and Ayan Chakrabarti. Stabilizing GAN training with multiple random projections. arXiv preprint arXiv:1705.07831, 2017.
|
| 257 |
+
|
| 258 |
+
Sebastian Peitz and Michael Dellnitz. Gradient-based multiobjective optimization with uncertainties. In NEO 2016, pp. 159–182. Springer, 2018.
|
| 259 |
+
|
| 260 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 261 |
+
|
| 262 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016.
|
| 263 |
+
|
| 264 |
+
Stefan Schäffler, Reinhart Schultz, and Klaus Weinzierl. Stochastic method for the solution of unconstrained vector optimization problems. Journal of Optimization Theory and Applications, 114(1):209–222, 2002.
|
| 265 |
+
|
| 266 |
+
Akash Srivastava, Lazar Valkoz, Chris Russell, Michael U Gutmann, and Charles Sutton. VEEGAN: Reducing mode collapse in GANs using implicit variational learning. In Advances in Neural Information Processing Systems, pp. 3310–3320, 2017.
|
| 267 |
+
|
| 268 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 269 |
+
|
| 270 |
+
Abhay Yadav, Sohil Shah, Zheng Xu, David Jacobs, and Tom Goldstein. Stabilizing adversarial nets with prediction methods. arXiv preprint arXiv:1705.07364, 2017.
|
| 271 |
+
|
| 272 |
+
# APPENDIX
|
| 273 |
+
|
| 274 |
+
A - OBJECTIVE EVALUATION METRIC.
|
| 275 |
+
|
| 276 |
+
In (Heusel et al., 2017), authors proposed to use as a quality metric the squared Fréchet distance (Fréchet, 1957) between Gaussians defined by estimates of the first and second order moments of the outputs obtained through a forward pass in a pretrained classifier of both real and generated data. They proposed the use of Inception V3 (Szegedy et al., 2016) for computation of the data representation and called the metric Fréchet Inception Distance (FID), which is defined as:
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\mathrm { F I D } = | | m _ { d } - m _ { g } | | ^ { 2 } + \mathrm { T r } ( \Sigma _ { d } + \Sigma _ { g } - 2 ( \Sigma _ { d } \Sigma _ { g } ) ^ { \frac { 1 } { 2 } } ) ,
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
where $m _ { d } , \Sigma _ { d }$ and $m _ { g } , \Sigma _ { g }$ are estimates of the first and second order moments from the representations of real data distributions and generated data, respectively.
|
| 283 |
+
|
| 284 |
+
We employ FID throughout our experiments for comparison of different approaches. However, for each dataset in which FID was computed, the output layer of a pretrained classifier on that particular dataset was used instead of Inception. $m _ { d }$ and $\Sigma _ { d }$ were estimated on the complete test partitions, which are not used during training.
|
| 285 |
+
|
| 286 |
+
# B - EXPERIMENTAL SETUP FOR STACKED MNIST EXPERIMENTS AND GENERATOR’S SAMPLES
|
| 287 |
+
|
| 288 |
+
Architectures of the generator and discriminator are detailed in Tables 2 and 3, respectively. Batch normalization was used in all intermediate convolutional and fully connected layers of both models. We employed RMSprop to train all the models with learning rate and $\alpha$ set to 0.0001 and 0.9, respectively. Mini-batch size was set to 64. The setup in (Lin et al., 2017) is employed and we build 128000 and 26000 samples for train and test sets, respectively.
|
| 289 |
+
|
| 290 |
+
Table 2: Generator’s architecture.
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Layer</td><td>Outputs</td><td>Kernel size</td><td>Stride</td><td>Activation</td></tr><tr><td>Input: z ~ N(0,I100)</td><td></td><td></td><td></td><td></td></tr><tr><td>Fully connected</td><td>2*2*512</td><td>4,4</td><td>2,2</td><td>ReLU</td></tr><tr><td>Transposed convolution</td><td>4*4*256</td><td>4,4</td><td>2,2</td><td>ReLU</td></tr><tr><td>Transposed convolution</td><td>8*8*128</td><td>4,4</td><td>2,2</td><td>ReLU</td></tr><tr><td>Transposed convolution</td><td>14*14*64</td><td>4,4</td><td>2,2</td><td>ReLU</td></tr><tr><td>Transposed convolution</td><td>28*28*3</td><td>4,4</td><td>2,2</td><td>Tanh</td></tr></table>
|
| 293 |
+
|
| 294 |
+
Table 3: Discriminator’s architecture.
|
| 295 |
+
|
| 296 |
+
<table><tr><td>Layer</td><td>Outputs</td><td>Kernel size</td><td>Stride</td><td>Activation</td></tr><tr><td>Input</td><td>28*28*3</td><td></td><td></td><td></td></tr><tr><td>Projection</td><td>14*14*3</td><td>8,8</td><td>2,2</td><td></td></tr><tr><td>Convolution</td><td>7*7*64</td><td>4,4</td><td>2,2</td><td>LeakyReLU</td></tr><tr><td>Convolution</td><td>5*5*128</td><td>4,4</td><td>2,2</td><td>LeakyReLU</td></tr><tr><td>Convolution</td><td>2*2*256</td><td>4,4</td><td>2,2</td><td>LeakyReLU</td></tr><tr><td>Convolution</td><td>1</td><td>4,4</td><td>2,2</td><td>Sigmoid</td></tr></table>
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
(a) HV - 8 discriminators
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
(b) HV - 16 discriminators
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 8: Stacked MNIST samples for HV trained with 8, 16, and 24 discriminators. Samples diversity increases greatly when more discriminators are employed.
|
| 306 |
+
|
| 307 |
+
# (c) HV - 24 discriminators
|
| 308 |
+
|
| 309 |
+
# C - EXTRA RESULTS ON CIFAR-10
|
| 310 |
+
|
| 311 |
+
# C.1 - MULTIPLE DISCRIMINATORS ACROSS DIFFERENT INITIALIZATIONS AND OTHER SCORES
|
| 312 |
+
|
| 313 |
+
Table 4 presents the best FID (computed with a pretrained ResNet) achieved by each approach at train time, along with the epoch in which it was achieved, for each of 3 independent runs. Train time FIDs are computed using 1000 generated images.
|
| 314 |
+
|
| 315 |
+
Table 4: Best FID obtained for each approach on 3 independent runs. FID is computed on 1000 generated images after every epoch.
|
| 316 |
+
|
| 317 |
+
<table><tr><td>#D</td><td>Method</td><td>Best FID (epoch)</td></tr><tr><td rowspan="2">1</td><td>DCGAN</td><td>7.09 (68),9.09 (21),4.22 (101)</td></tr><tr><td>WGAN-GP</td><td>5.09 (117),5.69 (101) 7.13 (71)</td></tr><tr><td rowspan="3">8</td><td>AVG</td><td>3.35 (105),4.64 (141),3.00 (76)</td></tr><tr><td>GMAN</td><td>4.28 (123),4.24 (129),3.80 (133)</td></tr><tr><td>HV</td><td>3.87 (102),4.54 (82),3.20 (98)</td></tr><tr><td rowspan="3">16</td><td>AVG</td><td>3.16 (96),2.50 (91),2.77 (116)</td></tr><tr><td>GMAN</td><td>2.69 (129),2.36 (144),2.48 (120)</td></tr><tr><td>HV</td><td>2.56 (85),2.70 (97),2.68 (133)</td></tr><tr><td rowspan="3">24</td><td>AVG</td><td>2.10 (94),2.44 (132),2.43 (129)</td></tr><tr><td>GMAN</td><td>2.16 (120),2.02 (98),2.13 (130)</td></tr><tr><td>HV</td><td>2.05 (83),1.89 (97),2.23 (130)</td></tr></table>
|
| 318 |
+
|
| 319 |
+
In Fig. 9, we report the norm of the update direction $\begin{array} { r l } { { \vert \vert \sum _ { k = 1 } ^ { K } \alpha _ { k } \nabla l _ { k } \vert \vert } } & { { } } \end{array}$ of the best model obtained for Pareto-stationarity sense, i.e. the norm upon convergence is lower for models trained against more discriminators, regardless of the employed method.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 9: Norm of the update direction over time for each method. Higher number of discriminators yield lower norm upon convergence.
|
| 323 |
+
|
| 324 |
+
We computed extra scores using 10000 images generated by the best model reported in Table 4, i.e. the same models utilized to generate the results shown in Fig. 6. Both Inception score and FID were computed with original implementations, while FID-VGG and FID-ResNet were computed using a VGG and a ResNet we pretrained. Results are reported with respect to DCGAN’s scores.
|
| 325 |
+
|
| 326 |
+
<table><tr><td></td><td>WGAN-GP</td><td>AVG-8</td><td>AVG-16</td><td>AVG-24</td><td>GMAN-8</td><td>GMAN-16</td><td>GMAN-24</td><td>HV-8</td><td>HV-16</td><td>HV-24</td></tr><tr><td>InceptionScore</td><td>1.08</td><td>1.02</td><td>1.26</td><td>1.36</td><td>0.95</td><td>1.32</td><td>1.42</td><td>1.00</td><td>1.30</td><td>1.44</td></tr><tr><td>FID</td><td>0.80</td><td>0.98</td><td>0.76</td><td>0.73</td><td>0.92</td><td>0.79</td><td>0.65</td><td>0.89</td><td>0.77</td><td>0.72</td></tr><tr><td>FID-VGG</td><td>1.29</td><td>0.91</td><td>1.03</td><td>0.85</td><td>0.87</td><td>0.78</td><td>0.73</td><td>0.78</td><td>0.75</td><td>0.64</td></tr><tr><td>FID-ResNet</td><td>1.64</td><td>0.88</td><td>0.90</td><td>0.62</td><td>0.80</td><td>0.72</td><td>0.73</td><td>0.75</td><td>0.73</td><td>0.51</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Table 5: Scores of different methods measure on generated CIFAR-10 samples. DCGAN scores are used as reference values, and results report are the ratio between given model and DCGAN scores. Inception score is better when high, whereas FIDs are better when low.
|
| 329 |
+
|
| 330 |
+
# C.2 - COMPUTATIONAL COST
|
| 331 |
+
|
| 332 |
+
In Table 6 we present a comparison of minimum FID-ResNet obtained during training, along with computation cost in terms of time and space for different GANs, with both 1 and 24 discriminators. The computational cost of training GANs under a multiple discriminator setting is higher by design, in terms of both FLOPS and memory, if compared with single discriminators settings. However, a corresponding shift in performance is the result of the additional cost. This effect was consistently observed considering 4 different well-known approaches, namely DCGAN (Radford et al., 2015), Least-square GAN (LSGAN) (Mao et al., 2017), and HingeGAN (Miyato et al., 2018). The architectures of all single discriminator models follow the DCGAN, described in (Radford et al., 2015). For the 24 discriminators models, we used the architecture described in (Neyshabur et al., 2017), which consists in removing the the normalization layers from DCGAN’s discriminator and further adding the projection layer, inline with previous experiments reported for CIFAR-10 upscaled to $6 4 \mathrm { x } 6 4$ . All models were trained with minibatch size of 64 during 150 epochs. Adam (Kingma & Ba, 2014) was used as the optimizer. Learning rate, $\beta _ { 1 }$ and $\beta _ { 2 }$ were equal to 0.0002, 0.5 and 0.999, respectively.
|
| 333 |
+
|
| 334 |
+
<table><tr><td></td><td>#Discriminators</td><td>FID-ResNet</td><td>FLOPS (MAC)</td><td>Memory (Mb)</td></tr><tr><td rowspan="2">DCGAN</td><td>1</td><td>4.22</td><td>8e10</td><td>1292</td></tr><tr><td>24</td><td>1.89</td><td>5e11</td><td>5671</td></tr><tr><td rowspan="2">LSGAN</td><td>1</td><td>4.55</td><td>8e10</td><td>1303</td></tr><tr><td>24</td><td>1.91</td><td>5e11</td><td>5682</td></tr><tr><td rowspan="2">HingeGAN</td><td>1</td><td>6.17</td><td>8e10</td><td>1303</td></tr><tr><td>24</td><td>2.25</td><td>5e11</td><td>5682</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 6: Comparison between different GANs with 1 and 24 discriminators in terms of minimum FID-ResNet obtained during training, and FLOPs and memory consumption for a complete train step.
|
| 337 |
+
|
| 338 |
+
Furthermore, wall-clock time per iteration for different numbers of discriminators is shown in Fig. 10 for experiments with CIFAR-10 with serial updates of discriminators. Notice that while the increase in cost in terms of FLOPS and memory is unavoidable when multiple discriminators settings is employed, wall-clock time can be made close to single discriminators cases since training with respect to different discriminators can be implemented in parallel. On the other hand, extra cost in time introduced by other frameworks such as WGAN-GP or SNGAN cannot be trivially recovered.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 10: Time in seconds per iteration of each method for serial updates of discriminators. Multiple discriminators approaches considered do not present relevant difference in time per iteration.
|
| 342 |
+
|
| 343 |
+
# C.3 - GENERATED SAMPLES
|
| 344 |
+
|
| 345 |
+
In Figs. 11, 12, and 13 we show random generated samples with 8, 16, and 24 discriminators for AVG, GMAN, and HV, respectively.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 11: CIFAR-10 samples for AVG trained with 8, 16, and 24 discriminators.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 12: CIFAR-10 samples for GMAN trained with 8, 16, and 24 discriminators.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 13: CIFAR-10 samples for HV trained with 8, 16, and 24 discriminators.
|
| 355 |
+
|
| 356 |
+
# C.4 - RESULTS CIFAR-10 32X32
|
| 357 |
+
|
| 358 |
+
All results reported in previous sections using CIFAR-10 were obtained with an upscaled version of the dataset. Here, we thus run experiments with the dataset in its original resolution aiming to contextualize our proposed approach with respect to previously introduced methods. To do so, we repeated similar experiments as reported in Miyato et al. (2018)-Table 2, for the model referred to as standard CNN. The same architecture is employed and the spectral normalization is removed from the discriminators. Moreover, the same projection input is added in each of the discriminators.
|
| 359 |
+
|
| 360 |
+
Results in terms of both FID and Inception score, evaluated on top of 5000 generated images as in (Miyato et al., 2018) as well as with 10000 images, are reported in Table 7 for our proposed approach and our implementation of (Miyato et al., 2018), along with the FID measured using a ResNet classifier trained in advance.
|
| 361 |
+
|
| 362 |
+
As can be seen, the addition of the multiple discriminators setting along with hypervolume maximization yields a relevant shift in performance for the DCGAN-like generator, taking all evaluated metrics to levels of recently proposed GANs.
|
| 363 |
+
|
| 364 |
+
<table><tr><td></td><td>FID-ResNet</td><td>FID (5k)</td><td>IS (5k)</td><td>FID (10k)</td><td>IS (10k)</td></tr><tr><td>SNGAN (Miyato et al., 2018)</td><td>-</td><td>25.5</td><td>7.58±0.12</td><td>-</td><td>-</td></tr><tr><td>WGAN-GP (Miyato et al., 2018)</td><td></td><td>40.2</td><td>6.68 ± 0.06</td><td>1</td><td>-</td></tr><tr><td>DCGAN (Miyato et al., 2018)</td><td>-</td><td>-</td><td>6.64± 0.14</td><td>-</td><td>=</td></tr><tr><td>SNGAN (our implementation)</td><td>1.55</td><td>27.93</td><td>7.11 ± 0.30</td><td>25.29</td><td>7.26± 0.12</td></tr><tr><td>DCGAN + 24 Ds and HV</td><td>1.21</td><td>27.74</td><td>7.32 ± 0.26</td><td>24.90</td><td>7.45 ± 0.17</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table 7: Evaluation of the effect of adding discriminators on a DCGAN-like model trained on CIFAR-10. Results reach the same level as the best reported for the given architecture when the multiple-discriminator setting is added and the normalization layers are removed from discriminators.
|
| 367 |
+
|
| 368 |
+
# D - CELEBA DATASET
|
| 369 |
+
|
| 370 |
+
# D.1 - COMPARING WITH OTHER MULTIPLE-DISCRIMINATORS APPROACHES
|
| 371 |
+
|
| 372 |
+
Here, we present samples obtained by generators trained against 8, 16, and 24 discriminators using AVG, GMAN, and HV on the CelebA dataset rescaled to $6 4 \mathrm { x } 6 4$ . Training lasted 100 epochs and samples are shown in Figs. 14, 15, and 16 for AVG, GMAN and HV, respectively. Same architectures and hyperparameters used for experiments with CIFAR-10 presented in Section 5 were utilized.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 14: CelebA samples for AVG trained with 8, 16, and 24 discriminators.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 15: CelebA samples for GMAN trained with 8, 16, and 24 discriminators.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 16: CelebA samples for HV trained with 8, 16, and 24 discriminators.
|
| 382 |
+
|
| 383 |
+
# D.2 - GENERATING 128X128 IMAGES
|
| 384 |
+
|
| 385 |
+
In this experiment, we verify whether the proposed multiple discriminators setting is capable of generating higher resolution images. For that, we employed the CelebA at a size of $1 2 8 \mathrm { x } 1 2 8$ . We used a similar architecture for both generator and discriminators networks as described in the previous experiments. A convolutional layer with 2048 feature maps was added to both generator and discriminators architectures due to the increase in the image size. Adam optimizer with the same set of hyperparameters as for CIFAR-10 and CelebA $6 4 \mathrm { x } 6 4$ was employed. We trained models with 6, 8, and 10 discriminators during 24 epochs. Samples from each generator are shown in Figure 17.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 17: 128x128 CelebA samples for HV trained during 24 epochs with 6, 8, and 10 discriminators.
|
| 389 |
+
|
| 390 |
+
# E - GENERATING 256X256 CATS
|
| 391 |
+
|
| 392 |
+
We show the proposed multiple-discriminators setting scales to higher resolution even in the small dataset regime, by reproducing the experiments presented in (Jolicoeur-Martineau, 2018). We used the same architecture for the generator. For the discriminator, we removed batch normalization from all layers and used stride equal to 1 at the last convolutional layer, after adding the initial projection step. The Cats dataset 3 was employed, we followed the same pre-processing steps, which, in our case, yielded 1740 training samples with resolution of $2 5 6 \times 2 5 6$ . Our model is trained using 24 discriminators and Adam optimizer with the same hyperparameters as for CIFAR-10 and CelebA previously described experiments. In Figure 18 we show generator’s samples after 288 training epochs. One epoch corresponds to updating over 27 minibatches of size 64.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 18: Cats generated using 24 discriminators after 288 training epochs.
|
| 396 |
+
|
| 397 |
+
# F - INCREASING NUMBER OF RANDOM PROJECTIONS
|
| 398 |
+
|
| 399 |
+
In this experiment we illustrate and confirm the results introduced in (Neyshabur et al., 2017), showing the effect of using an increasing number of random projections to train a GAN. We trained models using average loss minimization with 1 to 6 discriminators on the CelebA dataset for 15 epochs. Samples from the generator obtained in the last epoch are shown in Fig. 19. Generated samples are closer to real data as the number of random projections (and discriminators, consequently) increases.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 19: Models trained with AVG during 15 epochs using an increasing number of random projections and discriminators.
|
| 405 |
+
|
| 406 |
+
# (f) AVG - 6 discriminators
|
| 407 |
+
|
| 408 |
+
# G - ILLUSTRATION OF INTERACTION BETWEEN HYPERVOLUME AND ADOPTEDNADIR POINT ADAPTATION SCHEME
|
| 409 |
+
|
| 410 |
+
Consider a two-objectives problem, with $l _ { 1 } ^ { t } > 0$ and $l _ { 2 } ^ { t } > 0$ corresponding to each of the losses we want to minimize, at iteration $t$ . We present in Figures 20 and 21 an illustrative example of the effect of the adaptation scheme adopted for $\eta$ , as described in Section 4.
|
| 411 |
+
|
| 412 |
+
Figure 20 describes the initialization state. Since $l _ { 1 } ^ { t }$ and $l _ { 2 } ^ { t }$ will be high at $t = 0$ , and, following the adaptation rule presented in previous sections, $\eta ^ { t } = \overline { { \delta } } \operatorname* { m a x } \{ l _ { 1 } ^ { t } , l _ { 2 } ^ { t } \}$ , for a slack $\delta > 0$ , the difference $\eta ^ { t } - \operatorname* { m a x } \{ l _ { 1 } ^ { t } , l _ { 2 } ^ { t } \}$ will be high. In contrast, after $T$ updates, as described in Figure 21, $\eta ^ { t } = \delta \operatorname* { m a x } \{ l _ { 1 } ^ { t } , l _ { 2 } ^ { t } \}$ will be smaller, since losses are now closer to 0.
|
| 413 |
+
|
| 414 |
+
If no adaptation is performed and $\eta$ is kept unchanged throughout training, as represented in red in Figure 21, $\eta ^ { T } - l _ { 1 } ^ { \dot { T } } \approx \eta ^ { T } - l _ { 2 } ^ { T }$ for a large enough $T$ , which will end up assigning similar weights to gradients provided by the different losses, defeating the purpose of employing hypervolume maximization rather than optimizing for the average loss.
|
| 415 |
+
|
| 416 |
+
The employed adaptation scheme thus keeps the gradient weighting relevant even when losses become low. Moreover, this effect will be more aggressive as training progresses, assigning more gradient importance to the higher losses, since $\eta ^ { T } \stackrel { \smile \smile } { - } \operatorname* { m a x } \{ l _ { 1 } ^ { T } , l _ { 2 } ^ { T } \} < \tilde { \eta ^ { 0 } } ^ { \perp } - \tilde { \operatorname* { m a x } } \{ l _ { 1 } ^ { 0 } , l _ { 2 } ^ { 0 } \}$ .
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 20: Losses and nadir point at beginning of training.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 21: Losses and nadir point at $t = T$ , and nadir point at $t = 0$ (in red).
|
| 423 |
+
|
| 424 |
+
# H - WALL-CLOCK TIME FOR REACHING BEST FID DURING TRAINING ON MNIST
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Figure 22: Minimum FID during training. X-axis is in minutes. The blue dot is intended to highlight the moment during training when the minimum FID was reached.
|
md/train/S1lN69AT-/S1lN69AT-.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TO PRUNE, OR NOT TO PRUNE: EXPLORING THE EFFICACY OF PRUNING FOR MODEL COMPRESSION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Model pruning seeks to induce sparsity in a deep neural network’s various connection matrices, thereby reducing the number of nonzero-valued parameters in the model. Recent reports (Han et al., 2015a; Narang et al., 2017) prune deep networks at the cost of only a marginal loss in accuracy and achieve a sizable reduction in model size. This hints at the possibility that the baseline models in these experiments are perhaps severely over-parameterized at the outset and a viable alternative for model compression might be to simply reduce the number of hidden units while maintaining the model’s dense connection structure, exposing a similar trade-off in model size and accuracy. We investigate these two distinct paths for model compression within the context of energy-efficient inference in resource-constrained environments and propose a new gradual pruning technique that is simple and straightforward to apply across a variety of models/datasets with minimal tuning and can be seamlessly incorporated within the training process. We compare the accuracy of large, but pruned models (large-sparse) and their smaller, but dense (small-dense) counterparts with identical memory footprint. Across a broad range of neural network architectures (deep CNNs, stacked LSTM, and seq2seq LSTM models), we find large-sparse models to consistently outperform small-dense models and achieve up to $1 0 \mathrm { x }$ reduction in number of non-zero parameters with minimal loss in accuracy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Over the past few years, deep neural networks have achieved state-of-the-art performance on several challenging tasks in the domains of computer vision, speech recognition, and natural language processing. Driven by increasing amounts of data and computational power, deep learning models have become bigger and deeper to better learn from data. While these models are typically deployed in a datacenter back-end, preserving user privacy and reducing user-perceived query times mandate the migration of the intelligence offered by these deep neural networks towards edge computing devices. Deploying large, accurate deep learning models to resource-constrained computing environments such as mobile phones, smart cameras etc. for on-device inference poses a few key challenges. Firstly, state-of-the-art deep learning models routinely have millions of parameters requiring \~MBs of storage, whereas on-device memory is limited. Furthermore, it is not uncommon for even a single model inference to invoke \~billions of memory accesses and arithmetic operations, all of which consume power and dissipate heat which may drain the limited battery capacity and/or test the device’s thermal limits.
|
| 12 |
+
|
| 13 |
+
Confronting these challenges, a growing body of work has emerged that intends to discover methods for compressing neural network models while limiting any potential loss in model quality. Latencysensitive workloads relying on energy-efficient on-device neural network inference are often memory bandwidth-bound, and model compression offers the two-fold benefit of reducing the total number of energy-intensive memory accesses as well as improving the inference time due to an effectively higher memory bandwidth for fetching compressed model parameters. Within the realm of model compression techniques, pruning away (forcing to zero) the less salient connections (parameters) in the neural network has been shown to reduce the number of nonzero parameters in the model with little to no loss in the final model quality. Model pruning enables trading off a small degradation in model quality for a reduction in model size, potentially reaping improvements in inference time and energy-efficiency. The resulting pruned model typically has sparse connection matrices, so efficient inference using these sparse models requires purpose-built hardware capable of loading sparse matrices and/or performing sparse matrix-vector operations (Zhang et al., 2016; Han et al., 2016; Parashar et al., 2017). Also, representing sparse matrices carries with it an additional storage overhead increasing the model’s net memory footprint which must also be taken into consideration.
|
| 14 |
+
|
| 15 |
+
In this work, we perform a closer examination of the effectiveness of model pruning as a means for model compression. From the perspective of on-device neural network inference, given a bound on the model’s memory footprint, how can we arrive at the most accurate model? We aim to answer this question by comparing the quality of the models obtained through two distinct methods: (1) training a large model, but pruned to obtain a sparse model with a small number of nonzero parameters (large-sparse); and (2) training a small-dense model with size comparable to the large-sparse model. Both of these methods expose a model accuracy and size tradeoff, but differ remarkably in terms of their implications on the design of the underlying hardware architecture. For this comparative study, we pick models across a diverse set of application domains: InceptionV3 (Szegedy et al., 2016) and MobileNets (Howard et al., 2017) for image recognitions tasks, stacked LSTMs for language modeling, and seq2seq models used in Google’s Neural Machine Translation (Wu et al., 2016) system. In the process of this investigation, we also develop a simple gradual pruning approach that requires minimal tuning and can be seamlessly incorporated within the training process and demonstrate its applicability and performance on an assortment of neural network architectures.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
Early works in the 1990s (LeCun et al., 1990; Hassibi et al., 1993) performed pruning using a second-order Taylor approximation of the increase in the loss function of the network when a weight is set to zero. In Optimal Brain Damage (LeCun et al., 1990), the saliency for each weight was computed using a diagonal Hessian approximation, and the low-saliency weights were pruned from the network and the network was retrained. In Optimal Brain Surgeon (Hassibi et al., 1993), the saliency for each weight was computed using the inverse Hessian matrix, and the low-saliency weights were pruned and all other weights in the network were updated using the Hessian matrix.
|
| 20 |
+
|
| 21 |
+
More recently, magnitude-based weight pruning methods have become popular techniques for network pruning (Han et al., 2015b;a; See et al., 2016; Narang et al., 2017). Magnitude-based weight pruning techniques are computationally efficient, scaling to large networks and datasets. Our automated gradual pruning algorithm prunes the smallest magnitude weights to achieve a preset level of network sparsity. In contrast with the works listed above, our paper focuses on comparing the model accuracy and size tradeoff of large-sparse versus small-dense models.
|
| 22 |
+
|
| 23 |
+
A work similar to ours is the work by Narang et al. (2017) on pruning a RNN and GRU model for speech recognition and showing that a sparse RNN that was pruned outperformed a dense RNN trained normally of comparable size. While they provide one data point comparing the performance of a sparse vs dense model, our work does an extensive comparison of sparse vs dense models across a wide range of models in different domains (vision and NLP). Narang et al. also introduce a gradual pruning scheme based on pruning all the weights in a layer less than some threshold (manually chosen) which is linear with some slope in phase 1 and linear with some slope in phase 2 followed by normal training. Compared to their approach, we do not have two phases and do not have to choose two slopes, and we do not need to choose weight thresholds for each layer (we rely on a sparsity schedule which determines the weight thresholds). Thus, our technique is simpler, doesn’t require much hyperparameter tuning, and is shown to perform well across different models.
|
| 24 |
+
|
| 25 |
+
Within the context of reducing model size by removing redundant connections, several recent works (Anwar et al., 2015; Lebedev & Lempitsky, 2015; Li et al., 2016; Changpinyo et al., 2017) propose techniques to prune and induce sparsity in a structured way, motivated primarily by the desire to speedup computations on existing hardware architectures optimized for dense linear algebra. Such techniques perform coarse-grain pruning and depend critically on the structure of the convolutional layers, and may not be directly extensible to other neural network architectures that lack such structural properties (LSTMs for instance). On the contrary, our method does not make any assumptions about the structure of the network or its constituent layers and is therefore more generally applicable.
|
| 26 |
+
|
| 27 |
+
While pruning focuses on reducing the number of non-zero parameters, in principle, model pruning can be used in conjunction with other techniques to further reduce model size. Quantization techniques aim to reduce the number of bits required to represent each parameter from 32-bit floats to 8 bits or fewer. Different quantization techniques such as fixed-point quantization (Vanhoucke et al., 2011) or vector quantization (Gong et al., 2014) achieve different compression ratios and accuracies but also require different software or hardware to support inference at runtime. Pruning can be combined with quantization to achieve maximal compression (Han et al., 2015a). In addition, an emerging area of research is low precision networks where the parameters and/or activations are quantized to 4 bits or fewer (Courbariaux et al., 2015; Lin et al., 2015; Hubara et al., 2016; Rastegari et al., 2016; Zhu et al., 2016). Besides quantization, other potentially complementary approaches to reducing model size include low-rank matrix factorization (Denil et al., 2013; Denton et al., 2014; Jaderberg et al., 2014; Lebedev et al., 2014) and group sparsity regularization to arrive at an optimal layer size (Alvarez & Salzmann, 2016).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Sparsity function used for gradual pruning
|
| 31 |
+
|
| 32 |
+
Table 1: Model size and accuracy tradeoff for sparse-InceptionV3
|
| 33 |
+
|
| 34 |
+
<table><tr><td>Sparsity</td><td>NNZ params</td><td>Top-1 acc.</td><td>Top-5 acc.</td></tr><tr><td>0%</td><td>27.1M</td><td>78.1%</td><td>94.3%</td></tr><tr><td>50%</td><td>13.6M</td><td>78.0%</td><td>94.2%</td></tr><tr><td>75%</td><td>6.8M</td><td>76.1%</td><td>93.2%</td></tr><tr><td>87.5%</td><td>3.3M</td><td>74.6%</td><td>92.5%</td></tr></table>
|
| 35 |
+
|
| 36 |
+
# 3 METHODS
|
| 37 |
+
|
| 38 |
+
We extend the TensorFlow (Abadi et al., 2015) framework to prune the network’s connections during training. For every layer chosen to be pruned, we add a binary mask variable which is of the same size and shape as the layer’s weight tensor and determines which of the weights participate in the forward execution of the graph. We inject ops into the TensorFlow training graph to sort the weights in that layer by their absolute values and mask to zero the smallest magnitude weights until some desired sparsity level $s$ is reached. The back-propagated gradients flow through the binary masks, and the weights that were masked in the forward execution do not get updated in the backpropagation step. We introduce a new automated gradual pruning algorithm in which the sparsity is increased from an initial sparsity value $s _ { i }$ (usually 0) to a final sparsity value $s _ { f }$ over a span of $n$ pruning steps, starting at training step $t _ { 0 }$ and with pruning frequency $\Delta t$ :
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
s _ { t } = s _ { f } + ( s _ { i } - s _ { f } ) \left( 1 - \frac { t - t _ { 0 } } { n \Delta t } \right) ^ { 3 } \mathrm { ~ f o r ~ } t \in \{ t _ { 0 } , ~ t _ { 0 } + \Delta t , ~ . . . , ~ t _ { 0 } + n \Delta t \}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
The binary weight masks are updated every $\Delta t$ steps as the network is trained to gradually increase the sparsity of the network while allowing the network training steps to recover from any pruninginduced loss in accuracy. In our experience, varying the pruning frequency $\Delta t$ between 100 and 1000 training steps had a negligible impact on the final model quality. Once the model achieves the target sparsity $s _ { f }$ , the weight masks are no longer updated. The intuition behind this sparsity function in equation (1) is to prune the network rapidly in the initial phase when the redundant connections are abundant and gradually reduce the number of weights being pruned each time as there are fewer and fewer weights remaining in the network, as illustrated in Figure 1. In the experimental results presented in this paper, pruning is initiated after the model has been trained for a few epochs or from a pre-trained model. This determines the value for the hyperparameter $t _ { 0 }$ . A suitable choice for $n$ is largely dependent on the learning rate schedule. Stochastic gradient descent (and its many variants) typically decay the learning rate during training, and we have observed that pruning in the presence of an exceedingly small learning rate makes it difficult for the subsequent training steps to recover from the loss in accuracy caused by forcing the weights to zero. At the same time, pruning with too high of a learning rate may mean pruning weights when the weights have not yet converged to a good solution, so the pruning schedule should be chosen closely with the learning rate schedule.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: (a) The gradual sparsity function and exponentially decaying learning rate used for training sparse-InceptionV3 models. (b) Evolution of the model’s accuracy during the training process
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: MobileNet sparse vs dense results
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 4: PTB sparse vs dense results
|
| 54 |
+
|
| 55 |
+
Figure 2a shows the learning rate and the pruning schedule used for training sparse-InceptionV3 (Szegedy et al., 2016) models. All the convolutional layers in this model are pruned using the same sparsity function, and pruning occurs in the regime where the learning rate is still reasonably high to allow the network to heal from the pruning-induced damage. Figure 2b offers more insight into how this pruning scheme interacts with the training procedure. For the $8 7 . 5 \%$ sparse model, with the gradual increase in sparsity, there comes a point when the model suffers a near-catastrophic degradation, but recovers nearly just as quickly with continued training. This behavior is more pronounced in the models trained to have higher sparsity. Table 1 compares the performance of sparse-InceptionV3 models pruned to varying extents. As expected, there is a gradual degradation in the model quality as the sparsity increases. However, a $50 \%$ sparse model performs just as well as the baseline $0 \%$ sparsity), and there is only a $2 \%$ decrease in top-5 classification accuracy for the $8 7 . 5 \%$ sparse model which offers an ${ 8 } \mathbf { { x } }$ reduction in number of nonzero (NNZ) model parameters. Also note that since the weights are initialized randomly, the sparsity in the weight tensors does not exhibit any specific structure. Furthermore, the pruning method described here does not depend on any specific property of the network or the constituent layers, and can be extended directly to a wide-range of neural network architectures.
|
| 56 |
+
|
| 57 |
+
# 4 COMPARING large-sparse AND small-dense MODELS
|
| 58 |
+
|
| 59 |
+
# 4.1 MOBILENETS
|
| 60 |
+
|
| 61 |
+
MobileNets are a class of efficient convolutional neural networks designed specifically for mobile vision applications (Howard et al., 2017). Instead of using standard convolutions, MobileNets are based on a form of factorized convolutions called depthwise separable convolution. Depthwise separable convolutions consist of a depthwise convolution followed by a 1x1 convolution called a pointwise convolution. This factorization significantly reduces the number of parameters in the model by filtering and combining input channels in two separate steps instead of together as in the standard convolution. The MobileNet architecture consists of one standard convolution layer acting on the input image, a stack of depthwise separable convolutions, and finally averaging pooling and fully connected layers. For the dense baseline model with width multiplier 1.0, there are a total of 4.21M parameters, $9 9 \%$ of which are in the 1x1 pointwise convolution layers $( 7 4 . 6 \% )$ and fully connected layers $( 2 4 . 3 \% )$ . We do not prune the parameters in the one standard convolution layer and in the depthwise convolution layers since there are very few parameters in those layers $( 1 . 1 \% )$ .
|
| 62 |
+
|
| 63 |
+
Table 2: MobileNet sparse vs dense results
|
| 64 |
+
|
| 65 |
+
<table><tr><td>Width</td><td>Sparsity</td><td>NNZ params</td><td>Top-1 acc.</td><td>Top-5 acc.</td></tr><tr><td>0.25</td><td>0%</td><td>0.46M</td><td>50.6%</td><td>75.0%</td></tr><tr><td>0.5</td><td>0%</td><td>1.32M</td><td>63.7%</td><td>85.4%</td></tr><tr><td>0.75</td><td>0%</td><td>2.57M</td><td>68.4%</td><td>88.2%</td></tr><tr><td rowspan="4">1.0</td><td>0%</td><td>4.21M</td><td>70.6%</td><td>89.5%</td></tr><tr><td>50%</td><td>2.13M</td><td>69.5%</td><td>89.5%</td></tr><tr><td>75%</td><td>1.09M</td><td>67.7%</td><td>88.5%</td></tr><tr><td>90%</td><td>0.46M</td><td>61.8%</td><td>84.7%</td></tr><tr><td></td><td>95%</td><td>0.25M</td><td>53.6%</td><td>78.9%</td></tr></table>
|
| 66 |
+
|
| 67 |
+
Table 3: PTB sparse vs dense results
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Model</td><td>Sparsity</td><td>NNZ params</td><td>Per- plexity</td></tr><tr><td>Small</td><td>0%</td><td>4.6M</td><td>115.30</td></tr><tr><td rowspan="5">Medium</td><td>0%</td><td>19.8M</td><td>83.37</td></tr><tr><td>80%</td><td>4.0M</td><td>83.87</td></tr><tr><td>85%</td><td>3.0M</td><td>85.17</td></tr><tr><td>90%</td><td>2.0M</td><td>87.86</td></tr><tr><td>95% 97.5%</td><td>1.0M 0.5M</td><td>96.30 113.6</td></tr><tr><td rowspan="5">Large</td><td>0%</td><td>66M</td><td>78.45</td></tr><tr><td>80%</td><td>13.2M</td><td>77.52</td></tr><tr><td>85%</td><td>9.9M</td><td>78.31</td></tr><tr><td>90%</td><td>6.6M</td><td>80.24</td></tr><tr><td>95%</td><td>3.3M</td><td>87.83</td></tr><tr><td></td><td>97.5%</td><td>1.7M</td><td>103.20</td></tr></table>
|
| 70 |
+
|
| 71 |
+
The width multiplier is a parameter of the MobileNet network that allows trading off the accuracy of the model with the number of parameters and computational cost. The width multiplier of the baseline model is 1.0. For a given width multiplier $\alpha \in ( 0 , 1 ]$ , the number of input channels and the number of output channels in each layer is scaled by $\alpha$ relative to the baseline 1.0 model. We compare the performance of dense MobileNets trained with width multipliers 0.75, 0.5, and 0.25 with the performance of sparse MobileNets pruned from dense 1.0 MobileNet in Figure 3 and Table 2 on the ImageNet dataset. We see that for a given number of non-zero parameters, sparse MobileNets are able to outperform dense MobileNets. For example, the $7 5 \%$ sparse model (which has 1.09 million parameters and a top-1 accuracy of $6 7 . 7 \%$ ) outperforms the dense 0.5 MobileNet (which has 1.32 million parameters and a top-1 accuracy of $6 3 . 7 \%$ ) by $4 \%$ in top-1 accuracy while being smaller. Similarly, the $90 \%$ sparse model (which has 0.46 million parameters and a top-1 accuracy of $6 1 . 8 \%$ ) outperforms the dense 0.25 MobileNet (which has 0.46 million parameters and a top-1 accuracy of $5 0 . 6 \%$ by $1 0 . 2 \%$ in top-1 accuracy while having the same number of non-zero parameters.
|
| 72 |
+
|
| 73 |
+
Overall, pruning is a promising approach for model compression even for an architecture that was designed to be compact and efficient by using depthwise separable convolutions instead of standard convolutions as a factorization-like technique to reduce the number of parameters. The sparsity parameter is shown to be an effective way to trade off the accuracy of a model with its memory usage and compares favorably with the width multiplier in MobileNet. Training a sparse MobileNet using our gradual pruning algorithm is also easy. For pruning a dense MobileNet, we used the same learning rate schedule as for training a dense MobileNet but with an initial learning rate 10 times smaller than for training a dense MobileNet, and all other hyperparameters were kept the same.
|
| 74 |
+
|
| 75 |
+
# 4.2 PENN TREE BANK (PTB) LANGUAGE MODEL
|
| 76 |
+
|
| 77 |
+
We train an LSTM language model on the Penn Tree Bank dataset using the models and training procedure described in Zaremba et al. (2014). At each time step, the LSTM language model outputs the probability of the next word in the sentence given the history of previous words. The loss function is the average negative log probability of the target words, and the perplexity is the exponential of the loss function. The language model is composed of an embedding layer, 2 LSTM layers, and a softmax layer. The vocabulary size is 10,000, and the LSTM hidden layer size is 200 for the small model, 650 for the medium model, and 1,500 for the large model. In the case of the large model, there are 15M parameters in the embedding layer, 18M parameters in each of the two LSTM layers, and 15M parameters in the softmax layer for a total of 66M parameters. Different hyperparameters are used to train the different-sized models. When pruning a model of a certain size, we use the same hyperparameters that were used for training the dense model of that size. We compare the performance of the dense models with sparse models pruned from medium and large to $80 \%$ , $8 5 \%$ , $90 \%$ , $9 5 \%$ , and $9 7 . 5 \%$ sparsity in Figure 4 and Table 3. In this case, we see that sparse models are able to outperform dense models which have significantly more parameters (note the log scale for the number of parameters). The $90 \%$ sparse large model (which has 6.6 million parameters and a perplexity of 80.24) is able to outperform the dense medium model (which has 19.8 million parameters and a perplexity of 83.37), a model which has 3 times more parameters. Compared with MobileNet, pruning PTB model likely gives better results because the PTB model is larger with significantly more parameters. Our results show that pruning works very well not only on the dense LSTM weights and dense softmax layer but also the dense embedding matrix. This suggests that during the optimization procedure the neural network can find a good sparse embedding for the words in the vocabulary that works well together with the sparse connectivity structure of the LSTM weights and softmax layer.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 5: Comparison of sparse vs dense NMT models for English to German (EN-DE) and German to English (DE-EN) translation
|
| 81 |
+
|
| 82 |
+
From Figure 4 and Table 3, we also see that the $85 \%$ sparse medium model (which has 3 million parameters and a perplexity of 85.17) outperforms the $9 5 \%$ sparse large model (which has 3.3 million parameters and a perplexity of 87.83). The accuracy of the $9 5 \%$ sparse large model is comparable to the accuracy of the $90 \%$ sparse medium model (which has 2 million parameters and a perplexity of 87.86). Together, these results suggest that there is an optimal compression range when pruning. In the case of PTB, pruning to $9 5 \%$ sparsity for a compression ratio of $2 0 \mathrm { x }$ significantly degrades the performance of the sparse model compared to pruning to $90 \%$ sparsity for a compression ratio of $1 0 \mathrm { x }$ , as seen in Figure 4 from the curve of perplexity vs. number of parameters traced by either of the sparse models. These results suggest that in order to get the best-performing sparse model of a certain size, we should train a dense model that is $5 \mathbf { X } { - } 1 0 \mathbf { X }$ larger and then prune to the desired number of parameters rather than taking the largest and best-performing dense model and pruning this model by $2 0 \mathrm { x }$ or more to the desired number of parameters, assuming that the difference in performance of the two dense baseline models is not that large. We note that it may be possible to obtain slightly better results for pruning to $9 5 \%$ sparsity or higher with more hyperparameter tuning, and the results we obtained for pruning a model of a certain size were from using exactly the same hyperparameter configuration as for training the dense model of that size.
|
| 83 |
+
|
| 84 |
+
# 4.3 GOOGLE NEURAL MACHINE TRANSLATION
|
| 85 |
+
|
| 86 |
+
The Google Neural Machine Translation (NMT) architecture is a seq2seq model with attention (Wu et al., 2016). We use the open-source TensorFlow implementation available at Luong et al. (2017). The model is based on an encoder-decoder architecture. The encoder has an embedding layer which maps the source vocabulary of 36,548 words into a $k$ -dimensional space, 1 bidirectional LSTM layer, and 3 standard LSTM layers. The decoder has an embedding layer which maps the target vocabulary of 36,548 words into a $k$ -dimensional space, 4 LSTM layers with attention, and finally a softmax layer. For the dense baseline model with number of units $k = 1 0 2 4$ , there are $3 7 . 4 \mathbf { M }$ parameters in each of the encoder embedding, decoder embedding, and softmax layers and $9 8 . 6 \mathbf { M }$ parameters in all of the LSTM layers for a total of 211M parameters. We apply pruning to all of the LSTM layers, embedding layers, and softmax layers, but we do not prune the attention parameters of which there are relatively few. The other dense models were obtained by varying the number of units $k$ . We use the WMT16 German and English dataset with news-test2013 as the dev set and news-test2015 as the test set. The BLEU score is reported as a measure of the translation quality. The learning rate schedule used for training the dense models is 170K iterations with initial learning rate 1.0 and 170K iterations with learning rate decay of 0.5 every 17K iterations. For pruning a dense model, the learning rate schedule we use is 70K iterations with initial learning rate 0.5 and 170K iterations with learning rate decay of 0.5 every 17K iterations, and all other hyperparameters were kept the same.
|
| 87 |
+
|
| 88 |
+
Table 4: NMT sparse vs dense results
|
| 89 |
+
|
| 90 |
+
<table><tr><td># units</td><td>Sparsity</td><td> NNZ params</td><td>EN-DE BLEU score</td><td>DE-EN BLEU score</td></tr><tr><td>256</td><td>0%</td><td>34M</td><td>23.52</td><td>26.52</td></tr><tr><td>512</td><td>0%</td><td>81M</td><td>26.05</td><td>28.88</td></tr><tr><td>768</td><td>0%</td><td>140M</td><td>26.63</td><td>29.41</td></tr><tr><td>1024</td><td>0%</td><td>211M</td><td>26.77</td><td>29.47</td></tr><tr><td></td><td>80%</td><td>44M</td><td>26.86</td><td>29.50</td></tr><tr><td></td><td>85%</td><td>33M</td><td>26.52</td><td>29.24</td></tr><tr><td></td><td>90%</td><td>23M</td><td>26.19</td><td>28.81</td></tr></table>
|
| 91 |
+
|
| 92 |
+
Since we noticed that the NMT training procedure had high variance, we tested several pruning schemes applied to NMT. Our standard implementation of gradual pruning increases the sparsity of every layer to the same sparsity level at each pruning step. We tested a variant which we call “layerwise constant” sparsity: instead of simultaneously increasing the sparsity of all layers to some sparsity level at each pruning step, we subdivide the pruning interval and increase the sparsity of one layer at a time to that sparsity level. This potentially has the effect of reducing the impact of pruning and allowing the network to recover better with training. Finally, we compared with “global” pruning: we prune the smallest magnitude weights across the entire network, regardless of which layer they are in. Global pruning produces a different sparsity level for each layer and was shown to perform well on NMT in the work of See et al. (2016). Overall, the layerwise constant pruning scheme performed best on average, so we report the results with the layerwise constant pruning scheme in Figure 5 and Table 4. We note that there is high variance in the results due to the stochasticity of the training process, as illustrated by the error bar in Figure 5 which is the standard deviation of the BLEU score of 10 randomly initialized and independently trained NMT models.
|
| 93 |
+
|
| 94 |
+
The results in Table 4 show that for $80 \%$ sparsity (5x compression), the pruned model actually achieves a slightly higher BLEU score than the baseline model (though we note the error bar). For $8 5 \%$ sparsity, the BLEU score drops by around 0.25, and for $90 \%$ sparsity, the BLEU score drops by around 0.6. When we compare the performance of dense and sparse models in Figure 5 and Table 4, we again see that sparse models outperform even larger-sized dense models. The BLEU score of the dense model falls off quickly after $2 \mathbf { x }$ reduction in model size while the BLEU score of the sparse model starts to fall off only after ${ 5 } \mathbf { x }$ reduction in NNZ parameters. For example, the $90 \%$ sparse 1024-unit model is comparable to or outperforms the dense 512-unit model (26.19 vs 26.05 for EN-DE and 28.81 vs 28.88 for DE-EN) despite having $3 . 5 \mathrm { x }$ fewer NNZ params (23M vs 81M).
|
| 95 |
+
|
| 96 |
+
# 5 DISCUSSION
|
| 97 |
+
|
| 98 |
+
The net memory footprint of a sparse model includes the storage for the nonzero parameters and any auxiliary data structures needed for indexing these elements. Pruning models helps reduce the number of nonzero-valued connections in the network; however the overhead in sparse matrix storage inevitably diminishes the achievable compression ratio. The bit-mask sparse matrix representation requires 1 bit per matrix element indicating whether the element is nonzero, and a vector containing all the nonzero matrix elements. This representation incurs a constant overhead regardless of the model sparsity. In the compressed sparse row (column) storage (CSR(C)) adopted in Parashar et al. (2017), each nonzero parameter in the sparse matrix is associated with a count (usually stored as a 4 or 5 bit integer) of the number of zeros preceding it. The overhead in this case is proportional to the NNZ in the model. Table 5 compares these two representations for sparse-MobileNets. The CSR(C) representation can enable higher compression ratio for networks with high sparsity. Note, however, that the bit-mask representation offers marginally lower overhead at smaller sparsity levels.
|
| 99 |
+
|
| 100 |
+
Table 5: Storage overheads associated with bit-mask and CSR(C) sparse matrix representations for sparse-MobileNets
|
| 101 |
+
|
| 102 |
+
<table><tr><td>Sparsity</td><td> NNZ params</td><td>Bit-mask (MB)</td><td>CSR(C) (MB)</td></tr><tr><td>0%</td><td>4.21M</td><td>N/A</td><td>N/A</td></tr><tr><td>50%</td><td>2.13M</td><td>0.52</td><td>1.06</td></tr><tr><td>75%</td><td>1.09M</td><td>0.52</td><td>0.54</td></tr><tr><td>90%</td><td>0.46M</td><td>0.52</td><td>0.23</td></tr><tr><td>95%</td><td>0.25M</td><td>0.52</td><td>0.13</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 6: Comparison of the performance of small-dense and large-sparse models. Model size calculations include overhead for sparse matrix storage and assumes 32-bit (4 bytes) per nonzero element.
|
| 105 |
+
|
| 106 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Small-dense</td><td colspan="2">Large-sparse</td></tr><tr><td>Model size (MB)</td><td>Accuracy (%)</td><td>Model size (MB)</td><td>Accuracy (%)</td></tr><tr><td rowspan="4">MobileNet</td><td>10.28</td><td>68.4</td><td>9.04</td><td>69.5</td></tr><tr><td>5.28</td><td>63.7</td><td>4.88</td><td>67.7</td></tr><tr><td>1.84</td><td>50.6</td><td>2.07</td><td>61.8</td></tr><tr><td></td><td></td><td>1.13</td><td>53.6</td></tr></table>
|
| 107 |
+
|
| 108 |
+
In spite of this overhead, large-sparse models appear to achieve higher accuracy than small-dense models with comparable memory footprint. For instance, MobileNet with width multiplier 1 and sparsity $50 \%$ has similar footprint as MobileNet with width multiplier 0.75, but obtains higher accuracy. Table 6 further highlights the trade-off between model size and accuracy for dense and sparse models. The performance gap between large-sparse and small-dense models widens for larger models such as as the PTB language models and NMT (see Table 3 and Table 4). It is worth noting that the results presented in this work were obtained by training neural networks using 32-bit floating point representation. For neural networks trained to perform inference using reduced precision (8-bit integer, for instance) arithmetic, the memory overhead of sparse matrix storage represents a bigger fraction of the total memory footprint. Quantization of the parameters to a reduced precision number representation is also an effective method for model compression, and the interplay between model quantization and pruning and their collective impact on model accuracy merits a closer examination. We defer that investigation to a future extension to this work.
|
| 109 |
+
|
| 110 |
+
# 6 CONCLUSION
|
| 111 |
+
|
| 112 |
+
This work sheds light on the model size and accuracy trade-off encountered in pruned deep neural networks. We demonstrate that large-sparse models outperform comparably-sized small-dense models across a diverse set of neural network architectures. We also present a gradual pruning technique that can be applied with ease across these different architectures. We believe these results will encourage the adoption of model pruning as a tool for compressing neural networks for deployment in resource-constrained environments. At the same time, we hold the opinion that our results will provide further impetus to the hardware architecture community to customize the next generation of deep learning accelerator architectures to efficiently handle sparse matrix storage and computations.
|
| 113 |
+
|
| 114 |
+
# REFERENCES
|
| 115 |
+
|
| 116 |
+
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 https://www.tensorflow. org/. Software available from tensorflow.org.
|
| 117 |
+
Jose M. Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. CoRR, abs/1611.06321, 2016.
|
| 118 |
+
Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Structured pruning of deep convolutional neural networks. CoRR, abs/1512.08571, 2015.
|
| 119 |
+
Soravit Changpinyo, Mark Sandler, and Andrey Zhmoginov. The power of sparsity in convolutional neural networks. CoRR, abs/1702.06257, 2017.
|
| 120 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. CoRR, abs/1511.00363, 2015.
|
| 121 |
+
Misha Denil, Babak Shakibi, Laurent Dinh, Marc’aurelio Ranzato, and Nando D. Freitas. Predicting parameters in deep learning. In C.j.c. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 2148–2156. 2013.
|
| 122 |
+
Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 1269– 1277. Curran Associates, Inc., 2014.
|
| 123 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir D. Bourdev. Compressing deep convolutional networks using vector quantization. CoRR, abs/1412.6115, 2014.
|
| 124 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. CoRR, abs/1510.00149, 2015a.
|
| 125 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1135–1143. Curran Associates, Inc., 2015b.
|
| 126 |
+
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. CoRR, abs/1602.01528, 2016.
|
| 127 |
+
B. Hassibi, D. G. Stork, and G. J. Wolff. Optimal brain surgeon and general network pruning. In IEEE International Conference on Neural Networks, pp. 293–299 vol.1, 1993. doi: 10.1109/ICNN.1993.298572.
|
| 128 |
+
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. CoRR, abs/1704.04861, 2017.
|
| 129 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. CoRR, abs/1609.07061, 2016.
|
| 130 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. CoRR, abs/1405.3866, 2014.
|
| 131 |
+
Vadim Lebedev and Victor S. Lempitsky. Fast convnets using group-wise brain damage. CoRR, abs/1506.02515, 2015.
|
| 132 |
+
Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan V. Oseledets, and Victor S. Lempitsky. Speeding-up convolutional neural networks using fine-tuned cp-decomposition. CoRR, abs/1412.6553, 2014.
|
| 133 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In D. S. Touretzky (ed.), Advances in Neural Information Processing Systems 2, pp. 598–605. Morgan-Kaufmann, 1990.
|
| 134 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 135 |
+
Zhouhan Lin, Matthieu Courbariaux, Roland Memisevic, and Yoshua Bengio. Neural networks with few multiplications. CoRR, abs/1510.03009, 2015.
|
| 136 |
+
Thang Luong, Eugene Brevdo, and Rui Zhao. Neural machine translation (seq2seq) tutorial, 2017. URL https://github.com/tensorflow/nmt.
|
| 137 |
+
Sharan Narang, Gregory F. Diamos, Shubho Sengupta, and Erich Elsen. Exploring sparsity in recurrent neural networks. CoRR, abs/1704.05119, 2017.
|
| 138 |
+
Angshuman Parashar, Minsoo Rhu, Anurag Mukkara, Antonio Puglielli, Rangharajan Venkatesan, Brucek Khailany, Joel Emer, Stephen W Keckler, and William J Dally. Scnn: An accelerator for compressed-sparse convolutional neural networks. In Proceedings of the 44th Annual International Symposium on Computer Architecture, pp. 27–40. ACM, 2017.
|
| 139 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. CoRR, abs/1603.05279, 2016.
|
| 140 |
+
Abigail See, Minh-Thang Luong, and Christopher D. Manning. Compression of neural machine translation models via pruning. In CoNLL, pp. 291–301. ACL, 2016.
|
| 141 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 142 |
+
Vincent Vanhoucke, Andrew Senior, and Mark Z. Mao. Improving the speed of neural networks on cpus. In Deep Learning and Unsupervised Feature Learning Workshop, NIPS 2011, 2011.
|
| 143 |
+
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.
|
| 144 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. CoRR, abs/1409.2329, 2014.
|
| 145 |
+
Shijin Zhang, Zidong Du, Lei Zhang, Huiying Lan, Shaoli Liu, Ling Li, Qi Guo, Tianshi Chen, and Yunji Chen. Cambricon-x: An accelerator for sparse neural networks. In Microarchitecture (MICRO), 2016 49th Annual IEEE/ACM International Symposium on, pp. 1–12. IEEE, 2016.
|
| 146 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J. Dally. Trained ternary quantization. CoRR, abs/1612.01064, 2016.
|
md/train/SJJySbbAZ/SJJySbbAZ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SJgNwi09Km/SJgNwi09Km.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING LATENT SUPERSTRUCTURES IN VARIATIONAL AUTOENCODERS FOR DEEP MULTIDIMENSIONAL CLUSTERING
|
| 2 |
+
|
| 3 |
+
Xiaopeng $\mathbf { L i } ^ { 1 }$ , Zhourong Chen1, Leonard K. M. Poon2 and Nevin L. Zhang1
|
| 4 |
+
|
| 5 |
+
1 Department of Computer Science and Engineering The Hong Kong University of Science and Technology 2 Department of Mathematics & Information Technology The Education University of Hong Kong {xlibo,zchenbb,lzhang}@cse.ust.hk, kmpoon@eduhk.hk
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
We investigate a variant of variational autoencoders where there is a superstructure of discrete latent variables on top of the latent features. In general, our superstructure is a tree structure of multiple super latent variables and it is automatically learned from data. When there is only one latent variable in the superstructure, our model reduces to one that assumes the latent features to be generated from a Gaussian mixture model. We call our model the latent tree variational autoencoder (LTVAE). Whereas previous deep learning methods for clustering produce only one partition of data, LTVAE produces multiple partitions of data, each being given by one super latent variable. This is desirable because high dimensional data usually have many different natural facets and can be meaningfully partitioned in multiple ways.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Clustering is a fundamental task in unsupervised machine learning, and it is central to many datadriven application domains. Cluster analysis partitions all the data into disjoint groups, and one can understand the structure of the data by examining examples in each group. Many clustering methods have been proposed in the literature (Aggarwal & Reddy, 2013), such as $k$ -means (MacQueen et al., 1967), Gaussian mixture models (Christopher, 2016) and spectral clustering (Von Luxburg, 2007). Conventional clustering methods are generally applied directly on the original data space. However, it is challenging to perform cluster analysis on high dimensional and unstructured data (Steinbach et al., 2004), such as images. It is not only because the dimensionality is high, but also because the original data space is too complex to interpret, e.g. there are semantic gaps between pixel values and objects in images.
|
| 14 |
+
|
| 15 |
+
Recently, deep learning based clustering methods have been proposed that simultanously learn nonlinear embeddings through deep neural networks and perform cluster analysis on the embedding space. The representation learning process learns effective high-level representations from high dimensional data and helps the cluster analysis. This is typically achieved by unsupervised deep learning methods, such as restricted Boltzmann machine (RBM) (Hinton et al., 2006; Hinton & Salakhutdinov, 2006), autoencoders (AE) (Vincent et al., 2008; 2010), variational autoencoders (VAE) (Kingma & Welling, 2014), etc. Previous deep learning based clustering methods (Xie et al., 2016; Guo et al., 2017; Jiang et al., 2017; Yang et al., 2017) assume one single partition over the data and that all attributes define that partition. In real-world applications, however, the assumptions are usually not true. High-dimensional data are often multifaceted and can be meaningfully partitioned in multiple ways based on subsets of attributes (Chen et al., 2012). For example, a student population can be clustered in one way based on course grades and in another way based on extracurricular activities. Movie reviews can be clustered based on both sentiment (positive or negative) and genre (comedy, action, war, etc.). It is challenging to discover the multi-facet structures of data, especially for high-dimensional data.
|
| 16 |
+
|
| 17 |
+
To resolve the above issues, we propose an unsupervised learning method, latent tree variational autoencoder (LTVAE) to learn latent superstructures in variational autoencoders, and simultaneously perform representation learning and structure learning. LTVAE is a generative model, where the data is assumed to be generated from latent features through neural networks, while the latent features themselves are generated from tree-structured Bayesian networks with another level of latent variables as shown in Fig. 1. Each of those latent variables defines a facet of clustering. The proposed method automatically selects subsets of latent features for each facet, and learns the dependency structure among different facets. This is achieved through systematic structure learning. Consequently, LTVAE is able to discover complex structures of data rather than one partition. We also propose efficient learning algorithms for LTVAE with gradient descent and Stepwise EM through message passing.
|
| 18 |
+
|
| 19 |
+
The rest of the paper is organized as follows. The related works are reviewed in Section 2. We introduce the proposed method and learning algorithms in Section 3. In Section 4, we present the empirical results. The conclusion is given in Section 5.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORKS
|
| 22 |
+
|
| 23 |
+
Clustering has been extensively studied in the literature in many aspects (Aggarwal & Reddy, 2013). More complex clustering methods related to structure learning using Bayesian nonparametrics have been proposed, like Dirichlet Process (Blei et al., 2006), Hierarchical Dirichlet Process (HDP) (Teh et al., 2006). However, those are with conventional clustering methods that apply on raw data. Recently, deep learning based clustering methods have drawn more and more attention. A simple two-stage approach is to first learn low-dimensional embeddings using unsupervised feature learning methods, and then perform cluster analysis on the embeddings. However, without any supervision, the representation learning do not necessarily reveal the true cluster structure of the data. DEC (Xie et al., 2016) is a method that simultaneously learns feature representations and cluster assignments through deep autoencoders. It gradually improves the clustering by driving the deep network to learn a better mapping. Improved Deep Embedded Clustering (Guo et al., 2017) improves DEC by keeping the decoder network and adding reconstruction loss to the original clustering loss in DEC. Variational deep embedding (Jiang et al., 2017) is a generative method that models the data generative process using a Gaussian mixture model combined with a VAE, and also performs joint learning of representations and clustering. Similarly, GMVAE (Dilokthanakul et al., 2016) performs joint learning of a GMM and a VAE, but instead generates the mixture components through neural networks. Deep clustering network (DCN) (Yang et al., 2017) is another one that jointly learns an autoencoder and performs k-means clustering. These joint learning methods consistently achieve better clustering results than conventional ones. The method proposed in (Yang et al., 2016) uses convolutional neural networks and jointly learns the representations and clustering in a recurrent framework. All these methods assume flat partitions over the data, and do not attempt the structure learning issue. An exception is hierarchical nonparametric variational autoencoders proposed in (Goyal et al., 2017). It uses nCRP as the prior for VAE to allow infinitely deep and branching tree hierarchy structure and focuses on learning hierarchy of concepts. However, it is still one partition over the data, only that the partitions in upper levels are more general partitions, while those in lower levels more fine-grained. Different from it, our work focuses on multifacets of clustering, for example, the model could make one partition based on identity of subjects, while another partition based on pose.
|
| 24 |
+
|
| 25 |
+
# 3 THE PROPOSED METHOD
|
| 26 |
+
|
| 27 |
+
In this section, we present the proposed latent tree variational autoencoder and the learning algorithms for joint representation learning and structure learning for multidimensional clustering.
|
| 28 |
+
|
| 29 |
+
# 3.1 LATENT TREE VARIATIONAL AUTOENCODER
|
| 30 |
+
|
| 31 |
+
Deep generative models assume that data $\mathbf { x }$ is generated from latent continuous variable $\mathbf { z }$ through some random process. The process consists of two steps: (1) a value $\mathbf { z }$ is generated from some prior distribution $p ( \mathbf { z } )$ ; (2) the observation $x$ is generated from the conditional distribution $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ , which is parameterized through deep neural networks. Thus, it defines the joint distribution between
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Latent Tree Variational Autoencoder
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Inference and gradient through message passing. Solid-arrows denote collecting message, and dashed-arrows denote distributing message.
|
| 38 |
+
|
| 39 |
+
observation $\mathbf { x }$ and latent variable $\mathbf { z }$ :
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
p ( \mathbf { x } , \mathbf { z } ) = p ( \mathbf { z } ) p _ { \theta } ( \mathbf { x } | \mathbf { z } )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
This process is hidden from our view, and we learn this process by maximizing the marginal loglikelihood $p ( \mathbf { x } )$ over the parameters $\theta$ and latent variable $\mathbf { z }$ from data. After the learning, the latent variable $\mathbf { z }$ can be regarded as the deep representations of $\mathbf { x }$ since it captures the most relevant information of $\mathbf { x }$ . Thus, the learning process is also called representation learning.
|
| 46 |
+
|
| 47 |
+
In order to learn the latent structure of $\mathbf { z }$ , for example multidimensional cluster structure, we introduce a set of latent variables $Y _ { 1 } , . . . , Y _ { l }$ on top of $\mathbf { z }$ . A single $z$ or multiple $z$ ’s form a node $\mathbf { z } _ { b }$ . Suppose variables in $\mathbf { z }$ form $B$ nodes of ${ \bf z } _ { 1 } , \cdots , { \bf z } _ { B }$ . Each latent variable $Y$ may be only connected to a subset of nodes, and the dependency of each $\mathbf { z } _ { b }$ and its parent $Y$ is characterized by a conditional Gaussian distribution. Furthermore, the latent variables $Y _ { 1 } , . . . , Y _ { l }$ are connected to each other, and the dependency of a latent variable $Y$ on its parent $Y ^ { \prime }$ is characterized by a conditional distribution $P ( Y | Y ^ { \prime } )$ . This essentially forms a Bayesian network. And if we restrict the network to be treestructured, the $\mathbf { z }$ and $\mathbf { Y }$ together form a latent tree model (Zhang, 2004; Poon et al., 2010; 2013; Mourad et al., 2013; Pearl, 2014; Zhang & Poon, 2017) with $\mathbf { z }$ being the observed variables and $\mathbf { Y }$ being the latent variables. For multidimensional clustering, each latent variable $Y$ is taken to be a discrete variable, where each discrete state $y$ of $Y$ defines a cluster. Each latent variable $Y$ thus defines a facet partition over the data based on subset of attributes and multiple $Y$ ’s define multiple facets. Given a value $y$ of $Y$ , $\mathbf { z } _ { b }$ follows a conditional Gaussian distribution $\dot { P } ( \mathbf { z } _ { b } | y ) = \mathcal { N } ( \mu _ { y } , \bar { \Sigma } _ { y } )$ with mean vector $\mu _ { y }$ and covariance matrix $\Sigma _ { y }$ . Thus, each $\mathbf { z } _ { b }$ and its parent constitute a Gaussian mixture model (GMM). Suppose the parent of a node is denoted as $\pi ( \cdot )$ , the maginal distribution of $\mathbf { z }$ is defined as follows
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
p ( \mathbf { z } ) = \sum _ { \mathbf { Y } } \prod _ { j = 1 } ^ { l } p ( y _ { j } | \pi ( Y _ { j } ) ) \prod _ { b = 1 } ^ { B } \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { \pi ( \mathbf { z } _ { b } ) } , \boldsymbol { \Sigma } _ { \pi ( \mathbf { z } _ { b } ) } ) ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
which sums over all possible combinations of $\mathbf { Y }$ states. As a matter of fact, a GMM is a Gaussian LTM that has only one latent variable connecting to all observed variables.
|
| 54 |
+
|
| 55 |
+
Let the latent structure of $\mathbf { Y }$ be $s$ , defining the number of latent variables in $\mathbf { Y }$ , the number of discrete states in each variable $Y$ and the connectivity structure among all variables in $\mathbf { z }$ and $\mathbf { Y }$ . And let the parameters for all conditional probabilities in the latent structure be $\Theta$ . Both the latent structure $s$ and the latent parameters $\Theta$ are unknown. We aim to jointly learn data representations and the latent structure. The proposed LTVAE model is shown in Fig. 1. The latent structure $s$ are automatically learned from data and will be discussed in a later section.
|
| 56 |
+
|
| 57 |
+
Due to the existence of the generation network, the inference of the model is intratable. Instead, we do amortized variational inference for the latent variable $\mathbf { z }$ by introducing an inference network (Kingma & Welling, 2014) and define an approximate posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ . The evidence lower bound (ELBO) $\mathcal { L } _ { \mathrm { E L B O } }$ of the marginal loglikelihood of the data given $( \cal S , \Theta )$ is:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathcal { L } _ { \mathrm { E L B O } } ( \mathbf { x } ) = \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) ] + \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \log \sum _ { \mathbf { y } } p _ { S } ( \mathbf { z } , \mathbf { y } ; \Theta ) ] + \mathbb { H } [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) ] ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\begin{array} { r } { \log \sum _ { \mathbf { y } } p _ { S } ( \mathbf { z } , \mathbf { y } ; \Theta ) } \end{array}$ is the marginal loglikelihood of the latent variable $\mathbf { z }$ under the latent tree model, and $\mathbb { H } [ \cdot ]$ is the entropy. The conditional generative distribution $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ could be a Gaussian distribution if the input data is real-valued, or a Bernoulli distribution if binary, parameterized by the generation network. Using Monte Carlo sampling, the ELBO can be asymptotically estimated by
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathcal { L } _ { \mathrm { E L B O } } ( \mathbf { x } ) \simeq \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \log p _ { \boldsymbol \theta } ( \mathbf { x } | \mathbf { z } ^ { ( i ) } ) + \log \sum _ { \mathbf { y } } p _ { \mathcal { S } } ( \mathbf { z } ^ { ( i ) } , \mathbf { y } ; \boldsymbol \Theta ) + \mathbb { H } [ q _ { \boldsymbol \phi } ( \mathbf { z } | \mathbf { x } ) ] ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbf { z } ^ { ( i ) } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . The term $\mathbb { H } [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) ]$ can be computed analytically if we choose the form of $q _ { \phi } ( { \bf z } | { \bf x } )$ to be a Gaussian distribution $\begin{array} { r } { \mathcal { N } ( { \bf z } ; \mu _ { { \bf x } } , \sigma _ { { \bf x } } ) \colon \mathbb { H } [ q _ { \phi } ( { \bf z } | { \bf x } ) ] = \frac { J } { 2 } \log ( 2 \pi ) + \frac { 1 } { 2 } \sum _ { j = 1 } ^ { J } ( 1 + \log \sigma _ { j } ^ { 2 } ) . } \end{array}$ , where $J$ is the dimensionality of $\mathbf { z }$ .
|
| 70 |
+
|
| 71 |
+
Furthermore, the marginal loglikelihood $\begin{array} { r } { \log \sum _ { \mathbf { y } } p _ { \mathcal { S } } ( \mathbf { z } ^ { ( i ) } , \mathbf { y } ; \Theta ) } \end{array}$ can be computed efficiently through message passing. Message passing is an efficient algorithm for inference in Bayesian networks (Koller & Friedman, 2009; Poon et al., 2013). In message passing, we first build a clique tree using the factors in the defined probability density. Because of the tree structure, each $\mathbf { z } _ { b }$ along with its parent form a clique with the potential $\psi ( \mathbf { z } _ { b } , y )$ being the corresponding conditional distribution. This is illustrated in Fig. 2. With the sampled $\mathbf { z } ^ { ( i ) }$ , we can compute the message $\psi ^ { \prime } ( y )$ by absorbing the evidence from $\mathbf { z }$ . During collecting message phase, the message $\psi ^ { \prime } ( y )$ are sent towards the pivot. After receiving all messages, the pivot distributes back messages towards all $\mathbf { z }$ . Both the posterior of $\mathbf { Y }$ and the marginal loglikelihood of $\mathbf { z } ^ { ( i ) }$ thus can be computed in the final normalization step.
|
| 72 |
+
|
| 73 |
+
3.2 PARAMETER LEARNING THROUGH GRADIENT DESCENT AND STEPWISE EM WITH MESSAGE PASSING
|
| 74 |
+
|
| 75 |
+
In this section, we propose efficient learning algorithms for LTVAE through gradient descent and stepwise EM with message passing.
|
| 76 |
+
|
| 77 |
+
Given the latent tree model $( \cal S , \Theta )$ , the parameters of neural networks can be efficiently optimized through stochastic gradient descent (SGD). However, in order to learn the model, it is important to efficiently compute the gradient of the marginal loglikelihood $\log p _ { S } ( \mathbf { z } ; \Theta )$ from the latent tree model, the third term in Eq. 4. Here, we propose an efficient method to compute gradient through message passing. Let $\mathbf { z } _ { b }$ be the variables that we want to compute gradient with respect to, and let $Y _ { b }$ be the parent node. The marginal loglikelihood of full $\mathbf { z }$ can be written as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\log p _ { \mathcal { S } } ( \mathbf { z } ; \Theta ) = \log [ \sum _ { y _ { b } } \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { y _ { b } } , \boldsymbol { \Sigma } _ { y _ { b } } ) f ( y _ { b } ) ] ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $f ( y _ { b } )$ is the collection of all the rest of the terms not containing $\mathbf { z } _ { b }$ . The gradient $\mathbf { g } _ { \mathbf { z } _ { b } }$ of the marginal loglikelihood $\log p s ( \mathbf { z } ; \Theta )$ w.r.t $\mathbf { z } _ { b }$ thus can be computed as
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathbf { g } _ { \mathbf { z } _ { b } } = \frac { 1 } { p _ { S } ( \mathbf { z } ; \boldsymbol { \Theta } ) } \frac { \partial \sum _ { y _ { b } } f ( y _ { b } ) \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { y _ { b } } , \boldsymbol { \Sigma } _ { y _ { b } } ) } { \partial \mathbf { z } _ { b } } = \sum _ { y _ { b } } p ( y _ { b } | \mathbf { z } ) \frac { \partial \log [ f ( y _ { b } ) \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { y _ { b } } , \boldsymbol { \Sigma } _ { y _ { b } } ) ] } { \partial \mathbf { z } _ { b } }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $p ( \boldsymbol { y } _ { b } | \mathbf { z } )$ is the posterior probability of $y _ { b }$ and can be computed efficiently with message passing as described in the previous section. The detailed derivation is in Appendix E. Since $\mathbf { z } = [ \bar { \mathbf { z } _ { 1 } } , \bar { \mathbf { . . . , z } _ { B } } ]$ , we have
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\frac { \partial \log p ( \mathbf { z } ) } { \partial \mathbf { z } } = \left[ \frac { \partial \log p ( \mathbf { z } ) } { \partial \mathbf { z } _ { 1 } } , . . . , \frac { \partial \log p ( \mathbf { z } ) } { \partial \mathbf { z } _ { B } } \right] = \left[ \mathbf { g } _ { \mathbf { z } _ { 1 } } , . . . , \mathbf { g } _ { \mathbf { z } _ { B } } \right] .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
With the efficient computation of the third term in Eq. 4 and its gradient w.r.t $\mathbf { z }$ through message passing, the parameters of inference network and generation network can be efficiently optimized through SGD.
|
| 96 |
+
|
| 97 |
+
In order to jointly learn the parameters of the latent tree $\Theta$ , we propose Stepwise EM algorithm based on mini-batch of data. Specifically, we maximize the third term in Eq. 4, i.e. the marginal loglikelihood of $\mathbf { z }$ under the latent tree. In the Stepwise E-step, we compute the distributions $\bar { P ( } y , y ^ { \prime } | \mathbf { z } , \theta ^ { ( t - 1 ) } )$ and $P ( y | \mathbf { z } , \theta ^ { ( t - 1 ) } )$ for each latent node $Y$ and its parent $Y ^ { \prime }$ . In the Stepwise
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 3: Structure search operators. The digits above the nodes denote the number of discrete states. Node deletion, state deletion and unpouching are the inverse of node insertion, state insertion and pouching, respectively.
|
| 101 |
+
|
| 102 |
+
M-step, we estimate the new parameter $\theta ^ { ( t ) }$ . Let $\mathbf { s } ( \mathbf { z } , \mathbf { y } )$ be a vector the sufficient statistics for a single data case. Let $\bar { \mathbf { s } } = \mathbb { E } _ { p s ( \mathbf { y } | \mathbf { z } ; \boldsymbol { \Theta } ) } [ \mathbf { s } ( \mathbf { z } , \mathbf { y } ) ]$ be the expected sufficient statistics for the data case, where the expectation is w.r.t the posterior distribution of $\mathbf { y }$ with current parameter. And let $\begin{array} { r } { \boldsymbol { \mu } = \sum _ { i = 1 } ^ { N } \bar { \mathbf { s } } _ { i } } \end{array}$ be the sum of the expected sufficient statistics. The update of the parameter $\Theta$ is performed as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r l } & { ~ \bar { \mathbf { s } } _ { i } ^ { t } = \mathbb { E } _ { p s ( \mathbf { y } _ { i } \mid \mathbf { z } _ { i } ; \boldsymbol { \Theta } ^ { t } ) } [ \mathbf { s } ( \mathbf { z } _ { i } , \mathbf { y } _ { i } ) ] } \\ & { ~ \mu ^ { t + 1 } = \mu ^ { t } + \eta ( \bar { \mathbf { s } } _ { i } ^ { t } - \mu ^ { t } ) } \\ & { \boldsymbol { \Theta } ^ { t + 1 } = \underset { \boldsymbol { \Theta } } { \arg \operatorname* { m a x } } l ( \mu ^ { t + 1 } , \boldsymbol { \Theta } ) , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\eta$ is the learning rate and $l$ is the complete data loglikelihood. Each iteration of update of LTVAE thus is composed of one iteration of gradient descent update for the neural network parameters and one iteration of Stepwise EM update for the latent tree model parameters with a mini-batch of data.
|
| 109 |
+
|
| 110 |
+
# 3.3 STRUCTURE LEARNING
|
| 111 |
+
|
| 112 |
+
For the latent structure $s$ , there are four aspects need to determine: the number of latent variables, the cardinalities of latent variables, the connectivities among variables. We aim at finding the model $m ^ { * }$ that maximizes the BIC score (Schwarz et al., 1978; Koller & Friedman, 2009):
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
B I C ( m | \mathcal { D } ) = \log P ( \mathcal { D } | m , \theta ^ { * } ) - \frac { d ( m ) } { 2 } \log N ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\theta ^ { * }$ is the MLE of the parameters and $d ( m )$ is the number of independent parameters. The first term is known as the likelihood term. It favors models that fit data well. The second term is known as the penalty term. It discourages complex models. Hence, the BIC score provides a tradeoff between model fit and model complexity. To this end, we perform systematic searching to find a structure with a high BIC score. We use the hill-climing algorithm to search for $m ^ { * }$ as in (Poon et al., 2010; 2013), and define 7 search operators: node introduction (NI) and node deletion (ND) to introduce new latent nodes and delete existing nodes, state introduction (SI) and state deletion (SD) to add a new state and delete a state for existing nodes, node relocation (NR) to change links of existing nodes, pouching (PO) and unpouching (UP) operators to combine nodes into a single node and separate variables from a node.. The structure search operators are shown in Fig. 3. Each operator produces a set of candidates from existing structure, and the best candidate is picked if it improves the previous one. To reduce the number of possible search candidates, we first perform SI, NI and PO to expand the structure and pick the best model. Then we perform NR to adjust the best model. Finally, we perform UP, ND and SD to simplify the current best structure and pick the best one. Acceleration techniques (Poon et al., 2013) are adopted that make the algorithm efficient enough. The structure learning is performed iteratively together with the parameter learning of neural networks.
|
| 119 |
+
|
| 120 |
+
The overall learning algorithm is illustrated in Algorithm 1. Starting from a pretrained model, we iteratively improve the structure and parameters of latent tree model while learning the representations of data through neural network in a greedy manner. Using current structure $S ^ { t }$ as the initial structure,
|
| 121 |
+
|
| 122 |
+
# Algorithm 1 Learning Latent Tree Variational Autoencoder
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Input:data D,z dim,neural networks,E 0,,S°,Θ° ← pretrain(D) repeat fore=1toEdo</td></tr><tr><td>for each minibatchX in D do Compute q(z|μx,Ox)</td></tr><tr><td>Sample z(i) ~q(z|μx,x) Compute log ps(z; ) and 0log ps(z) from Eq.5 and 7 dz</td></tr><tr><td>Compute ELBO from Eq. 4 0,Φ ← Back-propagation and SGD step</td></tr><tr><td>← StepwiseEM(z()) end for</td></tr><tr><td>end for Dz↑μD</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>repeat</td></tr><tr><td>S*,Θ* ← SearchWith(St-1,Θt-1,{SI,NI,PO})</td></tr><tr><td>S*,Θ* ← SearchWith(S*,Θ* {NR}) St,Θt ← SearchWith(S*,Θ*,{UP,ND,SD}) until BIC(St,0t|Dz)≤BIC(St-1,0t-1|Dz)</td></tr></table>
|
| 125 |
+
|
| 126 |
+
we search for a better model. With new latent tree model, we optimize for a better representation until convergence.
|
| 127 |
+
|
| 128 |
+
# 4 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
# 4.1 SYNTHETIC-DATA DEMONSTRATION
|
| 131 |
+
|
| 132 |
+
We first demonstrate the effectiveness of the proposed method through synthetic data. Assume that the data points have two facets $Y _ { 1 }$ and $Y _ { 2 }$ , where each facet controlls a subset of attributes (e.g. two-dimensional domain) and defines one partition over the data. This four-dimensional domain $\mathbf { z } = \{ z _ { 1 } , z _ { 2 } , z _ { 3 } , z _ { 4 } \}$ is a latent representation which we do not observe. What we observe is $\mathbf { x } \in \mathbb { R } ^ { 1 0 0 }$ that is obtained via the following non-linear transformation:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\mathbf { x } = \sigma ( U \sigma ( W \mathbf { z } ) ) ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $W \in \mathbb { R } ^ { 1 0 \times 4 }$ and $U \in \mathbb { R } ^ { 1 0 0 \times 1 0 }$ are matrices whose entries follow the zero-mean unit-variance i.i.d. Gaussian distribution, $\sigma ( \cdot )$ is a sigmoid function to introduce nonlinearity. The generative model is shown in Fig. 4 (a). We define two clusters in facet $Y _ { 1 }$ and two clusters in facet $Y _ { 2 }$ , and generate 5,000 samples of $\mathbf { x }$ . Under the above generative model, recovering the two facets $Y _ { 1 }$ and $Y _ { 2 }$ structure and the latent $z$ domain from the observation of $\mathbf { x }$ seems very challenging. All previous DNN-based methods $\mathbf { \Gamma } ( \mathbf { A E + G M M }$ , DEC, DCN, etc.) are only able to discover one-facet of clustering (i.e. one partition over the data), and none of these is applicable to solve such a multidimensional clustering problem. Fig. 4 (b) shows the results of the proposed method. As one can see, the LTVAE successfully discovers the true superstructure of $Y _ { 1 }$ and $Y _ { 2 }$ . The 2-d plot of $z _ { 1 }$ and $z _ { 2 }$ shows the separable latent space clusters under facet $Y _ { 1 }$ , and it matches the ground-truth cluster assignments. Additionally, the 2-d plot of $z _ { 3 }$ and $z _ { 4 }$ shows another separable clusters under facet $Y _ { 2 }$ , and it also matches the ground-truth cluster assignments well in the other facet.
|
| 139 |
+
|
| 140 |
+
# 4.2 REAL-DATA EXPERIMENT SETUP
|
| 141 |
+
|
| 142 |
+
We evaluate the proposed LTVAE model on two image datasets and two other datasets, and compare it against other deep learning based clustering algorithms, including two-stage methods, $\mathbf { A E { + } G M M }$ and $\mathbf { V A E + G M M }$ , which first learn AE/VAE (Kingma & Welling, 2014) models then construct a GMM on top of them, and joint learning methods, DEC (Xie et al., 2016) and DCN (Yang et al., 2017). The datasets include MNIST, STL-10, Reuters (Xie et al., 2016; Jiang et al., 2017) and the Heterogeneity Human Activity Recognition (HHAR) dataset. When evaluating the clustering performance, for fair of comparison, we follow previous works (Xie et al., 2016; Yang et al., 2017) and use the network structures of $d - 5 0 0 - 5 0 0 - 2 0 0 0 - 1 0$ for the encoder network and $1 0 - 2 0 0 0 -$ $5 0 0 - 5 0 0 - d$ for the decoder network for all datasets, where $d$ is the data-space dimension, which varies among datasets. All layers are fully-connected. We follow the pretraining procedure as in (Xie et al., 2016). We first perform greedy layer-wise pretraining in denoising autoencoder manner, then stack all layers to form deep autoencoder. The deep autoencoder is further finetuned to minimize the reconstruction loss. The weights of the deep autoencoder are used to intialize the weights of encoder and decoder networks of above methods. After the pretraining, we optimze the objectives of those methods. For DEC and DCN, we use the same hyperparameter settings as the original papers. When initializing the cluster centroids for DEC and DCN, we perform 10 random restarts and pick the results with the best objective value for $k$ -means/GMM. For the proposed LTVAE, we use Adam optimzer (Kingma & Ba, 2015) with initial learning rate of 0.001 and mini-batch size of 128. For Stepwise EM, we set the learning rate to be 0.01. As in Algorithm 1, we set $E = 5$ , i.e. we update the latent tree model every 5 epochs. When optimizing the candidate models during structure search, we perform 10 random restarts and train with EM for 200 iterations.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 4: (a) The generative process of synthetic data; (b) The discovered multidimensional superstructure and the latent space (different colors denote different ground truth clusters in each facet.)
|
| 146 |
+
|
| 147 |
+
Table 1: Test data loglikelihood for various datasets.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>STL</td><td rowspan=1 colspan=1>Reuters</td><td rowspan=1 colspan=1>HHAR</td></tr><tr><td rowspan=1 colspan=1>VAE</td><td rowspan=1 colspan=1>-86.64±0.20</td><td rowspan=1 colspan=1>-743.72±0.51</td><td rowspan=1 colspan=1>-1312.40±1.24</td><td rowspan=1 colspan=1>-17.88±0.26</td></tr><tr><td rowspan=1 colspan=1>IWAE</td><td rowspan=1 colspan=1>-85.39±0.13</td><td rowspan=1 colspan=1>-742.43±1.10</td><td rowspan=1 colspan=1>-1254.29±6.95</td><td rowspan=1 colspan=1>-16.53±0.16</td></tr><tr><td rowspan=1 colspan=1>LTVAE</td><td rowspan=1 colspan=1>-84.75±0.14</td><td rowspan=1 colspan=1>-619.04±7.88</td><td rowspan=1 colspan=1>-1245.71±4.45</td><td rowspan=1 colspan=1>-13.65±0.53</td></tr></table>
|
| 150 |
+
|
| 151 |
+
# 4.3 TEST LOGLIKELIHOOD
|
| 152 |
+
|
| 153 |
+
We first show that, by using the marginal loglikelihood defined by the latent tree model as the prior, LTVAE better fits the data than conventional VAE and importance weighted autoencoders (IWAE) (Burda et al., 2016). While alternative quantitative criteria have been proposed (Bounliphone et al., 2016; Im et al., 2016; Salimans et al., 2016) for generative models, log-likelihood of held-out test data remains one of the most important measures of a generative model’s performance (Kingma & Welling, 2014; Burda et al., 2016; Wu et al., 2017; Goyal et al., 2017). For comparison, we approximate true loglikelihood $\mathcal { L } _ { 5 0 0 0 }$ using importance sampling (Burda et al., 2016): ${ \mathcal { L } } _ { k } ( \mathbf { x } ) =$ $\begin{array} { r } { \log { \frac { 1 } { k } } \sum _ { i = 1 } ^ { k } \frac { p _ { \theta } ( \mathbf { x } , \mathbf { z } ^ { ( i ) } ) } { q _ { \phi } ( \mathbf { z } ^ { ( i ) } | \mathbf { x } ) } } \end{array}$ , where $\mathbf { z } ^ { ( i ) } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . The results for all datasets are shown in Table 1. The proposed LTVAE obtains a higher test data loglikelihood and ELBO, implying that it can better model the underlying complex data distribution embedded in the image data.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 5: Two facet clustering results from LTVAE are in (a) digit identity and (b) shape and pose. Each row contains the top 10 scoring elements from one cluster. (c) shows the pose variations by fixing the digit cluster in facet 1 and changing the cluster in facet 2. It can be seen that up-right, left-tilted and right-tilted images of the same digits are clearly recognizable.
|
| 157 |
+
|
| 158 |
+
Table 2: Clustering Accuracy of clustering results.
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>STL-10</td><td rowspan=1 colspan=1>Reuters</td><td rowspan=1 colspan=1>HHAR</td></tr><tr><td rowspan=1 colspan=1>AE+GMM</td><td rowspan=1 colspan=1>82.18%</td><td rowspan=1 colspan=1>79.83%</td><td rowspan=1 colspan=1>68.68%</td><td rowspan=1 colspan=1>78.90%</td></tr><tr><td rowspan=1 colspan=1>VAE+GMM</td><td rowspan=1 colspan=1>76.87%</td><td rowspan=1 colspan=1>79.49%</td><td rowspan=1 colspan=1>65.85%</td><td rowspan=1 colspan=1>67.91%</td></tr><tr><td rowspan=1 colspan=1>DEC</td><td rowspan=1 colspan=1>84.30%</td><td rowspan=1 colspan=1>80.62%</td><td rowspan=1 colspan=1>74.32%</td><td rowspan=1 colspan=1>79.86%</td></tr><tr><td rowspan=1 colspan=1>DCN</td><td rowspan=1 colspan=1>83.32%</td><td rowspan=1 colspan=1>85.88%</td><td rowspan=1 colspan=1>75.05%</td><td rowspan=1 colspan=1>81.26%</td></tr><tr><td rowspan=1 colspan=1>LTVAE</td><td rowspan=1 colspan=1>86.32%</td><td rowspan=1 colspan=1>90.00%</td><td rowspan=1 colspan=1>80.96%</td><td rowspan=1 colspan=1>85.00%</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 4.4 MULTIFACET CLUSTERING
|
| 163 |
+
|
| 164 |
+
The most important features of the proposed model are that it can perform variable selection for model-based clustering, leading to multiple facets clustering.
|
| 165 |
+
|
| 166 |
+
We use the standard unsupervised evaluation metric and protocols for evaluations and comparisons to other algorithms (Yang et al., 2010). For baseline algorithms we set the number of clusters to the number of ground-truth categories. While for LTVAE, it automatically determines the number of facets and latent superstructure through structure learning. We evaluate performance with unsupervised clustering accuracy $( A C C )$ :
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
A C C = \operatorname* { m a x } _ { m } \frac { \sum _ { i = 1 } ^ { n } \mathbf { 1 } \left\{ l _ { i } = m ( c _ { i } ) \right\} } { n } ,
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $l _ { i }$ is the groundtruth label, $c _ { i }$ is the cluster assignment produced by the algorithm, and $m$ ranges over all possible mappings between clusters and labels. Table 2 show the quantitative clustering results compared with previous works. With $\mathbf { z }$ dimension of small value like 10, LTVAE usually discovers only one facet. It can be seen the, for MNIST dataset LTVAE achieves clustering accuracy of $8 6 . 3 2 \%$ , better than the results of other methods. This is also the case for STL-10, Reuters and HHAR.
|
| 173 |
+
|
| 174 |
+
More importantly, the proposed LTVAE does not just give one partition over the data. Instead, it explains the data in multi-faceted ways. Unlike previous clustering experiments, for this experiment, we choose the z dimension to be 20. Fig. 5 shows the two facet clustering results for MNIST. It can be seen that facet 1 gives quite clean clustering over the identity of the digits and the ten digits are well separated. On the other hand, facet 2 gives a more grand partition based on the shape and pose. Note how up-right $" 4 > "$ and “9” are similar, and how tilted “4”,“7” and “9” are similar. The facet meanings are more evident in Fig. 5 (c). Fig. 6 shows four facets discovered for the STL-10 dataset. Although it is hard to characterize precisely how the facets differ from each other, there are visible patterns. For example, the cats, monkeys and birds in facet 2 have clearly visible eyes, while this is not always true in facet 1. The deers in facet 2 are all showing their antlers/ears, while this is not true in facet 3. In facet 2 we see frontal views of cars, while in facets 1 and 3 we see side view of cars. In facet 1, each cluster consists of the same types of objects/animal. In facet 3/4, images in the same cluster do not necessarily show the same type of objects/animals. However, they have similar overall feel.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 6: Clustering results from LTVAE for STL-10 dataset. Each row contains the top 5 scoring elements from one cluster.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 7: The digits generated by the proposed model. Digits in the same row come from the same latent code of the latent tree.
|
| 181 |
+
|
| 182 |
+
# 4.5 IMAGE GENERATION
|
| 183 |
+
|
| 184 |
+
Since the structure of the data in latent space is automatically learned through the latent tree, we can sample the data in a more structured way. One way is through ancestral sampling, where we first sample the root of the latent tree and then hierarchically sample the children variables to get $\mathbf { z }$ , from which the images can be generated through generation network. The other way is to pick one component from the Gaussian mixture and sample $\mathbf { z }$ from that component. This produces samples from a particular cluster. Fig. 7 shows the samples generated in this way. As it can be seen, digits sampled from each component has clear semantic meaning and belong to the same category. Whereas, the samples generated by VAE does not have such structure. Conditional image generation can also be performed to alter the attributes of the same digit as shown in Appendix B.
|
| 185 |
+
|
| 186 |
+
# 5 DISCUSSIONS
|
| 187 |
+
|
| 188 |
+
LTVAE learns the dependencies among latent variables $\mathbf { Y }$ . In general, latent variables are often correlated. For example, the social skills and academic skills of a student are generally correlated. Therefore, its better to model this relationship to better fit the data. Experiments show that removing such dependencies in LTVAE models results in inferior data loglikelihood.
|
| 189 |
+
|
| 190 |
+
In this paper, for the inference network, we simply use mean-field inference network with same structure as the generative network (Kingma & Welling, 2014). However, the limited expressiveness of the mean-field inference network could restrict the learning in the generative network and the quality of the learned model (Webb et al., 2018; Rainforth et al., 2018; Cremer et al., 2018). Using a faithful inference network structure as in (Webb et al., 2018) to incorporate the dependencies among latent variables in the posterior, for example one parameterized with masked autoencoder distribution estimator (MADE) model (Germain et al., 2015), could have a significant improvement in learning. We leave it for future investigation.
|
| 191 |
+
|
| 192 |
+
# 6 CONCLUSIONS
|
| 193 |
+
|
| 194 |
+
In this paper, we propose an unsupervised learning method, latent tree variational autoencoder (LTVAE), which simultaneously performs representation learning and multidimensional clustering. Different from previous deep learning based clustering methods, LTVAE learns latent embeddings from data and discovers multi-facet clustering structure based on subsets of latent features rather than one partition over data. Experiments show that the proposed method achieves state-of-the-art clustering performance and reals reasonable multifacet structures of the data.
|
| 195 |
+
|
| 196 |
+
# ACKNOWLEDGMENTS
|
| 197 |
+
|
| 198 |
+
Research on this article was supported by Hong Kong Research Grants Council under grants 16212516 and 16202118.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Charu C Aggarwal and Chandan K Reddy. Data clustering: algorithms and applications. CRC press, 2013.
|
| 203 |
+
|
| 204 |
+
David M Blei, Michael I Jordan, et al. Variational inference for dirichlet process mixtures. Bayesian analysis, 1(1):121–144, 2006.
|
| 205 |
+
|
| 206 |
+
Wacha Bounliphone, Eugene Belilovsky, Matthew B Blaschko, Ioannis Antonoglou, and Arthur Gretton. A test of relative similarity for model selection in generative models. In Proceedings of the International Conference on Learning Representations, 2016.
|
| 207 |
+
|
| 208 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In Proceedings of the International Conference on Learning Representations, 2016.
|
| 209 |
+
|
| 210 |
+
Tao Chen, Nevin L Zhang, Tengfei Liu, Kin Man Poon, and Yi Wang. Model-based multidimensional clustering of categorical data. Artificial Intelligence, 176(1):2246–2269, 2012.
|
| 211 |
+
|
| 212 |
+
M Bishop Christopher. Pattern Recognition and Machine Learning. Springer-Verlag New York, 2016.
|
| 213 |
+
|
| 214 |
+
Chris Cremer, Xuechen Li, and David Duvenaud. Inference suboptimality in variational autoencoders. In International Conference on Machine Learning, 2018.
|
| 215 |
+
|
| 216 |
+
Nat Dilokthanakul, Pedro AM Mediano, Marta Garnelo, Matthew CH Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. Deep unsupervised clustering with gaussian mixture variational autoencoders. arXiv preprint arXiv:1611.02648, 2016.
|
| 217 |
+
|
| 218 |
+
Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. In International Conference on Machine Learning, pp. 881–889, 2015.
|
| 219 |
+
|
| 220 |
+
Prasoon Goyal, Zhiting Hu, Xiaodan Liang, Chenyu Wang, and Eric Xing. Nonparametric variational auto-encoders for hierarchical representation learning. In Proceedings of the IEEE International Conference on Computer Vision, 2017.
|
| 221 |
+
|
| 222 |
+
Xifeng Guo, Long Gao, Xinwang Liu, and Jianping Yin. Improved deep embedded clustering with local structure preservation. In International Joint Conference on Artificial Intelligence (IJCAI17), pp. 1753–1759, 2017.
|
| 223 |
+
|
| 224 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006.
|
| 225 |
+
|
| 226 |
+
Geoffrey E Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554, 2006.
|
| 227 |
+
|
| 228 |
+
Daniel Jiwoong Im, Chris Dongjoo Kim, Hui Jiang, and Roland Memisevic. Generating images with recurrent adversarial networks. arXiv preprint arXiv:1602.05110, 2016.
|
| 229 |
+
|
| 230 |
+
Zhuxi Jiang, Yin Zheng, Huachun Tan, Bangsheng Tang, and Hanning Zhou. Variational deep embedding: An unsupervised and generative approach to clustering. In International Joint Conference on Artificial Intelligence, 2017.
|
| 231 |
+
|
| 232 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, 2015.
|
| 233 |
+
|
| 234 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the International Conference on Learning Representations, 2014.
|
| 235 |
+
|
| 236 |
+
Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
Raphael Mourad, Christine Sinoquet, Nevin L Zhang, Tengfei Liu, and Philippe Leray. A survey on ¨ latent tree models and applications. Journal of Artificial Intelligence Research, 2013.
|
| 241 |
+
|
| 242 |
+
Judea Pearl. Probabilistic reasoning in intelligent systems: networks of plausible inference. Morgan Kaufmann, 2014.
|
| 243 |
+
|
| 244 |
+
Leonard Poon, Nevin L Zhang, Tao Chen, and Yi Wang. Variable selection in model-based clustering: To do or to facilitate. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 887–894, 2010.
|
| 245 |
+
|
| 246 |
+
Leonard KM Poon, Nevin L Zhang, Tengfei Liu, and April H Liu. Model-based clustering of high-dimensional data: Variable selection versus facet determination. International Journal of Approximate Reasoning, 54(1):196–215, 2013.
|
| 247 |
+
|
| 248 |
+
Tom Rainforth, Adam R Kosiorek, Tuan Anh Le, Chris J Maddison, Maximilian Igl, Frank Wood, and Yee Whye Teh. Tighter variational bounds are not necessarily better. In International Conference on Machine Learning, 2018.
|
| 249 |
+
|
| 250 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016.
|
| 251 |
+
|
| 252 |
+
Gideon Schwarz et al. Estimating the dimension of a model. The annals of statistics, 6(2):461–464, 1978.
|
| 253 |
+
|
| 254 |
+
Michael Steinbach, Levent Ertoz, and Vipin Kumar. The challenges of clustering high dimensional ¨ data. In New directions in statistical physics, pp. 273–309. Springer, 2004.
|
| 255 |
+
|
| 256 |
+
Yee Whye Teh, Michael I Jordan, Matthew J Beal, and David M Blei. Hierarchical dirichlet processes. Journal of the American Statistical Association, 101(1):1566–1581, 2006.
|
| 257 |
+
|
| 258 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008.
|
| 259 |
+
|
| 260 |
+
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, 11(Dec):3371–3408, 2010.
|
| 261 |
+
|
| 262 |
+
Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007.
|
| 263 |
+
|
| 264 |
+
Stefan Webb, Adam Golinski, Robert Zinkov, N Siddharth, Tom Rainforth, Yee Whye Teh, and Frank Wood. Faithful inversion of generative models for effective amortized inference. In Advances in Neural Information Processing Systems, 2018.
|
| 265 |
+
|
| 266 |
+
Yuhuai Wu, Yuri Burda, Ruslan Salakhutdinov, and Roger Grosse. On the quantitative analysis of decoder-based generative models. In Proceedings of the International Conference on Learning Representations, 2017.
|
| 267 |
+
|
| 268 |
+
Junyuan Xie, Ross Girshick, and Ali Farhadi. Unsupervised deep embedding for clustering analysis. In International Conference on Machine Learning, pp. 478–487, 2016.
|
| 269 |
+
|
| 270 |
+
Bo Yang, Xiao Fu, Nicholas D Sidiropoulos, and Mingyi Hong. Towards k-means-friendly spaces: Simultaneous deep learning and clustering. In International Conference on Machine Learning, 2017.
|
| 271 |
+
|
| 272 |
+
Jianwei Yang, Devi Parikh, and Dhruv Batra. Joint unsupervised learning of deep representations and image clusters. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5147–5156, 2016.
|
| 273 |
+
|
| 274 |
+
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.
|
| 275 |
+
|
| 276 |
+
Nevin L Zhang. Hierarchical latent class models for cluster analysis. Journal of Machine Learning Research, 5(6):697–723, 2004.
|
| 277 |
+
|
| 278 |
+
Nevin L Zhang and Leonard KM Poon. Latent tree analysis. In AAAI, pp. 4891–4898, 2017.
|
| 279 |
+
|
| 280 |
+
# A SUPERSTRUCTURES
|
| 281 |
+
|
| 282 |
+
For the MNIST dataset, the conditional probability between identity facet $Y _ { 1 }$ ( $\mathbf { \bar { X } } ^ { \prime }$ -axis) and pose facet $Y _ { 2 }$ (y-axis) is shown in Fig. 8. It can be seen that a cluster in $Y _ { 1 }$ facet could correspond to multiple clusters in $Y _ { 2 }$ facet due to the conditional probability, e.g. cluster 0, 4, 5, 11 and 12. However, not all clusters in $Y _ { 2 }$ facet are possible for a given cluster in $Y _ { 1 }$ facet.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 8: Conditional probability of $Y _ { 1 }$ and $Y _ { 2 }$ for the two facets of MNIST discovered by LTVAE.
|
| 286 |
+
|
| 287 |
+
# B CONDITIONAL IMAGE GENERATION
|
| 288 |
+
|
| 289 |
+
Here we show more results on conditional image generation. Interestingly, with LTVAE, we can change the original images by fixing variables in some facet and sampling in other facets. For example, in MNIST we can fix the variables in identity facet and change the pose of the digit by sampling in the pose facet. Fig. 9 shows the samples generated in this way. As it can be seen, the pose of the input digits are changed in the samples generated by the proposed method.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 9: Image generation. Left are the original image. Right are generated with the proposed model by fixing the variables in identity facet and sampling the variables in the pose facet. Digits in the same row come from the same latent code of the latent tree.
|
| 293 |
+
|
| 294 |
+
# C COMPUTATIONAL TIME
|
| 295 |
+
|
| 296 |
+
We compare the computational time of the proposed LTVAE w/ structure learning and that w/ fixed structure. For LTVAE with fixed structure, we fixed the structure of the latent tree model to be a single $Y$ connecting to all $z \mathbf { S }$ , in which each $z$ node consists of single $z$ variable.
|
| 297 |
+
|
| 298 |
+
Table 3: Computational time (s) w/ and w/o structure learning.
|
| 299 |
+
|
| 300 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>STL-10</td><td rowspan=1 colspan=1>Reuters</td><td rowspan=1 colspan=1>HHAR</td></tr><tr><td rowspan=1 colspan=1>LTVAE w/ structure learning</td><td rowspan=1 colspan=1>7,592</td><td rowspan=1 colspan=1>3,251</td><td rowspan=1 colspan=1>5,756</td><td rowspan=1 colspan=1>5,693</td></tr><tr><td rowspan=1 colspan=1>LTVAE w/ fixed structure</td><td rowspan=1 colspan=1>3,197</td><td rowspan=1 colspan=1>542</td><td rowspan=1 colspan=1>1,442</td><td rowspan=1 colspan=1>1,021</td></tr></table>
|
| 301 |
+
|
| 302 |
+
# D SIMILARITY BETWEEN LEARNED FACETS
|
| 303 |
+
|
| 304 |
+
Different facets learned by LTVAE might have some overlaps among each other. Here we make quantitative comparison among different facets based on the cluster assignments in each facet. We evaluate the similarity between two clusterings $Y _ { 1 }$ and $Y _ { 2 }$ using normalized mutual information $N M I ( Y _ { 1 } ; Y _ { 2 } )$ . The NMI is given by
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
N M I ( Y _ { 1 } ; Y _ { 2 } ) = \frac { I ( Y _ { 1 } ; Y _ { 2 } ) } { \sqrt { H ( Y _ { 1 } ) H ( Y _ { 2 } ) } } ,
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
where $I ( Y _ { 1 } ; Y _ { 2 } )$ is the mutual information between $Y _ { 1 }$ and $Y _ { 2 }$ and $H ( V )$ is the entropy of a variable $V$ . These quantities can be computed from $P ( Y _ { 1 } ; Y _ { 2 } )$ , which in turn is estimated by $P ( Y _ { 1 } ; Y _ { 2 } ) =$ $\begin{array} { r l } { { } } & { { } { \frac { 1 } { N } } \sum _ { i = 1 } ^ { N } P ( Y _ { 1 } | \mathbf { d _ { i } } ) P ( Y _ { 2 } | \mathbf { d _ { i } } ) } \end{array}$ , where $\mathbf { d } _ { 1 } , \cdots , \mathbf { d } _ { N }$ are the samples in the test data.
|
| 311 |
+
|
| 312 |
+
Table 4: NMI between different facets learned by LTVAE and groundtruth for MNIST dataset.
|
| 313 |
+
|
| 314 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Groundtruth</td><td rowspan=1 colspan=1>Facet 1</td><td rowspan=1 colspan=1>Facet 2</td></tr><tr><td rowspan=1 colspan=1>Groundtruth</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.825</td><td rowspan=1 colspan=1>0.574</td></tr><tr><td rowspan=1 colspan=1>Facet 1</td><td rowspan=1 colspan=1>0.825</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.682</td></tr><tr><td rowspan=1 colspan=1>Facet 2</td><td rowspan=1 colspan=1>0.574</td><td rowspan=1 colspan=1>0.682</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 315 |
+
|
| 316 |
+
Table 5: NMI between different facets learned by LTVAE and groundtruth for STL dataset.
|
| 317 |
+
|
| 318 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Groundtruth</td><td rowspan=1 colspan=1>Facet1</td><td rowspan=1 colspan=1>Facet 2</td><td rowspan=1 colspan=1>Facet3</td><td rowspan=1 colspan=1>Facet 4</td></tr><tr><td rowspan=1 colspan=1>Groundtruth</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.8613</td><td rowspan=1 colspan=1>0.6279</td><td rowspan=1 colspan=1>0.5758</td><td rowspan=1 colspan=1>0.5536</td></tr><tr><td rowspan=1 colspan=1>Facet 1</td><td rowspan=1 colspan=1>0.8613</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.6962</td><td rowspan=1 colspan=1>0.6314</td><td rowspan=1 colspan=1>0.6251</td></tr><tr><td rowspan=1 colspan=1>Facet 2</td><td rowspan=1 colspan=1>0.6279</td><td rowspan=1 colspan=1>0.6962</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.4675</td><td rowspan=1 colspan=1>0.5031</td></tr><tr><td rowspan=1 colspan=1>Facet 3</td><td rowspan=1 colspan=1>0.5758</td><td rowspan=1 colspan=1>0.6314</td><td rowspan=1 colspan=1>0.4675</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.5885</td></tr><tr><td rowspan=1 colspan=1>Facet 4</td><td rowspan=1 colspan=1>0.5536</td><td rowspan=1 colspan=1>0.6251</td><td rowspan=1 colspan=1>0.5031</td><td rowspan=1 colspan=1>0.5885</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 319 |
+
|
| 320 |
+
# E DERIVATION OF GRADIENT
|
| 321 |
+
|
| 322 |
+
Here we give detailed derivation of Equation 6. The gradient $\mathbf { g } _ { \mathbf { z } _ { b } }$ of the marginal loglikelihood $\log p s ( { \bf z } ; \Theta )$ w.r.t $\mathbf { z } _ { b }$ thus can be computed as
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r l } { \mathcal { Q } _ { \kappa , \kappa } = } & { \frac { \partial \langle \Phi _ { \kappa } | \phi _ { \sigma } \rangle \langle \kappa \Theta \rangle } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \frac { \partial } { \partial \kappa _ { \kappa } \langle \kappa \Theta \rangle } _ { \kappa } \frac { \partial \langle \Phi _ { \kappa } | \phi _ { \sigma } \rangle _ { \kappa } } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \frac { 1 } { \rho _ { \kappa } \langle \kappa \Theta \rangle } _ { \kappa } \frac { \partial \sum _ { \kappa } f \langle \Phi _ { \kappa } \rangle \langle \kappa \Theta _ { \kappa } | \phi _ { \kappa } \rangle _ { \kappa } \langle \kappa \Theta _ { \kappa } \rangle } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \sum _ { \kappa } \frac { \partial } { \rho _ { \kappa } \langle \kappa \Theta \rangle } _ { \kappa } \frac { \partial | f \langle \Phi _ { \kappa } \rangle \langle \kappa | \Theta _ { \kappa } \rangle _ { \kappa } \langle \kappa \Theta _ { \kappa } \rangle | } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \sum _ { \kappa } \frac { f \langle \Phi _ { \kappa } | \Phi \rangle \langle \kappa | \Phi _ { \kappa } | \rho _ { \kappa } \rangle _ { \kappa } \langle \kappa \Theta _ { \kappa } | \phi _ { \kappa } \rangle _ { \kappa } } { \partial \mathcal { L } _ { \kappa } \langle \kappa \Theta \rangle } \frac { \partial | f \langle \Phi _ { \kappa } | \mathcal { N } \langle \kappa | \Phi _ { \kappa } \rangle _ { \kappa } \langle \kappa \Theta _ { \kappa } \rangle _ { \kappa } | } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \sum _ { \kappa } \frac { f \langle \Phi _ { \kappa } | \Phi \rangle \langle \kappa | \Phi _ { \kappa } | \rho _ { \kappa } \rangle _ { \kappa } \langle \kappa | \Phi _ { \kappa } \rangle _ { \kappa } \langle \kappa | \Phi _ { \kappa } \rangle _ { \kappa } } { \partial \mathcal { L } _ { \kappa } } } \\ & { = \sum _ { \kappa } \rho _ { \kappa } | z | \rho _ { \kappa } \langle | \Phi _ { \kappa } | \rho _ { \kappa } \rangle _ { \kappa } \langle | \Phi _ { \kappa } | \rho _ { \kappa } \rangle _ { \kappa } } \\ & = \sum _ { \kappa } ^ { \kappa } \rho _ { \kappa } | z | \rho _ { \kappa } \langle \kappa | \Phi _ { \kappa } \rangle _ { \kappa } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
where $p ( \boldsymbol { y } _ { b } | \mathbf { z } )$ is the posterior probability of $y _ { b }$ and can be computed efficiently with message passing as described in the previous section. Note that
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
p ( y _ { b } | \mathbf { z } ) = \frac { f ( y _ { b } ) \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { y _ { b } } , \Sigma _ { y _ { b } } ) } { p s ( \mathbf { z } ; \boldsymbol { \Theta } ) }
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
is valid due to $\begin{array} { r } { p _ { S } ( \mathbf { z } ; \Theta ) = \sum _ { y _ { b } } \mathcal { N } ( \mathbf { z } _ { b } | \mu _ { y _ { b } } , \boldsymbol { \Sigma } _ { y _ { b } } ) f ( y _ { b } ) } \end{array}$ and the Bayes rule.
|
md/train/SJgTps0qtQ/SJgTps0qtQ.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EXPLOITING ENVIRONMENTAL VARIATION TO IMPROVE POLICY ROBUSTNESS IN REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Conventional reinforcement learning rarely considers how the physical variations in the environment (eg. mass, drag, etc.) affect the policy learned by the agent. In this paper, we explore how changes in the environment affect policy generalization. We observe experimentally that, for each task we considered, there exists an optimal environment setting that results in the most robust policy that generalizes well to future environments. We propose a novel method to exploit this observation to develop robust actor policies, by automatically developing a sampling curriculum over environment settings to use in training. Ours is a model-free approach and experiments demonstrate that the performance of our method is on par with the best policies found by an exhaustive grid search, while bearing a significantly lower computational cost.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
How does the agent’s environment affect the robustness of policies it learns through deep reinforcement learning? Previous work has addressed the sensitivity of RL to changing visual environments by applying domain randomization, i.e. training on randomized visual environments (Tobin et al., 2017; Sadeghi et al., 2017), but there is limited work on the variability caused by the physics of the environment, such as object weight, surface friction, arm dynamics, etc. (Peng et al., 2018; Devin et al., 2017; Yu et al., 2017). In practical applications, one cannot assume the the task environment at test time has the same properties as the training environment, particularly if the training is conducted in simulation, and in most cases it is unfeasible to measure and categorize the changes. At the same time, enumerating all possible physical properties during training is extremely time-consuming and may still not lead to the best policy.
|
| 12 |
+
|
| 13 |
+
In this paper, we propose to develop RL algorithms that learn to exploit the training environment to discover the most robust and useful policy to handle any potential future environment, without needing explicit information about that future environment’s underlying settings. We observe an interesting phenomenon, which we term ‘inadvertent generalization’: training a task under certain physical settings results in more robust policies than others. For example, a pendulum policy trained on a low weight solves the task perfectly, but then fails on a higher weight setting. However, training on a single high weight leads to success on all lower weights. We observe forms of inadvertent generalization across multiple tasks - [i] simple pendulum inversion (with two different physics simulators), [ii] cart-pole balancing, [iii] ball-pushing (where the agent is required to push a ball to an arbitrarily specified goal). Curiously, intuition gained to explain the phenomenon on any one task does not necessarily extend to the others. We speculate that this may be because certain environments make the task harder and thus require more robust policies to solve the task.
|
| 14 |
+
|
| 15 |
+
Motivated by these observations, we propose to exploit variations in environments during training to learn a single policy that is capable of generalizing across environmental setting variations without incurring a significant additional cost, i.e. making the inadvertent generalization deliberate. We develop an approach called Reward-guided Stochastic Curriculum that automatically constructs a training curriculum for each learner to best motivate the learning of robust actor policies. We accomplish this by formulating the training curriculum as a multi-armed bandit problem, which seeks to maximize episodic rewards over all environmental settings of interest, utilizing separate bandits for each environmental variable (where different physics properties correspond to different variables), thus ensuring linear growth with the introduction of additional variables, as opposed to polynomial. Experiments show that our method yields policies with performance similar to the best policies identified by an exhaustive grid search, while being computationally less expensive, since we only need to train one policy as opposed to one for each environmental setting.
|
| 16 |
+
|
| 17 |
+
# 2 PROBLEM DEFINITION
|
| 18 |
+
|
| 19 |
+
The primary focus of this paper is to characterize and exploit the phenomenon of inadvertent generalization so that we may better guide and utilize experiences gained to develop action policies that are more robust to environmental perturbation and variation. We build our analyses on the Deep Deterministic Policy Gradient (DDPG) algorithm (Lillicrap et al., 2016). DDPG is one of a class of actor-critic algorithms, where there exist separate actor and critic policies (each represented by a deep neural network). The critic attempts to learn the value of actions taken for a given state, which is then used to inform the improvement of the actor policy. We chose DDPG for its ability to handle continuous state and action spaces, which we consider to be important for both coarse and fine control, and for its status as a well-studied baseline algorithm with good stability and sample efficiency while learning (Duan et al., 2016).
|
| 20 |
+
|
| 21 |
+
We first motivate the problem by demonstrating inadvertent generalization on the inverted pendulum task. The aim of the pendulum task is to train an agent to hold a pendulum mass steady above its pivot point (as shown in Appendix A, Figure 2) . This is a task that can be considered solved by many of the existing deep-RL architectures (Schulman et al., 2017; Lillicrap et al., 2016; Wang et al., 2016; Wu et al., 2017; Schulman et al., 2015), but to the best of our knowledge, the robustness of RL policies to changes in the pendulum environment (or many classical control tasks) has not been well explored. We test whether an agent policy would still be capable of controlling the pendulum if the mass of the pendulum were changed. Our initial intuition was as follows: [i] decreasing the mass of the pendulum may result in significant overshoot of the vertical steady-point, potentially with a significant jitter in the motion, and [ii] increasing the mass might result in an inability to effectively swing-up the mass, resulting in failure. Both of these observations would make intuitive sense and could then be attributed to policies lacking an understanding of the environment dynamics. What we observed however is that, while hypothesis [ii] appears to hold, pendulum control policies trained with heavier masses generalized to a wider range of masses without a perceptible cost to stability. Table 1 provides a breakdown of the success rates of policies trained on individual OpenAI-gym Pendulum (Brockman et al., 2016) environment settings - in this case, with the only variable being the pendulum’s mass. Observe that policies trained on heavier pendulums consistently outperform those trained on lower masses. It is important to note that all other aspects of the environment and action space were held equal - i.e. the maximum torque that the agent was allowed to apply was not changed and no other changes were made to how the physics in the environment are computed. To verify that these observations were not simply an anomaly of the physics simulator, tests were conducted on a separate pendulum environment built with the Unity game engine, which uses Nvidia’s PhysX physics engine to simulate rigid-body dynamics. Our tests on the Unity pendulum environment show similar trends in behavior (as shown in Appendix C, Table 6), further establishing the effects of inadvertent generalization. Similarly, from training in the OpenAI-Gym CartPole-v1 environment (with minor modifications to support continuous control), we observe that training with heavier carts and poles seems to promote better generalization within the task, with cart masses having a stronger influence (see Appendix C, Table 7).
|
| 22 |
+
|
| 23 |
+
Table 1: OpenAI-Gym Pendulum policy success rate (higher is better). We evaluate multiple policies trained and tested on different OpenAI-Gym Pendulum-v0 environment settings. Rows represent performance for policies trained on a specific mass, columns correspond to specific test masses. Success rate is computed as the fraction of 8 trials with an average maximum deviation of less than 15 degrees, over 6 tests per test mass per trial, from the vertical steady point over the last 100 steps of a 300-step episode. Darker shading indicates worse performance.
|
| 24 |
+
|
| 25 |
+
<table><tr><td rowspan=1 colspan=1>Train\Test</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>Avg</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.13</td><td rowspan=1 colspan=1>0.13</td><td rowspan=1 colspan=1>0.38</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.13</td><td rowspan=1 colspan=1>0.59</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.80</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.98</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr></table>
|
| 26 |
+
|
| 27 |
+
Table 2: Unity Ball-pushing policy error (lower is better). Performance evaluation of multiple policies trained and tested on different custom Unity ball-pushing environment settings. Rows represent performance for policies trained on a specific ball mass, columns correspond to specific test masses. Errors are computed as the mean Euclidean distance of the ball from the goal evaluated on 6 separate trials, with 50 pre-defined tests per trial (to ensure fair comparison between policies).
|
| 28 |
+
|
| 29 |
+
<table><tr><td rowspan=1 colspan=1>TrainTest</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>Avg</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.21</td><td rowspan=1 colspan=1>0.21</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.22</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>0.40</td><td rowspan=1 colspan=1>0.23</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.28</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>0.66</td><td rowspan=1 colspan=1>0.37</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>0.37</td><td rowspan=1 colspan=1>0.43</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>1.25</td><td rowspan=1 colspan=1>0.66</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>0.64</td><td rowspan=1 colspan=1>0.76</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1.15</td><td rowspan=1 colspan=1>0.54</td><td rowspan=1 colspan=1>0.46</td><td rowspan=1 colspan=1>0.45</td><td rowspan=1 colspan=1>0.46</td><td rowspan=1 colspan=1>0.61</td></tr></table>
|
| 30 |
+
|
| 31 |
+
One might attribute these observations to the difference in physical inertia of pendulums, carts and poles of different masses - with a heavier pendulum presenting with higher inertia than a lighter one. This might further suggest that prioritizing high-inertia settings would result in improved generalization across environmental variations. Further testing with additional tasks however revealed that this is not the case. By analyzing the behavior of trained policies on a simple ball-pushing task (results presented in Table 2), where the agent is tasked with rolling a ball from an arbitrary starting position to an arbitrarily defined goal on a 2D plane, we observe that it is in fact the policies trained on lighter balls that do better at generalizing to variations in the environment when solving this task. Furthermore, policies trained with lighter balls also outperform their heavy-ball trained counterparts on test settings employing heavier balls. Independently, these observations can be rationalized to suggest that the higher inertia of the heavier balls requires the agents to exert more force on the ball to manipulate its position, resulting in a loss of finer control that might be developed with the lower-inertia (low mass) cases. However, it is clear that such intuition would in fact run counter to the behavior on the pendulum and cart-pole tasks.
|
| 32 |
+
|
| 33 |
+
Taken together, our observations and analyses demonstrate that there are classes of tasks, at least within the realm of continuous control, for which the following statement holds: given a task, there exists a window of generalizability for which training under a specific ideal set of environmental conditions results in a policy capable of generalizing to variations in the environmental settings. When the variations are limited, a grid search over the variants may be reasonable, but as the number of variables and the degree of variability increases, this quickly becomes impractical. This leads us to our problem statement: we seek a principled approach that reliably and deliberately promotes the development of policies that are robust to environmental changes, similar to policies trained under ‘ideal’ settings, however, without the need for prior knowledge of the task/environment and without incurring significant additional computational cost over the cost of training a single policy.
|
| 34 |
+
|
| 35 |
+
# 3 RELATED WORK
|
| 36 |
+
|
| 37 |
+
To the best of our knowledge, there have not been many explorations of robustness to the environment of a single task, as studied in this paper, however, we are able to draw insight from studies into multi-task reinforcement learning, specifically those where a single policy is trained to be utilized for all relevant tasks. Many of the existing single-policy methods appear to share a core idea: expose the agent to all the relevant task variations, attempt to account for different value associations that different tasks might encourage, and hope that some level of generalization might be achievable. Single-policy methods offer a key advantage towards generalization: they can be developed to function even when exact task specifications are not known. This was demonstrated in the performance of various approaches proposed/attempted in the OpenAI Gym Retro Challenge (Nichol et al., 2018), which was conducted in an attempt to systematically test algorithms abilities to generalize to unseen environments by having agents play levels of Sonic the Hedgehog. Interestingly, the best-performing approaches were achieved primarily by tuning the baselines “joint PPO”, based on the PPO (Schulman et al., 2017) architecture, and “joint Rainbow”, based on Rainbow (Hessel et al., 2017). These “joint” networks were constructed with separate replay buffers for each trained level (task). During training, agents are exposed to a sampling of levels, and the gradients for each of these levels are averaged to produce an update to the universal policy, which is then used to update each level’s agents. Similar approaches were taken by Model-Agnostic Meta-Learning (MAML) (Finn et al., 2017) and DeepMind’s IMPALA (Espeholt et al., 2018). Key differences however are that they apply importance weighting to experience gained. MAML iteratively updates the policy in small steps relative to post-update losses of a series of proposed updates to the policy computed at the end of each episode (where each episode samples a new task). After sampling a set of tasks, MAML generates a final update to its primary policy from a scaled sum of the gradients generated from each proposed update. Instead of a direct averaging of agents, IMPALA applies their v-trace algorithm for importance weighting to compensate for the fact that their algorithm operates in a distributed manner with multiple (potentially un-synced) agents and learners, with some agents operating with outdated policies. IMPALA is primarily introduced as a distributed-learning framework, which conveniently possesses properties that allow it to be used in multi-task learning (where multiple agents can simultaneously train in different environments).
|
| 38 |
+
|
| 39 |
+
Yu et al. (2017) attempt to address a problem most similar to the one studied in this paper. The authors attempt to get around the problem of environmental variation by utilizing a separately trained online physics parameter(s) identifier to inform a joint ‘universal’ policy on the current state of the environment. However, there is a non-trivial cost associated with training the online identifier and the approach inherently limits itself to cases encountered in training (as demonstrated by their evaluations where the policy was not able to generalize beyond a certain threshold).
|
| 40 |
+
|
| 41 |
+
We also consider approaches that employ a sense of intrinsic motivation. While recent works in curiosity-driven learning achieve impressive results without any extrinsically defined reward signals from the environment (Burda et al., 2018), we focused on first addressing the more traditional RL problem structure with extrinsically defined rewards. One such approach to intrinsic prioritization of experience is implemented in Prioritized Experience Replay (PER) (Schaul et al., 2016), where experiences are sampled from the replay buffer proportionally to the magnitude of their TemporalDifference (TD) error. A key inspiration for the method presented in this paper however comes from Graves et al. (2017), who tackle multi-task Natural Language Processing (NLP), utilizing a curriculum formulated as a multi-armed bandit. The advantage of this approach is that the curriculum can be automatically generated and would adapt to the experiences of individual learners, unlike the hand-tuned or goal-oriented curricula typically employed in RL. We borrow a similar idea, also building our curriculum on the Exp3 algorithm proposed by Auer et al. (2003), however, as discussed in Section 4, we employ a different valuation of the ‘prediction gain’.
|
| 42 |
+
|
| 43 |
+
# 4 REWARD-GUIDED STOCHASTIC CURRICULUM
|
| 44 |
+
|
| 45 |
+
As stated in Section 2, we seek to exploit the environment to find settings that lead to the most general policy for the task. We assume that all tasks have specific environment settings which can be controlled during training. The best policy is relatively straightforward to train when the ideal settings are known, however, these may not always be known a priori, and as the number of possible settings to consider increases, so too does the computational cost of exploring all variations of the settings in order to determine such settings.
|
| 46 |
+
|
| 47 |
+
Drawing inspiration from Graves et al. (2017), who tackle a multi-task NLP problem, we formulate the problem of developing an automated curriculum for learning generalization over environment settings for a given RL task as a multi-armed bandit problem, focused on minimizing regret and maximizing the actor’s rewards. Each of the arms of the multi-armed bandit corresponds to an ‘action’ that the bandit can take, and each action would have a corresponding value (or payoff). The goal of the bandit is to maximize the payoff of every action, which would be trivial if the values of each arm is known, however, when action-values are not known, it is necessary to estimate the value by exploring the action space.
|
| 48 |
+
|
| 49 |
+
We define a curriculum as a sampling policy on the different environmental settings associated with a given task. A basic curriculum over $N$ possible environmental settings can be constructed as an $N$ -armed bandit, with the syllabus of the developed curriculum intended to maximize the reward that the actor achieves over all the tasks. Over $T$ rounds of ’play’, the bandit agent selects an action, $a _ { t } \in \{ 1 , \ldots , N \}$ , corresponding to a decision to train under a specific environment setting, and observes a payoff $r _ { t }$ , computed as the difference in mean rewards observed before and after training on the selected environment setting. The goal of the bandit/curriculum is to consistently select the settings which offer the best learning gains.
|
| 50 |
+
|
| 51 |
+
A key difference in our method from that employed by Graves et al. (2017) is in how we define the payoff, or the value gained by training on a specific setting. Graves et al. (2017) perform a comparison on the training loss before and after training, utilizing the same loss metric that is employed by the network. We instead compute our payoff based on the difference in mean episodic rewards before and after training. This choice was made based on an analysis of the Q values and TD errors of policies that generalized well on settings they were not trained on. We noted that, despite the ‘good’ performance of the actor, the critic was consistently wrong in its value predictions for any state/action pair, which was to be expected given that we do not model the physical environment. This led us to conclude that, in order to prioritize the performance of the actor policy, we would need to utilize a direct evaluation of the actor, which is reflected by the episodic rewards.
|
| 52 |
+
|
| 53 |
+
# 4.1 SINGLE VARIABLE ENVIRONMENTAL SETTING
|
| 54 |
+
|
| 55 |
+
To motivate the best choice of action that yields the lowest regret, we employ the Exponentiallyweighted algorithm for Exploration and Exploitation (Exp3) (Auer et al., 2003). Specifically, we employ the $\operatorname { E x p 3 . S }$ variant of the algorithm to develop our multi-armed bandit’s policy, which employs an $\epsilon$ -greedy strategy and additively mixes weights to ensure that the probabilities of selecting any particular action is not driven to insignificance. We define $\epsilon$ to limit the maximum probability of any setting being selected. (Note: we present $\mathrm { E x p } 3 . 5$ similarly to Graves et al. (2017), which is mathematically equivalent to the algorithm as it is presented in Auer et al. (2003)).
|
| 56 |
+
|
| 57 |
+
For a bandit policy defined by weights, $w _ { i }$ for $i \in \{ 1 , \ldots , N \}$ , corresponding to the $N$ possible environment settings, at bandit-step $t$ and the bandit’s action, $a _ { i }$ , the sampling probability, πExp3.St (i) of action $i$ is given by:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
a _ { i } \sim \pi _ { t } ^ { \mathrm { E x p 3 . 5 } } \quad \quad \pi _ { t } ^ { \mathrm { E x p 3 . 5 } } ( i ) : = ( 1 - \epsilon ) \frac { \exp w _ { i , t } } { \sum _ { j } \exp w _ { j , t } } + \frac { \epsilon } { N }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
At the end of each bandit step, the weights are updated based on observed payoff, $r _ { t }$ :
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
w _ { t + 1 , i } : = \log \left[ \left( 1 - \alpha _ { t } \right) \exp \left( w _ { t , i } + \hat { r } _ { t - 1 , i } ^ { \beta } \right) + \frac { \alpha _ { t } } { N - 1 } \sum _ { j \neq i } \exp \left( w _ { t , j } + \hat { r } _ { t , j } ^ { \beta } \right) \right]
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $w _ { 1 } = 0$ , $\alpha _ { t } : = t ^ { - 1 }$ , and the importance sampled payoff is computed as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\hat { r } _ { t , i } ^ { \beta } : = \frac { r _ { t } \mathbb { I } _ { [ a _ { t } = i ] } + \beta } { \pi _ { t } ^ { \mathrm { E x p } 3 . \mathrm { S } } ( i ) }
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
To bound the magnitude by which an arm’s weight might change at any given step, payoffs, $r _ { t }$ , per bandit step, $t$ are scaled such that $r _ { t } \in [ - 1 , 1 ]$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
r _ { t } : = \left\{ \begin{array} { l l } { - 1 } & { \delta R _ { t } < \mu _ { t } ^ { 2 0 } } \\ { 1 } & { \delta R _ { t } > \mu _ { t } ^ { 8 0 } } \\ { \frac { 2 ( \delta R _ { t } - \mu _ { t } ^ { 2 0 } ) } { \mu _ { t } ^ { 8 0 } - \mu _ { t } ^ { 2 0 } } - 1 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\delta R _ { t } = R _ { t } - R _ { t - 1 }$ is the true bandit policy payoff at step t, computed based on mean rewards achieved by the actor on the set of environment setting of interest, and $\mu ^ { x }$ represents the $x ^ { \mathrm { { t h } } }$ percentile of payoffs achieved: $\{ r _ { s } \forall s \in t \}$ .
|
| 82 |
+
|
| 83 |
+
# 4.2 MULTIPLE VARIABLE ENVIRONMENTAL SETTINGS
|
| 84 |
+
|
| 85 |
+
In addition to handling a single variable environment setting, we are also interested in efficiently handling environments where multiple settings might change - examples of single and multi-variable environments would respectively be the Pendulum environment, where the mass of the pendulum may change, or the Cart-Pole environment, where the masses of both the cart and pole could change. Considering the combinatorial enumeration of all possible combinations of environment variables would cause the number of settings (and corresponding bandit arms) to grow by order $O ( \prod _ { m \in M } N _ { m } )$ . Instead, we propose a multi-multi-armed bandit solution, where a separate bandit is maintained for each variable. Crucially, this results in a linear growth in the number of arms to be maintained.
|
| 86 |
+
|
| 87 |
+
There are two primary differences between our approaches to the multi-variable and single variable settings for $M$ variables:
|
| 88 |
+
|
| 89 |
+
(i) The importance weighting of the scaled rewards (equation 3) is adjusted to account for the joint probabilities of the (assumed to be independent) variables:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\hat { r } _ { M , t , i } ^ { \beta } : = \frac { r _ { t } \prod _ { m \in M } \mathbb { I } _ { [ a _ { m , t } = i _ { m } ] } + \beta } { \prod _ { m \in M } \pi _ { m , t } ^ { \mathrm { E x p } 3 . \mathrm { S } } ( i _ { m } ) }
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where the pre-superscript $m$ reflects the actions and properties of the the $m ^ { \mathrm { t h } }$ bandit (corresponding to the $m ^ { \mathrm { t h } }$ environment variable.
|
| 96 |
+
|
| 97 |
+
(ii) The bandit weight policy weights are then updated per variable, effectively just as it was in equation 2, but using the importance sampled reward computed by equation 5:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
w _ { m , t + 1 , i } : = \log \left[ \left( 1 - \alpha _ { t } \right) \exp \left( w _ { m , t , i } + \hat { r } _ { M , t - 1 , i } ^ { \beta } \right) + \frac { \alpha _ { t } } { N _ { m } - 1 } \sum _ { j \neq i } \exp \left( w _ { m , t , j } + \hat { r } _ { M , t , j } ^ { \beta } \right) \right]
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
# Algorithm 1: Reward-guided curriculum for improving policy robustness
|
| 104 |
+
|
| 105 |
+
Initialize: $w _ { m , i } = 0 ~ \forall i \in N _ { m } ~ \forall m \in M$ ;
|
| 106 |
+
|
| 107 |
+
2 for $t = 1 \dots T$ do
|
| 108 |
+
|
| 109 |
+
3 Sample $M$ task-variable values $i _ { m }$ under sampling properties defined by equation 1 for each of
|
| 110 |
+
the $M$ systems of policy weights;
|
| 111 |
+
4 Sample $K$ task initializations uniformly from a valid space of initializations;
|
| 112 |
+
5 for $k \in K$ do
|
| 113 |
+
6 Compute Initial Reward of actor-network policy $p _ { \theta }$ on initialization $k$ : $R _ { k } ^ { p r e }$ ;
|
| 114 |
+
7 end
|
| 115 |
+
8 Train network $p _ { \theta }$ on $k \in K$ ;
|
| 116 |
+
9 for $k \in K$ do
|
| 117 |
+
10 Compute Post-training Reward of network $p _ { \theta }$ on initialization $k$ : $R _ { k } ^ { p o s t }$ ;
|
| 118 |
+
11 end
|
| 119 |
+
12 Compute learning progress $\delta R _ { t } : = m e a n ( \{ R _ { k } ^ { p o s t } - R _ { k } ^ { p r e } \} \ \forall \ k \in K ) ;$
|
| 120 |
+
13 Map $\delta R _ { t }$ to $[ - 1 , 1 ]$ by equation 4;
|
| 121 |
+
14 Update weights $w _ { m , i }$ by equation 6;
|
| 122 |
+
15 end
|
| 123 |
+
|
| 124 |
+
# 5 EVALUATION
|
| 125 |
+
|
| 126 |
+
Evaluations are conducted on the three task environments that were previously discussed: [i] Pendulum, [ii] Cart-Pole, and [iii] Ball-pushing. While the pendulum and ball-pushing environments have only a single variable environment setting (the pendulum and ball mass respectively), cart-pole has two variables (the pole mass and the cart mass), thus allowing us to evaluate the multi-variable version of our algorithm.
|
| 127 |
+
|
| 128 |
+
To meter the performance of our method, our results are compared against two key baselines: [i] The best results observed via a grid search (oracle) on policies trained exclusively on specific individual environment settings (i.e. the best inadvertently generalizing agent for each task, as presented in Tables 1, 2 and Appendix C, Table 7), and [ii] Policies trained under a joint/mixed training structure (joint), where the environment settings are varied every episode during training, with the episode settings drawn uniformly at random from a list of values of interest. This is similar to domain randomization. Additionally, for the pendulum task, which served as our primary sandbox for testing different ideas, we also provide comparisons against policies trained with Prioritized Experience
|
| 129 |
+
|
| 130 |
+
Replay (PER) and also policies where the curriculum’s key payoff indicator was determined by the changes in TD-error instead of the episodic rewards but otherwise followed Algorithm 1. These baselines are motivated by initial attempts to guide training with respect to the TD-error, which seems reasonable given that it is the primary error metric for policy training in RL. Performance metrics for the Pendulum, Cart-Pole and Ball-pushing tasks are provided in Tables 3, 4 and 5 respectively.
|
| 131 |
+
|
| 132 |
+
Table 3: Pendulum policy success rate comparisons (higher is better)
|
| 133 |
+
|
| 134 |
+
<table><tr><td rowspan=2 colspan=1>Test Mass</td><td rowspan=1 colspan=5>Policy</td></tr><tr><td rowspan=1 colspan=1>Oracle</td><td rowspan=1 colspan=1>Joint</td><td rowspan=1 colspan=1>PER</td><td rowspan=1 colspan=1>TD-error-guided Curriculum</td><td rowspan=1 colspan=1>Reward-guided Curriculum (ours)</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.93</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.93</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.79</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.64</td><td rowspan=1 colspan=1>0.77</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.93</td><td rowspan=1 colspan=1>0.57</td><td rowspan=1 colspan=1>0.69</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.86</td><td rowspan=1 colspan=1>0.29</td><td rowspan=1 colspan=1>0.69</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.57</td><td rowspan=1 colspan=1>0.14</td><td rowspan=1 colspan=1>0.46</td><td rowspan=1 colspan=1>0.93</td></tr><tr><td rowspan=1 colspan=1>Avg</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.94</td><td rowspan=1 colspan=1>0.73</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>0.99</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 4: Cart-Pole policy success rate comparisons (higher is better)
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan=2 colspan=1>Cart Mass</td><td rowspan=2 colspan=1>Pole Mass</td><td rowspan=1 colspan=3>Policy</td></tr><tr><td rowspan=1 colspan=1>Oracle</td><td rowspan=1 colspan=1>Joint</td><td rowspan=1 colspan=1>Reward-guided Curriculum (ours)</td></tr><tr><td rowspan=4 colspan=1>1.0</td><td rowspan=1 colspan=1>0.10</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.93</td></tr><tr><td rowspan=4 colspan=1>3.0</td><td rowspan=1 colspan=1>0.10</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.86</td></tr><tr><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.79</td></tr><tr><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.79</td></tr><tr><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.86</td></tr><tr><td rowspan=4 colspan=1>5.0</td><td rowspan=1 colspan=1>0.10</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>0.57</td></tr><tr><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>0.64</td></tr><tr><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.64</td></tr><tr><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.64</td></tr><tr><td rowspan=1 colspan=2>Avg</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>0.65</td><td rowspan=1 colspan=1>0.81</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 5: Ball pushing policy error rate comparisons (lower is better)
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan=2 colspan=1>Test Mass</td><td rowspan=1 colspan=4>Policy</td></tr><tr><td rowspan=1 colspan=1>Oracle</td><td rowspan=1 colspan=1>Joint</td><td rowspan=1 colspan=1>PER</td><td rowspan=1 colspan=1>Reward-guided Curriculum (ours)</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.21</td><td rowspan=1 colspan=1>0.55</td><td rowspan=1 colspan=1>4.85</td><td rowspan=1 colspan=1>0.44</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>0.21</td><td rowspan=1 colspan=1>0.64</td><td rowspan=1 colspan=1>4.77</td><td rowspan=1 colspan=1>0.44</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>4.71</td><td rowspan=1 colspan=1>0.45</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>4.66</td><td rowspan=1 colspan=1>0.45</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.69</td><td rowspan=1 colspan=1>4.65</td><td rowspan=1 colspan=1>0.45</td></tr><tr><td rowspan=1 colspan=1>Avg</td><td rowspan=1 colspan=1>0.22</td><td rowspan=1 colspan=1>0.65</td><td rowspan=1 colspan=1>4.72</td><td rowspan=1 colspan=1>0.45</td></tr></table>
|
| 143 |
+
|
| 144 |
+
It is immediately clear that our method outperforms policies built on joint sampling, PER (where tested) and the TD-error-guided curriculum (where tested), and achieves a performance closest to our oracle, of all the methods tested - with the Pendulum and Cart-Pole getting within $1 \%$ and $4 \%$ of their oracles’ success rate respectively (noting that the Pendulum’s oracle achieved a $100 \%$ success rate). In the case of the ball-pushing task, where we did not have a binary definition of success, it can be noted that the average error is improved over joint sampling, being within $2 \times$ of the oracle’s error, as opposed to $3 \times$ . Our method also has a significantly lower computational cost than the oracle, needing to train only a single policy as opposed to $\textstyle \prod _ { m \in M } N _ { m }$ policies. Additionally, as evidenced by Figure 1, the curricula developed appear to address the needs of each learner, adjusting the curriculum policies as necessary.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 1: Cherry-picked comparison of two separate curricula evolution during training, represented as a heat-map to demonstrate probability distribution. Given the pseudo-random nature of episodic experience and policy-network training, it is important for curriculum to be able to adapt to the training experience. Note that Figure 1-left presents with a relatively clear sense of priority, initially favoring mass 2, then 10, then 4, then 6 and then 4 again. Contrast this with Figure 1-right, where there is no obvious pattern. Despite this, policies trained under both curricula present with equally successful performance, implying the ability of this training scheme to adapt consistently to different experiences when attempting to learn to solve a task. Note also that neither curriculum is uniform. Additional curriculum visualizations are provided in Appendix D.
|
| 148 |
+
|
| 149 |
+
It is interesting to note that TD error is apparently a bad metric for guiding curriculum choice and evolution. This is observed both with PER and the TD-error-guided curriculum - where the former samples the replay buffer proportionally to a transition’s TD-error, and the latter adjusts the curriculum based on the TD-errors of transitions associated with previously tested settings. We hypothesize that prioritizing TD-error, which is inherently a measure of the next-state prediction capabilities of the critic, negatively impacts performance due to the fact that the critic is expected to always be wrong when working without a model of the environment and its settings - without explicitly knowing the current setting of the environment, it may simply be impossible to develop good predictions of expected future reward. Prioritizing TD-error as a metric by which to guide multi-setting (and possibly multi-task) learning may therefore wrongly bias policies towards minimizing the variance in TD-error across settings (or tasks). Rudimentary tests on the TD-errors on trained policies appear to support this hypothesis, however, due to time constraints, we have not been able to test this idea sufficiently to make a conclusive claim.
|
| 150 |
+
|
| 151 |
+
# 6 CONCLUSION
|
| 152 |
+
|
| 153 |
+
We proposed learning a stochastic curriculum, guided by episodic reward signals, to get the most out of an agent’s environment and develop action policies robust to environmental perturbation. Furthermore, the curricula developed adapt to the experiences of each learner, allowing for a notion of self-reflection and self-correction. Not only does our method achieve performance close to the best policies found by an exhaustive grid search, it does so with a significantly lower computational cost, needing to train only a single policy, with minimal additional overhead, as opposed to $\Pi _ { m \in M } N _ { m }$ policies. We also further demonstrate that neither uniformly sampling tasks, nor focusing on TDerror, as is common in multi-task RL, extends well to developing robust models for individual tasks. While our current approach is not designed to handle environments with sparse rewards or continuously varying settings, we hope to address these limitations with future work.
|
| 154 |
+
|
| 155 |
+
# REFERENCES
|
| 156 |
+
|
| 157 |
+
Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The nonstochastic multi- \` armed bandit problem. SIAM J. Comput., 32(1):48–77, January 2003. ISSN 0097-5397. doi: 10. 1137/S0097539701398375. URL https://doi.org/10.1137/S0097539701398375.
|
| 158 |
+
|
| 159 |
+
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.
|
| 160 |
+
|
| 161 |
+
Yuri Burda, Harrison A Edwards, Deepak Pathak, Amos J. Storkey, Trevor Darrell, and Alexei A. Efros. Large-scale study of curiosity-driven learning. CoRR, abs/1808.04355, 2018.
|
| 162 |
+
|
| 163 |
+
Coline Devin, Abhishek Gupta, Trevor Darrell, Pieter Abbeel, and Sergey Levine. Learning modular neural network policies for multi-task and multi-robot transfer. IEEE International Conference on Robotics and Automation, pp. 2169–2176, 05 2017. doi: 10.1109/ICRA.2017.7989250.
|
| 164 |
+
|
| 165 |
+
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.
|
| 166 |
+
|
| 167 |
+
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.
|
| 168 |
+
|
| 169 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymyr Mnih, Tom Ward, Yotam ´ Doron, Vlad Firoiu, Tim Harley, Iain Dunning, Shane Legg, and Koray Kavukcuoglu. IMPALA: scalable distributed deep-rl with importance weighted actor-learner architectures. CoRR, abs/1802.01561, 2018. URL http://arxiv.org/abs/1802.01561.
|
| 170 |
+
|
| 171 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1126–1135, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/finn17a.html.
|
| 172 |
+
|
| 173 |
+
Alex Graves, Marc G. Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated ´ curriculum learning for neural networks. CoRR, abs/1704.03003, 2017. URL http://arxiv. org/abs/1704.03003.
|
| 174 |
+
|
| 175 |
+
Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Daniel Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. Association for the Advancement of Artificial Intelligence Conference on Artificial Intelligence, 2017. URL http://arxiv.org/abs/1710. 02298.
|
| 176 |
+
|
| 177 |
+
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, 2016. URL http://arxiv.org/abs/ 1509.02971.
|
| 178 |
+
|
| 179 |
+
Alex Nichol, Vicki Pfau, Christopher Hesse, Oleg Klimov, and John Schulman. Gotta learn fast: A new benchmark for generalization in RL. CoRR, abs/1804.03720, 2018. URL http://arxiv. org/abs/1804.03720.
|
| 180 |
+
|
| 181 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Exampleguided deep reinforcement learning of physics-based character skills. ACM Trans. Graph., 37 (4):143:1–143:14, July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201311. URL http: //doi.acm.org/10.1145/3197517.3201311.
|
| 182 |
+
|
| 183 |
+
Fereshteh Sadeghi, Alexander Toshev, Eric Jang, and Sergey Levine. Sim2real view invariant visual servoing by recurrent control. CoRR, abs/1712.07642, 2017. URL http://arxiv.org/ abs/1712.07642.
|
| 184 |
+
|
| 185 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. International Conference on Learning Representations, 2016.
|
| 186 |
+
|
| 187 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. 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. 1889–1897, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr. press/v37/schulman15.html.
|
| 188 |
+
|
| 189 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/ 1707.06347.
|
| 190 |
+
|
| 191 |
+
Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 23–30, 09 2017. doi: 10.1109/IROS.2017.8202133.
|
| 192 |
+
|
| 193 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and ´ Nando de Freitas. Sample efficient actor-critic with experience replay. CoRR, abs/1611.01224, 2016. URL http://arxiv.org/abs/1611.01224.
|
| 194 |
+
|
| 195 |
+
Yuhuai Wu, Elman Mansimov, Roger B Grosse, Shun Liao, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. 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. 5279–5288. Curran Associates, Inc., 2017.
|
| 196 |
+
|
| 197 |
+
Wenhao Yu, C. Karen Liu, and Greg Turk. Preparing for the unknown: Learning a universal policy with online system identification. Robotics: Science and Systems, 2017. URL http://arxiv. org/abs/1702.02453.
|
| 198 |
+
|
| 199 |
+
# A TRAINING ENVIRONMENTS
|
| 200 |
+
|
| 201 |
+
We primarily use 4 training environments in all our experiments:
|
| 202 |
+
|
| 203 |
+
1. Pendulum-v0 from OpenAI Gym (Brockman et al., 2016), modified minimally to allow for programmatic control of the pendulum’s mass. State space: sinθ, cos θ, $\dot { \theta }$ , Action space: T orque. Sample environment shown in Figure 2
|
| 204 |
+
2. Custom Unity Pendulum Environment - designed to provide a similar interface and response to the OpenAI Gym Pendulum implementation, however making use of Unity’s built-in PhysX physics engine. State space: ${ \dot { \theta } } , { \dot { \theta } }$ , Action space: T orque
|
| 205 |
+
3. CartPole-v1 from OpenAI Gym, modified to allow programmatic control of the pole and cart masses, as well as to be treated as a continuous control task, as opposed to one with discrete actions. State space: $x , { \dot { x } }$ (of cart), $\theta , { \dot { \theta } }$ of pole. Action Space: F orce
|
| 206 |
+
4. Custom Unity Ball-pushing task. State space: $x _ { g } , y _ { g }$ position of goal, $x _ { b } , y _ { b }$ position of ball, $\dot { x } _ { b } , \dot { y } _ { b }$ velocity of ball
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 2: Sample renders from Gym Pendulum-v0 (Left) Random Initialization, (Right) Successful Completion
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 3: Sample renders from Unity Pendulum (Left) Random Initialization, (Right) Successful Completion
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 4: Sample render from Gym CartPole-v1 Success is determined by maintaining the pole steady
|
| 218 |
+
Figure 5: Sample renders from Unity Ball-pushing (Left) Random Initialization, (Right) Successful Completion
|
| 219 |
+
|
| 220 |
+
# B EXPERIMENTAL DETAILS
|
| 221 |
+
|
| 222 |
+
Policy network configuration:
|
| 223 |
+
|
| 224 |
+
• Network Architecture: DDPG
|
| 225 |
+
• Hidden layer configuration: (400,300)
|
| 226 |
+
• Additional notes: Code adapted from Patrick Emami’s code which is available on Github. Modifications were made to remove the use of tflearn and use only tensorflow. Additionally, the OpenAI’s replay buffer code from their baselines (Dhariwal et al., 2017) was adapted into this code to allow for the easy implementation of PER (Schaul et al., 2016)
|
| 227 |
+
|
| 228 |
+
Reward-Guided stochastic curriculum parameters:
|
| 229 |
+
|
| 230 |
+
• $\epsilon \colon 0 . 0 5$ for pendulum and ball-pushing, 0.2 for cart-pole • $\beta \colon 0 . 0 5$ for pendulum and ball-pushing, 0.2 for cart-pole
|
| 231 |
+
|
| 232 |
+
# C ADDITIONAL EXPERIMENTAL RESULTS
|
| 233 |
+
|
| 234 |
+
Table 6: Unity-pendulum success rate for policies trained on individual environment settings (higher is better)
|
| 235 |
+
|
| 236 |
+
<table><tr><td rowspan=1 colspan=1>TrainTest</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>AVG</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.17</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><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.25</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.92</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.93</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr></table>
|
| 237 |
+
|
| 238 |
+
Table 7: Cart-pole success rate for policies trained on individual environment settings (higher is better). Note that the column and row headings contain the trained/tested pole and cart masses respectively within brackets
|
| 239 |
+
|
| 240 |
+
<table><tr><td rowspan=1 colspan=1>Train/Test</td><td rowspan=1 colspan=1>(0.1,1)</td><td rowspan=1 colspan=1>(0.1,3)</td><td rowspan=1 colspan=1>(0.1,5)</td><td rowspan=1 colspan=1>(0.25,1)</td><td rowspan=1 colspan=1>(0.25,3)</td><td rowspan=1 colspan=1>(0.25,5)</td><td rowspan=1 colspan=1>(0.5,1)</td><td rowspan=1 colspan=1>(0.5,3)</td><td rowspan=1 colspan=1>(0.5.5)</td><td rowspan=1 colspan=1>(1,1)</td><td rowspan=1 colspan=1>(1.3)</td><td rowspan=1 colspan=1>(1,5)</td><td rowspan=1 colspan=1>AVG</td></tr><tr><td rowspan=1 colspan=1>(0.1,1)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.67</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><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.21</td></tr><tr><td rowspan=1 colspan=1>(0.1,3)</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.60</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.40</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.18</td></tr><tr><td rowspan=1 colspan=1>(0.1,5)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.82</td></tr><tr><td rowspan=1 colspan=1>(0.25,1)</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.67</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><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.19</td></tr><tr><td rowspan=1 colspan=1>(0.25,3)</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.60</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.20</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.47</td></tr><tr><td rowspan=1 colspan=1>(0.25,5)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.75</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.81</td></tr><tr><td rowspan=1 colspan=1>(0.5,1)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.25</td></tr><tr><td rowspan=1 colspan=1>(0.5,3)</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.56</td></tr><tr><td rowspan=1 colspan=1>(0.5,5)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.50</td><td rowspan=1 colspan=1>0.83</td></tr><tr><td rowspan=1 colspan=1>(1,1)</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.80</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.60</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>0.25</td></tr><tr><td rowspan=1 colspan=1>(1,3)</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.60</td></tr><tr><td rowspan=1 colspan=1>(1,5)</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.85</td></tr></table>
|
| 241 |
+
|
| 242 |
+
# D PENDULUM CURRICULUM EVOLUTION
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 6: Additional Sample Curricula for Pendulum training by Reward-guided Stochastic Curriculum
|
md/train/SJgn3lBtwH/SJgn3lBtwH.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RE-EXAMINING LINEAR EMBEDDINGS FOR HIGH-DIMENSIONAL BAYESIAN OPTIMIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Bayesian optimization (BO) is a popular approach to optimize expensive-toevaluate black-box functions. A significant challenge in BO is to scale to highdimensional parameter spaces while retaining sample efficiency. A solution considered in previous literature is to embed the high-dimensional parameter space into a lower-dimensional manifold, often a random linear embedding. In this paper, we identify several crucial issues and misconceptions about the use of linear embeddings for BO. We thoroughly study and analyze the consequences of using linear embeddings and show that some of the design choices in current approaches adversely impact their performance. Based on this new theoretical understanding we propose ALEBO, a new algorithm for high-dimensional BO via linear embeddings that outperforms state-of-the-art methods on a range of problems, including learning a gait policy for robot locomotion.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Bayesian optimization (BO) is a robust, sample-efficient technique for optimizing expensive-toevaluate black-box functions (Mockus, 1989; Jones, 2001). BO has been successfully applied to diverse applications, ranging from automated machine learning (Snoek et al., 2012; Hutter et al., 2011) to robotics (Lizotte et al., 2007; Calandra et al., 2015; Rai et al., 2018). One of the most active topics of research in BO is how to extend current methods to higher-dimensional spaces. A common framework to tackle this problem is to consider a high-dimensional BO (HDBO) task as a standard BO problem in a low-dimensional embedding, where the embedding can be either linear (typically a random projection) or nonlinear (e.g. via a multi-layer neural network); see Sec. 2 for a full review. An advantage of this framework is to explicitly decouple the problem of finding low-dimensional representations suitable for optimization from the actual optimization technique.
|
| 12 |
+
|
| 13 |
+
In this paper we study the use of linear embeddings for HDBO, and in particular we re-examine prior efforts to use random linear projections. Random projections are attractive for BO because, by the Johnson-Lindenstrauss lemma, they can be approximately distance-preserving (Johnson & Lindenstrauss, 1984) without requiring any data to learn the embedding. Random embeddings come with several strong theoretical guarantees, but have shown mixed empirical performance for HDBO.
|
| 14 |
+
|
| 15 |
+
The contributions of this paper are: 1) We provide new results that identify why linear embeddings have performed poorly in HDBO. We show that existing approaches produce representations that cannot be well-modeled by a Gaussian process (GP), or representations that likely do not contain an optimum (Sec. 4). 2) We construct a representation with better properties for BO (Sec. 5): we improve modelability by deriving a Mahalanobis kernel tailored for linear embeddings and adding polytope bounds to the embedding, and we show how to maintain a high probability that the embedding contains an optimum. 3) We show that using this representation for BO outperforms a wide range of previous approaches for HDBO, including on test functions up to $D = 1 0 0 0$ , and on realworld problems, such as gait optimization of a multi-legged robot (Sec. 6). These include the first results for HDBO with black-box constraints.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
There are generally two approaches to extending BO into high dimensions. The first is to produce a low-dimensional embedding, do standard BO in this low-dimensional space, and then project up to the original space for function evaluations. The foundational work on embeddings for BO is REMBO (Wang et al., 2016), which creates a linear embedding by generating a random projection matrix. Sec. 3 provides a thorough description of REMBO and several subsequent approaches based on random linear embeddings (Qian et al., 2016; Binois et al., 2019; Nayebi et al., 2019). If derivatives of $f$ are available, the active subspace method can be used to recover a linear embedding (Constantine et al., 2014; Eriksson et al., 2018), or approximate gradients can be used (Djolonga et al., 2013). BO can also be done in nonlinear embeddings through VAEs (Gomez-Bombarelli et al., ´ 2018; Lu et al., 2018; Moriconi et al., 2019). An attractive aspect of random embeddings is that they can be extremely sample-efficient, since the only model to be estimated is a low-dimensional GP.
|
| 20 |
+
|
| 21 |
+
The second approach to extend BO to high dimensions is to make use of surrogate models that better handle high dimensions, typically by imposing additional structure on the problem. Work along these lines include GPs with an additive kernel (Kandasamy et al., 2015; Wang et al., 2017; Gardner et al., 2017; Wang et al., 2018; Rolland et al., 2018; Mutny & Krause, 2018), cylindrical kernels (Oh ´ et al., 2018), or deep neural network kernels (Antonova et al., 2017). Random forest is used as the surrogate model in SMAC (Hutter et al., 2011). These methods produce trade-offs between sample efficiency of the model and the ability to effectively optimize the acquisition function.
|
| 22 |
+
|
| 23 |
+
Here, we focus on the embedding approach and in particular the use of linear embeddings for HDBO. Without box bounds, REMBO comes with a strong guarantee: with probability 1, the embedding contains an optimum (Wang et al., 2016, Thm. 2). However, if function evaluations are limited to the box bounds, as is typical in BO problems, REMBO requires a collection of heuristics for which there are no longer guarantees on performance. While REMBO can perform well in some HDBO tasks, subsequent papers have found it can perform poorly even on tasks with a true low-dimensional linear subspace (e.g. Nayebi et al., 2019). In this paper, we analyze the properties of linear embeddings as they relate to BO, and show how to improve the representation of the function we seek to optimize.
|
| 24 |
+
|
| 25 |
+
# 3 PROBLEM FRAMEWORK AND REMBO
|
| 26 |
+
|
| 27 |
+
In this section we define the problem framework and notation, and then describe BO via random linear projections (REMBO)—a promising method for HDBO—along with known challenges and follow-up work that has been proposed to address these issues.
|
| 28 |
+
|
| 29 |
+
Bayesian optimization We consider optimization problems of the form $\scriptstyle \operatorname* { m i n } _ { { \pmb x } \in B } f ( { \pmb x } )$ where $f$ is a black-box function and $\boldsymbol { B }$ are box bounds. We assume gradients of $f$ are unavailable. The box bounds on $_ { \textbf { \em x } }$ specify the range of values that are reasonable or physically possible to evaluate. For instance, Gramacy et al. (2016) use BO for an environmental remediation problem in which each $x _ { i }$ represents the pumping rate of a particular pump, which has physical limitations. The problem may also include nonlinear constraints $c _ { j } ( { \pmb x } ) \leq 0$ where each $c _ { j }$ is itself a black-box function. BO is a form of sequential model-based optimization, where we construct a surrogate model for $f$ and use that model to identify which parameters $_ { \textbf { \em x } }$ should be evaluated next, according to an explore-exploit strategy. The surrogate model is typically a GP, $f \sim \mathcal { G P } ( m ( \cdot ) , k ( \cdot , \cdot ) )$ , with mean function $m ( \cdot )$ and a kernel $k ( \cdot , \cdot )$ . Under the GP prior, the posterior for the value of $f ( { \pmb x } )$ at any point in the space is a normal distribution with closed-form mean and variance. Using that posterior, we construct an acquisition function $\alpha ( { \pmb x } )$ that specifies the value of a function evaluation at $_ { \textbf { \em x } }$ , such as Expected Improvement (EI) (Jones et al., 1998). We find $\pmb { x } ^ { * } \in \arg \operatorname* { m a x } _ { \pmb { x } \in B } \alpha ( \pmb { x } )$ , and evaluate $f ( { \pmb x } ^ { * } )$ .
|
| 30 |
+
|
| 31 |
+
The GP is useful for BO because it provides a well-calibrated posterior in closed form. With typical kernels and acquisition functions, $\alpha ( { \pmb x } )$ is differentiable and can be effectively optimized. However, with typical kernels like the ARD RBF kernel, there are significant limitations. GPs are known to predict poorly in high dimensions, which for a GP is $D$ larger than 15–20 (Wang et al., 2016; Li et al., 2016; Nayebi et al., 2019). This prevents BO from being a useful tool in high dimensions.
|
| 32 |
+
|
| 33 |
+
In HDBO, the objective $f : \mathbb { R } ^ { D } \mathbb { R }$ operates in a high-dimensional $( D )$ space, which we call the ambient space. When using linear embeddings for HDBO, we assume there exists a low-dimensional linear subspace that captures all of the variation of $f$ . Specifically, let $f _ { d } : \mathbb { R } ^ { d } \mathbb { R }$ , $d \ll D$ , and let $\pmb { T } \in \mathbb { R } ^ { d \times D ^ { 1 } }$ be a projection matrix from $D$ down to $d$ dimensions. The linear embedding assumption is that $f ( \pmb { x } ) = f _ { d } ( \pmb { \bar { T } } \pmb { x } ) ~ \forall \pmb { x } \in \mathbb { R } ^ { D }$ . $_ { \mathbf { T } }$ is unknown, and we only have access to $f$ , not $f _ { d }$ . We assume without loss of generality that the box bounds are $\boldsymbol { B } = [ - 1 , \mathrm { \bar { 1 } } ] ^ { D }$ ; the ambient space can always be scaled to these bounds.
|
| 34 |
+
|
| 35 |
+
REMBO: Bayesian optimization via random embedding REMBO (Wang et al., 2016) generates a random projection matrix $\pmb { A } \in \mathbb { R } ^ { D \times d _ { e } }$ with each element drawn independently from $\mathcal { N } ( 0 , 1 )$ to specify a $d _ { e }$ -dimensional embedding. BO is done in the embedding to identify a point $\pmb { y } \in \mathbb { R } ^ { d _ { e } }$ to be evaluated, which is given objective value $f ( A y )$ . The embedding dimension $d _ { e }$ should satisfy $d _ { e } \geq d$ for the REMBO guarantee of containing an optimum to hold.
|
| 36 |
+
|
| 37 |
+
The main challenges for using REMBO come when dealing with box bounds in the ambient space. We may select a point $\textbf { { y } }$ in the embedding to be evaluated and find that its projection to the ambient space, $\pmb { A } \pmb { y }$ , falls outside $\boldsymbol { B }$ . The first challenge this poses is a theoretical challenge: $\mathbb { R } ^ { d _ { e } }$ is guaranteed to contain an optimum, but that optimum is not guaranteed to project up to $\boldsymbol { B }$ . When function evaluations are restricted to the box bounds, the embedding may not contain an optimum—it is not difficult to construct examples of this. REMBO has no theoretical guarantees in this setting. The second challenge posed by box bounds is the practical challenge of how function evaluations should be done for points that project up outside √ √ $\boldsymbol { B }$ . Here REMBO introduces three heuristics. First, the embedding is given box bounds $[ - \sqrt { d _ { e } } , \sqrt { d _ { e } } ] ^ { d _ { e } }$ . BO will only select points within those bounds to be projected up and evaluated. Second, if a point $\textbf { { y } }$ in the embedding projects up outside $\boldsymbol { B }$ , then it is clipped to $\boldsymbol { B }$ . Let $p _ { B } : \mathbb { R } ^ { D } \mathbb { R } ^ { D }$ be the $L ^ { 2 }$ projection that maps $_ { \textbf { \em x } }$ to its nearest point in $\boldsymbol { B }$ . A point $\textbf { { y } }$ in the embedding is given objective value $f ( p _ { B } ( A y ) )$ , which can always be evaluated. Note that clipping to $\boldsymbol { B }$ renders the projection of $\textbf { { y } }$ to the ambient space a nonlinear transformation whenever $A y \notin B$ . Third, the optimization is done with $k { = } 4$ separate projections, to improve the chances of√ √ generating an embedding that contains an optimum inside $[ - \sqrt { d _ { e } } , \sqrt { d _ { e } } ] ^ { d _ { e } }$ . Since these embeddings are independent, no data can be shared across them, which reduces sample efficiency.
|
| 38 |
+
|
| 39 |
+
Extensions of REMBO Binois et al. (2015) consider the issue of non-injectivity, where the $L ^ { 2 }$ projection causes many points in the embedding to map to the same vertex of $\boldsymbol { B }$ . They define a warped kernel that reduces non-injectivity, which is called REMBO- $\phi k _ { \Psi }$ . Binois et al. (2019) consider the issue of setting bounds on the embedding. They define a projection matrix $B \in \mathbb { R } ^ { d \times D }$ that maps from the ambient space down to the embedding, and replace the $L ^ { 2 }$ projection with a projection $\gamma$ that maps $\textbf { { y } }$ to the closest point in $\boldsymbol { B }$ that satisfies $\mathbf { \delta } _ { B x } = \mathbf { \delta } _ { y }$ . The $\gamma$ projection resolves the core challenge of REMBO related to setting bounds in the embedding: we can restrict the optimization in the embedding to points for which $\exists { \boldsymbol { x } } \in \mathbf { \boldsymbol { B } }$ s.t. $B x = y$ , and so heuristic box bounds in the embedding are no longer required. The $\gamma$ projection projects to the same points on the facets of $\boldsymbol { B }$ as the $L ^ { 2 }$ projection. Paired with the warped kernel of Binois et al. (2015), this is called REMBO- $\gamma k _ { \Psi }$ .
|
| 40 |
+
|
| 41 |
+
Binois (2015) studies different choices for the projection matrix and shows that BO performance can be improved for small $d$ by sampling each row of $\pmb { A }$ from the unit hypersphere $\mathbb { S } ^ { d _ { e } - 1 }$ . If $\boldsymbol { z } \sim \mathcal { N } ( \mathbf { 0 } , I _ { d _ { e } } )$ , then $\frac { z } { | | z | | }$ is a random sample from $\mathbb { S } ^ { d _ { e } - 1 }$ , so this amounts to normalizing the rows of the usual REMBO projection matrix.
|
| 42 |
+
|
| 43 |
+
HeSBO (Nayebi et al., 2019) is a recent extension of REMBO that avoids clipping to $\boldsymbol { B }$ and heuristic box bounds in the embedding by changing the projection matrix $\pmb { A }$ . In $d _ { e } = 1$ , it is easy to see that the projection matrix $\mathbf A = \mathbf 1$ , which sets every $x _ { i } = y$ , is optimal. With this projection we can set bounds of $[ - 1 , 1 ]$ on the embedding and there is no need for $L ^ { 2 }$ projections because every point in the embedding will map to a point in $\boldsymbol { B }$ . HeSBO extends this to $d _ { e } > 1$ by setting each row of $\pmb { A }$ to have a single non-zero element, which is randomly set to $\pm 1$ . The column with the non-zero value is chosen uniformly at random. Thus, each parameter in the ambient space is mapped directly to a parameter in the embedding: $x _ { i } = \pm y _ { j }$ , where $j$ is sampled uniformly from $\{ 1 , \ldots , d _ { e } \}$ and $\pm$ is chosen uniformly at random. The embedding is given box bounds of $[ - 1 , 1 ] ^ { d _ { e } }$ .
|
| 44 |
+
|
| 45 |
+
# 4 CHALLENGES WITH LINEAR EMBEDDINGS
|
| 46 |
+
|
| 47 |
+
Heuristics for handling box bounds when utilizing linear embeddings introduce several issues that impact HDBO performance. We highlight one recent observation from Binois et al. (2019), that most points in the embedding project up outside the box bounds, and discuss three novel observations about how existing methods can make it difficult to learn high-dimensional surrogates.
|
| 48 |
+
|
| 49 |
+
Projection to the facets of $\boldsymbol { B }$ produces a nonlinear distortion in the function. The function value at any point in the embedding is measured as $f ( p \boldsymbol { { s } } ( \boldsymbol { { A } } \boldsymbol { { y } } ) )$ . For points $\textbf { { y } }$ that project up outside of $\boldsymbol { B }$ , this will be a nonlinear mapping from the embedding to the ambient space, despite the use of a linear embedding. This has a powerful, detrimental effect on the ability to model $f$ in the embedding. Fig. 1 provides visualizations of an actual REMBO embedding for two classic test functions: the Branin $( d { = } 2 )$ and Hartmann6 $( d \small { = } 6 )$ functions, both extended to $D { = } 1 0 0$ by adding unused variables. The REMBO embedding for the Branin function contains all three optima, however there is visible distortion to the function caused by the the clipping to $\boldsymbol { B }$ . The embedding for the Hartmann6 function is even more heavily distorted.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: A visualization of REMBO embeddings for two test functions. (Top left) The Branin function, $d { = } 2$ , extended to $D { = } 1 0 0$ . (Top right) A REMBO embedding of the $D { = } 1 0 0$ Branin function. (Bottom left) A center slice of the $d { = } 6$ Hartmann6 function, similarly extended to $D { = } 1 0 0$ . (Bottom right) The same slice of a REMBO embedding of that function. The embedding produces distortions in the function that render it difficult to model.
|
| 53 |
+
|
| 54 |
+
Even if the function is well-modeled by a GP in the true low-dimensional space, the distortion produced by the REMBO projection transforms it into one on the embedding that is not appropriate for a GP. This can happen for any embedding strategy that cannot guarantee all points in the embedding project into $\boldsymbol { B }$ . The distortion induced by mapping to the facet depends on the relative angles of the facet and the true embedding. Projection to a facet essentially induces a non-stationarity in the kernel: each of the $2 D$ facets sits at different angles to the true subspace, and so the change in the rate of function variance will differ for each. To correct for the non-stationarity, we would have to estimate the true subspace $\mathbf { T }$ , which with $d \times D$ entries is not feasible for $D$ large.
|
| 55 |
+
|
| 56 |
+
The idea behind using low-dimensional embeddings for HDBO is that it enables the use of standard BO techniques on the embedding. However, from these results we see that for the REMBO projection with box bounds we cannot expect to successfully model the function on the embedding with a regular GP. The problem is especially acute for $d _ { e } > 2$ where, as we will see next, nearly all points in the embedding map to one of the $2 D$ facets.
|
| 57 |
+
|
| 58 |
+
Most points in the embedding map to the facets of $\boldsymbol { B }$ . Fig. 2 shows the probability that an interior point in the embedding projects up to the interior of √ √ $\boldsymbol { B }$ . This is measured empirically by sampling $\textbf { { y } }$ uniformly at random from $[ - \dot { \sqrt { d _ { e } } } , \sqrt { d _ { e } } ] ^ { d _ { e } }$ , sampling $\pmb { A }$ with $\mathcal { N } ( 0 , 1 )$ entries, and then checking if $\boldsymbol { A } \boldsymbol { y } \in \mathcal { B }$ (with 1000 samples). Even for small $D$ , with $d _ { e } > 2$ practically all of the volume in the embedding projects up outside the box bounds, and is thus clipped to a facet of $\boldsymbol { B }$ .
|
| 59 |
+
|
| 60 |
+
This is an issue because it means the optimization will be done primarily on the facets of $\boldsymbol { B }$ and not in the interior, which will likely not even be reached in a typical BO initialization. We saw in Fig. 1 that the function behaves very differently on points projected to the facets, and that these parts of the space can be hard to model with a GP. The problem cannot be resolved by simply shrinking the box bounds in the embedding. Binois et al. (2019) provide an excellent study of the issue of setting bounds in the embedding and show that with the REMBO strategy there is no good way to do this. The pup to $\boldsymbol { B }$ onto the embedding produces a star-shaped object called a zonotope, which has vertices (Ferrez et al., 2005). Shrinking box bounds in the embedding cuts off $2 \textstyle \sum _ { i = 0 } ^ { d - 1 } { \binom { D - 1 } { i } }$ the vertices of the zonotope and increases the chance of not containing an optimum.
|
| 61 |
+
|
| 62 |
+
Linear projections do not preserve product kernels. Although less visible than that produced by the projection to the facets, there is also distortion to interior points just from the linear projection $\pmb { A }$ . The ARD kernels typically used in GP modeling are product kernels that decompose the covariance into the covariance across each dimension. Inside the embedding, moving along a single dimension will move across all dimensions of the ambient space, at rates depending on the projection matrix. Consider moving along a single dimension in the embedding, from $\mathbf { \mu } _ { \mathbf { \mu } _ { y 1 } }$ to $\mathbf { { \boldsymbol { { y } } } } _ { 2 }$ where only a single element has changed. The corresponding points in the ambient space are $\pmb { x } _ { 1 } = \pmb { A } \pmb { y } _ { 1 }$ and $\mathbf { x } _ { 2 } = A y _ { 2 }$ : even though $\mathbf { \pmb { y } } _ { 1 }$ and $\mathbf { { \boldsymbol { { y } } } } _ { 2 }$ differ in only one element, $\mathbf { \delta x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ will differ in all their elements. Thus a product kernel in the true subspace will not produce a product kernel in the embedding; this is shown mathematically in Proposition 1.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: The probability that a randomly selected point in the REMBO embedding satisfies the ambient box bounds after being projected up. For $d _ { e } > 2$ , nearly all points in the embedding map outside the box bounds.
|
| 66 |
+
|
| 67 |
+
Linear embeddings can have a low probability of containing an optimum. HeSBO avoids the challenges of REMBO related to box bounds: all interior points in the embedding map to interior points of $\boldsymbol { B }$ , and there is no need for the $L ^ { 2 }$ projection and thus the ability to model in the embedding is improved. However, for $d _ { e } > 1$ there is no guarantee that the embedding will contain an optimum, and in fact the probability of containing an optimum can be quite low. Consider the example of an axis-aligned true subspace: $f$ operates only on some set of $d$ elements of $_ { \textbf { \em x } }$ , which we denote $\mathcal { T } = \{ i _ { 1 } , \ldots , i _ { d } \}$ . For $d = 2$ and $d _ { e } \geq 2$ , there are three possible embeddings: $\boldsymbol { x } _ { i _ { 1 } }$ and $x _ { i _ { 2 } }$ map to different features in the embedding, $x _ { i _ { 1 } } = x _ { i _ { 2 } }$ , or $x _ { i _ { 1 } } = - x _ { i _ { 2 } }$ . These three embeddings are visualized in Appendix A.1. In the first case the embedding successfully captures the entire true subspace and we can expect the optimization to be successful. However, in the other two cases the embedding is only able to reach the diagonals of the true subspace, which, unless $f$ happens to have an optimum on the diagonal, will not reach the optimal value. Under a uniform prior on the location of optima, we can compute analytically the probability that the HeSBO embedding contains an optimum (see Appendix A.1). The probability is independent of $D$ , but is low for even moderate values of $d$ . For instance, with $d = 6$ , $d _ { e } = 2 0$ gives only a $44 \%$ chance of recovering an optimum.
|
| 68 |
+
|
| 69 |
+
Relative to REMBO, HeSBO improves the ability to effectively model and optimize in the embedding, but reduces the likelihood of the embedding containing an optimum. Empirically, this trade-off leads to HeSBO having better BO performance than REMBO. Like HeSBO, here we wish to eliminate the $L ^ { 2 }$ projection and thus improve our ability to model and optimize in the embedding. We will show that this can be done while maintaining a much higher chance of the embedding containing an optimum, which will further improve BO performance.
|
| 70 |
+
|
| 71 |
+
# 5 LEARNING AND OPTIMIZING IN LINEAR EMBEDDINGS
|
| 72 |
+
|
| 73 |
+
We now show how to overcome the embedding issues described in Sec. 4. Similarly to Binois et al. (2019), we define the embedding via a matrix $\boldsymbol { B } \in \mathbb { R } ^ { d _ { e } \times D }$ that projects from the ambient space down to the embedding, and $f _ { B } ( \mathbf { \bar { y } } ) = f ( B ^ { \dagger } y )$ as the function evaluated on the embedding, where $B ^ { \dagger }$ denotes the matrix pseudo-inverse. The new techniques we develop here are applicable to any linear embedding, not just random embeddings.
|
| 74 |
+
|
| 75 |
+
# 5.1 A KERNEL FOR LEARNING IN A LINEAR EMBEDDING
|
| 76 |
+
|
| 77 |
+
As discussed in Sec. 4, a product kernel over dimensions of the true subspace (ARD) does not translate to a product kernel over dimensions in the embedding. However, stationarity in the true subspace does imply stationarity in the embedding, and this result gives the appropriate kernel structure.
|
| 78 |
+
|
| 79 |
+
Proposition 1. Suppose the function on the true subspace is drawn from a $G P$ with an ARD RBF kernel: $f _ { d } \sim \mathcal { G P } ( m ( \cdot ) , k _ { R B F } ( \cdot , \cdot ) )$ . For any pair of points in the embedding $\textbf { { y } }$ and $\mathbf { \Delta } _ { \mathbf { \boldsymbol { y } } ^ { \prime } }$ ,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
C o \nu [ f _ { B } ( \pmb { y } ) , f _ { B } ( \pmb { y } ^ { \prime } ) ] = \sigma ^ { 2 } \exp \left( - ( \pmb { y } - \pmb { y } ^ { \prime } ) ^ { \top } \pmb { \Gamma } ( \pmb { y } - \pmb { y } ^ { \prime } ) \right) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\sigma ^ { 2 }$ is the kernel variance of $f _ { d } ,$ , and $\mathbf { T } \in \mathbb { R } ^ { d _ { e } \times d _ { e } }$ is symmetric and positive definite.
|
| 86 |
+
|
| 87 |
+
Proof. To determine the covariance in function values of points in the embedding, we first project up to the ambient space and then project down to the true subspace
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
f _ { B } ( \pmb { y } ) = f ( B ^ { \dagger } \pmb { y } ) = f _ { d } ( \pmb { T } B ^ { \dagger } \pmb { y } ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Then,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { \mathrm { C o v } [ f _ { B } ( \pmb { y } ) , f _ { B } ( \pmb { y } ^ { \prime } ) ] = \mathrm { C o v } [ f _ { d } ( \pmb { T } \pmb { B } ^ { \dag } \pmb { y } ) , f _ { d } ( \pmb { T } \pmb { B } ^ { \dag } \pmb { y } ) ] } \\ & { \quad \quad \quad \quad = \sigma ^ { 2 } \exp \left( - ( \pmb { T } \pmb { B } ^ { \dag } \pmb { y } - \pmb { T } \pmb { B } ^ { \dag } \pmb { y } ^ { \prime } ) ^ { \top } \pmb { D } ( \pmb { T } \pmb { B } ^ { \dag } \pmb { y } - \pmb { T } \pmb { B } ^ { \dag } \pmb { y } ^ { \prime } ) \right) , } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\begin{array} { r } { D = \mathrm { d i a g } \left( \left[ \frac { 1 } { 2 \ell _ { 1 } ^ { 2 } } , \dots , \frac { 1 } { 2 \ell _ { d } ^ { 2 } } \right] \right) } \end{array}$ . Let $\mathbf { \Gamma } \mathbf { \Gamma } = ( T B ^ { \dagger } ) ^ { \top } D ( T B ^ { \dagger } )$ . Because $_ D$ is positive definite, it follows that $\mathbf { \delta T }$ is symmetric and positive definite.
|
| 100 |
+
|
| 101 |
+
This kernel replaces the ARD Euclidean distance with a Mahalanobis distance, and so we refer to it as the Mahalanobis kernel. Similar kernels have been used for GP regression in other settings (Vivarelli & Williams, 1999; Snelson $\&$ Ghahramani, 2006). This result shows that the impact of the linear projection on the kernel can be correctly handled by fitting a $\frac { d _ { e } ( d _ { e } + 1 ) } { 2 }$ -parameter distance metric rather than the typical $d _ { e }$ -parameter ARD metric. The use of this kernel is vital for obtaining good model fits in the embedding. Appendix A.2 shows GP predictive performance on a linear embedding of the Hartmann6 function, in which an ARD RBF kernel entirely fails to predict, while the Mahalanobis kernel does not. We handle uncertainty in $\mathbf { \delta T }$ by posterior sampling from a Laplace approximation of its posterior; this is described in the appendix.
|
| 102 |
+
|
| 103 |
+
# 5.2 AVOIDING NONLINEAR PROJECTIONS
|
| 104 |
+
|
| 105 |
+
The most significant distortions seen in Fig. 1 result from clipping projected points to $\boldsymbol { B }$ . We can avoid this by constraining the optimization in the embedding to points that do not project up outside the bounds, that is, $B ^ { \dagger } y \in B$ . Let $\alpha ( \pmb { y } )$ be the acquisition function evaluated in the embedding that we wish to optimize. We select the next point to evaluate by solving
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\operatorname* { m a x } _ { \pmb { y } \in \mathbb { R } ^ { d _ { e } } } \alpha ( \pmb { y } ) \mathrm { s u b j e c t t o } - \mathbf { 1 } \leq \pmb { B } ^ { \dag } \pmb { y } \leq \mathbf { 1 } .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Note that there are no box bounds on the embedding. The constraints $- \mathbf { 1 } \le B ^ { \dagger } y \le \mathbf { 1 }$ form a polytope, which is convex and can be efficiently optimized over with off-the-shelf optimization tools. Appendix A.3 provides visualizations of the embedding subject to these constraints. Within this space, the projection is entirely linear and can be effectively modeled with the GP described in Sec. 5.1.
|
| 112 |
+
|
| 113 |
+
# 5.3 THE PROBABILITY THE EMBEDDING CONTAINS AN OPTIMUM
|
| 114 |
+
|
| 115 |
+
Restricting the embedding with the constraints in (1) eliminates distortions from clipping to $\boldsymbol { B }$ , but it also reduces the volume of the ambient space that can be reached from the embedding and thus reduces the probability that the embedding contains an optimum. To understand the performance of BO in the linear embedding, it is critical to understand this probability, which we denote $P _ { \mathrm { o p t } }$ . Recall that even with clipping, the REMBO theoretical result does not hold when function evaluations are restricted to box bounds, and so even REMBO will generally have $P _ { \mathrm { o p t } } < 1$ .
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Probability the embedding contains an optimum $( P _ { \mathrm { o p t } } )$ when restricted to the constraints of (1), under a uniform prior for the location of the optima and $D = 1 0 0$ , for three embedding strategies. Setting $d _ { e } > d$ rapidly increases $P _ { \mathrm { o p t } }$ , and high probabilities can achieved with reasonable values of $d _ { e }$ . Hypersphere sampling produces the best embedding, particularly for $d$ small.
|
| 119 |
+
|
| 120 |
+
$P _ { \mathrm { o p t } }$ depends on where the optima are in the ambient space—for instance, an optimum at 0 will always be contained in the embedding. Suppose the true subspace has an optimum at $z ^ { * }$ . Then, $\mathcal { O } ( T , z ^ { * } ) = \{ { \pmb x } : T { \pmb x } = z ^ { * } \}$ defines the set of optima in the ambient space. We wish to determine if any of these optima can be reached from the embedding. The points $_ { \textbf { \em x } }$ that can be reached from the embedding are those for which there exists a $\textbf { { y } }$ in the embedding that projects up to $_ { \textbf { \em x } }$ , that is, $B ^ { \dagger } y =$ $_ { \textbf { \em x } }$ . Since the embedding itself is produced from the projection ${ \mathbf { } } _ { { \mathbf { } } } { \mathbf { } } _ { { \mathbf { } } }$ , $\bar { \mathcal { E } ( B ) } \overset { v } { = } \left\{ \pmb { x } : B ^ { \dagger } B \pmb { x } = \pmb { x } \right\}$ defines the set of points in ambient space that can be reached from the embedding. The embedding contains an optimum if and only if the intersection $\mathcal { O } ( T , z ^ { * } ) \cap \mathcal { E } ( B ) \cap B$ is non-empty. Given a prior for the locations of optima (that is, over $\mathbf { T }$ and $z ^ { * }$ ), we can compute $P _ { \mathrm { o p t } }$ as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
P _ { \mathrm { o p t } } = \mathbb { E } _ { B , T , z ^ { * } } \left[ \mathbf { 1 } _ { \mathcal { O } ( T , z ^ { * } ) \cap \mathcal { E } ( B ) \cap \mathcal { B } \neq \mathcal { O } } \right] .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Importantly, ${ \mathcal { O } } ( T , z ^ { * } )$ , $\mathcal { E } ( B )$ , and $\boldsymbol { B }$ are all polyhedra, so their intersection can be tested by solving a linear program (see Appendix A.4). The expectation can be estimated with Monte Carlo sampling from the prior over $\mathbf { T }$ and $z ^ { * }$ and from the chosen generating distribution of $\textbf { { B } }$ .
|
| 127 |
+
|
| 128 |
+
For our analysis here, we give $_ { \mathbf { T } }$ a uniform prior over axis-aligned subspaces as described in Sec. 4, and we give $z ^ { * }$ a uniform prior in that subspace. Under these uniform priors, we can evaluate (2) to compute $P _ { \mathrm { o p t } }$ as a function of $B , D , d ,$ , and $d _ { e }$ . Fig. 3 shows these probabilities for $D = 1 0 0$ as a function of $d$ and $d _ { e }$ , for three strategies for generating the projection matrix: the REMBO strategy of $\mathcal { N } ( 0 , 1 )$ , the HeSBO projection matrix, and the unit hypersphere sampling described in Sec. 4. Increasing $d _ { e }$ above $d$ rapidly improves the probability of containing an optimum. For $d = 6$ , with $d _ { e } = 6$ the probability is nearly 0, while increasing $d _ { e }$ to 12 is sufficient to raise it to 0.5 and with $d _ { e } = 2 0$ it is nearly 1. Across all values of $d$ and $d _ { e }$ , hypersphere sampling produces the embedding with the best chance of containing an optimum. Appendix A.4 shows $P _ { \mathrm { o p t } }$ for more values of $D$ and $d$ . By using hypersphere sampling and selecting $d _ { e } > d$ , we can maintain a high $P _ { \mathrm { o p t } }$ while still avoiding clipping to $\boldsymbol { B }$ .
|
| 129 |
+
|
| 130 |
+
# 5.4 A NEW METHOD FOR BO WITH LINEAR EMBEDDINGS: ALEBO
|
| 131 |
+
|
| 132 |
+
We combine the results and insight gained into a new method for HDBO, which we call adaptive linear embedding BO (ALEBO), since the kernel metric and embedding bounds are adapted with the choice of $\textbf { { B } }$ . The approach is given in algorithm form in Algorithm 1. Code is available at github.com/anonymized-for-review. In Line 1 the embedding is specified by generating a random projection matrix. We use hypersphere sampling, which gave the best $P _ { \mathrm { o p t } }$ in Fig. 3 among strategies tried here, but this could be replaced with a different projection strategy should one be more appropriate for a particular setting.
|
| 133 |
+
|
| 134 |
+
# 6 BENCHMARK EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
We evaluate the performance of ALEBO on synthetic HDBO tasks, and compare its performance to a broad selection of HDBO methods. We include in these benchmarks: REMBO and HeSBO;
|
| 137 |
+
|
| 138 |
+
Data: D, de, ninit, nBO. Result: Approximate optimizer $\pmb { x } ^ { * }$ . 1 Generate a random projection matrix $\textbf { { B } }$ by sampling $D$ points from the hypersphere $\mathbb { S } ^ { d _ { e } - 1 }$ . 2 Generate $n _ { \mathrm { i n i t } }$ random points $y ^ { i }$ in the embedding using rejection sampling to satisfy polytope (1). 3 Let $\mathcal { D } = \{ ( \pmb { y } ^ { i } , f ( \pmb { B } ^ { \dag } \pmb { y } ^ { i } ) \} _ { i = 1 } ^ { n _ { \mathrm { i n i t } } }$ be the initial data. 4 for $j = 1 , \dots , n _ { B O }$ do 5 Fit a GP by maximizing marginal log-likelihood of $\mathcal { D }$ , with the Mahalanobis kernel. 6 Draw posterior samples of $\mathbf { \delta T }$ using a Laplace approximation. Marginalize over the posterior with moment matching. 7 Use the GP to find $\boldsymbol { y } ^ { j }$ that maximizes the acquisition function according to (1). 8 Update $\mathcal { D }$ with $( { \pmb y } ^ { j } , f ( { \pmb B } ^ { \dagger } { \pmb y } ^ { j } ) )$
|
| 139 |
+
|
| 140 |
+
REMBO variants $\phi k _ { \Psi }$ (Binois et al., 2015) and $\gamma k _ { \Psi }$ (Binois et al., 2019); additive kernel methods Add-GP-UCB (Kandasamy et al., 2015) and Ensemble BO (EBO) (Wang et al., 2018); SMAC, which uses a random forest model; CMA-ES, an evolutionary strategy (Hansen et al., 2003); and quasirandom search (Sobol). For ALEBO we took $d _ { e } = 2 d$ for these experiments. In their evaluation of HeSBO, Nayebi et al. (2019) used $d _ { e } = 2 d$ when $d = 2$ but $d _ { e } = d$ on the Hartmann6 problem. Our results in Fig. 3 indicate that with $d = 6$ HeSBO will have a much higher chance of reaching an optimum with $d _ { e } = 2 d$ , so we evaluate this alongside their original choice of $d _ { e } = d$ .
|
| 141 |
+
|
| 142 |
+
Fig. 4 shows optimization performance for three HDBO tasks: the Branin problem extended to $D { = } 1 0 0$ as described above; the Hartmann6 problem extended to $D { = } 1 0 0 0$ ; and the Gramacy problem extended to $D { = } 1 0 0$ . The Gramacy problem (Gramacy et al., 2016) includes two black-box constraints. The linear embedding methods (ALEBO, REMBO, and HeSBO) can naturally be extended to constrained optimization as described in Appendix A.5. The $D { = } 1 0 0$ problems were repeated with 50 runs, and the $D { = } 1 0 0 0$ problem was repeated with 25 runs. Appendix A.6 provides additional details of the benchmark methods, additional experimental results (including plots of log regret and error bars), and an extended analysis of the results.
|
| 143 |
+
|
| 144 |
+
For all problems, ALEBO had the best average optimization performance. Relative to other linear embedding approaches, ALEBO also had low variance in the final best-value, which is important in real applications where one can typically only run one optimization run. For the $D { = } 1 0 0 0$ problem, REMBO- $\gamma k _ { \Psi }$ , EBO, and Add-GP-UCB did not finish a single run after 24 hours and so were terminated and not included in the results. These methods, along with SMAC and CMA-ES, also do not support blackbox constraints and so were not included in the results for the Gramacy problem.
|
| 145 |
+
|
| 146 |
+
We used the Branin problem to explore the sensitivity of optimization performance to $D$ and $d _ { e }$ , by varying $d _ { e }$ from 2 to 8 and $D$ from 50 to 1000. We found that $d _ { e } = d$ performed significantly worse than larger values, but for $d _ { e } > d$ and across all values of $D$ there was little change in the BO performance. Figures with these results are in Appendix A.6.
|
| 147 |
+
|
| 148 |
+
# 7 POLICY SEARCH FOR ROBOT LOCOMOTION
|
| 149 |
+
|
| 150 |
+
Next, we evaluate our approach on a hexapod robot simulation for learning walking controllers. Sample efficiency is crucial in robotics as collecting data on real robots is time consuming and can cause wear-andtear on the robot. We optimize the walking gait of the simulated hexapod robot “Daisy” (Hebi Robotics, 2019). The Daisy robot is simulated in PyBullet (Coumans & McCutchan, 2008), and has 6 legs with 3 motors in each leg, as shown in Fig. 5. The goal is to learn the policy parameters that enable the robot to walk to a target location while avoiding high joint velocities and height deviations. More details about this task can be found in Appendix A.7.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: The simulated hexapod robot Daisy.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 4: Optimization performance on three HDBO minimization problems. For each row, the left plot shows the best value by each iteration, averaged over repeated runs. The right plot shows the distribution of the best value at the final iteration. For all three tasks, ALEBO achieved the best average performance, and had the lowest variance in final performance of the linear embedding methods.
|
| 157 |
+
|
| 158 |
+
We use a Central Pattern Generator (CPG) (Crespi & Ijspeert, 2008) with $D = 7 2$ to control the robot. The CPG controller induces a cyclical motion in each joint of the robot. Different parameters of the CPG change the phase, amplitude, frequency, and offset of each joint. While the 72- dimensional controller assumes that each joint is independent of the others, one could construct a lower-dimensional embedding by coupling multiple joints. For example, the tripod gait in hexapods assumes three sets of legs synced, and out of phase with the remaining three legs. The dimensionality of the CPG controller can be reduced to 11 dimensions by restricting the movement to a tripod gait, and learning the common amplitude, offset and frequency of the joints. The existence of such low-dimensional parameterizations motivates the use of ALEBO for learning the parameters of the CPG controller, although it is not known if there is a linear low-dimensional representation. In a real robot, each motor can have different physical properties, such as friction, damping, etc. This could make a pre-defined constrained space sub-optimal, and we could benefit from learning with a flexible embedding, as in ALEBO.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 6: Optimization performance on the $D = 7 2$ hexapod locomotion task (higher is better). (Left) Mean and two standard errors (over 50 repeated runs) of the best value found by each iteration. (Right) Distribution of the best value found across repeated runs. ALEBO had the best average performance, and the lowest variance.
|
| 162 |
+
|
| 163 |
+
Fig. 6 shows optimization performance for the linear embedding methods on this task, which is a maximization problem. ALEBO improves on the state-of-the-art, with both higher mean performance and a lower variance (thus, a lower chance of poor performance). Expert tuning can achieve reward values above 40, so while ALEBO is an advance in terms of linear embedding BO, there is still much room for additional work in high-dimensional BO.
|
| 164 |
+
|
| 165 |
+
# 8 DISCUSSION
|
| 166 |
+
|
| 167 |
+
Our work highlights the importance of two basic requirements for an embedding to be useful for optimization that are often not examined critically by the literature: 1) the function must be wellmodeled on the embedding; and 2) the embedding should contain an optimum. To the first point, we showed how polytope constraints on the embedding eliminate boundary distortions, and we derived a Mahalanobis kernel appropriate for GP modeling in a linear embedding. These two contributions allow effective modeling in the embedding space. To the second point, we developed an approach for computing the probability that the embedding contains an optimum, which we then used to construct embeddings with a higher chance of containing an optimum, via hypersphere sampling and selecting $d _ { e }$ larger than $d$ .
|
| 168 |
+
|
| 169 |
+
These same two considerations are important for any embedding, not just linear. For instance, when constructing a VAE for BO it will be equally important to ensure the function remains well-modeled on the embedding and that box bounds are not handled in a way that adds distortion. We must also ensure that the VAE embedding captures enough of the ambient space to have a high chance of containing an optimum. With linear embeddings we were able to derive analytical quantities for answering these questions—more work in this area is needed for nonlinear embeddings. Here we applied linear constraints to restrict the acquisition function optimization to points that project up inside the ambient box bounds. For a VAE these constraints will be general nonlinear functions, but their gradients can be backpropped and so constrained optimization could be done in a similar way.
|
| 170 |
+
|
| 171 |
+
Given $D$ and $d$ , we can solve (2) to determine the probability of containing an optimum for any $d _ { e }$ , and thus select $d _ { e }$ based on a desired target probability. We showed on test problems that BO performance was not too sensitive to the exact choice of $d _ { e }$ . In reality, such as in the robot locomotion task, we do not know $d$ , or even if the problem has low-dimensional linear structure. In this case selecting an appropriate embedding dimension remains an important open question.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Rika Antonova, Akshara Rai, and Christopher G Atkeson. Deep kernels for optimizing locomotion controllers. In 1st Conference on Robot Learning, CoRL, pp. 47–56, 2017.
|
| 176 |
+
|
| 177 |
+
Maximilian Balandat, Brian Karrer, Daniel R. Jiang, Samuel Daulton, Benjamin Letham, Andrew Gordon Wilson, and Eytan Bakshy. BoTorch: Programmable Bayesian optimization in PyTorch. arXiv preprint arXiv:1910.06403, 2019.
|
| 178 |
+
|
| 179 |
+
Mickael Binois. ¨ Uncertainty quantification on Pareto fronts and high-dimensional strategies in Bayesian optimization, with applications in multi-objective automotive design. PhD thesis, Ecole Nationale Superieure des Mines de Saint-Etienne, 2015. ´
|
| 180 |
+
|
| 181 |
+
Mickael Binois, David Ginsbourger, and Olivier Roustant. A warped kernel improving robustness in ¨ Bayesian optimization via random embeddings. In Proceedings of the International Conference on Learning and Intelligent Optimization, LION, pp. 281–286, 2015.
|
| 182 |
+
|
| 183 |
+
Mickael Binois, David Ginsbourger, and Olivier Roustant. On the choice of the low-dimensional ¨ domain for global optimization via random embeddings. Journal of Global Optimization, 2019.
|
| 184 |
+
|
| 185 |
+
Roberto Calandra, Andre Seyfarth, Jan Peters, and Marc P. Deisenroth. Bayesian optimization for ´ learning gaits under uncertainty. Annals of Mathematics and Artificial Intelligence, 76(1):5–23, 2015.
|
| 186 |
+
|
| 187 |
+
Paul G. Constantine, Eric Dow, and Qiqi Wang. Active subspace methods in theory and practice: applications to Kriging surfaces. SIAM Journal on Scientific Computing, 36:A1500–A1524, 2014.
|
| 188 |
+
|
| 189 |
+
Erwin Coumans and John McCutchan. Pybullet simulator. https://github.com/ bulletphysics/bullet3, 2008. Accessed: 2019-09.
|
| 190 |
+
|
| 191 |
+
Alessandro Crespi and Auke Jan Ijspeert. Online optimization of swimming and crawling in an amphibious snake robot. IEEE Transactions on Robotics, 24(1):75–87, 2008.
|
| 192 |
+
|
| 193 |
+
Josip Djolonga, Andreas Krause, and Volkan Cevher. High-dimensional Gaussian process bandits. In Advances in Neural Information Processing Systems 26, NIPS, pp. 1025–1033, 2013.
|
| 194 |
+
|
| 195 |
+
David Eriksson, Kun Dong, Eric Hans Lee, David Bindel, and Andrew Gordon Wilson. Scaling Gaussian process regression with derivatives. In Advances in Neural Information Processing Systems 31, NIPS, pp. 6867–6877, 2018.
|
| 196 |
+
|
| 197 |
+
Jean-Albert Ferrez, Kornei Fukuda, and Th. M. Liebling. Solving the fixed rank convex quadratic maximization in binary variables by a parallel zonotope construction algorithm. European Journal of Operational Research, 166(1):35–50, 2005.
|
| 198 |
+
|
| 199 |
+
Jacob Gardner, Chuan Guo, Kilian Q. Weinberger, Roman Garnett, and Roger Grosse. Discovering and exploiting additive structure for Bayesian optimization. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, AISTATS, pp. 1311–1319, 2017.
|
| 200 |
+
|
| 201 |
+
Jacob R. Gardner, Matt J. Kusner, Zhixiang Xu, Kilian Q. Weinberger, and John P. Cunningham. Bayesian optimization with inequality constraints. In Proceedings of the 31st International Conference on Machine Learning, ICML, 2014.
|
| 202 |
+
|
| 203 |
+
Rafael Gomez-Bombarelli, Jennifer N. Wei, David Duvenaud, Jos ´ e Miguel Hern ´ andez-Lobato, ´ Benjam´ın Sanchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D. Hirzel, ´ Ryan P. Adams, and Alan Aspuru-Guzik. Automatic chemical design using a data-driven contin- ´ uous representation of molecules. ACS Central Science, 4(2):268–276, 2018.
|
| 204 |
+
|
| 205 |
+
Robert B. Gramacy, Genetha A. Gray, Sebastien Le Digabel, Herbert K. H. Lee, Pritam Ranjan, ´ Garth Wells, and Stefan M. Wild. Modeling an augmented Lagrangian for blackbox constrained optimization. Technometrics, 58(1):1–11, 2016.
|
| 206 |
+
|
| 207 |
+
Nikolaus Hansen, Sibylle D. Mller, and Petros Koumoutsakos. Reducing the time complexity of the derandomized evolution strategy with covariance matrix adaptation (CMA-ES). Evolutionary Computation, 11(1):1–18, 2003.
|
| 208 |
+
|
| 209 |
+
Hebi Robotics. Daisy hexapod, 2019. URL https://www.hebirobotics.com/ robotic-kits.
|
| 210 |
+
Frank Hutter, Holger H. Hoos, and Kevin Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In International Conference on Learning and Intelligent Optimization, LION, pp. 507–523, 2011.
|
| 211 |
+
William B. Johnson and Joram Lindenstrauss. Extensions of Lipschitz mappings into a Hilbert space. Contemporary Mathematics, 26(189–206):1, 1984.
|
| 212 |
+
Donald R. Jones. A taxonomy of global optimization methods based on response surfaces. Journal of Global Optimization, 21(4):345–383, 2001.
|
| 213 |
+
Donald R. Jones, Matthias Schonlau, and William J. Welch. Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13:455–492, 1998.
|
| 214 |
+
Kirthevasan Kandasamy, Jeff Schneider, and Barnabas P ´ oczos. High dimensional Bayesian optimi- ´ sation and bandits via additive models. In Proceedings of the 32nd International Conference on Machine Learning, ICML, pp. 295–304, 2015.
|
| 215 |
+
Johannes Kirschner, Mojm´ır Mutny, Nicole Hiller, Rasmus Ischebeck, and Andreas Krause. Adap- ´ tive and safe bayesian optimization in high dimensions via one-dimensional subspaces. In Proceedings of the 36th International Conference on Machine Learning, ICML, 2019.
|
| 216 |
+
Benjamin Letham, Brian Karrer, Guilherme Ottoni, and Eytan Bakshy. Constrained Bayesian optimization with noisy experiments. Bayesian Analysis, 14(2):495–519, 2019.
|
| 217 |
+
Chun-Liang Li, Kirthevasan Kandasamy, Barnabas P ´ oczos, and Jeff Schneider. High dimensional ´ Bayesian optimization via restricted projection pursuit models. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, AISTATS, pp. 884–892, 2016.
|
| 218 |
+
Daniel J. Lizotte, Tao Wang, Michael Bowling, and Dale Schuurmans. Automatic gait optimization with Gaussian process regression. In Proceedings of the 20th International Joint Conference on Artificial Intelligence, IJCAI, pp. 944–949, 2007.
|
| 219 |
+
Xiaoyu Lu, Javier Gonzalez, Zhenwen Dai, and Neil Lawrence. Structured variationally auto- ´ encoded optimization. In Proceedings of the 35th International Conference on Machine Learning, ICML, pp. 3267–3275, 2018.
|
| 220 |
+
Jonas Mockus. Bayesian approach to global optimization: theory and applications. Mathematics and its Applications: Soviet Series. Kluwer Academic, 1989.
|
| 221 |
+
Riccardo Moriconi, K. S. Sesh Kumar, and Marc P. Deisenroth. High-dimensional Bayesian optimization with manifold Gaussian processes. arXiv preprint arXiv:1902.10675, 2019.
|
| 222 |
+
Mojm´ır Mutny and Andreas Krause. Efficient high dimensional Bayesian optimization with addi- ´ tivity and quadrature Fourier features. In Advances in Neural Information Processing Systems 31, NIPS, pp. 9005–9016, 2018.
|
| 223 |
+
Amin Nayebi, Alexander Munteanu, and Matthias Poloczek. A framework for Bayesian optimization in embedded subspaces. In Proceedings of the 36th International Conference on Machine Learning, ICML, pp. 4752–4761, 2019.
|
| 224 |
+
ChangYong Oh, Efstratios Gavves, and Max Welling. BOCK $:$ Bayesian optimization with cylindrical kernels. In Proceedings of the 35th International Conference on Machine Learning, ICML, pp. 3868–3877, 2018.
|
| 225 |
+
Hong Qian, Yi-Qi. Hu, and Yang Yu. Derivative-free optimization of high-dimensional non-convex functions by sequential random embeddings. In Proceedings of the 25th International Joint Conference on Artificial Intelligence, IJCAI, 2016.
|
| 226 |
+
Akshara Rai, Rika Antonova, Seungmoon Song, William Martin, Hartmut Geyer, and Christopher G. Atkeson. Bayesian optimization using domain knowledge on the ATRIAS biped. In Proceedings of the IEEE International Conference on Robotics and Automation, ICRA, pp. 1771– 1778, 2018.
|
| 227 |
+
|
| 228 |
+
Paul Rolland, Jonathan Scarlett, Ilija Bogunovic, and Volkan Cevher. High-dimensional Bayesian optimization via additive models with overlapping groups. In Proceedings of the 21st International Conference on Artificial Intelligence and Statistics, AISTATS, pp. 298–307, 2018.
|
| 229 |
+
|
| 230 |
+
Edward Snelson and Zoubin Ghahramani. Variable noise and dimensionality reduction for sparse Gaussian processes. In Proceedings of the 22nd Conference on Uncertainty in Artificial Intelligence, UAI, pp. 461–468, 2006.
|
| 231 |
+
|
| 232 |
+
Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical Bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems 25, NIPS, pp. 2951– 2959, 2012.
|
| 233 |
+
|
| 234 |
+
Francesco Vivarelli and Christopher K. I. Williams. Discovering hidden features with Gaussian processes regression. In Advances in Neural Information Processing Systems 11, pp. 613–619, 1999.
|
| 235 |
+
|
| 236 |
+
Zi Wang, Chengtao Li, Stefanie Jegelka, and Pushmeet Kohli. Batched high-dimensional Bayesian optimization via structural kernel learning. In Proceedings of the 34th International Conference on Machine Learning, ICML, pp. 3656–3664, 2017.
|
| 237 |
+
|
| 238 |
+
Zi Wang, Clement Gehring, Pushmeet Kohli, and Stefanie Jegelka. Batched large-scale Bayesian optimization in high-dimensional spaces. In Proceedings of the 21st International Conference on Artificial Intelligence and Statistics, AISTATS, 2018.
|
| 239 |
+
|
| 240 |
+
Ziyu Wang, Frank Hutter, Masrour Zoghi, David Matheson, and Nando de Feitas. Bayesian optimization in a billion dimensions via random embeddings. Journal of Artificial Intelligence Research, 55:361–387, 2016.
|
| 241 |
+
|
| 242 |
+
# A APPENDIX
|
| 243 |
+
|
| 244 |
+
This appendix contains a number of additional results and analyses to supplement the main text.
|
| 245 |
+
|
| 246 |
+
# A.1 HESBO EMBEDDINGS
|
| 247 |
+
|
| 248 |
+
We consider HeSBO embeddings in the case of a random axis-aligned true subspace, and a uniform prior on the location of the optimum within that subspace. As explained in Sec. 4, with $d = 2$ and this prior, regardless of $d _ { e }$ or $D$ there are three possible embeddings: (1) each of the active parameters are captured by a parameter in the embedding; (2) the embedding is constrained to the diagonal $x _ { i _ { 1 } } = x _ { i _ { 2 } }$ ; or (3) the embedding is constrained to the diagonal $x _ { i _ { 1 } } = - x _ { i _ { 2 } }$ . Fig. 7 shows these three embeddings for the Branin problem from the top row of Fig. 1.
|
| 249 |
+
|
| 250 |
+
Within the first embedding, the optimal value of 0.398 can be reached. Within the second, the best value is 0.925 and within the third it is 17.18. Under a uniform prior on the location of the optimum within a random axis-aligned true subspace, it is easy to compute the probability that the HeSBO embedding contains an optimum:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
P _ { \mathrm { o p t } } ( d _ { e } ) = \frac { d _ { e } ! } { ( d _ { e } - d ) ! d _ { e } ^ { d } } .
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
For $d = 2$ , this is exactly the probability of the first embedding shown in Fig. 7. This probability increases with $d _ { e }$ , and is exactly the probability shown in Fig. 3.
|
| 257 |
+
|
| 258 |
+
# A.2 THE MAHALANOBIS KERNEL
|
| 259 |
+
|
| 260 |
+
When fitting the Mahalanobis kernel derived in Proposition 1, we use an approximate Bayesian treatment of $\mathbf { \delta T }$ to improve model performance while still maintaining tractability. We propagate uncertainty in $\mathbf { \delta T }$ into the GP posterior by first constructing a posterior for $\mathbf { \delta T }$ using a Laplace approximation with a diagonal Hessian, and then drawing $m$ samples from that posterior. The marginal posterior for $f ( y )$ can then be approximated as:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
p ( f ( \pmb { y } ) ) \approx \frac { 1 } { m } \sum _ { i = 1 } ^ { m } p ( f ( \pmb { y } ) | \mathbf { \Gamma } ^ { i } ) .
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
Because of the GP prior, each conditional posterior $p ( f ( \pmb { y } ) | \mathbf { \Gamma } ^ { i } )$ is a normal distribution with known mean $\mu _ { i }$ and variance $\sigma _ { i } ^ { 2 }$ . Thus the posterior $p ( f ( \pmb { y } ) )$ is a mixture of Gaussians, which we can approximate using moment matching:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
p ( f ( \pmb { y } ) ) \approx \mathcal { N } \left( \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \mu _ { i } , \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \sigma _ { i } ^ { 2 } + \mathrm { V a r } _ { i } [ \mu _ { i } ] \right) .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 7: Three possible HeSBO embeddings of the $d = 2$ Branin function. (Left) The first embedding fully captures the function, and thus captures all three optima. (Middle) The second is restricted to the subspace $x _ { 1 } = - x _ { 2 }$ . This subspace does not contain an optimum, but comes fairly close. (Right) The third embedding is restricted to the subspace $x _ { 1 } = x _ { 2 }$ and does not come close to any optima.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 8: Test-set model predictions for three GP kernels on the same train/test data generated by evaluating the Hartmann6 $D { = } 1 0 0$ function on a fixed linear embedding. A typical ARD kernel fails to learn and predicts the mean. The Mahalanobis kernel predicts well, and posterior sampling is important for getting reasonable predictive variance.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 9: Average test-set log likelihood as a function of training set size, for training sets randomly sampled from a fixed linear embedding. Log marginal probabilities were averaged over a fixed test set of 1000 random points. For each training set size, 20 random training sets were drawn of that size and the figure shows the average result over those draws (with error bars for two standard errors). The ARD RBF kernel continues to predict the mean as the training set size is increased, while the Mahalanobis kernel is able to learn as the training set is expanded.
|
| 280 |
+
|
| 281 |
+
We do this to maintain a Gaussian posterior, under which acquisition functions like EI have analytic form and can easily be optimized, even subject to constraints as in (1).
|
| 282 |
+
|
| 283 |
+
We show the importance of the Mahalanobis kernel using models fit to data from the Hartmann6 $D { = } 1 0 0$ function, from Fig. 1. We generated a projection matrix $\textbf { { B } }$ using hypersphere sampling to define a 6-d linear embedding. We then generated a training set (100 points) and a test set (50 points) within that embedding (that is, within the polytope given by (1)) using rejection sampling. We fit three GP models with different kernels to the training set, and then evaluated each on the test set: a typical ARD RBF kernel in 6 dimensions, the Mahalanobis kernel using a point estimate for $\mathbf { \delta T }$ , and the Mahalanobis kernel with posterior marginalization for $\mathbf { \delta T }$ as described above.
|
| 284 |
+
|
| 285 |
+
Fig. 8 compares model predictions for each of these models with the actual test-set outcomes. With an ARD RBF kernel, the GP predicts the function mean everywhere, which is typical behavior of a GP that has failed to learn the function. With the same training data, the Mahalanobis kernel is able to make accurate predictions on the test set. Using a point estimate for $\mathbf { \delta T }$ significantly underestimates the predictive variance, which is rectified by using posterior sampling as described above. In BO exploration is driven by model uncertainty, so well-calibrated uncertainty intervals are especially important.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 10: (Left) An embedding from a $\mathcal { N } ( 0 , 1 )$ projection matrix on the same Branin $D = 1 0 0$ problem from Fig. 1 subject to constraints of (1). (Right) The embedding from the same projection matrix after normalizing the columns to produce unit circle samples. Sampling from the unit circle increases the probability that an optimum will fall within the embedding, and polytope bounds avoid nonlinear distortions.
|
| 289 |
+
|
| 290 |
+
Fig. 9 evaluates the predictive log marginal probabilities for the ARD RBF kernel and the Mahalanobis kernel with posterior sampling across a wide range of training sets with different sizes (without posterior sampling, Fig. 8 shows that the Mahalanobis point estimate significantly under covers and so has very poor predictive log marginal probabilities). We used the same linear embedding and Hartmann6 $D { = } 1 0 0$ function used in Fig. 8 to sample 1000 test points which were held fixed. For each of 8 training set sizes ranging from 40 to 200, we randomly sampled 20 training sets from the embedding. For each training set, we fit the two GPs, made predictions on the 1000 test points, and then computed the average marginal log probability of the true values. Fig. 9 shows that as we vary the training set size from 40 to 200, the ARD RBF kernel continues to predict the mean, as in Fig. 8; even 200 points in the 6-d embedding are not sufficient to learn. For small training set sizes, the Mahalanobis kernel (with sampling) has high variance in log likelihood, as it has the potential to overfit and thus under cover. But for training set sizes of 50 and greater it had better predictive log likelihood than the ARD RBF, and continued to learn as the training set size was increased. For small datasets, the Mahalanobis kernel can overfit and thus have poor predictive likelihood, but for the purposes of BO, overfitting can be better than not fitting at all (predicting the mean), even when predicting the mean has better predictive log likelihood. This can be seen in the optimization results (Figs. 4 and 12) where ALEBO shows strong performance even with less than 50 iterations.
|
| 291 |
+
|
| 292 |
+
# A.3 POLYTOPE BOUNDS ON THE EMBEDDING
|
| 293 |
+
|
| 294 |
+
Rather than using projections to the box bounds $\boldsymbol { B }$ , we specify polytope constraints in (1). Fig. 10 illustrates the embedding with these constraints for the same Branin $D = 1 0 0$ problem from the top row of Fig. 1. The embedding in the left figure was created with the REMBO strategy of sampling each entry from $\mathcal { N } ( 0 , 1 )$ . For the embedding in the right figure, that same projection matrix had each column normalized. This converts the projection matrix to be a sample from the unit circle, as described in Sec. 4.
|
| 295 |
+
|
| 296 |
+
The $\mathcal { N } ( 0 , 1 )$ embedding does not contain any optima within the polytope bounds. Converting that projection matrix to a hypersphere sample rounds out the vertices of the polytope and expands the space to capture two of the optima. Consistent with Fig. 3, we see that hypersphere sampling significantly improves the chances of the embedding containing an optimum. Fig. 10 also shows that with the polytope bounds, we avoid the nonlinear distortions seen in Fig. 1.
|
| 297 |
+
|
| 298 |
+
# A.4 EVALUATING THE PROBABILITY THE EMBEDDING CONTAINS AN OPTIMUM
|
| 299 |
+
|
| 300 |
+
As in other parts of the paper, we consider a uniform prior on the location of the optimum within a random axis-aligned subspace. A random true projection matrix $_ { \mathbf { T } }$ is sampled by selecting $d$ columns at random and setting each to one of the $d$ -dimensional unit vectors. $z ^ { * }$ is then sampled uniformly at random from $[ - \bar { 1 } , 1 ] ^ { d }$ . $\textbf { { B } }$ is sampled according to the desired strategy, which in our experiments was REMBO, HeSBO, or hypersphere. Given these three quantities, we can evaluate whether or not $\textbf { { B } }$ contains an optimum subject to the constraints of (1) by solving the following
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 11: $P _ { \mathrm { o p t } }$ for hypersphere sampling, as estimated in Fig. 3 but here for a wider range of values of $d$ and $D$ . Contour color indicates $P _ { \mathrm { o p t } }$ . Doubling $D$ decreases $P _ { \mathrm { o p t } }$ for $d$ and $d _ { e }$ fixed, however even at $D = 2 0 0$ , high values of $P _ { \mathrm { o p t } }$ with reasonable values of $d _ { e }$ can be had for many values of $d$ .
|
| 304 |
+
|
| 305 |
+
linear program:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { l } { ( B ^ { \dagger } B - I ) { \pmb x } = { \bf 0 } , } \\ { { \pmb x } \geq - { \bf 1 } , } \\ { { \pmb x } \leq { \bf 1 } . } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
If this problem is feasible, then the embedding produced by $\textbf { { B } }$ contains an optimum. If it is infeasible, then it does not. Solving this over many draws of ${ \mathbf { } } T , z ^ { * }$ , and $\textbf { { B } }$ produces an estimate of $P _ { \mathrm { o p t } }$ under that prior for the location of optima. Here we used a uniform prior, but this linear program can be taken to compute $P _ { \mathrm { o p t } }$ under any prior.
|
| 312 |
+
|
| 313 |
+
Fig. 11 shows $P _ { \mathrm { o p t } }$ for a wide range of values of $d$ and $D$ , for hypersphere sampling. Across this wide range we see that for many values of $d$ we can achieve high values of $P _ { \mathrm { o p t } }$ with reasonable values of $d _ { e }$ , even for relatively high values of $D$ .
|
| 314 |
+
|
| 315 |
+
# A.5 HANDLING BLACK-BOX CONSTRAINTS IN HIGH-DIMENSIONAL BAYESIAN OPTIMIZATION
|
| 316 |
+
|
| 317 |
+
In many applications of BO, in addition to the black-box objective $f$ there are black-box constraints $c _ { j }$ and we seek to solve the optimization problem
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
{ \begin{array} { r l } & { { \mathrm { m i n i m i z e ~ } } f ( { \boldsymbol { x } } ) } \\ & { { \mathrm { s u b j e c t ~ t o ~ } } c _ { j } ( { \boldsymbol { x } } ) \leq 0 , \quad j = 1 , \ldots , J , } \\ & { \qquad { \boldsymbol { x } } \in { \boldsymbol { \mathcal { B } } } . } \end{array} }
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
In most settings the constraint functions $c _ { j }$ are evaluated simultaneously with the objective $f$ . Constraints are typically handled in BO by fitting a separate GP to each outcome (that is, to $f$ and to each $c _ { j }$ ). The acquisition function is then modified to consider not only the objective value but also whether the constraints are likely to be satisfied (e.g., Gardner et al., 2014).
|
| 324 |
+
|
| 325 |
+
The extension of BO in an embedding to constrained BO is straightforward, so long as the same embedding is used for every outcome. A separate GP (in our case, using the Mahalanobis kernel) is fit to data from each outcome. Because the embedding is shared, predictions can be made for all of the outcomes at any point in the embedding. This allows us to evaluate and optimize an acquisition function for constrained BO in the embedding. Once a point is selected, it is projected up to the ambient space and evaluated on $f$ and each $c _ { j }$ as usual. Random projections are especially wellsuited for constrained BO because there is no harm in requiring the same projection for all outcomes, since it is a random projection anyway.
|
| 326 |
+
|
| 327 |
+
# A.6 ADDITIONAL EXPERIMENTAL RESULTS
|
| 328 |
+
|
| 329 |
+
Here we provide results from an additional problem (Hartmann6 $D { = } 1 0 0 $ ), three additional methods (LineBO variants), and provide a study of the sensitivity of ALEBO performance to $d _ { e }$ and $D$ . We also provide implementation details for the experiments.
|
| 330 |
+
|
| 331 |
+
# A.6.1 METHOD IMPLEMENTATIONS AND EXPERIMENT SETUP
|
| 332 |
+
|
| 333 |
+
The linear embedding methods (REMBO, HeSBO, and ALEBO) were all implemented using BoTorch, a framework for BO in PyTorch (Balandat et al., 2019), and so used the same acquisition functions and the same tooling for optimizing the acquisition function. EI was the acquisition function for the Hartmann6 and Branin benchmarks, and NEI (Letham et al., 2019) was used to handle the constraints in the Gramacy problem. ALEBO and HeSBO were given a quasirandom initialization of 10 points from a scrambled Sobol sequence. REMBO was given a Sobol initialization of 2 points for each of its 4 projections used within a run.
|
| 334 |
+
|
| 335 |
+
The remaining methods used reference implementations from their authors with default settings for the package: REMBO- $\phi k _ { \Psi }$ and REMBO- $\gamma k _ { \Psi } { } ^ { 1 }$ ; $\mathrm { E B O } ^ { 2 }$ ; Add-GP-UCB 3; SMAC4; CMA-ES5; and CoordinateLineBO, RandomLineBO, and DescentLine $\mathrm { B O } ^ { 6 }$ . EBO requires an estimate of the best function value, and for each problem was given the true best function value. SMAC and CMA-ES require an initial point, and were given the point at the center of the ambient space box bounds.
|
| 336 |
+
|
| 337 |
+
The function evaluations for all problems were noiseless, so the stochasticity throughout the run and in the final value all comes from stochasticity in the methods themselves. For linear embedding methods the main sources of stochasticity are in generating the random projection matrix and in the quasirandom initialization.
|
| 338 |
+
|
| 339 |
+
# A.6.2 ANALYSIS OF EXPERIMENTAL RESULTS
|
| 340 |
+
|
| 341 |
+
Fig. 12 provides a different view of the benchmark results of Fig. 4, showing log regret for each method, averaged over runs with error bars indicating two standard errors of the mean. This is evaluated by measuring the difference between the best point found so far, subtracting from that the optimal value for the problem, and then taking the log of that difference. The results are consistent with those seen in Fig. 4, and the standard errors show that ALEBO’s improvement in average performance over the other methods is statistically significant. We now discuss some specific aspects of these experimental results.
|
| 342 |
+
|
| 343 |
+
Branin ${ \cal D } { \bf = } { \bf 1 0 0 }$ The additive kernel methods and SMAC all performed similarly on this problem, and, starting from around iteration 20, ALEBO performed the best. The distribution of final iteration values shows that in one iteration the ALEBO embedding did not contain an optimum and so achieved a final value near 10. However, across all 50 runs nearly all achieved a value very close to the optimum, leading to the best average performance.
|
| 344 |
+
|
| 345 |
+
The poor performance of HeSBO on this problem (particularly in Fig. 4 without the log, where it is outperformed by all methods other than Sobol) can be attributed entirely to the embedding not containing an optimum. Recall that for this problem there are exactly three possible HeSBO embeddings, which are shown in Fig. 7. As explained in Appendix A.1, the first embedding contains the optimum of 0.398, while the best value in the other embeddings are 0.925 and 17.18. Thus, if the BO were able to find the true optimum within each embedding with the budget of 50 function evaluations given in this experiment, the expected best value found by HeSBO would be:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
0 . 3 9 8 P _ { \mathrm { o p t } } + 0 . 9 2 5 \left( \frac { 1 - P _ { \mathrm { o p t } } } { 2 } \right) + 1 7 . 1 8 \left( \frac { 1 - P _ { \mathrm { o p t } } } { 2 } \right) .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 12: Log regret for the benchmark experiments of Fig. 4, plus Hartmann6 $D { = } 1 0 0$ . Each trace is the mean over repeated runs, with errors bars showing two standard errors of the mean. On the first three problems ALEBO performs significantly better than the other methods, and on Hartmann6 $D { = } 1 0 0$ it is tied with REMBO- $\gamma k _ { \Psi }$ as the best methods.
|
| 353 |
+
|
| 354 |
+
This is the best average performance one can hope to achieve using the HeSBO embedding on this problem. Using (3) we can compute $P _ { \mathrm { o p t } }$ for $d _ { e } = 4$ as 0.75, and it follows that the HeSBO expected best value is 2.56. This is nearly exactly the average best-value shown in Fig. 4. The poor performance of HeSBO is thus not related to BO, but comes entirely from the $12 . 5 \%$ chance of generating an embedding whose optimal value is 17.18. The presence of these embeddings can be clearly seen in the distribution of final best values in Fig. 4.
|
| 355 |
+
|
| 356 |
+
Hartmann6 ${ \cal D } { \bf = } { \bf 1 0 0 0 }$ As noted in the main text, the additive kernel methods and REMBO- $\gamma k _ { \Psi }$ could not scale up to the 1000 dimensional problem. A nice property of linear embedding approaches is that the running time is not significantly impacted by the ambient dimensionality. Table
|
| 357 |
+
|
| 358 |
+
Table 1: Average running time per iteration in seconds on the Hartmann6 problem, $D { = } 1 0 0$ and $D { = } 1 0 0 0$ .
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>D=100</td><td rowspan=1 colspan=1>D=1000</td></tr><tr><td rowspan=1 colspan=1>ALEBO</td><td rowspan=1 colspan=1>29.5</td><td rowspan=1 colspan=1>32.6</td></tr><tr><td rowspan=2 colspan=1>REMBOHeSBO, de=d</td><td rowspan=1 colspan=1>1.3</td><td rowspan=1 colspan=1>1.4</td></tr><tr><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.6</td></tr><tr><td rowspan=1 colspan=1>HeSBO, de=2d</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.4</td></tr><tr><td rowspan=1 colspan=1>REMBO-𝜙ky</td><td rowspan=1 colspan=1>2.1</td><td rowspan=7 colspan=1>1.1404.50.00.0</td></tr><tr><td rowspan=6 colspan=1>REMBO-yk亚EBOAdd-GP-UCBSMACCMA-ESSobol</td><td rowspan=1 colspan=1>7.2</td></tr><tr><td rowspan=1 colspan=1>27.3</td></tr><tr><td rowspan=1 colspan=1>695.2</td></tr><tr><td rowspan=1 colspan=1>9.5</td></tr><tr><td rowspan=1 colspan=1>0.0</td></tr><tr><td rowspan=1 colspan=1>0.0</td></tr></table>
|
| 361 |
+
|
| 362 |
+
1 gives the average running time per iteration for the various benchmark methods. Inferring the additional parameters in the Mahalanobis kernel and the added linear constraints make ALEBO slower than other linear embedding methods, but it has similar running time as EBO and is an order of magnitude faster than Add-GP-UCB, and at $D { = } 1 0 0 0$ is even an order of magnitude faster than SMAC. The average of 30s per iteration is short relative to the function evaluation time of typical resource-intensive BO applications.
|
| 363 |
+
|
| 364 |
+
Hartmann6 ${ \cal D } { \bf = } { \bf 1 0 0 }$ REMBO performed worse than Sobol on this problem, despite there being a true linear subspace that satisfies the REMBO assumptions. The source of the poor performance is the poor representation of the function on the embedding illustrated in Fig. 1. The remaining methods all performed better than quasirandom. CMA-ES was competitive with all of the methods except SMAC, REMBO- $\gamma k _ { \Psi }$ , and ALEBO, which is somewhat surprising since it is not designed to have the same degree of sample efficiency as BO methods. HeSBO and Add-GP-UCB both did very well early on, but then got stuck and did not progress significantly after about iteration 50.
|
| 365 |
+
|
| 366 |
+
This problem was used to test three additional methods beyond those in Fig. 4: CoordinateLineBO, RandomLineBO, and DescentLineBO (Kirschner et al., 2019). These are recent methods developed for high-dimensional safe BO, in which one must optimize subject to safety constraints that certain bounds on the functions must not be violated. The performance of these methods can be seen in the bottom panel of Fig. 12: all three LineBO variants perform much worse than Sobol, and show almost no reduction of log regret. This finding is consistent with the results of Kirschner et al. (2019), who used the Hartmann6 $D { = } 2 0$ problem as a benchmark problem. At $D { = } 2 0$ , they found that CoordinateLineBO required about 400 iterations to outperform random search, and even after 1200 iterations RandomLineBO and DescentLineBO did not perform better than random search. These methods are designed specifically for safe BO, which is a significantly harder problem than usual BO that has much worse scaling with dimensionality. The primary challenge for high-dimensional safe BO lies in optimizing the acquisition function, which is difficult even for relatively small numbers of parameters where there is no difficulty in optimizing the traditional BO acquisition function. The LineBO methods develop new techniques for acquisition function optimization, but do not consider difficulties with GP modeling in high dimensions, which is the main focus of HDBO work. LineBO methods perform very well on safe BO problems relative to other methods, but ultimately non-safe HDBO is not the problem that they were developed for, and so it is not surprising to see that they were not successful on this task.
|
| 367 |
+
|
| 368 |
+
# A.6.3 SENSITIVITY OF ALEBO TO EMBEDDING AND AMBIENT DIMENSIONS
|
| 369 |
+
|
| 370 |
+
We study sensitivity of ALEBO optimization performance to the embedding dimension $d _ { e }$ and the ambient dimension $D$ using the Branin function. To test dependence on $d _ { e }$ , for $D = 1 0 0$ we ran 50 optimization runs for each of $d _ { e } \in \{ 2 , 3 , 4 , 5 , 6 , 7 , 8 \}$ . To test dependence on $D$ , for $d _ { e } = 4$ we ran 50 optimization runs for each of $D \in \{ 5 0 , 1 0 0 , 2 0 0 , 5 0 0 , 1 0 0 0 \}$ . Note that the $d _ { e } = 4$ and $D = 1 0 0$ case in each of these is exactly the optimization problem of Fig. 4.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 13: ALEBO performance on the Branin problem, $( L e f t )$ as a function of embedding dimension $d _ { e }$ and $( R i g h t )$ as a function of ambient dimension $D$ . Performance shown is the average of 50 repeated runs. Optimization performance is poor with $d _ { e } = 2$ , but shows little sensitivity to $d _ { e }$ for values greater than 2. Optimization performance shows little sensitivity with $D$ , all the way up to $D = 1 0 0 0$ .
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 14: Final best value for the Branin problem optimizations Fig. 13, as mean with error bars showing two standard errors. With the exception of $d _ { e } = 2$ , optimization performance was good across a wide range of values of $d _ { e }$ and $D$ .
|
| 377 |
+
|
| 378 |
+
The results of the optimizations are shown in Figs. 13 and 14. For $d _ { e } = d$ , optimization performance was poor. From Fig. 3 we know this is because there is a low probability of the embedding containing an optimizer. Increasing $d _ { e }$ increases that probability, but also increases the dimensionality of the embedding and thus reduces the sample efficiency of the BO in the embedding. This trade-off can be seen clearly in the figure: with $d _ { e } = 2$ there is rapid improvement that then flattens out because of the lack of good solutions in the embedding, whereas for $d _ { e } = 8$ the initial iterations are worse but then it ultimately is able to find much better solutions. Even at $d _ { e } = 8$ the average best final value was better than that of any of the comparison methods in Fig. 4.
|
| 379 |
+
|
| 380 |
+
The ambient dimension $D$ will not directly impact the GP modeling in ALEBO, which depends only on $d _ { e }$ , however it will impact the probability the embedding contains an optimum as shown in Fig. 11. Consistent with the strong ALEBO performance for the Hartmann6 $D { = } 1 0 0 0$ problem, we see here that even increasing $D$ to 1000 produces only a small degradation in optimization performance. Even at $D = 1 0 0 0$ , ALEBO had better performance than the other benchmark methods had on $D = 1 0 0$ .
|
| 381 |
+
|
| 382 |
+
# A.7 LOCOMOTION BENCHMARK PROBLEM
|
| 383 |
+
|
| 384 |
+
The task for the final set of experiments was to learn a gait policy for a simulated robot. As a controller, we use the Central Pattern Generator (CPG) from Crespi & Ijspeert (2008). The goal in
|
| 385 |
+
|
| 386 |
+
this task is for the robot to walk to a target location in a given amount of time, while reducing joint velocities, and average deviation from a desired height
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\boldsymbol { f } ( \boldsymbol { p } ) = \boldsymbol { C } - | | \boldsymbol { x } _ { \mathrm { f i n a l } } - \boldsymbol { x } _ { \mathrm { g o a l } } | | - \sum _ { t = 0 } ^ { T } ( w _ { 1 } | | \dot { q } _ { t } | | - w _ { 2 } | h _ { \mathrm { r o b o t } , t } - h _ { \mathrm { t a r g e t } } | ) ,
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
where $C = 1 0$ , $w _ { 1 } = 0 . 0 0 5$ , and $w _ { 2 } = 0 . 0 1$ are constants. ${ \pmb x } _ { \mathrm { f i n a l } }$ is the location of the robot on a plane at the end of the episode, $\pmb { x } _ { \mathrm { g o a l } }$ is the target location, $\dot { \pmb q } _ { t }$ are the joint velocities at time $t$ during the trajectory, $h _ { \mathrm { r o b o t } , t }$ is the height of the robot at time $t$ , and $h _ { \mathrm { t a r g e t } }$ is a target height. $T = 3 0 0 0$ is the total length of the trajectory, leading to 30s of experiment. Cost is evaluated at the end of the trajectory.
|
md/train/SJiHXGWAZ/SJiHXGWAZ.md
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFUSION CONVOLUTIONAL RECURRENT NEURAL NETWORK: DATA-DRIVEN TRAFFIC FORECASTING
|
| 2 |
+
|
| 3 |
+
Yaguang $\mathbf { L i } ^ { \dagger }$ , Rose $\mathbf { V } \mathbf { u } ^ { \ddag }$ , Cyrus Shahabi†, Yan Liu† † University of Southern California, ‡ California Institute of Technology † {yaguang, shahabi, yanliu.cs}@usc.edu, ‡ rose@caltech.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Spatiotemporal forecasting has various applications in neuroscience, climate and transportation domain. Traffic forecasting is one canonical example of such learning task. The task is challenging due to (1) complex spatial dependency on road networks, (2) non-linear temporal dynamics with changing road conditions and (3) inherent difficulty of long-term forecasting. To address these challenges, we propose to model the traffic flow as a diffusion process on a directed graph and introduce Diffusion Convolutional Recurrent Neural Network (DCRNN), a deep learning framework for traffic forecasting that incorporates both spatial and temporal dependency in the traffic flow. Specifically, DCRNN captures the spatial dependency using bidirectional random walks on the graph, and the temporal dependency using the encoder-decoder architecture with scheduled sampling. We evaluate the framework on two real-world large scale road network traffic datasets and observe consistent improvement of $1 2 \% - 1 5 \%$ over state-of-the-art baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Spatiotemporal forecasting is a crucial task for a learning system that operates in a dynamic environment. It has a wide range of applications from autonomous vehicles operations, to energy and smart grid optimization, to logistics and supply chain management. In this paper, we study one important task: traffic forecasting on road networks, the core component of the intelligent transportation systems. The goal of traffic forecasting is to predict the future traffic speeds of a sensor network given historic traffic speeds and the underlying road networks.
|
| 12 |
+
|
| 13 |
+
This task is challenging mainly due to the complex spatiotemporal dependencies and inherent difficulty in the long term forecasting. On the one hand, traffic time series demonstrate strong temporal dynamics. Recurring incidents such as rush hours or accidents can cause nonstationarity, making it difficult to forecast longterm. On the other hand, sensors on the road network contain complex yet unique spatial correlations. Figure 1 illustrates an example. Road 1 and road 2 are correlated, while road 1 and road 3 are not. Although road 1 and road 3 are close in the Euclidean space, they demonstrate very different behaviors. Moreover, the future traffic speed is influenced more by the downstream traffic than the upstream one. This means that the spatial structure in traffic is nonEuclidean and directional.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Spatial correlation is dominated by road network structure. (1) Traffic speed in road 1 are similar to road 2 as they locate in the same highway. (2) Road 1 and road 3 locate in the opposite directions of the highway. Though close to each other in the Euclidean space, their road network distance is large, and their traffic speeds differ significantly.
|
| 17 |
+
|
| 18 |
+
Traffic forecasting has been studied for decades, falling into two main categories: knowledge
|
| 19 |
+
|
| 20 |
+
driven approach and data-driven approach. In transportation and operational research, knowledgedriven methods usually apply queuing theory and simulate user behaviors in traffic (Cascetta, 2013). In time series community, data-driven methods such as Auto-Regressive Integrated Moving Average (ARIMA) model and Kalman filtering remain popular (Liu et al., 2011; Lippi et al., 2013). However, simple time series models usually rely on the stationarity assumption, which is often violated by the traffic data. Most recently, deep learning models for traffic forecasting have been developed in Lv et al. (2015); Yu et al. (2017b), but without considering the spatial structure. Wu & Tan (2016) and Ma et al. (2017) model the spatial correlation with Convolutional Neural Networks (CNN), but the spatial structure is in the Euclidean space (e.g., 2D images). Bruna et al. (2014), Defferrard et al. (2016) studied graph convolution, but only for undirected graphs.
|
| 21 |
+
|
| 22 |
+
In this work, we represent the pair-wise spatial correlations between traffic sensors using a directed graph whose nodes are sensors and edge weights denote proximity between the sensor pairs measured by the road network distance. We model the dynamics of the traffic flow as a diffusion process and propose the diffusion convolution operation to capture the spatial dependency. We further propose Diffusion Convolutional Recurrent Neural Network (DCRNN) that integrates diffusion convolution, the sequence to sequence architecture and the scheduled sampling technique. When evaluated on realworld traffic datasets, DCRNN consistently outperforms state-of-the-art traffic forecasting baselines by a large margin. In summary:
|
| 23 |
+
|
| 24 |
+
• We study the traffic forecasting problem and model the spatial dependency of traffic as a diffusion process on a directed graph. We propose diffusion convolution, which has an intuitive interpretation and can be computed efficiently.
|
| 25 |
+
We propose Diffusion Convolutional Recurrent Neural Network (DCRNN), a holistic approach that captures both spatial and temporal dependencies among time series using diffusion convolution and the sequence to sequence learning framework together with scheduled sampling. DCRNN is not limited to transportation and is readily applicable to other spatiotemporal forecasting tasks.
|
| 26 |
+
We conducted extensive experiments on two large-scale real-world datasets, and the proposed approach obtains significant improvement over state-of-the-art baseline methods.
|
| 27 |
+
|
| 28 |
+
# 2 METHODOLOGY
|
| 29 |
+
|
| 30 |
+
We formalize the learning problem of spatiotemporal traffic forecasting and describe how to model the dependency structures using diffusion convolutional recurrent neural network.
|
| 31 |
+
|
| 32 |
+
# 2.1 TRAFFIC FORECASTING PROBLEM
|
| 33 |
+
|
| 34 |
+
The goal of traffic forecasting is to predict the future traffic speed given previously observed traffic flow from $N$ correlated sensors on the road network. We can represent the sensor network as a weighted directed graph $\mathcal { G } = ( \nu , \mathcal { E } , W )$ , where $\nu$ is a set of nodes $| \nu | = N$ , $\mathcal { E }$ is a set of edges and $\pmb { W } \in \mathbb { R } ^ { N \times N }$ is a weighted adjacency matrix representing the nodes proximity (e.g., a function of their road network distance). Denote the traffic flow observed on $\mathcal { G }$ as a graph signal $\pmb { X } \in \mathbb { R } ^ { N \times P }$ , where $P$ is the number of features of each node (e.g., velocity, volume). Let $\bar { X } ^ { ( t ) }$ represent the graph signal observed at time $t$ , the traffic forecasting problem aims to learn a function $h ( \cdot )$ that maps $T ^ { \prime }$ historical graph signals to future $T$ graph signals, given a graph $\mathcal { G }$ :
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
[ \pmb { X } ^ { ( t - T ^ { \prime } + 1 ) } , \allowbreak \cdot \cdot \ , \pmb { X } ^ { ( t ) } ; \mathcal { G } ] \xrightarrow { h ( \cdot ) } [ \pmb { X } ^ { ( t + 1 ) } , \allowbreak \cdot \cdot \ , \pmb { X } ^ { ( t + T ) } ]
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
# 2.2 SPATIAL DEPENDENCY MODELING
|
| 41 |
+
|
| 42 |
+
We model the spatial dependency by relating traffic flow to a diffusion process, which explicitly captures the stochastic nature of traffic dynamics. This diffusion process is characterized by a random walk on $\mathcal { G }$ with restart probability $\alpha \in [ 0 , 1 ]$ , and a state transition matrix $D _ { O } ^ { - 1 } W$ . Here $D _ { O } = \mathrm { d i a g } ( W 1 )$ is the out-degree diagonal matrix, and $\mathbf { 1 } \in \mathbb { R } ^ { N }$ denotes the all one vector. After many time steps, such Markov process converges to a stationary distribution $\pmb { \mathcal { P } } \in \mathbb { R } ^ { N \times N }$ whose $i$ th row $\mathbf { \bar { \mathcal { P } } } _ { i , : } \in \mathbb { R } ^ { \bar { N } }$ represents the likelihood of diffusion from node $v _ { i } \in \mathcal V$ , hence the proximity w.r.t. the node $v _ { i }$ . The following Lemma provides a closed form solution for the stationary distribution.
|
| 43 |
+
|
| 44 |
+
Lemma 2.1. (Teng et al., 2016) The stationary distribution of the diffusion process can be represented as a weighted combination of infinite random walks on the graph, and be calculated in closed form:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\mathcal { P } = \sum _ { k = 0 } ^ { \infty } \alpha ( 1 - \alpha ) ^ { k } \left( D _ { \mathcal { O } } ^ { - 1 } W \right) ^ { k }
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $k$ is the diffusion step. In practice, we use a finite $K$ -step truncation of the diffusion process and assign a trainable weight to each step. We also include the reversed direction diffusion process,
|
| 51 |
+
|
| 52 |
+
such that the bidirectional diffusion offers the model more flexibility to capture the influence from both the upstream and the downstream traffic.
|
| 53 |
+
|
| 54 |
+
Diffusion Convolution The resulted diffusion convolution operation over a graph signal $\boldsymbol { x } \in$ $\mathbb { R } ^ { N \times P }$ and a filter $f _ { \theta }$ is defined as:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\displaystyle { X _ { : , p } \star _ { \mathcal { G } } } \ f _ { \theta } = \sum _ { k = 0 } ^ { K - 1 } \left( \theta _ { k , 1 } \left( D _ { O } ^ { - 1 } W \right) ^ { k } + \theta _ { k , 2 } \left( D _ { I } ^ { - 1 } W ^ { \top } \right) ^ { k } \right) X _ { : , p } \quad \mathrm { f o r } p \in \{ 1 , \cdots , P \}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\pmb \theta \in \mathbb R ^ { K \times 2 }$ are the parameters for the filter and $D _ { O } ^ { - 1 } W , D _ { I } ^ { - 1 } W ^ { \intercal }$ represent the transition matrices of the diffusion process and the reverse one, respectively. In general, computing the convolution can be expensive. However, if $\mathcal { G }$ is sparse, Equation 2 can be calculated efficiently using $O ( K )$ recursive sparse-dense matrix multiplication with total time complexity $O ( K | \mathcal { E } | ) \ll \dot { O } ( N ^ { 2 } )$ . See Appendix $\mathbf { B }$ for more detail.
|
| 61 |
+
|
| 62 |
+
Diffusion Convolutional Layer With the convolution operation defined in Equation 2, we can build a diffusion convolutional layer that maps $P$ -dimensional features to $Q$ -dimensional outputs. Denote the parameter tensor as $\dot { \pmb { \Theta } } \in \mathbb { R } ^ { Q \times P \times \dot { \bf K } \times 2 } = [ \pmb { \theta } ] _ { q , p }$ , where $\Theta _ { q , p , : , : } \doteq \mathbb { R } ^ { K \times 2 }$ parameterizes the convolutional filter for the pth input and the qth output. The diffusion convolutional layer is thus:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
H _ { : , q } = a \left( \sum _ { p = 1 } ^ { P } X _ { : , p } \star _ { \mathcal { G } } f _ { \Theta _ { q , p ; : } } \right) \qquad { \mathrm { f o r ~ } } q \in \{ 1 , \cdots , Q \}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\pmb { X } \in \mathbb { R } ^ { N \times P }$ is the input, $H \in \mathbb { R } ^ { N \times Q }$ is the output, $\{ f _ { \Theta _ { q , p , , : } } \}$ are the filters and $\textbf { \em a }$ is the activation function (e.g., ReLU, Sigmoid). Diffusion convolutional layer learns the representations for graph structured data and we can train it using stochastic gradient based method.
|
| 69 |
+
|
| 70 |
+
Relation with Spectral Graph Convolution Diffusion convolution is defined on both directed and undirected graphs. When applied to undirected graphs, we show that many existing graph structured convolutional operations including the popular spectral graph convolution, i.e., ChebNet (Defferrard et al., 2016), can be considered as a special case of diffusion convolution (up to a similarity transformation). Let $_ D$ denote the degree matrix, and $L = D ^ { - { \frac { 1 } { 2 } } } ( D - W ) D ^ { - { \frac { 1 } { 2 } } }$ be the normalized graph Laplacian, the following Proposition demonstrates the connection.
|
| 71 |
+
|
| 72 |
+
Proposition 2.2. The spectral graph convolution defined as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
X _ { : , p } \star _ { \mathcal { G } } f _ { \theta } = \Phi \ F ( \pmb \theta ) \ \Phi ^ { \intercal } X _ { : , p }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
with eigenvalue decomposition diffusion convolution up to a sim ${ \pmb { L } } = \pmb { \Phi } \pmb { \Lambda } \pmb { \Phi } ^ { \intercal }$ and rmat $\begin{array} { r } { F ( \pmb \theta ) = \sum _ { 0 } ^ { K - 1 } \theta _ { k } \pmb \Lambda ^ { k } } \end{array}$ , is equivalent to graphs undirected. $\mathcal { G }$
|
| 79 |
+
|
| 80 |
+
Proof. See Appendix C.
|
| 81 |
+
|
| 82 |
+
2.3 TEMPORAL DYNAMICS MODELING
|
| 83 |
+
|
| 84 |
+
We leverage the recurrent neural networks (RNNs) to model the temporal dependency. In particular, we use Gated Recurrent Units (GRU) (Chung et al., 2014), which is a simple yet powerful variant of RNNs. We replace the matrix multiplications in GRU with the diffusion convolution, which leads to our proposed $D$ iffusion Convolutional Gated Recurrent Unit (DCGRU).
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r l r l } & { r ^ { ( t ) } = } & { \sigma ( \Theta _ { r } \star _ { \mathcal { G } } \big [ X ^ { ( t ) } , ~ H ^ { ( t - 1 ) } \big ] + b _ { r } ) } & { u ^ { ( t ) } = \sigma \big ( \Theta _ { u } \star _ { \mathcal { G } } \big [ X ^ { ( t ) } , ~ H ^ { ( t - 1 ) } \big ] + b _ { u } \big ) } \\ & { \varsigma ^ { ( t ) } = } & { \mathrm { t a n h } \big ( \Theta _ { C } \star _ { \mathcal { G } } \big [ X ^ { ( t ) } , ~ ( r ^ { ( t ) } \odot H ^ { ( t - 1 ) } ) \big ] + b _ { c } \big ) } & { H ^ { ( t ) } = u ^ { ( t ) } \odot H ^ { ( t - 1 ) } + \big ( 1 - u ^ { ( t ) } \big ) \odot C ^ { ( t ) } } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\mathbf { \boldsymbol { X } } ^ { ( t ) } , \mathbf { \boldsymbol { H } } ^ { ( t ) }$ denote the input and output of at time $t$ $\mathbf { \boldsymbol { r } } ^ { ( t ) } , \mathbf { \boldsymbol { u } } ^ { ( t ) }$ are reset gate and update gate at time $t$ , respectively. $\star _ { \mathcal { G } }$ denotes the diffusion convolution defined in Equation 2 and $\Theta _ { r } , \Theta _ { u } , \Theta _ { C }$ are parameters for the corresponding filters. Similar to GRU, DCGRU can be used to build recurrent neural network layers and be trained using backpropagation through time.
|
| 91 |
+
|
| 92 |
+
In multiple step ahead forecasting, we employ the Sequence to Sequence architecture (Sutskever et al., 2014). Both the encoder and the decoder are recurrent neural networks with DCGRU. During training, we feed the historical time series into the encoder and use its final states to initialize the decoder. The decoder generates predictions given previous ground truth observations. At testing time, ground truth observations are replaced by predictions generated by the model itself. The discrepancy between the input distributions of training and testing can cause degraded performance. To mitigate this issue, we integrate scheduled sampling (Bengio et al., 2015) into the model, where we feed the model with either the ground truth observation with probability $\epsilon _ { i }$ or the prediction by the model with probability $1 - \epsilon _ { i }$ at the ith iteration. During the training process, $\epsilon _ { i }$ gradually decreases to 0 to allow the model to learn the testing distribution.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: System architecture for the Diffusion Convolutional Recurrent Neural Network designed for spatiotemporal traffic forecasting. The historical time series are fed into an encoder whose final states are used to initialize the decoder. The decoder makes predictions based on either previous ground truth or the model output.
|
| 96 |
+
|
| 97 |
+
With both spatial and temporal modeling, we build a Diffusion Convolutional Recurrent Neural Network (DCRNN). The model architecture of DCRNN is shown in Figure 2. The entire network is trained by maximizing the likelihood of generating the target future time series using backpropagation through time. DCRNN is able to capture spatiotemporal dependencies among time series and can be applied to various spatiotemporal forecasting problems.
|
| 98 |
+
|
| 99 |
+
# 3 RELATED WORK
|
| 100 |
+
|
| 101 |
+
Traffic forecasting is a classic problem in transportation and operational research which are primarily based on queuing theory and simulations (Drew, 1968). Data-driven approaches for traffic forecasting have received considerable attention, and more details can be found in a recent survey paper (Vlahogianni et al., 2014) and the references therein. However, existing machine learning models either impose strong stationary assumptions on the data (e.g., auto-regressive model) or fail to account for highly non-linear temporal dependency (e.g., latent space model Yu et al. (2016); Deng et al. (2016)). Deep learning models deliver new promise for time series forecasting problem. For example, in Yu et al. (2017b); Laptev et al. (2017), the authors study time series forecasting using deep Recurrent Neural Networks (RNN). Convolutional Neural Networks (CNN) have also been applied to traffic forecasting. Zhang et al. (2016; 2017) convert the road network to a regular 2-D grid and apply traditional CNN to predict crowd flow. Cheng et al. (2017) propose DeepTransport which models the spatial dependency by explicitly collecting upstream and downstream neighborhood roads for each individual road and then conduct convolution on these neighborhoods respectively.
|
| 102 |
+
|
| 103 |
+
Recently, CNN has been generalized to arbitrary graphs based on the spectral graph theory. Graph convolutional neural networks (GCN) are first introduced in Bruna et al. (2014), which bridges the spectral graph theory and deep neural networks. Defferrard et al. (2016) propose ChebNet which improves GCN with fast localized convolutions filters. Kipf & Welling (2017) simplify ChebNet and achieve state-of-the-art performance in semi-supervised classification tasks. Seo et al. (2016) combine ChebNet with Recurrent Neural Networks (RNN) for structured sequence modeling. Yu et al. (2017a) model the sensor network as a undirected graph and applied ChebNet and convolutional sequence model (Gehring et al., 2017) to do forecasting. One limitation of the mentioned spectral based convolutions is that they generally require the graph to be undirected to calculate meaningful spectral decomposition. Going from spectral domain to vertex domain, Atwood & Towsley (2016) propose diffusion-convolutional neural network (DCNN) which defines convolution as a diffusion process across each node in a graph-structured input. Hechtlinger et al. (2017) propose GraphCNN to generalize convolution to graph by convolving every node with its $p$ nearest neighbors. However, both these methods do not consider the temporal dynamics and mainly deal with static graph settings.
|
| 104 |
+
|
| 105 |
+
Table 1: Performance comparison of different approaches for traffic speed forecasting. DCRNN achieves the best performance with all three metrics for all forecasting horizons, and the advantage becomes more evident with the increase of the forecasting horizon.
|
| 106 |
+
|
| 107 |
+
<table><tr><td></td><td>T</td><td>Metric</td><td>HA</td><td>ARIMAKal</td><td>VAR</td><td>SVR</td><td>FNN</td><td>FC-LSTM</td><td>DCRNN</td></tr><tr><td rowspan="4">PATIIA</td><td>15 min</td><td>MAE RMSE</td><td>4.16 7.80</td><td>3.99 8.21</td><td>4.42 7.89</td><td>3.99 8.45</td><td>3.99 7.94</td><td>3.44 6.30</td><td>2.77 5.38</td></tr><tr><td></td><td>MAPE MAE</td><td>13.0% 4.16</td><td>9.6% 5.15</td><td>10.2% 5.41</td><td>9.3% 5.05</td><td>9.9% 4.23</td><td>9.6% 3.77</td><td>7.3% 3.15</td></tr><tr><td>30 min</td><td>RMSE MAPE MAE</td><td>7.80 13.0% 4.16</td><td>10.45 12.7% 6.90</td><td>9.13 12.7% 6.52</td><td>10.87 12.1% 6.72</td><td>8.17 12.9% 4.49</td><td>7.23 10.9% 4.37</td><td>6.45 8.8% 3.60</td></tr><tr><td>1 hour</td><td>RMSE MAPE</td><td>7.80 13.0%</td><td>13.23 17.4%</td><td>10.11 15.8%</td><td>13.76 16.7%</td><td>8.69 14.0%</td><td>8.69 13.2%</td><td>7.59 10.5%</td></tr><tr><td rowspan="4">PPP-PPAA</td><td>15 min</td><td>MAE RMSE MAPE</td><td>2.88 5.59 6.8%</td><td>1.62 3.30 3.5%</td><td>1.74 3.16 3.6%</td><td>1.85 3.59 3.8%</td><td>2.20 4.42 5.19%</td><td>2.05 4.19</td><td>1.38 2.95</td></tr><tr><td>30 min</td><td>MAE RMSE MAPE</td><td>2.88 5.59 6.8%</td><td>2.33 4.76</td><td>2.32 4.25</td><td>2.48 5.18</td><td>2.30 4.63</td><td>4.8% 2.20 4.55</td><td>2.9% 1.74 3.97</td></tr><tr><td>1 hour</td><td>MAE RMSE</td><td>2.88 5.59</td><td>5.4% 3.38 6.50</td><td>5.0% 2.93 5.44</td><td>5.5% 3.28 7.08</td><td>5.43% 2.46</td><td>5.2% 2.37</td><td>3.9% 2.07</td></tr><tr><td></td><td>MAPE</td><td>6.8%</td><td>8.3%</td><td>6.5%</td><td>8.0%</td><td>4.98 5.89%</td><td>4.96 5.7%</td><td>4.74 4.9%</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Our approach is different from all those methods due to both the problem settings and the formulation of the convolution on the graph. We model the sensor network as a weighted directed graph which is more realistic than grid or undirected graph. Besides, the proposed convolution is defined using bidirectional graph random walk and is further integrated with the sequence to sequence learning framework as well as the scheduled sampling to model the long-term temporal dependency.
|
| 110 |
+
|
| 111 |
+
# 4 EXPERIMENTS
|
| 112 |
+
|
| 113 |
+
We conduct experiments on two real-world large-scale datasets: (1) METR-LA This traffic dataset contains traffic information collected from loop detectors in the highway of Los Angeles County (Jagadish et al., 2014). We select 207 sensors and collect 4 months of data ranging from Mar 1st 2012 to Jun 30th 2012 for the experiment. (2) PEMS-BAY This traffic dataset is collected by California Transportation Agencies (CalTrans) Performance Measurement System (PeMS). We select 325 sensors in the Bay Area and collect 6 months of data ranging from Jan 1st 2017 to May 31th 2017 for the experiment. The sensor distributions of both datasets are visualized in Figure 8 in the Appendix.
|
| 114 |
+
|
| 115 |
+
In both of those datasets, we aggregate traffic speed readings into 5 minutes windows, and apply Z-Score normalization. $70 \%$ of data is used for training, $20 \%$ are used for testing while the remaining $10 \%$ for validation. To construct the sensor graph, we compute the pairwise road network distances between sensors and build the adjacency matrix using thresholded Gaussian kernel (Shuman et al., 2013). $\begin{array} { r } { W _ { i j } = \exp \left( { - \frac { \mathrm { d i s t } ( v _ { i } , v _ { j } ) ^ { 2 } } { \sigma ^ { 2 } } } \right) } \end{array}$ if $\mathrm { d i s t } ( v _ { i } , v _ { j } ) \le \kappa$ , otherwise 0, where $W _ { i j }$ represents the edge weight between sensor $v _ { i }$ and sensor $v _ { j }$ , $\mathrm { d i s t } ( v _ { i } , v _ { j } )$ denotes the road network distance from sensor $v _ { i }$ to sensor $v _ { j }$ . $\sigma$ is the standard deviation of distances and $\kappa$ is the threshold.
|
| 116 |
+
|
| 117 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 118 |
+
|
| 119 |
+
Baselines We compare DCRNN1 with widely used time series regression models, including (1) HA: Historical Average, which models the traffic flow as a seasonal process, and uses weighted average of previous seasons as the prediction; (2) $\mathbf { A R I M A } _ { k a l }$ : Auto-Regressive Integrated Moving Average model with Kalman filter which is widely used in time series prediction; (3) VAR: Vector Auto-Regression (Hamilton, 1994). (4) SVR: Support Vector Regression which uses linear support vector machine for the regression task; The following deep neural network based approaches are also included: (5) Feed forward Neural network (FNN): Feed forward neural network with two hidden layers and L2 regularization. (6) Recurrent Neural Network with fully connected LSTM hidden units (FC-LSTM) (Sutskever et al., 2014).
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 3: Learning curve for DCRNN and DCRNN without diffusion convolution. Removing diffusion convolution results in much higher validation error. Moreover, DCRNN with bidirectional random walk achieves the lowest validation error.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: Effects of K and the number of units in each layer of DCRNN. K corresponds to the reception field width of the filter, and the number of units corresponds to the number of filters.
|
| 126 |
+
|
| 127 |
+
All neural network based approaches are implemented using Tensorflow (Abadi et al., 2016), and trained using the Adam optimizer with learning rate annealing. The best hyperparameters are chosen using the Tree-structured Parzen Estimator (TPE) (Bergstra et al., 2011) on the validation dataset. Detailed parameter settings for DCRNN as well as baselines are available in Appendix E.
|
| 128 |
+
|
| 129 |
+
# 4.2 TRAFFIC FORECASTING PERFORMANCE COMPARISON
|
| 130 |
+
|
| 131 |
+
Table 1 shows the comparison of different approaches for 15 minutes, 30 minutes and 1 hour ahead forecasting on both datasets. These methods are evaluated based on three commonly used metrics in traffic forecasting, including (1) Mean Absolute Error (MAE), (2) Mean Absolute Percentage Error (MAPE), and (3) Root Mean Squared Error (RMSE). Missing values are excluded in calculating these metrics. Detailed formulations of these metrics are provided in Appendix E.2. We observe the following phenomenon in both of these datasets. (1) RNN-based methods, including FC-LSTM and DCRNN, generally outperform other baselines which emphasizes the importance of modeling the temporal dependency. (2) DCRNN achieves the best performance regarding all the metrics for all forecasting horizons, which suggests the effectiveness of spatiotemporal dependency modeling. (3) Deep neural network based methods including FNN, FC-LSTM and DCRNN, tend to have better performance than linear baselines for long-term forecasting, e.g., 1 hour ahead. This is because the temporal dependency becomes increasingly non-linear with the growth of the horizon. Besides, as the historical average method does not depend on short-term data, its performance is invariant to the small increases in the forecasting horizon.
|
| 132 |
+
|
| 133 |
+
Note that, traffic forecasting on the METR-LA (Los Angeles, which is known for its complicated traffic conditions) dataset is more challenging than that in the PEMS-BAY (Bay Area) dataset. Thus we use METR-LA as the default dataset for following experiments.
|
| 134 |
+
|
| 135 |
+
# 4.3 EFFECT OF SPATIAL DEPENDENCY MODELING
|
| 136 |
+
|
| 137 |
+
To further investigate the effect of spatial dependency modeling, we compare DCRNN with the following variants: (1) DCRNN-NoConv, which ignores spatial dependency by replacing the transition matrices in the diffusion convolution (Equation 2) with identity matrices. This essentially means the forecasting of a sensor can be only be inferred from its own historical readings; (2) DCRNN-UniConv, which only uses the forward random walk transition matrix for diffusion convolution; Figure 3 shows the learning curves of these three models with roughly the same number of parameters. Without diffusion convolution, DCRNN-NoConv has much higher validation error. Moreover, DCRNN achieves the lowest validation error which shows the effectiveness of using bidirectional random walk. The intuition is that the bidirectional random walk gives the model the ability and flexibility to capture the influence from both the upstream and the downstream traffic.
|
| 138 |
+
|
| 139 |
+
Table 2: Performance comparison for DCRNN and GCRNN on the METRA-LA dataset.
|
| 140 |
+
|
| 141 |
+
<table><tr><td></td><td colspan="3">15 min</td><td colspan="3">30 min</td><td colspan="3">1 hour</td></tr><tr><td></td><td>MAE</td><td>RMSE</td><td>MAPE</td><td>MAE</td><td>RMSE</td><td>MAPE</td><td>MAE</td><td>RMSE</td><td>MAPE</td></tr><tr><td>DCRNN</td><td>2.77</td><td>5.38</td><td>7.3%</td><td>3.15</td><td>6.45</td><td>8.8%</td><td>3.60</td><td>7.60</td><td>10.5%</td></tr><tr><td>GCRNN</td><td>2.80</td><td>5.51</td><td>7.5%</td><td>3.24</td><td>6.74</td><td>9.0%</td><td>3.81</td><td>8.16</td><td>10.9%</td></tr></table>
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Performance comparison for different DCRNN variants. DCRNN, with the sequence to sequence framework and scheduled sampling, achieves the lowest MAE on the validation dataset. The advantage becomes more clear with the increase of the forecasting horizon.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: Traffic time series forecasting visualization. DCRNN generates smooth prediction and is usually better at predict the start and end of peak hours.
|
| 148 |
+
|
| 149 |
+
To investigate the effect of graph construction, we construct a undirected graph by setting $\widehat { W } _ { i j } =$ $\widehat { W } _ { j i } = \operatorname* { m a x } ( W _ { i j } , W _ { j i } )$ , where $\widehat { W }$ is the new symmetric weight matrix. Then we develop a variant of DCRNN denotes GCRNN, which uses the sequence to sequence learning with ChebNet graph convolution (Equation 5) with roughly the same amount of parameters. Table 2 shows the comparison between DCRNN and GCRNN in the METR-LA dataset. DCRNN consistently outperforms GCRNN. The intuition is that directed graph better captures the asymmetric correlation between traffic sensors. Figure 4 shows the effects of different parameters. $K$ roughly corresponds to the size of filters’ reception fields while the number of units corresponds to the number of filters. Larger $K$ enables the model to capture broader spatial dependency at the cost of increasing learning complexity. We observe that with the increase of $K$ , the error on the validation dataset first quickly decrease, and then slightly increase. Similar behavior is observed for varying the number of units.
|
| 150 |
+
|
| 151 |
+
# 4.4 EFFECT OF TEMPORAL DEPENDENCY MODELING
|
| 152 |
+
|
| 153 |
+
To evaluate the effect of temporal modeling including the sequence to sequence framework as well as the scheduled sampling mechanism, we further design three variants of DCRNN: (1) DCNN: in which we concatenate the historical observations as a fixed length vector and feed it into stacked diffusion convolutional layers to predict the future time series. We train a single model for one step ahead prediction, and feed the previous prediction into the model as input to perform multiple steps ahead prediction. (2) DCRNN-SEQ: which uses the encoder-decoder sequence to sequence learning framework to perform multiple steps ahead forecasting. (3) DCRNN: similar to DCRNN-SEQ except for adding scheduled sampling.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 7: Visualization of learned localized filters centered at different nodes with $K = 3$ on the METR-LA dataset. The star denotes the center, and the colors represent the weights. We observe that weights are localized around the center, and diffuse alongside the road network.
|
| 157 |
+
|
| 158 |
+
Figure 5 shows the comparison of those four methods with regards to MAE for different forecasting horizons. We observe that: (1) DCRNN-SEQ outperforms DCNN by a large margin which conforms the importance of modeling temporal dependency. (2) DCRNN achieves the best result, and its superiority becomes more evident with the increase of the forecasting horizon. This is mainly because the model is trained to deal with its mistakes during multiple steps ahead prediction and thus suffers less from the problem of error propagation. We also train a model that always been fed its output as input for multiple steps ahead prediction. However, its performance is much worse than all the three variants which emphasizes the importance of scheduled sampling.
|
| 159 |
+
|
| 160 |
+
# 4.5 MODEL INTERPRETATION
|
| 161 |
+
|
| 162 |
+
To better understand the model, we visualize forecasting results as well as learned filters. Figure 6 shows the visualization of 1 hour ahead forecasting. We have the following observations: (1) DCRNN generates smooth prediction of the mean when small oscillation exists in the traffic speeds (Figure 6(a)). This reflects the robustness of the model. (2) DCRNN is more likely to accurately predict abrupt changes in the traffic speed than baseline methods (e.g., FC-LSTM). As shown in Figure 6(b), DCRNN predicts the start and the end of the peak hours. This is because DCRNN captures the spatial dependency, and is able to utilize the speed changes in neighborhood sensors for more accurate forecasting. Figure 7 visualizes examples of learned filters centered at different nodes. The star denotes the center, and colors denote the weights. We can observe that (1) weights are well localized around the center, and (2) the weights diffuse based on road network distance. More visualizations are provided in Appendix F.
|
| 163 |
+
|
| 164 |
+
# 5 CONCLUSION
|
| 165 |
+
|
| 166 |
+
In this paper, we formulated the traffic prediction on road network as a spatiotemporal forecasting problem, and proposed the diffusion convolutional recurrent neural network that captures the spatiotemporal dependencies. Specifically, we use bidirectional graph random walk to model spatial dependency and recurrent neural network to capture the temporal dynamics. We further integrated the encoder-decoder architecture and the scheduled sampling technique to improve the performance for long-term forecasting. When evaluated on two large-scale real-world traffic datasets, our approach obtained significantly better prediction than baselines. For future work, we will investigate the following two aspects (1) applying the proposed model to other spatial-temporal forecasting tasks; (2) modeling the spatiotemporal dependency when the underlying graph structure is evolving, e.g., the K nearest neighbor graph for moving objects.
|
| 167 |
+
|
| 168 |
+
# ACKNOWLEDGMENTS
|
| 169 |
+
|
| 170 |
+
This research has been funded in part by NSF grants CNS-1461963, IIS-1254206, IIS-1539608, Caltrans-65A0533, the USC Integrated Media Systems Center (IMSC), and the USC METRANS Transportation Center. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of any of the sponsors such as NSF. Also, the authors would like to thank Shang-Hua Teng, Dehua Cheng and Siyang Li for helpful discussions and comments.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Mart´ın Abadi et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 175 |
+
|
| 176 |
+
James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
|
| 177 |
+
|
| 178 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In NIPS, pp. 1171–1179, 2015.
|
| 179 |
+
|
| 180 |
+
James S Bergstra, Remi Bardenet, Yoshua Bengio, and Bal ´ azs K ´ egl. Algorithms for hyper-parameter ´ optimization. In Advances in Neural Information Processing Systems, pp. 2546–2554, 2011.
|
| 181 |
+
|
| 182 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In ICLR, 2014.
|
| 183 |
+
|
| 184 |
+
Pinlong Cai, Yunpeng Wang, Guangquan Lu, Peng Chen, Chuan Ding, and Jianping Sun. A spatiotemporal correlative k-nearest neighbor model for short-term traffic multistep forecasting. Transportation Research Part C: Emerging Technologies, 62:21–34, 2016.
|
| 185 |
+
|
| 186 |
+
Ennio Cascetta. Transportation systems engineering: theory and methods, volume 49. Springer Science & Business Media, 2013.
|
| 187 |
+
|
| 188 |
+
Dehua Cheng, Yu Cheng, Yan Liu, Richard Peng, and Shang-Hua Teng. Efficient sampling for gaussian graphical models via spectral sparsification. In Conference on Learning Theory, pp. 364–390, 2015.
|
| 189 |
+
|
| 190 |
+
Xingyi Cheng, Ruiqing Zhang, Jie Zhou, and Wei Xu. Deeptransport: Learning spatial-temporal dependency for traffic condition forecasting. arXiv preprint arXiv:1709.09585, 2017.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In NIPS, pp. 3837–3845, 2016.
|
| 195 |
+
|
| 196 |
+
Dingxiong Deng, Cyrus Shahabi, Ugur Demiryurek, Linhong Zhu, Rose Yu, and Yan Liu. Latent space model for road networks to predict time-varying traffic. In SIGKDD, pp. 1525–1534, 2016.
|
| 197 |
+
|
| 198 |
+
Donald R Drew. Traffic flow theory and control. Technical report, 1968.
|
| 199 |
+
|
| 200 |
+
Gaetano Fusco, Chiara Colombaroni, and Natalia Isaenko. Short-term speed predictions exploiting big data on large urban road networks. Transportation Research Part C: Emerging Technologies, 73:183–201, 2016.
|
| 201 |
+
|
| 202 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, 2017.
|
| 203 |
+
|
| 204 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864. ACM, 2016.
|
| 205 |
+
|
| 206 |
+
James Douglas Hamilton. Time series analysis, volume 2. Princeton university press Princeton, 1994.
|
| 207 |
+
|
| 208 |
+
Yotam Hechtlinger, Purvasha Chakravarti, and Jining Qin. A generalization of convolutional neural networks to graph-structured data. arXiv preprint arXiv:1704.08165, 2017.
|
| 209 |
+
|
| 210 |
+
H. V. Jagadish, Johannes Gehrke, Alexandros Labrinidis, Yannis Papakonstantinou, Jignesh M. Patel, Raghu Ramakrishnan, and Cyrus Shahabi. Big data and its technical challenges. Commun. ACM, 57(7):86–94, July 2014.
|
| 211 |
+
|
| 212 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 213 |
+
|
| 214 |
+
Nikolay Laptev, Jason Yosinski, Li Erran Li, and Slawek Smyl. Time-series extreme event forecasting with neural networks at Uber. In Int. Conf. on Machine Learning Time Series Workshop, 2017.
|
| 215 |
+
|
| 216 |
+
Marco Lippi, Marco Bertini, and Paolo Frasconi. Short-term traffic flow forecasting: An experimental comparison of time-series analysis and supervised learning. ITS, IEEE Transactions on, 14(2): 871–882, 2013.
|
| 217 |
+
|
| 218 |
+
Wei Liu, Yu Zheng, Sanjay Chawla, Jing Yuan, and Xie Xing. Discovering spatio-temporal causal interactions in traffic data streams. In SIGKDD, pp. 1010–1018. ACM, 2011.
|
| 219 |
+
|
| 220 |
+
Yisheng Lv, Yanjie Duan, Wenwen Kang, Zhengxi Li, and Fei-Yue Wang. Traffic flow prediction with big data: A deep learning approach. ITS, IEEE Transactions on, 16(2):865–873, 2015.
|
| 221 |
+
|
| 222 |
+
Xiaolei Ma, Zhuang Dai, Zhengbing He, Jihui Ma, Yong Wang, and Yunpeng Wang. Learning traffic as images: a deep convolutional neural network for large-scale transportation network speed prediction. Sensors, 17(4):818, 2017.
|
| 223 |
+
|
| 224 |
+
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, pp. 701–710. ACM, 2014.
|
| 225 |
+
|
| 226 |
+
Youngjoo Seo, Michael Defferrard, Pierre Vandergheynst, and Xavier Bresson. Structured sequence ¨ modeling with graph convolutional recurrent networks. arXiv preprint arXiv:1612.07659, 2016.
|
| 227 |
+
|
| 228 |
+
David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30(3):83–98, 2013.
|
| 229 |
+
|
| 230 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, pp. 3104–3112, 2014.
|
| 231 |
+
|
| 232 |
+
Shang-Hua Teng et al. Scalable algorithms for data and network analysis. Foundations and Trends $\textsuperscript { \textregistered }$ in Theoretical Computer Science, 12(1–2):1–274, 2016.
|
| 233 |
+
|
| 234 |
+
Eleni I Vlahogianni, Matthew G Karlaftis, and John C Golias. Short-term traffic forecasting: Where we are and where were going. Transportation Research Part C: Emerging Technologies, 43:3–19, 2014.
|
| 235 |
+
|
| 236 |
+
Yuankai Wu and Huachun Tan. Short-term traffic flow forecasting with spatial-temporal correlation in a hybrid deep learning framework. arXiv preprint arXiv:1612.01022, 2016.
|
| 237 |
+
|
| 238 |
+
Yuanchang Xie, Kaiguang Zhao, Ying Sun, and Dawei Chen. Gaussian processes for short-term traffic volume forecasting. Transportation Research Record: Journal of the Transportation Research Board, (2165):69–78, 2010.
|
| 239 |
+
|
| 240 |
+
Bing Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional neural network: A deep learning framework for traffic forecasting. arXiv preprint arXiv:1709.04875, 2017a.
|
| 241 |
+
|
| 242 |
+
Hsiang-Fu Yu, Nikhil Rao, and Inderjit S Dhillon. Temporal regularized matrix factorization for high-dimensional time series prediction. In Advances in Neural Information Processing Systems, pp. 847–855, 2016.
|
| 243 |
+
|
| 244 |
+
Rose Yu, Yaguang Li, Cyrus Shahabi, Ugur Demiryurek, and Yan Liu. Deep learning: A generic approach for extreme condition traffic forecasting. In SIAM International Conference on Data Mining (SDM), 2017b.
|
| 245 |
+
|
| 246 |
+
Junbo Zhang, Yu Zheng, Dekang Qi, Ruiyuan Li, and Xiuwen Yi. Dnn-based prediction model for spatio-temporal data. In Proceedings of the 24th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 92. ACM, 2016.
|
| 247 |
+
|
| 248 |
+
Junbo Zhang, Yu Zheng, and Dekang Qi. Deep spatio-temporal residual networks for citywide crowd flows prediction. In AAAI, pp. 1655–1661, 2017.
|
| 249 |
+
|
| 250 |
+
# APPENDIX
|
| 251 |
+
|
| 252 |
+
A NOTATION
|
| 253 |
+
|
| 254 |
+
Table 3: Notation
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Name g</td><td>a graph</td></tr><tr><td>V,Ui m W,Wij, D,D1,Do L Φ,△</td><td>nodes of a graph,|V|= N and the i-th node. edges of a graph weight matrix of a graph and its entries undirected degree matrix, In-degree/out-degree matrix normalized graphLaplacian eigen-vector matrix and eigen-value matrix of L X,X∈RN×P a graph signal,and the predicted graph signal. a graph signal at time t. output of the diffusion convolutional layer.</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Table 3 summarizes the main notations used in the paper.
|
| 259 |
+
|
| 260 |
+
# B EFFICIENT CALCULATION OF EQUATION 2
|
| 261 |
+
|
| 262 |
+
Equation 2 can be decomposed into two parts with the same time complexity, i.e., one part with $D _ { O } ^ { - 1 } W$ and the other part with $D _ { I } ^ { - 1 } W ^ { \boldsymbol { \mathsf { T } } }$ . Thus we will only show the time complexity of the first part.
|
| 263 |
+
|
| 264 |
+
Let $T _ { k } ( { \pmb x } ) = \left( { \pmb D } _ { O } ^ { - 1 } { \pmb W } \right) ^ { k } { \pmb x }$ , The first part of Equation 2 can be rewritten as
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\sum _ { k = 0 } ^ { K - 1 } \theta _ { k } T _ { k } ( X _ { : , p } )
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
As $T _ { k + 1 } ( { \pmb x } ) = D _ { O } ^ { - 1 } { \pmb W } T _ { k } ( { \pmb x } )$ and $D _ { O } ^ { - 1 } W$ is sparse, it is easy to see that Equation 4 can be calculated using ${ \cal { O } } \breve { ( } K )$ recursive sparse-dense matrix multiplication each with time complexity $O ( | \mathcal { E } | )$ . Consequently, the time complexities of both Equation 2 and Equation 4 are $O ( K | \bar { \mathcal { E } } | )$ . For dense graph, we may use spectral sparsification (Cheng et al., 2015) to make it sparse.
|
| 271 |
+
|
| 272 |
+
# C RELATION WITH SPECTRAL GRAPH CONVOLUTION
|
| 273 |
+
|
| 274 |
+
Proof. The spectral graph convolution utilizes the concept of normalized graph Laplacian $L =$ $D ^ { - { \frac { 1 } { 2 } } } ( D - \bar { W } ) D ^ { - { \frac { 1 } { 2 } } } = \Phi \Lambda \Phi ^ { \intercal }$ . ChebNet parametrizes $f _ { \theta }$ to be a $K$ order polynomial of $\pmb { \Lambda }$ , and calculates it using stable Chebyshev polynomial basis.
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
{ \cal X } _ { : , p } \star _ { \mathscr G } f _ { \theta } = \Phi \left( \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } { \bf A } ^ { k } \right) \Phi ^ { \intercal } { \cal X } _ { : , p } = \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } { \cal L } ^ { k } { \pmb X } _ { : , p } = \sum _ { k = 0 } ^ { K - 1 } \tilde { \theta } _ { k } T _ { k } ( { \tilde { \cal L } } ) { \pmb X } _ { : , p }
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
where $T _ { 0 } ( x ) = 1 , T _ { 1 } ( x ) = x , T _ { k } ( x ) = x T _ { k - 1 } ( x ) - T _ { k - 2 } ( x )$ are the basis of the Cheyshev polynomial. Let $\lambda _ { m a x }$ denote the largest eigenvalue of $\pmb { L }$ , and $\begin{array} { r } { \tilde { \pmb { L } } = \frac { 2 } { \lambda _ { m a x } } \pmb { L } - \pmb { I } } \end{array}$ represents a rescaling of the graph Laplacian that maps the eigenvalues from $[ 0 , \lambda _ { m a x } ]$ to $[ - 1 , 1 ]$ since Chebyshev polynomial forms an orthogonal basis in $[ - 1 , 1 ]$ . Equation 5 can be considered as a polynomial of $\tilde { L }$ and we will show that the output of ChebNet Convolution is similar to the output of diffusion convolution up to constant scaling factor. Assume $\lambda _ { m a x } = 2$ and ${ \cal D } _ { I } = { \cal D } _ { O } = { \cal D }$ for undirected graph.
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\tilde { L } = D ^ { - \frac { 1 } { 2 } } ( D - W ) D ^ { - \frac { 1 } { 2 } } - I = - D ^ { - \frac { 1 } { 2 } } W D ^ { - \frac { 1 } { 2 } } \sim - D ^ { - 1 } W
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
$\tilde { L }$ is similar to the negative random walk transition matrix, thus the output of Equation 5 is also similar to the output of Equation 2 up to constant scaling factor. □
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 8: Sensor distribution of the METR-LA and PEMS-BAY dataset.
|
| 290 |
+
|
| 291 |
+
D MORE RELATED WORK AND DISCUSSION
|
| 292 |
+
|
| 293 |
+
Xie et al. (2010) introduce a Gaussian processes (GPs) based method. GPs are hard to scale to the large dataset and are generally not suitable for relatively long-term traffic prediction like 1 hour (i.e.,12 steps ahead), as the variance can be accumulated and becomes extremely large.
|
| 294 |
+
|
| 295 |
+
Cai et al. (2016) propose to use spatiotemporal nearest neighbor for traffic forecasting (ST-KNN). Though ST-KNN considers both the spatial and the temporal dependencies, it has the following drawbacks. As shown in Fusco et al. (2016), ST-KNN performs independent forecasting for each individual road. The prediction of a road is a weighted combination of its own historical traffic speeds. This makes it hard for ST-KNN to fully utilize information from neighbors. Besides, ST-KNN is a non-parametric approach and each road is modeled and calculated separately (Cai et al., 2016), which makes it hard to generalize to unseen situations and to scale to large datasets. Finally, in ST-KNN, all the similarities are calculated using hand-designed metrics with few learnable parameters, and this may limit its representational power.
|
| 296 |
+
|
| 297 |
+
Cheng et al. (2017) propose DeepTransport which models the spatial dependency by explicitly collecting certain number of upstream and downstream roads for each individual road and then conduct convolution on these roads respectively. Comparing with Cheng et al. (2017), DCRNN models the spatial dependency in a more systematic way, i.e., generalizing convolution to the traffic sensor graph based on the diffusion nature of traffic. Besides, we derive DCRNN from the property of random walk and show that the popular spectral convolution ChebNet is a special case of our method.
|
| 298 |
+
|
| 299 |
+
The proposed approach is also related to graph embedding techniques, e.g., Deepwalk (Perozzi et al., 2014), node2vec (Grover & Leskovec, 2016) which learn a low dimension representation for each node in the graph. DCRNN also learns a representation for each node. The learned representations capture both the spatial and the temporal dependency and at the same time are optimized with regarding to the objective, e.g., future traffic speeds.
|
| 300 |
+
|
| 301 |
+
# E DETAILED EXPERIMENTAL SETTINGS
|
| 302 |
+
|
| 303 |
+
HA Historical Average, which models the traffic flow as a seasonal process, and uses weighted average of previous seasons as the prediction. The period used is 1 week, and the prediction is based on aggregated data from previous weeks. For example, the prediction for this Wednesday is the averaged traffic speeds from last four Wednesdays. As the historical average method does not depend on short-term data, its performance is invariant to the small increases in the forecasting horizon
|
| 304 |
+
|
| 305 |
+
$\mathbf { A R I M A } _ { k a l }$ : Auto-Regressive Integrated Moving Average model with Kalman filter. The orders are (3, 0, 1), and the model is implemented using the statsmodel python package.
|
| 306 |
+
|
| 307 |
+
VAR Vector Auto-regressive model (Hamilton, 1994). The number of lags is set to 3, and the model is implemented using the statsmodel python package.
|
| 308 |
+
|
| 309 |
+
SVR Linear Support Vector Regression, the penalty term $C = 0 . 1$ , the number of historical observation is 5.
|
| 310 |
+
|
| 311 |
+
The following deep neural network based approaches are also included.
|
| 312 |
+
|
| 313 |
+
FNN Feed forward neural network with two hidden layers, each layer contains 256 units. The initial learning rate is $1 e ^ { - 3 }$ , and reduces to $\frac { 1 } { 1 0 }$ every 20 epochs starting at the 50th epochs. In addition, for all hidden layers, dropout with ratio 0.5 and L2 weight decay $1 e ^ { - 2 }$ is used. The model is trained with batch size 64 and MAE as the loss function. Early stop is performed by monitoring the validation error.
|
| 314 |
+
|
| 315 |
+
FC-LSTM The Encoder-decoder framework using LSTM with peephole (Sutskever et al., 2014). Both the encoder and the decoder contain two recurrent layers. In each recurrent layer, there are 256 LSTM units, L1 weight decay is $2 e ^ { - 5 }$ , L2 weight decay $5 e ^ { - 4 }$ . The model is trained with batch size 64 and loss function MAE. The initial learning rate is 1e-4 and reduces to 110 every 10 epochs starting from the 20th epochs. Early stop is performed by monitoring the validation error.
|
| 316 |
+
|
| 317 |
+
DCRNN : Diffusion Convolutional Recurrent Neural Network. Both encoder and decoder contain two recurrent layers. In each recurrent layer, there are 64 units, the initial learning rate is $1 e ^ { - 2 }$ , and reduces to $\frac { 1 } { 1 0 }$ every 10 epochs starting at the 20th epoch and early stopping on the validation dataset is used. Besides, the maximum steps of random walks, i.e., $K$ , is set to 3. For scheduled sampling, the thresholded inverse sigmoid function is used as the probability decay:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\epsilon _ { i } = \frac { \tau } { \tau + \exp \left( i / \tau \right) }
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
where $i$ is the number of iterations while $\tau$ are parameters to control the speed of convergence. $\tau$ is set to 3,000 in the experiments. The implementation is available in https://github.com/ liyaguang/DCRNN.
|
| 324 |
+
|
| 325 |
+
# E.1 DATASET
|
| 326 |
+
|
| 327 |
+
We conduct experiments on two real-world large-scale datasets:
|
| 328 |
+
|
| 329 |
+
• METR-LA This traffic dataset contains traffic information collected from loop detectors in the highway of Los Angeles County (Jagadish et al., 2014). We select 207 sensors and collect 4 months of data ranging from Mar 1st 2012 to Jun 30th 2012 for the experiment. The total number of observed traffic data points is 6,519,002.
|
| 330 |
+
PEMS-BAY This traffic dataset is collected by California Transportation Agencies (CalTrans) Performance Measurement System (PeMS). We select 325 sensors in the Bay Area and collect 6 months of data ranging from Jan 1st 2017 to May 31th 2017 for the experiment. The total number of observed traffic data points is 16,937,179.
|
| 331 |
+
|
| 332 |
+
The sensor distributions of both datasets are visualized in Figure 8.
|
| 333 |
+
|
| 334 |
+
In both of those datasets, we aggregate traffic speed readings into 5 minutes windows, and apply Z-Score normalization. $70 \%$ of data is used for training, $20 \%$ are used for testing while the remaining $10 \%$ for validation. To construct the sensor graph, we compute the pairwise road network distances between sensors and build the adjacency matrix using thresholded Gaussian kernel (Shuman et al., 2013).
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
W _ { i j } = \exp \left( - \frac { \mathrm { d i s t } ( v _ { i } , v _ { j } ) ^ { 2 } } { \sigma ^ { 2 } } \right) \quad \mathrm { i f ~ } \mathrm { d i s t } ( v _ { i } , v _ { j } ) \leq \kappa , \mathrm { o t h e r w i s e ~ } 0
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where $W _ { i j }$ represents the edge weight between sensor $v _ { i }$ and sensor $v _ { j }$ , $\mathrm { d i s t } ( v _ { i } , v _ { j } )$ denotes the road network distance from sensor $v _ { i }$ to sensor $v _ { j }$ . $\sigma$ is the standard deviation of distances and $\kappa$ is the threshold.
|
| 341 |
+
|
| 342 |
+
# E.2 METRICS
|
| 343 |
+
|
| 344 |
+
Suppose $\pmb { x } = x _ { 1 } , \cdots , x _ { n }$ represents the ground truth, $\hat { \pmb x } = \hat { x } _ { 1 } , \cdots , \hat { x } _ { n }$ represents the predicted values, and $\Omega$ denotes the indices of observed samples, the metrics are defined as follows.
|
| 345 |
+
|
| 346 |
+
Root Mean Square Error (RMSE)
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\mathrm { R M S E } ( { \pmb x } , \hat { \pmb x } ) = \sqrt { \frac { 1 } { | { \pmb \Omega } | } \sum _ { i \in \Omega } ( x _ { i } - \hat { x } _ { i } ) ^ { 2 } }
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Mean Absolute Percentage Error (MAPE)
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\mathrm { M A P E } ( \pmb { x } , \hat { \pmb { x } } ) = \frac { 1 } { | \pmb { \Omega } | } \sum _ { i \in \Omega } \left| \frac { x _ { i } - \hat { x } _ { i } } { x _ { i } } \right|
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Mean Absolute Error (MAE)
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathrm { M A E } ( { \pmb x } , \hat { \pmb x } ) = \frac { 1 } { | \pmb { \Omega } | } \sum _ { i \in \pmb { \Omega } } | x _ { i } - \hat { x } _ { i } |
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
F MODEL VISUALIZATION
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 9: Sensor correlations between the center sensor and its neighborhoods for different forecasting horizons. The correlations are estimated using regularized VAR. We observe that the correlations are localized and closer neighborhoods usually have larger relevance, and the magnitude of correlation quickly decay with the increase of distance which is consistent with the diffusion process on the graph.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 10: Traffic time series forecasting visualization.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 11: Traffic time series forecasting visualization.
|
md/train/SkfrvsA9FX/SkfrvsA9FX.md
ADDED
|
@@ -0,0 +1,462 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Reward Constrained Policy Optimization
|
| 2 |
+
|
| 3 |
+
Chen Tessler $^ { . 1 }$ , Daniel J. Mankowitz $^ 2$ , and Shie Mannor1
|
| 4 |
+
|
| 5 |
+
$^ { 1 }$ Technion Israel Institute of Technology, Haifa, Israel
|
| 6 |
+
$^ 2$ DeepMind, London, England
|
| 7 |
+
chen.tessler@campus.technion.ac.il, dmankowitz@google.com, shie@ee.technion.ac.il
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Solving tasks in Reinforcement Learning is no easy feat. As the goal of the agent is to maximize the accumulated reward, it often learns to exploit loopholes and misspecifications in the reward signal resulting in unwanted behavior. While constraints may solve this issue, there is no closed form solution for general constraints. In this work, we present a novel multi-timescale approach for constrained policy optimization, called ‘Reward Constrained Policy Optimization’ (RCPO), which uses an alternative penalty signal to guide the policy towards a constraint satisfying one. We prove the convergence of our approach and provide empirical evidence of its ability to train constraint satisfying policies.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Applying Reinforcement Learning (RL) is generally a hard problem. At each state, the agent performs an action which produces a reward. The goal is to maximize the accumulated reward, hence the reward signal implicitly defines the behavior of the agent. While in computer games (e.g. Bellemare et al. (2013)) there exists a pre-defined reward signal, it is not such in many real applications.
|
| 16 |
+
|
| 17 |
+
An example is the Mujoco domain (Todorov et al., 2012), in which the goal is to learn to control robotic agents in tasks such as: standing up, walking, navigation and more. Considering the Humanoid domain, the agent is a 3 dimensional humanoid and the task is to walk forward as far as possible (without falling down) within a fixed amount of time. Naturally, a reward is provided based on the forward velocity in order to encourage a larger distance; however, additional reward signals are provided in order to guide the agent, for instance a bonus for staying alive, a penalty for energy usage and a penalty based on the force of impact between the feet and the floor (which should encourage less erratic behavior). Each signal is multiplied by it’s own coefficient, which controls the emphasis placed on it.
|
| 18 |
+
|
| 19 |
+
This approach is a multi-objective problem (Mannor and Shimkin, 2004); in which for each set of penalty coefficients, there exists a different, optimal solution, also known as Pareto optimality (Van Moffaert and Now´e, 2014). In practice, the exact coefficient is selected through a time consuming and a computationally intensive process of hyper-parameter tuning. As our experiments show, the coefficient is not shared across domains, a coefficient which leads to a satisfying behavior on one domain may lead to catastrophic failure on the other (issues also seen in Leike et al. (2017) and Mania et al. (2018)). Constraints are a natural and consistent approach, an approach which ensures a satisfying behavior without the need for manually selecting the penalty coefficients.
|
| 20 |
+
|
| 21 |
+
In constrained optimization, the task is to maximize a target function $f ( x )$ while satisfying an inequality constraint $g ( x ) \leq \alpha$ . While constraints are a promising solution to ensuring a satisfying behavior, existing methods are limited in the type of constraints they are able to handle and the algorithms that they may support - they require a parametrization of the policy (policy gradient methods) and propagation of the constraint violation signal over the entire trajectory (e.g. Prashanth and Ghavamzadeh (2016)). This poses an issue, as Q-learning algorithms such as DQN (Mnih et al., 2015) do not learn a parametrization of the policy, and common Actor-Critic methods (e.g. (Schulman et al., 2015a; Mnih et al., 2016;
|
| 22 |
+
|
| 23 |
+
Table 1: Comparison between various approaches.
|
| 24 |
+
|
| 25 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Handles discountedsum constraints</td><td rowspan=1 colspan=1>Handles meanvaluelconstraints</td><td rowspan=1 colspan=1>Requiresno priorknowledge</td><td rowspan=1 colspan=1>Rewardagnostic</td></tr><tr><td rowspan=1 colspan=1>RCPO (this paper)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>12</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>Dalal et al. (2018)</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>Achiam et al. (2017)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>Reward shaping</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>Schulman et al. (2017)3</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr></table>
|
| 26 |
+
|
| 27 |
+
Schulman et al., 2017)) build the reward-to-go based on an N-step sample and a bootstrap update from the critic.
|
| 28 |
+
|
| 29 |
+
In this paper, we propose the ‘Reward Constrained Policy Optimization’ (RCPO) algorithm. RCPO incorporates the constraint as a penalty signal into the reward function. This penalty signal guides the policy towards a constraint satisfying solution. We prove that RCPO converges almost surely, under mild assumptions, to a constraint satisfying solution (Theorem 2). In addition; we show, empirically on a toy domain and six robotics domains, that RCPO results in a constraint satisfying solution while demonstrating faster convergence and improved stability (compared to the standard constraint optimization methods).
|
| 30 |
+
|
| 31 |
+
Related work: Constrained Markov Decision Processes (Altman, 1999) are an active field of research. CMDP applications cover a vast number of topics, such as: electric grids (Koutsopoulos and Tassiulas, 2011), networking (Hou and Zhao, 2017), robotics (Chow et al., 2015; Gu et al., 2017; Achiam et al., 2017; Dalal et al., 2018) and finance (Krokhmal et al., 2002; Tamar et al., 2012).
|
| 32 |
+
|
| 33 |
+
The main approaches to solving such problems are (i) Lagrange multipliers (Borkar, 2005; Bhatnagar and Lakshmanan, 2012), (ii) Trust Region (Achiam et al., 2017), (iii) integrating prior knowledge (Dalal et al., 2018) and (iv) manual selection of the penalty coefficient (Tamar and Mannor, 2013; Levine and Koltun, 2013; Peng et al., 2018).
|
| 34 |
+
|
| 35 |
+
Novelty: The novelty of our work lies in the ability to tackle (1) general constraints (both discounted sum and mean value constraints), not only constraints which satisfy the recursive Bellman equation (i.e, discounted sum constraints) as in previous work. The algorithm is (2) reward agnostic. That is, invariant to scaling of the underlying reward signal, and (3) does not require the use of prior knowledge. A comparison with the different approaches is provided in Table 1.
|
| 36 |
+
|
| 37 |
+
# 2 Preliminaries
|
| 38 |
+
|
| 39 |
+
# 2.1 Markov Decision Process (MDP)
|
| 40 |
+
|
| 41 |
+
A Markov Decision Processes $\mathcal { M }$ is defined by the tuple $( S , A , R , P , \mu , \gamma )$ (Sutton and Barto, 1998). Where $S$ is the set of states, $A$ the available actions, $R : S \times A \times S \mapsto \mathbb { R }$ is the reward function, $P : S \times A \times S \mapsto [ 0 , 1 ]$ is the transition matrix, where $P ( s ^ { \prime } | s , a )$ is the probability of transitioning from state $s$ to $s ^ { \prime }$ assuming action $a$ was taken, $\mu : S \mapsto \lfloor 0 , 1 \rfloor$ is the initial state distribution and $\gamma \in [ 0 , 1 )$ is the discount factor for future rewards. A policy $\pi : S \mapsto \Delta _ { A }$ is a probability distribution over actions and $\pi ( a | s )$ denotes the probability of taking action $a$ at state $s$ . For each state $s$ , the value of following policy $\pi$ is denoted by:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
V _ { R } ^ { \pi } ( s ) = \mathbb { E } ^ { \pi } [ \sum _ { t } \gamma ^ { t } r ( s _ { t } , a _ { t } ) | s _ { 0 } = s ] .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
An important property of the value function is that it solves the recursive Bellman equation:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
V _ { R } ^ { \pi } ( s ) = \mathbb { E } ^ { \pi } [ r ( s , a ) + \gamma V _ { R } ^ { \pi } ( s ^ { \prime } ) | s ] \enspace .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
The goal is then to maximize the expectation of the reward-to-go, given the initial state distribution $\mu$ :
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\operatorname* { m a x } _ { \pi \in \Pi } J _ { R } ^ { \pi } \ , \mathrm { w h e r e } \quad J _ { R } ^ { \pi } = \mathbb { E } _ { s \sim \mu } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } ] = \sum _ { s \in S } \mu ( s ) V _ { R } ^ { \pi } ( s ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
# 2.2 Constrained MDPs
|
| 60 |
+
|
| 61 |
+
A Constrained Markov Decision Process (CMDP) extends the MDP framework by introducing a penalty $c ( s , a )$ , a constraint $C ( s _ { t } ) = F ( c ( s _ { t } , a _ { t } ) , . . . , c ( s _ { N } , a _ { N } ) )$ and a threshold $\alpha \in \lfloor 0 , 1 \rfloor$ . A constraint may be a discounted sum (similar to the reward-to-go), the average sum and more (see Altman (1999) for additional examples). Throughout the paper we will refer to the collection of these constraints as general constraints.
|
| 62 |
+
|
| 63 |
+
We denote the expectation over the constraint by:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
J _ { C } ^ { \pi } = \mathbb { E } _ { s \sim \mu } ^ { \pi } [ C ( s ) ] \mathrm { ~ } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The problem thus becomes:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\operatorname* { m a x } _ { \pi \in \Pi } J _ { R } ^ { \pi } , { \bf s . t . } J _ { C } ^ { \pi } \leq \alpha .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
# 2.3 Parametrized Policies
|
| 76 |
+
|
| 77 |
+
In this work we consider parametrized policies, such as neural networks. The parameters of the policy are denoted by $\theta$ and a parametrized policy as $\pi _ { \theta }$ . We make the following assumptions in order to ensure convergence to a constraint satisfying policy:
|
| 78 |
+
|
| 79 |
+
Assumption 1. The value $V _ { R } ^ { \pi } ( s )$ is bounded for all policies $\pi \in \operatorname { I I }$ .
|
| 80 |
+
|
| 81 |
+
Assumption 2. Every local minima of ${ \cal J } _ { C } ^ { n _ { \theta } }$ is a feasible solution.
|
| 82 |
+
|
| 83 |
+
Assumption 2 is the minimal requirement in order to ensure convergence, given a general constraint, of a gradient algorithm to a feasible solution. Stricter assumptions, such as convexity, may ensure convergence to the optimal solution; however, in practice constraints are non-convex and such assumptions do not hold.
|
| 84 |
+
|
| 85 |
+
# 3 Constrained Policy Optimization
|
| 86 |
+
|
| 87 |
+
Constrained MDP’s are often solved using the Lagrange relaxation technique (Bertesekas, 1999). In Lagrange relaxation, the CMDP is converted into an equivalent unconstrained problem. In addition to the objective, a penalty term is added for infeasibility, thus making infeasible solutions sub-optimal. Given a CMDP (3), the unconstrained problem is
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\operatorname* { m i n } _ { \lambda \ge 0 } \operatorname* { m a x } _ { \theta } L ( \lambda , \theta ) = \operatorname* { m i n } _ { \lambda \ge 0 } \operatorname* { m a x } _ { \theta } \left[ J _ { R } ^ { \pi _ { \theta } } - \lambda \cdot ( J _ { C } ^ { \pi _ { \theta } } - \alpha ) \right] ~ ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $L$ is the Lagrangian and $\lambda \geq 0$ is the Lagrange multiplier (a penalty coefficient). Notice, as $\lambda$ increases, the solution to (4) converges to that of (3). This suggests a twotimescale approach: on the faster timescale, $\theta$ is found by solving (4), while on the slower timescale, $\lambda$ is increased until the constraint is satisfied. The goal is to find a saddle point $( \theta ^ { * } ( \lambda ^ { * } ) , \lambda ^ { * } )$ of (4), which is a feasible solution.
|
| 94 |
+
|
| 95 |
+
Definition 1. A feasible solution of the CMDP is a solution which satisfies $J _ { C } ^ { \pi } \leq \alpha$
|
| 96 |
+
|
| 97 |
+
# 3.1 Estimating the gradient
|
| 98 |
+
|
| 99 |
+
We assume there isn’t access to the MDP itself, but rather samples are obtained via simulation. The simulation based algorithm for the constrained optimization problem (3) is:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\lambda _ { k + 1 } = \Gamma _ { \lambda } [ \lambda _ { k } - \eta _ { 1 } ( k ) \nabla _ { \lambda } L ( \lambda _ { k } , \theta _ { k } ) ] \mathrm { ~ , ~ }
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\theta _ { k + 1 } = \Gamma _ { \theta } [ \theta _ { k } + \eta _ { 2 } ( k ) \nabla _ { \theta } L ( \lambda _ { k } , \theta _ { k } ) ] \mathrm { ~ , ~ }
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\Gamma _ { \theta }$ is a projection operator, which keeps the iterate $\theta _ { k }$ stable by projecting onto a compact and convex set. $\Gamma _ { \lambda }$ projects $\lambda$ into the range $\lbrack 0 , \lambda _ { \mathrm { m a x } } { } ^ { 4 } ]$ . $\nabla _ { \boldsymbol { \theta } } L$ and $\nabla _ { \lambda } L$ are derived from (4), where the formulation for $\nabla _ { \boldsymbol { \theta } } L$ is derivied using the log-likelihood trick (Williams, 1992):
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r l } & { \nabla _ { \theta } L ( \lambda , \theta ) = \nabla _ { \theta } \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta } } \left[ \log \pi ( s , a ; \theta ) \left[ R ( s ) - \lambda \cdot C ( s ) \right] \right] \ , } \\ & { \nabla _ { \lambda } L ( \lambda , \theta ) = - ( \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta } } [ C ( s ) ] - \alpha ) \ , } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
$\eta _ { 1 } ( k ) , \eta _ { 2 } ( k )$ are step-sizes which ensure that the policy update is performed on a faster timescale than that of the penalty coefficient $\lambda$ .
|
| 116 |
+
|
| 117 |
+
# Assumption 3.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\sum _ { k = 0 } ^ { \infty } \eta _ { 1 } ( k ) = \sum _ { k = 0 } ^ { \infty } \eta _ { 2 } ( k ) = \infty , \sum _ { k = 0 } ^ { \infty } \left( \eta _ { 1 } ( k ) ^ { 2 } + \eta _ { 2 } ( k ) ^ { 2 } \right) < \infty a n d \frac { \eta _ { 1 } ( k ) } { \eta _ { 2 } ( k ) } \to 0 .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Theorem 1. Under Assumption 3, as well as the standard stability assumption for the iterates and bounded noise (Borkar et al., 2008), the iterates $( \theta _ { n } , \lambda _ { n } )$ converge to a fixed point (a local minima) almost surely.
|
| 124 |
+
|
| 125 |
+
Lemma 1. Under assumptions 1 and 2, the fixed point of Theorem 1 is a feasible solution.
|
| 126 |
+
|
| 127 |
+
The proof to Theorem 1 is provided in Appendix C and to Lemma 1 in Appendix D.
|
| 128 |
+
|
| 129 |
+
# 4 Reward Constrained Policy Optimization
|
| 130 |
+
|
| 131 |
+
# 4.1 Actor Critic Requirements
|
| 132 |
+
|
| 133 |
+
Recently there has been a rise in the use of Actor-Critic based approaches, for example: A3C (Mnih et al., 2016), TRPO (Schulman et al., 2015a) and PPO (Schulman et al., 2017). The actor learns a policy $\pi$ , whereas the critic learns the value (using temporal-difference learning - the recursive Bellman equation). While the original use of the critic was for variance reduction, it also enables training using a finite number of samples (as opposed to Monte-Carlo sampling).
|
| 134 |
+
|
| 135 |
+
Our goal is to tackle general constraints (Section 2.2), as such, they are not ensured to satisfy the recursive property required to train a critic.
|
| 136 |
+
|
| 137 |
+
# 4.2 Penalized reward functions
|
| 138 |
+
|
| 139 |
+
We overcome this issue by training the actor (and critic) using an alternative, guiding, penalty - the discounted penalty. The appropriate assumptions under which the process converges to a feasible solution are provided in Theorem 2. It is important to note that; in order to ensure constraint satisfaction, $\lambda$ is still optimized using Monte-Carlo sampling on the original constraint (8).
|
| 140 |
+
|
| 141 |
+
Definition 2. The value of the discounted (guiding) penalty is defined as:
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
V _ { C _ { \gamma } } ^ { \pi } ( s ) \triangleq \mathbb { E } ^ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } c ( s _ { t } , a _ { t } ) | s _ { 0 } = s \right] \mathrm { ~ . ~ }
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
Definition 3. The penalized reward functions are defined as:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { r l } & { \hat { r } ( \lambda , s , a ) \triangleq r ( s , a ) - \lambda c ( s , a ) , } \\ & { \hat { V } ^ { \pi } ( \lambda , s ) \triangleq \mathbb { E } ^ { \pi } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \hat { r } ( \lambda , s _ { t } , a _ { t } ) | s _ { 0 } = s \right] } \\ & { \quad \quad = \mathbb { E } ^ { \pi } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( r ( s _ { t } , a _ { t } ) - \lambda c ( s _ { t } , a _ { t } ) \right) | s _ { 0 } = s \right] = V _ { R } ^ { \pi } ( s ) - \lambda V _ { C _ { \gamma } } ^ { \pi } ( s ) . } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
As opposed to (4), for a fixed $\pi$ and $\lambda$ , the penalized value (11) can be estimated using TD-learning critic. We denote a three-timescale (Constrained Actor Critic) process, in which the actor and critic are updated following (11) and $\lambda$ is updated following (5), as the ‘Reward Constrained Policy Optimization’ (RCPO) algorithm. Algorithm 1 illustrates such a procedure and a full RCPO Advantage-Actor-Critic algorithm is provided in Appendix A.
|
| 154 |
+
|
| 155 |
+
# Algorithm 1 Template for an RCPO implementation
|
| 156 |
+
|
| 157 |
+
1: Input: penalty $c ( \cdot )$ , constraint $C ( \cdot )$ , threshold $\alpha$ , learning rates $\eta _ { 1 } ( k ) < \eta _ { 2 } ( k ) < \eta _ { 3 } ( k )$
|
| 158 |
+
2: Initialize actor parameters $\theta = \theta _ { 0 }$ , critic parameters $\mathit { v } = \mathit { v } _ { 0 }$ , Lagrange multipliers and
|
| 159 |
+
$\lambda = 0$
|
| 160 |
+
3: for $k = 0 , 1 , \ldots$ do
|
| 161 |
+
4: Initialize state $s _ { 0 } \sim \mu$
|
| 162 |
+
5: for $t = 0 , 1 , . . . , T - 1$ do
|
| 163 |
+
6: Sample action $a _ { t } \sim \pi$ , observe next state $s _ { t + 1 }$ , reward $r _ { t }$ and penalties $c _ { t }$
|
| 164 |
+
7: $\hat { R } _ { t } = r _ { t } - \lambda _ { k } c _ { t } + \gamma \hat { V } ( \lambda , s _ { t } ; v _ { k } )$ . Equation 10
|
| 165 |
+
8: Critic update: $v _ { k + 1 } v _ { k } - \eta _ { 3 } ( k ) [ \partial ( \hat { R } _ { t } - \hat { V } ( \lambda , s _ { t } ; v _ { k } ) ) ^ { 2 } / \partial v _ { k } ]$ . Equation 11
|
| 166 |
+
9: Actor update: $\theta _ { k + 1 } \Gamma _ { \theta } [ \theta _ { k } + \eta _ { 2 } ( k ) \nabla _ { \theta } \hat { V } ( \lambda , s ) ]$ . Equation 6
|
| 167 |
+
10: Lagrange multiplier update: $\lambda _ { k + 1 } \Gamma _ { \lambda } [ \lambda _ { k } + \eta _ { 1 } ( k ) ( J _ { C } ^ { \pi _ { \theta } } - \alpha ) ]$ . Equation 8
|
| 168 |
+
11: return policy parameters $\theta$
|
| 169 |
+
|
| 170 |
+
Theorem 2. Denote by $\Theta = \{ \theta : J _ { C } ^ { \pi _ { \theta } } \leq \alpha \}$ the set of feasible solutions and the set of localminimas of $J _ { C _ { \gamma } } ^ { \pi _ { \theta } }$ as $\Theta _ { \gamma }$ . Assuming that $\Theta _ { \gamma } \subseteq \Theta$ then the ‘Reward Constrained Policy Optimization’ (RCPO) algorithm converges almost surely to $a$ fixed point $( \theta ^ { * } ( \lambda ^ { * } , v ^ { * } ) , v ^ { * } ( \lambda ^ { * } ) , \lambda ^ { * } )$ which is a feasible solution (e.g. $\theta ^ { \ast } \in \Theta$ ).
|
| 171 |
+
|
| 172 |
+
The proof to Theorem 2 is provided in Appendix E.
|
| 173 |
+
|
| 174 |
+
The assumption in Theorem 2 demands a specific correlation between the guiding penalty signal $C _ { \gamma }$ and the constraint $C$ . Consider a robot with an average torque constraint. A policy which uses $0$ torque at each time-step is a feasible solution and in turn is a local minimum of both $J _ { C }$ and $J _ { C _ { \gamma } }$ . If such a policy is reachable from any $\theta$ (via gradient descent), this is enough in order to provide a theoretical guarantee such that $J _ { C _ { \gamma } }$ may be used as a guiding signal in order to converge to a fixed-point, which is a feasible solution.
|
| 175 |
+
|
| 176 |
+
# 5 Experiments
|
| 177 |
+
|
| 178 |
+
We test the RCPO algorithm in various domains: a grid-world, and 6 tasks in the Mujoco simulator (Todorov et al., 2012). The grid-world serves as an experiment to show the benefits of RCPO over the standard Primal-Dual approach (solving (4) using Monte-Carlo simulations), whereas in the Mujoco domains we compare RCPO to reward shaping, a simpler (yet common) approach, and show the benefits of an adaptive approach to defining the cost value.
|
| 179 |
+
|
| 180 |
+
While we consider mean value constraints (robotics experiments) and probabilistic constraints (i.e., Mars rover), discounted sum constraints can be immediately incorporated into our setup. We compare our approach with relevant baselines that can support these constraints. Discounted sum approaches such as Achiam et al. (2017) and per-state constraints such as Dalal et al. (2018) are unsuitable for comparison given the considered constraints. See Table 1 for more details.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 1: Mars Rover domain and policy illustration. As $\alpha$ decreases, the agent is required to learn a safer policy.
|
| 186 |
+
Figure 2: RCPO vs Lagrange comparison. The reward is $( - )$ the average number of steps it takes to reach the goal. Results are considered valid if and only if they are at or below the threshold.
|
| 187 |
+
|
| 188 |
+
For clarity, we provide exact details in Appendix B (architecture and simulation specifics).
|
| 189 |
+
|
| 190 |
+
# 5.1 Mars Rover
|
| 191 |
+
|
| 192 |
+
# 5.1.1 Domain Description
|
| 193 |
+
|
| 194 |
+
The rover (red square) starts at the top left, a safe region of the grid, and is required to travel to the goal (orange square) which is located in the top right corner. The transition function is stochastic, the rover will move in the selected direction with probability $1 - \delta$ and randomly otherwise. On each step, the agent receives a small negative reward $r _ { \mathrm { s t e p } }$ and upon reaching the goal state a reward $r _ { \mathrm { g o a l } }$ . Crashing into a rock (yellow) causes the episode to terminate and provides a negative reward $- \lambda$ . The domain is inspired by the Mars Rover domain presented in Chow et al. (2015). It is important to note that the domain is built such that a shorter path induces higher risk (more rocks along the path). Given a minimal failure threshold ( $\alpha \in ( 0 , 1 )$ ), the task is to find $\lambda$ , such that when solving for parameters $\delta , r _ { \mathrm { s t e p } } , r _ { \mathrm { g o a l } }$ and $\lambda$ , the policy will induce a path with $\mathbb { P } _ { \mu } ^ { \pi _ { \theta } }$ (failure) $\leq \alpha$ ; e.g., find the shortest path while ensuring that the probability of failure is less or equal to $\alpha$ .
|
| 195 |
+
|
| 196 |
+
# 5.1.2 Experiment Description
|
| 197 |
+
|
| 198 |
+
As this domain is characterized by a discrete action space, we solve it using the A2C algorithm (a synchronous version of A3C (Mnih et al., 2016)). We compare RCPO, using the discounted penalty $C _ { \gamma }$ , with direct optimization of the Lagrange dual form (4).
|
| 199 |
+
|
| 200 |
+
# 5.1.3 Experiment Analysis
|
| 201 |
+
|
| 202 |
+
Figure 1 illustrates the domain and the policies the agent has learned based on different safety requirements. Learning curves are provided in Figure 2. The experiments show that,
|
| 203 |
+
|
| 204 |
+
Table 2: Comparison between RCPO and reward shaping with a torque constraint $< 2 5 \%$ .
|
| 205 |
+
|
| 206 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Swimmer-v2</td><td rowspan=1 colspan=2>Walker2d-v2</td><td rowspan=1 colspan=2>Hopper-v2</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td></tr><tr><td rowspan=1 colspan=1>入=0</td><td rowspan=1 colspan=1>30.4%</td><td rowspan=1 colspan=1>94.4</td><td rowspan=1 colspan=1>24.6%</td><td rowspan=1 colspan=1>3364.1</td><td rowspan=1 colspan=1>31.5%</td><td rowspan=1 colspan=1>2610.7</td></tr><tr><td rowspan=1 colspan=1>入= 0.00001</td><td rowspan=1 colspan=1>37.4%</td><td rowspan=1 colspan=1>65.1</td><td rowspan=1 colspan=1>28.4%</td><td rowspan=1 colspan=1>3198.9</td><td rowspan=1 colspan=1>31.4%</td><td rowspan=1 colspan=1>1768.2</td></tr><tr><td rowspan=1 colspan=1>入=0.1</td><td rowspan=1 colspan=1>32.8%</td><td rowspan=1 colspan=1>16.5</td><td rowspan=1 colspan=1>13.6%</td><td rowspan=1 colspan=1>823.5</td><td rowspan=1 colspan=1>15.7%</td><td rowspan=1 colspan=1>865.95</td></tr><tr><td rowspan=1 colspan=1>入=100</td><td rowspan=1 colspan=1>2.4%</td><td rowspan=1 colspan=1>11.7</td><td rowspan=1 colspan=1>17.8%</td><td rowspan=1 colspan=1>266.1</td><td rowspan=1 colspan=1>14.3%</td><td rowspan=1 colspan=1>329.4</td></tr><tr><td rowspan=1 colspan=1>RCPO (ours)</td><td rowspan=1 colspan=1>24%</td><td rowspan=1 colspan=1>72.7</td><td rowspan=1 colspan=1>25.2%</td><td rowspan=1 colspan=1>591.6</td><td rowspan=1 colspan=1>26%</td><td rowspan=1 colspan=1>1138.55</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Humanoid-v2</td><td rowspan=1 colspan=2>HalfCheetah-v2</td><td rowspan=1 colspan=2>Ant-v2</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td><td rowspan=1 colspan=1>Torque</td><td rowspan=1 colspan=1>Reward</td></tr><tr><td rowspan=1 colspan=1>入=0</td><td rowspan=1 colspan=1>28.6%</td><td rowspan=1 colspan=1>617.1</td><td rowspan=1 colspan=1>37.8%</td><td rowspan=1 colspan=1>2989.5</td><td rowspan=1 colspan=1>36.7%</td><td rowspan=1 colspan=1>1313.1</td></tr><tr><td rowspan=1 colspan=1>入=0.00001</td><td rowspan=1 colspan=1>28.1%</td><td rowspan=1 colspan=1>617.1</td><td rowspan=1 colspan=1>40.8%</td><td rowspan=1 colspan=1>2462.3</td><td rowspan=1 colspan=1>35.9%</td><td rowspan=1 colspan=1>1233.5</td></tr><tr><td rowspan=1 colspan=1>入=0.1</td><td rowspan=1 colspan=1>28.5%</td><td rowspan=1 colspan=1>1151.8</td><td rowspan=1 colspan=1>13.87%</td><td rowspan=1 colspan=1>-0.4</td><td rowspan=1 colspan=1>16.6%</td><td rowspan=1 colspan=1>1012.2</td></tr><tr><td rowspan=1 colspan=1>入=100</td><td rowspan=1 colspan=1>30.5%</td><td rowspan=1 colspan=1>119.4</td><td rowspan=1 colspan=1>13.9%</td><td rowspan=1 colspan=1>-2.4</td><td rowspan=1 colspan=1>16.7%</td><td rowspan=1 colspan=1>957.2</td></tr><tr><td rowspan=1 colspan=1>RCPO (ours)</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>606.1</td><td rowspan=1 colspan=1>26.7%</td><td rowspan=1 colspan=1>1547.1</td><td rowspan=1 colspan=1>15.2%</td><td rowspan=1 colspan=1>1031.5</td></tr></table>
|
| 207 |
+
|
| 208 |
+
for both scenarios $\alpha = 0 . 0 1$ and $\alpha = 0 . 5$ , RCPO is characterized by faster convergence (improved sample efficiency) and lower variance (a stabler learning regime).
|
| 209 |
+
|
| 210 |
+
# 5.2 Robotics
|
| 211 |
+
|
| 212 |
+
# 5.2.1 Domain Description
|
| 213 |
+
|
| 214 |
+
Todorov et al. (2012); Brockman et al. (2016) and OpenAI (2017) provide interfaces for training agents in complex control problems. These tasks attempt to imitate scenarios encountered by robots in real life, tasks such as teaching a humanoid robot to stand up, walk, and more. The robot is composed of $n$ joints; the state $S \in \mathbb { R } ^ { n \times 5 }$ is composed of the coordinates $( x , y , z )$ and angular velocity $( \omega _ { \theta } , \omega _ { \phi } )$ of each joint. At each step the agent selects the amount of torque to apply to each joint. We chose to use PPO (Schulman et al., 2017) in order to cope with the continuous action space.
|
| 215 |
+
|
| 216 |
+
# 5.2.2 Experiment Description
|
| 217 |
+
|
| 218 |
+
In the following experiments; the aim is to prolong the motor life of the various robots, while still enabling the robot to perform the task at hand. To do so, the robot motors need to be constrained from using high torque values. This is accomplished by defining the constraint $C$ as the average torque the agent has applied to each motor, and the per-state penalty $c ( s , a )$ becomes the amount of torque the agent decided to apply at each time step. We compare RCPO to the reward shaping approach, in which the different values of $\lambda$ are selected apriori and remain constant.
|
| 219 |
+
|
| 220 |
+
# 5.2.3 Experiment Analysis
|
| 221 |
+
|
| 222 |
+
Learning curves are provided in Figure 3 and the final values in Table 2. It is important to note that by preventing the agent from using high torque levels (limit the space of admissible policies), the agent may only be able to achieve a sub-optimal policy. RCPO aims to find the best performing policy given the constraints; that is, the policy that achieves maximal value while at the same time satisfying the constraints. Our experiments show that:
|
| 223 |
+
|
| 224 |
+
1. In all domains, RCPO finds a feasible (or near feasible) solution, and, besides the Walker2d-v2 domain, exhibits superior performance when compared to the relevant reward shaping variants (constant $\lambda$ values resulting in constraint satisfaction).
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 3: Mujoco with torque constraints. The dashed line represents the maximal allowed value. Results are considered valid only if they are at or below the threshold. RCPO is our approach, whereas each $\lambda$ value is a PPO simulation with a fixed penalty coefficient. Y axis is the average reward and the X axis represents the number of samples (steps).
|
| 228 |
+
|
| 229 |
+
2. Selecting a constant coefficient $\lambda$ such that the policy satisfies the constraint is not a trivial task, resulting in different results across domains (Achiam et al., 2017).
|
| 230 |
+
|
| 231 |
+
# 5.2.4 The Drawbacks of Reward Shaping
|
| 232 |
+
|
| 233 |
+
When performing reward shaping (selecting a fixed $\lambda$ value), the experiments show that in domains where the agent attains a high value, the penalty coefficient is required to be larger in order for the solution to satisfy the constraints. However, in domains where the agent attains a relatively low value, the same penalty coefficients can lead to drastically different behavior - often with severely sub-optimal solutions (e.g. Ant-v2 compared to Swimmer-v2).
|
| 234 |
+
|
| 235 |
+
Additionally, in RL, the value ( $J _ { R } ^ { \pi }$ ) increases as training progresses, this suggests that a non-adaptive approach is prone to converge to sub-optimal solutions; when the penalty is large, it is plausible that at the beginning of training the agent will only focus on constraint satisfaction and ignore the underlying reward signal, quickly converging to a local minima.
|
| 236 |
+
|
| 237 |
+
# 6 Discussion
|
| 238 |
+
|
| 239 |
+
We introduced a novel constrained actor-critic approach, named ‘Reward Constrained Policy Optimization’ (RCPO). RCPO uses a multi-timescale approach; on the fast timescale an alternative, discounted, objective is estimated using a TD-critic; on the intermediate timescale the policy is learned using policy gradient methods; and on the slow timescale the penalty coefficient $\lambda$ is learned by ascending on the original constraint. We validate our approach using simulations on both grid-world and robotics domains and show that RCPO converges in a stable and sample efficient manner to a constraint satisfying policy.
|
| 240 |
+
|
| 241 |
+
An exciting extension of this work is the combination of RCPO with CPO (Achiam et al., 2017). As they consider the discounted penalty, our guiding signal, it might be possible to combine both approaches. Such an approach will be able to solve complex constraints while enjoying feasibility guarantees during training.
|
| 242 |
+
|
| 243 |
+
# 7 Acknowledgements
|
| 244 |
+
|
| 245 |
+
The authors would like to thank Nadav Merlis for the insightful discussions and helpful remarks during the writing process.
|
| 246 |
+
|
| 247 |
+
# References
|
| 248 |
+
|
| 249 |
+
Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. arXiv preprint arXiv:1705.10528, 2017.
|
| 250 |
+
|
| 251 |
+
Eitan Altman. Constrained Markov decision processes, volume 7. CRC Press, 1999.
|
| 252 |
+
|
| 253 |
+
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), 47: 253–279, 2013.
|
| 254 |
+
|
| 255 |
+
D Bertesekas. Nonlinear programming. athena scientific. Belmont, Massachusetts, 1999.
|
| 256 |
+
|
| 257 |
+
Shalabh Bhatnagar and K Lakshmanan. An online actor–critic algorithm with function approximation for constrained markov decision processes. Journal of Optimization Theory and Applications, 153(3):688–708, 2012.
|
| 258 |
+
|
| 259 |
+
Vivek S Borkar. An actor-critic algorithm for constrained markov decision processes. Systems & control letters, 54(3):207–213, 2005.
|
| 260 |
+
|
| 261 |
+
Vivek S Borkar et al. Stochastic approximation. Cambridge Books, 2008.
|
| 262 |
+
|
| 263 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 264 |
+
|
| 265 |
+
Yinlam Chow, Aviv Tamar, Shie Mannor, and Marco Pavone. Risk-sensitive and robust decision-making: a cvar optimization approach. In Advances in Neural Information Processing Systems, pages 1522–1530, 2015.
|
| 266 |
+
|
| 267 |
+
Gal Dalal, Krishnamurthy Dvijotham, Matej Vecerik, Todd Hester, Cosmin Paduraru, and Yuval Tassa. Safe exploration in continuous action spaces. arXiv preprint arXiv:1801.08757, 2018.
|
| 268 |
+
|
| 269 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pages 3389–3396. IEEE, 2017.
|
| 270 |
+
|
| 271 |
+
Chen Hou and Qianchuan Zhao. Optimization of web service-based control system for balance between network traffic and delay. IEEE Transactions on Automation Science and Engineering, 2017.
|
| 272 |
+
|
| 273 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pages 267–274, 2002.
|
| 274 |
+
|
| 275 |
+
Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github.com/ikostrikov/pytorch-a2c-ppo-acktr, 2018.
|
| 276 |
+
|
| 277 |
+
Iordanis Koutsopoulos and Leandros Tassiulas. Control and optimization meet the smart power grid: Scheduling of power demands for optimal energy management. In Proceedings of the 2nd International Conference on Energy-efficient Computing and Networking, pages 41–50. ACM, 2011.
|
| 278 |
+
|
| 279 |
+
Pavlo Krokhmal, Jonas Palmquist, and Stanislav Uryasev. Portfolio optimization with conditional value-at-risk objective and constraints. Journal of risk, 4:43–68, 2002.
|
| 280 |
+
|
| 281 |
+
Jason D Lee, Ioannis Panageas, Georgios Piliouras, Max Simchowitz, Michael I Jordan, and Benjamin Recht. First-order methods almost always avoid saddle points. arXiv preprint arXiv:1710.07406, 2017.
|
| 282 |
+
|
| 283 |
+
Jan Leike, Miljan Martic, Victoria Krakovna, Pedro A Ortega, Tom Everitt, Andrew Lefrancq, Laurent Orseau, and Shane Legg. Ai safety gridworlds. arXiv preprint arXiv:1711.09883, 2017.
|
| 284 |
+
|
| 285 |
+
Sergey Levine and Vladlen Koltun. Guided policy search. In International Conference on Machine Learning, pages 1–9, 2013.
|
| 286 |
+
|
| 287 |
+
Horia Mania, Aurelia Guy, and Benjamin Recht. Simple random search provides a competitive approach to reinforcement learning. arXiv preprint arXiv:1803.07055, 2018.
|
| 288 |
+
|
| 289 |
+
Shie Mannor and Nahum Shimkin. A geometric approach to multi-criterion reinforcement learning. Journal of machine learning research, 5(Apr):325–360, 2004.
|
| 290 |
+
|
| 291 |
+
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, 2015.
|
| 292 |
+
|
| 293 |
+
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, pages 1928–1937, 2016.
|
| 294 |
+
|
| 295 |
+
OpenAI. Roboschool. https://github.com/openai/roboschool, 2017.
|
| 296 |
+
|
| 297 |
+
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. In NIPS-W, 2017.
|
| 298 |
+
|
| 299 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Example-guided deep reinforcement learning of physics-based character skills. arXiv preprint arXiv:1804.02717, 2018.
|
| 300 |
+
|
| 301 |
+
LA Prashanth and Mohammad Ghavamzadeh. Variance-constrained actor-critic algorithms for discounted and average reward mdps. Machine Learning, 105(3):367–417, 2016.
|
| 302 |
+
|
| 303 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pages 1889–1897, 2015a.
|
| 304 |
+
|
| 305 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 306 |
+
|
| 307 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 308 |
+
|
| 309 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
|
| 310 |
+
|
| 311 |
+
Aviv Tamar and Shie Mannor. Variance adjusted actor critic algorithms. arXiv preprint arXiv:1310.3697, 2013.
|
| 312 |
+
|
| 313 |
+
Aviv Tamar, Dotan Di Castro, and Shie Mannor. Policy gradients with variance related risk criteria. In Proceedings of the twenty-ninth international conference on machine learning, pages 387–396, 2012.
|
| 314 |
+
|
| 315 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for modelbased control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pages 5026–5033. IEEE, 2012.
|
| 316 |
+
|
| 317 |
+
Kristof Van Moffaert and Ann Now´e. Multi-objective reinforcement learning using sets of pareto dominating policies. The Journal of Machine Learning Research, 15(1):3483–3512, 2014.
|
| 318 |
+
|
| 319 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. In Reinforcement Learning, pages 5–32. Springer, 1992.
|
| 320 |
+
|
| 321 |
+
# A RCPO Algorithm
|
| 322 |
+
|
| 323 |
+
# Algorithm 2 RCPO Advantage Actor Critic
|
| 324 |
+
|
| 325 |
+
The original Advantage Actor Critic algorithm is in gray, whereas our additions are highlighted in
|
| 326 |
+
black.
|
| 327 |
+
1: Input: penalty function $C ( \cdot )$ , threshold $\alpha$ and learning rates $\eta _ { 1 } , \eta _ { 2 } , \eta _ { 3 }$
|
| 328 |
+
2: Initialize actor $\pi ( \cdot | \cdot ; \theta _ { p } )$ and critic $V ( \cdot ; \theta _ { v } )$ with random weights
|
| 329 |
+
3: Initialize $\lambda = 0$ , $t = 0$ , $s _ { 0 } \sim \mu$ . Restart
|
| 330 |
+
4: for $T = 1 , 2 , . . . , T _ { m a x }$ do
|
| 331 |
+
5: Reset gradients $d \theta _ { v } \gets 0$ , $d \theta _ { p } \gets 0$ and $\forall i : d \lambda _ { i } \gets 0$
|
| 332 |
+
6: $t _ { s t a r t } = t$
|
| 333 |
+
7: while $s _ { t }$ not terminal and $t - t _ { s t a r t } < t _ { m a x }$ do
|
| 334 |
+
8: Perform $a _ { t }$ according to policy $\pi ( a _ { t } | s _ { t } ; \theta _ { p } )$
|
| 335 |
+
9: Receive $r _ { t }$ , $s _ { t + 1 }$ and penalty score $\hat { C } _ { t }$
|
| 336 |
+
11: 10: $\begin{array} { r l } & { \qquad t t + 1 } \\ & { R = \{ 0 \qquad \mathrm { , ~ f o r ~ t e r m i n a l ~ } s _ { t } } \\ & { \qquad \ V ( s _ { t } , \theta _ { v } ) \quad , \ \mathrm { o t h e r w i s e } } \\ & { \qquad \mathbf { f o r } \ \tau = t - 1 , t - 2 , . . . , t _ { s t a r t } \ \mathbf { d o } } \\ & { \qquad R r _ { \tau } - \lambda \cdot \hat { C } _ { \tau } + \gamma R } \\ & { \qquad d \theta _ { p } \ e - d \theta _ { p } + \nabla _ { \theta _ { p } } \log \pi ( a _ { \tau } | s _ { \tau } ; \theta _ { p } ) ( R - V ( s _ { \tau } ; \theta _ { v } ) ) } \\ & { \qquad d \theta _ { v } \ \gets d \theta _ { v } + \partial ( R - V ( s _ { \tau } ; \theta _ { v } ) ) ^ { 2 } / \partial \theta _ { v } } \end{array}$ $t \gets t + 1$
|
| 337 |
+
12:
|
| 338 |
+
13: . Equation 10
|
| 339 |
+
14:
|
| 340 |
+
15:
|
| 341 |
+
16: if $s _ { t }$ is terminal state then
|
| 342 |
+
17: 18: $\begin{array} { l } { d \lambda - ( C - \alpha ) } \\ { t 0 } \\ { s _ { 0 } \sim \mu } \end{array}$ . Equation 8
|
| 343 |
+
19:
|
| 344 |
+
20: Update θv, $\theta _ { p }$ and $\lambda$
|
| 345 |
+
21: Set $\lambda = \operatorname* { m a x } ( \lambda , 0 )$ . Ensure weights are non-negative (Equation 4)
|
| 346 |
+
|
| 347 |
+
# B Experiment details
|
| 348 |
+
|
| 349 |
+
# B.1 Mars Rover
|
| 350 |
+
|
| 351 |
+
The MDP was defined as follows:
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
r _ { \mathrm { s t e p } } = - 0 . 0 1 , ~ r _ { \mathrm { g o a l } } = 0 , ~ \delta = 0 . 0 5 , ~ \gamma = 0 . 9 9 ~ .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
In order to avoid the issue of exploration in this domain, we employ a linearly decaying random restart (Kakade and Langford, 2002). $\mu$ , the initial state distribution, follows the following rule:
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\mu = \left\{ { \begin{array} { l l l } { u n i f o r m ( s \in S ) } & { { \mathrm { w . p . ~ } } { \frac { 1 } { \# i t e r a t i o n } } } \\ { s ^ { * } } & { e l s e } \end{array} } \right.
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
where $S$ denotes all the non-terminal states in the state space and $s ^ { * }$ is the state at the top left corner (red in Figure 1). Initially the agent starts at a random state, effectively improving the exploration and reducing convergence time. As training progresses, with increasing probability, the agent starts at the top left corner, the state which we test against.
|
| 364 |
+
|
| 365 |
+
The A2C architecture is the standard non-recurrent architecture, where the actor and critic share the internal representation and only hold a separate final projection layer. The input is fully-observable, being the whole grid. The network is as follows:
|
| 366 |
+
|
| 367 |
+
<table><tr><td rowspan=1 colspan=1>Layer</td><td rowspan=1 colspan=1>Actor</td><td rowspan=1 colspan=1>Critic</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=2>CNN (input layers = 1, output layers = 16, kernel size = 5, stride = 3)</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=2>CNN (input layers = 16, output layers = 32, kernel size = 3, stride = 2)</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=2>CNN (input layers = 32, output layers = 32, kernel size = 2, stride = 1)</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>Linear(input = 288,output = 64)</td><td rowspan=1 colspan=1>Linear(input = 288, output = 64)</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>Linear(input = 64, output = 4)</td><td rowspan=1 colspan=1>Linear(input = 64, output = 1)</td></tr><tr><td rowspan=1 colspan=1>LR</td><td rowspan=1 colspan=1>1e-3</td><td rowspan=1 colspan=1>5e-4</td></tr></table>
|
| 368 |
+
|
| 369 |
+
between the layers we apply a ReLU non-linearity.
|
| 370 |
+
|
| 371 |
+
As performance is noisy on such risk-sensitive environments, we evaluated the agent every 5120 episodes for a length of 1024 episodes. To reduce the initial convergence time, we start $\lambda$ at 0.6 and use a learning rate $l r _ { \lambda } = 0 . 0 0 0 0 2 5$ .
|
| 372 |
+
|
| 373 |
+
# B.2 Robotics
|
| 374 |
+
|
| 375 |
+
For these experiments we used a PyTorch (Paszke et al., 2017) implementation of PPO (Kostrikov, 2018). Notice that as in each domain the state represents the location and velocity of each joint, the number of inputs differs between domains. The network is as follows:
|
| 376 |
+
|
| 377 |
+
<table><tr><td rowspan=1 colspan=1>Layer</td><td rowspan=1 colspan=1>Actor</td><td rowspan=1 colspan=1>Critic</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>Linear(input = x, output = 64)</td><td rowspan=1 colspan=1>Linear(input = x, output = 64)</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>Linear(input = 64,output = 64)</td><td rowspan=1 colspan=1>Linear(input = 64, output = 64)</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>DiagGaussian(input = 64, output = y)</td><td rowspan=1 colspan=1>Linear(input = 64, output = 1)</td></tr><tr><td rowspan=1 colspan=1>LR</td><td rowspan=1 colspan=1>3e-4</td><td rowspan=1 colspan=1>1.5e-4</td></tr></table>
|
| 378 |
+
|
| 379 |
+
where DiagGaussian is a multivariate Gaussian distribution layer which learns a mean (as a function of the previous layers output) and std, per each motor, from which the torque is sampled. Between each layer, a Tanh non-linearity is applied.
|
| 380 |
+
|
| 381 |
+
We report the online performance of the agent and run each test for a total of 1M samples. In these domains we start $\lambda$ at $0$ and use a learning rate $l r _ { \lambda } = 5 e - 7$ which decays at a rate of $\kappa = ( 1 - 1 e - 9 )$ in order to avoid oscillations.
|
| 382 |
+
|
| 383 |
+
The simulations were run using Generalized Advantage Estimation (Schulman et al., 2015b) with coefficient $\tau = 0 . 9 5$ and discount factor $\gamma = 0 . 9 9$ .
|
| 384 |
+
|
| 385 |
+
# C Proof of Theorem 1
|
| 386 |
+
|
| 387 |
+
We provide a brief proof for clarity. We refer the reader to Chapter 6 of Borkar et al. (2008) for a full proof of convergence for two-timescale stochastic approximation processes.
|
| 388 |
+
|
| 389 |
+
Initially, we assume nothing regarding the structure of the constraint as such $\lambda _ { \mathrm { m a x } }$ is given some finite value. The special case in which Assumption 2 holds is handled in Lemma 1.
|
| 390 |
+
|
| 391 |
+
The proof of convergence to a local saddle point of the Lagrangian (4) contains the following main steps:
|
| 392 |
+
|
| 393 |
+
1. Convergence of $\theta$ -recursion: We utilize the fact that owing to projection, the $\theta$ parameter is stable. We show that the $\theta$ -recursion tracks an ODE in the asymptotic limit, for any given value of $\lambda$ on the slowest timescale.
|
| 394 |
+
2. Convergence of $\lambda$ -recursion: This step is similar to earlier analysis for constrained MDPs. In particular, we show that $\lambda$ -recursion in (4) converges and the overall convergence of $( \theta _ { k } , \lambda _ { k } )$ is to a local saddle point $\theta ^ { * } ( \lambda ^ { * } , \lambda ^ { * } )$ of $L ( \lambda , \theta )$ .
|
| 395 |
+
|
| 396 |
+
Step 1: Due to the timescale separation, we can assume that the value of $\lambda$ (updated on the slower timescale) is constant. As such it is clear that the following ODE governs the evolution of $\theta$ :
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\dot { \theta } _ { t } = \Gamma _ { \theta } \big ( \nabla _ { \theta } L ( \lambda , \theta _ { t } ) \big )
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
where $\Gamma _ { \theta }$ is a projection operator which ensures that the evolution of the ODE stays within the compact and convex set $\Theta : = \Pi _ { i = 1 } ^ { k } \left[ \theta _ { \operatorname* { m i n } } ^ { i } , \theta _ { \operatorname* { m a x } } ^ { i } \right]$ .
|
| 403 |
+
|
| 404 |
+
As $\lambda$ is considered constant, the process over $\theta$ is:
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\begin{array} { r l } & { \theta _ { k + 1 } = \Gamma _ { \theta } \bigl [ \theta _ { k } + \eta _ { 2 } ( k ) \nabla _ { \theta } L ( \lambda , \theta _ { k } ) \bigr ] } \\ & { \qquad = \Gamma _ { \theta } \bigl [ \theta _ { k } + \eta _ { 2 } ( k ) \nabla _ { \theta } \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta } } \left[ \log \pi ( s , a ; \theta ) \left[ R ( s ) - \lambda \cdot C ( s ) \right] \right] \bigr ] } \end{array}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Thus (6) can be seen as a discretization of the ODE (12). Finally, using the standard stochastic approximation arguments from Borkar et al. (2008) concludes step 1.
|
| 411 |
+
|
| 412 |
+
Step 2: We start by showing that the $\lambda$ -recursion converges and then show that the whole process converges to a local saddle point of $L ( \lambda , \theta )$ .
|
| 413 |
+
|
| 414 |
+
The process governing the evolution of $\lambda$ :
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\begin{array} { r l } & { \lambda _ { k + 1 } = \Gamma _ { \lambda } [ \lambda _ { k } - \eta _ { 1 } ( k ) \nabla _ { \lambda } L ( \lambda _ { k } , \theta ( \lambda _ { k } ) ) ] } \\ & { \qquad = \Gamma _ { \lambda } [ \lambda _ { k } + \eta _ { 1 } ( k ) ( \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta ( \lambda _ { k } ) } } [ C ( s ) ] - \alpha ) ] } \end{array}
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
where $\theta ( \lambda _ { k } )$ is the limiting point of the $\theta$ -recursion corresponding to $\lambda _ { k }$ , can be seen as the following ODE:
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\dot { \lambda } _ { t } = \Gamma _ { \lambda } ( \nabla _ { \lambda } L ( \lambda _ { t } , \theta ( \lambda _ { t } ) ) ) \mathrm { ~ . ~ }
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
As shown in Borkar et al. (2008) chapter 6, $( \lambda _ { n } , \theta _ { n } )$ converges to the internally chain transitive invariant sets of the ODE (13), $\dot { \theta } _ { t } = 0$ . Thus, $( \lambda _ { n } , \theta _ { n } ) \to \{ ( \lambda ( \theta ) , \theta ) : \theta \in \mathbb { R } ^ { k } \}$ almost surely.
|
| 427 |
+
|
| 428 |
+
Finally, as seen in Theorem 2 of Chapter 2 of Borkar et al. (2008), $\theta _ { n } \to \theta ^ { * }$ a.s. then $\lambda _ { n } \to \lambda ( \theta ^ { * } )$ a.s. which completes the proof.
|
| 429 |
+
|
| 430 |
+
# D Proof of Lemma 1
|
| 431 |
+
|
| 432 |
+
The proof is obtained by a simple extension to that of Theorem 1. Assumption 2 states that any local minima $\pi _ { \theta }$ of 2 satisfies the constraints, e.g. $J _ { C } ^ { \prime \prime } \le \alpha$ ; additionally, Lee et al. (2017) show that first order methods such as gradient descent, converge almost surely to a local minima (avoiding saddle points and local maxima). Hence for $\lambda _ { \operatorname* { m a x } } = \infty$ (unbounded Lagrange multiplier), the process converges to a fixed point $( \theta ^ { * } ( \lambda ^ { * } ) , \lambda ^ { * } )$ which is a feasible solution.
|
| 433 |
+
|
| 434 |
+
# E Proof of Theorem 2
|
| 435 |
+
|
| 436 |
+
As opposed to Theorem 1, in this case we are considering a three-timescale stochastic approximation scheme (the previous Theorem considered two-timescales). The proof is similar in essence to that of Prashanth and Ghavamzadeh (2016).
|
| 437 |
+
|
| 438 |
+
The full process is described as follows:
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\begin{array} { r l } & { \lambda _ { k + 1 } = \Gamma _ { \lambda } [ \lambda _ { k } + \eta _ { 1 } ( k ) ( \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta ( \lambda _ { k } ) } } [ C ( s ) ] - \alpha ) ] } \\ & { \theta _ { k + 1 } = \Gamma _ { \theta } [ \theta _ { k } + \eta _ { 2 } ( k ) \nabla _ { \theta } \mathbb { E } _ { s \sim \mu } ^ { \pi _ { \theta } } \left[ \log \pi ( s , a ; \theta ) \hat { V } ( \lambda , s _ { t } ; v _ { k } ) \right] ] } \\ & { v _ { k + 1 } = v _ { k } - \eta _ { 3 } ( k ) \left[ \partial ( \hat { r } + \gamma \hat { V } ( \lambda , s ^ { \prime } ; v _ { k } ) - \hat { V } ( \lambda , s ; v _ { k } ) ) ^ { 2 } / \partial v _ { k } \right] } \end{array}
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
Step 1: The value $v _ { k }$ runs on the fastest timescale, hence it observes $\theta$ and $\lambda$ as static. As the TD operator is a contraction we conclude that $v _ { k } \to v ( \lambda , \theta )$ .
|
| 445 |
+
|
| 446 |
+
Step 2: For the policy recursion $\theta _ { k }$ , due to the timescale differences, we can assume that the critic $v$ has converged and that $\lambda$ is static. Thus as seen in the proof of Theorem 1, $\theta _ { k }$ converges to the fixed point $\theta ( \lambda , v )$ .
|
| 447 |
+
|
| 448 |
+
Step 3: As shown previously (and in Prashanth and Ghavamzadeh (2016)), $( \lambda _ { n } , \theta _ { n } , v _ { n } ) $ $( \lambda ( \theta ^ { * } ) , \theta ^ { * } , v ( \theta ^ { * } ) )$ a.s.
|
| 449 |
+
|
| 450 |
+
Denoting by $\Theta = \{ \theta : J _ { C } ^ { \pi _ { \theta } } \leq \alpha \}$ the set of feasible solutions and the set of local-minimas of ${ { J } _ { { { C } _ { \gamma } } } ^ { \prime \prime } }$ as $\Theta _ { \gamma }$ . We recall the assumption stated in Theorem 2:
|
| 451 |
+
|
| 452 |
+
Assumption 4. $\Theta _ { \gamma } \subseteq \Theta$ .
|
| 453 |
+
|
| 454 |
+
Given that the assumption above holds, we may conclude that for $\lambda _ { \operatorname* { m a x } } \infty$ , the set of stationary points of the process are limited to a sub-set of feasible solutions of (4). As such the process converges a.s. to a feasible solution.
|
| 455 |
+
|
| 456 |
+
We finish by providing intuition regarding the behavior in case the assumptions do not hold.
|
| 457 |
+
|
| 458 |
+
1. Assumption 2 does not hold: As gradient descent algorithms descend until reaching a (local) stationary point. In such a scenario, the algorithm is only ensured to converge to some stationary solution, yet said solution is not necessarily a feasible one.
|
| 459 |
+
|
| 460 |
+
As such we can only treat the constraint as a regularizing term for the policy in which $\lambda _ { \mathrm { m a x } }$ defines the maximal regularization allowed.
|
| 461 |
+
|
| 462 |
+
2. Assumption 4 does not hold: In this case, it is not safe to assume that the gradient of (2) may be used as a guide for solving (3). A Monte-Carlo approach may be used (as seen in Section 5.1) to approximate the gradients, however this does not enjoy the benefits of reduced variance and smaller samples (due to the lack of a critic).
|
md/train/Sy2ogebAW/Sy2ogebAW.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED NEURAL MACHINE TRANSLATION
|
| 2 |
+
|
| 3 |
+
Mikel Artetxe, Gorka Labaka & Eneko Agirre IXA NLP Group University of the Basque Country (UPV/EHU) {mikel.artetxe,gorka.labaka,e.agirre}@ehu.eus
|
| 4 |
+
|
| 5 |
+
Kyunghyun Cho New York University CIFAR Azrieli Global Scholar kyunghyun.cho@nyu.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In spite of the recent success of neural machine translation (NMT) in standard benchmarks, the lack of large parallel corpora poses a major practical problem for many language pairs. There have been several proposals to alleviate this issue with, for instance, triangulation and semi-supervised learning techniques, but they still require a strong cross-lingual signal. In this work, we completely remove the need of parallel data and propose a novel method to train an NMT system in a completely unsupervised manner, relying on nothing but monolingual corpora. Our model builds upon the recent work on unsupervised embedding mappings, and consists of a slightly modified attentional encoder-decoder model that can be trained on monolingual corpora alone using a combination of denoising and backtranslation. Despite the simplicity of the approach, our system obtains 15.56 and 10.21 BLEU points in WMT 2014 French English and German English translation. The model can also profit from small parallel corpora, and attains 21.81 and 15.24 points when combined with 100,000 parallel sentences, respectively. Our implementation is released as an open source project1.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Neural machine translation (NMT) has recently become the dominant paradigm to machine translation (Bahdanau et al., 2014; Sutskever et al., 2014). As opposed to the traditional statistical machine translation (SMT), NMT systems are trained end-to-end, take advantage of continuous representations that greatly alleviate the sparsity problem, and make use of much larger contexts, thus mitigating the locality problem. Thanks to this, NMT has been reported to significantly improve over SMT both in automatic metrics and human evaluation (Wu et al., 2016).
|
| 14 |
+
|
| 15 |
+
Nevertheless, for the same reasons described above, NMT requires a large parallel corpus to be effective, and is known to fail when the training data is not big enough (Koehn & Knowles, 2017). Unfortunately, the lack of large parallel corpora is a practical problem for the vast majority of language pairs, including low-resource languages (e.g. Basque) as well as many combinations of major languages (e.g. German-Russian). Several authors have recently tried to address this problem using pivoting or triangulation techniques (Chen et al., 2017) as well as semi-supervised approaches (He et al., 2016), but these methods still require a strong cross-lingual signal.
|
| 16 |
+
|
| 17 |
+
In this work, we eliminate the need of cross-lingual information and propose a novel method to train NMT systems in a completely unsupervised manner, relying solely on monolingual corpora. Our approach builds upon the recent work on unsupervised cross-lingual embeddings (Artetxe et al., 2017; Zhang et al., 2017). Thanks to a shared encoder for both translation directions that uses these fixed cross-lingual embeddings, the entire system can be trained, with monolingual data, to reconstruct its input. In order to learn useful structural information, noise in the form of random token swaps is introduced in this input. In addition to denoising, we also incorporate backtranslation (Sennrich et al., 2016a) into the training procedure to further improve results. Figure 1 summarizes this general schema of the proposed system.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Architecture of the proposed system. For each sentence in language L1, the system is trained alternating two steps: denoising, which optimizes the probability of encoding a noised version of the sentence with the shared encoder and reconstructing it with the L1 decoder, and on-the-fly backtranslation, which translates the sentence in inference mode (encoding it with the shared encoder and decoding it with the L2 decoder) and then optimizes the probability of encoding this translated sentence with the shared encoder and recovering the original sentence with the L1 decoder. Training alternates between sentences in L1 and L2, with analogous steps for the latter.
|
| 21 |
+
|
| 22 |
+
In spite of the simplicity of the approach, our experiments show that the proposed system can reach up to 15.56 BLEU points for French English and 10.21 BLEU points for German English in the standard WMT 2014 translation task using nothing but monolingual training data. Moreover, we show that combining this method with a small parallel corpus can further improve the results, obtaining 21.81 and 15.24 BLEU points with 100,000 parallel sentences, respectively. Our manual analysis confirms the effectiveness of the proposed approach, revealing that the system is learning non-trivial translation relations that go beyond a word-by-word substitution.
|
| 23 |
+
|
| 24 |
+
The remaining of this paper is organized as follows. Section 2 analyzes the related work. Section 3 then describes the proposed method. The experimental settings are discussed in Section 4, while Section 5 presents and discusses the obtained results. Section 6 concludes the paper.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
We will first discuss unsupervised cross-lingual embeddings, which are the basis of our proposal, in Section 2.1. Section 2.2 then addresses statistical decipherment, an SMT-inspired approach to build a machine translation system in an unsupervised manner. Finally, Section 2.3 presents previous work on training NMT systems in different low-resource scenarios.
|
| 29 |
+
|
| 30 |
+
# 2.1 UNSUPERVISED CROSS-LINGUAL EMBEDDINGS
|
| 31 |
+
|
| 32 |
+
Most methods for learning cross-lingual word embeddings rely on some bilingual signal at the document level, typically in the form of parallel corpora (Gouws et al., 2015; Luong et al., 2015a). Closer to our scenario, embedding mapping methods independently train the embeddings in different languages using monolingual corpora, and then learn a linear transformation that maps them to a shared space based on a bilingual dictionary (Mikolov et al., 2013a; Lazaridou et al., 2015; Artetxe et al., 2016; Smith et al., 2017). While the dictionary used in these earlier work typically contains a few thousands entries, Artetxe et al. (2017) propose a simple self-learning extension that gives comparable results with an automatically generated list of numerals, which is used as a shortcut for practical unsupervised learning. Alternatively, adversarial training has also been proposed to learn such mappings in an unsupervised manner (Miceli Barone, 2016; Zhang et al., 2017).
|
| 33 |
+
|
| 34 |
+
# 2.2 STATISTICAL DECIPHERMENT FOR MACHINE TRANSLATION
|
| 35 |
+
|
| 36 |
+
There is a considerable body of work in statistical decipherment techniques to induce a machine translation model from monolingual data, which follows the same noisy-channel model used by SMT (Ravi & Knight, 2011; Dou & Knight, 2012). More concretely, they treat the source language as ciphertext, and model the process by which this ciphertext is generated as a two-stage process involving the generation of the original English sequence and the probabilistic replacement of the words in it. The English generative process is modeled using a standard n-gram language model, and the channel model parameters are estimated using either expectation maximization or Bayesian inference. This approach was shown to benefit from the incorporation of syntactic knowledge of the languages involved (Dou & Knight, 2013; Dou et al., 2015). More in line with our proposal, the use of word embeddings has also been shown to bring significant improvements in statistical decipherment for machine translation (Dou et al., 2015).
|
| 37 |
+
|
| 38 |
+
# 2.3 LOW-RESOURCE NEURAL MACHINE TRANSLATION
|
| 39 |
+
|
| 40 |
+
There have been several proposals to exploit resources other than direct parallel corpora to train NMT systems. The scenario that is most often considered is one where two languages have little or no parallel data between them but are well connected through a third language (e.g. there might be little direct resources for German-Russian but plenty for German-English and English-Russian). The most basic approach in this scenario is to independently translate from the source language to the pivot language and from the pivot language to the target language. It has however been shown that the use of more advanced models like a teacher-student framework can bring considerable improvements over this basic baseline (Firat et al., 2016b; Chen et al., 2017). In the same line, Johnson et al. (2017) show that a multilingual extension of a standard NMT architecture performs reasonably well even for language pairs for which no direct data was given during training.
|
| 41 |
+
|
| 42 |
+
In addition to that, there have been several attempts to exploit monolingual corpora for NMT in combination with the more scarce parallel corpora. A simple yet effective approach is to create a synthetic parallel corpus by backtranslating a monolingual corpus in the target language (Sennrich et al., 2016a). At the same time, Currey et al. (2017) showed that training an NMT system to directly copy target language text is also helpful and complementary with backtranslation. Finally, Ramachandran et al. (2017) pre-train the encoder and the decoder in language modeling.
|
| 43 |
+
|
| 44 |
+
To the best of our knowledge, the more ambitious scenario where an NMT model is trained from monolingual corpora alone has never been explored to date, but He et al. (2016) made an important contribution in this direction. More concretely, their method trains two agents to translate in opposite directions (e.g. French English and English French), and make them teach each other through a reinforcement learning process. While promising, this approach still requires a parallel corpus of a considerable size for a warm start (1.2 million sentences in the reported experiments), whereas our work does not use any parallel data at all.
|
| 45 |
+
|
| 46 |
+
# 3 PROPOSED METHOD
|
| 47 |
+
|
| 48 |
+
This section describes the proposed unsupervised NMT approach. Section 3.1 first presents the architecture of the proposed system, and Section 3.2 then describes the method to train it in an unsupervised manner.
|
| 49 |
+
|
| 50 |
+
# 3.1 SYSTEM ARCHITECTURE
|
| 51 |
+
|
| 52 |
+
As shown in Figure 1, the proposed system follows a fairly standard encoder-decoder architecture with an attention mechanism (Bahdanau et al., 2014). More concretely, we use a two-layer bidirectional RNN in the encoder, and another two-layer RNN in the decoder. All RNNs use GRU cells with 600 hidden units (Cho et al., 2014), and the dimensionality of the embeddings is set to 300. As for the attention mechanism, we use the global attention method proposed by Luong et al. (2015b) with the general alignment function. There are, however, three important aspects in which our system differs from the standard NMT, and these are critical so the system can be trained in an unsupervised manner as described next in Section 3.2:
|
| 53 |
+
|
| 54 |
+
1. Dual structure. While NMT systems are typically built for a specific translation direction (e.g. either French English or English French), we exploit the dual nature of machine translation (He et al., 2016; Firat et al., 2016a) and handle both directions together (e.g. French English).
|
| 55 |
+
2. Shared encoder. Our system makes use of one and only one encoder that is shared by both languages involved, similarly to Ha et al. (2016), Lee et al. (2017) and Johnson et al. (2017). For instance, the exact same encoder would be used for both French and English. This universal encoder is aimed to produce a language independent representation of the input text, which each decoder should then transform into its corresponding language.
|
| 56 |
+
3. Fixed embeddings in the encoder. While most NMT systems randomly initialize their embeddings and update them during training, we use pre-trained cross-lingual embeddings in the encoder that are kept fixed during training. This way, the encoder is given language independent word-level representations, and it only needs to learn how to compose them to build representations of larger phrases. As discussed in Section 2.1, there are several unsupervised methods to train these cross-lingual embeddings from monolingual corpora, so this is perfectly feasible in our scenario. Note that, even if the embeddings are crosslingual, we use separate vocabularies for each language. This way, the word chair, which exists both in French and English (meaning “flesh” in the former), would get a different vector in each language, although they would both be in a common space.
|
| 57 |
+
|
| 58 |
+
# 3.2 UNSUPERVISED TRAINING
|
| 59 |
+
|
| 60 |
+
As NMT systems are typically trained to predict the translations in a parallel corpus, such supervised training procedure is infeasible in our scenario, where we only have access to monolingual corpora. However, thanks to the architectural modifications proposed above, we are able to train the entire system in an unsupervised manner using the following two strategies:
|
| 61 |
+
|
| 62 |
+
1. Denoising. Thanks to the use of a shared encoder, and exploiting the dual structure of machine translation, the proposed system can be directly trained to reconstruct its own input. More concretely, the whole system can be optimized to take an input sentence in a given language, encode it using the shared encoder, and reconstruct the original sentence using the decoder of that language. Given that we use pre-trained cross-lingual embeddings in the shared encoder, this encoder should learn to compose the embeddings of both languages in a language-independent fashion, and each decoder should learn to decompose this representation into their corresponding language. At inference time, we simply replace the decoder with that of the target language, so it generates the translation of the input text from the language-independent representation given by the encoder.
|
| 63 |
+
|
| 64 |
+
Nevertheless, this ideal behavior is severely compromised by the fact that the resulting training procedure is essentially a trivial copying task. As such, the optimal solution for this task would not need to capture any real knowledge of the languages involved, as there would be many degenerated solutions that blindly copy all the elements in the input sequence. If this were the case, the system would at best make very literal word-by-word substitutions when used to translate from one language to another at inference time.
|
| 65 |
+
|
| 66 |
+
In order to avoid such degenerated solutions and make the encoder truly learn the compositionality of its input words in a language independent manner, we propose to introduce random noise in the input sentences. The idea is to exploit the same underlying principle of denoising autoencoders (Vincent et al., 2010), where the system is trained to reconstruct the original version of a corrupted input sentence (Dai & Le, 2015; Hill et al., 2016). For that purpose, we alter the word order of the input sentence by making random swaps between contiguous words. More concretely, for a sequence of $N$ elements, we make $N / 2$ random swaps of this kind. This way, the system needs to learn about the internal structure of the languages involved to be able to recover the correct word order. At the same time, by discouraging the system to rely too much on the word order of the input sequence, we can better account for the actual word order divergences across languages. This training procedure can be seen as an instance of contrastive estimation (Smith & Eisner, 2005), where the neighborhood is defined by local swaps in our case, although other functions would also be possible.
|
| 67 |
+
|
| 68 |
+
2. On-the-fly backtranslation. In spite of the denoising strategy, the training procedure above is still a copying task with some synthetic alterations that, most importantly, involves a single language at each time, without considering our final goal of translating between two languages. In order to train our system in a true translation setting without violating the constraint of using nothing but monolingual corpora, we propose to adapt the backtranslation approach proposed by Sennrich et al. (2016a) to our scenario. More concretely, given an input sentence in one language, we use the system in inference mode with greedy decoding to translate it to the other language (i.e. apply the shared encoder and the decoder of the other language). This way, we obtain a pseudo-parallel sentence pair, and train the system to predict the original sentence from this synthetic translation. Note that, contrary to standard backtranslation, which uses an independent model to backtranslate the entire corpus at one time, we take advantage of the dual structure of the proposed architecture to backtranslate each mini-batch on-the-fly using the model that is being trained itself. This way, as training progresses and the model improves, it will produce better synthetic sentence pairs through backtranslation, which will serve to further improve the model in the following iterations.
|
| 69 |
+
|
| 70 |
+
During training, we alternate these different training objectives from mini-batch to mini-batch. This way, given two languages L1 and L2, each iteration would perform one mini-batch of denoising for L1, another one for L2, one mini-batch of on-the-fly backtranslation from L1 to L2, and another one from L2 to L1. Moreover, by further assuming that we have access to a small parallel corpus, the system can also be trained in a semi-supervised fashion by combining these steps with directly predicting the translations in this parallel corpus just as in standard NMT.
|
| 71 |
+
|
| 72 |
+
# 4 EXPERIMENTAL SETTINGS
|
| 73 |
+
|
| 74 |
+
We make our experiments comparable with previous work by using the French-English and GermanEnglish datasets from the WMT 2014 shared task2. Following common practice, the systems are evaluated on newstest2014 using tokenized BLEU scores as computed by the multi-bleu.perl script3. As for the training data, we test the proposed system under three different settings:
|
| 75 |
+
|
| 76 |
+
• Unsupervised: This is the main scenario under consideration in our work, where the system has access to nothing but monolingual corpora. For that purpose, we used the News Crawl corpus with articles from 2007 to 2013.
|
| 77 |
+
• Semi-supervised: We assume that, in addition to monolingual corpora, we also have access to a small in-domain parallel corpus. This scenario has a great practical interest, as we might often have some parallel data from which we could potentially benefit, but it is insufficient to train a full traditional NMT system. For that purpose, we used the same monolingual data from the unsupervised settings together with either 10,000 or 100,000 random sentence pairs from the News Commentary parallel corpus.
|
| 78 |
+
Supervised: This is the traditional scenario in NMT where we have access to a large parallel corpus. While not the focus of our work, this setting should provide an approximate upper-bound for the proposed system. For that purpose, we used the combination of all parallel corpora provided at WMT 2014, which comprise Europarl, Common Crawl and News Commentary for both language pairs plus the UN and the Gigaword corpus for FrenchEnglish. For direct comparison with the semi-supervised scenario, we also ran separate experiments using the same subsets of News Commentary alone.
|
| 79 |
+
|
| 80 |
+
Note that, to be faithful to our target scenario, we did not make use of any parallel data in these language pairs for development or tuning purposes. Instead, we used Spanish-English WMT data for our preliminary experiments, where we also decided all the hyperparameters without any rigorous exploration.
|
| 81 |
+
|
| 82 |
+
As for the corpus preprocessing, we perform tokenization and truecasing using standard Moses tools.4 We then apply byte pair encoding (BPE) as proposed by Sennrich et al. (2016b) using the implementation provided by the authors5. Learning was done on the monolingual corpus of each language independently, using 50,000 operations. While BPE is known to be an effective way to overcome the rare word problem in standard NMT, it is less clear how it would perform in our more challenging unsupervised scenario, as it might be difficult to learn the translation relations between subword units. For that reason, we also run experiments at the word level in this unsupervised scenario, limiting the vocabulary to the most frequent 50,000 tokens and replacing the rest with a special token ${ \mathrm { < U N K > } }$ . We accelerate training by discarding all sentences with more than 50 elements (either BPE units or actual tokens).
|
| 83 |
+
|
| 84 |
+
Given that the proposed system uses pre-trained cross-lingual embeddings in the encoder as described in Section 3.1, we use the monolingual corpora described above to independently train the embeddings for each language using word2vec (Mikolov et al., 2013b). More concretely, we use the skip-gram model with ten negative samples, a context window of ten words, 300 dimensions, a sub-sampling of $1 0 ^ { - 5 }$ , and ten training iterations. We then use the public implementation6 of the method proposed by Artetxe et al. (2017) to map these embeddings to a shared space, using the recommended configuration with numeral-based initialization. In addition to being a component of the proposed system, the resulting embeddings are also used to build a simple baseline system that translates a sentence word-by-word, replacing each word by their nearest neighbor in the other language and leaving out-of-vocabularies unchanged.
|
| 85 |
+
|
| 86 |
+
The training of the proposed system itself is done using the procedure described in Section 3.2 with the cross-entropy loss function and a batch size of 50 sentences. For the unsupervised systems, we try using denoising alone as well as the combination of both denoising and backtranslation, in order to better analyze the contribution of the latter. We use Adam as our optimizer with a learning rate of $\alpha = 0 . 0 0 0 2$ (Kingma & Ba, 2015). During training, we use dropout regularization with a drop probability $p = 0 . 3$ . Given that we restrict ourselves not to use any parallel data for development purposes, we perform a fixed number of iterations (300,000) to train each variant. Using our PyTorch implementation, training each system took about 4-5 days on a single Titan X GPU for the full unsupervised variant. Although we observed that the system had not fully converged after this number of iterations in our preliminary experiments, we decide to stop training at this point in order to accelerate experimentation due to hardware constraints.
|
| 87 |
+
|
| 88 |
+
As described in Section 3.2, we use greedy decoding at training time for backtranslation, but actual inference at test time was done using beam-search with a beam size of 12 following common practice (Sutskever et al., 2014; Sennrich et al., 2016a;b; He et al., 2016). We do not use any length or coverage penalty, which might further improve the reported results.
|
| 89 |
+
|
| 90 |
+
# 5 RESULTS AND DISCUSSION
|
| 91 |
+
|
| 92 |
+
We discuss the quantitative results in Section 5.1, and present a qualitative analysis in Section 5.2.
|
| 93 |
+
|
| 94 |
+
# 5.1 QUANTITATIVE ANALYSIS
|
| 95 |
+
|
| 96 |
+
The BLEU scores obtained by all the tested variants are reported in Table 1.
|
| 97 |
+
|
| 98 |
+
As it can be seen, the proposed unsupervised system obtains very strong results considering that it was trained on nothing but monolingual corpora, reaching 14-15 BLEU points in French-English and 6-10 BLEU points in German-English depending on the variant and direction (rows 3 and 4). This is much stronger than the baseline system of word-by-word substitution (row 1), with improvements of at least $40 \%$ in all cases, and up to $140 \%$ in some (e.g. from 6.25 to 15.13 BLEU points in English French). This shows that the proposed system is able to go beyond very literal translations, effectively learning to use context information and account for the internal structure of the languages.
|
| 99 |
+
|
| 100 |
+
The results also show that backtranslation is essential for the proposed system to work properly. In fact, the denoising technique alone is below the baseline (row 1 vs 2), while big improvements are seen when introducing backtranslation (row 2 vs 3). Test perplexities also confirm this: for instance, the proposed system with denoising alone obtains a per-word perplexity of 634.79 for French English, whereas the one with backtranslation achieves a much lower perplexity of 44.74. We emphasize, however, that the proposed training procedure would not work using backtranslation alone without denoising, as the initial translations would be meaningless sentences produced by a random NMT model, encouraging the system to completely ignore the input sentence and simply learn a language model of the target language. We thus conclude that both denoising and backtranslation play an essential role during training: denoising forces the system to capture broad word-level equivalences, while backtranslation encourages it to learn more subtle relations in an increasingly natural setting.
|
| 101 |
+
|
| 102 |
+
Table 1: BLEU scores in newstest2014. Unsupervised systems are trained in the News Crawl monolingual corpus, semi-supervised systems are trained in the News Crawl monolingual corpus and a subset of the News Commentary parallel corpus, and supervised systems (provided for comparison) are trained in either these same subsets or the full parallel corpus, all from WMT 2014. For GNMT, we report the best single model scores from Wu et al. (2016).
|
| 103 |
+
|
| 104 |
+
<table><tr><td colspan="2"></td><td>FR-EN</td><td>EN-FR</td><td>DE-EN</td><td>EN-DE</td></tr><tr><td rowspan="4">Unsupervised</td><td>1.Baseline (emb. nearest neighbor)</td><td>9.98</td><td>6.25</td><td>7.07</td><td>4.39</td></tr><tr><td>2.Proposed (denoising)</td><td>7.28</td><td>5.33</td><td>3.64</td><td>2.40</td></tr><tr><td>3.Proposed (+ backtranslation)</td><td>15.56</td><td>15.13</td><td>10.21</td><td>6.55</td></tr><tr><td>4.Proposed (+ BPE)</td><td>15.56</td><td>14.36</td><td>10.16</td><td>6.89</td></tr><tr><td rowspan="2">Semi- supervised</td><td>5. Proposed (full) + 10k parallel</td><td>18.57</td><td>17.34</td><td>11.47</td><td>7.86</td></tr><tr><td>6.Proposed (full) + 100k parallel</td><td>21.81</td><td>21.74</td><td>15.24</td><td>10.95</td></tr><tr><td rowspan="4">Supervised</td><td>7. Comparable NMT (10k parallel)</td><td>1.88</td><td>1.66</td><td>1.33</td><td>0.82</td></tr><tr><td>8.Comparable NMT (100k parallel)</td><td>10.40</td><td>9.19</td><td>8.11</td><td>5.29</td></tr><tr><td>9. Comparable NMT (full parallel)</td><td>20.48</td><td>19.89</td><td>15.04</td><td>11.05</td></tr><tr><td>10. GNMT (Wu et al., 2016)</td><td>1</td><td>38.95</td><td>1</td><td>24.61</td></tr></table>
|
| 105 |
+
|
| 106 |
+
As for the role of subword translation, we observe that BPE is slightly beneficial when German is the target language, detrimental when French is the target language, and practically equivalent when English is the target language (row 3 vs 4). This might be a bit surprising considering that the wordlevel system does not handle out-of-vocabularies in any way, so it always fails to translate rare words. Having a closer look, however, we observe that, while BPE manages to correctly translate some rare words, it also introduces some new errors. In particular, it sometimes happens that a subword unit from a rare word gets prefixed to a properly translated word, yielding to translations like SevAgency (split as S- ev- Agency). Moreover, we observe that BPE is of little help when translating infrequent named entities. For instance, we observed that our system translated Tymoshenko as Ebferchenko (split as Eb- fer- chenko). While standard NMT would easily learn to copy this kind of named entities using BPE, such relations are much more challenging to model under our unsupervised learning procedure. This way, we believe that a better handling of rare words and, in particular, named entities and numerals, could further improve the results in the future.
|
| 107 |
+
|
| 108 |
+
In addition to that, the results of the semi-supervised system (rows 5 and 6) show that the proposed model can greatly benefit from a small parallel corpus. Note that these semi-supervised systems differ from the full unsupervised system (row 4) in the use of either 10,000 or 100,000 parallel sentences from News Crawl, so that their training alternates between denoising, backtranslation and, additionally, maximizing the translation probability of these parallel sentences as described in Section 3.2. As it can be seen, 10,000 parallel sentences alone bring an improvement of 1-3 BLEU points, while 100,000 sentences bring an improvement of 4-7 points. These results are much better than those of a comparable NMT system trained in the same parallel data (rows 7 and 8), showing the potential interest of our approach beyond the strictly unsupervised scenario. In fact, the semisupervised system trained in 100,000 parallel sentences (row 6) even surpasses the comparable NMT system trained in the full parallel corpus (row 9) in all cases but one, presumably because the domain of both the monolingual and the parallel corpora that it uses matches that of the test set.
|
| 109 |
+
|
| 110 |
+
Table 2: Sample French English translations from newstest2014 by the full proposed system with BPE. See text for comments.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Source Reference</td><td></td><td>Proposed system (full)</td></tr><tr><td>Une fusillade a eu lieuä l'aéroport international de Los Angeles.</td><td>There was a shooting in Los An- geles International Airport.</td><td>A shooting occurred at Los An- geles International Airport.</td></tr><tr><td>Cette controverse croissante au- tour de l'agence a provoqué beaucoup de spéculations selon lesquelles l'incident de ce soir était le résultat d'une cyber- opération ciblée.</td><td>Such growing controversy sur- rounding the agency prompted early speculation that tonight's incident was the result of a tar- geted cyber operation.</td><td>This growing scandal around the agency has caused much spec- ulation about how this incident was the outcome of a targeted cyber operation.</td></tr><tr><td>Le nombre total de morts en oc- tobre est le plusélevé depuis avril 2008,quand 1 073 person- nes avaient été tuées.</td><td>The total number of deaths in October is the highest since April 2008,when1,073 people were killed.</td><td>The total number of deaths in May is the highest since April 2008,when 1 064 people had been killed.</td></tr><tr><td>A l'exception de l'opéra,la province reste le parent pauvre de la culture en France.</td><td>With the exception of opera, the provinces remain the poor rela- tive of culture in France.</td><td>At an exception,opera remains of the state remains the poorest parent culture.</td></tr></table>
|
| 113 |
+
|
| 114 |
+
As for the supervised system, it is remarkable that the comparable NMT model (rows 7-9), which uses the proposed architecture but trains it to predict the translations in the corresponding parallel corpus, obtains poor results compared to the state of the art in NMT (e.g. GNMT in row 10). Note that the comparable NMT system is equivalent to the semi-supervised system (rows 5 and 6), except that it does not use any monolingual corpora nor, consequently, denoising and backtranslation. As such, the comparable NMT differs from standard NMT in the use of a shared encoder with fixed embeddings (Section 3.1) and input corruption (Section 3.2).
|
| 115 |
+
|
| 116 |
+
The relatively poor results of the comparable NMT model suggest that these additional constraints in our system, which were introduced to enable unsupervised learning, may also be a factor limiting its potential performance, so we believe that the system could be further improved in the future by progressively relaxing these constraints during training. For instance, using fixed cross-lingual embeddings in the encoder is necessary in the early stages of training, as it forces the encoder to use a common word representation for both languages, but it might also limit what it can ultimately learn in the process. For that reason, one could start to progressively update the weights of the encoder embeddings as training progresses. Similarly, one could also decouple the shared encoder into two independent encoders at some point during training, or progressively reduce the noise level. At the same time, note that we did not perform any rigorous hyperparameter exploration, and favored efficiency over performance in the experimental design due to hardware constraints. As such, we think that there is a considerable margin to improve these results by using larger models, longer training times, and incorporating several well-known NMT techniques (e.g. ensembling and length/coverage penalty).
|
| 117 |
+
|
| 118 |
+
# 5.2 QUALITATIVE ANALYSIS
|
| 119 |
+
|
| 120 |
+
In order to better understand the behavior of the proposed system, we manually analyzed some translations for French English, and present some illustrative examples in Table 2.
|
| 121 |
+
|
| 122 |
+
Our analysis shows that the proposed system is able to produce high-quality translations, adequately modeling non-trivial translation relations. For instance, in the first example it translates the expression a eu lieu (literally ”has had place”) as occurred, going beyond a literal word-by-word substitution. At the same time, it correctly translates l’aeroport international de Los Angeles ´ as Los Angeles International Airport, properly modeling structural differences between the languages. As shown by the second example, the system is also capable of producing high-quality translations for considerably longer and more complex sentences.
|
| 123 |
+
|
| 124 |
+
Nevertheless, our analysis also points that the proposed system has limitations and, perhaps not surprisingly, its translation quality often lags behind that of a standard supervised NMT system. In particular, we observe that the proposed model has difficulties to preserve some concrete details from source sentences. For instance, in the third example April and 2008 are properly translated, but octobre (”October”) is mistranslated as May and 1 073 as 1 064. While these clearly point to some adequacy issues, they are also understandable given the unsupervised nature of the system, and it is remarkable that the system managed to at least replace a month by another month and a number by another close number. We believe that incorporating character level information might help to mitigate some of these issues, as it could for instance favor October as the translation of octobre instead of the selected May.
|
| 125 |
+
|
| 126 |
+
Finally, there are also some cases where there are both fluency and adequacy problems that severely hinders understanding the original message from the proposed translation. For instance, in the last example our system preserves most keywords in the original sentence, but it would be difficult to correctly guess its meaning just by looking at its translation. In concordance with our quantitative analysis, this suggests that there is still room for improvement, opening new research avenues for the future.
|
| 127 |
+
|
| 128 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 129 |
+
|
| 130 |
+
In this work, we propose a novel method to train an NMT system in a completely unsupervised manner. We build upon existing work on unsupervised cross-lingual embeddings (Artetxe et al., 2017; Zhang et al., 2017), and incorporate them in a modified attentional encoder-decoder model. By using a shared encoder with these fixed cross-lingual embeddings, we are able to train the system from monolingual corpora alone, combining denoising and backtranslation.
|
| 131 |
+
|
| 132 |
+
The experiments show the effectiveness of our proposal, obtaining significant improvements in the BLEU score over a baseline system that performs word-by-word substitution in the standard WMT 2014 French-English and German-English benchmarks. Our manual analysis confirms the quality of the proposed system, showing that it is able to model complex cross-lingual relations and produce high-quality translations. Moreover, we show that combining our method with a small parallel corpus can bring further improvements, showing its potential interest beyond the strictly unsupervised scenario.
|
| 133 |
+
|
| 134 |
+
Our work opens exciting opportunities for future research, as our analysis reveals that, in spite of the solid results, there is still a considerable room for improvement. In particular, we observe that the performance of a comparable supervised NMT system is considerably below the state of the art, which suggests that the architectural modifications introduced by our proposal (Section 3.1) are also limiting its potential performance. For that reason, we would like to explore progressively relaxing these constraints during training as discussed in Section 5.1. Additionally, we would like to incorporate character level information into the model, which we believe that could be very helpful to address some of the adequacy issues observed in our manual analysis (Section 5.2). Finally, we would like to explore other neighborhood functions for denoising, and analyze their effect in relation to the typological divergences of different language pairs.
|
| 135 |
+
|
| 136 |
+
# ACKNOWLEDGMENTS
|
| 137 |
+
|
| 138 |
+
This research was partially supported by a Google Faculty Award, the Spanish MINECO (TUNER TIN2015-65308-C5-1-R, MUSTER PCIN-2015-226 and TADEEP TIN2015-70214-P, cofunded by EU FEDER), the Basque Government (MODELA KK-2016/00082), the UPV/EHU (excellence research group), and the NVIDIA GPU grant program. Mikel Artetxe enjoys a doctoral grant from the Spanish MECD. Kyunghyun Cho thanks support by eBay, TenCent, Facebook, Google, NVIDIA and CIFAR, and was partly supported by Samsung Advanced Institute of Technology (Next Generation Deep Learning: from pattern recognition to AI).
|
| 139 |
+
|
| 140 |
+
# REFERENCES
|
| 141 |
+
|
| 142 |
+
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. Learning principled bilingual mappings of word embeddings while preserving monolingual invariance. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2289–2294, Austin, Texas,
|
| 143 |
+
|
| 144 |
+
November 2016. Association for Computational Linguistics. URL https://aclweb.org/ anthology/D16-1250.
|
| 145 |
+
|
| 146 |
+
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. Learning bilingual word embeddings with (almost) no bilingual data. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 451–462, Vancouver, Canada, July 2017. Association for Computational Linguistics. URL http://aclweb.org/anthology/P17-1042.
|
| 147 |
+
|
| 148 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of the 2014 International Conference on Learning Representations, 2014.
|
| 149 |
+
|
| 150 |
+
Yun Chen, Yang Liu, Yong Cheng, and Victor O.K. Li. A teacher-student framework for zeroresource neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1925–1935, Vancouver, Canada, July 2017. Association for Computational Linguistics. URL http://aclweb.org/ anthology/P17-1176.
|
| 151 |
+
|
| 152 |
+
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, Doha, Qatar, October 2014. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ D14-1179.
|
| 153 |
+
|
| 154 |
+
Anna Currey, Antonio Valerio Miceli Barone, and Kenneth Heafield. Copied monolingual data improves low-resource neural machine translation. In Proceedings of the Second Conference on Machine Translation, pp. 148–156, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/W17-4715.
|
| 155 |
+
|
| 156 |
+
Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. In Advances in Neural Information Processing Systems 28, pp. 3079–3087. 2015. URL http://papers.nips.cc/ paper/5949-semi-supervised-sequence-learning.pdf.
|
| 157 |
+
|
| 158 |
+
Qing Dou and Kevin Knight. Large scale decipherment for out-of-domain machine translation. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pp. 266–275, Jeju Island, Korea, July 2012. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ D12-1025.
|
| 159 |
+
|
| 160 |
+
Qing Dou and Kevin Knight. Dependency-based decipherment for resource-limited machine translation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1668–1676, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/D13-1173.
|
| 161 |
+
|
| 162 |
+
Qing Dou, Ashish Vaswani, Kevin Knight, and Chris Dyer. Unifying bayesian inference and vector space models for improved decipherment. 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), pp. 836–845, Beijing, China, July 2015. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ P15-1081.
|
| 163 |
+
|
| 164 |
+
Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation with a shared attention mechanism. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 866–875, San Diego, California, June 2016a. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/N16-1101.
|
| 165 |
+
|
| 166 |
+
Orhan Firat, Baskaran Sankaran, Yaser Al-Onaizan, Fatos T. Yarman Vural, and Kyunghyun Cho. Zero-resource translation with multi-lingual neural machine translation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 268–277, Austin, Texas, November 2016b. Association for Computational Linguistics. URL https://aclweb. org/anthology/D16-1026.
|
| 167 |
+
|
| 168 |
+
Stephan Gouws, Yoshua Bengio, and Greg Corrado. BilBOWA: Fast bilingual distributed representations without word alignments. In Proceedings of the 32nd International Conference on Machine Learning, pp. 748–756, 2015.
|
| 169 |
+
|
| 170 |
+
Thanh-Le Ha, Jan Niehues, and Alexander Waibel. Toward multilingual neural machine translation with universal encoder and decoder. arXiv preprint arXiv:1611.04798, 2016.
|
| 171 |
+
|
| 172 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems 29, pp. 820–828. 2016. URL http://papers.nips.cc/paper/ 6469-dual-learning-for-machine-translation.pdf.
|
| 173 |
+
|
| 174 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1367– 1377, San Diego, California, June 2016. Association for Computational Linguistics. URL http: //www.aclweb.org/anthology/N16-1162.
|
| 175 |
+
|
| 176 |
+
Melvin Johnson, Mike Schuster, Quoc Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernand a ViA˜
|
| 177 |
+
|
| 178 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference for Learning Representations, 2015.
|
| 179 |
+
|
| 180 |
+
Philipp Koehn and Rebecca Knowles. Six challenges for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation, pp. 28–39, Vancouver, August 2017. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ W17-3204.
|
| 181 |
+
|
| 182 |
+
Angeliki Lazaridou, Georgiana Dinu, and Marco Baroni. Hubness and pollution: Delving into cross-space mapping for zero-shot learning. 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), pp. 270–280, Beijing, China, July 2015. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ P15-1027.
|
| 183 |
+
|
| 184 |
+
Jason Lee, Kyunghyun Cho, and Thomas Hofmann. Fully character-level neural machine translation without explicit segmentation. Transactions of the Association for Computational Linguistics, 5: 365–378, 2017. ISSN 2307-387X. URL https://transacl.org/ojs/index.php/ tacl/article/view/1051.
|
| 185 |
+
|
| 186 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Bilingual word representations with monolingual quality in mind. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, pp. 151–159, Denver, Colorado, June 2015a. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/W15-1521.
|
| 187 |
+
|
| 188 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412–1421, Lisbon, Portugal, September 2015b. Association for Computational Linguistics. URL http://aclweb.org/anthology/D15-1166.
|
| 189 |
+
|
| 190 |
+
Antonio Valerio Miceli Barone. Towards cross-lingual distributed representations without parallel text trained with adversarial autoencoders. In Proceedings of the 1st Workshop on Representation Learning for NLP, pp. 121–126, Berlin, Germany, August 2016. Association for Computational Linguistics. URL http://anthology.aclweb.org/W16-1614.
|
| 191 |
+
|
| 192 |
+
Tomas Mikolov, Quoc V Le, and Ilya Sutskever. Exploiting similarities among languages for machine translation. arXiv preprint arXiv:1309.4168, 2013a.
|
| 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 26, pp. 3111–3119. 2013b.
|
| 195 |
+
|
| 196 |
+
Prajit Ramachandran, Peter Liu, and Quoc Le. Unsupervised pretraining for sequence to sequence learning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 383–391, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/D17-1039.
|
| 197 |
+
|
| 198 |
+
Sujith Ravi and Kevin Knight. Deciphering foreign language. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pp. 12–21, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1002.
|
| 199 |
+
|
| 200 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 86–96, Berlin, Germany, August 2016a. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ P16-1009.
|
| 201 |
+
|
| 202 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, August 2016b. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ P16-1162.
|
| 203 |
+
|
| 204 |
+
Noah A. Smith and Jason Eisner. Contrastive estimation: Training log-linear models on unlabeled data. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL’05), pp. 354–362, Ann Arbor, Michigan, June 2005. Association for Computational Linguistics. doi: 10.3115/1219840.1219884. URL http://www.aclweb.org/anthology/ P05-1044.
|
| 205 |
+
|
| 206 |
+
Samuel L Smith, David HP Turban, Steven Hamblin, and Nils Y Hammerla. Offline bilingual word vectors, orthogonal transformations and the inverted softmax. In 5th International Conference on Learning Representations (ICLR 2017), 2017.
|
| 207 |
+
|
| 208 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems 27, pp. 3104–3112. 2014. URL http://papers.nips.cc/paper/ 5346-sequence-to-sequence-learning-with-neural-networks.pdf.
|
| 209 |
+
|
| 210 |
+
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, 11(Dec):3371–3408, 2010.
|
| 211 |
+
|
| 212 |
+
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. arXiv preprint arXiv:1609.08144, 2016. URL http://arxiv.org/abs/1609.08144.
|
| 213 |
+
|
| 214 |
+
Meng Zhang, Yang Liu, Huanbo Luan, and Maosong Sun. Adversarial training for unsupervised bilingual lexicon induction. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1959–1970, Vancouver, Canada, July 2017. Association for Computational Linguistics. URL http://aclweb.org/ anthology/P17-1179.
|
md/train/Sy8XvGb0-/Sy8XvGb0-.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LATENT CONSTRAINTS: LEARNING TO GENERATE CONDITIONALLY FROM UNCONDITIONAL GENERATIVE MODELS
|
| 2 |
+
|
| 3 |
+
Jesse Engel
|
| 4 |
+
Google Brain
|
| 5 |
+
San Francisco, CA, USA
|
| 6 |
+
|
| 7 |
+
Matthew D. Hoffman Google Inc. San Francisco, CA, USA
|
| 8 |
+
|
| 9 |
+
Adam Roberts Google Brain San Francisco, CA, USA
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Deep generative neural networks have proven effective at both conditional and unconditional modeling of complex data distributions. Conditional generation enables interactive control, but creating new controls often requires expensive retraining. In this paper, we develop a method to condition generation without retraining the model. By post-hoc learning latent constraints, value functions that identify regions in latent space that generate outputs with desired attributes, we can conditionally sample from these regions with gradient-based optimization or amortized actor functions. Combining attribute constraints with a universal “realism” constraint, which enforces similarity to the data distribution, we generate realistic conditional images from an unconditional variational autoencoder. Further, using gradient-based optimization, we demonstrate identity-preserving transformations that make the minimal adjustment in latent space to modify the attributes of an image. Finally, with discrete sequences of musical notes, we demonstrate zero-shot conditional generation, learning latent constraints in the absence of labeled data or a differentiable reward function.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Generative modeling of complicated data such as images and audio is a long-standing challenge in machine learning. While unconditional sampling is an interesting technical problem, it is arguably of limited practical interest in its own right: if one needs a non-specific image (or sound, song, document, etc.), one can simply pull something at random from the unfathomably vast media databases on the web. But that naive approach may not work for conditional sampling (i.e., generating data to match a set of user-specified attributes), since as more attributes are specified, it becomes exponentially less likely that a satisfactory example can be pulled from a database. One might also want to modify some attributes of an object while preserving its core identity. These are crucial tasks in creative applications, where the typical user desires fine-grained controls (Bernardo et al., 2017).
|
| 18 |
+
|
| 19 |
+
One can enforce user-specified constraints at training time, either by training on a curated subset of data or with conditioning variables. These approaches can be effective if there is enough labeled data available, but they require expensive model retraining for each new set of constraints and may not leverage commonalities between tasks. Deep latent-variable models, such as Generative Adversarial Networks (GANs; Goodfellow et al., 2014) and Variational Autoencoders (VAEs; Kingma & Welling, 2013; Rezende et al., 2014), learn to unconditionally generate realistic and varied outputs by sampling from a semantically structured latent space. One might hope to leverage that structure in creating new conditional controls for sampling and transformations (Brock et al., 2016).
|
| 20 |
+
|
| 21 |
+
Here, we show that new constraints can be enforced post-hoc on pre-trained unsupervised generative models. This approach removes the need to retrain the model for each new set of constraints, allowing users to more easily define custom behavior. We separate the problem into (1) creating an unsupervised model that learns how to reconstruct data from latent embeddings, and (2) leveraging the latent structure exposed in that embedding space as a source of prior knowledge, upon which we can impose behavioral constraints.
|
| 22 |
+
|
| 23 |
+
Our key contributions are as follows:
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: (a) Diagram of latent constraints for a VAE. We use one critic $D _ { \mathrm { a t t r } }$ to predict which regions of the latent space will generate outputs with desired attributes, and another critic $D _ { \mathrm { r e a l i s m } }$ to predict which regions have high mass under the marginal posterior, $q ( z )$ , of the training data. (b) We begin by pretraining a standard VAE, with an emphasis on achieving good reconstructions. (c) To train the actor-critic pair we use constraint-satisfaction labels, $c .$ , to train $D$ to discriminate between encodings of actual data, $z \sim q ( z | x )$ , versus latent vectors $z \sim p ( z )$ sampled from the prior or transformed prior samples $G ( z \sim p ( z ) , y )$ . Similar to a Conditional GAN, both $G$ and $D$ operate on a concatenation of $z$ and a binary attribute vector, $y$ , allowing $G$ to learn conditional mappings in latent space. If $G$ is an optimizer, a separate attribute discriminator, $D _ { \mathrm { a t t r } }$ is trained and the latent vector is optimized to reduce the cost of both $D _ { \mathrm { a t t r } }$ and $D _ { \mathrm { r e a l i s m } }$ . (d) To sample from the intersection of these regions, we use either gradient-based optimization or an amortized generator, $G$ , to shift latent samples from either the prior $z \sim p ( z )$ , sampling) or from the data $( z \sim q ( z | x )$ , transformation).
|
| 27 |
+
|
| 28 |
+
• We show that it is possible to generate conditionally from an unconditional model, learning a critic function $D ( z )$ in latent space and generating high-value samples with either gradient-based optimization or an amortized actor function $G ( z )$ , even with a nondifferentiable decoder (e.g., discrete sequences). Focusing on VAEs, we address the tradeoff between reconstruction quality and sample quality (without sacrificing diversity) by enforcing a universal “realism” constraint that requires samples in latent space to be indistinguishable from encoded data (rather than prior samples). Because we start from a VAE that can reconstruct inputs well, we are able to apply identitypreserving transformations by making the minimal adjustment in latent space needed to satisfy the desired constraints. For example, when we adjust a person’s expression or hair, the result is still clearly identifiable as the same person (see Figure 5). This contrasts with pure GAN-based transformation approaches, which often fail to preserve identity. Zero-shot conditional generation. Using samples from the VAE to generate exemplars, we can learn an actor-critic pair that satisfies user-specified rule-based constraints in the absence of any labeled data.
|
| 29 |
+
|
| 30 |
+
# 2 BACKGROUND
|
| 31 |
+
|
| 32 |
+
Decoder-based deep generative models such as VAEs and GANs generate samples that approximate a population distribution $p ^ { \star } ( x )$ by passing samples from some simple tractable distribution $p ( z )$ (often $p ( z ) \ \triangleq \ N ( 0 , I ) )$ through a deep neural network. GANs are trained to fool an auxiliary classifier that tries to learn to distinguish between real and synthetic samples. VAEs are fit to data using a variational approximation to maximum-likelihood estimation:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\begin{array} { r } { \mathcal { L } ^ { \mathrm { E L B O } } \triangleq \frac 1 N \sum _ { n } \mathbb { E } _ { z \sim q ( z | x _ { n } ) } [ \log \pi ( x _ { n } ; g ( z ) ) ] - \mathrm { K L } ( q ( z \mid x _ { n } ) \mid | p ( z ) ) \le \frac 1 N \sum _ { n } \log p ( x _ { n } ) , } \end{array}
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Typical VAEs use a pixel-wise data likelihood, $\mathcal { N } ( \mu _ { x } ( z ) , \sigma _ { x } I )$ , with $\sigma _ { x } = 1$ to produce coherent samples at the expense of visual and conceptual blurriness (Row 3). Some reconstructions (Row 2) actually change attributes of the original data. Decreasing $\sigma _ { x }$ to 0.1 maximizes the ELBO (supplemental Table 4) and increases the fidelity of reconstructions (Row 4) at the cost of sample realism (Row 5). Using an actor to shift prior samples to satisfy the realism constraint, we achieve more realistic samples without sacrificing sharpness (Row 6). The samples are mapped to the closest point in latent space that both satisfies the realism constraint and has the same attributes as the original data.
|
| 40 |
+
|
| 41 |
+
where the “encoder” distribution $q ( z \mid x )$ is an approximation to the posterior $p ( z \mid x )$ , $\pi ( x ; g ( z ) ) \triangleq$ $p ( x \mid z )$ is a tractable likelihood function that depends on some parameters output by a “decoder” function $g ( z )$ , and $q$ and $g$ are fit to maximize the evidence lower bound (ELBO) $\dot { \mathcal { L } } ^ { \mathrm { E L B O } }$ . The likelihood $\pi ( x ; g )$ is often chosen to be a product of simple distributions such as $\pi ( x ; g ) = \mathcal { N } ( x ; g , \sigma _ { x } ^ { 2 } I )$ for continuous data or $\begin{array} { r } { \pi ( x ; g ) = \tilde { \prod _ { d } \mathrm { B e r n o u l l i } } ( x _ { d } ; g _ { d } ) } \end{array}$ for binary data.
|
| 42 |
+
|
| 43 |
+
GANs and VAEs have complementary strengths and weaknesses. GANs suffer from the “modecollapse” problem, where the generator assigns mass to a small subset of the support of the population distribution—that is, it may generate realistic samples, but there are many more realistic samples that it cannot generate. This is particularly problematic if we want to use GANs to manipulate data rather than generate new data; even GAN variants that include some kind of inference machinery (e.g., Donahue et al., 2016; Dumoulin et al., 2016; Perarnau et al., 2016) to determine what $z$ best matches some $x$ tend to produce reconstructions that are reminiscent of the input but do not preserve its identity.
|
| 44 |
+
|
| 45 |
+
On the other hand, VAEs (especially those with simple likelihoods $\pi$ ) often exhibit a tradeoff between sharp reconstructions and sensible-looking samples (see Figure 2). That is, depending on what hyperparameters they are trained with (e.g., latent dimensionality and the scale of the likelihood term), VAEs tend to either produce blurry reconstructions and plausible (but blurry) novel samples, or bizarre samples but sharp reconstructions. It has been argued (Makhzani et al., 2016) that this is due to the “holes” problem; the decoder is trained on samples from the marginal posterior $q ( z ) \triangleq { \frac { 1 } { N } } \sum _ { n } q ( z \mid x _ { n } )$ , which may have very high KL divergence to the presupposed marginal $p ( z )$ (Hoffman & Johnson, 2016). In particular, if the decoder, $g ( z )$ , can reconstruct arbitrary values of $x$ with high accuracy (as in the case of small $\sigma _ { x }$ ) then the typical posterior $p ( z \mid x )$ will be highly concentrated. We show this experimentally in supplemental Figure 16. If $q ( z \mid x )$ underestimates the posterior variance (as it usually does), then the marginal posterior $q ( z )$ will also be highly concentrated, and samples from $\begin{array} { r } { p ( x ) \stackrel { \cdot } { = } \int _ { z } p ( z ) p ( x \mid z ) d z } \end{array}$ may produce results that are far from typical reconstructions $\mathbb { E } _ { p } [ x \mid z \sim q ( z \mid x ) ]$ . If we tune $\sigma _ { x }$ to maximize the ELBO (Bishop, 2006), we find the optimal $\sigma _ { x } \approx 0 . 1$ (supplemental Table 4). Figure 2 shows that this choice does indeed lead to good reconstructions but strange-looking samples.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 3: Contour maps of the critic value functions for the marginal posterior (“realism”) constraint. We look at the two latent dimensions that have the lowest average posterior standard deviation on the training set, taking low variance in $z$ space as a proxy for influence over the generated images. All other latent dimensions are held fixed at their original values (from a sample from $p ( z )$ on the left, and from a sample from $q ( z \mid x )$ for a held-out $x$ on the right). Gray x marks correspond to the points in latent space of the generated images to the right. The cross-section on the left, taken from a prior sample, shows contours that point towards more realistic looking digits. In the cross-section on the right, a sample from the validation set (indicated by orange squares) resides within a local maximum of the critic, as one would hope.
|
| 49 |
+
|
| 50 |
+
Conditional GANs (CGAN; Mirza & Osindero, 2014) and conditional VAEs (CVAE; Sohn et al., 2015) can generate samples conditioned on attribute information when available, but they must be trained with knowledge of the attribute labels for the whole training set, and it is not clear how to adapt them to new attributes without retraining from scratch. Furthermore, CGANs and CVAEs suffer from the same problems of mode-collapse and blurriness as their unconditional cousins.
|
| 51 |
+
|
| 52 |
+
We take a different approach to conditional generation and identity-preserving transformation. We begin by training an unconditional VAE with hyperparameters chosen to ensure good reconstruction (at the expense of sample quality). We then train a “realism” critic to predict whether a given $z$ maps to a high-quality sample. We also train critics to predict whether a given $z$ maps to a sample that manifests various attributes of interest. To generate samples that are both realistic and exhibit desired attributes, one option is to optimize random $z$ vectors until they satisfy both the realism and attribute critics. Alternately, we can amortize this cost by training an “actor” network to map a random set of $z$ vectors to a subregion of latent space that satisfies the constraints encoded by the critics. By encouraging these transformed $z$ vectors to remain as close as possible to where they started, we alleviate the mode-collapse problem common to GANs.
|
| 53 |
+
|
| 54 |
+
Our approach is summarized visually in Figure 1. The details follow in sections 3, 4, 5, and 6.
|
| 55 |
+
|
| 56 |
+
# 3 THE “REALISM” CONSTRAINT: SHARPENING VAE SAMPLES
|
| 57 |
+
|
| 58 |
+
We define the realism constraint implicitly as being satisfied by samples from the marginal posterior $\begin{array} { r } { q ( z ) \triangleq \frac { 1 } { N } \sum _ { n } q ( z \mid \underline { { x } } _ { n } ) } \end{array}$ and not those from $p ( z )$ . By enforcing this constraint, we can close the gap between reconstruction quality and sample quality (without sacrificing sample diversity).
|
| 59 |
+
|
| 60 |
+
As shown in Figure 1, we can train a critic $D$ to differentiate between samples from $p ( z )$ and $q ( z )$ . The critic loss, $\mathcal { L } _ { D } ( z )$ , is simply the cross-entropy, with labels $c = 1$ for $z \sim q ( z \mid x )$ and $c = 0$ for $z \sim p ( z )$ . We found that the realism critic had little trouble generalizing to unseen data; that is, it was able to recognize samples from $q ( z \mid x ^ { \mathrm { h e l d - o u t } } )$ as being “realistic” (Figure 3).
|
| 61 |
+
|
| 62 |
+
Sampling from the prior is sufficient to train $D$ for models with lower KL Divergence, but if the KL Divergence between $q$ and $p$ is large, the chances of sampling a point $p ( z )$ that has high probability under $q ( z )$ becomes vanishingly small. This leads to poor sample quality and makes it difficult for $D$ to learn a tight approximation of $q ( z )$ solely by sampling from $p ( z )$ . Instead, we use an inner-loop of gradient-based optimization, $G _ { \mathrm { o p t } } ( z ) = \mathrm { G r a d i e n t D e s c e n t } ( z ; \mathcal { L } _ { D } ( z ) )$ , to move prior samples to points deemed more like $q ( z )$ by $D$ . For clarity, we introduce the shorthand $\mathcal { L } _ { c = 1 } ( z ) \triangleq - \log ( D ( z ) )$ and $\mathcal { L } _ { c = 0 } ( z ) \triangleq - ( 1 - \log ( D ( z ) ) )$ . This gives us our critic loss for the realism constraint:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathcal { L } _ { D } ( z ) = \mathbb { E } _ { z \sim q ( z | x ) } [ \mathcal { L } _ { c = 1 } ( z ) ] + \mathbb { E } _ { z \sim p ( z ) } [ \mathcal { L } _ { c = 0 } ( z ) ] + \mathbb { E } _ { z \sim G ( p ( z ) ) } [ \mathcal { L } _ { c = 0 } ( z ) ]
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 4: Conditional generation with a CGAN actor-critic pair acting in the latent space of a VAE with $\sigma _ { x } = 0 . 1$ . Each row starts from a different prior sample and maps it to a new point in latent space that satisfies both the attribute constraints and the realism constraint. The attribute constraints are changed one at a time to produce as smooth a transition as possible from left to right. The bottom CGAN is regularized during training to prefer small shifts in latent space $\lambda _ { \mathrm { d i s t } } = 0 . 1 $ , while the top is not $\lambda _ { \mathrm { d i s t } } = 0 . 0$ ). Compared to the images generated by the unregularized model, the images generated by the regularized model are much less diverse across columns, suggesting that the regularization does indeed enforce some degree of identity preservation. The regularized model produces images that are somewhat more diverse across rows, suggesting that the regularization fights mode collapse (arguably at the expense of image quality). For each column, the complete list of attributes is given in supplemental Table 3.
|
| 70 |
+
|
| 71 |
+
Since this inner-loop of optimization can slow down training, we amortize the generation by using a neural network as a function approximator. There are many examples of such amortization tricks, including the encoder of a VAE, generator of a GAN, and fast neural style transfer (Ulyanov et al., 2016; Li & Wand, 2016; Johnson et al., 2016). As with a traditional GAN, the parameters of the function $G$ are updated to maximize the value $D$ ascribes to the shifted latent points. One of the challenges using a GAN in this situation is that it is prone to mode-collapse. However, an advantage of applying the GAN in latent space is that we can regularize $G$ to try and find the closest point in latent space that satisfies $D$ , thus encouraging diverse solutions. We introduce a regularization term, $\bar { \mathcal { L } _ { \mathrm { d i s t } } ( z ^ { \prime } , z ) } = 1 / \bar { \sigma _ { z } } ^ { 2 } \log ( 1 + ( z ^ { \prime } - z ) ^ { 2 } )$ to encourage nearby solutions, while allowing more exploration than a mean square error term. As a VAE utilizes only a fraction of its latent dimensions, we scale the distance penalty of each dimension by its utilization, as indicated by the squared reciprocal of the scale $\sigma _ { z } ( x ) ^ { \top }$ of the encoder distribution $\overset { \cdot } { q } ( z \mid x )$ , averaged over the training dataset, $\begin{array} { r } { \bar { \sigma } _ { z } \triangleq \frac { 1 } { N } \sum _ { n } \sigma _ { z } ( x _ { n } ) } \end{array}$ . The regularized loss is
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal { L } _ { G } ( z ) = \mathbb { E } _ { z \sim p ( z ) } [ \mathcal { L } _ { c = 1 } ( G ( z ) ) + \lambda _ { \mathrm { d i s t } } \mathcal { L } _ { \mathrm { d i s t } } ( G ( z ) , z ) ] .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
# 4 ATTRIBUTE CONSTRAINTS: CONDITIONAL GENERATION
|
| 78 |
+
|
| 79 |
+
We want to generate samples that are realistic, but we also want to control what attributes they exhibit. Given binary attribute labels $y$ for a dataset, we can accomplish this by using a CGAN in the latent space, which amounts to replacing $D ( z )$ and $G ( z )$ with conditional versions $D ( z , y )$ and $G ( z , y )$ and concatenating $y$ to $z$ as input. If both the actor and critic see attribute information, $G$ must find points in latent space that could be samples from $q ( z )$ with attributes $y$ .
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 5: Identity-preserving transformations with optimization. Two separate critics are trained, one for attributes and one for the realism constraint. Starting at the latent points corresponding to the data reconstructions, we then perform gradient ascent in latent space on a weighted combination of critic values (1.0 attribute, 0.1 marginal posterior), stopping when a threshold value is passed for both critics. Images remain semantically close to the original because the pixel-wise likelihood of VAE training encourages identity-preserving reconstructions, and the dynamics of gradient ascent are naturally limited to finding solutions close in latent space. Panels are black for attributes of the original image, as the procedure just returns the original point in latent space.
|
| 83 |
+
|
| 84 |
+
This procedure is computationally inexpensive relative to training a generative model from scratch. In most of our experiments, we use a relatively large CGAN actor-critic pair (4 fully connected ReLU layers of 2048 units each), which during training uses about $9 6 \times$ fewer FLOPs/iteration than the unconditional VAE. We also trained a much smaller CGAN actor-critic pair (3 fully connected ReLU layers of 256 units), which uses about $2 8 8 4 \times$ fewer FLOPs/iteration than the VAE, and achieves only slightly worse results than the larger CGAN (supplemental Figure 14 and Table 1).
|
| 85 |
+
|
| 86 |
+
Figure 4 demonstrates the quality of conditional samples from a CGAN actor-critic pair and the effect of the distance penalty, which constrains generation to be closer to the prior sample, maintaining similarity between samples with different attributes. The regularized CGAN actor has less freedom to ignore modes by pushing many random $z$ vectors to the same area of the latent space, since it is penalized for moving samples from $p ( z )$ too far. The increased diversity across rows of the regularized CGAN is evidence that this regularization does fight mode-collapse (additional qualitative evidence is in supplemental Figures 7 and 8). However, without a distance penalty, samples appear more a bit realistic with more prominent attributes. This is supported by Table 1, where we use a separately trained attribute classification model to quantitatively evaluate samples. The actor with no penalty generates samples that are more accurately classified than the actor with a penalty but also shifts the samples much farther in latent space.
|
| 87 |
+
|
| 88 |
+
<table><tr><td>CelebA</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 Score</td><td>2ZMSE</td></tr><tr><td>(This Work) 10 Attributes</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Test Data</td><td>0.936</td><td>0.901</td><td>0.893</td><td>0.895</td><td></td></tr><tr><td>GcGAN(入dist = 0)</td><td>0.942</td><td>0.914</td><td>0.904</td><td>0.906</td><td>80.7</td></tr><tr><td>GcGAN(入dist = O) (Small Model) GcGAN(入dist = 0.1)</td><td>0.926 0.928</td><td>0.898</td><td>0.860</td><td>0.870</td><td>58.9</td></tr><tr><td>(Perarnau et al., 2016) 18 Attributes</td><td></td><td>0.903</td><td>0.863</td><td>0.874</td><td>17.0</td></tr><tr><td>Test Data</td><td>0.928</td><td></td><td></td><td></td><td></td></tr><tr><td>IcGAN</td><td>0.860</td><td></td><td></td><td>0.715 0.524</td><td></td></tr></table>
|
| 89 |
+
|
| 90 |
+
Table 1: Accuracy of a separate model trained to classify attributes from images, evaluated on test data and generated images. We condition and evaluate the generated images on the same labels as the test data. For comparison, the results of a similar task using invertible CGANs for generation (Perarnau et al., 2016) are provided. However, since the full list of salient attributes was not given in the paper, we emphasize that they are not directly comparable as the two experiments use a slightly different set of attribute labels. We also measure the distance in latent space that prior samples are shifted, weighted by $1 / \bar { \sigma _ { z } } ^ { 2 }$ . Actors trained with a latent distance penalty $\lambda _ { \mathrm { d i s t } }$ have slightly worse accuracy, but find latent points much closer to the prior samples and produce a greater diversity of images (see supplemental Figures 7 and 8). Interestingly, an actor trained without a distance penalty achieves higher classification accuracy than the test set itself, possibly by generating images with more exaggerated and distinctive features than real data. A ”small model” CGAN with $8 5 \mathrm { x }$ fewer parameters (3 fully connected layers of 256 units) generates images (supplemental Figure 14) of comperable quality. Due to the smaller capacity, the model finds more local solutions (smaller $z _ { M S E } )$ that have slightly less attribute accuracy, but are more visually similar to the prior sample without an explicit regularization term.
|
| 91 |
+
|
| 92 |
+
Although we used a VAE as the base generative model, our approach could also be used to generate high-quality conditional samples from pretrained classical autoencoders. We show in supplemental Figure 15 that we obtain reasonably good conditional samples (albeit with high-frequency spatial artifacts) as $\sigma _ { x } 0$ (equivalent to a classical autoencoder). Learning the decoder using VAE training encourages $\mathsf { q } ( \mathbf { z } )$ to fill up as much of the latent space as possible (without sacrificing reconstruction quality), which in turn encourages the decoder to map more of the latent space to reasonable-looking images. The prior $p ( z ) = \mathcal { N } ( \bar { 0 , } I )$ also imposes a natural scale on the latent variables.
|
| 93 |
+
|
| 94 |
+
# 5 IDENTITY-PRESERVING TRANSFORMATIONS
|
| 95 |
+
|
| 96 |
+
If we have a VAE that can produce good reconstructions of held-out data, we can transform the attributes of the output by gradient-based optimization. We simply need to train a critic, $D _ { a t t r } ( z )$ , to predict the attribute labels $p ( y \mid z )$ of the data embeddings $z \sim q ( z \mid x )$ , and use a cross-entropy loss to train. Then, starting from a data point, $z \sim q ( z \mid x )$ , we can perform gradient descent on the the realism constraint and attribute constraint jointly, $\mathcal { L } _ { D _ { \mathrm { r e a l } } } ( z ) + \lambda _ { \mathrm { a t t r } } \mathcal { L } _ { D _ { \mathrm { a t t r } } } ( z )$ . Note that it is helpful to maintain the realism constraint to keep the image from distorting unrealistically. Using the same procedure, we can also conditionally generate new samples (supplemental Figure 9) by starting from $z \sim p ( z )$ .
|
| 97 |
+
|
| 98 |
+
Figure 5 demonstrates transformations applied to samples from the held-out evaluation dataset. Note that since the reconstructions are close to the original images, the transformed images also maintain much of their structure. This contrasts with supplemental Figure 10, where a distance-penalty-free CGAN actor produces transformations that share attributes with the original but shift identity. We could preserve identity by introducing a distance penalty, but find that it is much easier to find the correct weighting of realism cost, attribute cost, and distance penalty through optimization, as each combination does not require retraining the network.
|
| 99 |
+
|
| 100 |
+
# 6 RULE-BASED CONSTRAINTS: ZERO-SHOT CONDITIONAL GENERATION
|
| 101 |
+
|
| 102 |
+
So far, we have assumed access to labeled data to train attribute classifiers. We can remove the need to provide labeled examples by leveraging the structure learned by our pre-trained model, using it to generate exemplars that are scored by a user-supplied reward function. If we constrain the reward function to be bounded, $c ( x ) : \mathbb { R } ^ { N } [ 0 , 1 ]$ , the problem becomes very similar to previous GAN settings, but now the actor, $G$ , and critic, $D$ , are working together. $D$ aims to best approximate the true value of each latent state, $\mathbb { E } _ { x \sim p ( x | z ) } c ( x )$ , and $G$ aims to shift samples from the prior to highvalue states. The critic loss is the cross-entropy from $c ( x )$ , and the actor loss is the same as $\mathcal { L } _ { G }$ in equation 3, where we again have a distance penalty to promote diversity of outputs.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 6: Transformations from a prior sample for the Melody VAE model. In each 16-bar pianoroll, time is in the horizontal direction and pitch in the vertical direction. In the prior sample, notes falling outside of the C Major scale are shown in red. After transformation by $G _ { \mathcal { P } = \mathrm { C } _ { \mathrm { M a j } } , d = 0 }$ , all sampled notes fall within the scale, without a significant change to note density. After transformation of the original $z$ by $G _ { \mathcal { P } = \mathrm { C _ { M a j } } , d = 1 9 2 }$ , all sampled notes lay within the scale and the density increases beyond 192. Synthesized audio of these samples can be heard at https://goo. ${ \mathfrak { g l } }$ /ouULt9.
|
| 106 |
+
|
| 107 |
+
Note that the reward function and VAE decoder need not necessarily be differentiable, as the critic learns a value function to approximate the reward, which the actor uses for training. To highlight this, we demonstrate that the output of a recurrent VAE model can be constrained to satisfy hardcoded rule-based constraints.
|
| 108 |
+
|
| 109 |
+
We first train an LSTM VAE (details in the Appendix) on melodic fragments. Each melody, $m$ , is represented as a sequence of categorical variables. In order to examine our ability to constrain the pitch classes and note density of the outputs, we define two reward functions, one that encourages notes from a set of pitches $\mathcal { P }$ , and another for that encourages melodies to have at least $d$ notes:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { c _ { \mathrm { p i t c h } } ( m , \mathcal { P } ) = \sum _ { p \in m } \mathbb { 1 } ( p \in \mathcal { P } ) / | m | \qquad c _ { \mathrm { d e n s i t y } } ( m , d ) = \operatorname* { m i n } ( 1 , | m | / d ) } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Figure 6 gives an example of controlling the pitch class and note density of generated outputs, which is quantitatively supported by the results in Table 2. During training, the actor goes through several phases of exploration and exploitation, oscillating between expanding to find new modes with high reward and then contracting to find the nearest locations of those modes, eventually settling into high value states that require only small movements in the latent space (supplemental Figure 11).
|
| 116 |
+
|
| 117 |
+
# 7 RELATED WORK
|
| 118 |
+
|
| 119 |
+
Conditional GANs (Mirza & Osindero, 2014) and VAEs (Sohn et al., 2015) introduce conditioning variables at training time. Sohn et al. (2015) allow these variables to affect the distribution in latent $z$ space, but still require that $p ( z \mid y )$ be a tractable distribution. Perarnau et al. (2016) use CGANs to adjust images, but because CGANs cannot usually reconstruct arbitrary inputs accurately, they must resort to image-space processing techniques to transfer effects to the original input. White (2016) propose adding “attribute vectors” to samples from $p ( z )$ as a simple and effective heuristic to perform transformations, which relies heavily on the linearity of the latent space.
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { \left. \begin{array} { l l l l } { { \bf A c t o r } } & { { \bf A c t o r } } & { { \bf \Phi } } & { { \bf c } _ { \mathrm { p i t c h } } ( m , \mathcal { P } = { \bf C } _ { \mathrm { M a j } } ) } & { c _ { \mathrm { d e n s i t y } } ( m , d = 1 9 2 ) } \\ { { \bf F r i o r } } & { { \bf 0 . 5 7 9 } ( 0 . 4 3 \% ) } & { { \bf 0 . 4 1 7 } ( 0 . 0 4 \% ) } & { - } \\ { G _ { { \mathcal P } = { \bf C } _ { \mathrm { M a j } } , d = 0 } } & { { \bf 0 . 9 9 1 } ( 7 0 . 8 \% ) } & { { \bf 0 . 4 5 9 } ( 0 . 0 1 \% ) } & { 0 . 0 1 5 } \\ { G _ { { \mathcal P } = { \bf C } _ { \mathrm { M a j } } , d = 1 9 2 } } & { { \bf 0 . 9 8 2 } ( 6 2 . 4 \% ) } & { { \bf 0 . 9 8 5 } ( 8 4 . 9 \% ) } & { { \bf 0 . 0 3 9 } } \end{array} \right| \left. \begin{array} { l } { { z } _ { \mathrm { M S E } } } \\ { { \bf 0 . 0 4 9 } } \\ { { \bf 0 . 0 1 5 } } \end{array} \right. } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Table 2: Average rewards and constraint satisfaction rates (in parentheses) for unconditional (Prior) and conditional generation. Samples from the prior receive low rewards, on average, and near zero satisfaction rates from both the pitch class (C Major) and note density $\ge 1 9 2$ notes) constraints. After applying an actor optimized only for the C Major scale $\scriptstyle \left( G _ { \mathcal { P } = \mathrm { C _ { M a j } } , d = 0 } \right)$ , the pitch class constraint is fully satisfied $7 0 . 8 \%$ of the time with only a minor effect on density. The average value close to 1 also indicates that when the constraint is not satisfied, it is typically off by only a few notes. Applying an actor function optimized for the C Major scale and high density $\scriptstyle \left( G _ { \mathcal { P } = \mathrm { C _ { M a j } } , d = 1 9 2 } \right)$ causes both constraints to be satisfied at high rates, with a slightly larger shift in latent space.
|
| 126 |
+
|
| 127 |
+
Some recent work has focused on applying more expressive prior constraints to VAEs (Rezende et al., 2014; Sønderby et al., 2016; Chen et al., 2017; Tomczak & Welling, 2017). The prior that maximizes the ELBO is $p ^ { \star } ( z ) = q ( z )$ (Hoffman & Johnson, 2016); one can interpret our realism constraint as trying to find an implicit distribution that is indistinguishable from $q ( z )$ . Like the adversarial autoencoder of Makhzani et al. (2016), our realism constraint relies on a discriminative model, but instead of trying to force $q ( z )$ to equal some simple $p ( z )$ , we only weakly constrain $q ( z )$ and then use a classifier to “clean up” our results.
|
| 128 |
+
|
| 129 |
+
Like this work, the recently proposed adversarially regularized autoencoder (Junbo et al., 2017) uses adversarial training to generate latent codes in a latent space discovered by an autoencoder; that work focuses on unconditional generation. Gomez-Bombarelli et al. (2016) train classifiers in the latent ´ space of a VAE to predict what latent variables map to molecules with various properties, and then use iterative gradient-based optimization in the latent space to find molecules that have a desired set of properties. On molecule data, their procedure generates invalid molecules rarely enough that they can simply reject these samples, which are detected using off-the-shelf software. By contrast, the probability of generating realistic images under our pretrained VAE is astronomically small, and no simple criterion for detecting valid images exists.
|
| 130 |
+
|
| 131 |
+
Jaques et al. (2017) also use a classifier to constrain generation; they use a Deep Q-network as an auxiliary loss for training an LSTM. Closest to Section 6, Nguyen et al. (2016a;b) generate very high quality conditional images by optimizing a sample from the latent space of a generative network to create an image that maximizes the class activations of a pretrained ImageNet classifier. Our work differs in that we learn an amortized generator/discriminator directly in the latent space and we achieve diversity through regularizing by the natural scale of the latent space rather than through a modified Langevin sampling algorithm.
|
| 132 |
+
|
| 133 |
+
# 8 DISCUSSION AND FUTURE WORK
|
| 134 |
+
|
| 135 |
+
We have demonstrated a new approach to conditional generation by constraining the latent space of an unconditional generative model. This approach could be extended in a number of ways.
|
| 136 |
+
|
| 137 |
+
One possibility would be to plug in different architectures, including powerful autoregressive decoders or adversarial decoder costs, as we make no assumptions specific to independent likelihoods. While we have considered constraints based on implicit density estimation, we could also estimate the constrained distribution directly with an explicit autoregressive model or another variational autoencoder. The efficacy of autoregressive priors in VAEs is promising for this approach (Kingma et al., 2016). Conditional samples could then be obtained by ancestral sampling, and transformations by using gradient ascent to increase the likelihood under the model. Active or semisupervised learning approaches could reduce the sample complexity of learning constraints. Real-time constraint learning would also enable new applications; it might be fruitful to extend the reward approximation of Section 6 to incorporate user preferences as in (Christiano et al., 2017).
|
| 138 |
+
|
| 139 |
+
# ACKNOWLEDGMENTS
|
| 140 |
+
|
| 141 |
+
Many thanks to Jascha Sohl-Dickstein, Colin Raffel, and Doug Eck for their helpful brainstorming and encouragement.
|
| 142 |
+
|
| 143 |
+
# REFERENCES
|
| 144 |
+
|
| 145 |
+
Bernardo, Zbyszyski, Fiebrink, and Grierson. Interactive machine learning for end-user innovation. In Proceedings of the AAAI Symposium Series: Designing the User Experience of Machine Learning Systems, 2017. URL http://research.gold.ac.uk/19767/1/ BernardoZbyszynskiFiebrinkGrierson_UXML_2017.pdf.
|
| 146 |
+
|
| 147 |
+
Christopher M Bishop. Pattern recognition and machine learning (information science and statistics) springer-verlag new york. Inc. Secaucus, NJ, USA, 2006.
|
| 148 |
+
|
| 149 |
+
Andrew Brock, Theodore Lim, J. M. Ritchie, and Nick Weston. Neural Photo Editing with Introspective Adversarial Networks. arXiv preprint, 2016. URL https://arxiv.org/abs/ 1609.07093.
|
| 150 |
+
|
| 151 |
+
Xi Chen, Diederik P. Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational Lossy Autoencoder. In Proceedings of the International Conference on Learning Representations (ICLR), 2017. URL http://arxiv.org/abs/ 1611.02731.
|
| 152 |
+
|
| 153 |
+
Paul Christiano, Jan Leike, Tom B Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. arXiv preprint, 2017. URL https://arxiv. org/abs/1706.03741.
|
| 154 |
+
|
| 155 |
+
Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. ¨ arXiv preprint arXiv:1605.09782, 2016.
|
| 156 |
+
|
| 157 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially Learned Inference. In Proceedings of the International Conference on Learning Representations (ICLR), 2016. URL https://arxiv.org/ abs/1606.00704.
|
| 158 |
+
|
| 159 |
+
R. Gomez-Bombarelli, J. N. Wei, D. Duvenaud, J. M. Hern ´ andez-Lobato, B. S ´ anchez-Lengeling, ´ D. Sheberla, J. Aguilera-Iparraguirre, T. D. Hirzel, R. P. Adams, and A. Aspuru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. ArXiv e-prints, October 2016.
|
| 160 |
+
|
| 161 |
+
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 (NIPS), 2014. URL http://papers.nips.cc/paper/5423- generative-adversarial-nets.pdf.
|
| 162 |
+
|
| 163 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved Training of Wasserstein GANs. arXiv preprint, 2017. URL http://arxiv.org/ abs/1704.00028.
|
| 164 |
+
|
| 165 |
+
Matthew D. Hoffman and Matthew J. Johnson. ELBO surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, 2016. URL http://approximateinference.org/accepted/ HoffmanJohnson2016.pdf.
|
| 166 |
+
|
| 167 |
+
Natasha Jaques, Shixiang Gu, Dzmitry Bahdanau, Jos Miguel Hernndez-Lobato, Richard E. Turner, and Douglas Eck. Sequence tutor: Conservative fine-tuning of sequence generation models with kl-control. In Proceedings of the International Conference on Learning Representations (ICLR), 2017. URL https://arxiv.org/abs/1611.02796.
|
| 168 |
+
|
| 169 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pp. 694–711. Springer, 2016.
|
| 170 |
+
|
| 171 |
+
Junbo, Zhao, Yoon Kim, Kelly Zhang, Alexander M. Rush, and Yann LeCun. Adversarially Regularized Autoencoders for Generating Discrete Structures. arXiv preprint, 2017. URL http://arxiv.org/abs/1706.04223.
|
| 172 |
+
|
| 173 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2015. URL http:// arxiv.org/abs/1412.6980.
|
| 174 |
+
|
| 175 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the International Conference on Learning Representations (ICLR), 2013. URL http://arxiv. org/abs/1312.6114.
|
| 176 |
+
|
| 177 |
+
Diederik P. Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improving Variational Inference with Inverse Autoregressive Flow. In Advances in Neural Information Processing Systems (NIPS), 2016. URL http://arxiv.org/abs/1606.04934.
|
| 178 |
+
|
| 179 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
|
| 180 |
+
|
| 181 |
+
Chuan Li and Michael Wand. Precomputed real-time texture synthesis with markovian generative adversarial networks. In European Conference on Computer Vision, pp. 702–716. Springer, 2016.
|
| 182 |
+
|
| 183 |
+
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), 2015. URL https: //arxiv.org/abs/1411.7766.
|
| 184 |
+
|
| 185 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, and Ian Goodfellow. Adversarial autoencoders. In Proceedings of the International Conference on Learning Representations (ICLR), 2016. URL http://arxiv.org/abs/1511.05644.
|
| 186 |
+
|
| 187 |
+
Mehdi Mirza and Simon Osindero. Conditional Generative Adversarial Nets. arXiv preprint, 2014. URL http://arxiv.org/abs/1411.1784.
|
| 188 |
+
|
| 189 |
+
Anh Nguyen, Alexey Dosovitskiy, Jason Yosinski, Thomas Brox, and Jeff Clune. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In Advances in Neural Information Processing Systems (NIPS), 2016a. URL https://arxiv.org/abs/ 1605.09304.
|
| 190 |
+
|
| 191 |
+
Anh Nguyen, Jason Yosinski, Yoshua Bengio, Alexey Dosovitskiy, and Jeff Clune. Plug & play generative networks: Conditional iterative generation of images in latent space. arXiv preprint arXiv:1612.00005, 2016b.
|
| 192 |
+
|
| 193 |
+
Guim Perarnau, Joost van de Weijer, Bogdan Raducanu, and Jose M. Alvarez.´ Invertible Conditional GANs for image editing. In Workshop on Adversarial Training, NIPS, 2016. URL http://arxiv.org/abs/1611.06355http://www.cvc.uab. es/LAMP/wp-content/uploads/Projects/pdfs/presentationNIPS.pdf.
|
| 194 |
+
|
| 195 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015. URL http:// arxiv.org/abs/1511.06434.
|
| 196 |
+
|
| 197 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 198 |
+
|
| 199 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems 29, 2016. URL http://papers.nips.cc/paper/6125-improvedtechniques-for-training-gans.pdf.
|
| 200 |
+
|
| 201 |
+
Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In Advances in Neural Information Processing Systems (NIPS), 2015. URL http://papers.nips.cc/paper/5775-learning-structuredoutput-representation-using-deep-conditional-generativemodels.pdf.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
Jakub M. Tomczak and Max Welling. VAE with a VampPrior. CoRR, abs/1705.07120, 2017. URL http://arxiv.org/abs/1705.07120.
|
| 206 |
+
|
| 207 |
+
Dmitry Ulyanov, Vadim Lebedev, Andrea Vedaldi, and Victor S. Lempitsky. Texture networks: Feed-forward synthesis of textures and stylized images. In Proceedings of the 33rd International Conference on Machine Learning (ICML), 2016. URL http://arxiv.org/abs/1603. 03417.
|
| 208 |
+
|
| 209 |
+
Tom White. Sampling generative networks: Notes on a few effective techniques. arXiv preprint, 2016. URL https://arxiv.org/abs/1609.04468.
|
| 210 |
+
|
| 211 |
+
# 9 APPENDIX
|
| 212 |
+
|
| 213 |
+
# 9.1 EXPERIMENTAL DETAILS
|
| 214 |
+
|
| 215 |
+
For images, we use the MNIST digits dataset (LeCun & Cortes, 2010) and the Large-scale CelebFaces Attributes (CelebA) dataset (Liu et al., 2015). MNIST images are $2 8 \times 2 8$ pixels and greyscale scaled to [0, 1]. For attributes, we use the number class label of each digit. CelebA images are centercropped to $1 2 8 \times 1 2 8$ pixels and then downsampled to $6 4 \times 6 4$ RGB pixels and scaled to [0, 1]. We find that many of the attribute labels are not strongly correlated with changes in the images, so we narrow the original 40 attributes to the 10 most visually salient: blond hair, black hair, brown hair, bald, eyeglasses, facial hair, hat, smiling, gender, and age.
|
| 216 |
+
|
| 217 |
+
For melodies, we scraped the web to collect over 1.5 million publicly available MIDI files. We then extracted 16-bar melodies by sliding a window with a single bar stride over each non-percussion instrument with a $\frac { 4 } { 4 }$ time signature, keeping only the note with the highest pitch when multiple overlap. This produced over 3 million unique melodies. We represent each melody as a sequence of 256 (16 per bar) categorical variables taking one of 130 discrete states at each sixteenth note: 128 note-on pitches, a hold state, and a rest state.
|
| 218 |
+
|
| 219 |
+
# 9.2 MODEL ARCHITECTURES
|
| 220 |
+
|
| 221 |
+
All encoders, decoders, and classifiers are trained with the Adam optimizer (Kingma & Ba, 2015), with learning rate $= 3 \mathrm { e } { - } 4$ , $\beta _ { 1 } = 0 . 9$ , and $\beta _ { 2 } = 0 . 9 9 9$ .
|
| 222 |
+
|
| 223 |
+
To train $D _ { r e a l } ( z ) , D _ { a t t r } ( z )$ and $G ( z )$ we follow the training procedure of Gulrajani et al. (2017), applying a gradient penalty of 10, training $D$ and $G$ in a 10:1 step ratio, and use the Adam optimizer with learning rate $= 3 \mathrm { e } { - } 4$ , $\beta _ { 1 } ~ = 0 . 0$ , and $\beta _ { 2 } ~ = 0 . 9$ . While not necessary to converge, we find it improves the stability of optimization. We do not apply any of the other tricks of GAN training such as batch normalization, minibatch discrimination, or one-sided label smoothing (Radford et al., 2015; Salimans et al., 2016). As samples from $p ( z )$ are easier to discriminate than samples from $G ( p ( z ) )$ , we train $D$ by sampling from $p ( z )$ at a rate 10 times less than $G ( p ( z ) )$ . For actors with inner-loop optimization, $G _ { \mathrm { o p t } }$ , 100 iterations of Adam are used with with learning rate $= 1 \mathrm { e } \mathrm { - } 1$ , $\beta _ { 1 } =$ 0.9, and $\beta _ { 2 } = 0 . 9 9 9$ .
|
| 224 |
+
|
| 225 |
+
# 9.2.1 MNIST FEED-FORWARD VAE
|
| 226 |
+
|
| 227 |
+
To model the MNIST data, we use a deep feed-forward neural network (Figure 13a).
|
| 228 |
+
|
| 229 |
+
The encoder is a series of 3 linear layers with 1024 outputs, each followed by a ReLU, after which an additional linear layer is used to produce 2048 outputs. Half of the outputs are used as the $\mu$ and the softplus of the other half are used as the $\sigma$ to parameterize a 1024-dimension multivariate Gaussian distribution with a diagonal covariance matrix for $z$ .
|
| 230 |
+
|
| 231 |
+
The decoder is a series of 3 linear layers with 1024 outputs, each followed by a ReLU, after which an additional linear layer is used to produce $2 8 \mathbf { x } 2 8$ outputs. These outputs are then passed through a sigmoid to generate the output image.
|
| 232 |
+
|
| 233 |
+
# 9.2.2 CELEBA CONVOLUTIONAL VAE
|
| 234 |
+
|
| 235 |
+
To model the CelebA data, we use a deep convolutional neural network (Figure 13b).
|
| 236 |
+
|
| 237 |
+
The encoder is a series of $4 ~ 2 \mathrm { D }$ convolutional layers, each followed by a ReLU. The convolution kernels are of size $3 \times 3$ , $3 \times 3$ , $5 \times 5$ , and $5 \times 5$ , with 2048, 1024, 512, and 256 output channels, respectively. All convolutional layers have a stride of 2. After the final ReLU, a linear layer is used to produce 2048 outputs. Half of the outputs are used as the $\mu$ and the softplus of the other half are used as the $\sigma$ to parameterize a 1024-dimension multivariate Gaussian distribution with a diagonal covariance matrix for $z$ .
|
| 238 |
+
|
| 239 |
+
The decoder passes the $z$ through a $4 \mathrm { x } 4 \mathrm { x } 2 0 4 8$ linear layer, and then a series of 4 2D transposed convolutional layers, all but the last of which are followed by a ReLU. The deconvolution kernels are of size $5 \times 5 , 5 \times 5 , 3 \times 3$ , and $3 \times 3$ , with 1024, 512, 256, and 3 output channels, respectively. All deconvolution layers have a stride of 2. The output from the final deconvolution is passed through a sigmoid to generate the output image.
|
| 240 |
+
|
| 241 |
+
The classifier that is trained to predict labels from images are identical to the VAE encoders except that they end with a sigmoid cross-entropy loss.
|
| 242 |
+
|
| 243 |
+
# 9.2.3 MELODY SEQUENCE VAE
|
| 244 |
+
|
| 245 |
+
Music is fundamentally sequential, so we use an LSTM-based sequence VAE for modelling monophonic melodies (Figure 13c).
|
| 246 |
+
|
| 247 |
+
The encoder is made up of a single-layer bidirectional LSTM, with 2048 units per cell. The final output in each direction is concatenated and passed through a linear layer to produce 1024 outputs. Half of the outputs are used as the $\mu$ and the softplus of the other half are used as a $\sigma$ to parameterize a 512-dimension multivariate Gaussian distribution with a diagonal covariance matrix for $z$ .
|
| 248 |
+
|
| 249 |
+
Since musical sequences often have structure at the bar level, we use a hierarchical decoder to model long melodies. First, the $z$ goes through a linear layer to initialize the state of a 2-layer LSTM with 1024 units per layer, which outputs 16 embeddings of size 512 each, one per bar. Each of these embeddings are passed through a linear layer to produce 16 initial states for another 2-layer LSTM with 1024 units per layer. This bar-level LSTM autoregressively produces individual sixteenth note events, passing its output through a linear layer and softmax to create a distribution over the 130 classes. This categorical distribution is used to compute a cross-entropy loss during training or samples at inference time. In addition to generating the initial state at the start of each bar, the embedding for the current bar is concatenated with the previous output as the input at each time step.
|
| 250 |
+
|
| 251 |
+
# 9.2.4 ACTOR FEED-FORWARD NETWORK
|
| 252 |
+
|
| 253 |
+
For $G ( z )$ , we use a deep feed-forward neural network (Figure 12a) in all of our experiments.
|
| 254 |
+
|
| 255 |
+
The network is a series of 4 linear layers with 2048 outputs, each followed by a ReLU, after which an additional linear layer is used to produce $2 * d i m ( z )$ outputs. Half of the outputs are used as the $\delta z$ and the sigmoid of the other half are used as gates. The transformed $z ^ { \prime }$ is the computed as $( 1 - g a t e s ) * z + g a t e s * \delta z$ . This aids in training as the network only has to then predict shifts in $z$ .
|
| 256 |
+
|
| 257 |
+
When conditioning on attribute labels, $y$ , to compute $G ( z , y )$ , the labels are passed through a linear layer producing 2048 outputs which are concatenated with $z$ as the model input.
|
| 258 |
+
|
| 259 |
+
# 9.2.5 CRITIC FEED-FORWARD NETWORK
|
| 260 |
+
|
| 261 |
+
For $D ( z )$ , we use a deep feed-forward neural network (Figure 12b) in all of our experiments.
|
| 262 |
+
|
| 263 |
+
The network is a series of 4 linear layers with 2048 outputs, each followed by a ReLU, after which an additional linear layer is used to produce a single output. This output is passed through a sigmoid to compute $D ( z )$ .
|
| 264 |
+
|
| 265 |
+
When conditioning on attribute labels, $y$ , to compute $D ( z , y )$ , the labels are passed through a linear layer producing 2048 outputs which are concatenated with $z$ as the model input.
|
| 266 |
+
|
| 267 |
+
# 9.3 SUPPLEMENTAL FIGURES
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 7: Additional generated CelebA faces by $G _ { \mathrm { C G A N } }$ with $\lambda _ { \mathrm { d i s t } } = 0$ . Full attribute labels are given in supplementary Table 3
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 8: Additional generated CelebA faces by $G _ { \mathrm { C G A N } }$ with $\lambda _ { \mathrm { d i s t } } = 0 . 1$ . Full attribute labels are given in supplementary Table 3
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 9: Optimization of samples drawn from the prior to satisfy both the realism constraint and attribute constraints (drawn from the test set). The optimization takes 100 steps, and images are shown at 0, 10, 30, 50 and 100 steps. $D$ is trained with inner-loop optimization, $G _ { \mathrm { o p t } }$ , as described in Section 9.2
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 10: Identity-distorting transformations with CGAN actor-critic. Without a penalty to encourage small moves in latent space, the actor maps the latent vectors of the original data points to generated images that have the correct attributes, but a different identity. Panels are black for attributes of the original image, as the procedure just returns the same image as the reconstruction.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 11: Training curves for melody actor $( G )$ and critic $( D )$ pair for pitch class constraint $c _ { \mathrm { p i t c h } } ( m , \mathcal { P } = \mathrm { C _ { M a j } } ) ,$ ).
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 12: Architecture for the (a) actors and (b) critics used in all experiments.
|
| 286 |
+
|
| 287 |
+
Table 3: Complete list of attributes for label names in Figures 4, 7, and 8
|
| 288 |
+
|
| 289 |
+
<table><tr><td>Figure Label</td><td>Bald</td><td>Black Hair</td><td>Blond Hair</td><td>Brown Hair</td><td>Eye- glasses</td><td>Male</td><td>Beard</td><td>Smiling</td><td>Hat</td><td>Young</td></tr><tr><td>Blond Hair</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Brown Hair</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Black Hair</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Male</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Facial Hair</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Eyeglasses</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Bald</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>0</td><td>1</td></tr><tr><td>Aged</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>0</td></tr></table>
|
| 290 |
+
|
| 291 |
+
<table><tr><td></td><td>LL</td><td>KL</td><td>ELBO</td></tr><tr><td>1</td><td>-11360</td><td>30</td><td>-11390</td></tr><tr><td>1e-1</td><td>-11325</td><td>150</td><td>-11475</td></tr><tr><td>1e-2</td><td>15680</td><td>600</td><td>15080</td></tr><tr><td>1e-3</td><td>16090</td><td>1950</td><td>14140</td></tr><tr><td>1e-4</td><td>16150</td><td>3650</td><td>12500</td></tr></table>
|
| 292 |
+
|
| 293 |
+
Table 4: Selection of $\sigma _ { x } = 0 . 1$ for the CelebA VAEs by ELBO maximization. All results are given in Nats.
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 13: Architectures for the (a) feed-forward MNIST, (b) convolutional CelebA, and (c) hierarchical LSTM melody VAEs. In (b), all convolutions have a stride of 2. In (c), LSTM cells shown in the same color share weights and linear layers between levels are omitted.
|
| 297 |
+
|
| 298 |
+
# Small G/D Models (256 ReLU × 3)
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 14: Samples generated with smaller (3 ReLU layers of 256 units each) $G$ and $D$ models are comparable quality despite having $8 5 \mathrm { x }$ fewer parameters, $\lambda _ { \mathrm { d i s t } } = 0 . 0$ . Full attribute labels are given in supplementary Table 3.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 15: Latent constraints applied to a vanilla autoencoder with no latent prior. Samples are similar quality to VAEs with $\sigma _ { x } ~ = ~ 0 . 1$ , but with less diversity and more high-frequency visual artifacts. Full attribute labels are given in supplementary Table 3.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 16: Smaller decoder standard deviations, $\sigma _ { x }$ , lead to lower-variance posteriors, $\sigma _ { z } ( x )$ of the encoder $q ( z \mid x )$ , averaged over the training set per a dimension. The $\mathbf { X } ^ { } -$ -axis is sorted from lowest to highest variance. Tighter posteriors correspond to more utilization of the latent dimension, and we scale our distance regularization the square inverse on a per-dimension basis.
|
md/train/SyNPk2R9K7/SyNPk2R9K7.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO DESCRIBE SCENES WITH PROGRAMS
|
| 2 |
+
|
| 3 |
+
Yunchao Liu∗ IIIS, Tsinghua University
|
| 4 |
+
|
| 5 |
+
Zheng Wu MIT CSAIL, Shanghai Jiao Tong University
|
| 6 |
+
|
| 7 |
+
Daniel Ritchie Brown University
|
| 8 |
+
|
| 9 |
+
William T. Freeman MIT CSAIL, Google Research
|
| 10 |
+
|
| 11 |
+
Joshua B. Tenenbaum MIT CSAIL
|
| 12 |
+
|
| 13 |
+
Jiajun Wu MIT CSAIL
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Human scene perception goes beyond recognizing a collection of objects and their pairwise relations. We understand higher-level, abstract regularities within the scene such as symmetry and repetition. Current vision recognition modules and scene representations fall short in this dimension. In this paper, we present scene programs, representing a scene via a symbolic program for its objects, attributes, and their relations. We also propose a model that infers such scene programs by exploiting a hierarchical, object-based scene representation. Experiments demonstrate that our model works well on synthetic data and transfers to real images with such compositional structure. The use of scene programs has enabled a number of applications, such as complex visual analogy-making and scene extrapolation.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
When examining the image in Figure 1a, we instantly recognize the shape, color, and material of the objects it depicts. We can also effortlessly imagine how we may extrapolate the set of objects in the scene while preserving object patterns (Figure 1b). Our ability to imagine unseen objects arises from holistic scene perception: we not only recognize individual objects from an image, but naturally perceive how they should be organized into higher-level structure (Rock & Palmer, 1990).
|
| 22 |
+
|
| 23 |
+
Recent AI systems for scene understanding have made impressive progress on detecting, segmenting, and recognizing individual objects (He et al., 2017). In contrast, the problem of understanding high-level, abstract relations among objects is less studied. While a few recent papers have attempted to produce a holistic scene representation for scenes with a variable number of objects (Ba et al., 2015; Huang & Murphy, 2015; Eslami et al., 2016; Wu et al., 2017), the relationships among these objects are not captured in these models.
|
| 24 |
+
|
| 25 |
+
The idea of jointly discovering objects and their relations has been explored only very recently, where the learned relations are often in the form of interaction graphs (van Steenkiste et al., 2018; Kipf et al., 2018) or semantic scene graphs (Johnson et al., 2015), both restricted to pairwise, local relations. However, our ability to imagine extrapolated images as in Figure 1 relies on our knowledge of long-range, hierarchical relationships among objects, such as how objects are grouped and what patterns characterize those groups.
|
| 26 |
+
|
| 27 |
+
In this paper, we aim to tackle the problem of understanding higher-level, abstract regularities such as repetition and symmetry. We propose to represent scenes as scene programs. We define a domainspecific language for scenes, capturing both objects with their geometric and semantic attributes, as well as program commands such as loops to enforce higher-level structural relationships. Given an image of a complex scene, we propose to infer its scene program via a hierarchical bottom-up approach. First, we parse the image into individual objects and infer their attributes, resulting in the object representation. Then, we organize these objects into different groups, i.e. the group representation, where objects in each group fall into the same program block. Finally, we describe each group with a program, and combine these programs to get the program representation for the entire scene.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: High-level scene understanding. Given original image (a), we are able to imagine unseen objects based on the structural relations among existing objects, resulting in extrapolated image (b).
|
| 31 |
+
|
| 32 |
+
Our model applies deep neural networks for each stage of this process and is able to generate programs describing the input image with high accuracy. When testing on scenes that are more complex than those used for training, our hierarchical inference process achieves better generalization performance than baseline methods that attempt to infer a program directly from the image. Our model is also able to handle ambiguity, generating multiple possible programs when there is more than one way to describe the scene. Furthermore, our method generalizes to real-world images without any additional supervised training programs; only the low-level object detection module must be re-trained. Finally, we demonstrate how our model facilitates high-level image editing, as users can change parameters in the inferred program to achieve the editing effects they want more efficiently. We show examples of such image edits, including extrapolations such as the one in (Figure 1b), on both synthetic and photographic images.
|
| 33 |
+
|
| 34 |
+
Our contributions are therefore three-fold:
|
| 35 |
+
|
| 36 |
+
1. We propose scene programs: a new representation for scenes, drawing insights from classic findings in cognitive science and computer graphics.
|
| 37 |
+
2. We present a method for inferring scene programs from images using a hierarchical approach (from objects to groups to programs).
|
| 38 |
+
3. We demonstrate that our model can achieve high accuracy on describing both synthetic and constrained real scenes with programs. Combined with modern image-to-image translation methods, our model generates realistic images of extrapolated scenes, capturing both highlevel scene structure and low-level object appearance.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK
|
| 41 |
+
|
| 42 |
+
Describing Images with Programs Ellis et al. (2018) performs a similar task as ours where handdrawn images of 2D geometry primitives are converted to high-level programs. This work uses a constraint-based SAT solver to perform program search and is much slower than neural network models. IM2LATEX (Deng et al., 2017) de-renders images into low-level $\mathrm { { I A I R } X }$ markup using a neural network, while our work discovers high-level programs from an image of objects. SPIRAL (Ganin et al., 2018) uses reinforcement learning to infer a sequence of low-level drawing commands that can reproduce an image, meanwhile learning a distribution from which images can be sampled. Beltramelli (2018) learns to convert GUI images to markup-like code. Unlike these papers, our model performs program induction in 3D and infers high-level structural patterns both in object layout and color.
|
| 43 |
+
|
| 44 |
+
Describing the Structure of 3D Shapes and Scenes Beyond 2D images, prior work in vision and graphics has attempted to infer high-level structure from 3D objects and 3D scenes. The most relevant to our approach are those that extract a so-called symmetry hierarchy, in which 3D geometry is hierarchically grouped by either attachment or symmetric relationships (Wang et al., 2011). This representation has been used to train generative models of 3D shapes (Li et al., 2017) and indoor 3D scenes (Li et al., 2019), as well as to infer a hierarchical bounding box structure from a single image of a 3D shape (Niu et al., 2018). Our program representation bears some resemblance to the symmetry hierarchy, but it generalizes to repetitive patterns beyond symmetries and also models patterns in object visual attributes (e.g., color). CSGNet (Sharma et al., 2018) learns to parse shapes with a set of primitive and arithmetic commands; Tulsiani et al. (2017) parses shapes into an assembly of geometric primitives. In this paper, we focus on learning the high-level scene regularities described by loop structures.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: Our model for visual program synthesis. (a) The input is an image consisting of multiple objects with ordered arrangements. We also perform instance segmentation to get object masks. (b) We use two vision models to extract object attributes and predict object groups, respectively. (c) These representations are then sent to a sequence model to predict the program.
|
| 48 |
+
|
| 49 |
+
Neural Program Synthesis In general, a program synthesis model outputs an explicit program by learning from examples. Recent works on neural program synthesis include R3NN (Parisotto et al., 2017) and RobustFill (Devlin et al., 2017), which perform end-to-end program synthesis from input/output examples. Bunel et al. (2018) goes beyond the pure supervised learning setting and improves performance on diversity and syntax by leveraging grammar and reinforcement learning. These models synthesize programs based on input/output pairs, which is different from our setting, where a program is generated to describe an input image. In the vision domain, Sun et al. (2018) learns decision strategies represented as programs from demonstration videos, while we focus on describing the complex correlations among objects in static scenes.
|
| 50 |
+
|
| 51 |
+
# 3 METHOD
|
| 52 |
+
|
| 53 |
+
Our model combines vision and sequence models via structured representations. An object parser predicts the segmentation mask and attributes for each object in the image. A group recognizer predicts the group that each object belongs to. Finally, a program synthesizer generates a program block for each object group. Figure 2 shows an example of synthesizing programs from an input image, where a sphere is selected at random (highlighted) and the group that this object belongs to is predicted, which consists of six spheres. Then the program for this group (highlighted) is synthesized.
|
| 54 |
+
|
| 55 |
+
# 3.1 A DOMAIN-SPECIFIC LANGUAGE (DSL) FOR SCENES
|
| 56 |
+
|
| 57 |
+
In order to constrain the program space to make it tractable for our models, we introduce human prior on scene regularities that can be described as programs. More specifically, we introduce a Domain Specific Language (DSL) which explicitly defines the space of our scene programs. We present the grammar of our DSL in Table 1, which contains 3 primitive commands (cube, sphere, cylinder) and 2 loop structures (for, rotate). The positions for each object are defined as affine transformations of loop indices, while the colors are more complicated functions of the loop indices, displaying alternating (modular) and repeating (division) patterns.
|
| 58 |
+
|
| 59 |
+
Furthermore, since the DSL allows unbounded program depth, we define program blocks to further reduce complexity. Each type of program block is an production instance of the Statement token, and objects that belong to the same block form a group. For example, in this work the program blocks include single objects, layered for loops of depth $\leq 3$ , and single-layer rotations of $\leq 4$ objects.
|
| 60 |
+
|
| 61 |
+
Table 1: Grammar of the scene program. Primitive commands (cube, sphere, cylinder) can be placed inside loop structures, where the position and color of each object are determined by the loop indices.
|
| 62 |
+
|
| 63 |
+
<table><tr><td>Program →</td><td>Statement; ···; Statement</td></tr><tr><td>Statement</td><td></td></tr><tr><td></td><td>Cube(pos=Expression1,color=Expression2) sphere(pos=Expression1,color=Expression2)</td></tr><tr><td>Statement Statement</td><td>cylinder(pos=Expression1,color=Expression2)</td></tr><tr><td></td><td>for(0 ≤Varl <Expression1){Program}</td></tr><tr><td>Statement Statement</td><td>rotate(O ≤ Var1 < Expression1,start=Z,center=(Z,Z,Z)){Program}</td></tr><tr><td>Expression1</td><td></td><td>Z ×Var1+·+Z ×Var1+ Z</td></tr><tr><td>Expression2</td><td>→ →</td><td>Z × Var2+· + Z × Var2+ Z</td></tr><tr><td>Var1</td><td>→</td><td>a free variable</td></tr><tr><td>Var2</td><td></td><td>Var1|Var1 % Z|Var1 / Z</td></tr><tr><td>Z</td><td>→</td><td>integer</td></tr></table>
|
| 64 |
+
|
| 65 |
+
# 3.2 OBJECT PARSING
|
| 66 |
+
|
| 67 |
+
Following the spirit of The Trace Hypothesis (Ellis et al., 2018), we use object attributes as an intermediate representation between image space and structured program space. Parsing individual objects from the input image consists of two steps: mask prediction and attribute prediction. For each object, its instance segmentation mask is predicted by a Mask R-CNN (He et al., 2017). Next, the mask is concatenated with the original image, and sent to a ResNet-34 (He et al., 2015) to predict object attributes. In our work, object attributes include shape, size, material, color and 3D coordinates. Each attribute is encoded as a one-hot vector, except for coordinates. The overall representation of an object is a vector of length 18. The networks are trained with ground truth masks and attributes, respectively. For the attribute network, we minimize the mean-squared error between output and ground truth attributes.
|
| 68 |
+
|
| 69 |
+
# 3.3 GROUP DETECTION
|
| 70 |
+
|
| 71 |
+
When we identify a distinct visual pattern, we first know which objects in the image form the pattern before we can tell what the pattern is. Motivated by this idea, we develop a group recognizer that tells us which objects form a group that can be described by a single program block. The group recognizer works after mask prediction is performed, and answers the following specific question: given an input object, which objects are in the same group with this object?
|
| 72 |
+
|
| 73 |
+
The input to the model consists of three parts: the original image, the mask of the input object, and the mask of all objects. These three parts are concatenated and sent to a ResNet-152 followed by fully connected layers. The output contains two parts: a binary vector $g$ where $g [ i ] = 1$ denotes object $i$ in the same group with the input object, and the category $c$ of the group, representing the type of program block that this group belongs to. The network is trained to minimize the binary cross entropy loss for group recognition, and the cross entropy loss for category classification.
|
| 74 |
+
|
| 75 |
+
# 3.4 NEURAL PROGRAM SYNTHESIS
|
| 76 |
+
|
| 77 |
+
With the object attributes and groups obtained from the vision models, the final step in our model is to generate program sequences describing the input image. Since we have already detected object groups, what remains is to generate a program block for each group. For this goal we train a sequence to sequence (seq2seq) LSTM with an encoder-decoder structure and attention mechanism (Luong et al., 2015; Bahdanau et al., 2015). The input sequence is a set of object attributes that form a group, which are sorted by their 3D coordinates. The output program consists of two parts: program tokens are predicted as a sequence as in neural machine translation, and program parameters are predicted by a MLP from the hidden state at each time step. At each step, we predict a token $t$ as well as a
|
| 78 |
+
|
| 79 |
+
Result: a program sequence $P$
|
| 80 |
+
Input: a set of object attributes $O$ ;
|
| 81 |
+
while $O$ is not empty do randomly choose $o _ { i } \in O$ ; predict the group that contains $o _ { i }$ , indexed by $G$ ; also predict the group category $c$ ; get attributes of objects that belong to the group, $A = \{ o _ { j } | j \in G \}$ ; remove $A$ from $O$ ; send $A , c$ to program synthesizer, get program $p$ ; add $p$ to $P$ ;
|
| 82 |
+
end
|
| 83 |
+
|
| 84 |
+
parameter matrix $P$ , which contains predicted parameters for all possible tokens. Then we use $P [ t ]$ as the output parameter for this step.
|
| 85 |
+
|
| 86 |
+
Since the program synthesizer only works for a single group, a method for combining the group prediction with program synthesis is needed. Consider the simplest case where we randomly choose an object and describe the group it belongs to. This procedure is described in Algorithm 1. In practice, by default we sample 10 times and stop when a correct program is generated. Here correct means that we can recover the scene attributes successfully by executing the program.
|
| 87 |
+
|
| 88 |
+
# 4 EXPERIMENTS
|
| 89 |
+
|
| 90 |
+
We perform several experiments on synthetic scene images, including quantitative comparison with baseline methods and further extensions and applications. We further demonstrate our model’s ability to generalize to real images with a small amount of hand-labeled supervision which is only at the object level. We also apply our method to other tasks, specifically image extrapolation and visual analogy-making, on both synthetic and real images.
|
| 91 |
+
|
| 92 |
+
# 4.1 DATASET
|
| 93 |
+
|
| 94 |
+
We create a synthetic dataset of images rendered from complex scenes with rich program structures. Figure 3 displays some examples drawn from the dataset. These images are generated by first sampling scenes and then rendering using the same renderer as in CLEVR (Johnson et al., 2017). Each scene consists of a few groups, where objects in the same group can be described by a program block. The groups are sampled from predefined program primitives with multi-layered translational and rotational symmetries. Further, we also incorporate rich color patterns into the primitives.
|
| 95 |
+
|
| 96 |
+
Our synthetic dataset includes annotations on object attributes and programs. We train and test the models on two synthetic datasets, REGULAR and RANDOM, each containing 20,000 training and 500 test images, where each image has at most 2 groups of multiple objects, in addition to many groups of a single object. In the REGULAR dataset (Figure 3a), the objects are placed on a grid and have discrete coordinates. We increase the scene complexity by adding randomness in the RANDOM dataset (Figure 3c), where objects are placed uniformly at random with continuous coordinates and different sizes.
|
| 97 |
+
|
| 98 |
+
# 4.2 VISUAL PROGRAM SYNTHESIS
|
| 99 |
+
|
| 100 |
+
Setup. We present evaluation results on our synthetic dataset introduced above. We compare with an ablated version of our full model, where we use a simple search-based heuristic grouping method (HG) which does not require any training or any knowledge of the program patterns. The details of this method are presented in Appendix A. We also compare with two baselines. One removes group recognition and instead synthesizes programs from all object attributes (derender-LSTM). Another directly synthesizes programs from the input image in an end-to-end manner (CNN-LSTM). The model uses a CNN as encoder and a LSTM with attention as decoder. We use the same network architecture as in attention-based neural image captioning (Xu et al., 2015), except that the decoder predicts a token as well as a parameter matrix at each time step.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 3: Qualitative results for visual program synthesis. (a) Results on the REGULAR test set, where all objects are placed on a grid. (b) Results on the generalization test set which contains more complex scenes. (c) Results on the RANDOM test set, where objects have different sizes and the groups are placed with random continuous coordinates.
|
| 104 |
+
|
| 105 |
+
Table 2: Comparing program synthesis performance with baseline methods. Evaluation metrics include program token accuracy, parameter MSE loss, and scene reconstruction accuracy on the test sets.
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Model</td><td>Token (%)</td><td>Param. (MSE)</td><td>Test (%)</td><td>Generalization (%)</td><td>Random (%)</td></tr><tr><td>ours (full)</td><td>99.5</td><td>0.014</td><td>96.6</td><td>70.0</td><td>97.6</td></tr><tr><td>ours (HG)</td><td>99.5</td><td>0.014</td><td>92.4</td><td>63.0</td><td>94.8</td></tr><tr><td>derender-LSTM</td><td>97.5</td><td>0.080</td><td>87.6</td><td>14.0</td><td>64.4</td></tr><tr><td>CNN-LSTM</td><td>98.9</td><td>0.043</td><td>92.3</td><td>48.0</td><td>70.7</td></tr></table>
|
| 108 |
+
|
| 109 |
+
We evaluate the models on both the REGULAR and the RANDOM test sets. For evaluation on generalization, we also create an additional test set of 100 images, where each image contains three groups of multiple objects. These images are more complex and harder to describe than those in training.
|
| 110 |
+
|
| 111 |
+
Results. Figure 3 includes qualitative results generated by our model on all three test sets. Our model generates accurate results in the REGULAR setting and is able to recognize the two groups from neighbouring objects (Figure 3a). Although trained on images with two groups, our model can perform well when tested on images with three groups (Figure 3b). When objects are placed at random, our model can accurately recognize which objects form a regular pattern and describe them with programs (Figure 3c). For quantitative evaluation, we compute program token accuracy and parameter loss, defined as the percentage of correctly predicted tokens and the mean-squared error of parameter prediction, respectively. To evaluate the global performance of the generated program, we also compute reconstruction accuracy of the programs, defined as the percentage of programs that correctly reconstruct the original image. The reconstruction accuracy is evaluated on all three test sets.
|
| 112 |
+
|
| 113 |
+
We present the test results in Table 2, where our model outperforms baseline methods in each of the metrics, and achieves good performance on generalization. Note that the deep grouping model outperforms the simple heuristic grouping method, as it learns from the data distribution specified by our program space. Also note that our model performs better on RANDOM, while the baselines do not perform as well. This is because our group detection model discovers groups among randomly placed objects better than among regularly placed objects, as it is easier to rule out outsiders when they look random.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 4: Generating multiple possible programs.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 5: Inferring programs from partial observations. (Input Image) The input image contains objects that are fully or mostly occluded. (Partial Observation) Output of Mask R-CNN where we discard mask proposals that are too small. The highlighted objects form the observation of our model. (Program) Despite the noisy and incomplete input, our model can accurately predict programs that describe the image.
|
| 120 |
+
|
| 121 |
+
Tackling ambiguous input. While our model can generate program representations for images with high accuracy, it can also generate multiple possible programs when the input is ambiguous. Figure 4 shows an example where the red group can be described by either a two-layer for loop or a rotation of 4 objects. Our hierarchical method allows explicit specification of group category. When executing Algorithm 1, instead of selecting the most confident group category, we search top 3 proposals, and execute the synthesized program block to decide if each proposal corresponds to a possible correct program. Figure 4 demonstrates programs generated by our model, while the baseline methods tend to collapse to one possible answer and is unable to generate others.
|
| 122 |
+
|
| 123 |
+
Program synthesis from partial observations. Our model can also handle scenes where there are invisible (or hardly visible) objects. Figure 5 demonstrates how our model operates on these scenes. Given an input image, we generate object instance masks and remove those with area below a certain threshold, so that the remaining objects can be correctly recognized. These objects form the partial observation of our model, from which the program synthesizer generates a program block which correctly describes the scene, including (partially) occluded objects. The flexibility of the neural program synthesizer allows us to recognize the same program pattern given different partial observations. Consider the two examples at the bottom of Figure 5. They have different set of observations (8 and 6 objects on bottom left and right, respectively) due to the different distances, and our model is able to correctly recognize both of them.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 6: Image Editing. Our model can be applied to edit images by inferring programs (a) and then operate on program space. Examples include image extrapolation (b, c) and attribute editing (d, e).
|
| 127 |
+
|
| 128 |
+
# 4.3 IMAGE EDITING
|
| 129 |
+
|
| 130 |
+
Image editing via program representation. With the expressive power of the program representation, our model can be applied to tasks that require a high-level structural knowledge of the scene. For example, when an image lies within the space defined by our DSL, it can be efficiently edited using the program representation generated by our model. Figure 6 shows some examples of image editing, where the input image (Figure 6a) is represented by a program. Users can then edit the program to achieve the preferred editing effects. The edited program is sent to a graphics engine to render the new image. The structural form of our program representation allows various types of high-level editing, including spacial extrapolation (Figure 6b, c), changing color patterns (Figure 6d) and shapes (Figure 6e). Each of the four examples requires only one edit in the program, while using the traditional object representation, users have to change objects one at a time, averaging 6.25 edits per image.
|
| 131 |
+
|
| 132 |
+
Real image extrapolation. An advantage of our method which uses object attributes as a connection between vision and program synthesis is to generalize to real images. Since our neural program synthesizer is independent from visual recognition, only the vision systems need to be retrained for our entire model to work on real images.
|
| 133 |
+
|
| 134 |
+
Figure 7a shows images of LEGO blocks shot from a camera in real-world settings. We create a dataset of 120 real images, where we use 90 for training, 10 for validation, and 20 for testing. To adapt our model to generate programs for these images, we first pretrain on a synthetic dataset of 4,000 images rendered by a graphics engine. Then we fine-tune the model on 90 real images with labeled masks and attributes. The vision system is then linked with the pretrained program synthesizer which does not require any fine-tuning. Even with a small amount of real data for fine-tuning, our model generalizes well and correctly predicts the programs for each test image.
|
| 135 |
+
|
| 136 |
+
Furthermore, the image editing techniques introduced above can also be applied to such real images. Here we present an experiment on real image extrapolation. Given an input image, we generate the program describing the image and also extract object patches with Mask R-CNN. The program is extended by increasing the iteration number, which is a simple way of “imagining” what could be the next given a sequence of observations.
|
| 137 |
+
|
| 138 |
+
Our original method uses a graphics engine to render new images from edited programs (Figure 6), which is not applicable for real images. For this purpose, we use pix2pix (Isola et al., 2017) as an approximate neural renderer. After program inference, we execute the edited program and retrieve newly added object masks. These masks can be computed using camera parameters and 3D coordinates, while here we use retrieval for simplicity. All of the patches are pasted on a white background, and then sent to pix2pix to generate realistic background and lighting. Figure 7c displays the editing results. The edited images preserve object appearances in the original images, and also fix the errors made by mask prediction (small white gaps in Figure 7b) and contain realistic-looking shadows.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 7: Generalizing to real images. (a) Input image which is described by a program generated by our model. (b) The object patches in the original image are extracted using Mask R-CNN, while new objects are inferred by modifying the program iteration number and added as masks. (c) The edited image is rendered by pix2pix.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Model</td><td>Synthetic</td><td>Real</td></tr><tr><td>Autoencoder</td><td>5.17</td><td>10.19</td></tr><tr><td>Ours</td><td>3.87</td><td>7.05</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Table 3: Average L2 distance between ground truth images and model outputs for visual analogy making experiment.
|
| 146 |
+
|
| 147 |
+
# 4.4 VISUAL ANALOGY MAKING
|
| 148 |
+
|
| 149 |
+
Besides representing images for efficient editing, scene programs can also be used as encoded images. For example, the distance in program space can also be applied to model similarity between images, which is already introduced by (Ellis et al., 2018). Motivated by this idea, we consider visual analogy making (Reed et al., 2015), where an input image is converted to a new image given other reference images. We introduce a setting where the reference is an image pair and ask the intuitive question, $i f$ B follows A, then what should follow C?
|
| 150 |
+
|
| 151 |
+
Here we use a simple solution based on representation distance. More specifically, for an encoder $R$ and an input image $c$ with reference pair $( a , b )$ , we set $R ( d ) = R ( c ) + \bar { R ( b ) } - R ( \bar { a } )$ and decode $R ( d )$ to get the output. In our case, the encoder is our program synthesis model, while we use pix2pix as a neural decoder. In order to perform arithmetic operations, the program is represented as a matrix, where each line starts with a token followed by parameters (see Appendix A.3 for details). We compare our model with an autoencoder (Hinton $\&$ Salakhutdinov, 2006). The autoencoder we adopt takes an input image of size $2 5 6 \times 2 5 6$ , encodes the input into a 256-dimensional vector and then decodes the encoded vector back to original image size.
|
| 152 |
+
|
| 153 |
+
Figure 8 shows qualitative results of the visual analogy making task. Using our program representation, our model generates perceptually plausible results (Figure 8e). While the autoencoder can sometimes correctly change the number of objects, it fails to preserve the layout arrangements (Figure 8f). We also compute the average L2 distance between model output and ground truth images made by humans. Table 3 shows that our model generates images that are closer to the ground truth than the baseline.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 8: Visual Analogy Making. Given example image pairs (a), (b), the input image (c) is encoded with a representation, which is edited according to the example image pair. The edited representation is then decoded into a new image by our model (e) and an autoencoder (f), respectively. (d) shows analogy making result made by human.
|
| 157 |
+
|
| 158 |
+
# 5 CONCLUSION
|
| 159 |
+
|
| 160 |
+
We propose scene programs as a structured representation of complex scenes with high-level regularities. We also present a novel method that infers scene programs from 2D images in a hierarchical bottom-up manner. Our model achieves high accuracy on a synthetic dataset and also generalizes to real images. The representation power of programs allows our model to be applied to other tasks in computer vision, such as image editing and analogy making, on both synthetic and photographic images.
|
| 161 |
+
|
| 162 |
+
Acknowledgements. We thank Jiayuan Mao for insightful discussions and anonymous reviewers for their helpful feedback. This work was supported in part by NSF #1231216, NSF #1447476, NSF #1753684, ONR MURI N00014-16-1-2007, Facebook, and the Yao Class Exchange Program at IIIS, Tsinghua University.
|
| 163 |
+
|
| 164 |
+
# REFERENCES
|
| 165 |
+
|
| 166 |
+
Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. In ICLR, 2015.
|
| 167 |
+
|
| 168 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 169 |
+
|
| 170 |
+
Tony Beltramelli. Pix2code: Generating code from a graphical user interface screenshot. In ACM SIGCHI Symposium on Engineering Interactive Computing Systems, EICS, 2018.
|
| 171 |
+
|
| 172 |
+
Rudy Bunel, Matthew Hausknecht, Jacob Devlin, Rishabh Singh, and Pushmeet Kohli. Leveraging grammar and reinforcement learning for neural program synthesis. In ICLR, 2018.
|
| 173 |
+
|
| 174 |
+
Yuntian Deng, Anssi Kanervisto, Jeffrey Ling, and Alexander M Rush. Image-to-markup generation with coarse-to-fine attention. In ICML, 2017.
|
| 175 |
+
|
| 176 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. In ICML, 2017.
|
| 177 |
+
|
| 178 |
+
Kevin Ellis, Daniel Ritchie, Armando Solar-Lezama, and Josh Tenenbaum. Learning to infer graphics programs from hand-drawn images. In NeurIPS, 2018.
|
| 179 |
+
|
| 180 |
+
SM Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, Koray Kavukcuoglu, and Geoffrey E Hinton. Attend, infer, repeat: Fast scene understanding with generative models. In NeurIPS, 2016.
|
| 181 |
+
|
| 182 |
+
Yaroslav Ganin, Tejas Kulkarni, Igor Babuschkin, S. M. Ali Eslami, and Oriol Vinyals. Synthesizing programs for images using reinforced adversarial learning. In ICML, 2018.
|
| 183 |
+
|
| 184 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2015.
|
| 185 |
+
|
| 186 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In ´ ICCV, 2017.
|
| 187 |
+
|
| 188 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006.
|
| 189 |
+
|
| 190 |
+
Jonathan Huang and Kevin Murphy. Efficient inference in occlusion-aware generative models of images. In ICLR Workshop, 2015.
|
| 191 |
+
|
| 192 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017.
|
| 193 |
+
|
| 194 |
+
Justin Johnson, Ranjay Krishna, Michael Stark, Li-Jia Li, David Shamma, Michael Bernstein, and Li Fei-Fei. Image retrieval using scene graphs. In CVPR, 2015.
|
| 195 |
+
|
| 196 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In CVPR, 2017.
|
| 197 |
+
|
| 198 |
+
Thomas N Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard S Zemel. Neural relational inference for interacting systems. In ICML, 2018.
|
| 199 |
+
|
| 200 |
+
Jun Li, Kai Xu, Siddhartha Chaudhuri, Ersin Yumer, Hao Zhang, and Leonidas Guibas. GRASS: Generative Recursive Autoencoders for Shape Structures. In SIGGRAPH, 2017.
|
| 201 |
+
|
| 202 |
+
Manyi Li, Akshay Gadi Patil, Kai Xu, Siddhartha Chaudhuri, Owais Khan, Ariel Shamir, Changhe Tu, Baoquan Chen, Daniel Cohen-Or, and Hao Zhang. Grains: Generative recursive autoencoders for indoor scenes. ACM TOG, 38(2):12:1–12:16, 2019.
|
| 203 |
+
|
| 204 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In EMNLP, 2015.
|
| 205 |
+
|
| 206 |
+
Chengjie Niu, Jun Li, and Kai Xu. Im2Struct: Recovering 3D Shape Structure from a Single RGB Image. In CVPR, 2018.
|
| 207 |
+
|
| 208 |
+
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In ICLR, 2017.
|
| 209 |
+
|
| 210 |
+
Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In NeurIPS, 2015.
|
| 211 |
+
|
| 212 |
+
Irvin Rock and Stephen Palmer. The legacy of gestalt psychology. Sci. Amer., 263(6):84–91, 1990.
|
| 213 |
+
|
| 214 |
+
Gopal Sharma, Rishabh Goyal, Difan Liu, Evangelos Kalogerakis, and Subhransu Maji. Csgnet: Neural shape parser for constructive solid geometry. In CVPR, 2018.
|
| 215 |
+
|
| 216 |
+
Shao-Hua Sun, Hyeonwoo Noh, Sriram Somasundaram, and Joseph Lim. Neural program synthesis from diverse demonstration videos. In ICML, 2018.
|
| 217 |
+
|
| 218 |
+
Shubham Tulsiani, Hao Su, Leonidas J. Guibas, Alexei A. Efros, and Jitendra Malik. Learning shape abstractions by assembling volumetric primitives. In CVPR, 2017.
|
| 219 |
+
|
| 220 |
+
Sjoerd van Steenkiste, Michael Chang, Klaus Greff, and Jurgen Schmidhuber. Relational neural ¨ expectation maximization: Unsupervised discovery of objects and their interactions. In ICLR, 2018.
|
| 221 |
+
|
| 222 |
+
Yanzhen Wang, Kai Xu, Jun Li, Hao Zhang, Ariel Shamir, Ligang Liu, Zhi-Quan Cheng, and Yueshan Xiong. Symmetry Hierarchy of Man-Made Objects. Computer Graphics Forum, 2011.
|
| 223 |
+
|
| 224 |
+
Jiajun Wu, Joshua B Tenenbaum, and Pushmeet Kohli. Neural scene de-rendering. In CVPR, 2017.
|
| 225 |
+
|
| 226 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015.
|
| 227 |
+
|
| 228 |
+
# A IMPLEMENTATION DETAILS
|
| 229 |
+
|
| 230 |
+
# A.1 SCENE CONFIGURATION
|
| 231 |
+
|
| 232 |
+
For synthetic data rendering, we use essentially the same settings as in CLEVR (Johnson et al., 2017). The objects are in two sizes (radius 0.4, 0.7), three shapes (sphere, cube, cylinder), two materials (metal, rubber), and eight colors (blue, brown, cyan, gray, green, purple, red, yellow). We represent the colors as numbers 1-8 in the scene programs as shown in Figure 3.
|
| 233 |
+
|
| 234 |
+
In the REGULAR setting, objects are placed on a $5 \times 5 \times 5$ grid, with integer coordinates in 0-4, which means that the spacial gap between objects is a constant 1. We only use objects with the smaller size. Then we jitter each object position by a random noise sampled uniformly from $[ - 0 . 0 3 , 0 . 0 3 ]$ These random noises are used for visual diversity, and is ignored in the scene program.
|
| 235 |
+
|
| 236 |
+
In the RANDOM setting, objects have both large and small sizes, and we use continuous coordinates in [0, 4]. When sampling a program block, the spacial gap between neighboring objects in the same group is still the constant 1, while the entire group is shifted by a continuous random amount. Finally, each object is also independently jittered by a random noise sampled uniformly from $[ - 0 . 0 3 , 0 . 0 3 ]$ .
|
| 237 |
+
|
| 238 |
+
# A.2 HEURISTIC GROUPING
|
| 239 |
+
|
| 240 |
+
We present the detailed method for heuristic grouping (HG) in Algorithm 2. Here $d ( o , G )$ denotes the minimum Euclidean distance from $o$ to any object in $G$ . During testing we will sample the distance threshold $\varepsilon$ multiple times.
|
| 241 |
+
|
| 242 |
+
# A.3 DATA FORMAT FOR SCENE PROGRAMS
|
| 243 |
+
|
| 244 |
+
In this Section we introduce the data format for the proposed scene programs. In short, a program is represented as a matrix, where each row contains a program command, which is a program token followed by its parameters. In our work, a program block is represented as a matrix of size $N \times 1 4$ where $N$ is the number of program commands. In order to unify the data format of the programs specified by our DSL defined in Table 1, we divide the 14 numbers into four parts: program token (index 0), iteration arguments (index 1-3), position arguments (index 4-6) and color arguments (index
|
| 245 |
+
|
| 246 |
+
# Algorithm 2: A simple heuristic grouping algorithm
|
| 247 |
+
|
| 248 |
+
Result: a group of objects $G$
|
| 249 |
+
Input: a set of object attributes $O$ , an object $o \in O$ ;
|
| 250 |
+
$G = \{ o \}$ ;
|
| 251 |
+
uniformly sample $\varepsilon$ from $[ 1 , { \sqrt { 2 } } ]$ ;
|
| 252 |
+
while True do for $o _ { i } \in O$ do if $o _ { i } \not \in G$ and $d ( o _ { i } , G ) < \varepsilon$ and $o _ { i }$ has the same shape as o then add $o _ { i }$ to $G$ end end if $G$ did not change in this iteration then return $G$ end
|
| 253 |
+
end
|
| 254 |
+
|
| 255 |
+
7-13). We give an explicit example as shown in Figure 9. The matrix representation allows direct arithmetic operations in program space, which enables the application of scene programs in image analogy making (Figure 8).
|
| 256 |
+
|
| 257 |
+
The evaluation of output program is different under different scene configurations. In the REGULAR setting, every program argument is an integer, so we round the output program to the nearest integer and calculate its accuracy. In the RANDOM setting, since the position arguments are continuous, we allow a small error (0.2) for them and treat the other arguments as integers.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 9: Data format of our scene programs. Each color represents a different type of argument, including red: program tokens, blue: iteration arguments, green: position arguments, purple: color arguments.
|
md/train/SyfXKoRqFQ/SyfXKoRqFQ.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADA-BOUNDARY: ACCELERATING THE DNN TRAINING VIA ADAPTIVE BOUNDARY BATCH SELECTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural networks can converge faster with help from a smarter batch selection strategy. In this regard, we propose Ada-Boundary, a novel adaptive-batch selection algorithm that constructs an effective mini-batch according to the learning progress of the model. Our key idea is to present confusing samples what the true label is. Thus, the samples near the current decision boundary are considered as the most effective to expedite convergence. Taking advantage of our design, Ada-Boundary maintains its dominance in various degrees of training difficulty. We demonstrate the advantage of Ada-Boundary by extensive experiments using two convolutional neural networks for three benchmark data sets. The experiment results show that Ada-Boundary improves the training time by up to $3 1 . { \bar { 7 } } \%$ compared with the state-of-the-art strategy and by up to $3 3 . 5 \%$ 31 7%compared with the baseline strategy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have achieved remarkable performance in many fields, especially, in computer vision and natural language processing (Krizhevsky et al., 2012; Goodfellow et al., 2016). Nevertheless, as the size of data grows very rapidly, the training step via stochastic gradient descent (SGD) based on mini-batches suffers from extremely high computational cost, which is mainly due to slow convergence. The common approaches for expediting convergence include some SGD variants (Zeiler, 2012; Kingma and Ba, 2015) that maintain individual learning rates for parameters and batch normalization (Ioffe and Szegedy, 2015) that stabilizes gradient variance.
|
| 12 |
+
|
| 13 |
+
Recently, in favor of the fact that not all samples have an equal impact on training, many studies have attempted to design sampling schemes based on the sample importance (Wu et al., 2017; Fan et al., 2017; Katharopoulos and Fleuret, 2018). Curriculum learning (Bengio et al., 2009) inspired by human’s learning is one of the representative methods to speed up the training step by gradually increasing the difficulty level of training samples. In contrast, deep learning studies focus on giving higher weights to harder samples during the entire training process. When the model requires a lot of epochs for convergence, it is known to converge faster with the batches of hard samples rather than randomly selected batches (Schaul et al., 2016; Loshchilov and Hutter, 2016; Gao and Jojic, 2017). There are various criteria for judging the hardness of a sample, e.g., the rank of the loss computed from previous epochs (Loshchilov and Hutter, 2016).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Analysis on hard batch selection strategy: (a) shows the true sample distribution according to the difficulty computed by Eq. (1) at the training accuracy of $6 0 \%$ . An easy data set (MNIST) does 60%not have “too hard” sample but “moderately hard” samples colored in gray, whereas a relatively hard data set (CIFAR-10) has many “too hard” samples colored in black. (b) shows the result of SGD on a hard batch. The moderately hard samples are informative to update a model, but the too hard samples make the model overfit to themselves.
|
| 17 |
+
|
| 18 |
+
Here, a natural question arises: Does the “hard” batch selection always speed up DNN training? Our answer is partially yes: it is helpful only when training an easy data set. According to our indepth analysis, as demonstrated in Figure 1(a), the hardest samples in a hard data set (e.g., CIFAR10) were too hard to learn. They are highly likely to make the decision boundary bias towards themselves, as shown in Figure 1(b). On the other hand, in an easy data set (e.g., MNIST), the hardest samples, though they are just moderately hard, provide useful information for training. In practice, it was reported that hard batch selection succeeded to speed up only when training the easy MNIST data set (Loshchilov and Hutter, 2016; Gao and Jojic, 2017), and our experiments in Section 4.4 also confirmed the previous findings. This limitation calls for a new sampling scheme that supports both easy and hard data sets.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a novel adaptive batch selection strategy, called Ada-Boundary, that accelerates training and is better generalized to hard data sets. As opposed to existing hard batch selection, Ada-Boundary picks up the samples with the most appropriate difficulty, considering the learning progress of the model. The samples near the current decision boundary are selected with high probability, as shown in Figure 2(a). Intuitively speaking, the samples far from the decision boundary are not that helpful since they are either too hard or too easy: those on the incorrect (or correct) side are too hard (or easy). This is the reason why we regard the samples around the decision boundary, which are moderately hard, as having the appropriate difficulty at the moment.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Key idea of Ada-Boundary: (a) shows the sampling process of Ada-Boundary, (b) shows the results of an SGD iteration on the boundary samples.
|
| 24 |
+
|
| 25 |
+
Overall, the key idea of Ada-Boundary is to use the distance of a sample to the decision boundary for the hardness of the sample. The beauty of this design is not to require human intervention. The current decision boundary should be directly influenced by the learning progress of the model. The decision boundary of a DNN moves towards eliminating the incorrect samples as the training step progresses, so the difficulty of the samples near the decision boundary gradually increases as the model is learned. Then, the decision boundary keeps updated to identify the confusing samples in the middle of SGD, as illustrated in Figure 2(b). This approach is able to accelerate the convergence speed by providing the samples suited to the model at every SGD iteration, while it is less prone to incur an overfitting issue.
|
| 26 |
+
|
| 27 |
+
We have conducted extensive experiments to demonstrate the superiority of Ada-Boundary. Two popular convolutional neural network (CNN)1 models are trained using three benchmark data sets. Compared to random batch selection, Ada-Boundary significantly reduces the execution time by $1 4 . 0 \hat { - } 3 3 . 5 \%$ . At the same time, it provides a relative improvement of test error by $7 . 3 4 \mathrm { - } 1 4 . 8 \%$ in the 14 0 33 5% 7 34 14 8%final epoch. Moreover, compared to the state-of-the-art hard batch selection (Loshchilov and Hutter,
|
| 28 |
+
|
| 29 |
+
2016), Ada-Boundary achieves the execution time smaller by $1 8 . 0 \%$ and the test error smaller by $1 3 . 7 \%$ in the CIFAR-10 data set.
|
| 30 |
+
|
| 31 |
+
# 2 Ada-Boundary COMPONENTS
|
| 32 |
+
|
| 33 |
+
The main challenge for Ada-Boundary is to evaluate how close a sample is to the decision boundary. In this section, we introduce a novel distance measure and present a method of computing the sampling probability based on the measure.
|
| 34 |
+
|
| 35 |
+
# 2.1 SAMPLE’S DISTANCE BASED ON SOFTMAX DISTRIBUTION
|
| 36 |
+
|
| 37 |
+
To evaluate the sample’s distance to the decision boundary, we note that the softmax distribution, which is the output of the softmax layer in neural networks, clearly distinguishes how confidently the learner predicts and whether the prediction is right or wrong, as demonstrated in Figure 3.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 3: Classification of CIFAR-10 samples using the softmax distribution obtained from WideResNet 16-8 when training accuracy is $5 0 \%$ . If the prediction probability of the true label 90%is the highest, the prediction is correct; otherwise, incorrect. If the highest probability dominates the distribution, the model’s confidence is strong; otherwise, weak.
|
| 41 |
+
|
| 42 |
+
Let $h ( y | x _ { i } ; \theta ^ { t } )$ be the softmax distribution of a given sample $x _ { i }$ over $y \in \{ 1 , 2 , \ldots , k \}$ labels, where $\pmb { \theta } ^ { t }$ ( ; )is the parameter of a neural network at time $t$ 1 2. Then, the distance from a sample $x _ { i }$ with the true label $y _ { i }$ to the decision boundary of the neural network with $\pmb { \theta } ^ { t }$ is defined by the directional distance function in Eq. (1). More specifically, the function consists of two terms related to the direction and magnitude of the distance, determined by the model’s correctness and confidence, respectively. The correctness is determined by verifying whether the label with the highest probability matches the true label $y _ { i }$ , and the confidence is computed by the standard deviation of the softmax distribution. Intuitively, the standard deviation is a nice indicator of the confidence because the value gets closer to zero when the learner confuses.
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r l } & { \quad d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) = \overbrace { s i g n ( x _ { i } , y _ { i } ) } ^ { \qquad } \cdot \overbrace { s t d ( h ( y | x _ { i } ; \pmb \theta ^ { t } ) ) } ^ { \qquad } } \\ & { \quad i g n ( x _ { i } , y _ { i } ) = \overbrace { \left\{ - 1 , \begin{array} { l l } { a r g m a x _ { y \in \{ 1 , 2 , \ldots , k \} } h ( y | x _ { i } ; \pmb \theta ^ { t } ) = y _ { i } } \\ { - 1 , } & { o t h e r w i s e } \end{array} \right. } } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
One might argue that the cross-entropy loss, $H ( p , q ) = - p ( x _ { i } ) \log ( q ( x _ { i } ) )$ where $p ( x _ { i } )$ and $q ( x _ { i } )$ are the true and softmax distributions for $x _ { i }$ ( ) = ( ) log( ( )) ( ) ( ), can be adopted for the distance function. However, because $p ( x _ { i } )$ is formulated as a one-hot true label vector, the cross-entropy loss cannot capture the ( )prediction probability for false labels, which is an important factor of confusing samples.
|
| 49 |
+
|
| 50 |
+
Another advantage is that our distance function is bounded as opposed to the loss. For $k$ labels, the maximum value of $s t d ( h ( y | x _ { i } ; \pmb { \theta } ^ { t } ) )$ is $k ^ { - 1 } \sqrt { ( k - 1 ) }$ when $h ( m | x _ { i } ; \pmb { \theta } ^ { t } ) = 1$ and $\forall _ { l \neq m } h ( l | x _ { i } ; \pmb \theta ^ { t } ) =$ . Thus, $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ ( ; )) (is bounded as in Eq. (2).
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
- k ^ { - 1 } \sqrt { k - 1 } \le d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } ) \le k ^ { - 1 } \sqrt { k - 1 }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
# 2.2 SAMPLING PROBABILITY BASED ON QUANTIZATION INDEX
|
| 57 |
+
|
| 58 |
+
The rank-based approach introduced by Loshchilov and Hutter (2016) is a common way to make the sampling probability of being selected for the next mini-batch. This approach sorts the samples by a certain importance measure in descending order, and exponentially decays the sampling probability of a given sample according to its rank. Let $N$ denote the total number of samples. Then, each $r$ -th ranked sample is selected with the probability $p ( r )$ which drops by a factor of $\exp { ( \log ( s _ { e } ) / N ) }$ . Here, $s _ { e }$ ( ) exp (log( ) )is the selection pressure parameter that affects the probability gap between the most and the least important samples. When normalized to sum up to . , the probability of the $r$ -th ranked sample’s being selected is defined by Eq. (3).
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
p ( r ) = \frac { 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { r } } } { \sum _ { j = 1 } ^ { N } 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { j } } }
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
In the existing rank-based approach, the rank of a sample is determined by $\left| d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) \right|$ in as( ; )cending order, because it is inversely proportional to the sample importance. However, if the mass of the true sample distribution is skewed to one side (e.g., easy side) as shown in Figure 4, the mini-batch samples are selected with high probability from the skewed side rather than around the decision boundary where $\left| d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) \right|$ is very small. This problem was attributed to uncondi( ; )tionally fixed probability to a given rank. In other words, the samples with similar ranks are selected with similar probabilities regardless of the magnitude of the distance values.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 4: Sample distribution according to the normalized $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ at the training accuracy of $8 0 \%$ , when training LeNet-5 $s _ { e } = 1 0 0$ ( ; )) with the Fashion-MNIST data set. The distributions of 80% = 100mini-batch samples selected by the rank-based and quantization-based approaches, respectively, are plotted together with the true sample distribution.
|
| 68 |
+
|
| 69 |
+
To incorporate the impact of the distance into batch selection, we adopt the quantization method (Gray and Neuhoff, 1998; Chen and Wornell, 2001) and use the quantization index $q$ instead of the rank $r$ . Let $\Delta$ be the quantization step size and $d$ be the output of the function $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ of a Δgiven sample $x _ { i }$ . Then, the index $q$ is obtained by the quantizer $Q ( d )$ ( ; )as in Eq. (4). The quantization ( )index gets larger as a sample moves away from the decision boundary. In addition, the difference between two indexes reflects the difference in the actual distances.
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
q = Q ( d ) , ~ Q ( d ) = \lceil \lvert d \rvert / \Delta \rceil
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
In Eq. (4), we set $\Delta$ to be $k ^ { - 1 } \sqrt { k - 1 } / N$ such that the index $q$ is bounded to $N$ (the total number Δ 1of samples) by Eq. (2). The sampling probability of a given sample $x _ { i }$ with the true label $y _ { i }$ is defined as Eq. (5). As shown in Figure 4, our quantization-based method provides a well-balanced distribution, even if the true sample distribution is skewed.
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
p ( x _ { i } , y _ { i } ) = \frac { 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { i } , y _ { i } ; \theta ^ { t } ) ) } } } { \sum _ { j = 1 } ^ { N } 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { j } , y _ { j } ; \theta ^ { t } ) ) } } }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
# 3 Ada-Boundary ALGORITHM
|
| 82 |
+
|
| 83 |
+
# 3.1 MAIN PROPOSED ALGORITHM
|
| 84 |
+
|
| 85 |
+
Algorithm 1 describes the overall procedure of Ada-Boundary. The input to the algorithm consists of the samples of size $N$ (i.e., training data set), the mini-batch size $b$ , the selection pressure $s _ { e }$ , and the threshold $\gamma$ used to decide the warm-up period. In the early stages of training, since the quantization index for each sample is not confirmed yet, the algorithm requires the warm-up period during $\gamma$ epochs. Randomly selected mini-batch samples are used to warm-up (Lines 6–7), and their quantization indexes are updated (Lines 11–16). After the warm-up epochs, the algorithm computes the sampling probability of each sample by Eq. (5) and selects mini-batch samples based on the probability (Lines 8–10). Then, the quantization indexes are updated in the same way (Lines $1 1 -$ 16). Here, we compute the indexes using the model with $\pmb { \theta } ^ { t + \hat { 1 } }$ after every SGD step rather than every epoch, in order to reflect the latest state of the model; besides, we asynchronously update the indexes of the samples only included in the mini-batch, to avoid the forward propagation of the entire samples which induces a high computational cost.
|
| 86 |
+
|
| 87 |
+
# Algorithm 1 Ada-Boundary Algorithm
|
| 88 |
+
|
| 89 |
+
INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\gamma$ : warm-up period
|
| 90 |
+
1: $t \gets 1$
|
| 91 |
+
2: $\theta ^ { t } \gets$ ;Initialize the model parameter
|
| 92 |
+
3: $q . d i c t \gets \{ \}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$
|
| 93 |
+
4: for $i = 1$ ;to numEpoch do
|
| 94 |
+
5: =for $j = 1$ to $N / b$ do
|
| 95 |
+
6: if $i \leq \gamma$ then $/ *$ Warm-up $^ { * }$
|
| 96 |
+
7: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ Randomly select next mini-batch samples;
|
| 97 |
+
8: (else $/ { * }$ ) ( ) Adaptive batch selection $^ { * }$
|
| 98 |
+
9: prob $t a b l e \gets C$ ompute P robability q dict, se ; $/ { * }$ By Eq. (5) \*/
|
| 99 |
+
10: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ ( )Select next mini-batch samples based on prob table
|
| 100 |
+
11: $l o s s \gets G e t \_ L o s s ( \{ ( x _ { 1 } , y _ { 1 } ) , \dots , ( x _ { b } , y _ { b } ) \} , \theta ^ { t } )$ $/ *$ Forward $1 ~ ^ { * } /$
|
| 101 |
+
12: $\pmb { \theta } ^ { t + 1 } S G D \_ S t e p ( l o s s , \pmb { \theta } ^ { t } )$ $/ *$ ( ) Backward $^ { * }$ ;
|
| 102 |
+
13: $/ { * }$ ( Asynchronous update $^ { * }$
|
| 103 |
+
14: $\{ h ( y | \check { x } _ { 1 } ; \theta ^ { t + 1 } ) , . . . , \hat { h } ( y | x _ { b } ; \theta ^ { t + 1 } ) \} G e t . S o f t m a x ( \{ x _ { 1 } , . . . , x _ { b } \} , \theta ^ { t + 1 } ) ; \ / \mathrm { { s u p t - s u p } }$ Forward 2 \*/
|
| 104 |
+
15: ( ; )for m to b do
|
| 105 |
+
16: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \pmb { \theta } ^ { t + 1 } ) )$ $/ { * }$ Compute quantization indexes by Eq. (4) \*/
|
| 106 |
+
17: [t ← t
|
| 107 |
+
|
| 108 |
+
# 3.2 VARIANTS OF Ada-Boundary FOR COMPARISON
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 5: The distributions of mini-batch samples selected by the three variants in the same configuration as Figure 4.
|
| 112 |
+
|
| 113 |
+
For a more sophisticated analysis of sampling strategies, we modify a few lines of Algorithm 1 to present three heuristic sampling strategies, which are detailed in Appendix A. (i) Ada-Easy is designed to show the effect of easy samples on training, so it focuses on the samples far from the decision boundary to the positive direction. (ii) Ada-Hard is similar to the existing hard batch strategy (Loshchilov and Hutter, 2016), but it uses our distance function instead of the loss. That is, Ada-Hard focuses on the samples far from the decision boundary to the negative direction, which is the opposite of Ada-Easy. (iii) Ada-Uniform is designed to select the samples for a wide range of difficulty, so it samples uniformly over the distance range regardless of the sample distribution. Figure 5 shows the distributions of mini-batch samples drawn by these three variants. The distribution of Ada-Easy is skewed to the easy side, that of Ada-Hard is skewed to the hard side, and that of Ada-Uniform tends to be uniform.
|
| 114 |
+
|
| 115 |
+
To avoid additional inference steps of Ada-Boundary (Line in Algorithm 1), we present a history14based variant, called Ada-Boundary(History). It updates the qunatization indexes using the previous model with $\pmb { \theta } ^ { t }$ . See Appendix B for the detailed algorithm and experiment results.
|
| 116 |
+
|
| 117 |
+
# 4 EVALUATION
|
| 118 |
+
|
| 119 |
+
# 4.1 DATA SETS AND ARCHITECTURES
|
| 120 |
+
|
| 121 |
+
In this section, all the experiments were performed on three benchmark data sets: MNIST2 of handwritten digits (LeCun, 1998) with , training and , testing images; Fashion-MNIST3 of 60 000 10 000various clothing (Xiao et al., 2017) with , training and , testing images; and CIFAR$1 0 ^ { 4 }$ 60 000 10 000of a subset of 80 million categorical images (Krizhevsky et al., 2014) with , training and 50 000, testing images. We did not apply any data augmentation and pre-processing procedures.
|
| 122 |
+
|
| 123 |
+
A simple model LeNet-5 (LeCun et al., 2015) was used for two easy data sets, MNIST and FasionMNIST. A complex model WideResNet-16-8 (Zagoruyko and Komodakis, 2016) was used for a relatively difficult data set, CIFAR-10. Batch normalization (Ioffe and Szegedy, 2015) was applied to both models. As for hyper-parameters, we used a learning rate of . and a batch size of ; the 0 01 128training epoch was set to be for LeNet-5 and for WideResNet-16-8, which is early stopping 50 70to clearly show the difference in convergence speed. Regarding those specific to our algorithm, we set the selection pressure $s _ { e }$ to be , which is the best value found from $s _ { e } = \{ 1 0 , 1 0 0 , 1 0 0 0 \}$ on 100the three data sets, and set the warm-up threshold $\gamma$ = 10to be . Technically, a small $\gamma$ 00 1000was enough 10to warm-up, but to reduce the performance variance caused by randomly initialized parameters, we used the larger $\gamma$ and shared model parameters for all strategies during the warm-up period.
|
| 124 |
+
|
| 125 |
+
Due to the lack of space, the experimental results using DenseNet $L \ = \ 2 5$ , $k \ = \ 1 2$ ) (Huang et al., 2017) on two hard data sets, CIFAR- $1 0 0 ^ { 4 }$ = 25 = 12and Tiny-ImageNet 5, are discussed in Appendix C together with the impact of the selection pressure $s _ { e }$ .
|
| 126 |
+
|
| 127 |
+
# 4.2 ALGORITHMS
|
| 128 |
+
|
| 129 |
+
We compared Ada-Boundary with not only random batch selection but also four different adaptive batch selections. Random batch selection selects the next batch uniformly at random from the entire data set. One of four adaptive selections is the state-of-the-art strategy that selects hard samples based on the loss-rank, which is called online batch selection (Loshchilov and Hutter, 2016), and the remainders, Ada-Easy, Ada-Hard, and Ada-Uniform, are the three variants introduced in Section 3.2. All the algorithms were implemented using TensorFlow6 and executed using a single NVIDIA Tesla V100 GPU on DGX-1. For reproducibility, we provide the source code at https://github. com/anonymized.
|
| 130 |
+
|
| 131 |
+
# 4.3 EVALUATION METRICS
|
| 132 |
+
|
| 133 |
+
To measure the performance gain over the baseline (random batch selection) as well as the state-ofart (online batch selection), we used the following three metrics. We repeated every test five times for robustness and reported the average. The wall-clock training time is discussed in Appendix D.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 6: Convergence curves of five batch selection strategies with SGD on three data sets.
|
| 137 |
+
|
| 138 |
+
(i) $G a i n _ { e r r }$ : Reduction in test error at the final epoch $( \% )$ . In Figure 6(a), at the 50th epoch, the test error of random batch selection was $1 . 0 1 4 \cdot 1 0 ^ { - 2 }$ , and that of Ada-Boundary was $8 . 6 4 3 \cdot 1 0 ^ { - 3 }$ . Thus, $G a i n _ { e r r }$ was $( 1 . 0 1 4 \cdot 1 0 ^ { - 2 } - 8 . 6 4 3 \cdot 1 0 ^ { - 3 } ) / 1 . 0 1 4 \cdot 1 0 ^ { - 2 } \times 1 0 0 = \dot { 1 } 4 . 8 \%$ .
|
| 139 |
+
|
| 140 |
+
(ii) $G a i n _ { e p o }$ : Reduction in number of epochs to obtain the same error $( \% )$ . In Figure 6(a), the test error of $1 . 0 1 4 \cdot 1 0 ^ { 2 }$ achieved at the 50th epoch by random batch selection can be achieved only 1 014 10at the 29th epoch by Ada-Boundary. Thus, $G a i n _ { e r r }$ was $( 5 0 - 2 9 ) / 5 0 \times 1 0 0 = 4 2 . 0 \%$ .
|
| 141 |
+
|
| 142 |
+
(iii) $G a i n _ { t i m }$ : Reduction in running time to obtain the same error $( \% )$ . In Figure 6(a), similar to $G a i n _ { e p o }$ , $G a i n _ { t i m }$ was $( 2 0 5 . 0 - 1 3 6 . 3 ) / 2 0 5 . 0 \times 1 0 0 = 3 3 . 5 \%$ .
|
| 143 |
+
|
| 144 |
+
# 4.4 CONVERGENCE ANALYSIS
|
| 145 |
+
|
| 146 |
+
Figure 6 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the SGD optimizer for training. In order to improve legibility, only the curves for the baseline and proposed strategies are dark colored; thus, the three metrics in the figure were calculated against the baseline strategy, random batch selection. Owing to the lack of space, we discuss the results with the momentum optimizer in Appendix E. Ada-Easy was excluded in Figure 6 because its convergence speed was much slower than other strategies. That is, easy samples did not contribute to expedite training. We conduct convergence analysis of the five batch selection strategies for the same number of epochs, as follows:
|
| 147 |
+
|
| 148 |
+
MNIST (Figure 6(a)): All adaptive batch selections achieved faster convergence speed compared with random batch selection. Ada-Boundary, Ada-Hard, and online batch selection showed similar performance. Ada-Uniform was the fastest at the beginning, but its training loss and test error increased sharply in the middle of the training or testing procedures.
|
| 149 |
+
|
| 150 |
+
Fashion-MNIST (Figure 6(b)): Ada-Boundary showed the fastest convergence speed in both training loss and test error. In contrast, after warm-up epochs, the training loss of the other adaptive batch selections increased temporarily, and their test error at the final epoch became similar to that of random batch selection.
|
| 151 |
+
|
| 152 |
+
CIFAR-10 (Figure 6(c)): Ada-Boundary and Ada-Hard showed the fastest convergence on training loss, but in test error, the convergence speed of Ada-Hard was much slower than that of Ada-Boundary. This means that focusing on hard samples results in the overfitting to “too hard” samples, which is indicated by a larger difference between the converged training loss (error) and the converged test error. Also, the slow convergence speed of online batch selection in test error is explained by the same reason.
|
| 153 |
+
|
| 154 |
+
In summary, in the easiest MNIST data set, all adaptive batch selections accelerated their convergence speed compared with random batch selection. However, as the training difficulty (complexity) increased from MNIST to Fashion-MNIST and further to CIFAR-10, only Ada-Boundary converged significantly (by $G a i n _ { e r r }$ ) faster than random batch selection.
|
| 155 |
+
|
| 156 |
+
# 4.5 SUMMARY OF PERFORMANCE GAINS
|
| 157 |
+
|
| 158 |
+
We clarify the quantitative performance gains of Ada-Boundary over random batch and online batch selections in Table 1. Ada-Boundary significantly outperforms both strategies, as already shown in Figure 6. There is only one exception in MNIST, because online batch selection is known to work well with an easy data set (Loshchilov and Hutter, 2016). The noticeable advantage of AdaBoundary is to reduce the training time significantly by up to around $3 0 \%$ , which is really important for huge, complex data sets.
|
| 159 |
+
|
| 160 |
+
Table 1: Performance gains over random batch and online batch selections.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>33.5%</td><td rowspan=1 colspan=1>-2.08%</td><td rowspan=1 colspan=1>0.00%</td><td rowspan=1 colspan=1>0.00%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>8.01%</td><td rowspan=1 colspan=1>40.0%</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>10.2%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>31.7%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>7.34%</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>13.7%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 5 RELATED WORK
|
| 165 |
+
|
| 166 |
+
There have been numerous attempts to understand which samples contribute the most during training. Curriculum learning (Bengio et al., 2009), inspired by the perceived way that humans and animals learn, first takes easy samples and then gradually increases the difficulty of samples in a manual manner. Self-paced learning (Kumar et al., 2010) uses the prediction error to determine the easiness of samples in order to alleviate the limitation of curriculum learning. They regard that the importance is determined by how easy the samples are. However, easiness is not sufficient to decide when a sample should be introduced to a learner (Gao and Jojic, 2017).
|
| 167 |
+
|
| 168 |
+
Recently, Tsvetkov et al. (2016) used Bayesian optimization to optimize a curriculum for training dense, distributed word representations. Sachan and Xing (2016) emphasized that the right curriculum not only has to arrange data samples in the order of difficulty, but also introduces a small number of samples that are dissimilar to the previously seen samples. Shrivastava et al. (2016) proposed a hard-example mining algorithm to eliminate several heuristics and hyper-parameters commonly used to select hard examples. However, these algorithms are designed to support only a designated task, such as natural language processing or region-based object detection. The neural data filter proposed by Fan et al. (2017) is orthogonal to our work because it aims at filtering the redundant samples from streaming data. As mentioned earlier, Ada-Boundary in general follows the philosophy of curriculum learning.
|
| 169 |
+
|
| 170 |
+
More closely related to the adaptive batch selection, Loshchilov and Hutter (2016) keep the history of losses for previously seen samples, and compute the sampling probability based on the loss rank. The sample probability to be selected for the next mini-batch is exponentially decayed with its rank. This allows the samples with low ranks (i.e., high losses) are considered more frequently for the next mini-batch. Gao and Jojic (2017)’s work is similar to Loshchilov and Hutter (2016)’s work except that gradient norms are used instead of losses to compute the probability. In contrast to curriculum learning, both methods focus on only hard samples for training. Also, they ignore the difference in actual losses or gradient norms by transforming the values to ranks. We have empirically verified that Ada-Boundary outperforms online batch selection (Loshchilov and Hutter, 2016), which is regarded as the state-of-the-art of this category. Similar to our work, Chang et al. (2017) claimed that the uncertain samples should be preferred during training, but their main contribution lies on training more accurate and robust model by choosing samples with high prediction variances. In contrast, our main contribution lies on training faster using confusing samples near the decision boundary.
|
| 171 |
+
|
| 172 |
+
For the completeness of the survey, we mention the work to accelerate the optimization process of conventional algorithms based on importance sampling. Needell et al. (2014) re-weight the obtained gradients by the inverses of their sampling probabilities to reduce the variance. Schmidt et al. (2015) biased the sampling to the Lipschitz constant to quickly find the solution of a strongly-convex optimization problem arising from the training of conditional random fields.
|
| 173 |
+
|
| 174 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 175 |
+
|
| 176 |
+
In this paper, we proposed a novel adaptive batch selection algorithm, Ada-Boundary, that presents the most appropriate samples according to the learning progress of the model. Toward this goal, we defined the distance from a sample to the decision boundary and introduced a quantization method for selecting the samples near the boundary with high probability. We performed extensive experiments using two CNN models for three benchmark data sets. The results showed that Ada-Boundary significantly accelerated the training process as well as was better generalized in hard data sets. When training an easy data set, Ada-Boundary showed a fast convergence comparable to that of the state-of-the-art algorithm; when training relatively hard data sets, only Ada-Boundary converged significantly faster than random batch selection.
|
| 177 |
+
|
| 178 |
+
The most exciting benefit of Ada-Boundary is to save the time needed for the training of a DNN. It becomes more important as the size and complexity of data becomes higher, and can be boosted with recent advance of hardware technologies. Our immediate future work is to apply Ada-Boundary to other types of DNNs such as the recurrent neural networks (RNN) (Mikolov et al., 2010) and the long short-term memory (LSTM) (Hochreiter and Schmidhuber, 1997), which have a neural structure completely different from the CNN. In addition, we plan to investigate the relationship between the power of a DNN and the improvement of Ada-Boundary.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In ICML, pages 41–48.
|
| 183 |
+
Chang, H.-S., Learned-Miller, E., and McCallum, A. (2017). Active bias: Training more accurate neural networks by emphasizing high variance samples. In NIPS, pages 1002–1012.
|
| 184 |
+
Chen, B. and Wornell, G. W. (2001). Quantization index modulation: A class of provably good methods for digital watermarking and information embedding. IEEE Trans. on Information Theory, 47(4):1423–1443.
|
| 185 |
+
Fan, Y., Tian, F., Qin, T., and Liu, T.-Y. (2017). Neural data filter for bootstrapping stochastic gradient descent. In ICLR.
|
| 186 |
+
Gao, T. and Jojic, V. (2017). Sample importance in training deep neural networks. https:// openreview.net/forum?id=r1IRctqxg.
|
| 187 |
+
Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep learning. MIT Press. http://www. deeplearningbook.org.
|
| 188 |
+
Gray, R. M. and Neuhoff, D. L. (1998). Quantization. IEEE Trans. on Information Theory, 44(6):2325–2383.
|
| 189 |
+
Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780.
|
| 190 |
+
Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. (2017). Densely connected convolutional networks. In CVPR, volume 1, page 3.
|
| 191 |
+
Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456.
|
| 192 |
+
Katharopoulos, A. and Fleuret, F. (2018). Not all samples are created equal: Deep learning with importance sampling. In ICML, pages 2525–2534.
|
| 193 |
+
Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In ICLR.
|
| 194 |
+
Krizhevsky, A., Nair, V., and Hinton, G. (2014). The CIFAR-10 dataset. https://www.cs. toronto.edu/˜kriz/cifar.html.
|
| 195 |
+
Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. In NIPS, pages 1097–1105.
|
| 196 |
+
Kumar, M. P., Packer, B., and Koller, D. (2010). Self-paced learning for latent variable models. In NIPS, pages 1189–1197.
|
| 197 |
+
LeCun, Y. (1998). The MNIST database of handwritten digits. http://yann.lecun.com/ exdb/mnist.
|
| 198 |
+
LeCun, Y. et al. (2015). LeNet-5, Convolutional neural networks. http://yann.lecun.com/ exdb/lenet.
|
| 199 |
+
Loshchilov, I. and Hutter, F. (2016). Online batch selection for faster training of neural networks. In ICLR.
|
| 200 |
+
Mikolov, T., Karafiat, M., Burget, L., ´ Cernock ˇ y, J., and Khudanpur, S. (2010). Recurrent neural \` network based language model. In INTERSPEECH, pages 1045–1048.
|
| 201 |
+
Needell, D., Ward, R., and Srebro, N. (2014). Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. In NIPS, pages 1017–1025.
|
| 202 |
+
Sachan, M. and Xing, E. (2016). Easy questions first? A case study on curriculum learning for question answering. In ACL, pages 453–463.
|
| 203 |
+
Schaul, T., Quan, J., Antonoglou, I., and Silver, D. (2016). Prioritized experience replay. In ICLR.
|
| 204 |
+
Schmidt, M., Babanezhad, R., Ahmed, M., Defazio, A., Clifton, A., and Sarkar, A. (2015). Nonuniform stochastic average gradient method for training conditional random fields. In AISTATS, pages 819–828.
|
| 205 |
+
Shrivastava, A., Gupta, A., and Girshick, R. (2016). Training region-based object detectors with online hard example mining. In CVPR, pages 761–769.
|
| 206 |
+
Tsvetkov, Y., Faruqui, M., Ling, W., MacWhinney, B., and Dyer, C. (2016). Learning the curriculum with bayesian optimization for task-specific word representation learning. In ACL, pages 130– 139.
|
| 207 |
+
Wu, C.-Y., Manmatha, R., Smola, A. J., and Krahenb ¨ uhl, P. (2017). Sampling matters in deep ¨ embedding learning. In ICCV, pages 2840–2848.
|
| 208 |
+
Xiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747.
|
| 209 |
+
Zagoruyko, S. and Komodakis, N. (2016). Wide residual networks. In BMVC, pages 87.1–87.12.
|
| 210 |
+
Zeiler, M. D. (2012). ADADELTA: An adaptive learning rate method. arXiv:1212.5701.
|
| 211 |
+
|
| 212 |
+
# A IMPLEMENTATION OF THE THREE VARIANTS
|
| 213 |
+
|
| 214 |
+
For Ada-Easy which prefers easy samples to hard samples, $q$ should be small for the sample located deep in the positive direction. For Ada-Hard, $q$ should be small for the sample located deep in the negative direction. Thus, Ada-Easy and Ada-Hard can be implemented by modifying the quantizers $Q ( d )$ in Line of Algorithm 1. When we set $\Delta = k ^ { - 1 } \sqrt { k - 1 } / N$ to make the index $q$ bound to $N$ ( ) 16 Δ = 1, the quantizers of Ada-Easy and Ada-Hard are defined as Eqs. (6) and (7), respectively.
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
\begin{array}{c} \begin{array} { c } { q = Q ( d ) } \\ { Q ( d ) = \{ \begin{array} { l l } { - \lceil d / 2 \Delta \rceil + N / 2 + 1 , } & { i f } \end{array} d \geq 0 } \\ { - \lfloor d / 2 \Delta \rfloor + N / 2 , } & { o t h e r w i s e } \\ { q = Q ( d ) } \\ { Q ( d ) = \{ \begin{array} { l l } { \lceil d / 2 \Delta \rceil + N / 2 , } & { i f } \end{array} d \geq 0 } \\ { \lfloor d / 2 \Delta \rfloor + N / 2 + 1 , } & { o t h e r w i s e } \end{array} \end{array}
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
Ada-Uniform can be implemented by using ${ \cal F } ^ { - 1 } ( x )$ to compute the sampling probability in Line of Algorithm 1, where $F ( x )$ ( ) 9is the empirical sample distribution according to the sample’s distance to the decision boundary.
|
| 221 |
+
|
| 222 |
+
# B HISTORY-BASED Ada-Boundary VARIANT
|
| 223 |
+
|
| 224 |
+
We present Ada-Boundary(History) that updates the quantization indexes based on the previous model with $\pmb { \theta } ^ { t }$ instead of the latest model with $\pmb { \theta } ^ { t + 1 }$ . This is easily accomplished by replacing Lines – of Algorithm 1 with those of Algorithm 2. Ada-Boundary(History) reduces the time required 11 17for additional inference steps that reflect the latest state of the model, which correspond to Lines – of Algorithm 1, at the expense of slight increase of test error.
|
| 225 |
+
|
| 226 |
+
# Algorithm 2 Ada-Boundary(History)
|
| 227 |
+
|
| 228 |
+
INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\gamma$ : warm-up period
|
| 229 |
+
1: $t \gets 1$
|
| 230 |
+
2: $\theta ^ { t } \gets$ ;Initialize the model parameter
|
| 231 |
+
3: $q . d i c t \gets \{ \}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$
|
| 232 |
+
4: for $i = 1$ ;to numEpoch do
|
| 233 |
+
5: =for $j = 1$ to $N / b$ do
|
| 234 |
+
6: if $i \leq \gamma$ then $/ *$ Warm-up $^ { * }$
|
| 235 |
+
7: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ Randomly select next mini-batch samples;
|
| 236 |
+
8: (else $/ { * }$ ) ( )Adaptive batch selection $^ { * }$
|
| 237 |
+
9: prob table Compute P robability q dict, $s _ { e , \ l }$ ; $/ { * }$ By Eq. (5) \*/
|
| 238 |
+
10: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , \bar { y _ { b } } ) \} $ ( )Select next mini-batch samples based on prob table
|
| 239 |
+
11: $/ { * }$ ( ) ( ) Forward and asynchronous update $^ { * }$
|
| 240 |
+
12: $\{ h ( y | x _ { 1 } ; \theta ^ { t } ) , . . . , \{ h ( y | x _ { b } ; \theta ^ { t } ) \} , l o s s \gets G e t . S o f t m a x \& L o s s ( \{ ( x _ { 1 } , y _ { 1 } ) , . . . , ( x _ { b } , y _ { b } ) \} , \theta ^ { t } ) :$
|
| 241 |
+
13: (for $m = 1$ )to $b$ do
|
| 242 |
+
14: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \pmb { \theta } ^ { t } )$ $/ *$ Compute quantization indexes by Eq. (4) \*/
|
| 243 |
+
15: [ ] =/\* Backward \*/
|
| 244 |
+
16: $\pmb { \theta } ^ { t + 1 } S G D \_ S t e p ( l o s s , \pmb { \theta } ^ { t } )$
|
| 245 |
+
17: t ← t
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 7: Convergence curves of Ada-Boundary(History) with SGD on three data sets.
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure 8: Convergence curves of Ada-Boundary(History) with momentum on three data sets.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 9: Convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets.
|
| 255 |
+
|
| 256 |
+
C Ada-Boundary ON TWO HARD DATA SETS
|
| 257 |
+
|
| 258 |
+
As a practical paper, we include the experimental results on two more challenging data sets: CIFAR100 composed of image classes with , training and , testing images; Tiny-ImageNet 100 50 000 10 000composed of image classes with , training and , testing images. All images in 200Tiny-ImageNet were resized to $3 2 \times 3 2$ 00 000images.
|
| 259 |
+
|
| 260 |
+
One of the state-of-the-art model DenseNet $L { = } 2 5$ , $k { = } 1 2$ ) (Huang et al., 2017) was used for two hard data sets with momentum optimizer. Regarding algorithm parameters, we used a learning rate of . and a batch size of ; The training epoch and warm-up threshold $\gamma$ were set to be and 0 1 128, respectively. We repeated every test five times for robustness and reported the average.
|
| 261 |
+
|
| 262 |
+
# C.1 IMPACT OF SELECTION PRESSURE $s _ { e }$
|
| 263 |
+
|
| 264 |
+
The selection pressure $s _ { e }$ determines how strongly the boundary samples are selected. The greater the $s _ { e }$ , the greater the sampling probability of the boundary sample, so more boundary samples were chosen for the next mini-batch. On the other hand, the less $s _ { e }$ makes Ada-Boundary closer to random batch selection.
|
| 265 |
+
|
| 266 |
+
Figure 9 shows the convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets. To clearly analyze the impact of the selection pressure, we plotted the minimum of training loss and test error with a given epochs. Overall, the convergence speed of training loss was accelerated as the $s _ { e }$ increased from to , but that of test error was faster only when the $s _ { e }$ was less than a 2 16certain value. The convergence speed of test error was faster than random batch selection, when $s _ { e }$ was less than or equal to (CIFAR-100) and (Tiny-ImageNet). Surprisingly, the overexposure to 4the boundary samples using the large $s _ { e }$ 2incurred the overfitting issue in hard data sets, whereas the large $s _ { e } = 1 0 0$ worked well for our easy or relatively hard data sets as discussed in Section 4. That = 100is, the selection pressure $s _ { e }$ should be chosen more carefully considering the difficulty of the given data set. We leave this challenge as our future work.
|
| 267 |
+
|
| 268 |
+
# C.2 PERFORMANCE ANALYSIS
|
| 269 |
+
|
| 270 |
+
Table 2 shows the performance gains of Ada-Boundary over random batch selection on two hard data sets. We only quantify the gains of Ada-Boundary $s _ { e } = 2 ,$ ) because its performance was the best as shown in Figure 9. Ada-Boundary $s _ { e } = 2 )$ = 2 always outperforms random batch selection. = 2Especially, it reduces the training time significantly by up to around $20 \%$ .
|
| 271 |
+
|
| 272 |
+
Table 2: Performance gains of Ada-Boundary( $s _ { e } = 2$ ) over random batch selection in Figure 9.
|
| 273 |
+
|
| 274 |
+
<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>1.99%</td><td rowspan=1 colspan=1>33.3%</td><td rowspan=1 colspan=1>21.4%</td></tr><tr><td rowspan=1 colspan=1>TINY-ImageNet</td><td rowspan=1 colspan=1>0.37%</td><td rowspan=1 colspan=1>31.1%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 3 shows the wall-clock training time for the same number of parameter updates on two hard data sets (Figure 9). Ada-Boundary $s _ { e } = 2$ ) with momentum was $1 5 . { \overset { \cdot } { 2 } } \% - 1 6 . 0 \%$ slower than random = 2batch selection. However, it reduced the running time by $1 8 . 0 \% \mathrm { - 2 1 . 4 \% }$ 16(by $G a i n _ { t i m } \rangle$ to obtain the same test error of random batch selection.
|
| 277 |
+
|
| 278 |
+
Table 3: Wall-clock training time for Figure 9 (seconds).
|
| 279 |
+
|
| 280 |
+
<table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=2>Momentum (Figure 9)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>Tiny-ImageNet</td></tr><tr><td rowspan=1 colspan=1>Randombatch</td><td rowspan=1 colspan=1>1917</td><td rowspan=1 colspan=1>3814</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary(se = 2)</td><td rowspan=1 colspan=1>2260</td><td rowspan=1 colspan=1>4542</td></tr></table>
|
| 281 |
+
|
| 282 |
+
# D WALL-CLOCK TRAINING TIME
|
| 283 |
+
|
| 284 |
+
The procedures for recomputing sampling probabilities and updating quantization indexes make Ada-Boundary slower than random batch selection. Table 4 shows the wall-clock training time for the same number of parameter updates (i.e., the same number of epochs) with SGD (Figure 6) and momentum (Figure 10). Ada-Boundary with SGD was $1 2 . 8 \% \mathrm { - } \mathrm { \bar { 1 } } 4 . 7 \%$ and $6 . 0 6 \% - 1 2 . 2 \%$ 12 8% 14 7% 6 06% 12 2%slower than random batch and online batch selections, respectively. Ada-Boundary with momentum was $1 3 . 1 \% \mathrm { - } 1 4 . 7 \%$ and $6 . 6 7 \% - 1 2 . 2 \%$ slower than random batch and online batch selections, 13 1% 14 7% 6 67% 12 2%respectively. Although Ada-Boundary took longer for the same number of updates, Ada-Boundary achieved significant reduction in running time by $7 . 9 6 \% - 3 3 . 5 \%$ (by $G a i n _ { t i m }$ ) to obtain the same 7 96% 33 5%test error of random batch selection due to the fast convergence.
|
| 285 |
+
|
| 286 |
+
Table 4: Wall-clock training time for Figure 6 and Figure 10 (seconds).
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=3>SGD (Figure 6)</td><td rowspan=1 colspan=3>Momentum (Figure 10)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td></tr><tr><td rowspan=1 colspan=1>Random batch</td><td rowspan=1 colspan=1>205</td><td rowspan=1 colspan=1>197</td><td rowspan=1 colspan=1>3347</td><td rowspan=1 colspan=1>199</td><td rowspan=1 colspan=1>192</td><td rowspan=1 colspan=1>3355</td></tr><tr><td rowspan=1 colspan=1>Online batch</td><td rowspan=1 colspan=1>218</td><td rowspan=1 colspan=1>217</td><td rowspan=1 colspan=1>3371</td><td rowspan=1 colspan=1>211</td><td rowspan=1 colspan=1>210</td><td rowspan=1 colspan=1>3388</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary</td><td rowspan=1 colspan=1>235</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>3838</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>225</td><td rowspan=1 colspan=1>3860</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# E EXPERIMENT RESULTS USING MOMENTUM OPTIMIZER
|
| 291 |
+
|
| 292 |
+
# E.1 CONVERGENCE ANALYSIS
|
| 293 |
+
|
| 294 |
+
Figure 10 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the momentum optimizer with setting the momentum to be . . In the MNIST data set, we limited the number of epochs to be because both training loss and 0 9 30test error were fully converged after epochs. We repeat the convergence analysis, as follows:
|
| 295 |
+
|
| 296 |
+
MNIST (Figure 10(a)): Except Ada-Uniform, all adaptive batch selections converged faster than random batch selection. Online batch selection showed much faster convergence speed than other adaptive batch selections in training loss, but converged similarly with the others in test error owing to the overfitting to hard samples.
|
| 297 |
+
|
| 298 |
+
Fashion-MNIST (Figure 10(b)): Ada-Boundary showed the fastest convergence speed in test error, although it did not converge faster than online batch selection in training loss. In contrast, online batch selection was the fastest in training loss, but its convergence in test error was slightly slower than that of random batch selection. This emphasizes the need to consider the samples with appropriate difficulty rather than hard samples. The convergence speeds of Ada-Hard and Ada-Uniform in test error were slower than that of random batch selection.
|
| 299 |
+
|
| 300 |
+
• CIFAR-10 (Figure 10(c)): In both training loss and test error, Ada-Boundary and Ada-Hard showed slightly faster convergence speed than random batch selection. On the other hand, online batch selection converged slightly slower than random batch selection in both cases.
|
| 301 |
+
|
| 302 |
+
In summary, in the easiest MNIST data set, most of adaptive batch selections accelerated their convergence speed compared with random batch selection. However, in Fashion-MNIST data set, only Ada-Boundary converged faster than random batch selection. In a relatively difficult CIFAR-10 data set, Ada-Boundary and Ada-Hard showed comparable convergence speed and then converged faster than random batch selection.
|
| 303 |
+
|
| 304 |
+
# E.2 SUMMARY OF PERFORMANCE GAINS
|
| 305 |
+
|
| 306 |
+
We quantify the performance gains of Ada-Boundary over random batch and online batch selections in Table 5. Ada-Boundary always outperforms both strategies, as already shown in Figure 10. Compared with Table 1, $G a i n _ { t i m }$ over random batch selection tends to become smaller, whereas $G a i n _ { t i m }$ over online batch selection tends to become larger.
|
| 307 |
+
|
| 308 |
+
Table 5: Performance gains over two existing strategies in Figure 10.
|
| 309 |
+
|
| 310 |
+
<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>5.58%</td><td rowspan=1 colspan=1>26.7%</td><td rowspan=1 colspan=1>14.9%</td><td rowspan=1 colspan=1>2.27%</td><td rowspan=1 colspan=1>13.0%</td><td rowspan=1 colspan=1>4.75%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>2.24%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>15.6%</td><td rowspan=1 colspan=1>4.54%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>42.1%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>3.43%</td><td rowspan=1 colspan=1>20.0%</td><td rowspan=1 colspan=1>7.96%</td><td rowspan=1 colspan=1>4.02%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 10: Convergence curves using the momentum optimizer for Figure 6.
|
md/train/Syx4_iCqKQ/Syx4_iCqKQ.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# POLAR PROTOTYPE NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper proposes a neural network for classification and regression, without the need to learn layout structures in the output space. Standard solutions such as softmax cross-entropy and mean squared error are effective but parametric, meaning that known inductive structures such as maximum margin separation and simplicity (Occam’s Razor) need to be learned for the task at hand. Instead, we propose polar prototype networks, a class of networks that explicitly states the structure, i.e., the layout, of the output. The structure is defined by polar prototypes, points on the hypersphere of the output space. For classification, each class is described by a single polar prototype and they are a priori distributed with maximal separation and equal shares on the hypersphere. Classes are assigned to prototypes randomly or based on semantic priors and training becomes a matter of minimizing angular distances between examples and their class prototypes. For regression, we show that training can be performed as a polar interpolation between two prototypes, arriving at a regression with higher-dimensional outputs. From empirical analysis, we find that polar prototype networks benefit from large margin separation and semantic class structure, while only requiring a minimal amount of output dimensions. While the structure is simple, the performance is on par with (classification) or better than (regression) standard network methods. Moreover, we show that we gain the ability to perform regression and classification jointly in the same space, which is disentangled and interpretable by design.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
This paper strives for classification and regression in neural networks. Current standards in classification (with softmax cross-entropy) and regression (with mean squared error) yield effective performance, but do so in a parametric manner. They do not use inductive biases such as maximum class separation, minimal description length, and domain knowledge (Mitchell, 1980). The awareness of such inductive biases then need to be learned while optimizing the task at hand. Instead, we propose to structure the network output space before learning, such that the class structure is both as simple as possible and maximally separable.
|
| 12 |
+
|
| 13 |
+
We are inspired by prototype-based networks, which divide an output metric space into Voronoi cells around a prototype per class (Guerriero et al., 2018; Hasnat et al., 2017; Jetley et al., 2015; Snell et al., 2017; Wen et al., 2016). The Voronoi division tackles the notion of simplicity and minimal description length, while enabling fast generalization and learning from new classes (Snell et al., 2017). However, by mapping examples to prototypes during training, and defining the prototypes as the mean of the examples, the output space is continually modified, altering the true prototype location. Obtaining prototypes is computationally expensive, as it requires a full pass over the training data. As a result, current prototype networks either focus exclusively on the few-shot classification setting (Snell et al., 2017) or resort to coarse approximations of the prototype locations (Hasnat et al., 2017; Guerriero et al., 2018). In this paper we question the need to learn prototypes.
|
| 14 |
+
|
| 15 |
+
By adopting a polar coordinate system, we show that classes can be positioned with (near) optimal separation a priori. This is achieved by finding an equal distribution of points on the hypersphere $\mathbb { S } ^ { \hat { D } - 1 }$ for a $D$ -dimensional output space. Fig. 1a shows an example for a 3D output space. By distributing classes based on maximal angular discrepancy, we arrive at an output space with largemargin class separation and an equal division of the output space over classes. Learning simplifies to minimizing the cosine distance between training examples and their class polar prototype. The structuring of the output space prior to learning alleviates the need to obtain and update the prototypes
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Illustrative overview of polar prototype networks for classification and regression with a 3-dimensional output space. For classification, we position class polar prototypes (six in Fig. 1a) in the output space with maximal separation prior to learning. The output space is determined by maximal polar similarity to the prototypes. For regression, we perform a polar interpolation of two opposing prototypes, denoting the lower and upper regression bounds ( ${ \bf \bar { p } } _ { l }$ and $\mathbf { p } _ { u }$ in Fig. 1b). Note that the output space is visualized as a sphere for ease of visualization. We do not need to project output vectors explicitly onto the hypersphere during training or inference.
|
| 19 |
+
|
| 20 |
+
themselves. We consider two approaches to optimally distribute prototypes on the hypersphere.
|
| 21 |
+
Furthermore, we investigate how to assign classes to prototypes by exploiting semantic priors.
|
| 22 |
+
|
| 23 |
+
Where the literature on prototype networks focuses exclusively on classification, we also propose a method for regression based on polar prototype networks (Fig. 1b). Two opposing polar prototypes are maintained for regression, denoting the lower and upper regression bounds. During training, we minimize for each example the difference between the expected and measured cosine similarities to the polar upper bound. Since the cosine similarities can be computed in higher-dimensional spaces, our approach is a direct generalization of standard regression, which learns on the one-dimensional line. Regression in polar prototype networks yields a more robust and better regression performance. What is more, as regression and classification now form a coherent unity, we show that in polar prototype networks we gain the ability to learn both tasks jointly within the same output, rather than separate outputs per task.
|
| 24 |
+
|
| 25 |
+
We make three contributions in this work: (i) we propose networks with simple, maximally separated, and semantic class structures in the output space defined prior to learning, (ii) we outline how to perform both classification and regression from the imposed output structures, and (iii) we show how to learn both tasks in the same output space in a disentangled and unified outputs. We will make the code and computed polar prototypes publicly available.
|
| 26 |
+
|
| 27 |
+
# 2 CLASSIFICATION AND REGRESSION WITH POLAR PROTOTYPES
|
| 28 |
+
|
| 29 |
+
# 2.1 CLASSIFICATION WITH POLAR PROTOTYPES
|
| 30 |
+
|
| 31 |
+
In a classification setup, we are given $N$ training examples $\{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , where $\mathbf { x } _ { i } ~ \in ~ \mathbb { R } ^ { I }$ and $y _ { i } ~ \in ~ C$ denote the inputs and class labels of the $i ^ { t h }$ training example, $C = \{ 1 , . . , K \}$ the set of $K$ labels, and $I$ the input dimensionality. Furthermore, we have a set of $D$ -dimensional polar prototypes $P = \{ \mathbf { p } _ { 1 } , . . . , \mathbf { p } _ { K } \}$ , where each polar prototype $\mathbf { p } _ { k } \in \mathbb { S } ^ { D - 1 }$ denotes a point on the $D$ - dimensional hypersphere. The polar prototypes are maximally separated from each other a priori, i.e., the prototypes provide an (approximately) equal separation of the output space. We first present the main loss function with the backpropagation and decision rule at inference. Then we outline how to obtain polar prototypes prior to learning and how to assign classes to prototypes.
|
| 32 |
+
|
| 33 |
+
# 2.1.1 LOSS FUNCTION, BACKPROPAGATION, AND INFERENCE
|
| 34 |
+
|
| 35 |
+
For a training example $\left( \mathbf { x } _ { i } , y _ { i } \right)$ , let $\mathbf { z } _ { i } = f _ { \phi } ( \mathbf { x } _ { i } )$ denote the $D$ -dimensional output vector givenva network $f _ { \phi } ( \bar { \cdot } )$ . Since the output space is subdivided by the polar prototypes, we propose to train a classification network by minimizing the angle between the output vector and the polar prototype
|
| 36 |
+
|
| 37 |
+
$\mathbf { p } _ { y _ { i } }$ for ground truth label $y _ { i }$ , so that the classification loss $\mathcal { L } _ { \mathrm { p o l a r - c } }$ to minimize is given as:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathcal { L } _ { \mathrm { p o l a r - c } } = - \sum _ { i = 1 } ^ { N } \cos \theta _ { \mathbf { z } _ { i } , \mathbf { p } _ { y _ { i } } } = - \sum _ { i = 1 } ^ { N } \frac { \lvert \mathbf { z } _ { i } \cdot \mathbf { p } _ { y _ { i } } \rvert } { \lvert \lvert \mathbf { z } _ { i } \rvert \rvert \ \lvert \mathbf { p } _ { y _ { i } } \rvert \rvert } .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
The polar loss function yields a loss of minus one if the ouput vector and prototype point in the same direction. The loss increases as the angle becomes larger and equals one if the vectors point in opposite directions. We note that unlike common classification losses in deep networks, our loss function is only concerned with the mapping from training examples to a structured layout of the output space, the space itself does not need to be learned.
|
| 44 |
+
|
| 45 |
+
Since the polar prototypes do not require updating, we only have to backpropagate the error with respect to the training examples. The partial derivative of the loss function of Eq. 1 with respect to $\mathbf { z } _ { i }$ is given as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { c } { \displaystyle \frac { d } { d \mathbf { z } _ { i } } - \cos \theta _ { \mathbf { z } _ { i } , \mathbf { p } _ { y _ { i } } } = - \frac { \mathbf { p } _ { y _ { i } } \cdot ( | | \mathbf { z } _ { i } | | \cdot | | \mathbf { p } _ { y _ { i } } | | ) - \mathbf { z } _ { i } \cdot | \mathbf { z } _ { i } \cdot \mathbf { p } _ { y _ { i } } | \cdot | | \mathbf { p } _ { y _ { i } } | | \cdot | | \mathbf { z } _ { i } | | ^ { - 1 } } { | | \mathbf { z } _ { i } | | ^ { 2 } \cdot | | \mathbf { p } _ { y _ { i } } | | ^ { 2 } } } \\ { = \frac { \cos \theta _ { \mathbf { z } _ { i } , \mathbf { p } _ { y _ { i } } \cdot \mathbf { z } _ { i } } } { | | \mathbf { z } _ { i } | | ^ { 2 } } - \frac { \mathbf { p } _ { y _ { i } } } { | | \mathbf { z } _ { i } | | \cdot | | \mathbf { p } _ { y _ { i } } | | } . } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The remaining layers in the network are backpropagated in the conventional manner given the error backpropagation of the training examples of Eq. 2.
|
| 52 |
+
|
| 53 |
+
The network minimizes the angle between projected features and polar prototypes. For a new data point $\tilde { \bf x }$ , the cosine similarity to all class prototypes is computed and the class with the highest similarity serves as the prediction:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
c ^ { * } = \underset { c \in C } { \arg \operatorname* { m a x } } \left( \cos \theta _ { f _ { \phi } \left( \tilde { \mathbf { x } } \right) , \mathbf { p } _ { c } } \right) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
# 2.1.2 OBTAINING AND ASSIGNING POLAR PROTOTYPES
|
| 60 |
+
|
| 61 |
+
The loss function and corresponding optimization of polar prototype networks hinges on the presence of polar prototypes that separate the output space prior to learning. For $D$ output dimensions and $K$ classes, this amounts to a spherical code problem of optimally separating $K$ classes on the $D$ -dimensional unit-hypersphere $\ S ^ { D - 1 }$ (Saff & Kuijlaars, 1997). For $D = 2$ , this can be easily solved by splitting the unit-circle $\mathbb { S } ^ { 1 }$ into equal slices, separated by an angle of $\frac { 2 \pi } { K }$ . Then, for each angle $\psi$ , the $2 D$ coordinates are obtained as $( \cos \psi , \sin \psi )$ .
|
| 62 |
+
|
| 63 |
+
For $\textit { D } \geq \ 3$ , no such optimal separation algorithm exists. This is known as the Tammes problem (Tammes, 1930), for which exact solutions only exist for optimally distributing a handful of points on $\mathbb { S } ^ { 2 }$ and none for ${ \mathbb S } ^ { 3 }$ and up (Musin & Tarasov, 2015). To obtain polar prototypes for any output dimension and number of classes, we observe that the optimal set of prototypes, $P ^ { * }$ , is the one where the largest cosine similarity between two class prototypes $\mathbf { p } _ { i } , \mathbf { p } _ { j }$ from the set is minimized:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
P ^ { * } = \underset { P ^ { \prime } \in \mathbb { P } } { \arg \operatorname* { m i n } } \left( \underset { ( k , l , k \neq l ) \in C } { \operatorname* { m a x } } \cos \theta _ { ( \mathbf { p } _ { k } ^ { \prime } , \mathbf { p } _ { l } ^ { \prime } ) } \right) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbb { P }$ contains all sets of $K$ vectors on $\mathbb { S } ^ { D - 1 }$
|
| 70 |
+
|
| 71 |
+
We consider two approaches to approximating the objective of Eq. 4. The first employs Monte Carlo sampling, where a multifold (1e7) of polar prototype sets are sampled from a uniform distribution and the set which maximizes the objective is maintained. The second is an evolutionary algorithm (Eiben et al., 2003) that optimizes for polar prototype separation. For a set of class polar prototypes $P$ , the evolutionary algorithm has a fitness function $g ( P )$ , which returns the minimum cosine distance between the pairs of prototypes in the individual. For every new generation (300 in total), we sample parents ( $30 \%$ from population of 3,000) using fitness proportionate selection and offsprings are produced using single-point row crossover (each parent pair produces 300 offsprings). Before insertion into the population, each new individual undergoes uniform mutation (each feature is replaced by uniform sample with $p = 0 . 0 1$ ). The final population size is decreased back to the original size by sampling individuals for survival, again proportional to $g ( P )$ .
|
| 72 |
+
|
| 73 |
+
Both Monte Carlo sampling and the evolutionary algorithm yield a set of polar prototypes with a large margin separation. However, the algorithms do not specify which classes should be represented by which prototypes. We consider two ways for class to prototype assignment. The first is to assign classes randomly to polar prototypes. The second is to structure the polar prototypes such that semantically similar classes point in similar directions. To achieve this we adapt our evolutionary algorithm to exploit word2vec (Mikolov et al., 2013) representations of the class names. To encourage finding polar prototypes that incorporate semantic information, we add a similarity score to the fitness function of the algorithm. This similarity score describes how similar the neighbourhoods of classes in a set of prototypes are to the neighbourhoods in the word2vec representations. For every class prototype $\mathbf { p } _ { i }$ , sorting the class prototypes based on the cosine similarity of both polar prototypes induces a ranking of ‘closeness’ to each other prototype $\mathbf { p } _ { j }$ . To compute the rank-based distance between the word2vec representations and the found polar prototypes, we can compute the distance between the word2vec order $w _ { i j }$ and the ranks induced by the polar prototype order $p _ { i j }$ as: $\begin{array} { r } { d _ { r } ( w , p ) = \sum _ { i , j } | \mathrm { r a n k } ( w _ { i j } ) - \mathrm { r a n k } ( \bar { p _ { i j } } ) | } \end{array}$ . The similarity score is defined to be the inverse of $d _ { r } ( w , p )$ and is added to the fitness function with a weight parameter $\lambda = 1 0$ that allows us to balance the importance of the semantics and of the separation. Since the best ordering is given by the word2vec representations, we use Principal Component Analysis to reduce these to the desired number of dimensions and use the resulting representations to initialize our population. This evolutionary algorithm results in a set of polars with large margin separation and with a semantic structure from prior knowledge.
|
| 74 |
+
|
| 75 |
+
# 2.2 REGRESSION WITH POLAR PROTOTYPES
|
| 76 |
+
|
| 77 |
+
While current prototype-based works focus exclusively on classification, we show here that regression can be naturally handled in polar prototype networks as well.
|
| 78 |
+
|
| 79 |
+
In a regression setup, we are given $N$ training examples $\{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , where $y _ { i } \in \mathbb { R }$ now denotes a real-valued regression value. The upper and lower bounds on the regression task are denoted as $v _ { u }$ and $v _ { l }$ respectively and are typically the maximum and minimum regression values of the training examples. To perform regression with polar prototypes, we first observe that training examples should no longer point towards a specific prototype as done in classification. Rather, we posit that for regression we maintain two prototypes: $\mathbf { p } _ { u } \in \mathbb { S } ^ { D - 1 }$ which denotes the regression upper bound and $\mathbf { p } _ { l } \in \mathbb { S } ^ { D - 1 }$ which denotes the lower bound. Their specific direction is irrelevant, as long as the two prototypes are diametrically opposed, i.e., $\cos \theta _ { \mathbf { p } _ { l } , \mathbf { p } _ { u } } = - 1$ . The idea behind polar prototype regression is to perform a polar-based interpolation between the lower and upper prototypes. We propose the following loss function for regression with polar prototypes:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { c } { { \displaystyle \mathcal { L } _ { \mathrm { p o l a r - r } } = \sum _ { i = 1 } ^ { N } ( r _ { i } - \cos \theta _ { { \mathbf z } _ { i } , { \mathbf p } _ { u } } ) ^ { 2 } , } } \\ { { r _ { i } = 2 \cdot \frac { y _ { i } - v _ { l } } { v _ { u } - v _ { l } } - 1 . } } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
The loss function of Eq. 5 computes a squared loss between two values. The first value denotes the ground truth regression value, normalized based on the upper and lower bounds. The second value denotes the cosine similarity between the output vector of the training example and the polar upper bound. The intuition behind the loss function is shown in Figure 2 for 3D output space. Shown is an artificial training example for which the ground truth regression value $r _ { i }$ is zero. Due to the symmetric nature of the cosine similarity with respect to the polar upper bound, any output prediction of the training example on the turquoise circle is equally correct. As such, the loss function of Eq. 5 adjusts the angle of the output prediction either away or towards the polar upper bound, based on the difference between the expected and measured cosine similarity to the polar upper bound.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 2: Illustration of polar prototype networks for regression with 3D outputs. For a training example, we compute the cosine similarity between the output prediction $\left( \mathbf { z } _ { i } \right)$ and polar upper bound $\left( \mathbf { p } _ { u } \right)$ . This value is compared to the expected similarity $( r _ { i } )$ and difference between the values determines the gradient direction and magnitude.
|
| 89 |
+
|
| 90 |
+
Table 1: The effect of maximum margin separation and semantic priors for classification in polar prototype networks. Separation is quantified by the minimum and maximum cosine distance among the polar prototypes. We find that an approximate maximum margin separation using our Monte Carlo or evolutionary algorithm is sufficient for effective classification. Furthermore, we find that incorporating semantic priors in our evolutionary algorithms results in polar prototypes with large margin separation, semantic structure, and effective classification performance.
|
| 91 |
+
|
| 92 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Semantic</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td></tr><tr><td>Separation min</td><td>max</td><td>Accuracy</td><td>Separation min</td><td>max</td><td>Accuracy</td></tr><tr><td> Baseline prototypes</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>One-hot vectors (Chintala et al.,2017)</td><td></td><td>1.00</td><td>1.00</td><td>91.1 ± 0.2</td><td>1.00</td><td>1.00</td><td>51.5 ± 0.4</td></tr><tr><td>word2vec (Mikolov et al., 2013)</td><td>厂</td><td>0.72</td><td>1.40</td><td>91.0 ± 0.2</td><td>0.26</td><td>1.32</td><td>61.2 ± 0.7</td></tr><tr><td> Our prototypes</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Monte Carlo</td><td></td><td>0.77</td><td>1.76</td><td>90.9 ± 0.1</td><td>0.73</td><td>1.36</td><td>64.9 ± 0.1</td></tr><tr><td>Evolutionary</td><td></td><td>0.89</td><td>1.81</td><td>90.7 ± 0.2</td><td>0.73</td><td>1.40</td><td>64.8 ± 0.3</td></tr><tr><td>Evolutionary</td><td>√</td><td>0.91</td><td>1.40</td><td>91.2 ± 0.1</td><td>0.73</td><td>1.36</td><td>65.0 ± 0.3</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Standard regression computes and backpropagates a loss directly on one-dimensional outputs. In the context of this work, this corresponds to an optimization on the line from $\mathbf { p } _ { l }$ to $\mathbf { p } _ { u }$ . Our approach generalizes regression to higher dimensional output spaces. While we still try to find an interpolation between two points on the line, the ability to project to higher dimensional outputs provides additional degrees of freedom to help the regression optimization. As shown in the experiments, this generalization results in a better and more robust performance than mean squared error.
|
| 95 |
+
|
| 96 |
+
# 2.3 LEARNING MULTIPLE TASKS IN THE SAME OUTPUT SPACE
|
| 97 |
+
|
| 98 |
+
To underline that classification and regression form a coherent unity in polar prototype networks, we show that both tasks can be optimized not only with the same base network, as is common in multi-task learning (Caruana, 1997), but can even be done in the same output space. To combine regression and classification in a shared $D$ -dimensional output space, all that is required is to place the upper and lower polar bounds for regression in opposite direction along one axis. The other axes can then be used to maximally separate the class polar prototypes for classification. Optimization is as simple as summing the losses of Eq. 1 and 5. In this manner the regression and classification are unraveled and interpretable by design, while being jointly optimized in the same space. This allows us to obtain classification and regression results at the same time and to visualize and interpret results from multiple tasks in the same space.
|
| 99 |
+
|
| 100 |
+
# 3 EXPERIMENTAL EVALUATION
|
| 101 |
+
|
| 102 |
+
# 3.1 CLASSIFICATION
|
| 103 |
+
|
| 104 |
+
We first evaluate polar prototype networks for classification, where we investigate the importance of the inductive and semantic priors that are incorporated in our network outputs: maximum margin separation, semantic class similarity, and minimum description length. We evaluate on CIFAR-10 and CIFAR-100 using ResNet32 (He et al., 2016) as the base network, optimized using SGD (learning rate: 0.01, momentum: 0.9) for 250 epochs. The learning rate is decreased by a factor 10 after 150 and 200 epochs. For all experimental settings, we perform five runs and report the mean and standard deviation of the top-1 accuracy.
|
| 105 |
+
|
| 106 |
+
Maximum margin separation. First, we investigate the importance of separation with polar prototypes. We evaluate our Monte Carlo and evolutionary algorithms, with a comparison to baseline prototypes as proposed in (Chintala et al., 2017). In the baseline each prototype is a vertex of the standard simplex, i.e., each prototype is a unique one-hot vector where all entries are zero except one. The baseline prototypes are optimally separated but on the positive quadrant only, while our prototypes are approximately optimally separated on the full hypersphere. For all approaches, we perform random assignments between classes and polar prototypes. Using these three approaches, we relate the separation to the classification performance in polar prototype networks. For this experiment, we use 10 and 100 output dimensions for CIFAR-10 and CIFAR-100 respectively.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 3: Minimal amount of output dimensions in polar prototype networks. For CIFAR-10 and CIFAR-100, we can largely reduce the output space with minimal loss in performance. We also compare to softmax cross-entropy and find that the performance is similar. This experiment highlights the ability of our approach to provide effective results with the simplest of output structures.
|
| 110 |
+
|
| 111 |
+
The results are shown in Table 1, where the approaches of interest are the non-semantic ones. We observe that the baseline has an equal separation among all classes, as the prototypes form an orthonormal basis. However, this also means only a quarter of the space of the hypersphere is used. Our approaches make full use of the space of the hypersphere. We find that the evolutionary algorithm yields a better separation than the Monte Carlo algorithm, especially in lower dimensions. The importance of exploiting the full hypersphere for polar prototypes becomes evident when evaluating the classification performance. While the CIFAR-10 performance is roughly equal for all three, the baseline only reaches an average accuracy of $5 1 . 5 \%$ on CIFAR-100, compared to $6 4 . 9 \%$ and $6 4 . 8 \%$ for our polar prototypes. Interestingly, the larger margins of our evolutionary algorithm do not result in better performance. These results indicate that for classification, a large margin separation on the full hypersphere is preferred, but a maximum separation is not a must.
|
| 112 |
+
|
| 113 |
+
Learning with semantic priors. Second, we investigate the effect of enhancing our evolutionary algorithm with semantic class knowledge. We use the word2vec embeddings of the class names as the baseline approach for semantic polar prototypes. The word embeddings are a natural baseline, as the cosine similarity is the common similarity measure for the embedding vectors. We perform PCA reduction on the word embeddings to make them of equal dimensionality as our polar prototypes. The results of this
|
| 114 |
+
|
| 115 |
+
Table 2: Classification for few training examples on CIFAR-100. Adding semantic priors to our polar prototypes aids classification performance when examples are more limited.
|
| 116 |
+
|
| 117 |
+
<table><tr><td></td><td colspan="3"> Samples per class</td></tr><tr><td></td><td>5</td><td>20</td><td>50</td><td>all</td></tr><tr><td>Ours (w/o semantics)</td><td>8.3</td><td>16.4</td><td>28.7</td><td>64.8</td></tr><tr><td>Ours (w/ semantics)</td><td>8.9</td><td>17.7</td><td>30.4</td><td>65.0</td></tr></table>
|
| 118 |
+
|
| 119 |
+
experiment are in Table 1, with the semantic approaches check-marked. We observe that the word2vec baseline yields a desirable separation and accuracy on CIFAR-10. However, when increasing the output dimensionality and number of classes in CIFAR-100 the separation decreases, which has a negative effect on the performance (mean accuracy of $6 1 . 2 \%$ ). For our evolutionary algorithm, we obtain polar prototypes with both a semantic structure and large class separation. The performance on CIFAR-10 and CIFAR-100 benefits from the semantics, leading us to conclude that semantic priors aid the classification abilities. In Table 2, we also investigate the use of semantic priors in polar prototype networks when training examples are scarce. When training examples are scarce our approach benefits from the semantic class correlations for classification. To show that our approach also benefits from deeper architectures, we have also applied our approach with semantic priors on a DenseNet121 architecture (Huang et al., 2017). This improved the results to $9 3 . 2 \%$ (CIFAR-10) and $7 3 . 1 \%$ (CIFAR-100). We expect further improvements with strategies such as pre-training and extensive hyperparameter tuning.
|
| 120 |
+
|
| 121 |
+
Table 3: Regression performance of polar prototype networks for predicting creation year in paintings. Shown are the mean absolute error rates. Polar prototype networks largely outperform standard network regression when using SGD. With Adam, we also report better performance. Polar prototype networks are an effective and robust solution for regression in neural networks.
|
| 122 |
+
|
| 123 |
+
<table><tr><td rowspan="2"></td><td colspan="3">OmniArt</td></tr><tr><td>Output dimensions</td><td>Optimizer SGD</td><td>Adam</td></tr><tr><td colspan="3">Baseline regression</td><td></td></tr><tr><td>(Strezoski & Worring,2017)</td><td>1</td><td>88.3</td><td></td></tr><tr><td>Square loss regression</td><td>1</td><td>199.7 ± 31.7</td><td>81.0 ± 1.4</td></tr><tr><td>Square loss regression</td><td>2+1</td><td>236.2 ± 74.3</td><td>78.7 ± 0.7</td></tr><tr><td>Square loss regression</td><td>3+1</td><td>207.2 ± 35.8</td><td>80.0 ± 0.6</td></tr><tr><td colspan="3"> Our regression</td><td></td></tr><tr><td>Polar prototypes</td><td>23</td><td>74.8 ± 6.8</td><td>71.9 ± 3.6</td></tr><tr><td>Polar prototypes</td><td></td><td>72.3 ± 3.9</td><td>71.6 ± 2.7</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Towards minimal amount of dimensions in the network outputs. Where the penultimate layer of networks with softmax cross-entropy is described by an unbounded $K$ -dimensional output space for $K$ classes, our polar prototype networks reduces the description to a bounded $( K \bar { \ } \times \bar { K } )$ -dimensional matrix when using the same number of output dimensions. Contrary to softmax cross-entropy however, we are not restricted to a fixed-size output space. In the third study, we evaluate the classification performance when using lower-dimensional output spaces, to arrive at a minimal amount of dimensions in the output space. We use our evolutionary algorithm with semantic priors. We also use this study to compare to softmax cross-entropy.
|
| 126 |
+
|
| 127 |
+
Figure 3 shows the classification performance as a function of the output description length on CIFAR-10 and CIFAR-100. For both datasets, we observe that we can reduce the output space for a large part with minimal effect on the performance. We also provide a comparison to softmax cross-entropy with identical settings, which yields a similar performance on both datasets. Next to being competitive to softmax cross-entropy, our approach is also competitive to the prototypebased approach of Guerriero et al. (2018), with the benefit that our approach not longer needs to continuously re-esitmate and update the class prototypes. A direct comparison to e.g. Schnell et al. (2017) is not possible, since it is optimized for few-shot learning only. We conclude that polar prototype networks deliver effective performance with the simplest of output structures, embodying Occam’s Razor in enabling predictive interpretation (Grunwald et al., 2005). ¨
|
| 128 |
+
|
| 129 |
+
# 3.2 REGRESSION
|
| 130 |
+
|
| 131 |
+
In the second experiment, we evaluate polar prototype networks for regression. We perform an evaluation on the challenging task of predicting the creation year of paintings. We focus on paintings from the $2 0 ^ { t h }$ century available as part of the large-scale OmniArt dataset (Strezoski & Worring, 2017). This results in a dataset with 15,000 training examples and 8,353 test examples1. We employ a ResNet16 network architecture (He et al., 2016) trained in similar fashion to the classification setup. The Mean Absolute Error is used as the evaluation metric. We compare our approach to a squared loss regression baseline, where we both normalize and clamp the outputs between 0 and 1 using the bounds to provide a fair comparison to our regression. For this baseline, we also include variants where the output layer has more dimensions, followed by an additional layer to a onedimensional output.
|
| 132 |
+
|
| 133 |
+
The results are shown in Table 3. When we employ the same setup as in our classification experiments, i.e., with SGD as the optimizer, the squared loss regression baselines all fail to converge, resulting in high error rates. Our approach using SGD does converge and yields far better results. Given the large difference in performance, we also ran the baselines and our approaches using Adam (Kingma & Ba, 2014). With this setting, the baselines do converge. However, our approach also works better. We find that, using Adam, our approach with a two-dimensional output significantly outperforms the baseline with a two-dimensional plus an additional one-dimensional layer $\mathit { p } = 0 . 0 2$ for a two sample t-test, $H _ { 0 } =$ both samples have same mean). This also holds for the comparison with three dimensions ${ \mathrm { \Delta } } p = 0 . 0 1 { \mathrm { \Omega } }$ ). With our approach, we observe that using three dimensions over two results in slightly better performance, but not significantly $( p = 0 . 9 )$ . Lastly, we find that our error rate of 71.6 outperforms the regression baseline of (Strezoski & Worring, 2017) (MAE of 88.3, other info on paintings is excluded for a more fair comparison to our work). We conclude that polar prototype networks provide an effective and robust solution for regression.
|
| 134 |
+
|
| 135 |
+
# 3.3 JOINT REGRESSION AND CLASSIFICATION IN THE SAME OUTPUT SPACE
|
| 136 |
+
|
| 137 |
+
To underline the unification of regression and classification in polar prototype networks, we have performed an experiment where both tasks are optimized within the same output space. We use the MNIST dataset, where we aim to both classify the digits and regress the rotation of the examples. We use the digits 2, 3, 4, 5, and 7, where we apply a random rotation between 0 and 180 degrees to each example. The other digits were not of interest given the rotational range. We employ a 3-dimensional output space, where the classes are optimally separated along the $( x , y )$ plane and the regression bounds are projected along the $z$ -axis. We use a simple network with two convolutional and two fully connected layers.
|
| 138 |
+
|
| 139 |
+
In Figure 4, we visualize projections of data points in the output space of our network after 20 epochs. We provide separate visualizations for regression and classification for clarity and emphasize that they are the same output space. For regression, we observe a smooth interpolation between the minimum and maximum rotation, highlighting our regression ability. For classification, we observe that the digits from each class form slices with large separation to other classes. The joint optimization results in a space that unravels the inter-class separation from the intra-class rotations by design.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 4: Joint regression and classification in the same output space on a rotated MNIST subset. The regression and classification structure is shown separately for ease of visualization, we explicitly note that the space is identical. Rotation is along the $z$ -axis (color denotes regression value), while classification is on the $( x , y )$ -plane (color denotes class). With polar prototype networks, the output space can disentangle different tasks in a structured manner.
|
| 143 |
+
|
| 144 |
+
# 4 RELATED WORK
|
| 145 |
+
|
| 146 |
+
Our approach builds upon prototype-based networks, which have recently gained traction under various names, including centers (Wen et al., 2016), proxies (Movshovitz-Attias et al., 2017), means (Guerriero et al., 2018), prototypical concepts (Jetley et al., 2015), and prototypes (Snell et al., 2017). In general, these works adhere to the Nearest Mean Classifier paradigm (Mensink et al., 2013) by assigning training examples to a vector in the output space of the network, which is defined to be the mean vector of the training examples. A few works have also investigated multiple prototypes per class (Movshovitz-Attias et al., 2017; Yang et al., 2018). Prototype-based networks have shown to enforce a more coherent output structure (Wen et al., 2016) and to enable a generalization to new classes (Guerriero et al., 2018; Snell et al., 2017; Yang et al., 2018).
|
| 147 |
+
|
| 148 |
+
While promising, the training of prototype networks is currently faced with a chicken-and-egg problem. Training examples are mapped to class prototypes, while class prototypes are defined as the mean of the training examples. Because the projection from input to output changes continuously during network training, the true location of the prototypes changes with each mini-batch update. This holds for methods with both one, or multiple prototypes per class. Obtaining the true location of the prototypes is expensive, as it requires a pass over the complete dataset. As such, prototype networks currently either focus on the few-shot setting (Boney & Ilin, 2017; Snell et al., 2017), or on approximating the prototypes. Approximations include alternating the example mapping and prototype learning (Hasnat et al., 2017) or updating the prototypes online as a function of the minibatches (Guerriero et al., 2018). We propose to bypass the prototype learning altogether by structuring the output space prior to training. By defining polar prototypes as points on the hypersphere, they are maximally separated a priori. Optimization simplifies to minimizing a polar distance between training examples and their corresponding prototype, alleviating the need to continuously obtain and learn prototypes. Moreover, we provide a unification between classification and regression.
|
| 149 |
+
|
| 150 |
+
Bojanowski and Joulin (Bojanowski & Joulin, 2017) recently showed that unsupervised learning is possible by projecting examples to random prototypes on the unit hypersphere. Here, we similarly employ prototypes on the hypersphere, but do so in a supervised setting, without the need to explicitly project network outputs to the hypersphere. Perrot and Habrard (Perrot & Habrard, 2015) have previously explored the notion of pre-defined prototypes in the context of metric learning. We also employ pre-defined prototypes, but on the hypersphere in a deep learning setting using polar distances, for both classification and regression.
|
| 151 |
+
|
| 152 |
+
Several works have shown the benefit of optimizing networks using angles for classification. Liu et al. (2016) aim to improve the separation in softmax cross-entropy by increasing the angular margin between classes. In similar fashion, several works project network outputs to the hypersphere for classification through $\ell _ { 2 }$ normalization, which forces softmax cross-entropy to optimize for angular separation (Hasnat et al., 2017; Liu et al., 2017a; Wang et al., 2018; Zheng et al., 2018). The work of (Gidaris & Komodakis, 2018) shows that using cosine similarity in the output helps the generalization to new categories. The potential of angular similarities has also been investigated in other layers of deep networks (Liu et al., 2017b; Luo et al., 2017). In this work, we combine large margin separation from an angle-based perspective with the minimal description length from a prototype-based perspective and arrive at polar prototype networks, a simple and effective unified solution for classification and regression.
|
| 153 |
+
|
| 154 |
+
# 5 CONCLUSIONS
|
| 155 |
+
|
| 156 |
+
We propose polar prototype networks for unified classification and regression by imposing output structures that are both simple and with maximum margin separation. For classification, prototypes are distributed as uniformly as possible on the hypersphere prior to learning. We also show how to incorporate a semantic structure in the prototype distribution from prior knowledge. The network in turn only requires a polar minimization between training examples and their class prototypes. The simplicity of the output structure furthermore enables us to generalize to regression. Rather than directly minimizing an angle to fixed prototype locations, as done in classification, we maintain two diametrically opposed prototypes; the lower and upper regression bound. We outline how to perform regression in this setting as an interpolation between the polar lower and upper bounds. Experimentally, we show that our classification approach benefits from large-margin class separation and a semantic structure, resulting in effective classifiers with a minimal description length. Our regression outperforms standard squared error optimization, highlighting its expressive abilities. Since regression and classification are unified in the same network, we enable the capability to optimize both tasks in the same output, resulting in a common space with disentangled factors. We conclude that polar prototype networks provide a unified solution at least as effective as softmax cross-entropy and mean squared error, while having simpler and more interpretable output structures.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. ICML, 2017.
|
| 161 |
+
|
| 162 |
+
Rinu Boney and Alexander Ilin. Semi-supervised few-shot learning with prototypical networks. CoRR, 2017.
|
| 163 |
+
|
| 164 |
+
Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997.
|
| 165 |
+
|
| 166 |
+
Soumith Chintala, Arthur Szlam, Yuandong Tian, Mark Tygert, Wojciech Zaremba, et al. Scaleinvariant learning and convolutional networks. Applied and Computational Harmonic Analysis, 42(1):154–166, 2017.
|
| 167 |
+
|
| 168 |
+
Agoston E Eiben, James E Smith, et al. Introduction to evolutionary computing, volume 53. Springer, 2003.
|
| 169 |
+
|
| 170 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018.
|
| 171 |
+
|
| 172 |
+
Peter D Grunwald, In Jae Myung, and Mark A Pitt. ¨ Advances in minimum description length: Theory and applications. MIT press, 2005.
|
| 173 |
+
|
| 174 |
+
Samantha Guerriero, Barbara Caputo, and Thomas Mensink. Deep nearest class mean classifiers. In ICLR, Worskhop Track, 2018.
|
| 175 |
+
|
| 176 |
+
Md Hasnat, Julien Bohne, Jonathan Milgram, St ´ ephane Gentric, and Liming Chen. von mises-fisher ´ mixture model-based deep learning: Application to face verification. CoRR, 2017.
|
| 177 |
+
|
| 178 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 179 |
+
|
| 180 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 181 |
+
|
| 182 |
+
Saumya Jetley, Bernardino Romera-Paredes, Sadeep Jayasumana, and Philip Torr. Prototypical priors: From improving classification to zero-shot learning. BMVC, 2015.
|
| 183 |
+
|
| 184 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR, 2014.
|
| 185 |
+
|
| 186 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In ICML, 2016.
|
| 187 |
+
|
| 188 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Sphereface: Deep hypersphere embedding for face recognition. In CVPR, 2017a.
|
| 189 |
+
|
| 190 |
+
Weiyang Liu, Yan-Ming Zhang, Xingguo Li, Zhiding Yu, Bo Dai, Tuo Zhao, and Le Song. Deep hyperspherical learning. In NIPS, 2017b.
|
| 191 |
+
|
| 192 |
+
Chunjie Luo, Jianfeng Zhan, Lei Wang, and Qiang Yang. Cosine normalization: Using cosine similarity instead of dot product in neural networks. CoRR, 2017.
|
| 193 |
+
|
| 194 |
+
Thomas Mensink, Jakob Verbeek, Florent Perronnin, and Gabriela Csurka. Distance-based image classification: Generalizing to new classes at near-zero cost. TPAMI, 35(11):2624–2637, 2013.
|
| 195 |
+
|
| 196 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013.
|
| 197 |
+
|
| 198 |
+
Tom M Mitchell. The need for biases in learning generalizations. Department of Computer Science, Laboratory for Computer Science Research, Rutgers Univ. New Jersey, 1980.
|
| 199 |
+
|
| 200 |
+
Yair Movshovitz-Attias, Alexander Toshev, Thomas K Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. CVPR, 2017.
|
| 201 |
+
|
| 202 |
+
Oleg R Musin and Alexey S Tarasov. The tammes problem for $\mathrm { n } { = } 1 4$ . Experimental Mathematics, 24(4):460–468, 2015.
|
| 203 |
+
|
| 204 |
+
Michael Perrot and Amaury Habrard. Regressive virtual metric learning. In ¨ NIPS, 2015.
|
| 205 |
+
|
| 206 |
+
Edward B Saff and Amo BJ Kuijlaars. Distributing many points on a sphere. The mathematical intelligencer, 19(1):5–11, 1997.
|
| 207 |
+
|
| 208 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NIPS, 2017.
|
| 209 |
+
|
| 210 |
+
Gjorgji Strezoski and Marcel Worring. Omniart: multi-task deep learning for artistic data analysis. CoRR, 2017.
|
| 211 |
+
|
| 212 |
+
Pieter Merkus Lambertus Tammes. On the origin of number and arrangement of the places of exit on the surface of pollen-grains. Recueil des travaux botaniques neerlandais ´ , 27(1):1–84, 1930.
|
| 213 |
+
|
| 214 |
+
Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Zhifeng Li, Dihong Gong, Jingchao Zhou, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. CVPR, 2018.
|
| 215 |
+
|
| 216 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In ECCV, 2016.
|
| 217 |
+
|
| 218 |
+
Hong-Ming Yang, Xu-Yao Zhang, Fei Yin, and Cheng-Lin Liu. Robust classification with convolutional prototype learning. In CVPR, 2018.
|
| 219 |
+
|
| 220 |
+
Yutong Zheng, Dipan K Pal, and Marios Savvides. Ring loss: Convex feature normalization for face recognition. In CVPR, 2018.
|
md/train/TRDAFiwDq8A/TRDAFiwDq8A.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MagNet: A Neural Network for Directed Graphs
|
| 2 |
+
|
| 3 |
+
Xitong Zhang1, Yixuan $\mathrm { H e } ^ { 2 }$ , Nathan Brugnone1,3, Michael Perlmutter4, and Matthew $\mathrm { H i r n } ^ { 1 , 5 , 6 }$
|
| 4 |
+
|
| 5 |
+
1Michigan State University, Department of Computational Mathematics, Science & Engineering, East Lansing, Michigan, United States 2University of Oxford, Department of Statistics, Oxford, England, United Kingdom 3Michigan State University, Department of Community Sustainability, East Lansing, Michigan, United States 4University of California, Los Angeles, Department of Mathematics, Los Angeles, California, United States 5Michigan State University, Department of Mathematics, East Lansing, Michigan, United States 6Michigan State University, Center for Quantum Computing, Science & Engineering, East Lansing, Michigan, United States
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
The prevalence of graph-based data has spurred the rapid development of graph neural networks (GNNs) and related machine learning algorithms. Yet, despite the many datasets naturally modeled as directed graphs, including citation, website, and traffic networks, the vast majority of this research focuses on undirected graphs. In this paper, we propose MagNet, a GNN for directed graphs based on a complex Hermitian matrix known as the magnetic Laplacian. This matrix encodes undirected geometric structure in the magnitude of its entries and directional information in their phase. A “charge” parameter attunes spectral information to variation among directed cycles. We apply our network to a variety of directed graph node classification and link prediction tasks showing that MagNet performs well on all tasks and that its performance exceeds all other methods on a majority of such tasks. The underlying principles of MagNet are such that it can be adapted to other GNN architectures.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Endowing a collection of objects with a graph structure allows one to encode pairwise relationships among its elements. These relations often possess a natural notion of direction. For example, the WebKB dataset [36] contains a list of university websites with associated hyperlinks. In this context, one website might link to a second without a reciprocal link to the first. Such datasets are naturally modeled by directed graphs. In this paper, we introduce MagNet, a graph convolutional neural network for directed graphs based on the magnetic Laplacian.
|
| 14 |
+
|
| 15 |
+
Most graph neural networks fall into one of two families, spectral networks or spatial networks. Spatial methods define graph convolution as a localized averaging operation with iteratively learned weights. Spectral networks, on the other hand, define convolution on graphs via the eigendecompositon of the (normalized) graph Laplacian. The eigenvectors of the graph Laplacian assume the role of Fourier modes, and convolution is defined as entrywise multiplication in the Fourier basis. For a comprehensive review of both spatial and spectral networks, we refer the reader to [46] and [44].
|
| 16 |
+
|
| 17 |
+
Many spatial graph CNNs have natural extensions to directed graphs. However, these extensions typically only consider the outgoing neighbors of each vertex and neglect the incoming neighbors. Therefore, they run the risk of discarding potentially important information. Consider, for example, a directed social network such as Twitter, where the nodes are Twitter accounts and a directed edge $( u , v ) \in E$ means that account $u$ mentions account $v$ (using the $@$ functionality). To infer something about account $v$ , there is important information to be gathered both from other accounts that $v$ mentions, and accounts that mention $v$ . Therefore, it is common for spatial methods to preprocess the data by symmetrizing the adjacency matrix, effectively creating an undirected graph. For example, while [43] explicitly notes that their network is well-defined on directed graphs, their experiments treat all citation networks as undirected for improved performance.
|
| 18 |
+
|
| 19 |
+
Extending spectral methods to directed graphs is not straightforward since the adjacency matrix is asymmetric and, thus, there is no obvious way to define a symmetric, real-valued Laplacian with a full set of real eigenvalues that uniquely encodes any directed graph. We overcome this challenge by constructing a network based on the magnetic Laplacian $\mathbf { L } ^ { \left( q \right) }$ defined in Section 2. Unlike the directed graph Laplacians used in works such as [29, 33, 41, 42], the magnetic Laplacian is not a real-valued symmetric matrix. Instead, it is a complex-valued Hermitian matrix that encodes the fundamentally asymmetric nature of a directed graph via the complex phase of its entries.
|
| 20 |
+
|
| 21 |
+
Since $\mathbf { L } ^ { \left( q \right) }$ is Hermitian, the spectral theorem implies it has an orthonormal basis of complex eigenvectors corresponding to real eigenvalues. Moreover, Theorem 1, stated in Section 5 of the supplement, shows that $\mathbf { L } ^ { \left( q \right) }$ is positive semidefinite, similar to the traditional Laplacian. Setting $q = 0$ is equivalent to symmetrizing the adjacency matrix and no importance is given to directional information. When $q = . 2 5$ , on the other hand, we have that $\mathbf { L } ^ { ( . 2 5 ) } ( u , v ) = - \mathbf { L } ^ { ( . 2 5 ) } ( v , u )$ whenever there is an edge from $u$ to $v$ but not from $v$ to $u$ . Different values of $q$ highlight different graph motifs [16, 17, 20, 32], and therefore the optimal choice of $q$ varies. Learning the appropriate value of $q$ from data allows MagNet to adaptively incorporate directed information. We also note that $\mathbf { L } ^ { \left( q \right) }$ has been applied to graph signal processing [19], community detection [17], and clustering [10, 16, 15].
|
| 22 |
+
|
| 23 |
+
In Section 3, we show how the networks constructed in [6, 13, 24] can be adapted to directed graphs by incorporating complex Hermitian matrices, such as the magnetic Laplacian. When $q = 0$ , we effectively recover the networks constructed in those previous works. Therefore, our work generalizes these networks in a way that is suitable for directed graphs. Our method is very general and is not tied to any particular choice of network architecture. Indeed, the main ideas of this work could be adapted to nearly any spectral graph neural network, and some spatial ones.
|
| 24 |
+
|
| 25 |
+
In Section 4, we summarize related work on directed graph neural networks as well as other papers studying the magnetic Laplacian and its applications in data science. In Section 5, we apply our network to node classification and link prediction tasks. We compare against several spectral and spatial methods as well as networks designed for directed graphs. We find that MagNet obtains the best or second-best performance on five out of six node-classification tasks and has the best performance on seven out of eight link-prediction tasks tested on real-world data, in addition to providing excellent node-classification performance on difficult synthetic data. We also provide a supplementary document with full implementation details, theoretical results concerning the magnetic Laplacian, extended examples, and further numerical details.
|
| 26 |
+
|
| 27 |
+
# 2 The magnetic Laplacian
|
| 28 |
+
|
| 29 |
+
Spectral graph theory has been remarkably successful in relating geometric characteristics of undirected graphs to properties of eigenvectors and eigenvalues of graph Laplacians and related matrices. For example, the tasks of optimal graph partitioning, sparsification, clustering, and embedding may be approximated by eigenvectors corresponding to small eigenvalues of various Laplacians (see, e.g., [9, 38, 2, 40, 11]). Similarly, the graph signal processing research community leverages the full set of eigenvectors to extend the Fourier transform to these structures [34]. Furthermore, numerous papers [6, 13, 24] have shown that this eigendecomposition can be used to define neural networks on graphs. In this section, we provide the background needed to extend these constructions to directed graphs via complex Hermitian matrices such as the magnetic Laplacian.
|
| 30 |
+
|
| 31 |
+
We let $G = ( V , E )$ be a directed graph where $V$ is a set of $N$ vertices and $E \subseteq V \times V$ is a set of directed edges. If $( u , v ) \in E$ , then we say there is an edge from $u$ to $v$ . For the sake of simplicity, we will focus on the case where the graph is unweighted and has no self-loops, i.e., $( v , v ) \notin E$ , but our methods have natural extensions to graphs with self-loops and/or weighted edges. If both $( u , v ) \in E$ and $( v , u ) \in E$ , then one may consider this pair of directed edges as a single undirected edge.
|
| 32 |
+
|
| 33 |
+
A directed graph can be described by an adjacency matrix $( \mathbf { A } ( u , v ) ) _ { u , v \in V }$ where $\mathbf { A } ( u , v ) = 1$ if $( u , v ) \in E$ and $\mathbf { A } ( u , v ) = 0$ otherwise. Unless $G$ is undirected, $\mathbf { A }$ is not symmetric, and, indeed, this is the key technical challenge in extending spectral graph neural networks to directed graphs. In the undirected case, where the adjacency matrix $\mathbf { A }$ is symmetric, the (unnormalized) graph Laplacian can be defined by $\mathbf { L } = \mathbf { D } - \mathbf { A }$ , where $\mathbf { D }$ is a diagonal degree matrix. It is well-known that $\mathbf { L }$ is a symmetric, positive-semidefinite matrix and therefore has an orthonormal basis of eigenvectors associated with non-negative eigenvalues. However, when A is asymmetric, direct attempts to define the Laplacian this way typically yield complex eigenvalues. This impedes the straightforward extension of classical methods of spectral graph theory and graph signal processing to directed graphs.
|
| 34 |
+
|
| 35 |
+
A key point of this paper is to represent the directed graph through a complex Hermitian matrix $\mathcal { L }$ such that: (1) the magnitude of $\scriptstyle { \mathcal { L } } ( u , v )$ indicates the presence of an edge, but not its direction; and (2) the phase of $\scriptstyle { \mathcal { L } } ( u , v )$ indicates the direction of the edge, or if the edge is undirected. Such matrices have been explored in the directed graph literature (see Section 4), but not in the context of graph neural networks. They have several advantages over their real-valued matrix counterparts. In particular, a single symmetric real-valued matrix will not uniquely represent a directed graph. Instead, one must use several matrices, as in [42], but this increases the complexity of the resulting network. Alternatively, one can work with an asymmetric, real-valued matrix, such as the adjacency matrix or the random walk matrix. However, the spatial graph filters that result from such matrices are typically limited by the fact that they can only aggregate information from the vertices that can be reached in one hop from a central vertex, but ignore the equally important subset of vertices that can reach the central vertex in one hop. Complex Hermitian matrices, however, lead to filters that aggregate information from both sets of vertices. Finally, one could use a real-valued skew-symmetric matrix but such matrices do not generalize well to graphs with both directed and undirected edges.
|
| 36 |
+
|
| 37 |
+
The optimal choice of complex Hermitian matrix is an open question. Here, we utilize a parameterized family of magnetic Laplacians, which have proven to be useful in other data-driven contexts [17, 10, 16, 15]. We first define the symmetrized adjacency matrix and corresponding degree matrix by,
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathbf { A } _ { s } ( u , v ) : = \frac 1 2 ( \mathbf { A } ( u , v ) + \mathbf { A } ( v , u ) ) , \ 1 \leq u , v \leq N , \quad \mathbf { D } _ { s } ( u , u ) : = \sum _ { v \in V } \mathbf { A } _ { s } ( u , v ) , \ 1 \leq u \leq N ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
with $\mathbf { D } _ { s } ( u , v ) = 0$ for $u \ne v$ . We capture directional information via a phase matrix,1 $\Theta ^ { ( q ) }$ ,
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\Theta ^ { ( q ) } ( u , v ) : = 2 \pi q ( \mathbf { A } ( u , v ) - \mathbf { A } ( v , u ) ) , \quad q \geq 0 ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\exp ( i \Theta ^ { ( q ) } )$ is defined component-wise by $\exp ( i \Theta ^ { ( q ) } ) ( u , v ) : = \exp ( i \Theta ^ { ( q ) } ( u , v ) )$ . Letting $\odot$ denote component-wise multiplication, we define the complex Hermitian adjacency matrix $\mathbf { H } ^ { \left( q \right) }$ by
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathbf { H } ^ { \left( q \right) } : = \mathbf { A } _ { s } \odot \exp ( i \Theta ^ { \left( q \right) } ) .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Since $\Theta ^ { ( q ) }$ is skew-symmetric, $\mathbf { H } ^ { \left( q \right) }$ is Hermitian. When $q \ = \ 0$ , we have $\mathbf { \Theta } \Theta ^ { ( 0 ) } = \mathbf { 0 }$ and so $\mathbf { H } ^ { ( 0 ) } = \mathbf { A } _ { s }$ . This effectively corresponds to treating the graph as undirected. For $q \neq 0$ , the phase of $\mathbf { H } ^ { ( q ) } ( u , v )$ encodes edge direction and the value $\mathbf { H } ^ { ( q ) } ( u , v )$ separates four possible cases: no edge, edge from $u$ to $v$ , edge from $v$ to $u$ , and undirected edge. If there is no edge, we will have $\mathbf { H } ^ { \bar { q } } ( u , v ) = 0$ . In the case of a directed edge, the Hermitian adjacency will be complex valued, and changing the direction of an edge will correspond to complex conjugation. For example, in the case where $q = . 2 5$ , if there is an edge from $u$ to $v$ but not from $v$ to $u$ we have
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
{ \bf H } ^ { ( . 2 5 ) } ( u , v ) = \frac { i } { 2 } = - { \bf H } ^ { ( . 2 5 ) } ( v , u ) .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Thus, in this setting, an edge from $u$ to $v$ is treated as the opposite of an edge from $v$ to $u$ . On the other hand, if $( \overline { { u } } , v ) , ( v , u ) \in E$ (which can be interpreted as a single undirected edge), then ${ \bf H } ^ { ( q ) } ( u , v ) = { \bf H } ^ { ( q ) } ( v , u ) = 1$ , and we see the phase, $\Theta ^ { ( q ) } ( u , v ) = 0$ , encodes the lack of direction in the edge. For the rest of this paper, we will assume that $q$ lies in between these two extreme values, i.e., $0 \leq q \leq . 2 5$ . We define the normalized and unnormalized magnetic Laplacians by
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathbf { L } _ { U } ^ { ( q ) } : = \mathbf { D } _ { s } - \mathbf { H } ^ { ( q ) } = \mathbf { D } _ { s } - \mathbf { A } _ { s } \odot \exp ( i \Theta ^ { ( q ) } ) , \quad \mathbf { L } _ { N } ^ { ( q ) } : = \mathbf { I } - \left( \mathbf { D } _ { s } ^ { - 1 / 2 } \mathbf { A } _ { s } \mathbf { D } _ { s } ^ { - 1 / 2 } \right) \odot \exp ( i \Theta ^ { ( q ) } ) .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Note that when $G$ is undirected, $\mathbf { L } _ { U } ^ { \left( q \right) }$ and ${ \bf L } _ { N } ^ { \left( q \right) }$ reduce to the standard undirected Laplacians.
|
| 68 |
+
|
| 69 |
+
$\mathbf { L } _ { U } ^ { \left( q \right) }$ and ${ \bf L } _ { N } ^ { \left( q \right) }$ are Hermitian. Theorem 1 (Section 5 of the supplement) shows they are positivesemidefinite and thus are diagonalized by an orthonormal basis of complex eigenvectors $\mathbf { u } _ { 1 } , \ldots , \mathbf { u } _ { N }$ associated to real, nonnegative eigenvalues $\lambda _ { 1 } , \ldots , \lambda _ { N }$ . Similar to the traditional normalized Laplacian, Theorem 2 (Section 5 of the supplement) shows the eigenvalues of ${ \bf L } _ { N } ^ { q }$ lie in [0, 2], and we may factor $\mathbf { L } _ { N } ^ { \left( q \right) } = \mathbf { U } \mathbf { A } \mathbf { U } ^ { \dag }$ , where $\mathbf { U }$ is the $N \times N$ matrix whose $k$ -th column is $\mathbf { u } _ { k }$ , $\pmb { \Lambda }$ is the diagonal matrix with $\mathbf { \Delta } \Lambda ( k , k ) = \lambda _ { k }$ , and $\mathbf { U } ^ { \dagger }$ is the conjugate transpose of $\mathbf { U }$ (a similar formula holds for $\mathbf { L } _ { U } ^ { \left( q \right) } .$ ). Furthermore, recall $\mathbf { L } = \mathbf { B } \mathbf { B } ^ { \top }$ , where $\mathbf { B }$ is the signed incidence matrix. Similarly, Theorem 3 (Section 5 of the supplement) shows that $\mathbf { L } _ { U } ^ { ( q ) } = \mathbf { B } ^ { ( q ) } ( \mathbf { B } ^ { ( q ) } ) ^ { \dagger }$ , where $\mathbf { B } ^ { \left( q \right) }$ is a modified incidence matrix. The magnetic Laplacian encodes geometric information in its eigenvectors and eigenvalues. In the directed star graph (Section 6 of the supplement), for example, directional information is contained in the eigenvectors only, whereas the eigenvalues are invariant to the direction of the edges. On the other hand, for the directed cycle graph the magnetic Laplacian encodes the directed nature of the graph solely in its spectrum. In general, both the eigenvectors and eigenvalues may contain important information, which we leverage in MagNet.
|
| 70 |
+
|
| 71 |
+
# 3 MagNet
|
| 72 |
+
|
| 73 |
+
Most graph neural network architectures can be described as being either spectral or spatial. Spatial networks such as [43, 21, 1, 14] typically extend convolution to graphs by performing a weighted average of features over neighborhoods $\mathcal { N } ( u ) = \{ v : ( u , v ) \in \bar { E } \}$ . These neighborhoods are well-defined even when $E$ is not symmetric, so spatial methods typically have natural extensions to directed graphs. However, such simplistic extensions may miss important information in the directed graph. For example, filters defined using $\mathcal { N } ( u )$ are not capable of assimilating the equally important information contained in $\{ v : ( v , u ) \in E \}$ . Alternatively, these methods may also use the symmetrized adjacency matrix, but they cannot learn to balance directed and undirected approaches.
|
| 74 |
+
|
| 75 |
+
In this section, we show how to extend spectral methods to directed graphs using the magnetic Laplacian introduced in Section 2. To highlight the flexibility of our approach, we show how three spectral graph neural network architectures can be adapted to incorporate the magnetic Laplacian. Our approach is very general, and so for most of this section, we will perform our analysis for a general complex Hermitian, positive semidefinite matrix. However, we view the magnetic Laplacian as our primary object of interest (and use it in all of our experiments in Section 5) because of the large body of literature studying its spectral properties and applying it to data science (see Section 4).
|
| 76 |
+
|
| 77 |
+
# 3.1 Spectral convolution via the magnetic Laplacian
|
| 78 |
+
|
| 79 |
+
In this section, we let $\pmb { \mathcal { L } }$ denote a Hermitian, positive semidefinite matrix, such as the normalized or unnormalized magnetic Laplacian introduced in Section 2, on a directed graph $G = ( V , E )$ , $| V | = N$ . We let $\mathbf { u } _ { 1 } \ldots , \mathbf { u } _ { N }$ be an orthonormal basis of eigenvectors for $\mathcal { L }$ and let $\mathbf { U }$ be the $N \times N$ matrix whose $k$ -th column is $\mathbf { u } _ { k }$ . We define the directed graph Fourier transform for a signal $\mathbf { x } : V \mathbb { C }$ by $\widehat { \mathbf { x } } = \mathbf { U } ^ { \dagger } \mathbf { x }$ , so that $\widehat { \mathbf { x } } ( k ) = \langle \mathbf { x } , \mathbf { u } _ { k } \rangle$ . We regard the eigenvectors $\mathbf { u } _ { 1 } , \ldots , \mathbf { u } _ { N }$ as the generalizations of b bdiscrete Fourier modes to directed graphs. Since $\mathbf { U }$ is unitary, we have the Fourier inversion formula
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathbf { x } = \mathbf { U } \widehat { \mathbf { x } } = \sum _ { k = 1 } ^ { N } \widehat { \mathbf { x } } ( k ) \mathbf { u } _ { k } .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
In Euclidean space, convolution corresponds to pointwise multiplication in the Fourier basis. Thus, we define the convolution of $\mathbf { x }$ with a filter $\mathbf { y }$ in the Fourier domain by ${ \widehat { \mathbf { y } * \mathbf { x } } } ( k ) = { \widehat { \mathbf { y } } } ( k ) { \widehat { \mathbf { x } } } ( k )$ . By (2), this implies $\mathbf { y } * \mathbf { x } = \mathbf { U D i a g } ( \widehat { \mathbf { y } } ) \widehat { \mathbf { x } } = ( \mathbf { U D i a g } ( \widehat { \mathbf { y } } ) \mathbf { U } ^ { \dagger } ) \mathbf { x }$ , and so we say $\mathbf { Y }$ b bis a convolution matrix if
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathbf { Y } = \mathbf { U } \pmb { \Sigma } \mathbf { U } ^ { \dagger } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
for a diagonal matrix $\pmb { \Sigma }$ . This is the natural generalization of the class of convolutions used in [6].
|
| 92 |
+
|
| 93 |
+
Next, following [13] (see also [22]), we show that a spectral network can be implemented in the spatial domain via polynomials of $\mathcal { L }$ by having $\pmb { \Sigma }$ be a polynomial of $\pmb { \Lambda }$ in (3). This reduces the number of trainable parameters to prevent overfitting, avoids explicit diagonalization of the matrix $\mathcal { L }$ ,
|
| 94 |
+
|
| 95 |
+
(which is expensive for large graphs), and improves stability to perturbations [27]. As in [13], we define a normalized eigenvalue matrix, with entries in $[ - 1 , 1 ]$ , by $\begin{array} { r } { \widetilde { \pmb { \Lambda } } = \frac { 2 } { \lambda _ { \mathrm { m a x } } } \pmb { \Lambda } - \mathbf { I } } \end{array}$ and assume
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\Sigma = \sum _ { k = 0 } ^ { K } \theta _ { k } T _ { k } ( \widetilde { \Lambda } ) ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
for some real-valued $\theta _ { 1 } , \ldots , \theta _ { k }$ , where $T _ { k }$ is the Chebyshev polynomial defined by $T _ { 0 } ( x ) \ =$ $1 , T _ { 1 } ( x ) = x$ , and $T _ { k } ( x ) = 2 x T _ { k - 1 } ( x ) + T _ { k - 2 } ( x )$ for $k \geq 2$ . With $( { \bf U } \widetilde { \pmb { \Lambda } } { \bf U } ^ { \dagger } ) ^ { k } = { \bf U } \widetilde { \pmb { \Lambda } } ^ { k } { \bf U } ^ { \dagger }$ , one has
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathbf { Y } \mathbf { x } = \mathbf { U } \sum _ { k = 0 } ^ { K } \theta _ { k } T _ { k } ( \widetilde { \mathbf { A } } ) \mathbf { U } ^ { \dagger } \mathbf { x } = \sum _ { k = 0 } ^ { K } \theta _ { k } T _ { k } ( \widetilde { \pmb { \mathscr { L } } } ) \mathbf { x } ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where, analogous to $\widetilde { \Lambda }$ , we define $\begin{array} { r } { \widetilde { \pmb { \mathscr { L } } } : = \frac { 2 } { \lambda _ { \operatorname* { m a x } } } \pmb { \mathscr { L } } - \mathbf { I } } \end{array}$ . It is important to note that, due to the complex Hermitian structure of $\tilde { \pmb { { c } } }$ , the value $\mathbf { Y } \mathbf { x } ( u )$ aggregates information both from the values of $\mathbf { x }$ on $\mathcal { N } _ { k } ( u )$ , the $k$ -hop neighborhood of $u$ , and the values of $\mathbf { x }$ on $\{ v : \mathrm { d i s t } ( v , u ) \leq k \}$ , which consists of those of vertices that can reach $u$ in $k$ -hops. While in an undirected graph these two sets of vertices are the same, that is not the case for general directed graphs. Furthermore, due to the difference in phase between an edge $( u , v )$ and an edge $( v , u )$ , the filter matrix $\mathbf { Y }$ is also capable of aggregating information from these two sets in different ways. This capability is in contrast to any single, symmetric, real-valued matrix, as well as any matrix that encodes just $\mathcal { N } ( u )$ .
|
| 108 |
+
|
| 109 |
+
To obtain a netapproximation ar to [24, and set $K = 1$ , assume that this, we obt $\pmb { \mathcal { L } } = \mathbf { L } _ { N } ^ { \left( q \right) }$ , using $\lambda _ { \operatorname* { m a x } } \le 2$ make the $\lambda _ { \operatorname* { m a x } } \approx 2$ $\theta _ { 1 } = - \theta _ { 0 }$
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathbf { Y } \mathbf { x } = \theta _ { 0 } ( \mathbf { I } + ( \mathbf { D } _ { s } ^ { - 1 / 2 } \mathbf { A } _ { s } \mathbf { D } _ { s } ^ { - 1 / 2 } ) \odot \exp ( i \Theta ^ { ( q ) } ) ) \mathbf { x } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
As in [24], we substitute $: \mathbf { I } + ( \mathbf { D } _ { s } ^ { - 1 / 2 } \mathbf { A } _ { s } \mathbf { D } _ { s } ^ { - 1 / 2 } ) \odot \exp ( i \Theta ^ { ( q ) } ) \to \widetilde { \mathbf { D } } _ { s } ^ { - 1 / 2 } \widetilde { \mathbf { A } } _ { s } \widetilde { \mathbf { D } } _ { s } ^ { - 1 / 2 } \odot \exp ( i \Theta ^ { ( q ) } )$ This renormalization helps avoid instabilities arising from vanishing/exploding gradients and yields
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathbf { Y } \mathbf { x } = \theta _ { 0 } \widetilde { \mathbf { D } } _ { s } ^ { - 1 / 2 } \widetilde { \mathbf { A } } _ { s } \widetilde { \mathbf { D } } _ { s } ^ { - 1 / 2 } \odot \exp ( i \Theta ^ { ( q ) } ) ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\widetilde { \mathbf { A } } _ { s } = \mathbf { A } _ { s } + \mathbf { I }$ and $\begin{array} { r } { \widetilde { \bf D } _ { s } ( i , i ) = \sum _ { j } \widetilde { \bf A } _ { s } ( i , j ) } \end{array}$
|
| 122 |
+
|
| 123 |
+
In theory, the matrix $\exp ( i \Theta ^ { ( q ) } )$ is dense. However, in practice, one only needs to compute a small fraction of its entries. In most real-world datasets, the symmetrized adjacency matrix will be sparse. Since the Hermitian adjacency matrix is constructed via pointwise multiplication between the symmetrized adjacency matrix and the phase matrix, it is only necessary to compute the phase matrix for entries $( u , v )$ where ${ \bf A } _ { s } ( u , v ) \neq 0$ . Thus, the efficiency of the proposed algorithm is comparable to standard GCN algorithms, and can leverage any existing developments such as [18] that increase efficiency of standard GCNs (although the computational complexity our method does differ by a factor of four because of the computational complexity of complex-valued multiplication).
|
| 124 |
+
|
| 125 |
+
# 3.2 The MagNet architecture
|
| 126 |
+
|
| 127 |
+
Let $L$ be the number of convolution layers in our network, and let $\mathbf { X } ^ { ( 0 ) }$ be an $N \times F _ { 0 }$ input feature matrix with columns x(0)1 , . . . x(0)F0 . Since our filters are complex, we use a complex version of ReLU defined by $\sigma ( z ) = z$ , if $- \pi / 2 \le \arg ( z ) < \pi / 2$ , and $\sigma ( z ) = 0$ otherwise (where $\mathrm { a r g } ( z )$ is the complex argument of $z \in \mathbb { C } ,$ ). Let $F _ { \ell }$ be the number of channels in layer $\ell$ , and for $1 \le { \dot { \ell } } \le L$ , $1 \leq i \leq F _ { \ell - 1 }$ , and $1 \leq j \leq F _ { \ell }$ , we let $\mathbf { Y } _ { i j } ^ { ( \ell ) }$ be a convolution matrix defined in the sense of either (3), (4), or (5). Define the $\ell ^ { \mathrm { { t h } } }$ layer feature matrix $\mathbf { X } ^ { ( \ell ) }$ with columns $\mathbf { x } _ { 1 } ^ { ( \ell ) } , \ldots . . \mathbf { x } _ { F _ { \ell } } ^ { ( \ell ) }$ as:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\mathbf { x } _ { j } ^ { ( \ell ) } = \sigma \left( \sum _ { i = 1 } ^ { F _ { \ell - 1 } } \mathbf { Y } _ { i j } ^ { ( \ell ) } \mathbf { x } _ { i } ^ { ( \ell - 1 ) } + \mathbf { b } _ { j } ^ { ( \ell ) } \right) ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
with $\mathbf { b } _ { j } ^ { ( \ell ) } ( v ) = b _ { j } ^ { ( \ell ) }$ and $\mathrm { r e a l } ( b _ { j } ^ { ( \ell ) } ) = \mathrm { i m a g } ( b _ { j } ^ { ( \ell ) } )$ . In matrix form we write $\mathbf { X } ^ { \left( \ell \right) } = \mathbf { Z } ^ { \left( \ell \right) } \left( \mathbf { X } ^ { \left( \ell - 1 \right) } \right)$ , where $\mathbf { Z } ^ { ( \ell ) }$ is a hidden layer of the form (6). In the numerical experiments reported in Section 5, we utilize formulation (4) with $\pmb { \mathcal { L } } = \mathbf { L } _ { N } ^ { \left( q \right) }$ . In most cases we set $K = 1$ , for which
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\mathbf { X } ^ { ( \ell ) } = \sigma \left( \mathbf { X } ^ { ( \ell - 1 ) } \mathbf { W } _ { \mathrm { s e l f } } ^ { ( \ell ) } + \widetilde { \mathbf { L } } _ { N } ^ { ( q ) } \mathbf { X } ^ { ( \ell - 1 ) } \mathbf { W } _ { \mathrm { n e i g h } } ^ { ( \ell ) } + \mathbf { B } ^ { ( \ell ) } \right) ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 1: MagNet $L = 2 ,$ ) applied to node classification.
|
| 141 |
+
|
| 142 |
+
where W(\`)self and W(\`)neigh are learned weight matrices corresponding to the filter weights in (4), and $\mathbf { B } ^ { ( \ell ) } ( v , \cdot ) = ( b _ { 1 } ^ { ( \ell ) } , \cdot \cdot \cdot , \bar { b } _ { F _ { \ell } } ^ { ( \ell ) } )$ for each $v \in V$ .
|
| 143 |
+
|
| 144 |
+
After the convolutional layers, we unwind the complex $N \times F _ { L }$ matrix $\mathbf { X } ^ { ( L ) }$ into a real-valued $N \times 2 F _ { L }$ matrix, apply a linear layer, consisting of right-multiplication by a $2 F _ { L } \times n _ { c }$ weight matrix $\mathbf { W } ^ { ( L + 1 ) }$ (where $n _ { c }$ is the number of classes) and apply softmax. In our experiments, we set $L = 2$ or 3. When $L = 2$ , our network applied to node classification, as illustrated in Figure 1, is given by
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathrm { s o f t m a x } ( \mathrm { u n w i n d } ( \mathbf { Z } ^ { ( 2 ) } ( \mathbf { Z } ^ { ( 1 ) } ( \mathbf { X } ^ { ( 0 ) } ) ) ) \mathbf { W } ^ { ( 3 ) } ) .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
For link-prediction, we apply the same method through the unwind layer, and then concatenate the rows corresponding to pairs of nodes to obtain the edge features.
|
| 151 |
+
|
| 152 |
+
# 4 Related work
|
| 153 |
+
|
| 154 |
+
In Section 4.1, we describe other graph neural networks designed specifically for directed graphs. Notably, none of these methods encode directionality with complex numbers, instead opting for realvalued, symmetric matrices. In Section 4.2, we review other work studying the magnetic Laplacian which has been studied for several decades and lately has garnered interest in the network science and graph signal processing communities. However, to the best of our knowledge, this is the first work to use it to construct a graph neural network. We also note there are numerous approaches to graph signal processing on directed graphs. Many of these rely on a natural analog of Fourier modes. These Fourier modes are typically defined through either a factorization of a graph shift operator or by solving an optimization problem. For further review, we refer the reader to [30].
|
| 155 |
+
|
| 156 |
+
# 4.1 Neural networks for directed graphs
|
| 157 |
+
|
| 158 |
+
In [29], the authors construct a directed Laplacian, via identities involving the random walk matrix and its stationary distribution $\mathbf { I I }$ . When $G$ is undirected, one can use the fact that $\mathbf { I I }$ is proportional to the degree vector to verify this directed Laplacian reduces to the standard normalized graph Laplacian. However, this method requires $G$ to be strongly connected, unlike MagNet. The authors of [42] use a first-order proximity matrix $\mathbf { A } _ { F }$ (equivalent to ${ \bf A } _ { s }$ here), as well as two second-order proximity matrices $\mathbf { A } _ { S _ { \mathrm { i n } } }$ and $\mathbf { A } _ { S _ { \mathrm { o u t } } }$ . $\mathbf { A } _ { S _ { \mathrm { i n } } }$ is defined by $\mathbf { A } _ { S _ { \mathrm { i n } } } ( u , v ) \neq 0$ if there exists a $w$ such that $( w , u ) , ( \dot { w } , v ) \in E$ , and $\mathbf { A } _ { S _ { \mathrm { o u t } } }$ is defined analogously. These three matrices collectively describe and distinguish the neighborhood of each vertex and those vertices that can reach a vertex in a single hop. The authors construct three different Laplacians and use a fusion operator to share information across channels. Similarly, inspired by [3], in [33], the authors consider several different symmetric Laplacian matrices corresponding to a number of different graph motifs.
|
| 159 |
+
|
| 160 |
+
The method of [41] builds upon the ideas of both [29] and [42] and considers a directed Laplacian similar to the one used in [29], but with a PageRank matrix in place of the random-walk matrix. This allows for applications to graphs which are not strongly connected. Similar to [42], they use higher-order receptive fields (analogous to the second-order adjacency matrices discussed above) and an inception module to share information between receptive fields of different orders. We also note [25], which uses an approach based on PageRank in the spatial domain. There are also some related methods for directed graphs that are not based on the graph Laplacian, such as the directed graph embedding [39], and directed message passing for molecular graphs [26].
|
| 161 |
+
|
| 162 |
+
# 4.2 Related work on the magnetic Laplacian and Hermitian adjacency matrices
|
| 163 |
+
|
| 164 |
+
The magnetic Laplacian has been studied since at least [28]. The name originates from its interpretation as a quantum mechanical Hamiltonian of a particle under magnetic flux. Early works focused on $d$ -regular graphs, where the eigenvectors of the magnetic Laplacian are equivalent to those of the Hermitian adjacency matrix. The authors of [20], for example, show that using a complex-valued Hermitian adjacency matrix rather than the symmetrized adjacency matrix reduces the number of small, non-isomorphic cospectral graphs. Topics of current research into Hermitian adjacency matrices include clustering tasks [12] and the role of the parameter $q$ [32].
|
| 165 |
+
|
| 166 |
+
The magnetic Laplacian is also the subject of ongoing research in graph signal processing [19], community detection [17], and clustering [10, 16, 15]. For example, [16] uses the phase of the eigenvectors to construct eigenmap embeddings analogous to [2]. The role of $q$ is highlighted in the works of [16, 17, 20, 32], which show how particular choices of $q$ may highlight various graph motifs. In our context, this indicates that $q$ should be carefully tuned via cross-validation. Lastly, we note that numerous other directed graph Laplacians have been studied and applied to data science [7, 8, 35]. However, as alluded to in Section 2, these methods typically do not use complex Hermitian matrices.
|
| 167 |
+
|
| 168 |
+
# 5 Numerical experiments
|
| 169 |
+
|
| 170 |
+
# 5.1 Datasets
|
| 171 |
+
|
| 172 |
+
# 5.1.1 Directed Stochastic Block Model
|
| 173 |
+
|
| 174 |
+
We construct a directed stochastic block (DSBM) model as follows. First we divide $N$ vertices into $n _ { c }$ equally-sized clusters $C _ { 1 } , \ldots , C _ { n _ { c } }$ . We define $\{ \alpha _ { i , j } \} _ { 1 \leq i , j \leq n _ { c } }$ to be a collection of probabilities, $0 < \alpha _ { i , j } \leq 1$ with $\alpha _ { i , j } = \alpha _ { j , i }$ , and for an unordered pair $u \ne v$ create an undirected edge between $u$ and $v$ with probability $\alpha _ { i , j }$ if $u \in C _ { i } , v \in C _ { j }$ . To turn this undirected graph into a directed graph, we define $\{ \beta _ { i , j } \} _ { 1 \leq i , j \leq n _ { c } }$ to be a collection of probabilities such that $0 \leq \beta _ { i , j } \leq 1$ and $\bar { \beta } _ { i , j } + \beta _ { j , i } = 1$ . For each undirected edge $\{ u , v \}$ , we assign that edge a direction by the rule that the edge points from $u$ to $v$ with probability $\beta _ { i , j }$ if $u \in C _ { i }$ and $v \in C _ { j }$ , and points from $v$ to $u$ otherwise. If $\alpha _ { i , j }$ is constant, then the only way to determine the clusters will be from the directional information.
|
| 175 |
+
|
| 176 |
+
In Figure 3, we plot the performance of MagNet and other methods on variations of the DSBM. In each of these, we set $n _ { c } = 5$ and the goal is to classify the vertices by cluster. We set $N = 2 5 0 0$ , except in Figure 3d where $N = 5 0 0$ . In Figure 3a, we plot the performance of our model on the DSBM with $\alpha _ { i , j } : = \alpha ^ { * } = . 1 , . 0 8$ , and .05 for $i \neq j$ , which varies the density of inter-cluster edges, and set $\alpha _ { i , i } = . 1$ . Here we set $\beta _ { i , i } = . 5$ and $\beta _ { i , j } = . 0 5$ for $i > j$ . This corresponds to the ordered meta-graph in Figure 2a. Figure 3b also uses the ordered meta-graph, but here we fix $\alpha _ { i , j } = . 1$ for all $i , j$ , and set $\beta _ { i , j } = \beta ^ { * }$ , for $i > j$ , and allow $\beta ^ { * }$ to vary from .05 to .4, which varies the net flow (related to flow imbalance in [23]) from one cluster to another. The results in Figure 3c utilize a cyclic meta-graph structure as in Figure 2b (without the gray noise edges). Specifically, we set $\alpha _ { i , j } = . 1$ if $i = j$ or $i = j \pm 1$ mod 5 and $\alpha _ { i , j } = 0$ otherwise. We define $\beta _ { i , j } = \beta ^ { * }$ , $\beta _ { j , i } = 1 - \beta ^ { * }$ when $j = ( i - 1 )$ mod 5, and $\beta _ { i , j } = 0$ otherwise. In Figure 3d we add noise to the cyclic structure of our meta-graph by setting $\alpha _ { i , j } = . 1$ for all $i , j$ and $\beta _ { i , j } = . 5$ for all $( i , j )$ connected by a gray edge in Figure 2b (keeping $\beta _ { i , j }$ the same as in Figure 3c for the blue edges).
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 2: Meta-graphs for the synthetic data sets.
|
| 180 |
+
|
| 181 |
+
# 5.1.2 Real datasets
|
| 182 |
+
|
| 183 |
+
Texas, Wisconsin, and Cornell are WebKB datasets modeling links between websites at different universities [36]. We use these datasets for both link prediction and node classification with nodes labeled as student, project, course, staff, and faculty in the latter case. Telegram [5] is a pairwise influence network between 245 Telegram channels with 8, 912 links. To the best of our knowledge, this dataset has not previously been studied in the graph neural network literature. Labels are generated from the method discussed in [5], with a total of four classes. The datasets Chameleon and Squirrel [37] represent links between Wikipedia pages related to chameleons and squirrels. We use these datasets for link prediction. Likewise, WikiCS [31] is a collection of Computer Science articles, which we also use for link prediction (see the tables in Section 7 of the supplement). Cora-ML and CiteSeer are popular citation networks with node labels corresponding to scientific subareas. We use the versions of these datasets provided in [4]. Further details are given in the supplementary material.
|
| 184 |
+
|
| 185 |
+
# 5.2 Training and implementation details
|
| 186 |
+
|
| 187 |
+
Node classification is performed in a semi-supervised setting (i.e., access to the test data, but not the test labels, during training). For the datasets Cornell, Texas, Wisconsin, and Telegram we use a $6 0 \% / 2 0 \% / 2 0 \%$ training/validation/test split, which might be viewed as more akin to supervised learning, because of the small graph size. For Cora-ML and CiteSeer, we use the same split as [41]. For all of these datasets we use 10 random data splits. For the DSBM datasets, we generated 5 graphs randomly for each type and for each set of parameters, each with 10 different random node splits. We use $\dot { 2 0 } \%$ of the nodes for validation and we vary the proportion of training samples based on the classification difficulty, using $2 \%$ , $10 \%$ , and $60 \%$ of nodes per class for the ordered, cyclic, and noisy cyclic DSBM graphs, respectively, during training, and the rest for testing. Hyperpameters were selected using one of the five generated graphs, and then applied to the other four generated graphs.
|
| 188 |
+
|
| 189 |
+
In the main text, there are two types of link prediction tasks conducted for performance evaluation. The first type is to predict the edge direction of pairs of vertices $u , v$ for which either $( u , v ) \in E$ or $( v , u ) \in \dot { E }$ . The second type is existence prediction. The model is asked to predict if $( u , v ) \in E$ by considering ordered pairs of vertices $( u , v )$ . For both types of link prediction, we removed $15 \%$ of edges for testing, $5 \%$ for validation, and use the rest of the edges for training. The connectivity was maintained during splitting. 10 splits were generated randomly for each graph and the input features are in-degree and out-degree of nodes. In the supplement, we report on two additional link prediction tasks based on a three-class classification setup: $( u , v ) \in E$ , $( \bar { v } , u ) \in E$ , or $( u , v ) , ( v , u ) \ { \stackrel { } { \not \in } } \ E$ . Full details are provided in the supplementary material.
|
| 190 |
+
|
| 191 |
+
In all experiments, we used the normalized magnetic Laplacian and implement MagNet with convolution defined as in (4), meaning that our network may be viewed as the magnetic Laplacian generalization of ChebNet. The setting of the hyperparameter $q$ and other network hyperparameters is obtained by cross-validation. Since currently complex tensors are still in beta in PyTorch, we did not use them, and instead we stored any complex tensor as two real tensors (one for the real part, one for the imaginary part), and carried out complex multiplication using the standard formula: $( a + i b ) ( c + i d ) = ( a c - \bar { b } d ) + i ( b c + a d )$ (note, $a , b , c , d$ can be real numbers or real matrices). We compare with multiple baselines in three categories: (i) spectral methods: ChebNet [13], GCN [24]; (ii) spatial methods: APPNP [25], SAGE [21], GIN [45], GAT [43]; and (iii) methods designed for directed graphs: DGCN [42], and two variants of [41], a basic version (DiGraph) and a version with higher order inception blocks (DiGraphIB). All baselines in the experiments have two graph convolutional layers, except for the node classification on the DSBM using the cyclic meta-graphs (Figures 3c, 3d, and 2b) for which we also tested three layers during the hyperparameter search. For ChebNet, we use the symmetrized adjacency matrix. For the spatial networks we apply both the symmetrized and asymmmetric adjacency matrix for node classification. The results reported are the better of the two results. The supplement provides full details, as well as results for two other types of baselines: (i) BiGCN, BiSAGE, BiGAT which are obtained by applying GCN, SAGE, GAT on both the original adjacency matrix and the transposed adjacency matrix; and (ii) a $k$ -nearest neighbors classifier based on the eigenvector with the smallest eigenvalue of the magnetic Laplacian [17].
|
| 192 |
+
|
| 193 |
+
# 5.3 Results
|
| 194 |
+
|
| 195 |
+
We see that MagNet performs well across all tasks. As indicated in Table 1, our cross-validation procedure selects $q = 0$ for node classification on the citation networks Cora-ML and CiteSeer. This means we achieved the best performance when regarding directional information as noise, suggesting symmetrization-based methods are appropriate in the context of node classification on citation networks. This matches our intuition. For example, in Cora-ML, the task is to classify research papers by scientific subarea. If the topic of a given paper is “machine learning,” then it is likely to both cite and be cited by other machine learning papers. For all other datasets, we find the optimal value of $q$ is nonzero, indicating that directional information is important. Our network exhibits the best performance on three out of six of these datasets and is a close second on Texas and Telegram. We also achieve an at least four percentage point improvement over both ChebNet and GCN on the four data sets for which $q > 0$ . These networks are similar to ours but with the classical graph Laplacian. This isolates the effects of the magnetic Laplacian and shows that it is a valuable tool for encoding directional information. MagNet also compares favorably to non-spectral methods on the WebKB networks (Cornell, Texas, Wisconsin). Indeed, MagNet obtains $a \sim 4 \%$ improvement on Cornell and a $\sim 2 . 5 \%$ improvement on Wisconsin, while on Texas it has the second best accuracy, close behind SAGE. We also see the other directed methods have relatively poor performance on the WebKB networks, perhaps since these graphs are fairly small and have very few training samples. To make this analysis more quantitative, we computed the absolute difference of the classification accuracy of each method from the classification accuracy of the top performing method (in percentage points) on each data set, and averaged over the six data sets. In this context, lower scores are better, and a method with a score of zero indicates the method is the top performing method on each data set. As reported in Table 1, MagNet achieved a best score of 1.1 percent.
|
| 196 |
+
|
| 197 |
+
Table 1: Node classification accuracy $( \% )$ . The best results are in bold and the second are underlined.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Type</td><td>Method</td><td>Cornell</td><td>Texas</td><td>Wisconsin Cora-ML</td><td>CiteSeer</td><td>Telegram</td><td>Score</td></tr><tr><td rowspan="2">Spectral</td><td>ChebNet</td><td>79.8±5.0</td><td>79.2±7.5</td><td>81.6±6.3</td><td>80.0±1.8 66.7±1.6</td><td>70.2 ±6.8</td><td>6.94</td></tr><tr><td>GCN</td><td>59.0±6.4</td><td>58.7±3.8</td><td>55.9±5.4</td><td>82.0±1.1 66.0±1.5</td><td>73.4 ±5.8</td><td>19.16</td></tr><tr><td rowspan="4">Spatial</td><td>APPNP</td><td>58.7±4.0</td><td>57.0±4.8</td><td>51.8±7.4</td><td>82.6±1.4 66.9±1.8</td><td>67.3±3.0</td><td>18.75</td></tr><tr><td>SAGE</td><td>80.0±6.1</td><td>84.3±5.5</td><td>83.1±4.8</td><td>82.3±1.2 66.0±1.5</td><td>66.4±6.4</td><td>5.76</td></tr><tr><td>GIN</td><td>57.9±5.7</td><td>65.2±6.5</td><td>58.2±5.1</td><td>78.1±2.0 63.3±2.5</td><td>86.4±4.3</td><td>16.53</td></tr><tr><td>GAT</td><td>57.6±4.9</td><td>61.1±5.0</td><td>54.1±4.2</td><td>81.9±1.0 67.3±1.3</td><td>72.6±7.5</td><td>16.39</td></tr><tr><td rowspan="3">Directed</td><td>DGCN</td><td>67.3±4.3</td><td>71.7±7.4</td><td>65.5±4.7</td><td>81.3±1.4 66.3±2.0</td><td>90.4±5.6</td><td>8.55</td></tr><tr><td>Digraph</td><td>66.8±6.2</td><td>64.9±8.1</td><td>59.6±3.8</td><td>79.4±1.8 62.6±2.2</td><td>82.0±3.1</td><td>15.70</td></tr><tr><td>DiGraphIB</td><td>64.4±9.0</td><td>64.9±13.7</td><td>64.1±7.0</td><td>79.3±1.2 61.1±1.7</td><td>64.1±7.0</td><td>16.36</td></tr><tr><td rowspan="2">This paper</td><td>MagNet</td><td>84.3±7.0</td><td>83.3±6.1</td><td>85.7±3.2</td><td>79.8±2.5 67.5±1.8</td><td>87.6±2.9</td><td>1.10</td></tr><tr><td>Best q</td><td>0.25</td><td>0.15</td><td>0.05</td><td>0.0 0.0</td><td>0.15</td><td>1</td></tr></table>
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 3: Node classification accuracy. Error bars are one standard error. MagNet is bold red.
|
| 203 |
+
|
| 204 |
+
On the DSBM datasets, as illustrated in Figure 3 (see also the tables in Section 7 of the supplement), we see that MagNet generally performs quite well and is the best performing network in the vast majority of cases (for full details, see Section 7 of the supplement). The networks DGCN and DiGraphIB rely on second order proximity matrices. As demonstrated in Figure 3c, these methods are well suited for networks with a cyclic meta-graph structure since nodes in the same cluster are likely to have common neighbors. MagNet, on the other hand, does not use second-order proximity, but can still learn the clusters by stacking multiple layers together. This improves MagNet’s ability to adapt to directed graphs with different underlying topologies. This is illustrated in Figure 3d where the network has an approximately cyclic meta-graph structure. In this setting, MagNet continues to perform well, but the performance of DGCN and DiGraphIB deteriorate significantly. Interestingly, MagNet performs well on the DSBM cyclic meta-graph (Figure 3c) with $q \approx . 1$ , whereas $q \geq . 2$ is
|
| 205 |
+
|
| 206 |
+
Table 2: Link prediction accuracy $( \% )$ . The best results are in bold and the second are underlined.
|
| 207 |
+
|
| 208 |
+
<table><tr><td rowspan="2"></td><td colspan="4">Direction prediction</td><td colspan="4">Existence prediction</td></tr><tr><td>Cornell</td><td>Wisconsin</td><td>Cora-ML</td><td>CiteSeer</td><td>Cornell</td><td>Wisconsin</td><td>Cora-ML</td><td>CiteSeer</td></tr><tr><td>ChebNet</td><td>71.0±5.5</td><td>67.5±4.5</td><td>72.7±1.5</td><td>68.0±1.6</td><td>80.1±2.3</td><td>82.5±1.9</td><td>80.0±0.6</td><td>77.4±0.4</td></tr><tr><td>GCN</td><td>56.2±8.7</td><td>71.0±4.0</td><td>79.8±1.1</td><td>68.9±2.8</td><td>75.1±1.4</td><td>75.1±1.9</td><td>81.6±0.5</td><td>76.9±0.5</td></tr><tr><td>APPNP</td><td>69.5±9.0</td><td>75.1±3.5</td><td>83.7±0.7</td><td>77.9±1.6</td><td>74.9±1.5</td><td>75.7±2.2</td><td></td><td>82.5±0.6 78.6±0.7</td></tr><tr><td>SAGE</td><td>75.2±11.0</td><td>72.0±3.5</td><td>68.2±0.8</td><td>68.7±1.5</td><td>79.8±2.4</td><td>77.3±2.9</td><td>75.0±0.0</td><td>74.1±1.0</td></tr><tr><td>GIN</td><td>69.3±6.0</td><td>74.8±3.7</td><td>83.2±0.9</td><td>76.3±1.4</td><td>74.5±2.1</td><td>76.2±1.9</td><td>82.5±0.7</td><td>77.9±0.7</td></tr><tr><td>GAT</td><td>67.9±11.1</td><td>53.2±2.6</td><td>50.0±0.1</td><td>50.6±0.5</td><td>77.9±3.2</td><td>74.6±0.0</td><td></td><td>75.0±0.0 75.0±0.0</td></tr><tr><td>DGCN</td><td>80.7±6.3</td><td>74.5±7.2</td><td>79.6±1.5</td><td>78.5±2.3</td><td>80.0±3.9</td><td>82.8±2.0</td><td>82.1±0.5</td><td>81.2±0.4</td></tr><tr><td>DiGraph</td><td>79.3±1.9</td><td>82.3±4.9</td><td>80.8±1.1</td><td>81.0±1.1</td><td>80.6±2.5</td><td>82.8±2.6</td><td>81.8±0.5</td><td>82.2±0.6</td></tr><tr><td>DiGraphIB</td><td>79.8±4.8</td><td>82.0±4.9</td><td>83.4±1.1</td><td>82.5±1.3</td><td>80.5±3.6</td><td>82.4±2.2</td><td>82.2±0.5</td><td>81.0±0.5</td></tr><tr><td>MagNet</td><td>82.9±3.5</td><td>83.3±3.0</td><td>86.5±0.7</td><td>84.8±1.2</td><td>81.1±3.3</td><td>82.8±2.2</td><td>82.7±0.7</td><td>79.9±0.6</td></tr><tr><td>Best q</td><td>0.20</td><td>0.10</td><td>0.20</td><td>0.15</td><td>0.25</td><td>0.05</td><td>0.05</td><td>0.05</td></tr></table>
|
| 209 |
+
|
| 210 |
+
preferred for the other three DSBM tests; we leave a more in-depth investigation for future work.
|
| 211 |
+
Further details are available in Section 8 of the supplement.
|
| 212 |
+
|
| 213 |
+
For link prediction, we achieve the best performance on seven out of eight tests as shown in Table 2. We also note that Table 2 reports optimal non-zero $q$ values for each task. This indicates that incorporating directional information is important for link prediction, even on citation networks such as Cora and CiteSeer. This matches our intuition, since there is a clear difference between a paper with many citations and one with many references. More results on different datasets, and closely related tasks (including three-class classification), are provided in Section 7 in the supplement.
|
| 214 |
+
|
| 215 |
+
# 6 Conclusion
|
| 216 |
+
|
| 217 |
+
We have introduced MagNet, a neural network for directed graphs based on the magnetic Laplacian. This network can be viewed as the natural extension of spectral graph convolutional networks to the directed graph setting. We demonstrate the effectiveness of our network, and the importance of incorporating directional information via a complex Hermitian matrix, for link prediction and node classification on both real and synthetic datasets. Interesting avenues of future research would be using multiple $q$ ’s along different channels, exploring the role of different normalizations of the magnetic Laplacian, and incorporating the magnetic Laplacian into other network architectures.
|
| 218 |
+
|
| 219 |
+
Limitations and Ethical Considerations: Our method has natural extensions to weighted, directed graphs when all edges are directed. However, it not clear what is the best way to extend it to weighted mixed graphs (with both directed and undirected edges). Our network does not incorporate an attention mechanism and, similar to many other networks, is not scalable to large graphs in its current form (although this may be addressed in future work). All of our data is publicly available for research purposes and does not contain personally identifiable information or offensive content. The method presented here has no greater or lesser impact on society than other graph neural network algorithms.
|
| 220 |
+
|
| 221 |
+
# Acknowledgments
|
| 222 |
+
|
| 223 |
+
We would like to thank Jie Zhang who pointed out that our definition of the magnetic Laplacian differed by an entry-wise complex conjugation from the most commonly used definition in the literature. Y.H. thanks her supervisors Mihai Cucuringu and Gesine Reinert for their guidance.
|
| 224 |
+
|
| 225 |
+
This work was supported by the National Institutes of Health [grant NIGMS-R01GM135929 to M.H. and supporting X.Z, N.B.]; the University of Oxford [the Clarendon scholarship to Y.H.]; the National Science Foundation [grant DMS-1845856 to M.H.]; and the Department of Energy [grant DE-SC0021152 to M.H.].
|
| 226 |
+
|
| 227 |
+
References
|
| 228 |
+
[1] James Atwood and Don Towsley. Diffusion-convolutional neural networks. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29, pages 1993–2001. Curran Associates, Inc., 2016.
|
| 229 |
+
[2] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003.
|
| 230 |
+
[3] Austin R Benson, David F Gleich, and Jure Leskovec. Higher-order organization of complex networks. Science, 353(6295):163–166, 2016.
|
| 231 |
+
[4] Aleksandar Bojchevski and Stephan Günnemann. Deep Gaussian embedding of graphs: Unsupervised inductive learning via ranking. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2017.
|
| 232 |
+
[5] Alexandre Bovet and Peter Grindrod. The activity of the far right on telegram. https://www.researchgate.net/publication/346968575_The_Activity_ of_the_Far_Right_on_Telegram_v21, 2020.
|
| 233 |
+
[6] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and deep locally connected networks on graphs. In International Conference on Learning Representations (ICLR), 2014.
|
| 234 |
+
[7] Fan Chung. Laplacians and the Cheeger inequality for directed graphs. Annals of Combinatorics, 9(1):1–19, 2005.
|
| 235 |
+
[8] Fan Chung and Mark Kempton. A local clustering algorithm for connection graphs. In International Workshop on Algorithms and Models for the Web-Graph, pages 26–43. Springer, 2013.
|
| 236 |
+
[9] Fan RK Chung and Fan Chung Graham. Spectral graph theory. Number 92. American Mathematical Soc., 1997.
|
| 237 |
+
[10] Alexander Cloninger. A note on markov normalized magnetic eigenmaps. Applied and Computational Harmonic Analysis, 43(2):370 – 380, 2017.
|
| 238 |
+
[11] Ronald R Coifman and Stéphane Lafon. Diffusion maps. Applied and computational harmonic analysis, 21(1):5–30, 2006.
|
| 239 |
+
[12] Mihai Cucuringu, Huan Li, He Sun, and Luca Zanetti. Hermitian matrices for clustering directed graphs: insights and applications. In International Conference on Artificial Intelligence and Statistics, pages 983–992. PMLR, 2020.
|
| 240 |
+
[13] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems 29, pages 3844–3852, 2016.
|
| 241 |
+
[14] David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 28, pages 2224–2232. Curran Associates, Inc., 2015.
|
| 242 |
+
[15] Bruno Messias F. de Resende and Luciano da F. Costa. Characterization and comparison of large directed networks through the spectra of the magnetic laplacian. Chaos: An Interdisciplinary Journal of Nonlinear Science, 30(7):073141, 2020.
|
| 243 |
+
[16] Michaël Fanuel, Carlos M. Alaíz, Ángela Fernández, and Johan A.K. Suykens. Magnetic eigenmaps for the visualization of directed networks. Applied and Computational Harmonic Analysis, 44:189–199, 2018.
|
| 244 |
+
[17] Michaël Fanuel, Carlos M Alaiz, and Johan AK Suykens. Magnetic eigenmaps for community detection in directed networks. Physical Review E, 95(2):022302, 2017.
|
| 245 |
+
[18] Matthias Fey, Jan E Lenssen, Frank Weichert, and Jure Leskovec. GNNAutoScale: Scalable and expressive graph neural networks via historical embeddings. In International Conference on Machine Learning (ICML), 2021.
|
| 246 |
+
[19] Satoshi Furutani, Toshiki Shibahara, Mitsuaki Akiyama, Kunio Hato, and Masaki Aida. Graph signal processing for directed graphs based on the hermitian laplacian. In Machine Learning and Knowledge Discovery in Databases, pages 447–463, 2020.
|
| 247 |
+
[20] Krystal Guo and Bojan Mohar. Hermitian adjacency matrix of digraphs and mixed graphs. Journal of Graph Theory, 85(1):217–248, 2017.
|
| 248 |
+
[21] William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 1025–1035, Red Hook, NY, USA, 2017. Curran Associates Inc.
|
| 249 |
+
[22] David K Hammond, Pierre Vandergheynst, and Rémi Gribonval. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129–150, 2011.
|
| 250 |
+
[23] Yixuan He, Gesine Reinert, and Mihai Cucuringu. Digrac: Digraph clustering with flow imbalance. arXiv preprint arXiv:2106.05194, 2021.
|
| 251 |
+
[24] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 252 |
+
[25] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR, 2019.
|
| 253 |
+
[26] Johannes Klicpera, Janek Groß, and Stephan Günnemann. Directional message passing for molecular graphs. In International Conference on Learning Representations, 2019.
|
| 254 |
+
[27] Ron Levie, Wei Huang, Lorenzo Bucci, Michael M Bronstein, and Gitta Kutyniok. Transferability of spectral graph convolutional neural networks. arXiv preprint arXiv:1907.12972, 2019.
|
| 255 |
+
[28] Elliott H Lieb and Michael Loss. Fluxes, laplacians, and kasteleyn’s theorem. In Statistical Mechanics, pages 457–483. Springer, 1993.
|
| 256 |
+
[29] Yi Ma, Jianye Hao, Yaodong Yang, Han Li, Junqi Jin, and Guangyong Chen. Spectral-based graph convolutional network for directed graphs. arXiv:1907.08990, 2019.
|
| 257 |
+
[30] Antonio G Marques, Santiago Segarra, and Gonzalo Mateos. Signal processing on directed graphs: The role of edge directionality when processing and learning from network data. IEEE Signal Processing Magazine, 37(6):99–116, 2020.
|
| 258 |
+
[31] Péter Mernyei and Cat˘ alina Cangea. Wiki-cs: A wikipedia-based benchmark for graph neural ˘ networks. arXiv preprint arXiv:2007.02901, 2020.
|
| 259 |
+
[32] Bojan Mohar. A new kind of hermitian matrices for digraphs. Linear Algebra and its Applications, 584:343–352, 2020.
|
| 260 |
+
[33] Federico Monti, Karl Otness, and Michael M. Bronstein. Motifnet: A motif-based graph convolutional network for directed graphs. In 2018 IEEE Data Science Workshop, pages 225–228, 2018.
|
| 261 |
+
[34] Antonio Ortega, Pascal Frossard, Jelena Kovacevi ˇ c, José MF Moura, and Pierre Vandergheynst. ´ Graph signal processing: Overview, challenges, and applications. Proceedings of the IEEE, 106(5):808–828, 2018.
|
| 262 |
+
[35] William R Palmer and Tian Zheng. Spectral clustering for directed networks. Studies in Computational Intelligence, 943, 2021.
|
| 263 |
+
[36] Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. arXiv preprint arXiv:2002.05287, 2020.
|
| 264 |
+
|
| 265 |
+
[37] Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. arXiv preprint arXiv:1909.13021, 2019.
|
| 266 |
+
|
| 267 |
+
[38] Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. In Proceedings of IEEE computer society conference on computer vision and pattern recognition, pages 731–737. IEEE, 1997.
|
| 268 |
+
|
| 269 |
+
[39] Aaron Sim, Maciej Wiatrak, Angus Brayne, Páidí Creed, and Saee Paliwal. Directed graph embeddings in pseudo-riemannian manifolds. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 9681–9690. PMLR, 2021.
|
| 270 |
+
|
| 271 |
+
[40] Daniel A Spielman and Shang-Hua Teng. Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems. In Proceedings of the thirty-sixth annual ACM symposium on Theory of computing, pages 81–90, 2004.
|
| 272 |
+
|
| 273 |
+
[41] Zekun Tong, Yuxuan Liang, Changsheng Sun, Xinke Li, David Rosenblum, and Andrew Lim. Digraph inception convolutional networks. In NeurIPS, 2020.
|
| 274 |
+
|
| 275 |
+
[42] Zekun Tong, Yuxuan Liang, Changsheng Sun, David S. Rosenblum, and Andrew Lim. Directed graph convolutional network. arXiv:2004.13970, 2020.
|
| 276 |
+
|
| 277 |
+
[43] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph Attention Networks. International Conference on Learning Representations, 2018.
|
| 278 |
+
|
| 279 |
+
[44] 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, 32(1):4–24, 2020.
|
| 280 |
+
|
| 281 |
+
[45] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 282 |
+
|
| 283 |
+
[46] Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
|
md/train/YNA3UEPCUp/YNA3UEPCUp.md
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Principal Components Bias in Deep Neural Networks
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Recent work suggests that convolutional neural networks of different architectures
|
| 11 |
+
2 learn to classify images in the same order. To understand this phenomenon, we
|
| 12 |
+
3 revisit the over-parametrized deep linear network model. Our asymptotic analysis,
|
| 13 |
+
4 assuming that the hidden layers are wide enough, reveals that the convergence rate
|
| 14 |
+
5 of this model’s parameters is exponentially faster along directions corresponding
|
| 15 |
+
6 to the larger principal components of the data, at a rate governed by the singular
|
| 16 |
+
7 values. We term this convergence pattern the Principal Components bias (PC-bias).
|
| 17 |
+
8 We show how the $P C$ -bias streamlines the order of learning of both linear and non
|
| 18 |
+
9 linear networks, more prominently at earlier stages of learning. We then compare
|
| 19 |
+
10 our results to the spectral bias, showing that both biases can be seen independently,
|
| 20 |
+
11 and affect the order of learning in different ways. Finally, we discuss how the
|
| 21 |
+
12 PC-bias may explain some benefits of early stopping and its connection to PCA,
|
| 22 |
+
13 and why deep networks converge more slowly when given random labels.
|
| 23 |
+
|
| 24 |
+
# 14 1 Introduction
|
| 25 |
+
|
| 26 |
+
15 The dynamics of learning in deep neural networks is an intriguing subject, not yet sufficiently
|
| 27 |
+
16 understood. Diverse empirical data seems to support the hypothesis that neural networks start by
|
| 28 |
+
17 learning a simple model, which then gains complexity as learning proceeds (Gunasekar et al., 2018;
|
| 29 |
+
18 Soudry et al., 2018; Hu et al., 2020; Nakkiran et al., 2019; Gissin et al., 2019; Heckel & Soltanolkotabi,
|
| 30 |
+
19 2019; Ulyanov et al., 2018; Valle-Perez et al., 2018). This phenomenon is sometimes called simplicity
|
| 31 |
+
20 bias (Dingle et al., 2018; Shah et al., 2020).
|
| 32 |
+
21 Recent work additionally shows that neural networks learn the training examples of natural datasets
|
| 33 |
+
22 in a consistent order, and further impose a consistent order on the test set (Hacohen et al., 2020;
|
| 34 |
+
23 Pliushch et al., 2021). Below we call this effect Learning Order Constancy (LOC). Currently, the
|
| 35 |
+
24 characteristics of visual data, which may explain this consistently imposed order, remain unclear.
|
| 36 |
+
25 Surprisingly, this universal order persists despite the variability introduced into the training of different
|
| 37 |
+
26 models and architectures.
|
| 38 |
+
27 To understand this phenomenon, we start by analyzing the deep linear network model (Saxe et al.,
|
| 39 |
+
28 2013, 2019), defined by the concatenation of linear operators. While not a universal approximator, it
|
| 40 |
+
29 is nevertheless trained by minimizing a non-convex objective function with a multitude of minima.
|
| 41 |
+
30 The investigation of such networks is often employed to shed light on the learning dynamics when
|
| 42 |
+
31 complex geometric landscapes are explored by GD (Fukumizu, 1998; Arora et al., 2018).
|
| 43 |
+
32 In Section 2, we prove that the convergence of the weights of deep linear networks is governed
|
| 44 |
+
33 by the eigendecomposition of the raw data in a phenomenon we term PC-bias. These asymptotic
|
| 45 |
+
34 results, valid when the hidden layers are wide enough, can be seen as an extension of the known
|
| 46 |
+
35 behavior of the single-layer convex linear model (Le Cun et al., 1991). Our work is closely related to
|
| 47 |
+
36 (Saxe et al., 2013, 2019), where the deep linear model’s dynamics is analyzed as a function of the
|
| 48 |
+
37 input and input-output statistics. Importantly, the analysis in (Saxe et al., 2013, 2019; Arora et al.,
|
| 49 |
+
38 2018) incorporates the simplifying assumption that the data’s singular values are identical (whitened
|
| 50 |
+
39 data), an assumption which unfortunately obscures the main result of our analysis – the direct
|
| 51 |
+
40 dependence of convergence rate on the singular values of the data.
|
| 52 |
+
41 In Section 3, we empirically show that this pattern of convergence is indeed observed in deep linear
|
| 53 |
+
42 networks, validating the plausibility of our assumptions. We continue by showing that the LOC-effect
|
| 54 |
+
43 in deep linear network is determined solely by their PC-bias. We prove a similar (weaker) result for
|
| 55 |
+
44 the non-linear two-layer ReLU model introduced by Allen-Zhu et al. (2018), where this model is
|
| 56 |
+
45 presented as a certain extension of NTK (Jacot et al., 2020). In this framework, convergence is fastest
|
| 57 |
+
46 along the largest kernel’s principal components, a result related to the Spectral bias discussed below.
|
| 58 |
+
47 In Section 4, we extend the study empirically to non-linear networks, and investigate the relation
|
| 59 |
+
48 between the PC-bias and the LOC-effect in general deep networks. We first show that the order
|
| 60 |
+
49 by which examples are learned by linear networks is highly correlated with the order induced by
|
| 61 |
+
50 prevalent deep CNN models. We then show directly that the learning order of non-linear CNN models
|
| 62 |
+
51 is affected by the principal decomposition of the data. Moreover, the LOC-effect diminishes when
|
| 63 |
+
52 data is whitened, indicating a tight connection between the PC-bias and the LOC-effect.
|
| 64 |
+
53 Our results are reminiscent of another phenomenon, termed Spectral bias (Rahaman et al., 2019;
|
| 65 |
+
54 Cao et al., 2019), which associates the learning dynamics of neural networks with the Fourier
|
| 66 |
+
55 decomposition of functions in the hypothesis space. Rahaman et al. (2019) empirically demonstrated
|
| 67 |
+
56 that the complexity of classifiers learned by ReLU networks increases with time. Basri et al. (2019,
|
| 68 |
+
57 2020) showed theoretically, by way of analyzing elementary neural network models, that these models
|
| 69 |
+
58 first fit the data with low-frequency functions, and gradually add higher frequencies to improve the fit.
|
| 70 |
+
59 Nevertheless, the spectral bias and $P C$ -bias are inherently different. Indeed, the eigendecomposition
|
| 71 |
+
60 of raw images is closely related to the Fourier analysis of images as long as the statistical properties
|
| 72 |
+
61 of images are (approximately) translation-invariant (Simoncelli & Olshausen, 2001; Torralba & Oliva,
|
| 73 |
+
62 2003). Still, the $P C$ -bias is guided by spectral properties of the raw data and is additionally blind to
|
| 74 |
+
63 class labels. On the other hand, the spectral bias, as well as the related frequency bias that has been
|
| 75 |
+
64 shown to characterize NTK models (Basri et al., 2020), are all guided by spectral properties of the
|
| 76 |
+
65 learned hypothesis, which strongly depends on label assignment.
|
| 77 |
+
66 In Section 4.3 we investigate the relation between the PC-bias, spectral bias, and the LOC-effect.
|
| 78 |
+
67 We find that the LOC-effect is very robust: (i) when we neutralize the spectral bias by using low
|
| 79 |
+
68 complexity models such as deep linear networks, the effect is still observed; (ii) when we neutralize
|
| 80 |
+
69 the PC-bias by using whitened data, the LOC-effect persists. We hypothesize that at the beginning of
|
| 81 |
+
70 learning, the learning dynamics of neural models is controlled by the eigendecomposition of the raw
|
| 82 |
+
71 data. As learning proceeds, control of the dynamics slowly shifts to other factors.
|
| 83 |
+
|
| 84 |
+
72 The PC-bias has implications beyond the LOC-effect, as expanded in Section 5 and Suppl. §A:
|
| 85 |
+
|
| 86 |
+
73 1. Early stopping. It is often observed that when training deep networks with real data, the highest
|
| 87 |
+
74 generalization accuracy is obtained before convergence. Consequently, early stopping is often
|
| 88 |
+
75 prescribed to improve generalization. Following the commonly used assumption that in natural
|
| 89 |
+
76 images the lowest principal components correspond to noise (Torralba & Oliva, 2003), our results
|
| 90 |
+
77 predict the benefits of early stopping, and relate it to PCA. In Section 5 we investigate the relevance
|
| 91 |
+
78 of this conclusion to real non-linear networks (see, e.g., Basri et al. (2019); Li et al. (2020) for
|
| 92 |
+
79 complementary accounts).
|
| 93 |
+
80 2. Slower convergence with random labels. Zhang et al. (2016) showed that neural networks
|
| 94 |
+
81 can learn any label assignment. However, training with random label assignments is known to
|
| 95 |
+
82 converge slower as compared to training with the original labels (Krueger et al., 2017). We report a
|
| 96 |
+
83 similar phenomenon when training deep linear networks. Our analysis shows that when the principal
|
| 97 |
+
84 eigenvectors are correlated with class identity, as is often the case in natural images, the loss decreases
|
| 98 |
+
85 faster when given true label assignments as against random label assignments. In Section 5 we
|
| 99 |
+
86 investigate this hypothesis empirically in linear and non-linear networks.
|
| 100 |
+
87 3. Weight initialization. Different weight initialization schemes have been proposed to stabilize the
|
| 101 |
+
88 learning and minimize the hazard of "exploding gradients" (e.g., Glorot & Bengio, 2010; He et al.,
|
| 102 |
+
89 2015). Our analysis (see Suppl. $\ S \mathbf { A }$ ) identifies a related variant, which eliminates the hazard when
|
| 103 |
+
90 all the hidden layers are roughly of equal width. In the deep linear model, it can be proven that the
|
| 104 |
+
91 proposed normalization variant in a sense minimizes repeated gradient amplification.
|
| 105 |
+
|
| 106 |
+
# 92 2 Theoretical analysis
|
| 107 |
+
|
| 108 |
+
Notations. Let $\mathbb { X } = \{ ( \pmb { x } _ { i } , \pmb { y } _ { i } ) \} _ { i = 1 } ^ { n }$ denote the training data, where $\ b { x } \in \mathbb { R } ^ { q }$ denotes the i-th data point and ${ \pmb y } \in \{ 0 , 1 \} ^ { K }$ its corresponding label. Let $\scriptstyle { \frac { 1 } { n _ { i } } } m _ { i }$ denote the centroid (mean) of class $i$ with $n _ { i }$ points, and $M = [ \pmb { m } _ { 1 } \dots \pmb { m } _ { K } ] ^ { \top }$ . Finally, let $X$ and $Y$ denote the matrices whose $i ^ { t h }$ column is $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and $\mathbf { \nabla } _ { \mathbf { \boldsymbol { y } } _ { i } }$ respectively. $\Sigma _ { x x } = X X ^ { \top }$ and $\Sigma _ { Y X } = Y X ^ { \top }$ denote the covariance matrix of $X$ and cross-covariance of $X$ and $Y$ respectively. We note that $\Sigma _ { X X }$ captures the structure of the data irrespective of class identity.
|
| 109 |
+
|
| 110 |
+
9 Definition 1 (Principal coordinate system). The coordinate system obtained by rotating the data in $\mathbb { R } ^ { q }$ by an orthonormal matrix $\boldsymbol { U }$ >, where $S V D ( \Sigma _ { x x } ) { = } U D U ^ { \top } .$ . Now $\Sigma _ { X X } = D$ , a diagnoal matrix whose elements are the singular values of 01 $X X ^ { \top }$ , arranged in decreasing order $d _ { 1 } \geq d _ { 2 } \geq . . . \geq d _ { q } \geq 0$ .
|
| 111 |
+
|
| 112 |
+
Definition 2 (Compact representation). Let $f ( { \pmb x } )$ denote a deep linear network. Then $f ( { \pmb x } ) =$ $\begin{array} { r } { \Big ( \prod _ { l = L } ^ { 1 } W _ { l } \Big ) \pmb { x } = \pmb { W } \pmb { x } } \end{array}$ , where $W \in \mathbb { R } ^ { K \times q }$ is called the compact representation of the network.
|
| 113 |
+
|
| 114 |
+
04 Definition 3 (Error matrix). For a deep linear network whose compact representation is $W$ , the
|
| 115 |
+
05 error matrix is $E r = W \Sigma _ { x x } - \Sigma _ { Y X }$ . In the principal coordinate system, $E r = { W D - M }$ .
|
| 116 |
+
|
| 117 |
+
Assumptions. Our analysis assumes that the learning rate $\mu$ is infinitesimal, and therefore terms of size $\operatorname { \dot { ~ } O } ( \mu ^ { 2 } )$ can be neglected. We further assume that the width of the hidden layers lies in [m, $\mathbb { m } + M _ { b } ]$ , where $\mathbb { m } \to \infty$ denotes a very large number and $M _ { b }$ is fixed. Thus terms of size $O ( \textstyle { \frac { 1 } { m } } )$ can also be neglected. In Fig. 1 we show the plausibility of these assumptions, where the predicted dynamics is seen throughout the training of deep linear networks, even for small values of m.
|
| 118 |
+
|
| 119 |
+
# 111 2.1 The dynamics of deep over-parametrized linear networks
|
| 120 |
+
|
| 121 |
+
112 Consider a deep linear network with $L$ layers, and let
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
L ( \mathbb { X } ) = \frac { 1 } { 2 } \| \pmb { W } \pmb { X } - \pmb { Y } \| _ { F } ^ { 2 } \qquad \pmb { W } : = \prod _ { l = L } ^ { 1 } W _ { l } , \quad W _ { l } \in \mathbb { R } ^ { m _ { l } \times m _ { l - 1 } }
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
13 Above $m _ { l }$ denotes the number of neurons in layer $l$ , where $m _ { 0 } = q$ and $m _ { L } = K$ .
|
| 128 |
+
|
| 129 |
+
114 Theorem 1. In each time point s, the compact matrix representation $W$ obeys the following dynamics when using the notation 115 $E r ^ { s }$ defined in Def. 3:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\boldsymbol { W } ^ { s + 1 } = \boldsymbol { W } ^ { s } - \mu \sum _ { l = 1 } ^ { L } \boldsymbol { A } _ { l } ^ { s } \cdot \boldsymbol { E } \boldsymbol { r } ^ { s } \cdot \boldsymbol { B } _ { l } ^ { s } + O ( \mu ^ { 2 } )
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
Above 116 $\mu$ denotes the learning rate. $A _ { l } ^ { s }$ and $B _ { l } ^ { s }$ are called gradient scale matrices, and are defined as
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
A _ { l } ^ { s } : = \Big ( \prod _ { j = L } ^ { l + 1 } W _ { j } ^ { s } \Big ) \Big ( \prod _ { j = L } ^ { l + 1 } W _ { j } ^ { s } \Big ) ^ { \top } \in \mathbb R ^ { K \times K } \qquad B _ { l } ^ { s } : = \Big ( \prod _ { j = l - 1 } ^ { 1 } W _ { j } ^ { s } \Big ) ^ { \top } \Big ( \prod _ { j = l - 1 } ^ { 1 } W _ { j } ^ { s } \Big ) \in \mathbb R ^ { q \times q }
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
117 The proof can be found in Suppl. $\ S \mathbf { B }$ .
|
| 142 |
+
|
| 143 |
+
118 Gradient scale matrices. Some statistical properties of such matrices are established in Suppl. $\ S \mathrm { A }$ .
|
| 144 |
+
119 Note that when the number of hidden layers is 0 $\mathcal { L } = 1 $ ), both gradient scale matrices reduce to the
|
| 145 |
+
120 identity matrix and the dynamics in (2) is reduced to the following known result (e.g., Le Cun et al.,
|
| 146 |
+
121 1991): $\mathbf { \boldsymbol { W } } ^ { s + 1 } = \mathbf { \boldsymbol { W } } ^ { s } - \dot { \mu } \mathbf { \boldsymbol { E } } r ^ { s }$ . Recall, however, that the focus of this paper is the over-parameterized
|
| 147 |
+
122 linear model with $L > 1$ , in which the loss is not convex. Since the difference between the convex
|
| 148 |
+
123 linear model and the over-parametrized deep model boils down to these matrices, our convergence
|
| 149 |
+
124 analysis henceforth focuses on the dynamics of the gradient scale matrices.
|
| 150 |
+
125 In accordance, we analyze the evolution of the gradient scale matrices as learning proceeds. Let
|
| 151 |
+
126 $\mathfrak { m } = \operatorname* { m i n } \left( \underset { - } { m } _ { 1 } , . . . , { m } _ { L - 1 } \right)$ denote the size of the smallest hidden layer. Initially for $s = 0$ , all weight
|
| 152 |
+
127 matrices $W _ { l } ^ { 0 }$ are assumed to be initialized by sampling from a distribution with mean 0 and variance
|
| 153 |
+
128 $\begin{array} { r } { \sigma _ { l } ^ { 2 } = O ( \frac { 1 } { \mathrm { m } } ) } \end{array}$ . The specific normalization factor, alluded to in $O ( { \textstyle { \frac { 1 } { m } } } )$ , is a variant of the Glorot
|
| 154 |
+
129 initialization. Details and justification can be found in Suppl. $\ S \mathrm { A } . 1$ .
|
| 155 |
+
|
| 156 |
+
At time 130 $s$ , let $A _ { l } ^ { s } ( \mathrm { m } )$ and $B _ { l } ^ { s } ( \mathrm { m } )$ denote a sequence of random gradient scale matrices, corresponding 131 to networks whose smallest hidden layer has m neurons. From Suppl. $\ S \mathrm { A }$ we deduce that:
|
| 157 |
+
|
| 158 |
+
Theorem 2. Using 132 $\xrightarrow { p }$ to denote convergence in probability $a s \textrm { m } { } \infty$ , and $\forall s , l$ :
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
B _ { l } ^ { s } ( \mathrm { m } ) \stackrel { p } { } I , \mathrm { v a r } [ B ^ { l } ( \mathrm { m } ) ] = { \cal O } \biggl ( \frac { 1 } { \mathrm { m } } \biggr ) \qquad A _ { l } ^ { s } ( \mathrm { m } ) \stackrel { p } { } I , \mathrm { v a r } [ A ^ { l } ( \mathrm { m } ) ] = { \cal O } \biggl ( \frac { 1 } { \mathrm { m } } \biggr )
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
133 Proof. Proof by induction on $s$ . Initially when $s = 0$ , the claim follows from $\mathrm { T h m } 4$ and Corr 5.1.
|
| 165 |
+
134 The induction step validity follows from Thm 6 and Thm 7 (see Suppl. $\ S \mathrm { A } . 2$ ). □
|
| 166 |
+
135 The detailed proof shows that the relevant constants are amplified with $s$ . While they remain moderate
|
| 167 |
+
136 and m is sufficiently large, $B _ { l } ^ { s } ( \mathbf { m } ) \approx I$ and $A _ { l } ^ { s } ( \mathbf { m } ) \approx I \forall l$ . In this case, the dynamics of the over
|
| 168 |
+
137 parameterized model is identical to the dynamics of the convex linear model, $W ^ { s + 1 } = W ^ { s } - \mu E r ^ { s }$ .
|
| 169 |
+
138 Convergence rate. In $\ S \mathrm { A } . 2$ we show that the convergence of $B _ { l } ^ { s } ( \mathrm { m } )$ to $I$ is governed to some extent
|
| 170 |
+
139 by $O \left( \textstyle { \frac { K } { 2 0 } } \right)$ , while the convergence of $A _ { l } ^ { s } ( \mathrm { m } )$ is governed by $O \left( { \frac { q } { \mathrm { m } } } \right)$ . Recall that while $\mathrm { ~ m ~ } \mathrm { ~ \infty ~ }$
|
| 171 |
+
140 $q$ is the dimension of the data space which is fixed in advance and can be fairly large, while $K$ is
|
| 172 |
+
141 the number of classes which is fixed and quite small. Typically, $K \ll q$ . Thus we expect the right
|
| 173 |
+
142 gradient scale matrices $B _ { l } ^ { s } ( \mathrm { m } )$ to remain approximately $I$ much longer than the left matrices $A _ { l } ^ { s } ( \mathrm { m } )$
|
| 174 |
+
|
| 175 |
+
Empirical validation. Since the results above are asymptotic, and to envision the difference between convergence governed by $O \left( \textstyle { \frac { K } { 2 } } \right)$ vs. $O \left( { \frac { q } { \mathrm { m } } } \right)$ , we resort to simulations whose results are shown in Fig. 1. These empirical results, recounting linear networks with 4 hidden layers of width 1024, clearly show that during a significant part of the training both gradient scale matrices remain approximately I. The difference between the convergence rate of $B _ { l } ^ { s }$ and $A _ { l } ^ { s }$ is seen later on, when $\Delta A _ { l } ^ { s }$ starts to increase shortly before convergence, while $\Delta B _ { l } ^ { s }$ remains essentially 0 throughout.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 1: The dynamics of $A _ { l } ^ { s }$ and $B _ { l } ^ { s }$ when training 10 5-layered linear networks on the small-mammals dataset. (a) Mean distance of the diagonal elements of $A _ { l } ^ { s }$ and $B _ { l } ^ { s }$ from $\alpha _ { i } ^ { s }$ and $\beta _ { i } ^ { s }$ (as defined in Thm 3, $\ S \mathrm { A . 1 } \rangle$ ). (b) Mean value of the off-diagonal elements of $A _ { l } ^ { s }$ and $B _ { l } ^ { s }$ . The networks reach maximal test accuracy at epoch $s = 1 0 0$ , before the divergence of $A _ { l } ^ { s }$ . All layers behave similarly.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 2: Empirical confirmation of the theoretical results reported below, showing the std of ${ \pmb w } _ { j }$ over 10 independently trained networks as a function of the epoch, for 6 specific principal components (identified in the legend). Left: two-layer linear network. Right: two-layer non-linear network with ReLU activation.
|
| 182 |
+
|
| 183 |
+
# 149 2.2 Weight evolution
|
| 184 |
+
|
| 185 |
+
$K \ll q$ entails that $B _ { l } ^ { s } ( \mathrm { m } )$ remains approximately equal to $I$ much longer than $A _ { l } ^ { s } ( \mathrm { m } )$ . This is substantiated by the simulation results in Fig. 1. Consequently, while earlier on it is safe to assume that both $A _ { l } ^ { s } \approx I$ and $B _ { l } ^ { s } \approx I$ , as learning proceeds only $B _ { l } ^ { s } \approx I$ is safe to assume.
|
| 186 |
+
|
| 187 |
+
153 With this in mind, we obtain expressions for the evolution of $W ^ { s }$ separately for earlier and later in
|
| 188 |
+
154 learning. We first shift to the principal coordinate system defined in Def 1. In this system we can
|
| 189 |
+
155 analyze each column of $W ^ { s }$ separately, where $\boldsymbol { w } _ { j } ^ { s }$ and $m _ { j }$ denote the respective columns of $W ^ { s }$ and
|
| 190 |
+
156 $M$ . At the beginning of learning when both $A _ { l } ^ { s } \overset { \smile } { \approx } I$ and $\bar { B } _ { l } ^ { s } \approx I$ (see $\ S \mathrm { B } . 3$ for a detailed derivation):
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\pmb { w } _ { j } ^ { s + 1 } = ( \lambda _ { j } ) ^ { s } \pmb { w } _ { j } ^ { 0 } + [ 1 - ( \lambda _ { j } ) ^ { s } ] \frac { m _ { j } } { d _ { j } } \qquad \lambda _ { j } = 1 - \mu d _ { j } L
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
58 Eq. 4 is reminiscent of the well understood dynamics of training the convex one layer linear model. It
|
| 197 |
+
59 is composed of two additive terms, revealing two parallel and independent processes:
|
| 198 |
+
1. The dependence on random initialization tends to 0 exponentially with decline rate $\lambda _ { j }$ .
|
| 199 |
+
2. The final value is the sum of a geometrical series with a common ratio $\lambda _ { j }$ .
|
| 200 |
+
162 In either case, convergence is fastest for the largest singular eigenvalue, or the first column of $W$ ,
|
| 201 |
+
163 and slowest for the smallest singular value. This behavior is visualized in Fig. 2a. Importantly, the
|
| 202 |
+
164 rate of convergence depends on the singular value $d _ { j }$ , the number of layers $L$ , and the learning rate $\mu$ .
|
| 203 |
+
|
| 204 |
+
In later stages of learning, when we can only assume that 165 $B _ { l } ^ { s } \approx I$ , the dynamic becomes:
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
{ \pmb w } _ { j } ^ { s + 1 } = \prod _ { \nu = 1 } ^ { s } ( I - \mu d _ { j } A ^ { \nu } ) { \pmb w } _ { j } ^ { 0 } + \mu \left[ \sum _ { \nu = 1 } ^ { s } \prod _ { \rho = \nu + 1 } ^ { s } ( I - \mu d _ { j } A ^ { \rho } ) A ^ { \nu } \right] m _ { j }
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
166 where $\begin{array} { r } { A ^ { s } = \sum _ { l = 1 } ^ { L } A _ { l } ^ { s } } \end{array}$ . The proof is provided in $\ S \mathrm { B } . 3$ . Although the dynamics now depends on
|
| 211 |
+
167 matrices $A ^ { s }$ as well, it is still the case that the convergence of each column is governed by its singular
|
| 212 |
+
168 value $d _ { j }$ . This suggests that while the $P C$ -bias is more pronounced in earlier stages of learning, its
|
| 213 |
+
169 effect persists throughout.
|
| 214 |
+
170 The analysis above is extended to a simple non-linear ReLU model (cf. Arora et al., 2019) as detailed
|
| 215 |
+
171 in $\ S \mathbf { B } . 2$ , with qualitatively similar results (albeit under unrealistic assumptions). Empirical results,
|
| 216 |
+
172 shown in Fig. 2b, indicate that the results are indicative beyond the assumed circumstances.
|
| 217 |
+
|
| 218 |
+
# 173 3 PC-bias: empirical study
|
| 219 |
+
|
| 220 |
+
174 In this section, we first analyze deep linear networks, showing that the convergence rate is indeed
|
| 221 |
+
175 governed by the principal singular values of the data, which demonstrates the plausibility of the
|
| 222 |
+
176 assumptions made in Section 2. We continue by extending the scope of the investigation to non-linear
|
| 223 |
+
177 neural networks, finding there evidence for the $P C$ -bias mostly in the earlier stages of learning.
|
| 224 |
+
|
| 225 |
+
# 178 3.1 Methodology
|
| 226 |
+
|
| 227 |
+
We say that a linear network is $L$ -layered when it has $L - 1$ hidden fully connected (FC) layers (without convolutional layers). In our empirical study we relaxed some assumptions of the theoretical study, in order to increase the resemblance of the trained networks to networks in common use. Specifically, we changed the initialization to the commonly used Glorot initialization, replaced the $L _ { 2 }$ loss with the cross-entropy loss, and employed SGD instead of the deterministic GD. Notably, the original assumptions yielded similar results. The results presented summarize experiments with networks of equal width across all hidden layers, specifically the moderate value of $\mathrm { ~ m ~ } = 1 0 2 4$ , keeping in mind that we test the relevance of asymptotic results for $\mathbb { m } \to \infty$ . Using a different width for each layer yielded similar qualitative results. Details regarding the hyper-parameters, architectures, and datasets can be found in $\ S _ { \mathrm { D . 1 } }$ , $\ S _ { \mathrm { D } . 3 }$ and $\ S _ { \mathrm { D } . 4 }$ respectively.
|
| 228 |
+
|
| 229 |
+
# 3.2 PC-bias in deep linear networks
|
| 230 |
+
|
| 231 |
+
In this section, we train $L$ -layered linear networks, then compute their compact representations $W$ rotated to align with the canonical coordinate system (Def. 1). Note that each row ${ \pmb w } _ { r }$ in $W$ essentially defines the one-vs-all separating hyper-plane corresponding to class $r$ .
|
| 232 |
+
|
| 233 |
+
193 To examine both the variability between models and their convergence rate, we inspect ${ \pmb w } _ { r }$ at different
|
| 234 |
+
194 time points during learning. The rate of convergence can be measured directly, by observing the
|
| 235 |
+
195 changes in the weights of each element in ${ \pmb w } _ { r }$ . These weight values1 should be compared with
|
| 236 |
+
196 the optimal values in each row ${ \pmb w } _ { r }$ of $W _ { o p t } \doteq Y X ^ { T } ( X X ^ { \tilde { T } } )$ . The variability between models is
|
| 237 |
+
197 measured by calculating the standard deviation (std) of each ${ \pmb w } _ { r }$ across $N$ models.
|
| 238 |
+
|
| 239 |
+
We begin with linear networks. We trained 10 5-layered FC linear networks, and 10 linear st-VGG convolutional networks. When analyzing the compact representation of such networks we observe similar behavior – weights corresponding to larger principal components converge faster to the optimal value, and their variability across models converges faster to 0 (Figs. 3a,3b). Thus, while the theoretical results are asymptotic, $P C$ -bias is empirically seen throughout the entire learning process of deep linear networks.
|
| 240 |
+
|
| 241 |
+
Whitened data. The PC-bias is neutralized when the data is whitened, at which point $\Sigma _ { X X }$ is the scaled identity matrix. In Fig. 3c, we plot the results of the same experimental protocol while using a ZCA-whitened dataset. As predicted, the networks no longer show any bias towards any principal direction. Weights in all directions are scaled similarly, and the std over all models is the same in each epoch, irrespective of the principal direction. (Additional experiments show that this is not an artifact of the lack of uniqueness when deriving the principal components of a white signal).
|
| 242 |
+
|
| 243 |
+
1We note that the weights tend to start larger for smaller principal components, as can be seen in Fig. 3a left.
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 3: Convergence of the compact representation along the principal directions in different epochs. The value of the $X$ -axis corresponds to the index of a principal eigenvalue, from the most significant to the least significant. (a) 10 5-layered linear networks trained on the cats and dogs dataset. 3 plots are provided, corresponding to snapshots taken at different stages of learning: the beginning (epoch 0, left), intermediate stage (middle), and close to convergence (right). Bottom panel: average distance of the weights in $\pmb { w } _ { 1 }$ from the optimal linear classifier; top panel: respective std. (b) Similarly, for 10 linear st-VGG convolutional networks, trained on CIFAR-10. (c) Similarly, for 10 5-layered linear networks, trained on the cats and dogs dataset, with ZCAwhitening. (d) Similarly, for 10 non-linear st-VGG networks trained on the cats and dogs dataset. Here the distance to the optimal solution is not well defined and we therefore only show the std.
|
| 247 |
+
|
| 248 |
+
# 210 3.3 PC-bias in general CNNs
|
| 249 |
+
|
| 250 |
+
In this section, we investigate the manifestation of the PC-bias in non-linear deep convolutional networks. As we cannot directly track the learning dynamics separately in each principal direction of non-linear networks, we adopt two different evaluation mechanisms:
|
| 251 |
+
|
| 252 |
+
Linear approximation. We considered several linear approximations, but since all of them showed the same qualitative behavior, we report results with the simplest one. Specifically, to obtain a linear approximation of a non-linear network, without max-pooling or batch-normalization layers, we follow the definition of the compact representation from Section 2 while ignoring any non-linear activation. We then align this matrix with the canonical coordinate system (Def. 1), and observe the evolution of the weights and their std across models along the principal directions during learning. Note that now the networks do not converge to the same compact representation, which is not unique. Nevertheless, we see that the PC-bias governs the weight dynamics to a noticeable extent.
|
| 253 |
+
|
| 254 |
+
222 More specifically, in these networks a large fraction of the lowest principal components hardly changes
|
| 255 |
+
223 during learning, as good as being ignored. Nevertheless, the $P C$ -bias affects the higher principal
|
| 256 |
+
224 components, most notably at the beginning of training (see Fig. 3d). Thus weights corresponding to
|
| 257 |
+
225 higher principal components converge faster, and the std across models of such weights decreases
|
| 258 |
+
226 faster for higher principal components.
|
| 259 |
+
|
| 260 |
+
Projection to higher PC’s. We created a modified test-set, by projecting each test example on the span of the first $P$ principal components. This is equivalent to reducing the dimensionality of the test set to $P$ using PCA. We trained an ensemble of $N { = } 1 0 0$ st-VGG networks on the original small mammals training set, then evaluated these networks during training on 4 versions of the test-set, reduced to $P { = } 1 { , } 1 0 { , } 1 0 0 { , } 1 0 0 0$ dimensions respectively. Mean accuracy is plotted in Fig. 4. Similar results are obtained when training VGG-19 networks on CIFAR-10, see $\ S { \bf C } . 3$ .
|
| 261 |
+
|
| 262 |
+
Taking a closer look at Fig. 4, we see that when evaluated on lower dimensionality test-data $( P { = } 1 , 1 0 )$ ), the networks’ accuracy peaks after a few epochs, at which point performance starts to decrease. This result suggests that the networks rely more heavily on these dimensions in the earlier phases of learning, and then continue to learn other things. In contrast, when evaluated on higher dimensionality test-data $\scriptstyle P = 1 0 0 , 1 0 0 0 $ , accuracy continues to rise, longer so for larger $P$ . This suggests that significant learning of the additional dimensions continues in later stages of the learning.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
Figure 4: Mean accuracy of $1 0 \ \mathrm { s t } .$ -VGG networks evaluated on test data projected to dimensionality $\{ 1 , \bar { 1 0 } , 1 0 0 , 1 0 0 0 \}$ .
|
| 266 |
+
|
| 267 |
+
244 In this section, we show that the $P C$ -bias is significantly correlated with the learning order of deep
|
| 268 |
+
245 neural networks, and can therefore partially account for the $L O C$ -effect described in Section 1.
|
| 269 |
+
246 Following Hacohen et al. (2020), we measure the "speed of learning" of each example by computing
|
| 270 |
+
247 its accessibility score. This score is given per example, and characterizes how fast an ensemble of
|
| 271 |
+
248 $N$ networks learns it. Formally, accessibility $\mathbf { \Phi } _ { \prime } ( \mathbf { x } ) \bar { \mathbf { \Psi } } = \mathbb { E } \left[ \mathbb { 1 } ( f _ { i } ^ { e } ( \pmb { x } ) = y ( \pmb { x } ) ) \right]$ , where $f _ { i } ^ { e } ( { \pmb x } )$ denotes
|
| 272 |
+
249 the outcome of the $i$ -th network trained over $e$ epochs, and the mean is taken over networks and
|
| 273 |
+
250 epochs. For the set of datapoints $\{ ( \pmb { x } _ { j } , \pmb { y } _ { j } ) \} _ { j = 1 } ^ { n }$ , Learning Order Constancy is manifested by the high
|
| 274 |
+
251 correlation between 2 instances of accessibility $( { \pmb x } )$ , each computed from a different ensemble.
|
| 275 |
+
252 PC-bias is shown to pertain to $L O C$ in two ways: First, in Section 4.1 we show high correlation
|
| 276 |
+
253 between the learning order in deep linear and non-linear networks. Since the $P C$ -bias fully accounts
|
| 277 |
+
254 for $L O C$ in deep linear networks, this suggests it also accounts (at least partially) for the observed
|
| 278 |
+
255 $L O C$ in non-linear networks. Comparison with the critical principal component verifies this assertion.
|
| 279 |
+
256 Second, we show in Section 4.2 that when the $P C .$ -bias is neutralized, $L O C$ diminishes as well. In
|
| 280 |
+
257 Section 4.3 we discuss the relationship between the spectral bias, PC-bias and the LOC-effect.
|
| 281 |
+
|
| 282 |
+
# 258 4.1 PC-Bias is correlated with LOC
|
| 283 |
+
|
| 284 |
+
We first compare the order of learning of non-linear models and deep linear networks by computing the correlation between the accessibility scores of both models. This comparison reveals high correlation $\mathrm { \Delta } r = 0 . 8 5$ , $p < 1 0 ^ { - 4 5 } .$ ), as seen in Fig. 5a. To investigate directly the connection between the $P C$ -bias and $L O C$ , we define the critical principal component of an example to be the first principal component $P$ , such that a linear classifier trained on the original data can classify the example correctly when projected to $P$ principal components. We trained $N { = } 1 0 0$ st-VGG networks on the cats and dogs dataset, and computed for each example its accessibility score and critical principal component. In Fig. 5b we see strong negative correlation between the two scores $\scriptstyle ( p = - 0 . 9 3$ , $\stackrel { - } { r } < 1 0 ^ { - 4 }$ ), suggesting that the $P C$ -bias affects the order of learning as measured by accessibility.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 5: (a) Correlation between the accessibility score of $N { = } 1 0 0$ st-VGG networks trained with a low learning rate2, and $N { = } 1 0 0$ linear st-VGG networks, trained on small mammals. (b) Correlation between the accessibility score of $N { = } 1 0 0 ~ \mathrm { s t }$ -VGG networks trained on cats and dogs, and the critical principal component score. The accessibility plot is smoothed by moving average of width 10. Error bars indicate standard error.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 6: $L O C$ measured with and without PC-bias. Each bar represents the correlation between the learning order of 2 collections of 10 networks trained on CIFAR10. Orange bars represent natural images, in which the $P C$ -bias is present, while blue bars represent whitened data, in which the $P C$ -bias is eliminated. As $P C$ -bias is more prominent earlier on, we compare these correlations for the entire data (right 2 bars), and for the subset of $2 0 \%$ "fastest learned" examples (left 2 bars).
|
| 291 |
+
|
| 292 |
+
# 268 4.2 Neutralizing the PC-bias leads to diminishing LOC
|
| 293 |
+
|
| 294 |
+
Whitening the data eliminates the $P C$ -bias as shown in Fig. 3c, since all the singular values are now identical. Here we use this observation to further probe into the dependency of the Learning Order Constancy on the PC-bias. Starting with the linear case, we train 4 ensembles of $N { = } 1 0$ 2-layered linear networks on the cats and dogs dataset, 2 with and 2 without ZCA-whitening. We compute the accessibility score for each ensemble separately, and correlate the scores of the 2 ensembles in each test case. Each correlation captures the consistency of the LOC-effect for the respective condition. This correlation is expected to be very high for natural images. Low correlation implies that the LOC-effect is weak, as training the same network multiple times yields a different learning order.
|
| 295 |
+
|
| 296 |
+
277 Fig. 6a shows the results for deep linear networks. As expected, the correlation when using natural
|
| 297 |
+
278 images is very high. However, when using whitened images, correlation plummets, indicating that
|
| 298 |
+
279 the LOC-effect is highly dependent on the $P C$ -bias. We note that the drop in the correlation is much
|
| 299 |
+
280 higher when considering only the $2 0 \%$ "fastest learned" examples, suggesting that the $P C .$ -bias affects
|
| 300 |
+
281 learning order more evidently at earlier stages of learning.
|
| 301 |
+
|
| 302 |
+
Fig. 6b shows the results when repeating this experiment with non-linear networks, training 2 collections of $N { = } 1 0$ VGG-19 networks on CIFAR-10. We find that the elimination of the $P C .$ -bias in this case affects $L O C$ much less, suggesting that the $P C \cdot$ -bias can only partially account for the LOC-effect in the non-linear case. However, we note that at the beginning of learning, when the PC-bias is most pronounced, once again the drop is much larger and very significant (half).
|
| 303 |
+
|
| 304 |
+
# 4.3 Spectral bias, PC-bias and LOC
|
| 305 |
+
|
| 306 |
+
The spectral bias (Rahaman et al., 2019) characterizes the dynamics of learning in neural networks differently, asserting that initially neural models can be described by low frequencies only. This may provide an alternative explanation to LOC. Recall that LOC is manifested in the consistency of the accessibility score across networks. To compare between the spectral bias and accessibility score, we first need to estimate for each example whether it can be correctly classified by a low frequency model. Accordingly, we define for each example a discriminability measure – the percentage out of its $k$ neighbors that share with it class identity. Intuitively, an example has a low discriminability score when it is surrounded by examples from other classes, which forces the learned boundary to incorporate high frequencies. In $\ S { \bf C } . 2$ we show that in the 2D case analyzed by Rahaman et al. (2019), this measure strongly correlates $\scriptstyle { r = - 0 . 8 }$ , $p < 1 0 ^ { - 2 }$ ) with the spectral bias.
|
| 307 |
+
|
| 308 |
+
We trained several networks (VGG-19 and st-VGG) on several real datasets, including smallmammals, STL-10, CIFAR-10/100 and a subset of ImageNet-20. For each network and dataset, we computed the accessibility score as well as the discriminability of each example. The vector space, in which discriminability is evaluated, is either the raw data or the network’s perceptual space (penultimate layer activation). The correlation between these scores is shown in Table 1.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 7: Effects of amplifying the highest (blue) and lowest (orange) principal components.
|
| 312 |
+
|
| 313 |
+
Table 1: Correlation between accessibility and discriminability.
|
| 314 |
+
|
| 315 |
+
<table><tr><td>Dataset</td><td>Raw data</td><td>Penultimate</td></tr><tr><td>Small mammals</td><td>0.46</td><td>0.85</td></tr><tr><td>ImageNet 20</td><td>0.01</td><td>0.54</td></tr><tr><td>CIFAR-100</td><td>0.51</td><td>0.85</td></tr><tr><td>STL10</td><td>0.44</td><td>0.7</td></tr></table>
|
| 316 |
+
|
| 317 |
+
303 Using raw data, low correlation is still seen between the accessibility and discriminability scores
|
| 318 |
+
304 when inspecting the smaller datasets (small mammals, CIFAR-100 and STL10). This correlation
|
| 319 |
+
305 vanishes when considering the larger ImageNet-20 dataset. It would appear that on its own, the
|
| 320 |
+
306 spectral bias cannot adequately explain the LOC-effect. On the other hand, in the perceptual space,
|
| 321 |
+
307 the correlation between discriminability and accessibility is quite significant for all datasets. Contrary
|
| 322 |
+
308 to our supposition, it seems that networks learn a representation where the spectral bias is evident,
|
| 323 |
+
309 but this bias does not necessarily govern its learning before the representation has been learned.
|
| 324 |
+
|
| 325 |
+
# 310 5 PC-bias: further implications
|
| 326 |
+
|
| 327 |
+
Early Stopping and the Generalization Gap. Considering natural images, it is often assumed that the least significant principal components of the data represent noise (Torralba & Oliva, 2003). In such cases, our analysis predicts that as noise dominates the components learned later in learning, early stopping is likely to be beneficial. To test this hypothesis directly, we manipulated CIFAR-10 to amplify the signal in either the $1 . 5 \%$ most significant (higher) or $\mathrm { { \dot { 1 } . 5 \% } }$ least significant (lower) principal components (see examples in Fig. 16, Suppl. $\ S _ { \mathbf { D } }$ ). Accuracy over the original test set, after training 10 st-VGG and linear st-VGG networks on these manipulated images, can be seen in Fig. 7. Both in linear and non-linear networks, early stopping is more beneficial when lower
|
| 328 |
+
|
| 329 |
+
9 principal components are amplified, and significantly less so when higher components are amplified,
|
| 330 |
+
0 as predicted by the PC-bias.
|
| 331 |
+
|
| 332 |
+
Slower Convergence with Random Labels. Deep neural models can learn any random label assignment to a given training set (Zhang et al., 2016). However, when trained on randomly labeled data, convergence appears to be much slower (Krueger et al., 2017). Assume, as before, that in natural images the lower principal components are dominated by noise. We argue that the $P C$ -bias now predicts this empirical result, since learning randomly labeled examples requires signal present in lower principal components. To test this hypothesis directly, we trained 10 2-layered linear networks on datasets of natural images. Indeed, these networks converge slower with random labels (see Fig. 8a). In Fig. 8b we repeat this experiment after having whitened the images, to neutralize the PC-bias. Now convergence rate is identical, whether the labels are original or shuffled. Clearly, in deep linear networks the $P C$ -bias gives a full account of this phenomenon.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 8: Learning curves of 10 2-layered linear networks, with real and shuffled labels, (a) before and (b) after whitening.
|
| 336 |
+
Figure 9: Learning curves of st-VGG networks trained on 3 datasets, which are linearly separable after projection to the highest $P$ principal components (see legend).
|
| 337 |
+
|
| 338 |
+
331 To further check the relevance of this account to non-linear networks, we artificially generate datasets
|
| 339 |
+
332 where only the first $P$ principal components are discriminative, while the remaining components
|
| 340 |
+
333 become noise by design. We constructed two such datasets: in one the labels are correlated with the
|
| 341 |
+
334 original labels, in the other they are not. Specifically, PCA is used to reduce the dimensionality of a
|
| 342 |
+
335 two-class dataset to $P$ , and the optimal linear separator in the reduced representation is computed.
|
| 343 |
+
336 Next, all the labels of points that are incorrectly classified by the optimal linear separator are switched,
|
| 344 |
+
337 so that the train and test sets are linearly separable by this separator. Note that the modified labels
|
| 345 |
+
338 are still highly correlated with the original labels (for $P = 5 0 0$ : $p = 0 . 8 2$ , $r < 1 0 ^ { - 1 0 }$ ). The
|
| 346 |
+
339 second dataset is generated by repeating the process while starting from randomly shuffled labels.
|
| 347 |
+
340 This dataset is likewise fully separable when projected to the first $P$ components, but its labels are
|
| 348 |
+
341 uncorrelated with the original labels (for $P = 5 0 0$ : $p = 0 . 0 6$ , $r < 1 0 ^ { - 1 0 }$ ).
|
| 349 |
+
342 The mean training accuracy of 10 non-linear networks with $P { = } 1 0 { , } 5 0 { , } 5 0 0$ is plotted in Fig. 9a (first
|
| 350 |
+
343 dataset) and Fig. 9b (second dataset). In both cases, the lower $P$ is (namely, only the first few principal
|
| 351 |
+
344 components are discriminative), the faster the data is learned by the non-linear network. Whether the
|
| 352 |
+
345 labels are real or shuffled makes little qualitative difference, as predicted by the $P C$ -bias.
|
| 353 |
+
|
| 354 |
+
# 46 6 Summary and discussion
|
| 355 |
+
|
| 356 |
+
347 When trained with gradient descent, the convergence rate of the over-parameterized deep linear
|
| 357 |
+
348 network model is provably governed by the eigendecomposition of the data, and specifically, pa
|
| 358 |
+
349 rameters corresponding to the most significant principal components converge faster than the least
|
| 359 |
+
350 significant components. Empirical evidence is provided for the relevance of these results to more
|
| 360 |
+
351 realistic non-linear networks. We term this effect $P C$ -bias. This result provides a complementary
|
| 361 |
+
352 account for some prevalent empirical observations, including the benefit of early stopping and the
|
| 362 |
+
353 slower convergence rate with shuffled labels.
|
| 363 |
+
354 We use the PC-bias to explicate the Learning Order Constancy $( L O C )$ , showing that examples
|
| 364 |
+
355 learned at earlier stages are more distinguishable by the higher principal components, demonstrating
|
| 365 |
+
356 that networks’ training relies more heavily on higher principal components early on. A causal link
|
| 366 |
+
357 between the $P C$ -bias and the LOC-effect is demonstrated, as the $L O C .$ -effect diminishes when the
|
| 367 |
+
358 PC-bias is eliminated by whitening the images. We analyze these findings in view of a related
|
| 368 |
+
359 phenomenon termed spectral bias. While the $P C$ -bias may be more prominent early on, the spectral
|
| 369 |
+
360 bias may be more important in later stages of learning.
|
| 370 |
+
|
| 371 |
+
References
|
| 372 |
+
Allen-Zhu, Z., Li, Y., and Liang, Y. Learning and generalization in overparameterized neural networks, going beyond two layers. arXiv preprint arXiv:1811.04918, 2018.
|
| 373 |
+
Arora, S., Cohen, N., and Hazan, E. On the optimization of deep networks: Implicit acceleration by overparameterization. In International Conference on Machine Learning, pp. 244–253, 2018.
|
| 374 |
+
Arora, S., Du, S., Hu, W., Li, Z., and Wang, R. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pp. 322–332, 2019.
|
| 375 |
+
Basri, R., Jacobs, D. W., Kasten, Y., and Kritchman, S. The convergence rate of neural networks for learned functions of different frequencies. In Advances in Neural Information Processing Systems, pp. 4761–4771, 2019.
|
| 376 |
+
Basri, R., Galun, M., Geifman, A., Jacobs, D., Kasten, Y., and Kritchman, S. Frequency bias in neural networks for input of non-uniform density. In International Conference on Machine Learning, pp. 685–694. PMLR, 2020.
|
| 377 |
+
Cao, Y., Fang, Z., Wu, Y., Zhou, D.-X., and Gu, Q. Towards understanding the spectral bias of deep learning. arXiv preprint arXiv:1912.01198, 2019.
|
| 378 |
+
Dingle, K., Camargo, C. Q., and Louis, A. A. Input–output maps are strongly biased towards simple outputs. Nature communications, 9(1):1–7, 2018.
|
| 379 |
+
Fukumizu, K. Effect of batch learning in multilayer neural networks. Gen, 1(04):1E–03, 1998.
|
| 380 |
+
Gissin, D., Shalev-Shwartz, S., and Daniely, A. The implicit bias of depth: How incremental learning drives generalization. arXiv preprint arXiv:1909.12051, 2019.
|
| 381 |
+
Glorot, X. and Bengio, Y. 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.
|
| 382 |
+
Gunasekar, S., Lee, J., Soudry, D., and Srebro, N. Implicit bias of gradient descent on linear convolutional networks. arXiv preprint arXiv:1806.00468, 2018.
|
| 383 |
+
Hacohen, G., Choshen, L., and Weinshall, D. Let’s agree to agree: Neural networks share classification order on real datasets. In International Conference on Machine Learning, pp. 3950–3960. PMLR, 2020.
|
| 384 |
+
He, K., Zhang, X., Ren, S., and Sun, J. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), December 2015.
|
| 385 |
+
Heckel, R. and Soltanolkotabi, M. Denoising and regularization via exploiting the structural bias of convolutional generators. arXiv preprint arXiv:1910.14634, 2019.
|
| 386 |
+
Hu, W., Xiao, L., Adlam, B., and Pennington, J. The surprising simplicity of the early-time learning dynamics of neural networks. arXiv preprint arXiv:2006.14599, 2020.
|
| 387 |
+
Jacot, A., Gabriel, F., and Hongler, C. Neural tangent kernel: Convergence and generalization in neural networks, 2020.
|
| 388 |
+
Krueger, D., Ballas, N., Jastrzebski, S., Arpit, D., Kanwal, M. S., Maharaj, T., Bengio, E., Fischer, A., and Courville, A. Deep nets don’t learn via memorization. 2017.
|
| 389 |
+
Le Cun, Y., Kanter, I., and Solla, A. S. Second order properties of error surfaces learning time and generalization. Advances in neural information processing systems, 3:918–924, 1991.
|
| 390 |
+
Li, M., Soltanolkotabi, M., and Oymak, S. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International Conference on Artificial Intelligence and Statistics, pp. 4313–4324. PMLR, 2020.
|
| 391 |
+
|
| 392 |
+
406 Nakkiran, P., Kaplun, G., Kalimeris, D., Yang, T., Edelman, B. L., Zhang, F., and Barak, B. Sgd
|
| 393 |
+
407 on neural networks learns functions of increasing complexity. arXiv preprint arXiv:1905.11604,
|
| 394 |
+
408 2019.
|
| 395 |
+
409 Pliushch, I., Mundt, M., Lupp, N., and Ramesh, V. When deep classifiers agree: Analyzing
|
| 396 |
+
410 correlations between learning order and image statistics. arXiv preprint arXiv:2105.08997, 2021.
|
| 397 |
+
411 Rahaman, N., Baratin, A., Arpit, D., Draxler, F., Lin, M., Hamprecht, F., Bengio, Y., and Courville,
|
| 398 |
+
412 A. On the spectral bias of neural networks. In International Conference on Machine Learning, pp.
|
| 399 |
+
413 5301–5310. PMLR, 2019.
|
| 400 |
+
414 Saxe, A. M., McClelland, J. L., and Ganguli, S. Exact solutions to the nonlinear dynamics of learning
|
| 401 |
+
415 in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
|
| 402 |
+
416 Saxe, A. M., McClelland, J. L., and Ganguli, S. A mathematical theory of semantic development in
|
| 403 |
+
417 deep neural networks. Proceedings of the National Academy of Sciences, 116(23):11537–11546,
|
| 404 |
+
418 2019.
|
| 405 |
+
419 Shah, H., Tamuly, K., Raghunathan, A., Jain, P., and Netrapalli, P. The pitfalls of simplicity bias in
|
| 406 |
+
420 neural networks. arXiv preprint arXiv:2006.07710, 2020.
|
| 407 |
+
421 Simoncelli, E. P. and Olshausen, B. A. Natural image statistics and neural representation. Annual
|
| 408 |
+
422 review of neuroscience, 24(1):1193–1216, 2001.
|
| 409 |
+
423 Soudry, D., Hoffer, E., Nacson, M. S., Gunasekar, S., and Srebro, N. The implicit bias of gradient
|
| 410 |
+
424 descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878, 2018.
|
| 411 |
+
425 Torralba, A. and Oliva, A. Statistics of natural image categories. Network: computation in neural
|
| 412 |
+
426 systems, 14(3):391–412, 2003.
|
| 413 |
+
427 Ulyanov, D., Vedaldi, A., and Lempitsky, V. Deep image prior. In Proceedings of the IEEE conference
|
| 414 |
+
428 on computer vision and pattern recognition, pp. 9446–9454, 2018.
|
| 415 |
+
429 Valle-Perez, G., Camargo, C. Q., and Louis, A. A. Deep learning generalizes because the parameter
|
| 416 |
+
430 function map is biased towards simple functions. arXiv preprint arXiv:1805.08522, 2018.
|
| 417 |
+
431 Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. Understanding deep learning requires
|
| 418 |
+
432 rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 419 |
+
|
| 420 |
+
1. For all authors...
|
| 421 |
+
|
| 422 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 423 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 424 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 425 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 426 |
+
|
| 427 |
+
2. If you are including theoretical results...
|
| 428 |
+
|
| 429 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See the "Assumptions" paragraph as Section 2
|
| 430 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Each theorem reference to its proof. Proofs can be found in Suppl. $\ S \mathrm { A , B }$
|
| 431 |
+
|
| 432 |
+
3. If you ran experiments...
|
| 433 |
+
|
| 434 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] All data, instructions and hyper-parameters are explictly written in the main paper and/or in the Suppl. (see $\ S _ { \mathrm { D } . 4 , \mathrm { D } . 4 ) }$ . The code itself will be provided once the anonymity will be lifted.
|
| 435 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 436 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 437 |
+
(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)? [N/A]
|
| 438 |
+
|
| 439 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 440 |
+
|
| 441 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 442 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 443 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 444 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 445 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 446 |
+
|
| 447 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 448 |
+
|
| 449 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 450 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 451 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/cLYyCXHU7g1n/cLYyCXHU7g1n.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Episodic Multi-agent Reinforcement Learning with Curiosity-driven Exploration
|
| 2 |
+
|
| 3 |
+
Lulu Zheng∗1, Jiarui Chen∗2 3, Jianhao Wang1, Jiamin $\mathbf { H e ^ { 4 \dagger } }$ , $\mathbf { Y u j i n g \ : H u ^ { 3 } }$ , Yingfeng Chen3, Changjie $\mathbf { F a n ^ { 3 } }$ , Yang $\mathbf { G a o ^ { 2 } }$ , Chongjie Zhang1
|
| 4 |
+
|
| 5 |
+
1Institute for Interdisciplinary Information Sciences, Tsinghua University, China
|
| 6 |
+
2Department of Computer Science and Technology, Nanjing University, China 3Fuxi AI Lab, NetEase, China 4Department of Computing Science, University of Alberta, Canada zll19@mails.tsinghua.edu.cn chenjiarui@smail.nju.edu.cn wjh19@mails.tsinghua.edu.cn jiamin12@ualberta.ca {huyujing, chenyingfeng01, fanchangjie}@corp.netease.com gaoy@nju.edu.cn chongjie@tsinghua.edu.cn
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Efficient exploration in deep cooperative multi-agent reinforcement learning (MARL) still remains challenging in complex coordination problems. In this paper, we introduce a novel Episodic Multi-agent reinforcement learning with Curiosity-driven exploration, called EMC. We leverage an insight of popular factorized MARL algorithms that the “induced" individual Q-values, i.e., the individual utility functions used for local execution, are the embeddings of local actionobservation histories, and can capture the interaction between agents due to reward backpropagation during centralized training. Therefore, we use prediction errors of individual Q-values as intrinsic rewards for coordinated exploration and utilize episodic memory to exploit explored informative experience to boost policy training. As the dynamics of an agent’s individual Q-value function captures the novelty of states and the influence from other agents, our intrinsic reward can induce coordinated exploration to new or promising states. We illustrate the advantages of our method by didactic examples, and demonstrate its significant outperformance over state-of-the-art MARL baselines on challenging tasks in the StarCraft II micromanagement benchmark.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Cooperative multi-agent reinforcement learning (MARL) has great promise to solve many real-world multi-agent problems, such as autonomous cars [1] and robots [2]. These complex applications post two major challenges for cooperative MARL: scalability, i.e., the joint-action space exponentially grows as the number of agents increases, and partial observability, which requires agents to make decentralized decisions based on their local action-observation histories due to communication constraints. Luckily, a popular MARL paradigm, called centralized training with decentralized execution (CTDE) [3], is adopted to deal with these challenges. With this paradigm, agents’ policies are trained with access to global information in a centralized way and executed only based on local histories in a decentralized way. Based on the paradigm of CTDE, many deep MARL methods have been proposed, including VDN [4], QMIX [5], QTRAN [6], and QPLEX [7].
|
| 15 |
+
|
| 16 |
+
A core idea of these approaches is to use value factorization, which uses neural networks to represent the joint state-action value as a function of individual utility functions, which can be referred to individial $Q$ -values for terminological simplicity. For example, VDN learns a centralized but factorizable joint value function $Q _ { t o t }$ represented as the summation of individual value function $Q _ { i }$ . During execution, the decentralized policies can be easily derived for each agent $i$ by greedily selecting actions with respect to its local value function $Q _ { i }$ . By utilizing this factorization structure, an implicit multi-agent credit assignment is realized because $Q _ { i }$ is represented as a latent embedding and is learned by neural network backpropagation from the total temporal-difference error on the single global reward signal, rather than on a local reward signal specific to agent $i$ . This value factorization technique enables value-based MARL approaches, such as QMIX and QPLEX, to achieve state-ofthe-art performance in challenging tasks such as the StarCraft unit micromanagement [8].
|
| 17 |
+
|
| 18 |
+
Despite the current success, since only using simple $\epsilon$ -greedy exploration strategy, these deep MARL approaches are found ineffective to solve complex coordination tasks that require coordinated and efficient exploration [7]. Exploration has been extensively studied in single-agent reinforcement learning and many advanced methods have been proposed, including pseudo-counts [9, 10], curiosity [11, 12], and information gain [13]. However, these methods cannot be adopted into MARL directly, due to the exponentially growing state space and partial observability, leaving multi-agent exploration challenging. Recently, only a few works have tried to address this problem. For instance, EDTI [14] uses influence-based methods to quantify the value of agents’ interactions and coordinate exploration towards high-value interactions. This approach empirically shows promising results but, because of the need to explicitly estimate the influence among agents, it is not scalable when the number of agents increases. Another method, called MAVEN [15], introduces a hierarchical control method with a shared latent variable encouraging committed, temporally extended exploration. However, since the latent variable still needs to explore in the space of joint behaviours [15], it is not efficient in complex tasks with large state spaces.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a novel multi-agent curiosity-driven exploration method. Curiosity is a type of intrinsic motivation for exploration, which usually uses prediction errors on different spaces (e.g., future observations [12], actions [11], or learnable representation [16]) as a reward signal. Recently, curiosity-driven methods have achieved significant success in single-agent reinforcement learning [12, 17, 18]. However, curiosity-driven methods face a critical challenge in MARL: in which space should we define curiosity? The straightforward method is to measure curiosity on the global observation [12] or joint histories in a centralized way. However, it is inefficient to find structured interaction between agents, which seems too sparse compared with the exponentially growing state space when the number of agents increases. In contrast, if curiosity is defined as the novelty of local observation histories during the decentralized execution, although scalable, it still fails to guide agents to coordinate due to partial observability. Therefore, we find a middle point of centralized curiosity and decentralized curiosity, i.e., utilizing the value factorization of the state-of-the-art multi-agent Q-learning approaches and defining the prediction errors of individual Q-value functions as intrinsic rewards.
|
| 21 |
+
|
| 22 |
+
The significance of this intrinsic reward is twofold: 1) it provides a novelty measure of joint observation histories with scalability because individual Q-values are latent embeddings (i.e., an effective state abstraction [19]) of observation histories in factorized multi-agent Q-learning (e.g., VDN or QPLEX); and 2) as shown in Figure 1, it captures the influence from other agents due to the implicit credit assignment from global reward signal during centralized training [20], and biases exploration into promising
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: CTDE Framework
|
| 26 |
+
|
| 27 |
+
states where strong interdependence may lie between agents. Therefore, with this novel intrinsic reward, our curiosity-driven method enables efficient, diverse, and coordinated exploration for deep multi-agent Q-learning with value factorization.
|
| 28 |
+
|
| 29 |
+
Besides efficient exploration, another challenge for deep MARL approaches is how to make the best use of experiences collected by the exploration strategy. Prioritized experience replay based on TD errors shows effectiveness in single-agent deep reinforcement learning. However, it does not carry this promise in factorized multi-agent Q-learning, since the projection error induced by value factorization is also fused into the TD error and severally degrades the effectiveness of the TD error as a measure of the usefulness of experiences. To efficiently use promising exploratory experience trajectories, we augment factorized multi-agent reinforcement learning with episodic memory [21, 22]. This memory stores and regularly updates the best returns for explored states. We use the results in the episodic memory to regularize the TD loss, which allows fast latching onto past successful experience trajectories collected by curiosity-driven exploration and greatly improves learning efficiency. Therefore, we call our method Episodic Multi-agent reinforcement learning with Curiosity-driven exploration, called EMC.
|
| 30 |
+
|
| 31 |
+
We evaluate EMC in didactic examples, and a broad set of StarCraft II micromanagement benchmark tasks [8]. The didactic examples along with detailed visualization illustrate that our proposed intrinsic reward can guide agents’ policies to novel or promising states, thus enabling effectively coordinated exploration. Empirical results on more complicated StarCraft II tasks show that EMC significantly outperforms other multi-agent state-of-the-art baselines.
|
| 32 |
+
|
| 33 |
+
# 2 Background
|
| 34 |
+
|
| 35 |
+
# 2.1 Dec-POMDP
|
| 36 |
+
|
| 37 |
+
A cooperative multi-agent task can be modelled as a Dec-POMDP [23], which is defined by a tuple $G = < \mathcal { T } , \mathcal { S } , \mathcal { A } , P , R , \Omega , O , n , \gamma >$ , where $\mathcal { T }$ is the sets of $n$ agents, $s$ is the global state space, $\mathcal { A }$ is the finite action set, $\gamma \in [ 0 , 1 )$ is the discount factor. We consider a partially observable setting in a Dec-POMDP, i.e., at each timestep, agent $i \in \mathcal { T }$ only has access to the observation $o _ { i } \in \varOmega$ drawn from the observation function $O ( s , i )$ . Besides, each agent has an action-observation history $\tau _ { i } \in \mathcal { T } \equiv \left( \varOmega \times \mathcal { A } \right) ^ { * } \times \varOmega$ and constructs its individual policy to jointly maximize team performance. With each agent $i$ selecting an action $a _ { i } \in { \mathcal { A } }$ , the joint action $\mathbf { \bar { a } } \equiv [ a _ { i } ] _ { i = 1 } ^ { n } \in \mathcal { A } \equiv \mathcal { A } ^ { N }$ leads to a shared reward $r = R ( s , { \pmb a } )$ and the next state $s ^ { \prime }$ according to the transition distribution $P ( s ^ { \prime } | s , \pmb { a } )$ . The formal objective function is to find a joint policy $\pi$ that maximizes a joint value function $V ^ { \pi } ( s ) =$ $\mathbb { E } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \big | s = s _ { 0 } , \pi ]$ , or a joint action-value function $Q ^ { \pi } ( s , \pmb { a } ) = r \overline { { } } ( s , \pmb { a } ) + \gamma \mathbb { E } _ { s ^ { \prime } } [ V ^ { \pmb { \pi } } ( s ^ { \prime } ) ]$ .
|
| 38 |
+
|
| 39 |
+
# 2.2 Centralized Training With Decentralized Execution (CTDE)
|
| 40 |
+
|
| 41 |
+
CTDE is a promising paradigm in deep cooperative multi-agent reinforcement learning [3, 23, 24], where the local agents execute actions only based on local observation histories, while the policies can be trained in centralized manager which has access to global information. During the training process, the whole team cooperate to find the optimal joint action-value function $Q _ { t o t } ^ { * } ( s , \pmb { a } ) =$ $\grave { r } ( s , \pmb { a } ) + \gamma \mathbb { E } _ { s ^ { \prime } } [ \operatorname* { m a x } _ { \pmb { a } ^ { \prime } } Q _ { t o t } ^ { * } ( s ^ { \bar { \prime } } , \pmb { a } ^ { \prime } ) ]$ . Due to partial observability, we use $Q _ { t o t } ( \tau , a ; \theta )$ instead of $Q _ { t o t } ( s , \pmb { a } ; \pmb { \theta } )$ , where $\pmb { \tau } \in \mathcal { T } \equiv \mathcal { T } ^ { N }$ . Then the Q-value neural network will be trained to minimize the following expected TD-error:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { \mathcal { L } ( \pmb { \theta } ) = \mathbb { E } _ { \tau , a , r , \tau ^ { \prime } \in D } \left[ r + \gamma V ( \pmb { \tau ^ { \prime } } ; \pmb { \theta } ^ { - } ) - Q _ { t o t } ( \pmb { \tau } , \pmb { a } ; \pmb { \theta } ) \right] ^ { 2 } , } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $D$ is the replay buffer and $\pmb { \theta } ^ { - }$ denotes the parameters of the target network, which is periodically updated by $\pmb \theta$ . And $\operatorname { V } ( \tau ^ { \prime } ; \theta ^ { - } )$ is the one-step expected future return of the TD target. Local agents can only obtain local action-observation history and need inference based on individual Q-value functions $Q _ { i } ( \tau _ { i } , a _ { i } )$ . Therefore, many works have made efforts in finding the factorization structures between joint Q-value functions $Q _ { t o t }$ and individual Q-functions $Q _ { i } ( \tau _ { i } , a _ { i } )$ [4, 5, 7].
|
| 48 |
+
|
| 49 |
+
# 3 Related Work
|
| 50 |
+
|
| 51 |
+
Curiosity-driven Exploration Curiosity-driven exploration has been well studied in single-agent reinforcement learning. Previous literature [25, 26] has provided a good summary in this topic. Recently, curiosity-driven methods have made great progress in deep reinforcement learning. For example, some works use pseudo-state counts to get intrinsic rewards [9, 10, 27] instead of countbased methods to get better scalability. Stadie et al. [28] use prediction errors in the feature space of an auto-encoder to measure the novelty of states and encourage exploration. On the other hand, Mohamed and Rezende [29] propose to use empowerment, measured by the information gain based on the entropy of actions, as intrinsic rewards for exploring novel states efficiently. Another informationbased method [13] tries to maximize information gain about the agent’s belief of the environment’s dynamics as an exploration strategy. ICM [11] learns an inverse model which predicts the agent’s action given its current and next states and tries to predict the next state in the learned hidden space by current state and action. RND [12] uses curiosity as intrinsic rewards in a simpler but effective way, which uses a fixed randomly initialized neural network as a representation network and directly predicts the embedding of the next state. Different from these methods, we are the first to propose an advanced curiosity-driven exploration method in MARL setting for diverse and coordinated exploration.
|
| 52 |
+
|
| 53 |
+
Multi-agent Exploration Although single-agent exploration is extensively studied and has achieved considerable success, few exploration methods were designed for cooperative MARL. Bargiacchiet al. [30] proposes an exploration method that can only be used in repeated single-stage problems. Jaques et al. [31] defines intrinsic reward by “social influence” to encourage agents to choose actions that can influence other agents’ actions. Iqbal and Sha [32] uses various simple exploration methods to learn simultaneously and then put the samples of every method in a shared buffer to achieve the coordinated exploration. Wang et al. [14] use mutual information (MI) to capture the interdependence of the rewards and transitions between agents. MAVEN [15] is the state-of-the-art exploration method in MARL that uses a hierarchical policy to produce a shared latent variable and learns several state-action value functions for each agent. These works, although important, still face the challenge of achieving scalable and effective multi-agent exploration.
|
| 54 |
+
|
| 55 |
+
Episodic Control Our work is also related to episodic control reinforcement learning, which is usually adopted in single-agent settings for better sample efficiency. Previous works propose to use episodic memory in near-deterministic environment [33–36]. Model-free episodic control [34] uses a completely non-parametric table to keep the best Q-values of state-action pair in a tabular-based memory and uses a $\mathbf { k }$ -nearest-neighbors fashion to find the sequence of actions that so far yielded the highest return from a given start state in the memory. Recently, several extensions have been proposed to integrate episodic control with parametric DQN. Gershman and Daw [37] uses episodic memory to retrieve samples and then average future returns to approximate the action values. EMDQN [21] uses a fixed random matrix as a representation function and uses the projection of states as keys to store the information of episodic memory into a non-parametric model. Using the episodic-memory based target as a regularization term to guide the training process, the performance of EMDQN is significantly improved compared with the original DQN. Despite the fruitful progress made in single-agent episodic reinforcement learning, few works study episodic control in a multi-agent setting. To the best of our knowledge, we are the first to utilize the mechanism of episodic control in deep multi-agent reinforcement learning.
|
| 56 |
+
|
| 57 |
+
# 4 Episodic Multi-agent Reinforcement Learning with Curiosity-Driven Exploration
|
| 58 |
+
|
| 59 |
+
In this section, we introduce EMC, a novel episodic multi-agent exploration framework. EMC takes prediction errors of individual Q-value functions as intrinsic rewards for guiding the diverse and coordinated exploration. After collecting informative experience, we leverage an episodic memory to memorize the highly rewarding sequences and use it as the reference of a one-step TD target to boost multi-agent Q-learning. First, we analyze the motivations for predicting individual Q-values, then we introduce the curiosity module for exploration. Finally, we describe how to utilize episodic memory to boost training.
|
| 60 |
+
|
| 61 |
+
# 4.1 Curiosity-Driven Exploration by Predicting Individual Q-values
|
| 62 |
+
|
| 63 |
+
As shown in Figure 2, in the paradigm of CDTE, local agents make decisions based on individual Q-value functions, which take local observation histories as inputs, and are updated by the centralized module which has access to global information for training. The key insight is that, different from single-agent cases, individual Q-value functions in MARL are used for both decision-making and embedding historical observations. Furthermore, due to implicit credit assignment by global reward signal during centralized training, individual Q-value functions $Q _ { i } ( \tau _ { i } , \cdot )$ are influenced by environment as well as other agents’ behaviors. More concretely, it has been proved by Wang et al. [20] that, when the joint Q-function Q-functions $Q _ { i }$ , i.e., $\begin{array} { r } { Q _ { t o t } ^ { ( t + 1 ) } ( \pmb { \tau } , \pmb { a } ) = \sum _ { i = 1 } ^ { N } Q _ { i } ^ { ( t + 1 ) } ( \tau _ { i } , a _ { i } ) } \end{array}$ $Q _ { t o t }$ is factorized into linear combination of individual , then $Q _ { i } ^ { ( t + 1 ) } ( \tau _ { i } , a _ { i } )$ has the following closed-form solution:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
Q _ { i } ^ { ( t + 1 ) } ( \tau _ { i } , a _ { i } ) = \underset { ( \tau _ { - i } ^ { \prime } , a _ { - i } ^ { \prime } ) \sim p _ { D } ( \cdot \vert \tau _ { i } ) } { \mathbb { E } } \left[ y ^ { ( t ) } \left( \tau _ { i } \oplus \tau _ { - i } ^ { \prime } , a _ { i } \oplus a _ { - i } ^ { \prime } \right) \right]
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
- \frac { n - 1 } { n } \mathop { \mathbb { E } } _ { \tau ^ { \prime } , a ^ { \prime } \sim p _ { D } ( \cdot | \Lambda ^ { - 1 } ( \tau _ { i } ) ) } \left[ y ^ { ( t ) } \left( \tau ^ { \prime } , a ^ { \prime } \right) \right] + w _ { i } ( \tau _ { i } ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\begin{array} { r } { y ^ { ( t ) } ( \pmb { \tau } , \pmb { a } ) = r + \gamma \mathbb { E } _ { \pmb { \tau } ^ { \prime } } \left[ \operatorname* { m a x } _ { \pmb { a } ^ { \prime } } Q _ { t o t } ^ { ( t ) } \left( \pmb { \tau } ^ { \prime } , \pmb { a } ^ { \prime } \right) \right] } \end{array}$ denotes the expected one-step TD target, and $p _ { D } ( \cdot | \tau _ { i } )$ denotes the conditional empirical probability of $\tau _ { i }$ in the given dataset $D$ . The notation $\tau _ { i } \oplus \tau _ { - i } ^ { \prime }$ denotes $\langle \tau _ { 1 } ^ { \prime } , \dots , \tau _ { i - 1 } ^ { \prime } , \tau _ { i } , \tau _ { i + 1 } ^ { \prime } , \dots , \bar { \tau } _ { n } ^ { \prime } \rangle$ , and $\boldsymbol { \tau } _ { - i } ^ { \prime }$ denotes the elements of all agents except for agent $i$ . $\Lambda ^ { - 1 } ( \tau _ { i } )$ denotes the set of trajectory histories that may share the same latent-state trajectory as $\tau _ { i }$ i . The residue term $\pmb { w } \equiv [ w _ { i } ] _ { i = 1 } ^ { n }$ is an arbitrary function satisfying $\forall \tau \in \mathbf { T }$ , $\scriptstyle \sum _ { i = 1 } ^ { n } w _ { i } ( \tau _ { i } ) = 0$ .
|
| 74 |
+
|
| 75 |
+
Eq. (2) shows that by linear value factorization, the individual Q-value $Q _ { i } ( \tau _ { i } , a _ { i } )$ is not only decided by local observation histories but also influenced by other agents’ action-observation histories. Thus predicting $Q _ { i }$ can capture both the novelty of states and the interaction between agents and lead agents to explore promising states. Motivated by this insight, in this paper, we use a linear value factorization module separate from the inference module to learn the individual value function $Q _ { i }$ , and use the prediction errors of $Q _ { i }$ as intrinsic rewards to guide exploration. In this paper, we define the prediction errors of individual Q-values as curiosity and propose our curiosity-driven exploration module as follows.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 2: An overview of EMC’s framework
|
| 79 |
+
|
| 80 |
+
Figure 2b demonstrates the Curiosity Module, separated from the inference module (Figure 2a). The curiosity module consists of four components: (i) The centralized training part with linear value factorization, which shares the same implementation as VDN [4], but only trained with extrinsic rewards $r ^ { e x t }$ from the environment; (ii) the Target for prediction, i.e., the corresponding individual Q-values ${ Q _ { i } ^ { e x t } }$ , represented by a recurrent Q-network; (iii) Predictor $\widetilde { Q } _ { i } ( \tau _ { i } )$ , which is used for predicting ${ Q _ { i } ^ { e x t } }$ and shares the same network architecture as Target ${ Q _ { i } ^ { e x t } }$ ; and (iv) Distance Function, which measures the distance between ${ Q _ { i } ^ { e x t } }$ and $\widetilde { Q } _ { i }$ , e.g., $L _ { 2 }$ distance. The predictors are trained by minimizing the Mean Squared Error (MSE) of the distance in an end-to-end manner. For stable training, we use the soft-update target [38] of ${ Q _ { i } ^ { e x t } }$ to smooth the outputs of the targets. In general, (ii) is trained with (i) and outputs individual Q-values , while (iii) is trained with (ii) and (iv), and aims to predict the soft-update target of individual Q-values. Motivated by the implicit credit assignment of linear value factorization (Eq. (2)), the curiosity module predicts the individual Q-values $\bar { \big [ Q _ { i } ^ { e x t } \big ] } _ { i = 1 } ^ { n }$ in linear factorization, i.e., $\begin{array} { r } { Q _ { t o t } ^ { e x t } = \sum _ { i = 1 } ^ { N } Q _ { i } ^ { e x t } } \end{array}$ . Then the curiosity-driven intrinsic reward is generated by the following equation:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
r ^ { i n t } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left. \widetilde { Q } _ { i } ( \tau _ { i } , \cdot ) - Q _ { i } ^ { e x t } ( \tau _ { i } , \cdot ) \right. _ { 2 } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
This intrinsic reward is used for the centralized training of the inference module, as shown in Figure 2a:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { i n f e r e n c e } } ( \pmb { \theta } ) = \mathbb { E } _ { \pmb { \tau } , \pmb { a } , \pmb { r } , \pmb { \tau } ^ { \prime } \in D } \left[ \left( \pmb { y } ( \pmb { \tau } , \pmb { a } ) - Q _ { t o t } ( \pmb { \tau } , \pmb { a } ; \pmb { \theta } ) \right) ^ { 2 } \right] , } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where y(τ , $\begin{array} { r } { \mathbf { \Delta } \mathbf { a } ) = r ^ { e x t } + \beta r ^ { i n t } + \gamma \operatorname* { m a x } _ { \mathbf { a } ^ { \prime } } Q _ { t o t } \left( \tau ^ { \prime } , a ^ { \prime } ; \theta ^ { - } \right) ) } \end{array}$ , denoting one step TD target of the inference module, and $\beta$ is the weight term of the intrinsic reward. We use a separate training model for inference (Figure 2a) to avoid the accumulation of projection errors of $Q _ { i }$ during training.
|
| 93 |
+
|
| 94 |
+
The independence of inference module leads to another advantage, that EMC’s architecture can be adopted into many value-factorization-based multi-agent algorithms which utilize the CDTE paradigm, i.e., the general function $f$ in Figure $2 \mathrm { a }$ can indicate specific (linear, monotonic and IGM) value factorization structures in VDN [4], QMIX [5], and QPLEX [7], respectively. In this paper, we utilize these state-of-the-art algorithms for the inference module. With this curiosity-driven bias plugged into ordinary MARL algorithms, EMC will achieve efficient, diverse and coordinated exploration.
|
| 95 |
+
|
| 96 |
+
# 4.2 Episodic Memory
|
| 97 |
+
|
| 98 |
+
Equipped with efficient exploration ability, another challenge is how to make the best use of good trajectories collected by exploration effectively. Recently, episodic control has been widely studied in single-agent reinforcement learning [21, 22], which can replay the highly rewarding sequences, thus boosting training. Inspired by this framework, we generalize single-agent episodic control to propose a multi-agent episodic memory, which records the best memorized Monte-Carlo return in the episode, and provide a memory target $H$ as a reference to regularize the ordinary one-step inference TD target estimation in the inference module (Figure 2a):
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { m e m o r y } } ( \pmb { \theta } ) = \mathbb { E } _ { \pmb { \tau } , \pmb { a } , \pmb { r } , \pmb { \tau } ^ { \prime } \in D } \left[ \left( H - Q _ { t o t } ( \pmb { \tau } , \pmb { a } ; \pmb { \theta } ) \right) ^ { 2 } \right] . } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
However, different from the single-agent episodic control, the action space of MARL exponentially grows as the number of agents increases, and partial observability also limits the information of individual value functions. Thus, we maintain our episodic memory by storing the state-value function on the global state space and utilizing the global information during the centralized training process under the CTDE paradigm. Figure 2d shows the architecture of the Episodic Memory. We keep a memory table $M$ to record the maximum remembered return of the current state, and use a fixed random matrix drawn from Gaussian distribution as a representation function to project states into low-dimensional vectors $\phi ( s ) : S \to \mathbb { R } ^ { k }$ , which are used as keys to look up corresponding global state value function $H ( \phi ( s _ { t } ) )$ . When our exploration method collects a new trajectory, we update our memory table $M$ as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
H ( \phi ( s _ { t } ) ) = \left\{ \begin{array} { l l } { \operatorname* { m a x } \{ H ( \phi ( \hat { s } _ { t } ) ) , R _ { t } ( s _ { t } , \pmb { a } _ { t } ) \} } & { i f \| \phi ( \hat { s } _ { t } ) - \phi ( s _ { t } ) \| _ { 2 } < \delta } \\ { R _ { t } ( s _ { t } , \pmb { a } _ { t } ) } & { o t h e r w i s e } \end{array} \right. ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\phi ( \hat { s } _ { t } )$ is $\phi ( s _ { t } )$ ’s nearest neighbor in the memory $M , \delta$ is a threshold, and $R ( s _ { t } , \pmb { a } _ { t } )$ represents the future return when agents taking joint action $\mathbf { } \mathbf { a } _ { t }$ under global state $s _ { t }$ at the $t$ -th timestep in a new episode. In our implementation, $\phi ( s _ { t } ) \in M$ is indeed evaluated approximately based on the embedding distance. Specifically, when the key of the state $\phi ( s _ { t } )$ is close enough to one key in the memory, we assume that $\dot { \phi } ( s _ { t } ) \in M$ and find the best memorized Monte-Carlo return correspondingly. Otherwise, we think $\phi ( s _ { t } ) \notin M$ and record the state’s return into the memory. Leveraging the episodic memory, we can directly obtain the maximum remembered return of the current state, and use the one-step TD memory target $H$ as a reference to regularize learning:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
H ( \phi ( s _ { t } ) , \pmb { a } _ { t } ) = r _ { t } ( s _ { t } , \pmb { a } _ { t } ) + \gamma H ( \phi ( s _ { t + 1 } ) ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Thus, the new objective function for the inference module is:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { { t o t a l } } } ( \theta ) = \mathcal { L } _ { \mathrm { i n f e r e n c e } } ( \theta ) + \lambda \mathcal { L } _ { \mathrm { m e m o r y } } ( \theta ) } \\ & { \qquad = \mathbb { E } _ { \tau , a , r , \tau ^ { \prime } \in D } \left[ \left( y ( \tau , a ) - Q _ { t o t } ( \tau , a ; \theta ) \right) ^ { 2 } + \lambda \left( H \left( \phi ( s _ { t } ) , a _ { t } \right) - Q _ { t o t } ( \tau , a ; \theta ) \right) ^ { 2 } \right] , } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\lambda$ is the weighting term to balance the effect of episodic memory’s reference. Using the maximum return from the episodic memory to propagate rewards, we can compensate for the disadvantage of slow learning induced by the original one-step reward update and improve sample efficiency.
|
| 123 |
+
|
| 124 |
+
# 5 Experiments
|
| 125 |
+
|
| 126 |
+
In this section, we will conduct a large set of empirical experiments for answering the following questions: (1) Is exploration by predicting individual Q-value functions better than exploration by decentralized curiosity or global curiosity (Section 5.1)? (2) Can our method perform efficient coordinated exploration in challenging multi-agent tasks (Section 5.2-5.3)? (3) If so, what role does each key component play for the superior performance (Section 5.4)? (4) Why do we choose to predict target ${ \dot { Q } } _ { i } ^ { e x t }$ for generating intrinsic rewards rather than other choices (Section 5.4)? We will propose several didactic examples and demonstrate the advantage of our method in coordinated exploration, and evaluate our method on the StarCraft II micromanagement (SMAC) benchmark [8] compared with existing state-of-the-art multi-agent reinforcement learning (MARL) algorithms: QPLEX [7], Weighted-QMIX [39], QTRAN [6], QMIX [5], VDN [4], RODE [40], and MAVEN [15].
|
| 127 |
+
|
| 128 |
+
# 5.1 Didactic Example
|
| 129 |
+
|
| 130 |
+
Figure 3 shows an $1 1 \times 1 2$ grid world game that requires coordinated exploration. The blue agent and the red agent can choose one of the five actions: [up, down, left, right, stay] at each time step. The wall shown in the picture isolates the two agents, and one agent cannot be observed by the other until it gets into the shaded area. The two agents will receive a positive global reward $r = 1 0$ if and only if they arrive at the corresponding goal grid (referred to the character $G$ in Figure 3) at the same time. If only one arrives, the incoordination will be punished by a negative reward $- p$ .
|
| 131 |
+
|
| 132 |
+
To evaluate the effectiveness of our curiosity-driven exploration, we implement our method into QPLEX, QMIX, and VDN (denoted as EMCQPLEX, EMC-QMIX, and EMC-VDN, respectively) and test them in this toy game compared with the state-of-the-art MARL algorithms: VDN, IQL, QMIX, and QPLEX. Moreover, to demonstrate the motivation of predicting individual Q-functions, we add two more baselines: QPLEX with the prediction error of global state as intrinsic rewards (denoted as QPLEX-Global), and QPLEX with the prediction error of local joint histories as intrinsic rewards (denoted as QPLEX-Local). Both of them use a fixed network to project the inputs into latent embedding, then predict the latent embedding to generate intrinsic reward, just like the
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Coordinated Toygame
|
| 136 |
+
|
| 137 |
+
Random Network Distillation (RND) [12]. We test different punishment degrees, i.e., different ps (which are deferred to Appendix C), and the results show QPLEX-Global and QPLEX-Local are effective enough for exploration when $p$ is relatively small. However, as $p$ increases, the task becomes more challenging since it requires sufficient and coordinated exploration. In Figure 4, we show the median test win rate of all methods over 6 random seeds when $p = 2$ , and only our methods can learn the optimal policy and win the game, while other methods failed.
|
| 138 |
+
|
| 139 |
+
To understand this result better, we have made several visualisations to demonstrate our advantage in coordinated exploration. Figure 4 shows the heatmaps of visitation and intrinsic reward by EMC-QPLEX, QPLEX-Global, and QPLEX-Local. During the early stage of training, all methods uniformly explore the whole area (Figure 4a). As the exploration progresses, the global curiosity (QPLEX-Global) encourages agents to visit all configurations without bias, which is inefficient and fail to leverage the potential locality influence between agents (Figure 4b), resulting in extrinsic rewards beginning to dominate the behaviors (Figure 4c). On the other hand, the visitation heatmap of QPLEX-Local shows the decentralized curiosity encourages agents to explore around the goal grid, but it cannot promise to encourage agents to coordinate and gain the reward due to the partial observability in decentralized execution. In contrast, the heatmap of intrinsic reward for EMC-QPLEX shows that predicting individual Q-values will bias exploration into areas where individual Q-values are more dynamic due to the potential correlation between agents. Therefore, QPLEX-Local and QPLEX-Global both fail in this task (Figure 4c), while our methods are able to find the optimal policy. This didactic example shows the global curiosity or local curiosity may fail to handle complex tasks where coordinated exploration needs to be addressed. While since individual Q-values $Q _ { i }$ are the embeddings of historical observations, and are dynamically updated by the backpropagation of the global reward signal gained through cooperation during centralized training. Thus $Q _ { i }$ can implicitly reflect the influence from the environment and other agents, and predicting $Q _ { i }$ can capture valuable and spare interactions among agents and bias exploration into new or promising states.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 4: The heat map of gridworld game.
|
| 143 |
+
|
| 144 |
+
# 5.2 Predator Prey
|
| 145 |
+
|
| 146 |
+
Predator-Prey is a partially-observable multi-agent coordinated game with miscoordination penalties used by WQMIX [39]. As shown in Figure 5, since extensive exploration is needed to jump out of the local optima, WQMIX is the only baseline algorithm to find the optimal policy, due to its shaped data distribution which can be seen as a type of exploration. Other state-of-the-art multiagent Q-learning algorithms, such as QPLEX and QMIX, fail to solve this task. For MAVEN, QPLEC-Global and QPLEX-Local, although equipped with improved exploration ability, they still failed to address coordination due to uniform exploration nature or partial observability. However, plugged with EMC, EMC-VDN, EMC-QMIX, and EMC-QPLEX can guarantee coordinated exploration effectively and achieve good performance.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 5: The performance of Predator Prey.
|
| 150 |
+
|
| 151 |
+
# 5.3 StarCraftII Micromanagement (SMAC) Benchmark
|
| 152 |
+
|
| 153 |
+
StarCraft II Micromanagement (SMAC) is a popular benchmark in MARL [4, 5, 7, 40, 39]. We conduct experiments in 17 benchmark tasks of StarCraft II, which contains 14 popular tasks proposed by SMAC [8] and three more super hard cooperative tasks proposed by QPLEX [7]. In the micromanagement scenarios, each unit is controlled by an independent agent that must act based on its own local observation, and the enemy units are controlled by a built-in AI.
|
| 154 |
+
|
| 155 |
+
For evaluation, we compare EMC with the state-of-theart algorithms: RODE [40], QPLEX [7], MAVEN [15], and the two variants of QMIX [5]: CW-QMIX and OWQMIX [39]. All experimental results are illustrated with the median performance and $2 5 - 7 5 \%$ percentiles. Figure 6 shows the overall performance of the tested algorithms in all these 17 maps. Due to the effective exploration with episodic memory which can efficiently use promising exploratory experience trajectories, EMC is the best performer on up to 6 tasks, underperforms on just three tasks, and ties for the best performer on the rest tasks.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 6: The number of scenarios in which the algorithm’s median test win rate is the highest by as least 1/32.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 7: Results of super hard maps in SMAC.
|
| 162 |
+
|
| 163 |
+
The advantages of our algorithm can be mainly illustrated by the results of the six hard maps which need sufficient exploration shown in Figure 7. The three maps in the first row are super hard, and solving them needs efficient, diverse and coordinated exploration. Thus, we can find that the EMC algorithm significantly outperforms other algorithms in corridor and $3 s 5 z \_ { \nu s \_ 3 s 6 z }$ , and also achieves the best performance (equal to RODE) in $6 h \_ { \nu s \_ } 8 z$ . To the best of our knowledge, this will be the state-of-the-art results in corridor and $3 s 5 z \_ { \nu s \_ 3 s 6 z }$ . For the remaining three maps in the second row $( \ I c 3 s 8 z _ { - } \nu s _ { - } I c 3 s 9 z , 5 s I O z$ , and $7 s 7 z$ ), where other baselines can also find winning strategies, due to the boost learning process via episodic memory along with efficient exploration, our algorithm EMC still performs the best in the three maps, with fastest learning speed and the highest rates achieved.
|
| 164 |
+
|
| 165 |
+
# 5.4 Ablation Study
|
| 166 |
+
|
| 167 |
+
To understand the superior performance of EMC, we carry out ablation studies to test the contribution of its two main components: curiosity module and episodic memory. Following methods are included in the evaluation: (i) EMC without curiosity module (denoted by EMC-wo- $C$ ); (ii) EMC without episodic memory component (denoted by EMC-wo-M); (iii) QPLEX, which can be considered as EMC without the episodic memory component nor the curiosity module, provides a natural ablation baseline of EMC.
|
| 168 |
+
|
| 169 |
+
Figure 8(b-c) shows that in easy exploration maps, both EMC and EMC-wo-C achieve the state-of-theart performance, which implies that in the easy tasks, sufficient exploration can be achieved simply by the popular $\epsilon$ -greedy method. However, in super hard exploration maps (Figure 8 (a)), EMC-wo-C cannot solve this task but EMC has excellent performance. These empirical experiments show that the curiosity module plays a vital role in improving performance when sufficient and coordinated exploration is necessary. On the other hand, making the best use of good trajectories collected by exploration is also essential. As shown Figure 8, EMC with episodic memory enjoys better sample efficiency than EMC-wo-M in challenging (Figure 8a) and easy exploration tasks (Figure 8(b-c)). In general, the curiosity module and the episodic memory complement each other, and efficiently using promising exploratory experience trajectories leads to the superior performance of EMC.
|
| 170 |
+
|
| 171 |
+
Like single-agent curiosity or RND [12] exploration methods, our approach looks simple yet effective.
|
| 172 |
+
In addition, its design choices do not look straightforward before we know how to do it right.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 8: Ablation study on the two major components.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 9: Ablation study on design choice.
|
| 179 |
+
|
| 180 |
+
Therefore we conduct additional ablation studies to demonstrate the effect of our elaborate formulation of curiosity bias. We introduce several baselines and compare them with $\mathrm { E M C } : ( \mathrm { i } )$ using the normalized TD-error of $Q _ { t o t a l }$ as curiosity rewards, denoted as EMC-TD; (ii) using the averaged error between the individual utilities and their targets as intrinsic rewards, denoted as EMC-Ind; (iii) using the TD error of a centralized critic of the controllers which conditions on all agents’ histories and actions, denoted as EMC-Cen; (iv) using the averaged prediction errors of ${ Q _ { i } ^ { e x t ; d e c } }$ which are trained in a decentralized way, denoted as EMC-Dec. We aim to investigate the subtle implementation difference between EMC and EMC-TD as well as EMC-Ind, and compare the exploration efficiency of our method with the global curiosity-driven exploration method (EMC-Cen) and local curiosity-driven exploration method (EMC-Dec) empirically.
|
| 181 |
+
|
| 182 |
+
We design a variant of the toygame mentioned in section 5.1, which has an additional random noisy reward region. By visualizations, we demonstrate that the agents of EMC-TD and EMC-Ind tend to get stuck in the noisy-reward region, thus resulting in sub-optimal policy, while our method show superior ability for avoiding such noise-spike problem. On the other hand, since EMC-Cen is based on global curiosity, which encourages agents to explore the whole state space without bias, it may fail in finding sparse but valuable interaction patterns in the exponentially growing space in complex tasks. When comparing with EMC and EMC-Dec, we find that the key difference is the counterfactual baseline (Eq. (2)), which can theoretically reduce the variance of EMC [41]. Therefore, EMC can focus more on the individual specific contribution and achieve the significant improvements.
|
| 183 |
+
|
| 184 |
+
We test these baselines in SMAC and the results are shown in Figure 9, and our method significantly outperform other baselines. In general, by conducting these ablations, we demonstrate the robustness for noise spikes of our design choice ((i) and (ii)), as well as the efficiency and stability of our method compared with centralized or decentralized curiosity-driven exploration method. More detailed discussions will be deferred to Appendix E.
|
| 185 |
+
|
| 186 |
+
# 6 Conclusions and Future Work
|
| 187 |
+
|
| 188 |
+
This paper introduces EMC, a novel episodic multi-agent reinforcement learning algorithm with a curiosity-driven exploration framework that allows for efficient coordinated exploration and boosted policy training by exploiting explored informative experiences. Based on the effective exploration ability, our method shows significant outperformance over state-of-the-art MARL baselines on challenging tasks in the StarCraft II micromanagement benchmark. The limitation of our work lies in the lack of adaptive exploration methods to ensure robustness. Besides, the episodic memory may get problems in stochastic settings. For future work, we may conduct further research in these directions.
|
| 189 |
+
|
| 190 |
+
# Acknowledgments and Disclosure of Funding
|
| 191 |
+
|
| 192 |
+
We would like to thank the anonymous reviewers for their valuable comments and helpful suggestions. This work is supported in part by Science and Technology Innovation 2030 – “New Generation Artificial Intelligence” Major Project (No. 2018AAA0100900), a grant from the Institute of Guo Qiang, Tsinghua University, and a grant from Turing AI Institute of Nanjing.
|
| 193 |
+
|
| 194 |
+
# References
|
| 195 |
+
|
| 196 |
+
[1] Yongcan Cao, Wenwu Yu, Wei Ren, and Guanrong Chen. An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics, 9(1):427–438, 2012.
|
| 197 |
+
[2] Maximilian Hüttenrauch, Adrian Šošic, and Gerhard Neumann. Guided deep reinforcement ´ learning for swarm systems. arXiv preprint arXiv:1709.06011, 2017.
|
| 198 |
+
[3] Daniel S Bernstein, Robert Givan, Neil Immerman, and Shlomo Zilberstein. The complexity of decentralized control of markov decision processes. Mathematics of operations research, 27(4):819–840, 2002.
|
| 199 |
+
[4] Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinícius Flores Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning based on team reward. In AAMAS, pages 2085–2087, 2018.
|
| 200 |
+
[5] Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pages 4295–4304, 2018.
|
| 201 |
+
[6] Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. arXiv preprint arXiv:1905.05408, 2019.
|
| 202 |
+
[7] Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. Qplex: Duplex dueling multi-agent q-learning. arXiv preprint arXiv:2008.01062, 2020.
|
| 203 |
+
[8] Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pages 2186–2188, 2019.
|
| 204 |
+
[9] 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, pages 1471–1479, 2016.
|
| 205 |
+
[10] Georg Ostrovski, Marc G Bellemare, Aäron Oord, and Rémi Munos. Count-based exploration with neural density models. In International Conference on Machine Learning, pages 2721– 2730, 2017.
|
| 206 |
+
[11] Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning, 2017.
|
| 207 |
+
[12] Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
|
| 208 |
+
[13] Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pages 1109–1117, 2016.
|
| 209 |
+
[14] Tonghan Wang, Jianhao Wang, Yi Wu, and Chongjie Zhang. Influence-based multi-agent exploration. In International Conference on Learning Representations, 2019.
|
| 210 |
+
|
| 211 |
+
[15] Anuj Mahajan, Tabish Rashid, Mikayel Samvelyan, and Shimon Whiteson. Maven: Multiagent variational exploration. In Advances in Neural Information Processing Systems, pages 7613–7624, 2019.
|
| 212 |
+
|
| 213 |
+
[16] Hyoungseok Kim, Jaekyeom Kim, Yeonwoo Jeong, Sergey Levine, and Hyun Oh Song. Emi: Exploration with mutual information. arXiv preprint arXiv:1810.01176, 2018.
|
| 214 |
+
|
| 215 |
+
[17] Adrià Puigdomènech Badia, Pablo Sprechmann, Alex Vitvitskyi, Daniel Guo, Bilal Piot, Steven Kapturowski, Olivier Tieleman, Martin Arjovsky, Alexander Pritzel, Andrew Bolt, et al. Never give up: Learning directed exploration strategies. In International Conference on Learning Representations, 2019.
|
| 216 |
+
|
| 217 |
+
[18] Adrià Puigdomènech Badia, Bilal Piot, Steven Kapturowski, Pablo Sprechmann, Alex Vitvitskyi, Zhaohan Daniel Guo, and Charles Blundell. Agent57: Outperforming the atari human benchmark. In International Conference on Machine Learning, pages 507–517. PMLR, 2020.
|
| 218 |
+
|
| 219 |
+
[19] Lihong Li, Thomas J Walsh, and Michael L Littman. Towards a unified theory of state abstraction for mdps. ISAIM, 4:5, 2006.
|
| 220 |
+
|
| 221 |
+
[20] Jianhao Wang, Zhizhou Ren, Beining Han, Jianing Ye, and Chongjie Zhang. Towards understanding linear value decomposition in cooperative multi-agent q-learning. arXiv preprint arXiv:2006.00587, 2020.
|
| 222 |
+
|
| 223 |
+
[21] Zichuan Lin, Tianqi Zhao, Guangwen Yang, and Lintao Zhang. Episodic memory deep qnetworks. In IJCAI, 2018.
|
| 224 |
+
|
| 225 |
+
[22] Guangxiang Zhu, Zichuan Lin, Guangwen Yang, and Chongjie Zhang. Episodic reinforcement learning with associative memory. In International Conference on Learning Representations, 2019.
|
| 226 |
+
|
| 227 |
+
[23] Frans A Oliehoek, Christopher Amato, et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 2016.
|
| 228 |
+
|
| 229 |
+
[24] Frans A Oliehoek, Matthijs TJ Spaan, and Nikos Vlassis. Optimal and approximate q-value functions for decentralized pomdps. Journal of Artificial Intelligence Research, 32:289–353, 2008.
|
| 230 |
+
|
| 231 |
+
[25] Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265– 286, 2007.
|
| 232 |
+
|
| 233 |
+
[26] Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? a typology of computational approaches. Frontiers in neurorobotics, 1:6, 2009.
|
| 234 |
+
|
| 235 |
+
[27] Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, OpenAI Xi Chen, Yan Duan, John Schulman, Filip DeTurck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. In Advances in neural information processing systems, pages 2753–2762, 2017.
|
| 236 |
+
|
| 237 |
+
[28] Bradly C Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015.
|
| 238 |
+
|
| 239 |
+
[29] Shakir Mohamed and Danilo J Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 2125–2133, 2015.
|
| 240 |
+
|
| 241 |
+
[30] Eugenio Bargiacchi, Timothy Verstraeten, Diederik Roijers, Ann Nowé, and Hado Hasselt. Learning to coordinate with coordination graphs in repeated single-stage multi-agent decision problems. In International conference on machine learning, pages 482–490, 2018.
|
| 242 |
+
|
| 243 |
+
[31] Natasha Jaques, Angeliki Lazaridou, Edward Hughes, Caglar Gulcehre, Pedro Ortega, DJ Strouse, Joel Z Leibo, and Nando De Freitas. Social influence as intrinsic motivation for multi-agent deep reinforcement learning. In International Conference on Machine Learning, pages 3040–3049. PMLR, 2019.
|
| 244 |
+
|
| 245 |
+
[32] Shariq Iqbal and Fei Sha. Coordinated exploration via intrinsic rewards for multi-agent reinforcement learning. arXiv preprint arXiv:1905.12127, 2019.
|
| 246 |
+
|
| 247 |
+
[33] M Lengyel and P Dayan. Hippocampal contributions to control: The third way. In Twenty-First Annual Conference on Neural Information Processing Systems (NIPS 2007), pages 889–896. Curran, 2008.
|
| 248 |
+
|
| 249 |
+
[34] Charles Blundell, Benigno Uria, Alexander Pritzel, Yazhe Li, Avraham Ruderman, Joel Z Leibo, Jack Rae, Daan Wierstra, and Demis Hassabis. Model-free episodic control. arXiv preprint arXiv:1606.04460, 2016.
|
| 250 |
+
|
| 251 |
+
[35] Alexander Pritzel, Benigno Uria, Sriram Srinivasan, Adria Puigdomenech Badia, Oriol Vinyals, Demis Hassabis, Daan Wierstra, and Charles Blundell. Neural episodic control. In International Conference on Machine Learning, pages 2827–2836. PMLR, 2017.
|
| 252 |
+
|
| 253 |
+
[36] Steven S Hansen, Pablo Sprechmann, Alexander Pritzel, André Barreto, and Charles Blundell. Fast deep reinforcement learning using online adjustments from the past. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 10590–10600, 2018.
|
| 254 |
+
|
| 255 |
+
[37] Samuel J Gershman and Nathaniel D Daw. Reinforcement learning and episodic memory in humans and animals: an integrative framework. Annual review of psychology, 68:101–128, 2017.
|
| 256 |
+
|
| 257 |
+
[38] 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.
|
| 258 |
+
|
| 259 |
+
[39] Tabish Rashid, Gregory Farquhar, Bei Peng, and Shimon Whiteson. Weighted QMIX: expanding monotonic value function factorisation for deep multi-agent reinforcement learning. In Proceedings of the Annual Conference on Neural Information Processing Systems 2020 (NeurIPS 2020), 2020.
|
| 260 |
+
|
| 261 |
+
[40] Tonghan Wang, Tarun Gupta, Anuj Mahajan, Bei Peng, Shimon Whiteson, and Chongjie Zhang. Rode: Learning roles to decompose multi-agent tasks. arXiv preprint arXiv:2010.01523, 2020.
|
| 262 |
+
|
| 263 |
+
[41] Yihan Wang, Beining Han, Tonghan Wang, Heng Dong, and Chongjie Zhang. Dop: Offpolicy multi-agent decomposed policy gradients. In International Conference on Learning Representations, 2020.
|
| 264 |
+
|
| 265 |
+
[42] Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018.
|
| 266 |
+
|
| 267 |
+
[43] Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018.
|
| 268 |
+
|
| 269 |
+
[44] Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 270 |
+
|
| 271 |
+
[45] Matteo Hessel, Joseph Modayil, Hado Van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In Thirty-second AAAI conference on artificial intelligence, 2018.
|
md/train/d0MtHWY0NZ/d0MtHWY0NZ.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 |
+

|
| 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 |
+

|
| 175 |
+
Figure 2: Neighborhood composition
|
| 176 |
+
|
| 177 |
+

|
| 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>>4E5</td></tr><tr><td>SGC</td><td>0.6329±0.0019</td><td>0.6648±0.0020</td><td>>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/d7KBjmI3GmQ/d7KBjmI3GmQ.md
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MEASURING MASSIVE MULTITASK LANGUAGE UNDERSTANDING
|
| 2 |
+
|
| 3 |
+
Dan Hendrycks UC Berkeley
|
| 4 |
+
|
| 5 |
+
Collin Burns Columbia University
|
| 6 |
+
|
| 7 |
+
Steven Basart UChicago
|
| 8 |
+
|
| 9 |
+
Andy Zou UC Berkeley
|
| 10 |
+
|
| 11 |
+
Mantas Mazeika UIUC
|
| 12 |
+
|
| 13 |
+
Dawn Song UC Berkeley
|
| 14 |
+
|
| 15 |
+
Jacob Steinhardt UC Berkeley
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
We propose a new test to measure a text model’s multitask accuracy. The test covers 57 tasks including elementary mathematics, US history, computer science, law, and more. To attain high accuracy on this test, models must possess extensive world knowledge and problem solving ability. We find that while most recent models have near random-chance accuracy, the very largest GPT-3 model improves over random chance by almost 20 percentage points on average. However, on every one of the 57 tasks, the best models still need substantial improvements before they can reach expert-level accuracy. Models also have lopsided performance and frequently do not know when they are wrong. Worse, they still have nearrandom accuracy on some socially important subjects such as morality and law. By comprehensively evaluating the breadth and depth of a model’s academic and professional understanding, our test can be used to analyze models across many tasks and to identify important shortcomings.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
Natural Language Processing (NLP) models have achieved superhuman performance on a number of recently proposed benchmarks. However, these models are still well below human level performance for language understanding as a whole, suggesting a disconnect between our benchmarks and the actual capabilities of these models. The General Language Understanding Evaluation benchmark (GLUE) (Wang et al., 2018) was introduced in 2018 to evaluate performance on a wide range of NLP tasks, and top models achieved superhuman performance within a year. To address the shortcomings of GLUE, researchers designed the SuperGLUE benchmark with more difficult tasks (Wang et al., 2019). About a year since the release of SuperGLUE, performance is again essentially human-level (Raffel et al., 2019). While these benchmarks evaluate linguistic skills more than overall language understanding, an array of commonsense benchmarks have been proposed to measure basic reasoning and everyday knowledge (Zellers et al., 2019; Huang et al., 2019; Bisk et al., 2019). However, these recent benchmarks have similarly seen rapid progress (Khashabi et al., 2020). Overall, the near human-level performance on these benchmarks suggests that they are not capturing important facets of language understanding.
|
| 24 |
+
|
| 25 |
+
Transformer models have driven this recent progress by pretraining on massive text corpora, including all of Wikipedia, thousands of books, and numerous websites. These models consequently see extensive information about specialized topics, most of which is not assessed by existing NLP benchmarks. It consequently remains an open question just how capable current language models are at learning and applying knowledge from many domains.
|
| 26 |
+
|
| 27 |
+
To bridge the gap between the wide-ranging knowledge that models see during pretraining and the existing measures of success, we introduce a new benchmark for assessing models across a diverse set of subjects that humans learn. We design the benchmark to measure knowledge acquired during pretraining by evaluating models exclusively in zero-shot and few-shot settings. This makes the benchmark more challenging and more similar to how we evaluate humans. The benchmark covers 57 subjects across STEM, the humanities, the social sciences, and more. It ranges in difficulty from an elementary level to an advanced professional level, and it tests both world knowledge and problem solving ability. Subjects range from traditional areas, such as mathematics and history, to more
|
| 28 |
+
|
| 29 |
+
# Few Shot Prompt and Predicted Answer
|
| 30 |
+
|
| 31 |
+
The following are multiple choice questions about high school mathematics.
|
| 32 |
+
|
| 33 |
+
How many numbers are in the list 25, 26, ..., 100? (A) 75 (B) 76 (C) 22 (D) 23
|
| 34 |
+
|
| 35 |
+
Answer: B
|
| 36 |
+
|
| 37 |
+
Compute $i + i ^ { 2 } + i ^ { 3 } + \cdot \cdot \cdot + i ^ { 2 5 8 } + i ^ { 2 5 9 }$ . (A) -1 (B) 1 (C) i (D) -i Answer: A
|
| 38 |
+
|
| 39 |
+
If 4 daps $= 7$ yaps, and $5 \mathrm { y a p s } = 3$ baps, how many daps equal 42 baps? (A) 28 (B) 21 (C) 40 (D) 30 Answer: $\underline { { \mathbf { C } } }$
|
| 40 |
+
|
| 41 |
+
(a) An example of few-shot learning and inference using GPT-3. The blue underlined bold text is the autocompleted response from GPT-3, while the preceding text is the user-inputted prompt. In this 2-shot learning example, there are two instruction examples and one initially incomplete example. On average, GPT-3 has low accuracy on high school mathematics questions.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
|
| 45 |
+
(b) Performance on a commonsense benchmark (HellaSwag), a linguistic understanding benchmark (SuperGLUE), and the massive multitask test. On previous benchmarks, smaller models start well above random chance levels and exhibit more continuous improvements with model size increases, but on our test, GPT-3 moves beyond random chance with the largest model.
|
| 46 |
+
|
| 47 |
+
specialized areas like law and ethics (Hendrycks et al., 2020). The granularity and breadth of the subjects makes the benchmark ideal for identifying a model’s blind spots.
|
| 48 |
+
|
| 49 |
+
We find that meaningful progress on our benchmark has only become possible in recent months. In particular, few-shot models up to 13 billion parameters (Brown et al., 2020) achieve random chance performance of $2 5 \%$ accuracy, but the 175 billion parameter GPT-3 model reaches a much higher $4 3 . 9 \%$ accuracy (see Figure 1b). On the other hand, unlike human professionals GPT-3 does not excel at any single subject. Instead, we find that performance is lopsided, with GPT-3 having almost $7 0 \%$ accuracy for its best subject but near-random performance for several other subjects.
|
| 50 |
+
|
| 51 |
+
Our results indicate that while recent advances have been impressive, state-of-the-art models still struggle at learning and applying knowledge from pretraining. The tasks with near-random accuracy include calculation-heavy subjects such as physics and mathematics and subjects related to human values such as law and morality. This second weakness is particularly concerning because it will be important for future models to have a strong understanding of what is legal and what is ethical. Worryingly, we also find that GPT-3 does not have an accurate sense of what it does or does not know since its average confidence can be up to $2 4 \%$ off from its actual accuracy. We comprehensively evaluate the breadth and depth of a model’s text understanding by covering numerous topics that humans are incentivized to learn. Since our test consists in 57 tasks, it can be used to analyze aggregate properties of models across tasks and to track important shortcomings. The test and code is available at github.com/hendrycks/test.
|
| 52 |
+
|
| 53 |
+
# 2 RELATED WORK
|
| 54 |
+
|
| 55 |
+
Pretraining. The dominant paradigm in NLP is to pretrain large models on massive text corpora including educational books and websites. In the process, these models are exposed to information about a wide range of topics. Petroni et al. (2019) found that recent models learn enough information from pretraining that they can serve as knowledge bases. However, no prior work has comprehensively measured the knowledge models have across many real-world domains.
|
| 56 |
+
|
| 57 |
+
Until recently, researchers primarily used fine-tuned models on downstream tasks (Devlin et al., 2019). However, larger pretrained models like GPT-3 (Brown et al., 2020) have made it possible to achieve competitive performance without fine-tuning by using few-shot learning, which removes the need for a large fine-tuning set. With the advent of strong zero-shot and few-shot learning, it is now possible to curate a diverse set of tasks for evaluation and remove the possibility of models on “spurious cues” (Geirhos et al., 2020; Hendrycks et al., 2019b) in a dataset to achieve high performance.
|
| 58 |
+
|
| 59 |
+
Benchmarks. Many recent benchmarks aim to assess a model’s general world knowledge and basic reasoning ability by testing its “commonsense.” A number of commonsense benchmarks have been
|
| 60 |
+
|
| 61 |
+
As Seller, an encyclopedia salesman, approached the grounds on which Hermit's house was situated, he saw a sign that said, "No salesmen. Trespassers will be prosecuted. Proceed at your own risk." Although Seller had not been invited to enter, he ignored the sign and drove up the driveway toward the house. As he rounded a curve, a powerful explosive charge buried in the driveway exploded, and Seller was injured. Can Seller recover damages from Hermit for his injuries?
|
| 62 |
+
|
| 63 |
+
(A) Yes, unless Hermit, when he planted the charge, intended only to deter, not harm, intruders.
|
| 64 |
+
(B) Yes, if Hermit was responsible for the explosive charge under the driveway.
|
| 65 |
+
(C) No, because Seller ignored the sign, which warned him against proceeding further.
|
| 66 |
+
(D) No, if Hermit reasonably feared that intruders would come and harm him or his family.
|
| 67 |
+
|
| 68 |
+
Figure 2: This task requires understanding detailed and dissonant scenarios, applying appropriate legal precedents, and choosing the correct explanation. The green checkmark is the ground truth.
|
| 69 |
+
|
| 70 |
+
proposed in the past year, but recent models are already nearing human-level performance on several of these, including HellaSwag (Zellers et al., 2019), Physical IQA (Bisk et al., 2019), and CosmosQA (Huang et al., 2019). By design, these datasets assess abilities that almost every child has. In contrast, we include harder specialized subjects that people must study to learn.
|
| 71 |
+
|
| 72 |
+
Some researchers have suggested that the future of NLP evaluation should focus on Natural Language Generation (NLG) (Zellers et al., 2020), an idea that reaches back to the Turing Test (Turing, 1950). However, NLG is notoriously difficult to evaluate and lacks a standard metric (Sai et al., 2020). Consequently, we instead create a simple-to-evaluate test that measures classification accuracy on multiple choice questions.
|
| 73 |
+
|
| 74 |
+
While several question answering benchmarks exist, they are comparatively limited in scope. Most either cover easy topics like grade school subjects for which models can already achieve strong performance (Clark et al., 2018; Khot et al., 2019; Mihaylov et al., 2018; Clark et al., 2019), or are focused on linguistic understanding in the form of reading comprehension (Lai et al., 2017; Richardson et al., 2013). In contrast, we include a wide range of difficult subjects that go far beyond linguistic understanding.
|
| 75 |
+
|
| 76 |
+
# 3 A MULTITASK TEST
|
| 77 |
+
|
| 78 |
+
We create a massive multitask test consisting of multiple-choice questions from various branches of knowledge. The test spans subjects in the humanities, social sciences, hard sciences, and other areas that are important for some people to learn. There are 57 tasks in total, which is also the number of Atari games (Bellemare et al., 2013), all of which are listed in Appendix B. The questions in the dataset were manually collected by graduate and undergraduate students from freely available sources online. These include practice questions for tests such as the Graduate Record Examination and the United States Medical Licensing Examination. It also includes questions designed for undergraduate courses and questions designed for readers of Oxford University Press books. Some tasks cover a subject, like psychology, but at a specific level of difficulty, such as “Elementary,” “High School,” “College,” or “Professional.” For example, the “Professional Psychology” task draws on questions from freely available practice questions for the Examination for Professional Practice in Psychology, while the “High School Psychology” task has questions like those from Advanced Placement Psychology examinations.
|
| 79 |
+
|
| 80 |
+
We collected 15908 questions in total, which we split into a few-shot development set, a validation set, and a test set. The few-shot development set has 5 questions per subject, the validation set may be used for selecting hyperparameters and is made of 1540 questions, and the test set has 14079 questions. Each subject contains 100 test examples at the minimum, which is longer than most exams designed to assess people.
|
| 81 |
+
|
| 82 |
+
Human-level accuracy on this test varies. Unspecialized humans from Amazon Mechanical Turk obtain $3 4 . 5 \%$ accuracy on this test. Meanwhile, expert-level performance can be far higher. For example, real-world test-taker human accuracy at the 95th percentile is around $8 7 \%$ for US Medical Licensing Examinations, and these questions make up our “Professional Medicine” task. If we take the 95th percentile human test-taker accuracy for exams that build up our test, and if we make an educated guess when such information is unavailable, we then estimate that expert-level accuracy is approximately $8 9 . 8 \%$ .
|
| 83 |
+
|
| 84 |
+
Since our test aggregates different subjects and several levels of difficulty, we measure more than straightforward commonsense or narrow linguistic understanding. Instead, we measure arbitrary
|
| 85 |
+
|
| 86 |
+
One of the reasons that the government discourages and regulates monopolies is that
|
| 87 |
+
|
| 88 |
+
(A) producer surplus is lost and consumer surplus is gained.
|
| 89 |
+
(B) monopoly prices ensure productive efficiency but cost society allocative efficiency.
|
| 90 |
+
(C) monopoly firms do not engage in significant research and development.
|
| 91 |
+
(D) consumer surplus is lost with higher prices and lower levels of output.
|
| 92 |
+
|
| 93 |
+
When you drop a ball from rest it accelerates downward at $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$ . If you instead throw it downward assuming no air resistance its acceleration immediately after leaving your hand is
|
| 94 |
+
|
| 95 |
+
(A) $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$
|
| 96 |
+
(B) more than $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$
|
| 97 |
+
(C) less than $9 . 8 ~ \mathrm { m } / \mathrm { s } ^ { 2 }$
|
| 98 |
+
(D) Cannot say unless the speed of throw is given.
|
| 99 |
+
|
| 100 |
+
In the complex $z$ -plane, the set of points satisfying the equation $z ^ { 2 } = | z | ^ { 2 }$ is a
|
| 101 |
+
|
| 102 |
+
(A) pair of points
|
| 103 |
+
(B) circle
|
| 104 |
+
(C) half-line
|
| 105 |
+
(D) line
|
| 106 |
+
|
| 107 |
+
Figure 4: Examples from the Conceptual Physics and College Mathematics STEM tasks.
|
| 108 |
+
|
| 109 |
+
real-world text understanding. Since models are pretrained on the Internet, this enables us to test how well they can extract useful knowledge from massive corpora. Future models that use this test could be single models or a mixture of experts model. To succeed at our test, future models should be well-rounded, possess extensive world knowledge, and develop expert-level problem solving ability. These properties make the test likely to be an enduring and informative goalpost.
|
| 110 |
+
|
| 111 |
+
# 3.1 HUMANITIES
|
| 112 |
+
|
| 113 |
+
The humanities is a group of disciplines that make use of qualitative analysis and analytic methods rather than scientific empirical methods. Branches of the humanities include law, philosophy, history, and so on (Appendix B). Mastering these subjects requires a variety of skills. For example, legal understanding requires knowledge of how to apply rules and standards to complex scenarios, and also provide answers with stipulations and explanations. We illustrate this in Figure 2. Legal understanding is also necessary for understanding and following rules and regulations, a necessary capability to constrain open-world machine learning models. For philosophy, our questions cover concepts like logical fallacies, formal logic, and famous philosophical arguments. It also covers moral scenarios, including questions from the ETHICS dataset (Hendrycks et al., 2020) that test a model’s understanding of normative statements through predicting widespread moral intuitions about diverse everyday scenarios. Finally, our history questions cover a wide range of time periods and geographical locations, including prehistory and other advanced subjects.
|
| 114 |
+
|
| 115 |
+
# 3.2 SOCIAL SCIENCE
|
| 116 |
+
|
| 117 |
+
Social science includes branches of knowledge that examine human behavior and society. Subject areas include economics, sociology, politics, geography, psychology, and so on. See Figure 3 for an example question. Our economics questions include microeconomics, macroeconomics, and econometrics, and cover different types of problems, including questions that require a mixture of world knowledge, qualitative reasoning, or quantitative reasoning. We also include important but more esoteric topics such as security studies in order to test the boundaries of what is experienced and learned during pretraining. Social science also includes psychology, a field that may be especially important for attaining a nuanced understanding of humans.
|
| 118 |
+
|
| 119 |
+
# 3.3 SCIENCE, TECHNOLOGY, ENGINEERING, AND MATHEMATICS (STEM)
|
| 120 |
+
|
| 121 |
+
STEM subjects include physics, computer science, mathematics, and more. Two examples are shown in Figure 4. Conceptual physics tests understanding of simple physics principles and may be thought
|
| 122 |
+
|
| 123 |
+
A 33-year-old man undergoes a radical thyroidectomy for thyroid cancer. During the operation, moderate hemorrhaging requires ligation of several vessels in the left side of the neck. Postoperatively, serum studies show a calcium concentration of $7 . 5 \ : \mathrm { m g / d L } ,$ , albumin concentration of $4 \ : \mathrm { g / d L }$ , and parathyroid hormone concentration of $2 0 0 \mathrm { p g / m L }$ . Damage to which of the following vessels caused the findings in this patient?
|
| 124 |
+
|
| 125 |
+
(A) Branch of the costocervical trunk (B) Branch of the external carotid artery (C) Branch of the thyrocervical trunk (D) Tributary of the internal jugular vein
|
| 126 |
+
|
| 127 |
+
of as a harder version of the physical commonsense benchmark Physical IQA (Bisk et al., 2019). We also test mathematical problem solving ability at various levels of difficulty, from the elementary to the college level. College mathematics questions, like those found on the GRE mathematics subject test, often require chains of reasoning and abstract knowledge. To encode mathematics expressions, we use LaTeX or symbols such as \* and ˆ for multiplication and exponentiation respectively. STEM subjects require knowledge of empirical methods, fluid intelligence, and procedural knowledge.
|
| 128 |
+
|
| 129 |
+
# 3.4 OTHER
|
| 130 |
+
|
| 131 |
+
There is a long tail of subjects that either do not neatly fit into any of the three preceding categories or for which there are not thousands of freely available questions. We put these subjects into Other. This section includes the Professional Medicine task, which has difficult questions that require humans many years of study to master. An example is depicted in Figure 5. This section also contains business topics like finance, accounting, and marketing, as well as knowledge of global facts. The latter includes statistics about poverty in different countries over time, which may be necessary for having an accurate model of the world internationally.
|
| 132 |
+
|
| 133 |
+
# 4 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
# 4.1 SETUP
|
| 136 |
+
|
| 137 |
+
Assessment and Models. To measure performance on our multitask test, we compute the classification accuracy across all examples and tasks. We evaluate GPT-3 (Brown et al., 2020) and UnifiedQA (Khashabi et al., 2020). For GPT-3 we use the OpenAI API, which provides access to four model variants, “Ada,” “Babbage,” “Curie,” and “Davinci,” which we refer to as “Small” (2.7 billion parameters), “Medium” (6.7 billion), “Large” (13 billion) and “X-Large” (175 billion). UnifiedQA uses the T5 (Raffel et al., 2019) text-to-text backbone and is fine-tuned on previously proposed question answering datasets (Lai et al., 2017), where the prediction is the class with the highest token overlap with UnifiedQA’s text output. Since UnifiedQA is fine-tuned on other datasets, we evaluate it without any further tuning to assess its transfer accuracy. We also fine-tune RoBERTa-base, ALBERT-xxlarge, and GPT-2 on UnifiedQA training data and our dev+val set. We primarily focus on UnifiedQA and GPT-3 in the rest of this document, but additional discussion of RoBERTa, ALBERT, and GPT-2 is in Appendix A.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Model</td><td>Humanities</td><td>Social Science</td><td>STEM</td><td>Other</td><td>Average</td></tr><tr><td>RandomBaseline</td><td>25.0</td><td>25.0</td><td>25.0</td><td>25.0</td><td>25.0</td></tr><tr><td>RoBERTa</td><td>27.9</td><td>28.8</td><td>27.0</td><td>27.7</td><td>27.9</td></tr><tr><td>ALBERT</td><td>27.2</td><td>25.7</td><td>27.7</td><td>27.9</td><td>27.1</td></tr><tr><td>GPT-2</td><td>32.8</td><td>33.3</td><td>30.2</td><td>33.1</td><td>32.4</td></tr><tr><td>UnifiedQA</td><td>45.6</td><td>56.6</td><td>40.2</td><td>54.6</td><td>48.9</td></tr><tr><td>GPT-3 Small (few-shot)</td><td>24.4</td><td>30.9</td><td>26.0</td><td>24.1</td><td>25.9</td></tr><tr><td>GPT-3 Medium (few-shot)</td><td>26.1</td><td>21.6</td><td>25.6</td><td>25.5</td><td>24.9</td></tr><tr><td>GPT-3 Large (few-shot)</td><td>27.1</td><td>25.6</td><td>24.3</td><td>26.5</td><td>26.0</td></tr><tr><td>GPT-3 X-Large (few-shot)</td><td>40.8</td><td>50.4</td><td>36.7</td><td>48.8</td><td>43.9</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 1: Average weighted accuracy for each model on all four broad disciplines. All values are percentages. Some models proposed in the past few months can move several percent points beyond random chance. GPT-3 uses few-shot learning and UnifiedQA is tested under distribution shift.
|
| 142 |
+
|
| 143 |
+
Few-Shot Prompt. We feed GPT-3 prompts like that shown in Figure 1a. We begin each prompt with “The following are multiple choice questions (with answers) about [subject].” For zero-shot evaluation, we append the question to the prompt. For few-shot evaluation, we add up to 5 demonstration examples with answers to the prompt before appending the question. All prompts end with “Answer: ”. The model then produces probabilities for the tokens “A,” “B,” “C,” and “D,” and we treat the highest probability option as the prediction. For consistent evaluation, we create a dev set with 5 fixed few-shot examples for each subject.
|
| 144 |
+
|
| 145 |
+
# 4.2 RESULTS
|
| 146 |
+
|
| 147 |
+
Model Size and Accuracy. We compare the few-shot accuracy of each GPT-3 size in Table 1. We find that the three smaller GPT-3 models have near random accuracy (around $2 5 \%$ ). In contrast, we find that the X-Large 175 billion parameter GPT-3 model performs substantially better than random, with an accuracy of $4 3 . 9 \%$ . We also find qualitatively similar results in the zero-shot setting. While the smaller models have around $2 5 \%$ zero-shot accuracy, Figure 10 in Appendix A shows that the largest GPT-3 model has a much higher zero-shot accuracy of about $3 7 . 7 \%$ . Brown et al. (2020) also observe that larger GPT-3 models perform better, though progress tends to be steadier. In Figure 1b we show that non-random accuracy on the multitask test emerged with recent large few-shot models compared to datasets that assess commonsense and linguistic understanding.
|
| 148 |
+
|
| 149 |
+
To test the usefulness of fine-tuning instead of few-shot learning, we also evaluate UnifiedQA models. UnifiedQA has the advantage of being fine-tuned on other question answering datasets, unlike GPT-3. We assess UnifiedQA by evaluating its transfer performance without any additional fine-tuning. The largest UnifiedQA model we test has 11 billion parameters, which is slightly smaller than GPT-3 Large. Nevertheless, we show in Table 1 that it attains $4 8 . 9 \%$
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 6: GPT-3 (few-shot) and UnifiedQA results.
|
| 153 |
+
|
| 154 |
+
accuracy. This performs better than the few-shot GPT-3 X-Large model, despite UnifiedQA have an order of magnitude fewer parameters. We also find that even the smallest UnifiedQA variant, with just 60 million parameters, has approximately $2 9 . 3 \%$ accuracy. These results suggest that while model size is a key component for achieving strong performance, fine-tuning also helps.
|
| 155 |
+
|
| 156 |
+
Comparing Disciplines. Using our test, we discover that GPT-3 and UnifiedQA have lopsided performance and several substantial knowledge gaps. Figure 6 shows the accuracy of GPT-3 (fewshot) and UnifiedQA for all 57 tasks. It shows the both models are below expert-level performance for all tasks, with GPT-3’s accuracy ranging from $6 9 \%$ for US Foreign Policy to $2 6 \%$ for College Chemistry. UnifiedQA does best on marketing, with an accuracy of $8 2 . 5 \%$ .
|
| 157 |
+
|
| 158 |
+
Overall, models do poorly on highly procedural problems. Figure 6 shows that calculation-heavy STEM subjects tend to have low accuracy compared to verbal subjects. For GPT-3, 9 out of the 10
|
| 159 |
+
|
| 160 |
+
# Declarative vs. Procedural Knowledge
|
| 161 |
+
|
| 162 |
+
Prompt and Completion: The order of operations or PEMDAS is Parentheses Exponents Multiplication Division Addition Subtraction
|
| 163 |
+
|
| 164 |
+
Prompt and Completion: $( 1 + 1 ) \times 2 = 3 .$
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 7: GPT-3’s completion for two prompts testing knowledge of the order of operations. The blue underlined bold text is the autocompleted response from GPT-3. While it knows about the order of operations, it sometimes does not know how to apply its knowledge.
|
| 168 |
+
Figure 8: GPT-3’s confidence is a poor estimator of its accuracy and can be off by up to $2 4 \%$ .
|
| 169 |
+
|
| 170 |
+
lowest-accuracy tasks are STEM subjects that emphasize mathematics or calculations. We speculate that is in part because GPT-3 acquires declarative knowledge more readily than procedural knowledge. For example, many questions in Elementary Mathematics require applying the order of operations for arithmetic, which is described by the acronym PEMDAS (Parentheses Exponents Multiplication Division Addition Subtraction). In Figure 7, we confirm that GPT-3 is aware of the acronym PEMDAS. However, it does not consistently apply PEMDAS to actual problems. On the other hand, procedural understanding is not its only weak point. We find that some verbal tasks such as Moral Scenarios from Hendrycks et al. (2020) and Professional Law also have especially low accuracy.
|
| 171 |
+
|
| 172 |
+
Our test also shows that GPT-3 acquires knowledge quite unlike humans. For example, GPT-3 learns about topics in a pedagogically unusual order. GPT-3 does better on College Medicine $( 4 7 . 4 \% )$ and College Mathematics $( 3 5 . 0 \% )$ than calculation-heavy Elementary Mathematics $( 2 9 . 9 \% )$ . GPT-3 demonstrates unusual breadth, but it does not master a single subject. Meanhwhile we suspect humans have mastery in several subjects but not as much breadth. In this way, our test shows that GPT-3 has many knowledge blindspots and has capabilities that are lopsided.
|
| 173 |
+
|
| 174 |
+
Calibration. We should not trust a model’s prediction unless the model is calibrated, meaning that its confidence is a good estimate of the actual probability the prediction is correct. However, large neural networks are often miscalibrated (Guo et al., 2017), especially under distribution shift (Ovadia et al., 2019). We evaluate the calibration of GPT-3 by testing how well its average confidence estimates its actual accuracy for each subject. We show the results in Figure 8, which demonstrates that GPT-3 is uncalibrated. In fact, its confidence is only weakly related to its actual accuracy in the zero-shot setting, with the difference between its accuracy and confidence reaching up to $\dot { 2 } 4 \%$ for some subjects. Another calibration measure is the Root Mean Squared (RMS) calibration error (Hendrycks et al., 2019a; Kumar et al., 2019). Many tasks have miscalibrated predictions, such as Elementary Mathematics which has a zero-shot RMS calibration error of $1 9 . 4 \%$ . Models are only somewhat more calibrated in the few-shot setting, as shown in Appendix A. These results suggest that model calibration has wide room for improvement.
|
| 175 |
+
|
| 176 |
+
# 5 DISCUSSION
|
| 177 |
+
|
| 178 |
+
Multimodal Understanding. While text is capable of conveying an enormous number of concepts about the world, many important concepts are conveyed mainly through other modalities, such as images, audio, and physical interaction (Bisk et al., 2020). Existing large-scale NLP models, such as GPT-3, do not incorporate multimodal information, so we design our benchmark to capture a diverse array of tasks in a text-only format. However, as models gain the ability to process multimodal inputs, benchmarks should be designed to reflect this change. One such benchmark could be a “Turk Test,” consisting of Amazon Mechanical Turk Human Intelligence Tasks. These are well-defined tasks that require models to interact with flexible formats and demonstrate multimodal understanding.
|
| 179 |
+
|
| 180 |
+
The Internet as a Training Set. A major distinction between our benchmark and previous multitask NLP benchmarks is that we do not require large training sets. Instead, we assume that models have acquired the requisite knowledge from reading vast quantities of diverse text from the Internet. This process is typically called pretraining, but it can be thought of as training in its own right, where the downstream evaluation is demonstrating whatever knowledge we would expect a human to pick up from reading the same text.
|
| 181 |
+
|
| 182 |
+
This motivates us to propose a methodological change so that models are trained more like how humans learn. While most previous machine learning benchmarks have models learn from a large question bank, humans primarily learn new subjects by reading books and listening to others talk about the topic. For specialized subjects such as Professional Law, massive legal corpora are available, such as the 164-volume legal encyclopedia Corpus Juris Secundum, but there are fewer than 5,000 multistate bar exam questions available. Learning the entire law exclusively through a small number of practice tests is implausible, so future models must learn more during pretraining.
|
| 183 |
+
|
| 184 |
+
For this reason we assess pretrained models in a zero-shot, few-shot, or transfer setting and we provide a dev, val, and test set for each task. The dev set is used for few-shot prompts, the val set could be used for hyperparameter tuning, and the test set is used to compute the final accuracy. Importantly, the format of our evaluation is not identical to the format in which information is acquired during pretraining. This has the benefit of obviating concerns about spurious training set annotation artifacts (Geirhos et al., 2020; Hendrycks et al., 2019b) and is in stark contrast to the previous paradigm of identically distributed training and test sets. This change also enables collecting a much more extensive and diverse set of tasks for evaluation. We anticipate our methodology becoming more widespread as models improve at extracting information from diverse online sources.
|
| 185 |
+
|
| 186 |
+
Model Limitations. We find that current large-scale Transformers have wide room for improvement. They are notably poor at modeling human (dis)approval, as evident by the low performance on the Professional Law and Moral Scenarios tasks. For future systems to be aligned with human values, high performance on these tasks is crucial (Hendrycks et al., 2020), so future research should especially aim to increase accuracy on these tasks. Models also have difficulty performing calculations, so much so that they exhibit poor performance on Elementary Mathematics and many other STEM subjects with “plug and chug” problems. Additionally, they do not match expert-level performance $( 9 0 \% )$ on any subject, so for all subjects it is subhuman. On average, models are only now starting to move beyond random-chance accuracy levels.
|
| 187 |
+
|
| 188 |
+
Addressing these shortcomings may be challenging. To illustrate this, we attempted to create a better Professional Law model by pretraining on specialized data but achieved only limited success. We collected approximately 2,000 additional Professional Law training examples. After fine-tuning a RoBERTa-base model (Liu et al., 2019) using this custom training set, our model attained $3 2 . 8 \%$ test accuracy. To test the impact of additional specialized training data, we also had RoBERTa continue pretraining on approximately 1.6 million legal case summaries using Harvard’s Law Library case law corpus case.law, but after fine-tuning it only attained $3 6 . 1 \%$ accuracy. This suggests that while additional pretraining on relevant high quality text can help, it may not be enough to substantially increase the performance of current models.
|
| 189 |
+
|
| 190 |
+
It is unclear whether simply scaling up existing language models will solve the test. Current understanding indicates that a $1 0 \times$ increase in model size must be accompanied by an approximate $5 \times$ increase in data (Kaplan et al., 2020). Aside from the tremendous expense in creating multi-trillion parameter language models, data may also become a bottleneck, as there is far less written about esoteric branches of knowledge than about everyday situations.
|
| 191 |
+
|
| 192 |
+
# 6 CONCLUSION
|
| 193 |
+
|
| 194 |
+
We introduced a new test that measures how well text models can learn and apply knowledge encountered during pretraining. By covering 57 subjects at varying levels of difficulty, the test assesses language understanding in greater breadth and depth than previous benchmarks. We found that it has recently become possible for models to make meaningful progress on the test, but that state-of-the-art models have lopsided performance and rarely excel at any individual task. We also showed that current models are uncalibrated and have difficulty with tasks that require calculations. Worryingly, models also perform especially poorly on socially relevant subjects including morality and law. Our expansive test can help researchers pinpoint important shortcomings of models, making it easier to gain a clearer picture of state-of-the-art capabilities.
|
| 195 |
+
|
| 196 |
+
# ACKNOWLEDGEMENTS
|
| 197 |
+
|
| 198 |
+
We would like to thank the following for their helpful comments: Oyvind Tafjord, Jan Leike, David Krueger, Alex Tamkin, Girish Sastry, and Henry Zhu. DH is supported by the NSF GRFP Fellowship and an Open Philanthropy Project Fellowship. This research was also supported by the NSF Frontier Award 1804794.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents (extended abstract). J. Artif. Intell. Res., 47:253–279, 2013.
|
| 203 |
+
Y. Bisk, R. Zellers, R. L. Bras, J. Gao, and Y. Choi. Piqa: Reasoning about physical commonsense in natural language, 2019.
|
| 204 |
+
Y. Bisk, A. Holtzman, J. Thomason, J. Andreas, Y. Bengio, J. Chai, M. Lapata, A. Lazaridou, J. May, A. Nisnevich, N. Pinto, and J. Turian. Experience grounds language, 2020.
|
| 205 |
+
T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei. Language models are few-shot learners, 2020.
|
| 206 |
+
P. Clark, I. Cowhey, O. Etzioni, T. Khot, A. Sabharwal, C. Schoenick, and O. Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv, abs/1803.05457, 2018.
|
| 207 |
+
P. Clark, O. Etzioni, D. Khashabi, T. Khot, B. D. Mishra, K. Richardson, A. Sabharwal, C. Schoenick, O. Tafjord, N. Tandon, S. Bhakthavatsalam, D. Groeneveld, M. Guerquin, and M. Schmitz. From ’f’ to ’a’ on the n.y. regents science exams: An overview of the aristo project. ArXiv, abs/1909.01958, 2019.
|
| 208 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. ArXiv, abs/1810.04805, 2019.
|
| 209 |
+
R. Geirhos, J.-H. Jacobsen, C. Michaelis, R. Zemel, W. Brendel, M. Bethge, and F. A. Wichmann. Shortcut learning in deep neural networks, 2020.
|
| 210 |
+
C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. ICML, 2017.
|
| 211 |
+
D. Hendrycks, M. Mazeika, and T. Dietterich. Deep anomaly detection with outlier exposure. ICLR, 2019a.
|
| 212 |
+
D. Hendrycks, K. Zhao, S. Basart, J. Steinhardt, and D. Song. Natural adversarial examples. ArXiv, abs/1907.07174, 2019b.
|
| 213 |
+
D. Hendrycks, C. Burns, S. Basart, A. Critch, J. Li, D. Song, and J. Steinhardt. Aligning ai with shared human values, 2020.
|
| 214 |
+
L. Huang, R. L. Bras, C. Bhagavatula, and Y. Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning, 2019.
|
| 215 |
+
J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models, 2020.
|
| 216 |
+
D. Khashabi, T. Khot, A. Sabharwal, O. Tafjord, P. Clark, and H. Hajishirzi. Unifiedqa: Crossing format boundaries with a single qa system, 2020.
|
| 217 |
+
T. Khot, P. Clark, M. Guerquin, P. Jansen, and A. Sabharwal. Qasc: A dataset for question answering via sentence composition, 2019.
|
| 218 |
+
A. Kumar, P. Liang, and T. Ma. Verified uncertainty calibration, 2019.
|
| 219 |
+
|
| 220 |
+
G. Lai, Q. Xie, H. Liu, Y. Yang, and E. Hovy. Race: Large-scale reading comprehension dataset from examinations, 2017.
|
| 221 |
+
|
| 222 |
+
Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut. Albert: A lite bert for self-supervised learning of language representations. ArXiv, abs/1909.11942, 2020.
|
| 223 |
+
|
| 224 |
+
Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. ArXiv, abs/1907.11692, 2019.
|
| 225 |
+
|
| 226 |
+
T. Mihaylov, P. Clark, T. Khot, and A. Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. In EMNLP, 2018.
|
| 227 |
+
|
| 228 |
+
Y. Ovadia, E. Fertig, J. Ren, Z. Nado, D. Sculley, S. Nowozin, J. V. Dillon, B. Lakshminarayanan, and J. Snoek. Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift. NeurIPS, 2019.
|
| 229 |
+
|
| 230 |
+
F. Petroni, T. Rocktäschel, P. Lewis, A. Bakhtin, Y. Wu, A. H. Miller, and S. Riedel. Language models as knowledge bases?, 2019.
|
| 231 |
+
|
| 232 |
+
A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 233 |
+
|
| 234 |
+
C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer, 2019.
|
| 235 |
+
|
| 236 |
+
M. Richardson, C. J. Burges, and E. Renshaw. MCTest: A challenge dataset for the open-domain machine comprehension of text. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 193–203, Seattle, Washington, USA, Oct. 2013. Association for Computational Linguistics.
|
| 237 |
+
|
| 238 |
+
A. B. Sai, A. K. Mohankumar, and M. M. Khapra. A survey of evaluation metrics used for nlg systems. 2020.
|
| 239 |
+
|
| 240 |
+
A. Turing. Computing machinery and intelligence. 1950.
|
| 241 |
+
|
| 242 |
+
A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding, 2018.
|
| 243 |
+
|
| 244 |
+
A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems, 2019.
|
| 245 |
+
|
| 246 |
+
R. Zellers, A. Holtzman, Y. Bisk, A. Farhadi, and Y. Choi. Hellaswag: Can a machine really finish your sentence?, 2019.
|
| 247 |
+
|
| 248 |
+
R. Zellers, A. Holtzman, E. Clark, L. Qin, A. Farhadi, and Y. Choi. Evaluating machines by their real-world language use, 2020.
|
| 249 |
+
|
| 250 |
+
# A ADDITIONAL ANALYSIS
|
| 251 |
+
|
| 252 |
+
This appendix includes figures with sorted results (Figure 9), few-shot examples vs. accuracy (Figure 10), and few-shot calibration (Figure 11). It also includes sections on fine-tuning, error analysis, and format sensitivity.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 9: On the left are GPT-3 few shot accuracies for all of the 57 tasks. On the right are UnifiedQA transfer accuracies for all of the 57 tasks. For both models, capabilities are lopsided.
|
| 256 |
+
|
| 257 |
+
# A.1 ANALYSIS WITH MORE FINE-TUNED MODELS
|
| 258 |
+
|
| 259 |
+
We primarily analyzed models with more than 10 billion parameters in the main body of the paper. For this section, we analyze smaller models including RoBERTa-base (125 million parameters) (Liu et al., 2019), ALBERT-xxlarge (223 million parameters) (Lan et al., 2020), and GPT-2 (1,558 million parameters) (Radford et al., 2019). Models are fine-tuned to predict one of four classes using the UnifiedQA MCQ questions and using our dev+val set. We test on our multitask test set.
|
| 260 |
+
|
| 261 |
+
We observe that these smaller models can attain better-than-random accuracy. RoBERTa-base attains an overall accuracy of $2 7 . 9 \%$ , with $2 7 . 9 \%$ accuracy for the humanities, $2 \dot { 8 } . 8 \%$ for social sciences, $2 7 . 0 \%$ for STEM, and $2 7 . 7 \%$ for other. ALBERT-xxlarge attains an accuracy of $2 7 . 1 \%$ , with $2 7 . 2 \%$ accuracy for the humanities, $2 5 . 7 \%$ for the social sciences, $2 7 . 7 \%$ for STEM, and $2 7 . 9 \%$ for other. GPT-2 attains an accuracy of $3 2 . 4 \%$ , with $3 2 . 8 \%$ accuracy for the humanities, $3 3 . 3 \%$ for the social sciences, $3 0 . 2 \%$ for STEM, and $3 3 . 1 \%$ for other.
|
| 262 |
+
|
| 263 |
+
Compare this to UnifiedQA’s smallest variant, which has just 60 million parameters and approximately $2 9 . 3 \%$ accuracy. It obtains higher accuracy than RoBERTa and ALBERT, even though it has fewer parameters. This suggests that its larger pretraining dataset enables higher accuracy. Likewise, UnifiedQA with 3 billion parameters attains $4 3 . 7 \%$ , while the similarly sized GPT-2 model with 1.5 billion parameters attains ${ \mathrm { 3 2 . 4 \% } }$ accuracy. This again suggests that T5’s larger pretraining dataset size (and therefore UnifiedQA’s pretraining dataset size) can increase accuracy.
|
| 264 |
+
|
| 265 |
+
# A.2 ERROR ANALYSIS
|
| 266 |
+
|
| 267 |
+
We qualitatively analyze when GPT-3 makes high confidence mistakes. We find that while many of these mistakes were clearly wrong, many were mistakes that a human might make. For example, one question it got wrong was “How many chromosomes do all human somatic cells contain?” The correct answer is 46, while few-shot GPT-3 predicted 23 with confidence $9 7 . 5 \%$ . This answer would have been correct if the question asked about the number of pairs of chromosomes. Similarly, many of its other high confidence mistakes were also correct answers to slightly different questions.
|
| 268 |
+
|
| 269 |
+
# A.3 FORMAT SENSITIVITY
|
| 270 |
+
|
| 271 |
+
While different question formatting choices often lead to similar GPT-3 accuracies, we find that UnifiedQA is more sensitive. UnifiedQA’s input format is of the form
|
| 272 |
+
|
| 273 |
+
QUESTION1 \\n (A) CHOICE1 (B) CHOICE2 (C) CHOICE3 (D) CHOICE $4 < / \mathrm { { s } } >$
|
| 274 |
+
|
| 275 |
+
where questions and choices are normalized and made lowercase. If we remove the $< / \varsigma >$ from the input, accuracy declines by several percentage points.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 10: As the number of few-shot instruction examples increases, the accuracy monotonically increases. Notably, zero-shot performance is only somewhat lower than 5-shot accuracy.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 11: While models are more calibrated in a few-shot setting than a zero-shot setting, they are still miscalibrated, with gap between accuracy and confidence reaching up to $1 4 \%$ . Here the correlation between confidence and accuracy is $r = 0 . 8 1$ , compared to $r = 0 . 6 3$ in the zero-shot setting.
|
| 282 |
+
|
| 283 |
+
# B TEST DETAILS
|
| 284 |
+
|
| 285 |
+
# B.1 TASK DESCRIPTIONS AND EXAMPLES
|
| 286 |
+
|
| 287 |
+
We provide analysis of question length and difficulty in Figure 12. We list all tasks and the topics they test in Table 2. We also provide an example for each task starting with Figure 14.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 12: Figures on the relation between question difficulty and question length. For questions longer than a tweet (280 characters), the correlation between question length and true label confidence is slightly positive. This shows that longer questions are not necessarily harder.
|
| 291 |
+
|
| 292 |
+
# B.2 EXACT QUESTION AND ANSWER CONTAMINATION
|
| 293 |
+
|
| 294 |
+
Since language models train on vast text corpora, there is some chance that they have seen the exact question and answer during pretraining. If they memorized the exact question and answer, then they would attain higher accuracy than their true ability. Likewise, a question’s entropy would be especially low if it were memorized. Memorized questions and answers should have low entropy and high accuracy. However, in Figure 13, we see that accuracy and question entropy are not positively correlated, suggesting that the test’s low-entropy questions do not correspond to memorized (and thereby correctly predicted) answers. This suggests that our exact questions were not memorized. However, during pretraining models encountered text related to our questions through processing Wikipedia. We also note that most of our questions came from PDFs or websites where questions and answers are on separate pages.
|
| 295 |
+
|
| 296 |
+
See Brown et al. (2020) for a previous discussion of contamination showing that the phenomena hardly affects performance. To reduce the probability that future models encounter exact questions during test-time, we will provide a list of question sources.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 13: The average log probability of the question (without answer) is not strongly positively correlated with accuracy, all else equal. Each point corresponds to a task. Higher log probability indicates higher compression, and especially high log probability would suggest memorization. In the zero-shot question prompt, the correlation between average log probability and accuracy is $r = - 0 . 4 3$ , and for the few-shot setting the correlation is $r = - 0 . 5 6$ .
|
| 300 |
+
|
| 301 |
+
Table 2: Summary of all 57 tasks.
|
| 302 |
+
|
| 303 |
+
<table><tr><td>TaSk Abstract Algebra</td><td>Groups,rings, fields, vector spaces,.</td><td>Supelcalegory STEM</td></tr><tr><td>Anatomy</td><td>Central nervous system, circulatory system.,..</td><td>STEM</td></tr><tr><td></td><td>Solar system, galaxies,asteroids,...</td><td>STEM</td></tr><tr><td>Astronomy</td><td></td><td></td></tr><tr><td>Business Ethics</td><td>Corporate responsibility,stakeholders,regulation.,.</td><td>Other</td></tr><tr><td>Clinical Knowledge</td><td>Spot diagnosis, joints,abdominal examination.,.</td><td>Other</td></tr><tr><td>College Biology</td><td>Cellular structure, molecular biology, ecology,..</td><td>STEM</td></tr><tr><td>College Chemistry</td><td>Analytical, organic,inorganic,physical,..</td><td>STEM</td></tr><tr><td>College Computer Science</td><td>Algorithms,systems,graphs,recursion,.</td><td>STEM</td></tr><tr><td>College Mathematics College Medicine</td><td>Differential equations, real analysis,combinatorics,.</td><td>STEM</td></tr><tr><td>College Physics</td><td>Introductory biochemistry, sociology,reasoning,..</td><td>Other</td></tr><tr><td>Computer Security</td><td>Electromagnetism, thermodynamics,special relativity,..</td><td>STEM</td></tr><tr><td>Conceptual Physics</td><td>Cryptography, malware, side channels, fuzzing,..</td><td>STEM</td></tr><tr><td>Econometrics</td><td>Newton's laws,rotational motion, gravity, sound,..</td><td>STEM</td></tr><tr><td>Electrical Engineering</td><td>Volatility,long-run relationships,forecasting,.</td><td>Social Sciences</td></tr><tr><td>Elementary Mathematics</td><td>Circuits, power systems, electrical drives,..</td><td>STEM</td></tr><tr><td>Formal Logic</td><td>Word problems, multiplication, remainders, rounding,..</td><td>STEM</td></tr><tr><td>Global Facts</td><td>Propositions, predicate logic, first-order logic,..</td><td>Humanities</td></tr><tr><td>High School Biology</td><td>Extreme poverty, literacy rates,life expectancy,.</td><td>Other</td></tr><tr><td>High School Chemistry</td><td>Natural selection,heredity,cell cycle,Krebs cycle,.</td><td>STEM</td></tr><tr><td>High School Computer Science</td><td>Chemical reactions, ions,acids and bases,. Arrays,conditionals,iteration, inheritance...</td><td>STEM</td></tr><tr><td>High School European History</td><td>Renaissance,reformation, industrialization,.</td><td>STEM</td></tr><tr><td>High School Geography</td><td>Population migration, rural land-use,urban processes,.</td><td>Humanities</td></tr><tr><td>High School Gov't and Politics</td><td>Branches of government, civil liberties, political ideologies,.</td><td>Social Sciences</td></tr><tr><td>High School Macroeconomics</td><td>Economic indicators,national income,international trade,.</td><td>Social Sciences</td></tr><tr><td>High School Mathematics</td><td>Pre-algebra, algebra, trigonometry, calculus,.</td><td>Social Sciences</td></tr><tr><td>High School Microeconomics</td><td></td><td>STEM</td></tr><tr><td>High School Physics</td><td>Supply and demand, imperfect competition,market failure.,.</td><td>Social Sciences</td></tr><tr><td>High School Psychology</td><td>Kinematics, energy, torque,fluid pressure.,..</td><td>STEM</td></tr><tr><td>High School Statistics</td><td>Behavior, personality, emotions,learning,. Random variables,sampling distributions,chi-square tests.,..</td><td>Social Sciences</td></tr><tr><td>High School US History</td><td>Civil War, the Great Depression, The Great Society,..</td><td>STEM</td></tr><tr><td>High School World History</td><td>Ottoman empire, economic imperialism, World War I,..</td><td>Humanities</td></tr><tr><td>Human Aging</td><td>Senescence, dementia, longevity, personality changes,..</td><td>Humanities</td></tr><tr><td>Human Sexuality</td><td>Pregnancy,sexual differentiation, sexual orientation,.</td><td>Other</td></tr><tr><td>International Law</td><td>Human rights, sovereignty, law of the sea,use of force,.</td><td>Social Sciences</td></tr><tr><td>Jurisprudence</td><td>Natural law,classical legal positivism,legal realism,.</td><td>Humanities</td></tr><tr><td>Logical Fallacies</td><td>No true Scotsman, base rate fallacy, composition fallacy,..</td><td>Humanities</td></tr><tr><td>Machine Learning</td><td></td><td>Humanities</td></tr><tr><td>Management</td><td>SVMs, VC dimension, deep learning architectures,.</td><td>STEM</td></tr><tr><td>Marketing</td><td>Organizing, communication, organizational structure.,..</td><td>Other</td></tr><tr><td>Medical Genetics</td><td>Segmentation, pricing,market research,. Genes and cancer,common chromosome disorders.,.</td><td>Other</td></tr><tr><td>Miscellaneous</td><td>Agriculture, Fermi estimation, pop culture.,.</td><td>Other</td></tr><tr><td>Moral Disputes</td><td>Freedom of speech, addiction, the death penalty,.</td><td>Other</td></tr><tr><td>Moral Scenarios</td><td>Detecting physical violence, stealing, externalities,.</td><td>Humanities</td></tr><tr><td>Nutrition</td><td>Metabolism,water-soluble vitamins,diabetes,..</td><td>Humanities Other</td></tr><tr><td>Philosophy</td><td>Skepticism, phronesis, skepticism, Singer's Drowning Child,...</td><td>Humanities</td></tr><tr><td>Prehistory</td><td>Neanderthals, Mesoamerica, extinction, stone tools,..</td><td>Humanities</td></tr><tr><td>Professional Accounting</td><td>Auditing,reporting,regulation,valuation.,.</td><td>Other</td></tr><tr><td>Professional Law</td><td>Torts, criminal law, contracts, property, evidence..</td><td>Humanities</td></tr><tr><td>Professional Medicine</td><td>Diagnosis,pharmacotherapy, disease prevention,.</td><td>Other</td></tr><tr><td>Professional Psychology</td><td>Diagnosis,biology and behavior, lifespan development,.</td><td>Social Sciences</td></tr><tr><td>Public Relations</td><td></td><td></td></tr><tr><td>Security Studies</td><td>Media theory,crisis management, intelligence gathering,.</td><td>Social Sciences</td></tr><tr><td></td><td>Environmental security, terrorism,weapons of mass destruction,.</td><td>Social Sciences</td></tr><tr><td>Sociology</td><td>Socialization,cities and community, inequality and wealth.,..</td><td>Social Sciences</td></tr><tr><td>US Foreign Policy</td><td>Soft power, Cold War foreign policy, isolationism,.</td><td>Social Sciences</td></tr><tr><td>Virology</td><td>Epidemiology, coronaviruses,retroviruses, herpesviruses,.</td><td>Other</td></tr><tr><td>World Religions</td><td>Judaism, Christianity,Islam,Buddhism,Jainism.,..</td><td>Humanities</td></tr></table>
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 14: An Abstract Algebra example.
|
| 307 |
+
|
| 308 |
+
What is the embryological origin of the hyoid bone?
|
| 309 |
+
|
| 310 |
+
(A) The first pharyngeal arch (B) The first and second pharyngeal arches (C) The second pharyngeal arch (D) The second and third pharyngeal arches
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 15: An Anatomy example.
|
| 314 |
+
Figure 16: An Astronomy example.
|
| 315 |
+
|
| 316 |
+
Three contrasting tactics that CSO’s can engage in to meet their aims are which typically involves research and communication, , which may involve physically attacking a company’s operations or , often involving some form of .
|
| 317 |
+
|
| 318 |
+
(A) Non-violent direct action, Violent direct action, Indirect action, Boycott (B) Indirect action, Instrumental action, Non-violent direct action, Information campaign (C) Indirect action, Violent direct action, Non-violent direct-action Boycott. (D) Non-violent direct action, Instrumental action, Indirect action, Information campaign
|
| 319 |
+
|
| 320 |
+
How many attempts should you make to cannulate a patient before passing the job on to a senior colleague?
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 17: A Business Ethics example.
|
| 324 |
+
Figure 18: A Clinical Knowledge example.
|
| 325 |
+
|
| 326 |
+
In a given population, 1 out of every 400 people has a cancer caused by a completely recessive allele, b. Assuming the population is in Hardy-Weinberg equilibrium, which of the following is the expected proportion of individuals who carry the b allele but are not expected to develop the cancer?
|
| 327 |
+
|
| 328 |
+
(A) 1/400 (B) 19/400 (C) 20/400 (D) 38/400
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 19: A College Biology example.
|
| 332 |
+
Figure 20: A College Chemistry example.
|
| 333 |
+
|
| 334 |
+
Consider a computer design in which multiple processors, each with a private cache memory, share global memory using a single bus. This bus is the critical system resource. Each processor can execute one instruction every 500 nanoseconds as long as memory references are satisfied by its local cache. When a cache miss occurs, the processor is delayed for an additional 2,000 nanoseconds. During half of this additional delay, the bus is dedicated to serving the cache miss. During the other half, the processor cannot continue, but the bus is free to service requests from other processors. On average, each instruction requires 2 memory references. On average, cache misses occur on 1 percent of references. What proportion of the capacity of the bus would a single processor consume, ignoring delays due to competition from other processors?
|
| 335 |
+
|
| 336 |
+
(A) 1/50 (B) 1/27 (C) 1/25 (D) 2/27
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 21: A College Computer Science example.
|
| 340 |
+
Figure 22: A College Mathematics example.
|
| 341 |
+
|
| 342 |
+
In a genetic test of a newborn, a rare genetic disorder is found that has X-linked recessive transmission. Which of the following statements is likely true regarding the pedigree of this disorder?
|
| 343 |
+
|
| 344 |
+
(A) All descendants on the maternal side will have the disorder.
|
| 345 |
+
(B) Females will be approximately twice as affected as males in this family.
|
| 346 |
+
(C) All daughters of an affected male will be affected.
|
| 347 |
+
(D) There will be equal distribution of males and females affected.
|
| 348 |
+
|
| 349 |
+
One end of a Nichrome wire of length 2L and cross-sectional area A is attached to an end of another Nichrome wire of length L and cross- sectional area 2A. If the free end of the longer wire is at an electric potential of 8.0 volts, and the free end of the shorter wire is at an electric potential of 1.0 volt, the potential at the junction of the two wires is most nearly equal to
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 23: A College Medicine example.
|
| 353 |
+
Figure 24: A College Physics example.
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure 25: A Computer Security example.
|
| 357 |
+
Figure 26: A Conceptual Physics example.
|
| 358 |
+
|
| 359 |
+
A model airplane flies slower when flying into the wind and faster with wind at its back. When launched at right angles to the wind, a cross wind, its groundspeed compared with flying in still air is
|
| 360 |
+
|
| 361 |
+
(A) the same (B) greater (C) less (D) either greater or less depending on wind speed
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 27: An Econometrics example.
|
| 365 |
+
|
| 366 |
+
A point pole has a strength of $4 \pi \times 1 0 ^ { - 4 }$ weber. The force in newtons on a point pole of $4 \pi \times 1 . 5 \times 1 0 ^ { - 4 }$ weber placed at a distance of $1 0 \mathrm { c m }$ from it will be
|
| 367 |
+
(A) 15 N. (B) 20 N. (C) 7.5 N. (D) 3.75 N.
|
| 368 |
+
|
| 369 |
+
A total of 30 players will play basketball at a park. There will be exactly 5 players on each team. Which statement correctly explains how to find the number of teams needed?
|
| 370 |
+
|
| 371 |
+
(A) Add 5 to 30 to find 35 teams.
|
| 372 |
+
(B) Divide 30 by 5 to find 6 teams.
|
| 373 |
+
(C) Multiply 30 and 5 to find 150 teams.
|
| 374 |
+
(D) Subtract 5 from 30 to find 25 teams.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 28: An Electrical Engineering example.
|
| 378 |
+
Figure 29: An Elementary Mathematics example.
|
| 379 |
+
Figure 30: A Formal Logic example.
|
| 380 |
+
|
| 381 |
+
As of 2017, how many of the world’s 1-year-old children today have been vaccinated against some disease?
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 31: A Global Facts example.
|
| 385 |
+
|
| 386 |
+
Homologous structures are often cited as evidence for the process of natural selection. All of the following are examples of homologous structures EXCEPT
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 32: A High School Biology example.
|
| 390 |
+
|
| 391 |
+
From the solubility rules, which of the following is true?
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 33: A High School Chemistry example.
|
| 395 |
+
|
| 396 |
+
This question refers to the following information.
|
| 397 |
+
Albeit the king’s Majesty justly and rightfully is and ought to be the supreme head of the Church of England, and so is recognized by the clergy of this realm in their convocations, yet nevertheless, for corroboration and confirmation thereof, and for increase of virtue in Christ’s religion within this realm of England, and to repress and extirpate all errors, heresies, and other enormities and abuses heretofore used in the same, be it enacted, by authority of this present Parliament, that the king, our sovereign lord, his heirs and successors, kings of this realm, shall be taken, accepted, and reputed the only supreme head in earth of the Church of England, called Anglicans Ecclesia; and shall have and enjoy, annexed and united to the imperial crown of this realm, as well the title and style thereof, as all honors, dignities, preeminences, jurisdictions, privileges, authorities, immunities, profits, and commodities to the said dignity of the supreme head of the same Church belonging and appertaining; and that our said sovereign lord, his heirs and successors, kings of this realm, shall have full power and authority from time to time to visit, repress, redress, record, order, correct, restrain, and amend all such errors, heresies, abuses, offenses, contempts, and enormities, whatsoever they be, which by any manner of spiritual authority or jurisdiction ought or may lawfully be reformed, repressed, ordered, redressed, corrected, restrained, or amended, most to the pleasure of Almighty God, the increase of virtue in Christ’s religion, and for the conservation of the peace, unity, and tranquility of this realm; any usage, foreign land, foreign authority, prescription, or any other thing or things to the contrary hereof notwithstanding. English Parliament, Act of Supremacy, 1534
|
| 398 |
+
From the passage, one may infer that the English Parliament wished to argue that the Act of Supremacy would
|
| 399 |
+
(A) give the English king a new position of authority
|
| 400 |
+
(B) give the position of head of the Church of England to Henry VIII alone and exclude his heirs (C) establish Calvinism as the one true theology in England
|
| 401 |
+
(D) end various forms of corruption plaguing the Church in England During the third stage of the demographic transition model, which of the following is true? (A) Birth rates increase and population growth rate is less rapid.
|
| 402 |
+
(B) Birth rates decline and population growth rate is less rapid.
|
| 403 |
+
(C) Birth rates increase and population growth rate increases.
|
| 404 |
+
(D) Birth rates decrease and population growth rate increases. Which of the following best states an argument made by James Madison in The Federalist number 10?
|
| 405 |
+
(A) Honest politicians can prevent factions from developing.
|
| 406 |
+
(B) Factions are more likely to occur in large republics than in small ones.
|
| 407 |
+
(C) The negative effects of factionalism can be reduced by a republican government. (D) Free elections are the people’s best defense against factionalism.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 34: A High School Computer Science example.
|
| 411 |
+
Figure 35: A High School European History example.
|
| 412 |
+
Figure 36: A High School Geography example.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 37: A High School Government and Politics example.
|
| 416 |
+
Figure 38: A High School Macroeconomics example.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 39: A High School Mathematics example.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 40: A High School Microeconomics example.
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 41: A High School Physics example.
|
| 426 |
+
Figure 42: A High School Psychology example.
|
| 427 |
+
|
| 428 |
+
While swimming in the ocean, Ivan is frightened by a dark shadow in the water even before he has the chance to identify what the shadow is. The synaptic connections taking place during this incident of fright are best described by which of the following?
|
| 429 |
+
|
| 430 |
+
(A) Messages are sent from the thalamus directly to the amygdala.
|
| 431 |
+
(B) Messages are sent from the thalamus to the “what” and “where” pathways.
|
| 432 |
+
(C) Messages are sent from the parasympathetic nervous system to the cerebral cortex.
|
| 433 |
+
(D) Messages are sent from the frontal lobes to the pituitary gland. This question refers to the following information.
|
| 434 |
+
“Society in every state is a blessing, but government even in its best state is but a necessary evil; in its worst state an intolerable one; for when we suffer, or are exposed to the same miseries by a government, which we might expect in a country without government, our calamity is heightened by reflecting that we furnish the means by which we suffer. Government, like dress, is the badge of lost innocence; the palaces of kings are built on the ruins of the bowers of paradise. For were the impulses of conscience clear, uniform, and irresistibly obeyed, man would need no other lawgiver; but that not being the case, he finds it necessary to surrender up a part of his property to furnish means for the protection of the rest; and this he is induced to do by the same prudence which in every other case advises him out of two evils to choose the least. Wherefore, security being the true design and end of government, it unanswerably follows that whatever form thereof appears most likely to ensure it to us, with the least expense and greatest benefit, is preferable to all others.”
|
| 435 |
+
Thomas Paine, Common Sense, 1776
|
| 436 |
+
Which of the following “miseries” alluded to above were most condemned by Anti-Federalists of the post-Revolutionary era?
|
| 437 |
+
(A) Organized response to Bacon’s Rebellion.
|
| 438 |
+
(B) Federal response to Shays’s Rebellion.
|
| 439 |
+
(C) Federal response to the Whiskey Rebellion.
|
| 440 |
+
(D) Federal response to Pontiac’s Rebellion. This question refers to the following information.
|
| 441 |
+
“The real grievance of the worker is the insecurity of his existence; he is not sure that he will always have work, he is not sure that he will always be healthy, and he foresees that he will one day be old and unfit to work. If he falls into poverty, even if only through a prolonged illness, he is then completely helpless, left to his own devices, and society does not currently recognize any real obligation towards him beyond the usual help for the poor, even if he has been working all the time ever so faithfully and diligently. The usual help for the poor, however, leaves a lot to be desired, especially in large cities, where it is very much worse than in the country.”
|
| 442 |
+
Otto von Bismarck, 1884
|
| 443 |
+
Otto von Bismarck likely made this speech in reaction to which of the following issues? (A) Social acceptance of child labor.
|
| 444 |
+
(B) Declining life expectancy in Germany.
|
| 445 |
+
(C) Criticisms of German trade tariffs.
|
| 446 |
+
(D) Negative effects attributed to industrial capitalism. Would a reservation to the definition of torture in the ICCPR be acceptable in contemporary practice?
|
| 447 |
+
(A) This is an acceptable reservation if the reserving country’s legislation employs a different definition
|
| 448 |
+
(B) This is an unacceptable reservation because it contravenes the object and purpose of the ICCPR
|
| 449 |
+
(C) This is an unacceptable reservation because the definition of torture in the ICCPR is consistent with customary international law
|
| 450 |
+
(D) This is an acceptable reservation because under general international law States have the right to enter reservations to treaties
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
Figure 43: A High School Statistics example.
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
Figure 44: A High School US History example.
|
| 457 |
+
Figure 45: A High School World History example.
|
| 458 |
+
Figure 46: A Human Aging example.
|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
Figure 47: A Human Sexuality example.
|
| 462 |
+
|
| 463 |
+
Which position does Rawls claim is the least likely to be adopted by the POP (people in the original position)?
|
| 464 |
+
|
| 465 |
+
(A) The POP would choose equality above liberty. (B) The POP would opt for the ‘maximin’ strategy. (C) The POP would opt for the ‘difference principle.’ (D) The POP would reject the ‘system of natural liberty.’
|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
Figure 48: An International Law example.
|
| 469 |
+
Figure 49: A Jurisprudence example.
|
| 470 |
+
Figure 50: A Logical Fallacies example.
|
| 471 |
+
|
| 472 |
+

|
| 473 |
+
Figure 51: A Machine Learning example.
|
| 474 |
+
Figure 52: A Management example.
|
| 475 |
+
|
| 476 |
+
According to Lewin, Lippet and White’s 1939 experiment, which form of leadership produced the most work from participants?
|
| 477 |
+
|
| 478 |
+
(A) Laissez-faire
|
| 479 |
+
(B) Democratic
|
| 480 |
+
(C) Authoritarian
|
| 481 |
+
(D) A mix of laissez-faire and democratic The single group within society that is most vulnerable to reference group influence is: (A) The older consumer who feels somewhat left out of things.
|
| 482 |
+
(B) The married women, many of whom feel a need for stability in their lives.
|
| 483 |
+
(C) New immigrants who really want to assimilate into their new culture.
|
| 484 |
+
(D) Children, who base most of their buying decisions on outside influences.
|
| 485 |
+
|
| 486 |
+
Which of the following conditions does not show multifactorial inheritance?
|
| 487 |
+
|
| 488 |
+
(A) Pyloric stenosis
|
| 489 |
+
(B) Schizophrenia
|
| 490 |
+
(C) Spina bifida (neural tube defects)
|
| 491 |
+
(D) Marfan syndrome
|
| 492 |
+
|
| 493 |
+
If each of the following meals provides the same number of calories, which meal requires the most land to produce the food?
|
| 494 |
+
|
| 495 |
+
(A) Red beans and rice (B) Steak and a baked potato (C) Corn tortilla and refried beans (D) Lentil soup and brown bread
|
| 496 |
+
|
| 497 |
+
In response to Sandel’s “social justice” argument, Kamm argues that
|
| 498 |
+
(A) even if we were able to enhance ourselves or others, we would not thereby be obligated to do so.
|
| 499 |
+
(B) there is a difference between (i) choosing that one have a certain trait and (ii) being responsible for bearing the costs of that choice.
|
| 500 |
+
(C) having the option to enhance will lead to fewer instances of people who require the assistance of others.
|
| 501 |
+
(D) all of the above
|
| 502 |
+
|
| 503 |
+
For which of these two scenarios does the main character (who uses I/me/my) do something clearly morally wrong?
|
| 504 |
+
|
| 505 |
+
Scenario 1 | I drive very fast when I’m on a racetrack.
|
| 506 |
+
Scenario 2 | I drive very fast when I’m in the suburbs.
|
| 507 |
+
|
| 508 |
+
(A) Wrong, Wrong (B) Wrong, Not wrong (C) Not wrong, Wrong (D) Not wrong, Not wrong
|
| 509 |
+
|
| 510 |
+
Which of the following is the most plausible explanation for the protective effect of dietary fibre against cancer of the colon?
|
| 511 |
+
(A) Propionic acid, formed during colonic fibre fermentation inhibits liver fatty acid synthesis (B) Butyric acid, formed during colonic fibre fermentation stimulates "silencing" of the SLC5A8 tumour suppressor gene
|
| 512 |
+
(C) Butyric acid, formed during colonic fibre fermentation stimulates anti-oxidant defences in the colon
|
| 513 |
+
(D) None of these options are correct Researchers now believe that the decline of the Maya was caused chiefly by: (A) a cataclysm of some kind, such as an earthquake, volcano, or tsunami.
|
| 514 |
+
(B) ecological degradation resulting from slash-and-burn farming techniques.
|
| 515 |
+
(C) endless wars between neighboring Mayan city-states.
|
| 516 |
+
(D) practices of interbreeding that led to a steep rise in congenital disorders.
|
| 517 |
+
|
| 518 |
+

|
| 519 |
+
Figure 59: A Philosophy example.
|
| 520 |
+
|
| 521 |
+

|
| 522 |
+
Figure 60: A Prehistory example.
|
| 523 |
+
Figure 61: A Professional Accounting example.
|
| 524 |
+
Figure 62: A Professional Law example.
|
| 525 |
+
|
| 526 |
+
The night before his bar examination, the examinee’s next-door neighbor was having a party. The music from the neighbor’s home was so loud that the examinee couldn’t fall asleep. The examinee called the neighbor and asked her to please keep the noise down. The neighbor then abruptly hung up. Angered, the examinee went into his closet and got a gun. He went outside and fired a bullet through the neighbor’s living room window. Not intending to shoot anyone, the examinee fired his gun at such an angle that the bullet would hit the ceiling. He merely wanted to cause some damage to the neighbor’s home to relieve his angry rage. The bullet, however, ricocheted off the ceiling and struck a partygoer in the back, killing him. The jurisdiction makes it a misdemeanor to discharge a firearm in public. The examinee will most likely be found guilty for which of the following crimes in connection to the death of the partygoer?
|
| 527 |
+
|
| 528 |
+
(A) Murder.
|
| 529 |
+
(B) Involuntary manslaughter.
|
| 530 |
+
(C) Voluntary manslaughter.
|
| 531 |
+
(D) Discharge of a firearm in public.
|
| 532 |
+
|
| 533 |
+
A 63-year-old man is brought to the emergency department because of a 4-day history of increasingly severe left leg pain and swelling of his left calf. He also has a 1-month history of increasingly severe upper midthoracic back pain. During this time, he has had a $9 { \mathrm { - k g } }$ (20-lb) weight loss despite no change in appetite. He has no history of major medical illness. His only medication is ibuprofen. He is $1 8 0 ~ \mathrm { c m }$ (5 ft 11 in) tall and weighs $8 2 \mathrm { k g }$ (180 lb); BMI is 25 $\mathrm { k g } / \mathrm { m } 2$ . His vital signs are within normal limits. On examination, lower extremity pulses are palpable bilaterally. The remainder of the physical examination shows no abnormalities. An $\mathbf { X }$ -ray of the thoracic spine shows no abnormalities. A CT scan of the abdomen shows a 3-cm mass in the body of the pancreas; there are liver metastases and encasement of the superior mesenteric artery. Ultrasonography of the left lower extremity shows a femoropopliteal venous clot. Which of the following is the most likely cause of this patient’s symptoms?
|
| 534 |
+
|
| 535 |
+
(A) Carcinoid syndrome
|
| 536 |
+
(B) Hypercoagulability from advanced malignancy
|
| 537 |
+
(C) Multiple endocrine neoplasia
|
| 538 |
+
(D) Splenic artery aneurysm and embolic disease of the left lower extremity You work for a utility company that is building a biomass plant in the community. Your employer asks you to give a series of community talks about the plant and future operations. You visit the plant several hours before you are due to give a speech that has been prepared by your immediate supervisor. During the tour of the plant, you discover several claims in the speech are not true. What do you do?
|
| 539 |
+
(A) Write and deliver a new speech that you know is entirely correct.
|
| 540 |
+
(B) Cancel all speeches until you and your supervisor can get the information straight.
|
| 541 |
+
(C) Deliver the speech as prepared and discuss the inaccuracies with your supervisor afterward. (D) Address the inaccuracies with your supervisor immediately and make the necessary corrections before giving the speech. The Chemical Weapons Convention (CWC) prohibited the possession or deployment of chemical weapons; however it failed to implement stipulations that would require signatories to declare their existing stocks of chemical weapons, to identify facilities that were once involved in chemical production, or to announce when their existing stocks would be destroyed.
|
| 542 |
+
(A) The Chemical Weapons Convention (CWC) prohibited the possession or deployment of chemical weapons; however it failed to implement stipulations that would require signatories to declare their existing stocks of chemical weapons, to identify facilities that were once involved in chemical production, or to announce when their existing stocks would be destroyed.
|
| 543 |
+
(B) The CWC made some important developments regarding the use and possession of chemical weapons and the destruction of existing stockpiles. However, the treaty failed to establish an independent body empowered with the capacity to check treaty compliance. Lack of supra-state authority has undermined the ability to enforce those developments. Given the anarchical nature of international society it may be in the national security interest to retain stocks.
|
| 544 |
+
(C) Chemical weapons continue to exert a determining influence on international society. As early as the 1970s military strategists were convinced of the deterrence effects chemical weapons could have, comparable to the second strike survival logic of nuclear deterrence. The preferences of strategists resulted in continued manufacture and stockpiling of weapons creating an international crisis of stability.
|
| 545 |
+
(D) While the CWC has been ratified by the majority of international society, some nations with a large chemical capability at their disposal have yet to enter into the treaty. However, to some analysts the destructive military potential would be limited, having a moderate effect on a well-equipped army in conventional warfare. Chemical arsenal essentially falls under the category of the "poor mans" weaponry, being simplistic and inexpensive whilst having limited military utility. However, the concern remains of the prospective impact a terrorist chemical attack could have on civilian populations. An observational study in diabetics assesses the role of an increased plasma fibrinogen level on the risk of cardiac events. 130 diabetic patients are followed for 5 years to assess the development of acute coronary syndrome. In the group of 60 patients with a normal baseline plasma fibrinogen level, 20 develop acute coronary syndrome and 40 do not. In the group of 70 patients with a high baseline plasma fibrinogen level, 40 develop acute coronary syndrome and 30 do not. Which of the following is the best estimate of relative risk in patients with a high baseline plasma fibrinogen level compared to patients with a normal baseline plasma fibrinogen level?
|
| 546 |
+
(A) (40/30)/(20/40)
|
| 547 |
+
(B) $( 4 0 ^ { * } 4 0 ) / ( 2 0 ^ { * } 3 0 )$
|
| 548 |
+
(C) $( \mathbf { 4 0 ^ { * } 7 0 } ) / ( 2 \mathbf { 0 } ^ { * } \mathbf { 6 0 } )$
|
| 549 |
+
(D) (40/70)/(20/60)
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
Figure 63: A Professional Medicine example.
|
| 553 |
+
Figure 64: A Professional Psychology example.
|
| 554 |
+
Figure 65: A Public Relations example.
|
| 555 |
+
|
| 556 |
+

|
| 557 |
+
Figure 66: A Security Studies example.
|
| 558 |
+
Figure 67: A Sociology example.
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 68: A US Foreign Policy example.
|
| 562 |
+
Figure 69: A Virology example.
|
md/train/gl3D-xY7wLq/gl3D-xY7wLq.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NOISE OR SIGNAL: THE ROLE OF IMAGE BACK-GROUNDS IN OBJECT RECOGNITION
|
| 2 |
+
|
| 3 |
+
Kai Xiao, Logan Engstrom, Andrew Ilyas, Aleksander M ˛adry MIT {kaix,engstrom,ailyas,madry}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We assess the tendency of state-of-the-art object recognition models to depend on signals from image backgrounds. We create a toolkit for disentangling foreground and background signal on ImageNet images, and find that (a) models can achieve non-trivial accuracy by relying on the background alone, (b) models often misclassify images even in the presence of correctly classified foregrounds—up to $8 8 \%$ of the time with adversarially chosen backgrounds, and (c) more accurate models tend to depend on backgrounds less. Our analysis of backgrounds brings us closer to understanding which correlations machine learning models use, and how they determine models’ out of distribution performance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Object recognition models are typically trained to minimize loss on a given dataset, and evaluated by the accuracy they attain on the corresponding test set. In this paradigm, model performance can be improved by incorporating any generalizing correlation between images and their labels into decision-making. However, the actual model reliability and robustness depend on the specific set of correlations that is used, and on how those correlations are combined. Indeed, outside of the training distribution, model predictions can deviate wildly from human expectations either due to relying on correlations that humans do not perceive (Jetley et al., 2018; Ilyas et al., 2019; Jacobsen et al., 2019), or due to overusing correlations, such as texture (Geirhos et al., 2019; Baker et al., 2018) and color (Yip & Sinha, 2002), that humans do use (but to a lesser degree). Characterizing the correlations that models depend on thus has important implications for understanding model behavior, in general.
|
| 12 |
+
|
| 13 |
+
Image backgrounds are a natural source of correlation between images and their labels in object recognition. Indeed, prior work has shown that models may use backgrounds in classification (Zhang et al., 2007; Ribeiro et al., 2016; Zhu et al., 2017; Rosenfeld et al., 2018; Zech et al., 2018; Barbu et al., 2019; Shetty et al., 2019; Sagawa et al., 2020; Geirhos et al., 2020), and suggests that even human vision makes use of image context for scene and object recognition (Torralba, 2003). In this work, we aim to obtain a deeper and more holistic understanding of how current state-of-the-art image classifiers utilize image backgrounds. To this end, in contrast to most of the prior work (which tends to study relatively small and often newly-curated image datasets1), our focus is on ImageNet (Russakovsky et al., 2015)—one of the largest and most widely used datasets, with state-of-the-art training methods, architectures, and pre-trained models tuned to work well for it.
|
| 14 |
+
|
| 15 |
+
Zhu et al. (2017) analyze ImageNet classification (focusing on the older, AlexNet model) to find that AlexNet achieves small but non-trivial test accuracy on a dataset consisting of only backgrounds (where foreground objects are replaced by black rectangles). While sufficient for establishing that backgrounds can be used for classification, we aim to go beyond those initial explorations to get a more fine-grained understanding of the relative importance of backgrounds and foregrounds, for newer, state-of-the-art models, and to provide a versatile toolkit for others to use. Specifically, we investigate the extent to which models rely on backgrounds, the implications of this reliance, and how models’ use of backgrounds has evolved over time. Concretely:
|
| 16 |
+
|
| 17 |
+
• We create a suite of datasets that help disentangle (and control for different aspects of) the impact of foreground and background signals on classification. The code and datasets are publicly available for others to use in this repository: https://github.com/ MadryLab/backgrounds_challenge.
|
| 18 |
+
|
| 19 |
+
• Using the aforementioned toolkit, we characterize models’ reliance on image backgrounds. We find that image backgrounds alone suffice for fairly successful classification and that changing background signals decreases average-case performance. In fact, we further show that by choosing backgrounds in an adversarial manner, we can make standard models misclassify $8 8 \%$ of images as the background class.
|
| 20 |
+
• We demonstrate that standard models not only use but require backgrounds for correctly classifying large portions of test sets $3 5 \%$ on our benchmark).
|
| 21 |
+
• We study the impact of backgrounds on classification for a variety of classifiers, and find that models with higher ImageNet test accuracy tend to simultaneously have higher accuracy on image backgrounds alone and have greater robustness to changes in image background.
|
| 22 |
+
|
| 23 |
+
# 2 METHODOLOGY
|
| 24 |
+
|
| 25 |
+
To properly gauge image backgrounds’ role in image classification, we construct a synthetic dataset for disentangling background from foreground signal: ImageNet-9.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Variations of the synthetic dataset ImageNet-9, as described in Table 1. We label each image with its pre-trained ResNet-50 classification—green, if corresponding with the original label; red, if not. The model correctly classifies the image as “insect” when given: the original image, only the background, and two cases where the original foreground is present but the background changes. Note that, in particular, the model fails in two cases when the original foreground is present but the background changes (as in MIXED-NEXT or ONLY-FG).
|
| 29 |
+
|
| 30 |
+
Base dataset: ImageNet-9. We organize a subset of ImageNet into a new dataset with nine coarse-grained classes and call it ImageNet-9 (IN-9) 2. To create it, we group together ImageNet classes sharing an ancestor in the WordNet (Miller, 1995) hierarchy. We use coarse-grained classes because there are not enough images with annotated bounding boxes (which we need to disentangle backgrounds and foregrounds) to use the standard labels. The resulting IN-9 dataset is class-balanced and has 45405 training images and 4050 testing images. While we can (and do) apply our methods on the full ImageNet dataset as well, we choose to focus on this coarse-grained version of ImageNet because of its higher-fidelity images. We describe the dataset creation process in detail and discuss the advantages of focusing on IN-9 in Appendix A.
|
| 31 |
+
|
| 32 |
+
Variations of ImageNet-9 From this base set of images, which we call the ORIGINAL version of IN-9, we create seven other synthetic variations designed to understand the impact of backgrounds. We use both rectangular bounding boxes and the foreground segmentation algorithm GrabCut (Rother et al., 2004), as implemented in OpenCV, to disentangle backgrounds and foregrounds. We visualize these variations in Figure 1, and provide a detailed reference in Table 1. These subdatasets of IN-9 differ only in how they process the foregrounds and backgrounds of each constituent image.
|
| 33 |
+
|
| 34 |
+
Larger dataset: IN-9L We finally create a dataset called IN-9L that consists of all the images in ImageNet corresponding to the classes in ORIGINAL (rather than just the images that have associated bounding boxes). This dataset has about 180k training images in total. We leverage this larger dataset to train better generalizing models, and prefer to analyze models trained on IN-9L whenever possible.
|
| 35 |
+
|
| 36 |
+
Table 1: The 8 modified subdatasets created from ImageNet-9, which are visualized in Figure 1. The foreground detection method refers to how the pixels corresponding to the foreground are found. GrabCut refers to the foreground segmentation algorithm implemented in OpenCV. Random backgrounds in the last three datasets are taken from ONLY-BG-T. For more details see Appendix A.
|
| 37 |
+
|
| 38 |
+
<table><tr><td>Name</td><td>Foreground</td><td>Background</td><td>Foreground Detection Method</td></tr><tr><td>ORIGINAL</td><td>Unmodified</td><td>Unmodified</td><td></td></tr><tr><td>ONLY-BG-B</td><td>Black</td><td>Unmodified</td><td>Bounding Box</td></tr><tr><td>ONLY-BG-T</td><td>Tiled background</td><td>Unmodified</td><td>Bounding Box</td></tr><tr><td>No-FG</td><td>Black</td><td>Unmodified</td><td>GrabCut</td></tr><tr><td>ONLY-FG</td><td>Unmodified</td><td>Black</td><td>GrabCut</td></tr><tr><td>MIXED-SAME</td><td>Unmodified</td><td>Random BG of the same class</td><td>GrabCut</td></tr><tr><td>MIXED-RAND</td><td>Unmodified</td><td>Random BG of a random class</td><td>GrabCut</td></tr><tr><td>MIXED-NEXT</td><td>Unmodified</td><td>Random BG of the next class</td><td>GrabCut</td></tr></table>
|
| 39 |
+
|
| 40 |
+
# 3 QUANTIFYING RELIANCE ON BACKGROUND SIGNALS
|
| 41 |
+
|
| 42 |
+
With ImageNet-9 in hand, we now assess the role of image backgrounds in classification.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: We train models on each of the “background-only” datasets, then evaluate each on its corresponding test set as well as the ORIGINAL test set. Even though the model only learns from background signal, it achieves (much) better than random performance on both the corresponding test set and ORIGINAL. Here, random guessing would give $1 1 . 1 1 \%$ (the dotted line).
|
| 46 |
+
|
| 47 |
+
Backgrounds suffice for classification. Prior work has found that models are able to make accurate predictions based on backgrounds alone; we begin by directly quantifying this ability. Looking at the ONLY-BG-T, ONLY-BG-B, and NO-FG datasets, we find (cf. Figure 2) that models trained on these background-only training sets generalize reasonably well to both their corresponding test sets and to unmodified images from the ORIGINAL test set (around $40 { - } 5 0 \%$ for every model, far above the
|
| 48 |
+
|
| 49 |
+
Table 2: Performance of state-of-the-art computer vision models on selected test sets of ImageNet9. We include both pre-trained ImageNet models and models of different architectures that we train on IN-9L. The BG-GAP is defined as the difference in test accuracy between MIXED-SAME and MIXED-RAND and helps assess the tendency of such models to rely on background signal. Architectures are sorted by their test accuracies on ImageNet and ORIGINAL for pre-trained and IN-9L-trained models, respectively. Shaded in grey are the two architectures that can be directly compared across datasets (ResNet-50 and Wide-ResNet-50x2).
|
| 50 |
+
|
| 51 |
+
<table><tr><td></td><td colspan="4">Pre-trained on ImageNet</td><td colspan="5">Trained on IN-9L</td></tr><tr><td>Test dataset</td><td>MobileNet-v3</td><td>EfficientNet-b0</td><td>ResNet-50</td><td>WRN-50x2 DPN-92</td><td>AlexNet</td><td>ShufleNet</td><td>ResNet-50</td><td>WRN-50x2</td><td>VGG16-BN</td></tr><tr><td>ImageNet</td><td>67.9%</td><td>77.2%</td><td>77.6%</td><td>78.5% 80.0%</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ORIGINAL</td><td>95.5%</td><td>96.1%</td><td>96.9%</td><td>96.6% 97.2%</td><td>86.7%</td><td>95.7%</td><td>96.3%</td><td>97.2%</td><td>97.6%</td></tr><tr><td>ONLY-BG-T</td><td>16.3%</td><td>16.5%</td><td>17.4%</td><td>18.8% 17.6%</td><td></td><td>41.5% 43.6%</td><td>43.6%</td><td>45.1%</td><td>45.7%</td></tr><tr><td>MIXED-SAME</td><td>84.0%</td><td>86.2%</td><td>91.0%</td><td>88.3%</td><td>90.5%</td><td>76.2% 86.7%</td><td>89.9%</td><td>90.6%</td><td>91.0%</td></tr><tr><td>MIXED-RAND</td><td>73.2%</td><td>76.3%</td><td>84.3%</td><td>81.4%</td><td>86.1%</td><td>54.2% 69.4%</td><td>75.6%</td><td>78.0%</td><td>78.0%</td></tr><tr><td>BG-gap</td><td>10.8%</td><td>9.9%</td><td>6.7%</td><td>6.9%</td><td>4.4%</td><td>22.0% 17.3%</td><td>14.3%</td><td>12.6%</td><td>13.0%</td></tr></table>
|
| 52 |
+
|
| 53 |
+
baseline of $11 \%$ representing random classification). Our results confirm that image backgrounds contain signal that models can accurately classify standard images with.
|
| 54 |
+
|
| 55 |
+
Models exploit background signal for classification. We discover that models can misclassify due to background signal, especially when the background class does not match that of the foreground. As a demonstration, we study model accuracies on the MIXED-RAND dataset, where image backgrounds are randomized and thus provide no information about the correct label. By comparing test accuracies on MIXED-RAND and MIXED-SAME 3, where images have class-consistent backgrounds, we can measure classifiers’ dependence on the correct background. We denote the resulting accuracy gap between MIXED-SAME and MIXED-RAND as the BG-GAP; this difference represents the drop in model accuracy due to changing the class signal from the background. In Table 2, we observe a BG-GAP of $1 3 \mathrm { - } 2 2 \%$ and $4 \%$ for models trained on IN-9L and ImageNet, respectively, suggesting that backgrounds often mislead state-of-the-art models even when the correct foreground is present.
|
| 56 |
+
|
| 57 |
+
More Training Data can reduce the BG-GAP. Our results indicate that ImageNet-trained models are less dependent on backgrounds than their IN-9L-trained counterparts—they have a smaller (but still significant) BG-GAP, and perform worse when predicting solely based on backgrounds (i.e., on the ONLY-BG-T dataset). We explore two ways that ImageNet differs from IN-9L to understand this phenomena—ImageNet has (a) more datapoints than IN-9L, and (b) a more fine-grained class structure. Figure 3 shows that more training data reduces the BG-GAP, particularly when the training dataset size approaches the size of ImageNet. This indicates that training on much more data (and thus, more backgrounds) can reduce (but not eliminate) the effect of backgrounds on model predictions. An ablation study of ImageNet’s more fine-grained class structure does not find strong evidence supporting its helpfulness (cf. Appendix B).
|
| 58 |
+
|
| 59 |
+
Models are vulnerable to adversarial backgrounds. To understand how worst-case backgrounds impact models’ performance, we evaluate model robustness to adversarially chosen backgrounds. We find that $8 8 \%$ of foregrounds are susceptible to such backgrounds; that is, for these foregrounds, there is a background that causes the classifier to classify the resulting foreground-background combination as the background class. For a finer grained look, we also evaluate image backgrounds based on their attack success rate (ASR), i.e., how frequently they cause models to predict the (background) class in the presence of a conflicting foreground class. As an example, Figure 4 shows the five backgrounds with the highest ASR for the insect class—these backgrounds (extracted from insect images in ORIGINAL) fool a IN-9L-trained ResNet-50 model into predicting insect on up to $52 \%$ of non-insect foregrounds. We plot a histogram of ASR over all insect backgrounds in Figure 24 of the Appendix—it has a long tail. Similar results are observed for other classes as well (cf. Appendix G).
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: We compare test accuracies on MIXED-SAME and MIXED-RAND and observe that training with more data reduces the BG-GAP (BG-GAP measures the effect of backgrounds on model predictions). While this trend is true for models trained on both IN-9 and ImageNet, the trend is most noticeable for models trained on the largest training set, the full ImageNet dataset—this is shown on the far right side of the graph.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 4: The adversarial backgrounds that most frequently fool IN-9L-trained models into classifying a given foreground as insect, ordered by the percentage of foregrounds fooled. The total portion of images that can be fooled (by any background from this class) is $6 6 . 5 5 \%$ .
|
| 66 |
+
|
| 67 |
+
Training on MIXED-RAND reduces background dependence. Next, we explore how to reduce models’ dependence on background. To this end, we train models on MIXED-RAND, a synthetic dataset where background signals are decorrelated from class labels. As we would expect, MIXEDRAND-trained models extract less signal from backgrounds: evaluation results show that MIXEDRAND models perform poorly ( $15 \%$ accuracy—barely higher than random) on datasets with only backgrounds and no foregrounds, (ONLY-BG-T or ONLY-BG-B).
|
| 68 |
+
|
| 69 |
+
Indeed, such models are also more accurate on datasets where backgrounds do not match foregrounds. In Figure 5, we observe that a MIXED-RAND-trained model has $1 7 . 3 \%$ higher accuracy than its ORIGINAL-trained counterpart on MIXED-RAND, and $2 2 . 3 \%$ higher accuracy on MIXED-NEXT, a dataset where background signals class-consistently mismatch foregrounds. (Recall that MIXEDNEXT images have foregrounds from class $y$ mixed with backgrounds from class $y + 1$ , labeled as class $y$ .) The MIXED-RAND-trained model also has little variation (at most $3 . 8 \%$ ) in accuracy across all five test sets that contain the correct foreground.
|
| 70 |
+
|
| 71 |
+
Qualitatively, the MIXED-RAND-trained model also appears to place more relative importance on foreground pixels than the ORIGINAL-trained model; the saliency maps of the two models in Figure 6 show that the MIXED-RAND-trained model’s saliency maps highlight more foreground pixels than those of ORIGINAL-trained models.
|
| 72 |
+
|
| 73 |
+
A fine grained look at dependence on backgrounds. We now analyze models’ reliance on backgrounds at an image-by-image level and ask: for which images does introducing backgrounds help or hurt classifiers’ performance? To this end, for each image in ORIGINAL, we decompose how models use foreground and background signals by examining classifiers’ predictions on the corresponding image in MIXED-RAND and ONLY-BG-T. Here, we use the MIXED-RAND and ONLY-BG-T predictions as a proxy for which class the foreground and background signals (alone) point towards, respectively. We categorize each image based on how its background and foreground signals impact classification; we list the categories in Table 3 and show the counts for each category as a histogram per classifier in Figure 7. Our results show that while few backgrounds induce misclassification (see Appendix H for examples), a large fraction of images require backgrounds for correct classification—approximately $3 5 \%$ on the ORIGINAL trained classifiers, as calculated by combining the “BG Required” and “BG+FG Required” categories.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 5: We compare the test performance of a model trained on the synthetic MIXED-RAND dataset with a model trained on ORIGINAL. We evaluate these models on variants of IN-9 that contain identical foregrounds. For the ORIGINAL-trained model, test performance decreases significantly when the background signal is modified during testing. However, the MIXED-RAND-trained model is robust to background changes, albeit at the cost of lower accuracy on images from ORIGINAL.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 6: Saliency maps for the the ORIGINAL and MIXED-RAND models on two images. As expected, the MIXED-RAND model appears to place more importance on foreground pixels.
|
| 80 |
+
|
| 81 |
+
Further insights derived from IN-9 are discussed in the Appendix D. We focus on key findings in this section, but also include more comprehensive results and examples of other questions that can be explored by using the toolkit of IN-9 in the Appendix.
|
| 82 |
+
|
| 83 |
+
# 4 BENCHMARK PROGRESS AND BACKGROUND DEPENDENCE
|
| 84 |
+
|
| 85 |
+
In the previous sections, we demonstrated that standard image classification models exploit signals from backgrounds. Considering that these models result from progress on standard computer vision benchmarks, a natural question is: to what extent have improvements on image classification benchmarks resulted from exploiting background correlations? And relatedly, how has model robustness to misleading background signals evolved over time?
|
| 86 |
+
|
| 87 |
+
As a first step towards answering these questions, we study the progress made by ImageNet models on our synthetic IN-9 dataset variations. In Figure 8 we plot accuracy on our synthetic datasets against ImageNet accuracy for each of the architectures considered. As evidenced by the lines of best fit in Figure 8, accuracy increases on the original ImageNet benchmark generally correspond to accuracy increases on all of the synthetic datasets. This includes the ONLY-BG datasets—indicating that models do improve at extracting correlations from image backgrounds.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
|
| 91 |
+
Indeed, the ONLY-BG trend observed in Figure 8 suggests that either (a) image classification models can only attain their reported accuracies in the presence of background signals; or (b) these models carry an implicit bias towards features in the background, as a result of optimization technique, model class, etc.—in this case, we may need explicit regularization (e.g., through distributionally robust optimization (Sagawa et al., 2020) or related techniques) to obtain models invariant to these background features. The ONLY-BG trend does not indicate that models are failing per se; it could also indicate that models learn to depend on backgrounds because they are necessary for correctly classifying certain images due to quirks in the ImageNet dataset.
|
| 92 |
+
|
| 93 |
+
Still, models’ relative improvement in accuracy across dataset variants is promising—models improve on classifying ONLY-BG-T at a slower (absolute) rate than MIXED-RAND, MIXED-SAME and MIXED-NEXT. Furthermore, the performance gap between the MIXED datasets and the others (most notably, between MIXED-RAND and MIXED-SAME; between MIXED-NEXT and MIXED-RAND; and consequently between MIXED-NEXT and MIXED-SAME) trends towards closing, indicating that models not only are becoming better at using foreground features, but also are becoming more robust to misleading background features (MIXED-RAND and MIXED-NEXT). Finally, models also improve in accuracy faster on NO-FG (which has foreground shape but no texture) than on ONLY-BG-T, which implies that better models are using foreground shape features more effectively.
|
| 94 |
+
|
| 95 |
+
Overall, the accuracy trends observed from testing ImageNet models on our synthetic datasets reveal that better models (a) are capable of exploiting background correlations, but (b) are increasingly robust to changes in background, suggesting that invariance to background features may not necessarily come at the cost of benchmark accuracy.
|
| 96 |
+
|
| 97 |
+
# 5 RELATED WORK
|
| 98 |
+
|
| 99 |
+
Prior works on contextual bias from image backgrounds4 show that background correlations can be predictive (Torralba, 2003) and can influence model decisions. Zhang et al. (2007) find that (a) a bagof-features object detection algorithm depends on image backgrounds in the PASCAL dataset and (b) using this algorithm on a training set with varying backgrounds leads to better generalization. Beery et al. (2018) and Barbu et al. (2019) collect new test datasets of animals and objects, respectively. Barbu et al. (2019) focus on object classes that also exist in ImageNet, and their new test set contains objects photographed in front of unconventional backgrounds and in unfamiliar orientations. Both works show that computer vision models experience significant accuracy drops when trained on data with one set of backgrounds and tested on data with another. Sagawa et al. (2020) create a synthetic dataset of Waterbirds, where waterbirds and landbirds from one dataset are combined with water and land backgrounds from another. They show that a model’s reliance on spurious correlations with the background can be harmful for small subgroups of data where those spurious correlations no longer hold (e.g. landbirds on water backgrounds). Rosenfeld et al. (2018) analyze background dependence for object detection (as opposed to classification) models on the MS-COCO dataset. They transplant an object from one image to another image, and find that object detection models may detect the transplanted object differently depending on its location, and that the transplanted object may also cause mispredictions on other objects in the image. Zech et al. (2018) study medical imaging and show that a model learned to detect a hospital-specific metal token on medical scans. The model then used each hospital’s pneumonia prevalence rate to predict pneumonia fairly well (without learning much about actually detecting pneumonia).
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 7: We categorize each test set image based on how a model classifies the full image, the background alone, and the foreground alone (cf. Table 3). The model trained on ORIGINAL needs the background for correct classification on $3 5 \%$ of images (measured by adding “BG Required” and $\mathrm { \Delta ^ { 6 } G + F G }$ Required), while a model trained on MIXED-RAND is much less reliant on background. The model trained on ONLY-BG-T requires the background most, as expected; however, the model often misclassifies both the full image and the background, so the “BG Irrelevant” subset is still sizable.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 8: Measuring progress on each of the synthetic ImageNet-9 datasets with respect to progress on the standard ImageNet test set. Higher accuracy on ImageNet generally corresponds to higher accuracy on each of the constructed datasets, but the rate at which accuracy grows varies based on the types of features present in each dataset. Each pre-trained model corresponds to a vertical line on the plot—we mark ResNet-50 and MobileNet-v3s models for reference.
|
| 106 |
+
|
| 107 |
+
The only work that, similarly to us, studies a large-scale dataset in this context is Zhu et al. (2017), who analyze ImageNet and show that AlexNet can achieve nontrivial accuracy on a dataset similar to our ONLY-BG-B dataset. While sufficient for establishing that backgrounds can be used for classification, this dataset also introduces biases by adding large black rectangular patches to all of the images (which our ONLY-BG-T dataset fixes). In comparison to Zhu et al. (2017) and the other prior works, we: (a) properly segment foregrounds and backgrounds using the GrabCut algorithm instead of relying on rectangular bounding boxes; (b) create dataset variations that allow us to measure not just model performance without foregrounds, but also the relative influence of foregrounds and backgrounds on model predictions; (c) control for the effect of image artifacts by focusing on comparisons between the MIXED-SAME and MIXED-RAND datasets; (d) study model robustness to adversarial backgrounds; (e) study a larger and more recent set of classifiers (He et al., 2016; Zagoruyko & Komodakis, 2016; Tan & Le, 2019); (f) show how improvements they give on ImageNet relate to background dependence; and (g) make our benchmarking toolkit publicly accessible for others to use and build on.
|
| 108 |
+
|
| 109 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 110 |
+
|
| 111 |
+
In this work, we study the extent to which classifiers rely on image backgrounds. To this end, we create a toolkit for measuring the precise role of background and foreground signal that involves constructing new test datasets that contain different amounts of each. Through these datasets we establish both the usefulness of background signal and the tendency of our models to depend on backgrounds, even when relevant foreground features are present. Our results show that our models are not robust to changes in the background, either in the adversarial case, or in the average case.
|
| 112 |
+
|
| 113 |
+
As most ImageNet images have human-recognizable foreground objects, our models appear to rely on background more than humans on that dataset. The fact that models can be fooled by adversarial background changes on $8 8 \%$ of all images highlights how poorly computer vision models may perform in an out-of-distribution setting. However, contextual information like the background can still be useful in certain settings. After all, humans do use backgrounds as context in visual processing, and the background may be necessary if the foreground is blurry or distorted (Torralba, 2003). Therefore, reliance on background is a nuanced question that merits further study.
|
| 114 |
+
|
| 115 |
+
On one hand, our findings provide evidence that models succeed by using background correlations, which may be undesirable in some applications. On the other hand, we find that advances in classifiers have given rise to models that use foregrounds more effectively and are more robust to changes in the background. To obtain even more robust models, we may want to draw inspiration from successes in training on the MIXED-RAND dataset (a dataset designed to neutralize background signal—cf. Table 1), related data-augmentation techniques (Shetty et al., 2019), and training algorithms like distributionally robust optimization (Sagawa et al., 2020) and model-based robust learning (Robey et al., 2020). Overall, the toolkit and findings in this work help us to better understand models and to monitor our progress toward the goal of reliable machine learning.
|
| 116 |
+
|
| 117 |
+
# REFERENCES
|
| 118 |
+
|
| 119 |
+
Nicholas Baker, Hongjing Lu, Gennady Erlikhman, and Philip J. Kellman. Deep convolutional networks do not classify based on global object shape. In PLOS Computational Biology, 2018.
|
| 120 |
+
|
| 121 |
+
Andrei Barbu, David Mayo, Julian Alverio, William Luo, C Wang, Dan Gutfreund, Josh Tenenbaum, and Boris Katz. Objectnet: A large-scale bias-controlled dataset for pushing the limits of object recognition models. In Neural Information Processing Systems, 2019.
|
| 122 |
+
|
| 123 |
+
Sara Beery, Grant van Horn, and Pietro Perona. Recognition in terra incognita. In European Conference on Computer Vision (ECCV), 2018.
|
| 124 |
+
|
| 125 |
+
Antonio Criminisi, Patrick Pérez, and Kentaro Toyama. Region filling and object removal by exemplar-based image inpainting. In IEEE Transactions on Image Processing, 2004.
|
| 126 |
+
|
| 127 |
+
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 International Conference on Learning Representations, 2019.
|
| 128 |
+
|
| 129 |
+
Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A. Wichmann. Shortcut learning in deep neural networks. In arXiv preprint arXiv:2004.07780, 2020.
|
| 130 |
+
|
| 131 |
+
Michael Harville, Gaile Gordon, and John Woodfill. Foreground segmentation using adaptive mixture models in color and depth. In IEEE Workshop on Detection and Recognition of Events in Video, 2001.
|
| 132 |
+
|
| 133 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 134 |
+
|
| 135 |
+
Andrew Ilyas, Shibani Santurkar, Logan Engstrom, Dimitris Tsipras, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 136 |
+
|
| 137 |
+
Jorn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance causes adversarial vulnerability. In International Contemporary on Learning Representations (ICLR), 2019.
|
| 138 |
+
|
| 139 |
+
Saumya Jetley, Nicholas Lord, and Philip Torr. With friends like these, who needs adversaries? In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 140 |
+
|
| 141 |
+
Aditya Khosla, Tinghui Zhou, Tomasz Malisiewicz, Alexei A. Efros, and Antonio Torralba. Undoing the damage of dataset bias. In European Conference on Computer Vision (ECCV), 2012.
|
| 142 |
+
|
| 143 |
+
George Miller. Wordnet: a lexical database for english. In Communications of the ACM, 1995.
|
| 144 |
+
|
| 145 |
+
Choi Myung Jin, Antonio Torralba, and Alan S. Willsky. Context models and out-of-context objects. In Pattern Recognition Letters, 2012.
|
| 146 |
+
|
| 147 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. “why should i trust you?”: Explaining the predictions of any classifier. In International Conference on Knowledge Discovery and Data Mining, 2016.
|
| 148 |
+
|
| 149 |
+
Alexander Robey, Hamed Hassani, and George J. Pappas. Model-based robust deep learning. In arXiv preprint arXiv:2005.10247, 2020.
|
| 150 |
+
|
| 151 |
+
Amir Rosenfeld, Richard S. Zemel, and John K. Tsotsos. The elephant in the room. In arXiv preprint arXiv:1808.03305, 2018.
|
| 152 |
+
|
| 153 |
+
Carsten Rother, Vladimir Kolmogorov, and Andrew Blake. Grabcut: Interactive foreground extraction using iterated graph cuts. In ACM Transactions on Graphics, 2004.
|
| 154 |
+
|
| 155 |
+
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), 2015.
|
| 156 |
+
|
| 157 |
+
Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations, 2020.
|
| 158 |
+
|
| 159 |
+
Rakshith Shetty, Mario Fritz, and Bernt Schiele. Adversarial scene editing: Automatic object removal from weak supervision. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 160 |
+
|
| 161 |
+
Rakshith Shetty, Bernt Schiele, and Mario Fritz. Not using the car to see the sidewalk–quantifying and controlling the effects of context in classification and segmentation. In Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 162 |
+
|
| 163 |
+
Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning (ICML), 2019.
|
| 164 |
+
|
| 165 |
+
Antonio Torralba. Contextual priming for object detection. In International Journal of Computer Vision (IJCV), 2003.
|
| 166 |
+
|
| 167 |
+
Andrew W. Yip and Pawan Sinha. Contribution of color to face recognition. In Perception, 2002.
|
| 168 |
+
|
| 169 |
+
Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S. Huang. Generative image inpainting with contextual attention. In Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 170 |
+
|
| 171 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference (BMVC), 2016.
|
| 172 |
+
|
| 173 |
+
John R. Zech, Marcus A. Badgeley, Manway Liu, Anthony B. Costa, Joseph J. Titano, and Eric Karl Oermann. Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: A cross-sectional study. In PLoS Medicine, 2018.
|
| 174 |
+
|
| 175 |
+
Jianguo Zhang, Marcin Marszalek, Svetlana Lazebnik, and Cordelia Schmid. Local features and kernels for classification of texture and object categories: A comprehensive study. In International Journal of Computer Vision (IJCV), 2007.
|
| 176 |
+
|
| 177 |
+
Zhuotun Zhu, Lingxi Xie, and Alan Yuille. Object recognition without and without objects. In International Joint Conference on Artificial Intelligence, 2017.
|
| 178 |
+
|
| 179 |
+
# A DATASETS DETAILS
|
| 180 |
+
|
| 181 |
+
We choose the following 9 high-level classes.
|
| 182 |
+
|
| 183 |
+
Table 4: The 9 classes of ImageNet-9.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Class</td><td>WordNet ID</td><td>Number of sub-classes</td></tr><tr><td>Dog</td><td>n02084071</td><td>116</td></tr><tr><td>Bird</td><td>n01503061</td><td>52</td></tr><tr><td>Vehicle</td><td>n04576211</td><td>42</td></tr><tr><td>Reptile</td><td>n01661091</td><td>36</td></tr><tr><td>Carnivore</td><td>n02075296</td><td>35</td></tr><tr><td>Insect</td><td>n02159955</td><td>27</td></tr><tr><td>Instrument</td><td>n03800933</td><td>26</td></tr><tr><td>Primate</td><td>n02469914</td><td>20</td></tr><tr><td>Fish</td><td>n02512053</td><td>16</td></tr></table>
|
| 186 |
+
|
| 187 |
+
All datasets used in the paper are balanced by randomly removing images from classes that are over-represented. We only keep as many images as the smallest post-modification synthetic dataset, so all synthetic datasets (except IN-9L) have the same number of images. We also use a custom GUI to manually process the test set to improve data quality. For IN-9L, the only difference from using the corresponding classes in the original ImageNet dataset is that we balance the dataset.
|
| 188 |
+
|
| 189 |
+
For all images: we apply the following filters before adding each image to our datasets.
|
| 190 |
+
|
| 191 |
+
• The image must have bounding box annotations.
|
| 192 |
+
• For simplicity, each image must have exactly one bounding box. A large majority of images that have bounding box annotations satisfy this.
|
| 193 |
+
|
| 194 |
+
For images needing a properly segmented foreground: This includes the 3 MIXED datasets, ONLY-FG, and NO-FG. We filter out images based on the following criteria.
|
| 195 |
+
|
| 196 |
+
• Because images are cropped before they are fed into models, we require that less than $50 \%$ of the bounding box is removed by the crop, to ensure that the foreground still exists. Almost all images pass this filter. The OpenCV foreground segmentation function cv2.grabCut (used to extract the foreground shape) must work on the image. We remove images where it fails. For the test set only, we manually remove images with foreground segmentations that retain a significant portion of the background signal. For the test set only, we manually remove foreground segmentations that are very bad (e.g. the segmentation selects part of the image, and that part doesn’t contain the foreground object).
|
| 197 |
+
|
| 198 |
+
For images needing only background signal: This includes ONLY-BG-B and ONLY-BG-T. In this case, we apply the following criteria:
|
| 199 |
+
|
| 200 |
+
• The bounding box must not be too big (more than $90 \%$ of the image). The intent here is to avoid ONLY-BG-B images being just a large black rectangle.
|
| 201 |
+
• For the test set only, we manually remove ONLY-BG images that still have an instance of the class even after removing the bounding box. This occurs when the bounding boxes are imperfect or incomplete (e.g. only one of two dogs in an image is labeled with a bounding box).
|
| 202 |
+
|
| 203 |
+
Creating the ONLY-BG-T dataset: We first make a “tiled” version of the background by finding the largest rectangular strip (horizontal or vertical) outside the bounding box, and tiling the entire image with that strip. We then replace the removed foreground with the tiled background. A visual example is provided in Figure 9. We purposefully choose not to use deep-learning-based inpainting techniques such as (Shetty et al., 2018) to replace the removed foreground, as such methods could lead to biases that the inpainting model has learned from the data. For example, an inpainting model may learn that the best way to inpaint a missing chunk of a flower is to place an insect there, which is something we want to avoid.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 9: Visualization of how ONLY-BG-T is created.
|
| 207 |
+
|
| 208 |
+
Motivation for each IN-9 variation: We create ONLY-BG-B and ONLY-BG-T to remove the foreground completely, including the shape of the foreground object. We intend for ONLY-BG-B to be directly comparable to the prior work of Zhu et al. (2017) that uses similar methodology to evaluate older AlexNet models, while ONLY-BG-T is a more natural-looking background that avoids black rectangles introduced in ONLY-BG-B.
|
| 209 |
+
|
| 210 |
+
The NO-FG dataset is created to retain the foreground shape, but not the texture. We can use it to assess the relative importance of foreground shape compared to foreground texture.
|
| 211 |
+
|
| 212 |
+
Finally, we create four datasets that have identical foregrounds but each have distinct background signals. ONLY-FG has a pure black background to go with the foreground. MIXED-SAME has background signal from the same class as the foreground. MIXED-RAND has background signal from a random class, so it can be thought of as having neutral background signal. MIXED-NEXT has background signal from the next class, which will always be in conflict with the foreground . Any artifacts in the foreground that result from our image processing pipeline are equally present in all four datasets. Thus, these datasets help to isolate how much backgrounds alone influence model predictions when the correct foreground exists in the image.
|
| 213 |
+
|
| 214 |
+
Full-ImageNet version of each synthetic variation: We also apply the same methodology for disentangling foreground and background signal to the entire ImageNet validation set, creating Full-ImageNet (Full-IN) versions of each of our 7 dataset variations.
|
| 215 |
+
|
| 216 |
+
We evaluate a pre-trained ResNet-50 on Full-IN for comparison in Table 5, and observe similar trends to ImageNet-9 that lead to similar conclusions on model background reliance. We choose to focus on ImageNet-9 results in the main paper because of the following shortcomings of Full-IN.
|
| 217 |
+
|
| 218 |
+
1. Individual classes are quite small, as some classes have very few (or even zero) images that make it through our filters due to lack of proper annotated bounding boxes.
|
| 219 |
+
2. When bounding boxes do exist, their quality is often lower than those in the IN-9 classes. For example, many images of fruit contain multiple fruit, but only one will be properly annotated with a bounding box.
|
| 220 |
+
3. When creating the MIXED-NEXT equivalent for Full-IN, the next class is often similar to the previous one. For example, many dog breeds occur consecutively in ImageNet. Thus, Full-IN’s MIXED-NEXT frequently has backgrounds that are similar to backgrounds from the foreground class.
|
| 221 |
+
|
| 222 |
+
# B EXPLAINING THE DECREASED BG-GAP OF PRE-TRAINED IMAGENET MODELS
|
| 223 |
+
|
| 224 |
+
We investigate two possible explanations for why pre-trained ImageNet models have a smaller BGGAP than models trained on ImageNet-9. Understanding this phenomenon can help inform how models should be trained to be more background-robust. We find slight improvements to backgroundrobustness from training on more fine-grained classes. We find that training on larger datasets helps only slightly when the training dataset set size is smaller than IN-9L, but larger improvements occur when the training dataset size is bigger. Thus, we encourage training on larger datasets if reduced background robustness is the goal.
|
| 225 |
+
|
| 226 |
+
# B.1 THE EFFECT OF FINE-GRAINEDNESS ON THE BG-GAP
|
| 227 |
+
|
| 228 |
+
One possible explanation is that training models to distinguish between finer-grained classes forces them to focus more on the foreground, which contains relevant features for making those fine-grained distinctions, than the background, which may be fairly similar across sub-classes of a high-level class. This suggests that asking models to solve more fine-grained tasks could improve model robustness to background changes.
|
| 229 |
+
|
| 230 |
+
To test the effect of fine-grainedness on ImageNet-9, we make a related dataset called IN-9LB that uses the same 9 high-level classes and can be cleanly modified into more fine-grained versions. Specifically, for IN-9LB we choose exactly 16 sub-classes for each high-level class, for a total of 144 ImageNet classes. To create successively more fine-grained versions of the IN-9LB dataset, we group every $n$ sub-classes together into a higher-level class, for $n \in \{ 1 , 2 , 4 , 8 , 1 6 \}$ . Here, $n = 1$ corresponds to keeping all 144 ImageNet classes as they are, while $n = 1 6$ corresponds to only having 9 high-level classes, like ImageNet-9. Because we keep all images from those original ImageNet classes, this dataset is the same size as IN-9L.
|
| 231 |
+
|
| 232 |
+
We train models on IN-9LB at different levels of fine-grainedness and evaluate the BG-GAP of those models in Figure 10. We find that fine-grained models have a smaller BG-GAP as well as better performance on MIXED-NEXT, but the improvement is very slight and also comes at the cost of decreased accuracy on ORIGINAL. The BG-GAP of the most fine-grained classifier is $2 . 3 \%$ smaller than the BG-GAP of the most coarse-grained classifier, showing that fine-grainedness does improve background-robustness. However, the improvement is still small compared to the size of the BG-GAP (which is $1 3 . 3 \%$ for the fine-grained classifier).
|
| 233 |
+
|
| 234 |
+
# B.2 THE EFFECT OF LARGER DATASET SIZE ON THE BG-GAP
|
| 235 |
+
|
| 236 |
+
A second possible explanation for why pre-trained ImageNet models have a smaller BG-GAP is that training on larger datasets is important for background-robustness. To evaluate this possibility, we train models on different-sized subsets of IN-9LB. The largest dataset we train on is the full IN-9LB dataset, which is 4 times as large as IN-9, and the smallest is 1/4 as large as IN-9. Figure 11 shows that increasing the dataset size does increase overall performance but only slightly decreases the BG-GAP.
|
| 237 |
+
|
| 238 |
+
Next, we train models on different-sized subsets of ImageNet; we use the pre-trained ResNet-50 ImageNet model for full-sized ImageNet, and we train new ResNet-50 models on subsets that are 1/2, 1/4, 1/8, 1/16, and 1/32 as large as ImageNet. In these cases, we observe in Figure 12 that training on more data does not help significantly when the training dataset sizes are still small, but it does help more noticeably for models trained on $1 / 2$ of ImageNet and all of ImageNet.
|
| 239 |
+
|
| 240 |
+
It is possible that having both a fine-grained class structure and more training data simultaneously is important for background-robustness. Furthermore, more training data (from other classes that are not in IN-9L) may also be the cause of the increased background-robustness of pre-trained ImageNet models.
|
| 241 |
+
|
| 242 |
+
# B.3 SUMMARY OF METHODS INVESTIGATED TO REDUCE THE BG-GAP
|
| 243 |
+
|
| 244 |
+
In Figure 13, we compare the BG-GAP of ResNet-50 models trained on different datasets and with different methods to a ResNet-50 pre-trained on ImageNet. We explore $\ell _ { p }$ -robust training, increasing dataset size, and making the classification task more fine-grained, and find that none of these methods reduces the BG-GAP as much as pre-training on ImageNet. The only method that reduces the BG-GAP significantly more is training on MIXED-RAND. Furthermore, the same trends hold true if we measure the difference between MIXED-SAME and MIXED-NEXT as opposed to the BG-GAP (the difference between MIXED-SAME and MIXED-RAND).
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 10: We train models on IN-9LB at different levels of fine-grainedness (more training classes is more fine-grained). The BG-GAP, or the difference between the test accuracies on MIXED-SAME and MIXED-RAND, decreases as we make the classification task more fine-grained, but the decrease is small compared to the size of the BG-GAP.
|
| 248 |
+
|
| 249 |
+

|
| 250 |
+
Figure 11: We train models on different-sized subsets of IN-9LB. The largest training set we use is the full IN-9LB dataset, which is 4 times larger than ImageNet-9. While performance on all test datasets improves as the amount of training data increases, the BG-GAP has almost the same size regardless of the amount of training data used.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 12: We train models on different-sized subsets of ImageNet. We use a pre-trained ResNet-50 for the rightmost datapoints corresponding to training on the full ImageNet dataset, which is about 30 times larger than ImageNet-9. The BG-GAP begins to decrease when the training dataset set size is sufficiently large.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Mixed-Same vs. Mixed-Rand Accuracy for Different Models
|
| 257 |
+
Figure 13: We compare various different methods of training models and measure their BG-GAP, or the difference between MIXED-SAME and MIXED-RAND test accuracy. We find that (1) Pretrained IN models have surprisingly small BG-GAP. (2) Increasing fine-grainedness (IN-9LB Coarse vs. IN-9LB Fine) and dataset size (IN-9 vs. IN-9L) decreases the BG-GAP only slightly. (3) $\ell _ { p }$ -robust training does not help. (4) Training on MIXED-RAND (cf. Section 3 appears to be the most effective strategy for reducing the BG-GAP. For such a model, the MIXED-SAME and MIXED-RAND accuracies are nearly identical.
|
| 258 |
+
|
| 259 |
+
# C TRAINING AND EVALUATION DETAILS
|
| 260 |
+
|
| 261 |
+
For all models, we use fairly standard training settings for ImageNet-style models. We train for 200 epochs using SGD with a batch size of 256, a learning rate of 0.1 (with learning rate drops every 50 epochs), a momentum parameter of 0.9, a weight decay of 1e−4, and data augmentation (random resized crop, random horizontal flip, and color jitter). Unless specified, we always use a standard ResNet-50 architecture (He et al., 2016). For the experiment depicted in Figure 11, we found that using a smaller learning rate of 0.01 was necessary for training to converge on the smallest training sets. Thus, we used that same learning rate for all models in Figure 11.
|
| 262 |
+
|
| 263 |
+
When evaluating ImageNet classifiers on IN-9, we map all ImageNet predictions to their corresponding coarse-grained class in IN-9. For example, we map both giant schnauzer and Irish terrier to dog, and both goldfish and tiger shark to FISH. If an ImageNet classifier outputs a class that has no corresponding coarse-grained class in IN-9, we consider the prediction incorrect.
|
| 264 |
+
|
| 265 |
+
# D ADDITIONAL EVALUATION RESULTS
|
| 266 |
+
|
| 267 |
+
We include full results of training models on every synthetic IN-9 variation and then testing them on every synthetic IN-9 variation in Table 5. In addition to being more comprehensive, this table and these IN-9 variations can help answer a variety of questions, of which we provide three examples here. Finally, we also evaluate a pre-trained model on Full-ImageNet (Full-IN) versions of each synthetic IN-9 variation for comparison.
|
| 268 |
+
|
| 269 |
+
# How does more training data affect model performance with and without object shape?
|
| 270 |
+
|
| 271 |
+
We already show closely related results on the effect of more training data on the BG-GAP in Figure 11. Here, we compare model test performance on the NO-FG and ONLY-BG-B test sets. Both replace the foreground with black, but only NO-FG retains the foreground shape.
|
| 272 |
+
|
| 273 |
+
By comparing the models trained on ORIGINAL and IN-9L (4x more training data), we find that
|
| 274 |
+
|
| 275 |
+
1. The ORIGINAL-trained model performs about $9 \%$ better on NO-FG than ONLY-BG-B, indicating that it can slightly improve accuracy by using object shape. 2. The IN-9L-trained model performs about $22 \%$ better on NO-FG than ONLY-BG-B, showing that it can improve accuracy far more by using object shape.
|
| 276 |
+
|
| 277 |
+
Furthermore, both models perform very similarly on ONLY-BG-B. Thus, this suggests that more training data may allow models to learn to use object shape more effectively. Understanding this phenomena further could help inform model training and dataset collection if the goal is to train models that are able to leverage shape effectively.
|
| 278 |
+
|
| 279 |
+
# How much information is leaked from the size of the foreground bounding box?
|
| 280 |
+
|
| 281 |
+
The scale of an object already gives signal correlated with the object class (Torralba, 2003). Even though they are designed to avoid having foreground signal, the background-only datasets ONLYBG-B and ONLY-BG-T may inadvertently leak information about object scale due to the bounding box sizes being recognizable.
|
| 282 |
+
|
| 283 |
+
To gauge the extent of this leakage, we can measure how models trained on datasets where only the foreground signal has useful correlation (MIXED-RAND or ONLY-FG) perform on the backgroundonly test sets. We find that there is small signal leakage from bounding box size alone—a model trained on ONLY-FG achieves about $23 \%$ background-only test accuracy, suggesting that it is able to exploit the signal leakage to some degree. A model trained on MIXED-RAND achieves about $15 \%$ background-only test accuracy, just slightly better than random, perhaps because it is harder for models to measure (and thus, make use of) object scale when training on MIXED-RAND.
|
| 284 |
+
|
| 285 |
+
The existence of a small amount of information leakage in this case shows the importance of comparing MIXED-SAME (as opposed to just ORIGINAL) with MIXED-RAND and MIXED-NEXT when assessing model dependence on backgrounds. Indeed, the MIXED datasets may contain (1) image processing artifacts, such as rough edges from the foreground processing, and (2) small traces of the original background. This makes it important to control for both factors when measuring how models react to varying background signal.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 14: Comparing model accuracy on ONLY-BG-T across different foreground object bounding box sizes. We observe that the model is more likely to succeed when shown only image backgrounds if the removed foreground objects have smaller bounding boxes. The dotted line represents the overall accuracy of the model on ONLY-BG-T (averaged over all bounding box sizes).
|
| 289 |
+
|
| 290 |
+
# How does foreground bounding box size affect accuracy on ONLY-BG-T?
|
| 291 |
+
|
| 292 |
+
We further find that models are more able to predict accurately using the background signal alone when the foreground object is smaller—this is visualized in Figure 14. Intuitively this result makes sense, as most state-of-the-art models are trained with cropping-based data augmentation, which can remove small foreground objects from training images. Thus, models are actually trained to succeed when small foreground objects are cropped out, and our toolkit confirms that this is indeed the case.
|
| 293 |
+
|
| 294 |
+
<table><tr><td rowspan="2">Trained on</td><td colspan="7">Test Dataset</td><td rowspan="2"></td><td rowspan="2">IN-9L</td></tr><tr><td>MIXED-NEXT</td><td>MIXED-RAND</td><td>MIXED-SAME</td><td>No-FG</td><td>ONLY-BG-B</td><td>ONLY-BG-T</td><td>ONLY-FG ORIGINAL</td></tr><tr><td>MIXED-NEXT</td><td>78.07</td><td>53.28</td><td>48.49</td><td>16.20</td><td>11.19</td><td>8.22</td><td>59.60</td><td>52.32</td><td>46.44</td></tr><tr><td>MIXED-RAND</td><td>71.09</td><td>71.53</td><td>71.33</td><td>26.72</td><td>15.33</td><td>14.62</td><td>74.89</td><td>73.23</td><td>67.53</td></tr><tr><td>MIXED-SAME</td><td>45.41</td><td>51.36</td><td>74.40</td><td>39.85</td><td>35.19</td><td>41.58</td><td>61.65</td><td>75.01</td><td>69.21</td></tr><tr><td>No-FG</td><td>13.70</td><td>18.74</td><td>42.79</td><td>70.91</td><td>36.79</td><td>42.52</td><td>31.48</td><td>48.94</td><td>47.62</td></tr><tr><td>ONLY-BG-B</td><td>10.35</td><td>15.41</td><td>38.37</td><td>37.85</td><td>54.30</td><td>42.54</td><td>21.38</td><td>42.10</td><td>41.01</td></tr><tr><td>ONLY-BG-T</td><td>11.48</td><td>17.09</td><td>45.80</td><td>40.84</td><td>38.49</td><td>50.25</td><td>19.19</td><td>49.06</td><td>47.94</td></tr><tr><td>ONLY-FG</td><td>33.04</td><td>35.88</td><td>47.63</td><td>27.90</td><td>23.58</td><td>22.59</td><td>84.20</td><td>54.62</td><td>51.50</td></tr><tr><td>ORIGINAL</td><td>48.77</td><td>53.58</td><td>73.80</td><td>42.22</td><td>32.94</td><td>40.54</td><td>63.23</td><td>85.95</td><td>80.38</td></tr><tr><td>IN-9L</td><td>71.21</td><td>75.60</td><td>89.90</td><td>55.78</td><td>34.02</td><td>43.60</td><td>84.12</td><td>96.32</td><td>94.61</td></tr><tr><td>ImageNet</td><td>82.99</td><td>84.32</td><td>90.99</td><td>52.69</td><td>12.69</td><td>17.36</td><td>90.17</td><td>96.89</td><td>95.33</td></tr><tr><td>ImageNet (Full-IN)</td><td>51.47</td><td>48.69</td><td>64.34</td><td>21.70</td><td>7.98</td><td>9.51</td><td>59.19</td><td>76.07</td><td>-</td></tr></table>
|
| 295 |
+
|
| 296 |
+
Table 5: The test accuracies, in percentages, of ResNet-50 models trained on all variants of ImageNet9, and a pre-trained ImageNet ResNet-50. The bottom row and the second-to-last-row test the same pre-trained ImageNet model; however, the bottom row tests the model on the Full-IN version of each dataset variation. Testing on Full-IN shows similar trends as testing on ImageNet-9. Note that the MIXED-NEXT test accuracy is actually higher than the MIXED-RAND test accuracy in the bottom row because the next class is often very similar to the previous class in Full-IN.
|
| 297 |
+
|
| 298 |
+
# What about other ways of modifying the background signal?
|
| 299 |
+
|
| 300 |
+
One can modify the background in various other ways—for example, instead of replacing the background with black as in ONLY-FG, the background can be blurred as in the BG-BLURRED image of Figure 15. As expected, blurred backgrounds are still slightly correlated with the correct class. Thus, test accuracies for standard models on this dataset are higher than on ONLY-FG, but lower than on MIXED-SAME (which has signal from random class-aligned backgrounds that are not blurred). While we do not investigate all possible methods of modifying background signal, we believe that the variations we do examine in ImageNet-9 already improve our understanding of how background signals matter. Investigating other variations could provide an even more nuanced understanding of what parts of the background are most important.
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 15: Backgrounds can also be modified in other ways; for example, it can be blurred. Our evaluations on this dataset show similar results.
|
| 304 |
+
|
| 305 |
+
# E ADDITIONAL RELATED WORKS AND EXPLICIT COMPARISONS
|
| 306 |
+
|
| 307 |
+
There has been prior work on mitigating contextual bias in image classification, the influence of background signals on various datasets, and techniques like foreground segmentation that we leverage.
|
| 308 |
+
|
| 309 |
+
Mitigating Contextual Bias: (Khosla et al., 2012) focuses on mitigating dataset-specific contextual bias and proposes learning SVMs with both general weights and dataset-specific weights, while (Myung Jin et al., 2012) creates an out-of-context detection task with 209 out-of-context images and suggests using graphical models to solve it. (Shetty et al., 2019) focuses on the role of cooccurring objects as context in the MS-COCO dataset, and uses object removal to show that (a) models can still predict a removed object when only co-occurring objects are shown, and (b) special data-augmentation can mitigate this.
|
| 310 |
+
|
| 311 |
+
Explicit Comparison to Prior Works Studying the Influence of Backgrounds: In comparison to prior works on the influence of image backgrounds (described in Section 5), our work contributes the following.
|
| 312 |
+
|
| 313 |
+
• We develop a toolkit for analyzing the background dependence of ImageNet classifiers, the most common benchmark for computer vision progress. Only (Zhu et al., 2017), which we compare to in Section 5, also focuses on ImageNet. The test datasets we create separate and mix foreground and background signals in various ways (cf. Table 1), allowing us to study the sensitivity of models to these signals in a more fine-grained manner. Our toolkit for separating foreground and background can be applied without humanannotated foreground segmentation, which prior works on MS-COCO and Waterbirds rely on. This is important because foreground segmentation annotations are hard to collect and do not exist for ImageNet.
|
| 314 |
+
• We study the extent of background dependence in the extreme case of adversarial backgrounds.
|
| 315 |
+
• We focus on better vision models, including ResNet (He et al., 2016), Wide ResNet(Zagoruyko & Komodakis, 2016), and EfficientNet (Tan & Le, 2019).
|
| 316 |
+
• We evaluate how improvements on the ImageNet benchmark have affected background dependence (cf. Section 4). We will publicly release our toolkit (code and datasets) for benchmarking background dependence so that others can also use it to better understand their own models. Our toolkit is compatible with any ImageNet-trained model.
|
| 317 |
+
|
| 318 |
+
Foreground Segmentation and Image Inpainting: In order to create IN-9 and its variants, we rely on OpenCV’s implementation of the foreground segmentation algorithm GrabCut (Rother et al.,
|
| 319 |
+
|
| 320 |
+
2004). Foreground segmentation is a branch of computer vision that seeks to automatically extract the foreground from an image (Harville et al., 2001). After finding the foreground, we remove it and simply replace the foreground with copies of parts of the background. Other works solve this problem, called image inpainting, either using exemplar-based methods (Criminisi et al., 2004) or using deep learning Yu et al. (2018); Shetty et al. (2018). (Shetty et al., 2018) both detects the foreground for removal and inpaints the removed region. However, more advanced inpaintings techniques can be slow and inaccurate when the region that must be inpainted is relatively large (Shetty et al., 2018), which is the case for many ImageNet images. Exploring better ways of segementing the foreground and inpainting the removed foreground could improve our analysis toolkit further.
|
| 321 |
+
|
| 322 |
+
# F ADDITIONAL EXAMPLES OF SYNTHETIC DATASETS
|
| 323 |
+
|
| 324 |
+
We randomly sample an image from each class, and display all synthetic variations of that image, as well as the predictions of a pre-trained ResNet-50 (trained on IN-9L) on each variant.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 16: ImageNet-9 variations—Dog.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 17: ImageNet-9 variations—Bird.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 18: ImageNet-9 variations—Vehicle.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 19: ImageNet-9 variations—Reptile.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 20: ImageNet-9 variations—Carnivore.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 21: ImageNet-9 variations—Instrument.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 22: ImageNet-9 variations—Primate.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 23: ImageNet-9 variations—Fish.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 24: Histogram of insect backgrounds grouped by how often they cause (non-insect) foregrounds to be classified as insect by a IN-9L-trained model. We visualize the five backgrounds that fool the classifier on the largest percentage of images in Figure 4.
|
| 352 |
+
|
| 353 |
+
# G ADVERSARIAL BACKGROUNDS
|
| 354 |
+
|
| 355 |
+
We compute the adversarial background attack success rate for 4 models in Table 6. While the MIXED-RAND model is more adversarially background robust than the ORIGINAL model, it is less adversarially background robust than the IN-9L model. The model trained on all of ImageNet is the most adversarially background robust of all models. This suggests that increasing training dataset size (IN-9L) has a bigger effect on adversarial background robustness than randomizing backgrounds during training (MIXED-RAND). On the other hand, the MIXED-RAND model has a much lower BG-GAP than the IN-9L model, indicating that models with a smaller BG-GAP are not necessarily robust to adversarial backgrounds, and vice versa.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Training Dataset |ORIGINAL</td><td></td><td>MIXED-RAND</td><td>IN-9L</td><td>ImageNet</td></tr><tr><td>Attack Success Rate</td><td>99.0%</td><td>93.5%</td><td>88.0%</td><td>77.7%</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 6: Adversarial backgrounds attack success rates for 4 models analyzed in this paper. The ORIGINAL and the MIXED-RAND are trained on equally small datasets, IN-9L is trained on $4 \mathbf { x }$ more data, and the ImageNet model is trained on the most data.
|
| 360 |
+
|
| 361 |
+
Next, we visualize the attack success rate distribution of the different backgrounds from the insect class in Figure 24. The long tail of the distribution indicates that many backgrounds are especially capable of fooling models.
|
| 362 |
+
|
| 363 |
+
Finally, we include the 5 most fooling backgrounds for all classes, the fool rate for each of those 5 backgrounds, and the total fool rate across all backgrounds from that class (on the left of each row) below.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 25: Most adversarial backgrounds—Dog.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 26: Most adversarial backgrounds—Bird.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 27: Most adversarial backgrounds—Vehicle.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 28: Most adversarial backgrounds—Reptile.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 29: Most adversarial backgrounds—Carnivore.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 30: Most adversarial backgrounds—Instrument.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 31: Most adversarial backgrounds—Primate.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 32: Most adversarial backgrounds—Fish.
|
| 388 |
+
|
| 389 |
+
# H EXAMPLES OF FOOLING BACKGROUNDS IN UNMODIFIED IMAGES
|
| 390 |
+
|
| 391 |
+
We visualize examples of images where the background of the full original image actually fools models in Figure 33. For these images, models classify the foreground alone correctly, but they predict the same wrong class on the full image and the background. We denote these images as “BG Fools” in Table 3 and Figure 7. While this category is relatively rare (accounting for just $3 \%$ of the ORIGINAL-trained model’s predictions), they reveal a subset of original images where background signal hurts classifier performance. Qualitatively, we observe that these images all have confusing or misleading backgrounds.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 33: Images that are incorrectly classified (as the class on the top row, which is the same class that their background alone from ONLY-BG-T is classified as), but are correctly classified (as the class on the bottom row) when the background is randomized. Note that these images have confusing backgrounds that could be associated with another class.
|
md/train/nLYMajjctMh/nLYMajjctMh.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/o2mbl-Hmfgd/o2mbl-Hmfgd.md
ADDED
|
Binary file (51.8 kB). View file
|
|
|
md/train/rJedV3R5tm/rJedV3R5tm.md
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RELGAN: RELATIONAL GENERATIVE ADVERSARIAL NETWORKS FOR TEXT GENERATION
|
| 2 |
+
|
| 3 |
+
Weili Nie∗ Rice University wn8@rice.edu
|
| 4 |
+
|
| 5 |
+
Nina Narodytska
|
| 6 |
+
VMware Research
|
| 7 |
+
nnarodytska@vmware.com
|
| 8 |
+
|
| 9 |
+
Ankit B. Patel Rice University & Baylor College of Medicine abp4@rice.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Generative adversarial networks (GANs) have achieved great success at generating realistic images. However, the text generation still remains a challenging task for modern GAN architectures. In this work, we propose RelGAN, a new GAN architecture for text generation, consisting of three main components: a relational memory based generator for the long-distance dependency modeling, the Gumbel-Softmax relaxation for training GANs on discrete data, and multiple embedded representations in the discriminator to provide a more informative signal for the generator updates. Our experiments show that RelGAN outperforms current state-of-the-art models in terms of sample quality and diversity, and we also reveal via ablation studies that each component of RelGAN contributes critically to its performance improvements. Moreover, a key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity via the use of a single adjustable parameter. Finally, RelGAN is the first architecture that makes GANs with Gumbel-Softmax relaxation succeed in generating realistic text.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Generative adversarial networks (GANs) (Goodfellow et al., 2014) were originally designed to generate continuous data and have achieved a lot of success at generating continuous samples, such as images. Recently, GANs were extended to generate discrete data, in particular text sequences (Kusner & Hernandez-Lobato, 2016; Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017; ´ Fedus et al., 2018). However, this extension is not straightforward. The main issue is that outputs of GANs for the discrete data generation are not differentiable and thus the standard gradient-based techniques cannot be applied directly in these settings. To overcome this, most state-of-the-art GANs have used the REINFORCE algorithm (Williams, 1992) and its variants that originate from the reinforcement learning (RL) community to train the generator while the discriminator is still a classifier to discriminate real and generated text and provides reward signals for the generator updates. A detailed description of the related work is deferred to Appendix 4.
|
| 18 |
+
|
| 19 |
+
Although these state-of-the-art GANs have shown some promising results in text generation as compared to the conventional maximum likelihood estimation (MLE) method, they also suffer from some fundamental issues, including training instability and mode collapse. First, their performance is quite sensitive to random parameter initializations and hyperparameter choices (Semeniuta et al., 2018). Moreover, many GANs heavily employ RL heuristics, such as Monte Carlo search (Yu et al., 2017) and hierarchical RL (Guo et al., 2017), making the already difficult-to-train GANs more complicated and thus the individual role of adversarial training unclear. The second issue is mode collapse as the generated text sentences tend to be less diverse (Semeniuta et al., 2018; Fedus et al., 2018) and it becomes more severe when generating longer sentences. The mode collapse issue can be caused either by a lack of expressive power in the generator (since it may not be capable of covering many more complex modes in data distribution), or by a less informative guiding signal in the discriminator (as it may constrain the generator updates to within certain modes).
|
| 20 |
+
|
| 21 |
+
In this work, we propose a new GAN architecture – Relational GAN (RelGAN), whose design is motivated by the issues identified above. The RelGAN architecture mainly consists of three parts: 1) a relational memory (Santoro et al., 2018) based generator, which promises more expressive power and better ability of modeling longer-range dependencies in text; 2) Gumbel-Softmax relaxation (Jang et al., 2016; Maddison et al., 2016) for training GANs on discrete data, which simplifies our model, enabling us to stay within a classical GAN framework without intensive RL heuristics; 3) multiple embedded representations in the discriminator, enabling a more diverse and informative signal for the generator updates. We experimentally demonstrate that RelGAN outperforms most current models in terms of sample quality and diversity. Furthermore, we show via ablation studies that each part of RelGAN plays an important role in its performance improvements. A key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity, via the use of a single adjustable parameter. Finally, to the best of our knowledge, RelGAN is the first architecture to demonstrate that GANs with Gumbel-Softmax relaxation are capable of generating realistic text.
|
| 22 |
+
|
| 23 |
+
# 2 RELGAN
|
| 24 |
+
|
| 25 |
+
# 2.1 RELATIONAL MEMORY BASED GENERATOR
|
| 26 |
+
|
| 27 |
+
Current dominant GANs for text generation, such as Kusner & Hernandez-Lobato (2016); Yu et al. ´ (2017); Lin et al. (2017); Guo et al. (2017); Fedus et al. (2018) are built using LSTM (Hochreiter & Schmidhuber, 1997) as the generator architecture. However, the LSTM-based generator might be the bottleneck of GANs from the following experimental observations: 1) The discriminator’s loss value very quickly goes to near its minimum after few iterations of adversarial training. It means that the discriminator may be much more powerful than the generator and can easily distinguish between real and fake samples. 2) Mode collapse in current GANs (Fedus et al., 2018) may also partly indicate the incapacity of generator, as it may not be expressive enough to fit all the modes of data distribution. 3) Current GANs perform poorly at long sentence generation (Guo et al., 2017), and we know that LSTM packs all information about the previous text sequences into a common hidden vector, potentially limiting its ability of modeling the long-distance dependency.
|
| 28 |
+
|
| 29 |
+
Therefore, we propose to use the more powerful module – relational memory (Santoro et al., 2018) – as the generator architecture for text generation. The basic idea of relational memory is to consider a fixed set of memory slots (e.g. memory matrix) and allow for interactions between memory slots by using the self-attention mechanism (Vaswani et al., 2017). The empirical findings by Santoro et al. (2018) showed that relational memory performs better in the language modeling compared to LSTM. Intuitively, the use of multiple memory slots and the attention across these memories can increase the expressive power of generator and its ability of generating longer text sentences.
|
| 30 |
+
|
| 31 |
+
Formally, we assume each row of the memory $M _ { t }$ represents a memory slot and Figure 1 shows how self-attention updates $M _ { t }$ by incorporating new observation $x _ { t }$ at time $t$ . Given $H$ heads, we have $H$ sets of queries, keys and values via three linear transformations, respectively: For each head, we get query $\bar { Q } _ { t } ^ { ( h ) } = \dot { M } _ { t } W _ { q } ^ { ( h ) }$ , key $K _ { t } ^ { ( h ) } = [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) }$ and value $V _ { t } ^ { ( \dot { h } ) } = [ \dot { M _ { t } } ; x _ { t } ] W _ { v } ^ { ( h ) }$ where $[ ; ]$ denotes the row-wise concatenation. Thus, the updated memory $\tilde { M } _ { t + 1 }$ is given by
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\tilde { M } _ { t + 1 } = [ \tilde { M } _ { t + 1 } ^ { ( 1 ) } : \cdot \cdot \cdot : \tilde { M } _ { t + 1 } ^ { ( H ) } ] , \tilde { M } _ { t + 1 } ^ { ( h ) } = \sigma \left( \frac { M _ { t } W _ { q } ^ { ( h ) } ( [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) } ) ^ { T } } { \sqrt { d _ { k } } } \right) [ M _ { t } ; x _ { t } ] W _ { v } ^ { ( h ) }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\sigma ( \cdot )$ denotes the softmax function which is performed on each row, $d _ { k }$ is the column dimension of the key $K _ { t } ^ { ( h ) }$ and $[ : ]$ denotes the column-wise concatenation.
|
| 38 |
+
|
| 39 |
+
By following the same idea of Santoro et al. (2018), the next memory $M _ { t + 1 }$ and output (logits) $o _ { t }$ of the generator at time $t$ are given by
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
M _ { t + 1 } = f _ { \theta _ { 1 } } ( \tilde { M } _ { t + 1 } , M _ { t } ) , o _ { t } = f _ { \theta _ { 2 } } ( \tilde { M } _ { t + 1 } , M _ { t } )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
respectively, where the two parametrized functions $f _ { \theta _ { 1 } }$ and $f _ { \boldsymbol { \theta _ { 2 } } }$ are combinations of skip connections, multi-layer perceptron (MLP), gated operations and/or pre-softmax linear transformations.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: The self-attention mechanism for updating the memory from $M _ { t }$ to $\tilde { M } _ { t + 1 }$ by incorporating new observation $x _ { t }$ , where each row of the memory matrix $M _ { t }$ is a memory slot, and ${ Q } _ { t } ^ { ( h ) }$ , $K _ { t } ^ { ( h ) }$ and $V _ { t } ^ { ( h ) }$ denote the queries, keys and values, respectively. Note that the softmax function is performed on each row, and $\otimes$ denotes the dot product. The concatenation (denoted by “concat”) of $M _ { t }$ and $x _ { t }$ is row-wise where the embedded input is first passed through a linear layer to make $x _ { t }$ match the row dimension of $M _ { t }$ .
|
| 49 |
+
|
| 50 |
+
# 2.2 TRAINING WITH DISCRETE DATA
|
| 51 |
+
|
| 52 |
+
# 2.2.1 GUMBEL-SOFTMAX RELAXATION
|
| 53 |
+
|
| 54 |
+
Before the introduction of Gumbel-Softmax relaxation, we first show why training GANs with discrete data is a critical issue. Assuming the vocabulary size is $V$ , for the output logits $o _ { t } \in \mathbb { R } ^ { V }$ of the generator in (2), the next generated one-hot token $\boldsymbol { y } _ { t + 1 } \in \mathbb { R } ^ { V }$ will be obtained by sampling:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
y _ { t + 1 } \sim \sigma ( o _ { t } )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where similarly $\sigma ( \cdot )$ denotes the softmax function which is performed on $o _ { t }$ element-wisely and we use $\sigma ( o _ { t } )$ to represent the multinomial distribution on the set of all possible tokens. As we know, the sampling operations in (3) on the multinomial distribution of the generator output are not differentiable, which implies a step function at the end of the generator. Since the derivative of a step function is 0 almost everywhere, we have ∂yt+1∂θ = 0 a.e. for t = 0, · · · , T − 1 where θG denotes the generator parameters. By chain rule, the gradients of the generator loss $l _ { G }$ w.r.t. $\theta _ { G }$ will be
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\frac { \partial l _ { G } } { \partial \theta _ { G } } = \sum _ { i = 0 } ^ { T - 1 } \frac { \partial y _ { t + 1 } } { \partial \theta _ { G } } \frac { \partial l _ { G } } { \partial y _ { t + 1 } } = 0 \mathrm { ~ } a . e .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
So the gradients of the generator loss cannot pass back to the generator via the discriminator. This is the notorious “non-differentiability issue” of GANs in discrete data generation.
|
| 67 |
+
|
| 68 |
+
To deal with the non-differentiablity issue, we apply the Gumbel-Softmax relaxation technique which defines a continuous distribution over the simplex that can approximate samples from a categorical distribution (Jang et al., 2016; Maddison et al., 2016). Formally, the Gumbel-Softmax relaxation includes two parts: 1) The Gumbel-Max trick. According to Jang et al. (2016); Maddison et al. (2016), the sampling in (3) can be reparametrized as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
y _ { t + 1 } = \mathrm { o n e . h o t } ( \arg \operatorname* { m a x } _ { 1 \leq i \leq V } ( o _ { t } ^ { ( i ) } + g _ { t } ^ { ( i ) } ) )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $o _ { t } ^ { ( i ) }$ denotes the $i$ -th entry of $o _ { t }$ and $g _ { t } ^ { ( i ) }$ is from the i.i.d. standard Gumbel distribution, i.e. $g _ { t } ^ { ( i ) } = - \log ( - \log U _ { t } ^ { ( i ) } )$ with $U _ { t } ^ { ( i ) } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ . 2) Relaxing the discreteness. As the arg max operation in (5) is still non-differentiable, we need further approximate the “one-hot with arg max” by softmax, which yields
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\hat { y } _ { t + 1 } = \sigma \big ( \beta \big ( o _ { t } + g _ { t } \big ) \big )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\beta > 0$ is a tunable parameter called inverse temperature. As $\hat { y } _ { t + 1 }$ in (6) is differentiable with respect to $o _ { t }$ , we can use $\hat { y } _ { t + 1 }$ instead of the one-hot token $y _ { t + 1 }$ as the input of the discriminator. Also, note that the new observation $x _ { t + 1 }$ of the generator to be concatenated with $M _ { t + 1 }$ in next time $t + 1$ is given by $x _ { t + 1 } = f _ { \theta _ { 3 } } ( y _ { t + 1 } )$ , where the parametrized function $f _ { \theta _ { 3 } }$ is composed of an embedding layer that maps $y _ { t + 1 }$ to an embedded input and a linear layer that makes $x _ { t + 1 }$ match the row dimension of $M _ { t + 1 }$ (the embedded input and the linear layer are shown in Figure 1) .
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: The proposed discriminator framework with multiple embedded representations. The input is either the real sentence $\left[ \boldsymbol { r } _ { 1 } : \cdots : \boldsymbol { r } _ { T } \right]$ where $r _ { t }$ denotes the $t$ -th one-hot token, or the generated (approximate) sentence embedde $[ \hat { y } _ { 1 } : \dots : \hat { y } _ { T } ]$ where ns, eac $\hat { y } _ { t }$ is from (6). Also, f which is passed t $S$ embedding matrices ough discriminator in $\{ W _ { e } ^ { ( s ) } \} _ { s = 1 } ^ { S }$ map each input into y to get the related lo $S$ Note that “D” is the CNN-based classifier $\bar { D ( \cdot ) } \in \mathbb { R }$ with weight-sharing and $\oplus$ denotes taking the average.
|
| 84 |
+
|
| 85 |
+
# 2.2.2 TEMPERATURE CONTROL
|
| 86 |
+
|
| 87 |
+
With the larger inverse temperature $\beta , \hat { y } _ { t + 1 }$ in (6) will become a better approximation of $y _ { t + 1 }$ in (3) and asymptotically as $\beta \to \infty$ , $\hat { y } _ { t + 1 } \to y _ { t + 1 }$ . However, the issue is that the variance of gradients will be very large as we have $\textstyle \operatorname { V a r } ( { \frac { \partial { \hat { y } } _ { t + 1 } } { \partial o _ { t } } } ) \propto \beta ^ { 2 }$ , and thus the parameter updates will become very sensitive to the input noise. Intuitively, this might cause poor sample quality. On the other hand, with the smaller inverse temperature $\beta$ , the generator will pay more attention to making a sharp distribution of entries in $\hat { y } _ { i + 1 }$ due to the larger (initial) approximation gap between $\hat { y } _ { t + 1 }$ and $y _ { t + 1 }$ , which implicitly discourages its possible “exploration”. Intuitively, this might be one factor that contributes to mode collapse of RelGAN on text generation.
|
| 88 |
+
|
| 89 |
+
Therefore, the larger $\beta$ encourages more exploration for better sample diversity while the smaller $\beta$ encourages more exploitation for better sample quality. We thus propose to increase the inverse temperature $\beta$ over iterations via an exponential policy: $\beta _ { n } = \beta _ { \mathrm { m a x } } ^ { n / N }$ , where $\beta _ { \mathrm { m a x } }$ denotes the maximum inverse temperature, $N$ is the maximum number of training iterations and $n$ denotes the current iteration. In the exponential policy, as the increase rate of inverse temperature depends on $\beta _ { \mathrm { m a x } }$ , $\beta _ { \mathrm { m a x } }$ will decide the transition time from the exploitation phase to the exploration phase. In such sense, RelGAN provides a flexibility of either generating more diverse samples with a large $\beta _ { \mathrm { m a x } }$ or generating better quality samples with a small $\beta _ { \mathrm { m a x } }$ while most current GANs cannot provide.
|
| 90 |
+
|
| 91 |
+
# 2.3 MULTIPLE REPRESENTATIONS IN DISCRIMINATOR
|
| 92 |
+
|
| 93 |
+
A commonly used discriminator for text generation is a CNN-based classifier (Kim, 2014) that employs a convolutional layer with multiple filters of different sizes to capture relations of various word lengths and a max-pooling layer over the entire input sentence for each feature map (Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017). In this discriminator architecture, the input of the CNN-based classifier is a sentence of length $T$ represented by a single embedded matrix $\tilde { X } \in \mathbb { R } ^ { d \times T }$ where each column $\boldsymbol { \tilde { x } _ { t } } \in \mathbb { R } ^ { d }$ is a $d$ -dimensional embedded vector of each word.
|
| 94 |
+
|
| 95 |
+
In this work, we propose a new discriminator framework that applies multiple embedded representations for each sentence, with each representation independently passed through the above CNNbased classifier to get an individual score. The average of these individual scores will serve as the final guiding information to update the generator. Our hypothesis is that each embedded representation may capture a specific aspect of the input sentence and the discriminator which compares real and generated sentences from these different perspectives can provide more diverse and comprehensive guiding information for the generator updates. This idea resembles the use of multiple discriminators to improve GANs on image generation (Durugkar et al., 2016), but the difference is that we only use multiple different representations of the input while still keeping a single or weight-sharing CNN-based classifier, which presumably has much less computational cost.
|
| 96 |
+
|
| 97 |
+
Formally, we assume that $r _ { t }$ denotes the $t$ -th one-hot real token and $\hat { y } _ { t }$ from (6) denotes the $t$ - th softmax-like generated token, and Figure 2 shows the proposed discriminator framework with multiple embedded representations where either the real input $[ r _ { 1 } \ : \ \dots \ : \ r _ { T } ] \ \in \ \mathbb { R } ^ { V \times T }$ or the generated input $[ \hat { y } _ { 1 } : \dot { \dots } : \hat { y } _ { T } ] \in \mathbb { R } ^ { V \times T }$ will be mapped into $S$ embedded representations by $S$ distinct embedding matrices $\{ W _ { e } ^ { ( s ) } \} _ { s = 1 } ^ { S }$ 1 with W (s)e $W _ { e } ^ { ( s ) } \in \mathbb { R } ^ { d \times V }$ . Let $\tilde { X } _ { r } ^ { ( s ) }$ and $\tilde { X } _ { y } ^ { ( s ) }$ be the $s$ -th embedded representation of the real and generated input, respectively. Thus, we have
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\tilde { X } _ { r } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ r _ { 1 } : \cdot \cdot \cdot : r _ { T } ] , \tilde { X } _ { y } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ \hat { y } _ { 1 } : \cdot \cdot \cdot : \hat { y } _ { T } ]
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
and the final discriminator loss is given by
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
l _ { D } = \frac { 1 } { S } \sum _ { s = 1 } ^ { S } \mathbb { E } _ { r _ { 1 : T } \sim P _ { r } } f ( D ( \tilde { X } _ { r } ^ { ( s ) } ) , D ( \tilde { X } _ { y } ^ { ( s ) } ) )
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where the expectation is taken w.r.t. both real sentence distribution $P _ { r }$ and generated sentence distribution $P _ { \theta }$ , and the loss function $f$ is determined by the specific GAN loss, such as vanilla GAN (Goodfellow et al., 2014), $f$ -GAN (Nowozin et al., 2016) and WGAN (Arjovsky et al., 2017). Throughout this paper, the generator loss can be simply set to be $l _ { G } = - l _ { D }$ .
|
| 110 |
+
|
| 111 |
+
# 2.4 TRAINING TECHNIQUES
|
| 112 |
+
|
| 113 |
+
Choice of Loss Function. Empirically, we first compared three different standard GAN losses: standard GAN (the non-saturating version) (Goodfellow et al., 2014), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and Relativistic standard GAN (RSGAN) (Jolicoeur-Martineau, 2018) on the synthetic data (shown in next section) and then chose the best one – RSGAN for the rest of all experiments. Note that it does not mean RelGAN only works with the RSGAN loss and please see Appendix B for training curves of RelGAN with different loss functions. Formally, the function $f$ in (8) for RSGAN is $f ( a , b ) = \log { \mathrm { s i g m o i d } } ( a - b )$ for $a , b \in \mathbb { R }$ , and thus (8) becomes
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
l _ { D } = \frac { 1 } { S } \sum _ { s = 1 } ^ { S } \mathbb { E } _ { r _ { 1 : T } \sim P _ { r } } \log \operatorname { s i g m o i d } ( D ( \tilde { X } _ { r } ^ { ( s ) } ) - D ( \tilde { X } _ { y } ^ { ( s ) } ) )
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Intuitively, the loss function in (9) is to directly estimate the average probability that real sentences are more realistic than generated sentences in terms of different embedded representations.
|
| 120 |
+
|
| 121 |
+
Generator Pre-training. Most current GANs for text generation need the pre-training for both generator and discriminator, such as SeqGAN (Yu et al., 2017), and some may further heavily rely on the exclusive pre-training techniques, such as TextGAN (Zhang et al., 2017), LeakGAN (Guo et al., 2017) and MaskGAN (Fedus et al., 2018). Instead, the proposed RelGAN only need to pre-train the generator simply via the standard MLE training for several epochs before starting the adversarial training. Experimentally, we find that a good initialization for generator provided by the MLE pre-training is necessary for a good convergence behavior of adversarial training.
|
| 122 |
+
|
| 123 |
+
# 3 EXPERIMENTS
|
| 124 |
+
|
| 125 |
+
We test RelGAN on both synthetic and real data, where the synthetic data are 10,000 discrete sequences generated by an oracle-LSTM with fixed parameters (Yu et al., 2017) and the real data include the COCO image captions (Chen et al., 2015) and EMNLP2017 WMT News, first used by Guo et al. (2017) for text generation. The experimental settings are given in Appendix A.
|
| 126 |
+
|
| 127 |
+
Evaluation Metrics. How to properly evaluate generative models remains an open research question (Theis et al., 2015; Semeniuta et al., 2018). The key issue plaging current evaluation metrics for GANs is that they cannot measure sample quality and sample diversity simultaneously. Therefore, we use two distinct metrics: for synthetic data, we use both negative log-likelihood (called ${ \mathrm { N L L } } _ { \mathrm { g e n } , }$ ) and its counterpart (called $\mathrm { N L L _ { o r a c l e } }$ ), defined as:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\mathrm { N L } \mathbf { \mathrm { L } } _ { \mathrm { g e n } } = - \mathbb { E } _ { r _ { 1 } \sim r } { \sim } P _ { r } \log P _ { \theta } ( r _ { 1 } , \cdot \cdot \cdot , r _ { T } ) , \mathrm { N L } \mathbf { \mathrm { \mathrm { a r a c t e } } } = - \mathbb { E } _ { y _ { 1 } , \tau \sim P _ { \theta } } \log P _ { r } ( y _ { 1 } , \cdot \cdot \cdot , y _ { T } ) ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where the generated sentence distribution $P _ { \theta }$ and the real sentence distribution $P _ { r }$ are both known by evaluating the generator and oracle-LSTM, respectively. Generally, ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ measures sample diversity while $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ is more sensitive to sample quality (Theis et al., 2015; Arjovsky $\&$ Bottou, 2017). For the real dataset, we also apply ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ to measure the sample diversity, similar to Lu et al. (2018). However, since NLLoracle cannot be evaluated without an oracle, we instead apply the commonly-used BLEU scores (Papineni et al., 2002) to measure the sample quality and compare with the MLE baseline, along with other start-of-the-art GANs, including SeqGAN (Yu et al., 2017), RankGAN (Lin et al., 2017) and LeakGAN (Guo et al., 2017). Note that for BLEU score evaluation, we follow the strategy in (Yu et al., 2017; Zhu et al., 2018) by using the test data as the reference.
|
| 134 |
+
|
| 135 |
+
# 3.1 SYNTHETIC DATA
|
| 136 |
+
|
| 137 |
+
We run the synthetic data experiments with sequence length 20 and 40, respectively. The $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ results of RelGAN and other models are shown in Table 1 where we set $\beta _ { \mathrm { m a x } } = 1$ for length 20 and $\beta _ { \mathrm { m a x } } = 2$ for length 40. Note that “MLE” in Table 1 denotes the baseline model where LSTMs are trained with the teacher-forcing algorithm to maximize the likelihood (same with Table 2 and 3). We can see that RelGAN outperforms other models in both cases, and its lead in performance becomes larger with longer sequence length, demonstrating the log-distance dependency modeling ability of the proposed generator.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Length</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td><td>RelGAN</td><td>Real</td></tr><tr><td>20</td><td>9.038</td><td>8.736</td><td>8.247</td><td>7.038</td><td>6.680± 0.343</td><td>5.750</td></tr><tr><td>40</td><td>10.411</td><td>10.310</td><td>9.958</td><td>7.191</td><td>6.765 ± 0.026</td><td>4.071</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 1: The $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ scores on synthetic data where $\beta _ { \operatorname* { m a x } } = 1$ for length 20 and $\beta _ { \mathrm { m a x } } = 2$ for length 40. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are from their original papers and Guo et al. (2017). Note that “Real” denotes the real data generated by the oracle-LSTM. For the $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ score, the lower the better.
|
| 142 |
+
|
| 143 |
+
We also evaluate the trade-off between sample quality and diversity as a function of the maximum inverse temperature $\beta _ { \mathrm { m a x } }$ and the results are shown in Figure 3. As $\beta _ { \mathrm { m a x } }$ increases, ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ decreases, which implies better sample diversity, but $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ increases, which implies worse sample quality. Especially when $\beta _ { \mathrm { m a x } } \in \{ 1 0 , 1 0 0 \}$ , the best ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score of 4.4 for RelGAN is very close to the best ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score of 4.2 for MLE pre-training, implying that RelGAN with a sufficiently large inverse temperature suffers little mode collapse on synthetic data.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: The training curves of ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores (left) and $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ scores (right) on synthetic data of length 20 with different values of maximum inverse temperature $\beta _ { \mathrm { m a x } } \in \{ 1 , 2 , 5 , 1 0 , 1 0 0 \}$ . The vertical dash line represents the end of pre-training. With the increase of $\beta _ { \mathrm { m a x } }$ , ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ becomes lower but $\mathrm { N L L _ { o r a c l e } }$ becomes higher. For both the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ and $\mathrm { \Delta N L L _ { o r a c l e } }$ scores, the lower the better.
|
| 147 |
+
|
| 148 |
+
# 3.2 COCO IMAGE CAPTIONS DATASET
|
| 149 |
+
|
| 150 |
+
In order to test RelGAN on real-world data, we first run experiments on the COCO Image Captions dataset. By following the same data pre-processing as in Zhu et al. (2018), the dataset includes 4,682 unique words with the maximum sentence length 37. Both the training and test data contain 10,000 sentences.
|
| 151 |
+
|
| 152 |
+
The BLEU scores of RelGAN compared with previous models are shown in Table 2 where we set $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. We can see that RelGAN is significantly and consistently better than other models in terms of all the BLEU scores, which means its ability of generating high-quality sentences of COCO Image Captions. Furthermore, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 2, where RelGAN also achieves the state-of-the-art results in terms of sample diversity. For example, we do not see obvious mode collapse with $\beta _ { \mathrm { m a x } } = 1 0 0 0$ by looking at the generated samples (see Appendix C.1 for more details).
|
| 153 |
+
|
| 154 |
+
Table 2: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores on COCO Image Captions where $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018). For BLEU scores, the higher the better.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.731</td><td>0.497</td><td>0.305</td><td>0.189</td><td>0.718</td></tr><tr><td>SeqGAN</td><td>0.745</td><td>0.498</td><td>0.294</td><td>0.180</td><td>1.082</td></tr><tr><td>RankGAN</td><td>0.743</td><td>0.467</td><td>0.264</td><td>0.156</td><td>1.344</td></tr><tr><td>LeakGAN</td><td>0.746</td><td>0.528</td><td>0.355</td><td>0.230</td><td>0.679</td></tr><tr><td>RelGAN (100)</td><td>0.849± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756± 0.054</td></tr><tr><td>RelGAN (1000)</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 3.3 EMNLP2017 WMT NEWS DATASET
|
| 159 |
+
|
| 160 |
+
The EMNLP2017 WMT News dataset consists of 5,255 unique words with the maximum sentence length 51 after applying the same data pre-processing as in Zhu et al. (2018). The training data contains abbout 270,000 sentences and test data contains 10,000 sentences.
|
| 161 |
+
|
| 162 |
+
Table 3: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores on EMNLP2017 WMT News where $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. Our model is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018).
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.768</td><td>0.473</td><td>0.240</td><td>0.126</td><td>2.382</td></tr><tr><td>SeqGAN</td><td>0.777</td><td>0.491</td><td>0.261</td><td>0.138</td><td>2.773</td></tr><tr><td>RankGAN</td><td>0.727</td><td>0.435</td><td>0.209</td><td>0.101</td><td>3.345</td></tr><tr><td>LeakGAN</td><td>0.826</td><td>0.645</td><td>0.437</td><td>0.272</td><td>2.356</td></tr><tr><td>RelGAN (100)</td><td>0.881± 0.013</td><td>0.705± 0.019</td><td>0.501± 0.023</td><td>0.319± 0.018</td><td>2.482 ± 0.031</td></tr><tr><td>RelGAN (1000)</td><td>0.837 ± 0.012</td><td>0.654 ± 0.010</td><td>0.435 ± 0.011</td><td>0.265 ± 0.011</td><td>2.285 ± 0.025</td></tr></table>
|
| 165 |
+
|
| 166 |
+
The BLEU scores of RelGAN compared with previous models are shown in Table 3 where we set $\beta _ { \mathrm { m a x } } ~ = ~ 1 0 0$ and 1000, respectively. We can see that RelGAN also consistently outperforms previous models in terms of all the BLEU scores, demonstrating its ability of generating high-quality sentences on EMNLP2017 WMT News. Moreover, the sample diversity metric ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 3. Similarly, RelGAN achieves the stateof-the-art results in terms of sample diversity. Upon visually examining generated samples (See Appendix C.2 for more details), we do not observe obvious mode collapse for $\beta _ { \operatorname* { m a x } } \in \{ 1 0 \bar { 0 } , 1 0 0 0 \}$ .
|
| 167 |
+
|
| 168 |
+
Finally, from Tables 2 and 3, we can see that the sample quality and diversity trade-off with different values of maximum inverse temperature $\beta _ { \mathrm { m a x } }$ also exists on the real data. That is, RelGAN with $\beta _ { \mathrm { m a x } } = 1 0 0$ achieves better sample quality while RelGAN with $\beta _ { \mathrm { m a x } } = 1 0 0 0$ achieves better sample diversity. Depending on what the underlying applications of text generation via RelGAN are, we can adjust $\beta _ { \mathrm { m a x } }$ properly to get either better quality or better diversity.
|
| 169 |
+
|
| 170 |
+
To further evaluate the sample quality of RelGAN and other models on EMNLP2017 WMT News, we also perform the human evaluation by using Amazon Mechanical Turk. We randomly sampled 100 sentences for each model and the real dataset, and asked 10 different people to score each sentence on a scale of 1-5. Please see Appendix A.2 for more details of human evaluation.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Method</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td></tr><tr><td>Human score</td><td>2.751 ±0.908</td><td>2.588 ±0.970</td><td>2.449 ±1.051</td><td>3.011 ± 0.908</td></tr><tr><td>Method</td><td>RelGAN(100)</td><td>RelGAN(1000)</td><td>Real</td><td rowspan="2"></td></tr><tr><td>Human score</td><td>3.407 ± 0.909</td><td>3.285 ±0.900</td><td>4.445 ± 0.679</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 4: The means and standard deviations of human scores for RelGAN and other models on EMNLP2017 WMT News by using Amazon Mechanical Turk. Note that “Real” denotes the human score on the real dataset.
|
| 175 |
+
|
| 176 |
+
The human score results are provided in Table 4, where we can see that RelAGN generates better human-looking samples than other GANs and the MLE baseline model.
|
| 177 |
+
|
| 178 |
+
# 3.4 ABLATION STUDY
|
| 179 |
+
|
| 180 |
+
# 3.4.1 IMPACT OF RELATIONAL MEMORY
|
| 181 |
+
|
| 182 |
+
To show the impact of relational memory in RelGAN, we propose to replace relational memory by LSTM-32 and LSTM-512 as the generator architecture, respectively, and see how the performance differs. Here LSTM- $k$ represents the LSTM with hidden dimension being $k$ . We choose $k = 3 2$ because most previous GANs (Yu et al., 2017; Guo et al., 2017) have used this architecture for text generation, and also choose $k = 5 1 2$ because for more fair comparison, we want to keep the total memory size of LSTM to be the same with the relational memory we have used.
|
| 183 |
+
|
| 184 |
+
The results on the COCO Image Captions dataset are shown in Figure 4 (Left), where we provide the BLEU-4 score (See Appendix D.1 for all the BLEU scores). We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 4: (Left) Training curves of the BLEU-4 score on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512. (Right) Training curves of the BLEU-2 score on COCO Image Captions with Gumbel-Softmax relaxation and the vanilla REINFORCE method. All the results are obtained by taking the average of 6 runs with different random seeds.
|
| 188 |
+
|
| 189 |
+
# 3.4.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION
|
| 190 |
+
|
| 191 |
+
To show the impact of Gumbel-Softmax relaxation in RelGAN, we can instead apply the vanilla REINFORCE method to deal with the non-differentiable issue of RelGAN on text generation. In this experiment, we keep all other hyperparameters in RelGAN fixed and compare the performance of Gumbel-Softmax relaxation and the vanilla REINFORCE method.
|
| 192 |
+
|
| 193 |
+
The results are shown in Figure 4 (Right), where the BLEU-2 score is provided (See Appendix D.2 for all the BLEU scores). We can see that under the proposed RelGAN framework, Gumbel-Softmax relaxation performs much better than the vanilla REINFORCE method. During experiments, we find that the variance of generator gradients in the vanilla REINFORCE method is too large to provide any useful update for generator, which may explain why the performance of vanilla REINFORCE does not improve after the pre-training, as observed in Figure 4 (Right). The exploration of various variance reduction techniques for the REINFORCE method in RelGAN is out of scope of this paper.
|
| 194 |
+
|
| 195 |
+
# 3.4.3 IMPACT OF MULTIPLE REPRESENTATIONS IN DISCRIMINATOR
|
| 196 |
+
|
| 197 |
+
To show the impact of multiple embedded representations in discriminator while keeping the expressive power of discriminator the same for fair comparison, we propose to apply $S$ embedded presentations with each embedded vector of length $\begin{array} { r } { d = \frac { d _ { \mathrm { m a x } } } { S } } \end{array}$ where $d _ { \mathrm { m a x } }$ denotes the total length of representations. In this experiment, we set $d _ { \operatorname* { m a x } } = 6 4$ , and thus for instance, if $S = 1$ then $d = 6 4$ for each embedded vector, and if $S = 2$ then $d = 3 2$ for each embedded vector, and so on.
|
| 198 |
+
|
| 199 |
+
We first test RelGAN on the synthetic data with $S \in \{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \}$ and the results are shown in Figure 5 (Left). We can see that as the number of embedded representations $S$ increases, the best NLLoracle score tends to keep decreasing, yielding better sample quality. Furthermore, we test RelGAN on COCO Image Captions with $S \in \{ 1 , 6 4 \}$ and the BLEU-3 score is shown in Figure 5 (Right). Still, we can see that the BLEU scores of RelGAN with $S = 6 4$ are consistently better than those of RelGAN with $S = 1$ (see Appendix D.3 for all the BLEU scores). Note that in both experiments, we do not see an obvious sign of mode collapse with varying number of representations. For example, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score on the synthetic data stays around 4.4 for different values of $S$ (close to the best $\mathrm { N L L _ { g e n } } ~ 4 . \overset { \cdot } { 2 }$ for MLE shown in Figure 3 (Left)). Thus, these experiments demonstrate the advantages of using multiple embedded representations for discriminator in RelGAN.
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 5: (Left) The best $\mathrm { N L L _ { o r a c l e } }$ score on the synthetic data varies with different number of embedded presentations $S = \{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \}$ where $\beta _ { \mathrm { m a x } } = 1 0$ . (Right) The training curves of BLEU-3 score on COCO Image Captions with the number of embedded representations $S = 1$ and $S = 6 4$ , respectively, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . All results are obtained by taking the average of 6 runs with different random seeds.
|
| 203 |
+
|
| 204 |
+
# 4 RELATED WORK
|
| 205 |
+
|
| 206 |
+
Since GANs are originally proposed for continuous data, extending GAN training to discrete data generation has been an active research topic. Current works focus on dealing with the nondiferentiable issue brought by the discrete data nature either by considering the RL methods or by reformulating the problem in continuous space.
|
| 207 |
+
|
| 208 |
+
A large class of GANs for text generation relies on the RL algorithm. SeqGAN ((Yu et al., 2017)) models the text generation as a sequential decision making process and trains the generator with policy gradient methods (Sutton et al., 2000). MaliGAN (Che et al., 2017) proposes the co-training with a maximum-likelihood objective to reduce the gradient variance. RankGAN (Lin et al., 2017) proposes a ranking model to replace the original binary classifier as the discriminator. LeakGAN (Guo et al., 2017) designs a mechanism to provide intermediate information about text generation for generator, where the discriminator can leak its features through a manager module. MaskGAN (Fedus et al., 2018) introduces an actor-critic conditional GAN that fills in missing text conditioned on the surrounding context by resorting to a seq2seq model.
|
| 209 |
+
|
| 210 |
+
Other GANs without RL methods either approximate the discrete data or work in the continuous latent space. TextGAN (Zhang et al., 2017) provides a feature matching mechanism that matches the latent features of real and generated sentences via a kernelized discrepancy metric to alleviate the mode collapse. FM-GAN (Chen et al., 2018) proposes to match the latent feature distributions of real and synthetic sentences using the feature-movers distance. Similar to our work, both textGAN and FM-GAN apply an annealed softmax to approximate the argmax in the generator. However, they do not rely on the Gumbel-Max trick to reparametrize the sampling operations, which is the major difference with us in dealing with the non-differentiable issue. ARAE (Zhao et al., 2018) applies an additional autoencoder to embed the discrete data into a continuous latent space in which GANs can be trained properly. As for approximating the categorical distribution with GumbelSoftmax relaxation, Gu et al. (2017) has used it to improve the generation quality in neural machine translation. More similarly, Kusner & Hernandez-Lobato (2016) provides some initial experiments ´ of training GANs with Gumbel-Softmax relaxation on a synthetic task, but scaling them to work on real text dataset remains a challenging open problem.
|
| 211 |
+
|
| 212 |
+
Attention mechanisms, in particular self-attention (Vaswani et al., 2017), have gradually become a building block of many novel neural network architectures (Vaswani et al., 2017; Parmar et al., 2018; Santoro et al., 2018) due to its ability of capturing long or global dependencies and reducing computational cost via parallelization. In the context of GANs, self-attention have not been fully explored. SAGAN (Zhang et al., 2018) applies self-attention in GANs to model long range dependencies in images and get the state-of-the-art results on conditional image generation. In contrast, we employ self-attention in GANs for text generation by using relational memory as generator.
|
| 213 |
+
|
| 214 |
+
# 5 CONCLUSIONS
|
| 215 |
+
|
| 216 |
+
We proposed a new GAN architecture called RelGAN for text generation, that outperforms most current models in terms of sample quality and diversity on both synthetic and real data. Furthermore, the trade-off between the generated sample diversity and quality can be adjusted properly in RelGAN by controlling the inverse temperature. In RelGAN, we used the relational memory based generator to improve its ability of modeling long distance dependencies and also applied multiple embedded representations in discriminator such that it can provide more diverse and informative guiding signal for generator. By applying Gumbel-Softmax relaxation to deal with the non-differentiable issue, our architecture is simple to implement without employing intensive RL heuristics. For the future directions, since we have demonstrated that GANs with Gumbel-Softmax relaxation is very promising for text generation, we would like to explore further in this direction. For example, it is interesting to make RelGAN work better without any pre-training. Also, extending RelGAN to a conditional model for many text generation related applications is another interesting direction.
|
| 217 |
+
|
| 218 |
+
# ACKNOWLEDGEMENT
|
| 219 |
+
|
| 220 |
+
We would like to thank all the reviewers for their helpful comments. WN and ABP were supported by IARPA via DoI/IBC contract D16PC00003 and NSF NeuroNex grant DBI-1707400.
|
| 221 |
+
|
| 222 |
+
# REFERENCES
|
| 223 |
+
|
| 224 |
+
Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. arXiv preprint arXiv:1701.04862, 2017.
|
| 225 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 226 |
+
Tong Che, Yanran Li, Ruixiang Zhang, R Devon Hjelm, Wenjie Li, Yangqiu Song, and Yoshua Bengio. Maximum-likelihood augmented discrete generative adversarial networks. arXiv preprint arXiv:1702.07983, 2017.
|
| 227 |
+
Liqun Chen, Shuyang Dai, Chenyang Tao, Dinghan Shen, Zhe Gan, Haichao Zhang, Yizhe Zhang, and Lawrence Carin. Adversarial text generation via feature-mover’s distance. In NIPS, 2018.
|
| 228 |
+
Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015.
|
| 229 |
+
Ishan Durugkar, Ian Gemp, and Sridhar Mahadevan. Generative multi-adversarial networks. arXiv preprint arXiv:1611.01673, 2016.
|
| 230 |
+
William Fedus, Ian Goodfellow, and Andrew M Dai. Maskgan: Better text generation via filling in the . arXiv preprint arXiv:1801.07736, 2018.
|
| 231 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014.
|
| 232 |
+
Jiatao Gu, Daniel Jiwoong Im, and Victor OK Li. Neural machine translation with gumbel-greedy decoding. arXiv preprint arXiv:1706.07518, 2017.
|
| 233 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017.
|
| 234 |
+
Jiaxian Guo, Sidi Lu, Han Cai, Weinan Zhang, Yong Yu, and Jun Wang. Long text generation via adversarial training with leaked information. arXiv preprint arXiv:1709.08624, 2017.
|
| 235 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 236 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 237 |
+
Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. arXiv preprint arXiv:1807.00734, 2018.
|
| 238 |
+
Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
|
| 239 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 240 |
+
Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
|
| 241 |
+
Kevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation. In Advances in Neural Information Processing Systems, 2017.
|
| 242 |
+
Sidi Lu, Lantao Yu, Weinan Zhang, and Yong Yu. Cot: Cooperative training for generative modeling. arXiv preprint arXiv:1804.03782, 2018.
|
| 243 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 244 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, 2016.
|
| 245 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 2002.
|
| 246 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, and Alexander Ku. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 247 |
+
Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. arXiv preprint arXiv:1806.01822, 2018.
|
| 248 |
+
Stanislau Semeniuta, Aliaksei Severyn, and Sylvain Gelly. On accurate evaluation of gans for language generation. arXiv preprint arXiv:1806.04936, 2018.
|
| 249 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, 2000.
|
| 250 |
+
Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative ¨ models. arXiv preprint arXiv:1511.01844, 2015.
|
| 251 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
|
| 252 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 253 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, 2017.
|
| 254 |
+
Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018.
|
| 255 |
+
|
| 256 |
+
Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. In International Conference on Machine Learning, 2017.
|
| 257 |
+
|
| 258 |
+
Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander Rush, and Yann LeCun. Adversarially regularized autoencoders. In International Conference on Machine Learning, 2018.
|
| 259 |
+
|
| 260 |
+
Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. arXiv preprint arXiv:1802.01886, 2018.
|
| 261 |
+
|
| 262 |
+
# A EXPERIMENTAL SETTINGS
|
| 263 |
+
|
| 264 |
+
# A.1 TRAINING DETAILS
|
| 265 |
+
|
| 266 |
+
Unless stated otherwise, for the CNN-based discriminator architecture, we use filter windows of sizes $\{ 3 , 4 , 5 \}$ and 300 feature maps each. For relational memory, we set memory size to be 256, memory slots to be 1, number of heads to be 2. The batch size is set to be 64. For embedding dimensions, we set the embedding dimension of the input token for generator to be 32 and that for discriminator to be 1 with the number of embedded representations $S = 6 4$ . We use Adam (Kingma & Ba, 2014) with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ and gradient clipping is applied if the norm of gradients exceeds 5. We first pre-train the generator via MLE with learning rate of 1e-2 for 150 epochs and then start adversarial training with learning rate of 1e-4 for both discriminator and generator. For adversarial training, we set the maximum number of iterations $N = 5 0 0 0$ and we perform 5 gradient descent steps on the discriminator for every step on the generator.
|
| 267 |
+
|
| 268 |
+
# A.2 HUMAN EVALUATION DETAILS
|
| 269 |
+
|
| 270 |
+
On Amazon Mechanical Turk, our instructions are given as follows:
|
| 271 |
+
|
| 272 |
+
The text quality evaluation is based on grammatical correctness and meaningfulness (i.e. if a sentence makes sense). Please ignore any text formatting problems (e.g., capitalization, punctuation, spelling errors, extra spaces between words and punctuations). Note: A very short sentence (less than 10 words) should be penalized with its score minus 1. Please see below for the detailed criteria.
|
| 273 |
+
|
| 274 |
+
Table 5: The human evaluation scale from 1 to 5 with corresponding criteria and example sentences.
|
| 275 |
+
|
| 276 |
+
<table><tr><td rowspan=1 colspan=1>Scale</td><td rowspan=1 colspan=1>Criterion&Example</td></tr><tr><td rowspan=1 colspan=1>5 - Excellent</td><td rowspan=1 colspan=1>Its grammatically correct and makes sense.For example,“if England wins the World Cup next year,it will be the most significantresult the sport has seen in more than a decade ."</td></tr><tr><td rowspan=1 colspan=1>4 - Good</td><td rowspan=1 colspan=1>It has some small grammatical errors and mostly makes sense.For example,“it is useful to have had a doctor who forced her to release him a coupleofdays before she was cleared "</td></tr><tr><td rowspan=1 colspan=1>3-Fair</td><td rowspan=1 colspan=1>It has major grammatical errors but the whole still conveys some meanings.For example,“even then once again there’s a sign of that stuffis going on the way towork on christmas eve ."</td></tr><tr><td rowspan=1 colspan=1>2 - Poor</td><td rowspan=1 colspan=1>It has severe grammatical errors and the whole doesn't make sense, but some parts arestill locally meaningful.For example,“we go to work for the moment in life their eyes and,i have been adifferent race on to go ."</td></tr><tr><td rowspan=1 colspan=1>1 - Unacceptable</td><td rowspan=1 colspan=1>It isbasically a random collection of words.For example,��i go com com com,i on on on play can go go."</td></tr></table>
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 6: Training curves of BLEU scores on COCO Image Captions with different loss functions: RSGAN (Jolicoeur-Martineau, 2018), standard GAN (the non-saturating version) (Goodfellow et al., 2014) and hinge loss (Nowozin et al., 2016; Zhang et al., 2018), where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ and we use two different optimizers – (a) Adam and (b) RMSProp. All the results are obtained by taking the average of 6 runs with different random seeds. The vertical dash line represents the end of pre-training. We can see that RelGAN works well with different commonly-used loss functions of GANs and different optimization methods. In this scenario, the performance of RSGAN and standard GAN outperforms the hinge loss version.
|
| 280 |
+
|
| 281 |
+
# C GENERATED SAMPLES ON REAL DATASET
|
| 282 |
+
|
| 283 |
+
C.1 GENERATED SAMPLES ON COCO IMAGE CAPTIONS DATASET
|
| 284 |
+
|
| 285 |
+
a man is sitting on a bench next to a bicycle .
|
| 286 |
+
a man fixing a motor cycle in a race .
|
| 287 |
+
a rectangle shaped wooden sitting on a lush green field .
|
| 288 |
+
a man standing in a picture of a kitchen with a dog watching him .
|
| 289 |
+
a man is carving some meat in a park .
|
| 290 |
+
a kitchen with a black window and a large white stove wall .
|
| 291 |
+
a cat is looking on a man in a bathroom .
|
| 292 |
+
a train is covered in the air in the city scene .
|
| 293 |
+
a bathroom has a toilet , and bathroom rug for a urinal or a urinal on the side .
|
| 294 |
+
a home kitchen with a double oven and table while a table and chairs .
|
| 295 |
+
a small airplane flying above an airport covered with wood .
|
| 296 |
+
a man in a kitchen preparing food on a table .
|
| 297 |
+
a large passenger jet flying in a clear blue sky .
|
| 298 |
+
a group of people riding motorcycles on a street .
|
| 299 |
+
a woman in a kitchen with her hands clasped . a smiling woman is sitting on a green bench .
|
| 300 |
+
people are hiding under colorful umbrellas on a rainy day .
|
| 301 |
+
a photo of a small restroom in a kitchen .
|
| 302 |
+
many sheep graze are shown in front of a group of people .
|
| 303 |
+
a plane is parked next to an airplane on a runway near a control tower with two back .
|
| 304 |
+
a woman walking past a straw shower holding a corner .
|
| 305 |
+
an office desk with a row of books in the kitchen .
|
| 306 |
+
a cat sitting on top of a kitchen counter .
|
| 307 |
+
a person riding a bike through a lush green park .
|
| 308 |
+
a bathroom with a sink , toilet and toilet paper dispenser .
|
| 309 |
+
a man is on a motorcycle with a woman on the back of it .
|
| 310 |
+
two giraffes in a wild , lightly wooded field .
|
| 311 |
+
a metal tin pan filled with two different kitchen appliances .
|
| 312 |
+
a white airplane flying in the sky over a runway .
|
| 313 |
+
a car driving on a busy street at night from an airport .
|
| 314 |
+
|
| 315 |
+
# C.2 GENERATED SAMPLES ON EMNLP2017 WMT NEWS DATASET
|
| 316 |
+
|
| 317 |
+
he is also watching closely on staying in the plan , but sometimes i still don ’ t think that ’ s going to happen on saturday .
|
| 318 |
+
and so , they didn ’ t want to be in their position , and that was something they would do to my wife . i would like to assess whether you should be able to take that into that issue than you did on a sunday . “ he ’ s a young lady , so i don ’ t want to show up for them , ” she said .
|
| 319 |
+
that ’ s not yet about what you want to say about reality , but probably don ’ t think about that would just make me comfortable in my life .
|
| 320 |
+
officials have been also a member of nato against the us , and for the first time that so many other countries are on the rise , and that will be the only way to stay here .
|
| 321 |
+
he has always vowed to give him a little more on for him , and i think he is very willing for the division . we ’ ve had to try and get into the coming down to the today ’ s end .
|
| 322 |
+
i don ’ t think that ’ s why we did not have to score the last two .
|
| 323 |
+
meanwhile , it was never been in the past , but it was not known until the coalition was given the support of the rebels on the terms of the claims .
|
| 324 |
+
he said : “ i don ’ t think we should be better at what we would do to the good .
|
| 325 |
+
“ we had to get on with that , ” she said at a news conference .
|
| 326 |
+
by contrast , but this is a turning point at her age .
|
| 327 |
+
but i will do that , which i have to do with the city , and my new hopes is from all over the world . “ this is a very bad , and it ’ s not clear that this is a danger of this , ” he said . at a detroit press with reporters on the flight , gave informed operators time to interview mr . cox that he was struggling with all of his treatments .
|
| 328 |
+
“ in the past five days , we ’ re going to enjoy maybe that and after that , you ’ re going to stay to dinner with friends and family , ” he said .
|
| 329 |
+
the union has indicated that there are no restrictions on the long - standing alliance in any key areas .
|
| 330 |
+
i never thought i could put over the line but i couldn ’ t quite lose my job .
|
| 331 |
+
since then , while the number of people stood by the wall street banks fell by 2 percent over the past 10 years , there ’ s no need to say that .
|
| 332 |
+
“ they had to fly in the field , ” he said , adding that it didn ’ t miss it .
|
| 333 |
+
“ trump ’ s voice will be a positive one for mr . trump ’ s transition team , ” he said .
|
| 334 |
+
he was still working on a training camp friday with a small into a new manager .
|
| 335 |
+
the 15 - year - old man has been reported missing by a falling from the city centre .
|
| 336 |
+
“ it ’ s a process that can take a little while , ” one resident said .
|
| 337 |
+
a well - meaning - predicted or very public policy , seeking to work with us .
|
| 338 |
+
“ i ’ m not to have made me a bit more than anything , but i ’ ve never done that , ” he said .
|
| 339 |
+
they were waiting to see how many changes could come from us and that ’ s why it has made it leave facing .
|
| 340 |
+
she initially noted that some of the other victims began to come from being more than prepared to stand for .
|
| 341 |
+
“ i ’ ve never heard of the abuse , because we need to work with him , ” he added .
|
| 342 |
+
|
| 343 |
+
# D MORE RESULTS ON ABLATION STUDY
|
| 344 |
+
|
| 345 |
+
# D.1 IMPACT OF RELATIONAL MEMORY
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 7: Training curves of BLEU scores on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
D.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION
|
| 352 |
+
Figure 8: Training curves of BLEU scores on COCO Image Captions with different gradient relaxations for GANs on discrete data – Gumbel-Softmax relaxation and REINFORCE method. We can see that the BLEU scores of Gumbel-Softmax relaxation are consistently better than those of REINFORCE method, which demonstrates the advantages of using Gumbel-Softmax relaxation to deal with non-differentiable issues in RelGAN.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 9: Training curves of BLEU scores on COCO Image Captions with different number of embedded representations $S = 1$ and $S \ : = \ : 6 4$ , where $\beta _ { \mathrm { m a x } } ~ = ~ 1 0 0 0$ . We can see that the BLEU scores of $S \ : = \ : 6 4$ are consistently better than those of $S = 1$ , which demonstrates the advantages of using multiple embedded representations for discriminator in RelGAN.
|
| 356 |
+
|
| 357 |
+
# E DIVERSITY-QUALITY TRANSITION DURING TRAINING
|
| 358 |
+
|
| 359 |
+
As we can observe from Figures 7-9 in the above appendices, the BLEU scores of RelGAN (denoted by the blue curves in each subfigure) first increase over iterations and then keep decreasing after around 800 iterations. In other words, its sample quality first increases and then decreases during the adversarial training. To see what happens in the training dynamics of RelGAN, we also provide the training curve of the diversity metric $\mathrm { - N L L _ { \mathrm { g e n } } }$ in RelGAN as shown in Figure 10.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 10: The training curve of ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ in RelGAN on COCO Image Captions, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . We can see that during the adversarial training, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score first increases and then decreases after around 800 iterations. The turning point matches well with those in the training curves of BLEU scores.
|
| 363 |
+
|
| 364 |
+
Interestingly, Figure 10 shows that during the adversarial training, the sample diversity (measured by $\mathrm { N L L } _ { \mathrm { g e n } } )$ of RelGAN first decreases and then increases, and its turning point matches well with that of the sample quality (measured by BLEU scores) of RelGAN. These training dynamics illustrate a diversity-quality transition over iterations in RelGAN: Early on in training, it learns to aggressively improve sample quality while sacrificing diversity. Later on, it turns instead to maximizing sample diversity while gradually decreasing sample quality. Intuitively, it seems to be much easier for the generator to just produce realistic samples – regardless of their diversity – to fool the discriminator in the early stage of training. As the discriminator becomes better at distinguishing samples with less diversity over iterations, the generator has to focus more on producing more diverse samples to fool the discriminator.
|
| 365 |
+
|
| 366 |
+
# F RELGAN WITHOUT PRE-TRAINING
|
| 367 |
+
|
| 368 |
+
In this section, we want to test the performance of RelGAN without pre-training for different loss functions, including standard GAN (the non-satuarating version) (Goodfellow et al., 2014), WGANGP (Gulrajani et al., 2017), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and RSGAN (Jolicoeur-Martineau, 2018). The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores evaluated on COCO Image Captions are shown in Table 8.
|
| 369 |
+
|
| 370 |
+
Table 8: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN without pre-training on COCO Image Captions where with a little hyperparameter tuning, we set $\beta _ { \mathrm { m a x } } = 1 0 0$ for the standard GAN loss and $\beta _ { \mathrm { m a x } } = 1 0 0 0$ for other losses. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As a reference, we also provide the results of an untrained RelGAN which is marked as “random”. Note that for the hinge loss, we get no valid results as it suffers from the vanishing gradient issue.
|
| 371 |
+
|
| 372 |
+
<table><tr><td>Losses</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>Hinge</td><td>=</td><td>-</td><td>=</td><td>1</td><td>-</td></tr><tr><td>WGAN-GP</td><td>0.330 ± 0.024</td><td>0.111 ± 0.019</td><td>0.065 ± 0.017</td><td>0.045 ± 0.013</td><td>4.063 ± 0.623</td></tr><tr><td>RSGAN</td><td>0.460 ± 0.026</td><td>0.172 ± 0.025</td><td>0.085 ± 0.017</td><td>0.056 ± 0.013</td><td>3.065 ± 0.917</td></tr><tr><td>Standard</td><td>0.590 ± 0.019</td><td>0.280 ± 0.020</td><td>0.141 ± 0.018</td><td>0.094 ± 0.011</td><td>2.259 ± 0.263</td></tr><tr><td>Random</td><td>0.041</td><td>0.017</td><td>0.011</td><td>0.008</td><td>8.355</td></tr></table>
|
| 373 |
+
|
| 374 |
+
We can see that without pre-training, there is still a significant improvement for RelGAN compared with the random generation, in particular for the standard GAN loss, even though the improvement is inferior to the case with pre-training. In contrast, without pre-training, previous RL-based GANs for text generation, such as SeqGAN and RankGAN, always get stuck around their initialization points and are not able to improve their performance at all. This demonstrates that RelGAN may be a more promising GAN architecture to explore in order to completely get rid of the pre-training for GANs on text generation. Besides, Table 8 also shows that the evaluation results of RelGAN without pretraining vary with different loss functions and values of $\beta _ { \mathrm { m a x } }$ . We leave an extensive hyperparameter search to further improve the performance of RelGAN without pre-training for future work.
|
| 375 |
+
|
| 376 |
+
# G MORE EXPLORATION ON TUNABLE HYPERPARAMETER $\beta _ { \mathrm { m a x } }$
|
| 377 |
+
|
| 378 |
+
For real data experiments, we have showed the advantages of RelGAN over other models by setting the maximum inverse temperature $\beta _ { \mathrm { m a x } } \in \{ 1 0 0 , 1 0 0 0 \}$ , which are carefully chosen for a good tradeoff between sample quality and diversity. A natural question will be to explore the two extremes: what happens with the real data if $\beta _ { \mathrm { m a x } }$ is either too large or too small? Does it behave similarly to the synthetic data experiments in terms of the trade-off between sample diversity and quality?
|
| 379 |
+
|
| 380 |
+
To this end, we choose a broad range of $\beta _ { \mathrm { m a x } } \in \{ 1 , 1 0 , 1 0 ^ { 2 } , 1 0 ^ { 3 } , 1 0 ^ { 4 } , 1 0 ^ { 5 } , 1 0 ^ { 6 } , 1 0 ^ { 7 } \}$ and test its impact in RelGAN on the COCO Image Captions dataset. The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores are given in Table 9, where we can see that both BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores increase with the decrease of $\beta _ { \mathrm { m a x } }$ , and the variance of each score also consistently becomes larger for a smaller $\beta _ { \mathrm { m a x } }$ . For better illustration, we also plot BLEU-4 and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores with error bars in Figure 11.
|
| 381 |
+
|
| 382 |
+
It first confirms that similar to the synthetic data experiments, there also exists a consistent trade-off between sample quality and diversity in real data, controlled by the tunable hyperparameter $\beta _ { \mathrm { m a x } }$ . Besides, it reveals the failing cases at the two extremes: On the one hand, if $\beta _ { \mathrm { m a x } }$ is too small, i.e. $\beta _ { \operatorname* { m a x } } = 1$ , RelGAN suffers from severe mode collapse (denoted by the large ${ \mathrm { N L L } } _ { \mathrm { g e n . } }$ ) and training instability (denoted by high variances of scores) issues. On the other hand, if $\beta _ { \mathrm { m a x } }$ is too large, i.e. $\beta _ { \mathrm { m a x } } = \mathrm { \bar { 1 0 } ^ { 7 } }$ , the sample quality improvement of RelGAN becomes marginal (denoted by the low BLEU scores). Therefore, we have chosen the two intermediate values $\{ 1 0 0 , 1 0 0 0 \}$ of $\beta _ { \mathrm { m a x } }$ in the
|
| 383 |
+
|
| 384 |
+
<table><tr><td>βmax</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>1</td><td>0.890± 0.121</td><td>0.791± 0.209</td><td>0.659± 0.243</td><td>0.500± 0.230</td><td>1.454 ± 0.121</td></tr><tr><td>10</td><td>0.862 ± 0.038</td><td>0.741± 0.060</td><td>0.604 ± 0.060</td><td>0.445 ± 0.080</td><td>1.084 ± 0.061</td></tr><tr><td>10²</td><td>0.849 ± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756 ± 0.054</td></tr><tr><td>103</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr><tr><td>104</td><td>0.801 ± 0.006</td><td>0.609 ± 0.012</td><td>0.430 ± 0.019</td><td>0.288 ± 0.015</td><td>0.631 ± 0.045</td></tr><tr><td>105</td><td>0.796 ± 0.007</td><td>0.599 ± 0.012</td><td>0.417 ± 0.010</td><td>0.277 ± 0.012</td><td>0.588 ± 0.037</td></tr><tr><td>106</td><td>0.790 ± 0.009</td><td>0.588 ± 0.011</td><td>0.408 ± 0.013</td><td>0.272 ± 0.010</td><td>0.569± 0.039</td></tr><tr><td>107</td><td>0.775 ± 0.011</td><td>0.572 ± 0.020</td><td>0.390 ± 0.019</td><td>0.252 ± 0.016</td><td>0.547 ± 0.032</td></tr></table>
|
| 385 |
+
|
| 386 |
+
Table 9: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN with various values of $\beta _ { \mathrm { m a x } }$ on COCO Image Captions. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As we can see, both BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores increase with the decrease of $\beta _ { \mathrm { m a x } }$ . Besides, the variance of each score also consistently becomes larger for a smaller $\beta _ { \mathrm { m a x } }$ .
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 11: The BLEU-4 (Left) and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ (Right) scores with error bars in RelGAN on COCO Image Captions with varying maximum inverse temperature $\beta _ { \mathrm { m a x } }$ .
|
| 390 |
+
|
| 391 |
+
main text to show the advantages of RelGAN over other models while still demonstrating its ability to control the trade-off between sample quality and diversity.
|
md/train/rJxAo2VYwr/rJxAo2VYwr.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRANSFERABLE PERTURBATIONS OF DEEP FEATURE DISTRIBUTIONS
|
| 2 |
+
|
| 3 |
+
Nathan Inkawhich, Kevin J Liang, Lawrence Carin & Yiran Chen
|
| 4 |
+
|
| 5 |
+
Department of Electrical and Computer Engineering
|
| 6 |
+
Duke University
|
| 7 |
+
{nathan.inkawhich,kevin.liang,lcarin,yiran.chen}@duke.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Almost all current adversarial attacks of CNN classifiers rely on information derived from the output layer of the network. This work presents a new adversarial attack based on the modeling and exploitation of class-wise and layer-wise deep feature distributions. We achieve state-of-the-art targeted blackbox transfer-based attack results for undefended ImageNet models. Further, we place a priority on explainability and interpretability of the attacking process. Our methodology affords an analysis of how adversarial attacks change the intermediate feature distributions of CNNs, as well as a measure of layer-wise and class-wise feature distributional separability/entanglement. We also conceptualize a transition from task/data-specific to model-specific features within a CNN architecture that directly impacts the transferability of adversarial examples.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Most recent adversarial attack literature has focused on empirical demonstrations of how classifiers can be fooled by the addition of quasi-imperceptible noise to the input (Szegedy et al., 2014; Goodfellow et al., 2015; Carlini & Wagner, 2017; Moosavi-Dezfooli et al., 2016; Madry et al., 2018; Kurakin et al., 2017). However, adversarial attacks may be leveraged in other constructive ways to provide insights into how deep learning models learn data representations and make decisions. In this work, we propose a new blackbox transfer-based adversarial attack that outperforms state-of-the-art methods for undefended ImageNet classifiers. Importantly, this work provides a broad exploration into how different Deep Neural Network (DNN) models build feature representa
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (top) Given a pre-trained whitebox model $f$ , we capture the layer-wise and class-wise feature distributions with binary neural networks $g _ { l , c }$ , aiming to model the probability that the layer $l$ features extracted from input $x$ are from the class $c$ feature distribution (i.e. $\mathsf { \bar { p } } ( y = c | f _ { l } ( x ) ) )$ . (bottom) Forward pass for $F D A$ targeted attack.
|
| 19 |
+
|
| 20 |
+
tions and conceptualize classes. The new attack methodology, which we call the Feature Distribution Attack $( F D A )$ , leverages class-wise and layer-wise deep feature distributions of a substitute DNN to generate adversarial examples that are highly transferable to a blackbox target DNN.
|
| 21 |
+
|
| 22 |
+
One perspective on adversarial attacks is that adversarial noise is a direction in which to “move” the natural data. In standard attacks which directly use the classification output, the noise points in the direction of the nearest decision boundary at the classification layer (Tramer et al., 2017). In this \` work, our crafted noise points in a direction that makes the data “look like” a sample of another class in intermediate feature space. Intuitively, if we can alter the representation in a layer whose features are representative of the data for the given task, but not specific to the model, the adversarial example may transfer better (to unobserved architectures) than attacks derived from logit-layer information.
|
| 23 |
+
|
| 24 |
+
Figure 1(top) illustrates the feature distribution modeling of a DNN, which is the core mechanism of the attack. $f$ is a pre-trained substitute whitebox model to which we have full access. The true target blackbox model is not shown, but we only assume limited query access and that it has been trained on ImageNet-1k (Deng et al., 2009). Adversarial examples are then generated on the whitebox model and transferred to the blackbox model. The novelty of the attack comes from the explicit use of class-wise and layer-wise feature distributions. In Figure 1(top), an auxiliary Neural Network (NN) $g _ { l , c }$ learns $p ( y = \dot { c } | f _ { l } ( x ) )$ , which is the probability that the layer $l$ features of the whitebox model, extracted from input image $x$ , belong to class $c$ . The attack uses these learned distributions to generate targeted (or untargeted) adversarial examples by maximizing (or minimizing) the probability that the adversarial example is from a particular class’s feature distribution (Figure 1(bottom)). We also use these learned distributions to analyze layer-wise and model-wise transfer properties, and to monitor how perturbations of the input change feature space representations. Thus, we gain insights on how feature distributions evolve with layer depth and architecture.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
In blackbox attacks (Narodytska & Kasiviswanathan, 2017; Su et al., 2017; Papernot et al., 2017; Tramer et al., 2017; Inkawhich et al., 2019; Dong et al., 2018; Zhou et al., 2018), knowledge of \` the target model is limited. In this work, the target model is blackbox in the sense that we do not have access to its gradients and make no assumptions about its architecture (Madry et al., 2018; Cheng et al., 2019). A popular blackbox technique is transfer-based attacks, in which adversarial examples are constructed on the attackers’ own whitebox model and transferred to the target model. Papernot et al. (2016; 2017) develop special methods for training the attackers’ whitebox model to approximate the target model’s decision boundaries. In this work, we only use models that have been trained under standard configurations for ImageNet-1k (Deng et al., 2009). Tramer et al. (2018) \` and Liu et al. (2017) bolster transferability by generating adversarial examples from an ensemble of whitebox models, which helps the noise not overfit a single model architecture. Our methods also discourage overfitting of the generating architecture, but we instead leverage feature space perturbations at the appropriate layer. In the 2017 NeurIPS blackbox attack competition (Kurakin et al., 2018), the winning method (Dong et al., 2018) used momentum in the optimization step, which helped to speed up the convergence rate and de-noise the gradient directions as to not be overly specific to the generating architecture. We also use this approach. Finally, Tramer et al.\` (2017) analyze why transferability occurs and find that well-trained models have similar decision boundary structures. We also analyze transferability, but in the context of how adversarial examples change a model’s internal representations, rather than only making observations at the output layer.
|
| 29 |
+
|
| 30 |
+
While all of the above methods generate adversarial examples using information from the classification layer of the model, there have been a few recent works delving into the feature space of DNNs for both attacks and defenses. Sabour et al. (2016) show that in whitebox settings, samples can be moved very close together while maintaining their original image-domain representations. Zhou et al. (2018) regularize standard untargeted attack objectives to maximize perturbations of (all) intermediate feature maps and increase transferability. However, their primary objective is untargeted and still based on classification output information. Also, the authors do not consider which layers are affected and how the regularization alters the intermediate representations. Inkawhich et al. (2019) show that driving a source sample’s feature representation towards a target sample’s representation at particular layers in deep feature space is an effective method of targeted transfer attack. However, the method is targeted only and relies on the selection of a single (carefully selected) sample of the target class. Also, the attack success rate on ImageNet was empirically low. This work describes a more robust attack, with significantly better performance on ImageNet, and provides a more detailed analysis of layer-wise transfer properties. For adversarial defenses, Xie et al. (2019), Frosst et al. (2019), and Lin et al. (2019) consider the effects of adversarial perturbations in feature space but do not perform a layer-wise analysis of how the internal representations are affected.
|
| 31 |
+
|
| 32 |
+
# 3 ATTACK METHODOLOGY
|
| 33 |
+
|
| 34 |
+
We assume to have a set of training data and a pre-trained model $f$ from the same task as the target blackbox model (i.e. the ImageNet-1k training set and a pre-trained ImageNet model). To model the feature distributions for $f$ , we identify a set of classes $\mathcal { C } = \{ c _ { 1 } , . . . , c _ { K } \}$ and a set of layers $\mathcal { L } = \{ l _ { 1 } , . . . , l _ { N } \}$ that we are keen to probe. For each layer in $\mathcal { L }$ , we train a small, binary, one-versusall classifier $g$ for each of the classes in $\mathcal { C }$ , as shown in Figure 1 (top). Each binary classifier is given a unique set of parameters, and referred to as an auxiliary model $g _ { l , c }$ . The output of an auxiliary model represents the probability that the input feature map is from a specific class $c \in { \mathcal { C } }$ . Thus, we say that $g _ { l , c } ( f _ { l } ( x ) )$ outputs $p ( y = c | f _ { l } ( x ) )$ , where $f _ { l } ( x )$ is the layer $l$ feature map of the pre-trained model $f$ given input image $x$ .
|
| 35 |
+
|
| 36 |
+
Once trained, we may leverage the learned feature distributions to create both targeted and untargeted adversarial examples. Here, we focus mostly on targeted attacks, which are considered a harder problem (especially in the blackbox transfer case when we do not have access to the target model’s gradients) (Kurakin et al., 2018; Sharma et al., 2018). Discussion of untargeted attacks is left to Appendix C. Recall, the goal of a targeted attack is to generate an adversarial noise $\delta$ that when added to a clean sample $x$ of class $y _ { s r c }$ , the classification result of $x + \delta$ is a chosen class $y _ { t g t }$ . The key intuition for our targeted methods is that if a sample has features consistent with the feature distribution of class $c$ at some layer of intermediate feature space, then it will likely be classified as class $c$ . Although not shown in the objective functions for simplicity, for all attacks the adversarial noise $\delta$ is constrained by an $\ell _ { p }$ norm (i.e. $| | \delta | | _ { p } \leq \epsilon )$ , and the choice of layer $l$ and target class label $y _ { t g t }$ are chosen prior to optimization.
|
| 37 |
+
|
| 38 |
+
FDA We propose three targeted attack variants. The most straightforward variant, called $F D A$ , finds a perturbation $\delta$ of the “clean” input image $x$ that maximizes the probability that the layer $l$ features are from the target class $y _ { t g t }$ distribution:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\operatorname* { m a x } _ { \delta } p ( y = y _ { t g t } | f _ { l } ( x + \delta ) ) .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
We stress that unlike standard attacks that use output layer information to directly cross decision boundaries of the whitebox, our $F D A$ objective leverages intermediate feature distributions which do not implicitly describe these exact boundaries.
|
| 45 |
+
|
| 46 |
+
$F D A + m s$ In addition to maximizing the probability that the layer $l$ features are from the target class distribution, the $F D A + m s$ variant also considers minimizing the probability that the layer $l$ features are from the source class $y _ { s r c }$ distribution ( $\ m s =$ minimize source):
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname* { m a x } _ { \delta } \lambda p ( y = y _ { t g t } | f _ { l } ( x + \delta ) ) - ( 1 - \lambda ) p ( y = y _ { s r c } | f _ { l } ( x + \delta ) ) .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Here, $\lambda \in ( 0 , 1 )$ weights the contribution of both terms and is a fixed positive value.
|
| 53 |
+
|
| 54 |
+
$F D A + f d$ Similarly, the $F D A + f d$ variant maximizes the probability that the layer $l$ features are from the target class distribution while also maximizing the distance of the perturbed features from the original features $f d =$ feature-disruption):
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\operatorname* { m a x } _ { \delta } p ( y = y _ { t g t } | f _ { l } ( x + \delta ) ) + \eta \frac { \| f _ { l } ( x + \delta ) - f _ { l } ( x ) \| _ { 2 } } { \| f _ { l } ( x ) \| _ { 2 } } .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
In other words, the feature-disruption term, with a fixed $\eta \in \mathbb { R } _ { + }$ , prioritizes making the layer $l$ features of the perturbed sample maximally different from the original sample.
|
| 61 |
+
|
| 62 |
+
The additional terms in $F D A + m s$ and $F D A + f d$ encourage the adversarial sample to move far away from the starting point, which may intuitively help in generating (targeted) adversarial examples. Also, notice that $F D A + m s$ requires the modeling of both the source and target class distributions, whereas the others only require the modeling of the target class distribution.
|
| 63 |
+
|
| 64 |
+
Optimization Procedure. The trained auxiliary models afford a way to construct a fully differentiable path for gradient-based optimization of the objective functions. Specifically, to compute $F D A$ adversarial noise from layer $l$ , we first build a composite model using the truncated whitebox model $f _ { l }$ and the corresponding layer’s auxiliary model $g _ { l , c = y _ { t g t } }$ for the target class $y _ { t g t }$ , as shown in Figure 1(bottom). The loss is calculated as the Binary Cross Entropy (BCELoss) between the predicted $p ( y = y _ { t g t } | f _ { l } ( x ) )$ and 1. Thus, we perturb the input image in the direction that will minimize the loss, in turn maximizing $p ( y = y _ { t g t } | f _ { l } ( x ) )$ . For optimization, we employ iterative gradient descent with momentum, as the inclusion of a momentum term in adversarial attacks has proven effective (Inkawhich et al., 2019; Dong et al., 2018). See Appendix $\mathrm { D }$ for more details.
|
| 65 |
+
|
| 66 |
+
# 4 EXPERIMENTAL SETUP
|
| 67 |
+
|
| 68 |
+
ImageNet models. For evaluation we use popular CNN architectures designed for the ImageNet-1k (Deng et al., 2009) classification task: VGG-19 with batch-normalization (VGG19) (Simonyan & Zisserman, 2015), DenseNet-121 (DN121) (Huang et al., 2017), and ResNet-50 (RN50) (He et al.,
|
| 69 |
+
|
| 70 |
+
2016). All models are pre-trained and found in the PyTorch Model Zoo. Note, our methods are in no way specific to these particular models/architectures. We also emphasize transfers across different architectures rather than showing results between models from the same family.
|
| 71 |
+
|
| 72 |
+
Layer decoding scheme. Given a pre-trained model, we must choose a set of layers $\mathcal { L }$ to probe. For each model we subsample the layers such that we probe across the depth. For notation we use relative layer numbers, so layer 0 of DN121 $( D N 1 2 1 _ { l = 0 } )$ ) is near the input layer and $D N 1 2 1 _ { l = 1 2 }$ is closer to the classification layer. For all models, the deepest layer probed is the logit layer. Appendix A decodes the notation for each model.
|
| 73 |
+
|
| 74 |
+
Auxiliary model training. We must also choose a set of classes $\mathcal { C }$ that we are interested in modeling. Recall, the number of auxiliary models required for a given base model is the number of layers probed multiplied by the number of classes we are interested in modeling. Attempting to model the feature distributions for all 1000 ImageNet classes for each layer is expensive, so we instead choose to run the majority of tests with a set of 10 randomly chosen classes (which are meant to be representative of the entire dataset): 24:“grey-owl”, 99:“goose”, 245:“bulldog”, 344:“hippo”, 471:“cannon”, 555:“fire-truck”, 661:“Model-T”, 701:“parachute”, 802:“snowmobile”, 919:“streetsign”. Thus, for each layer of each model we train 10 auxiliary classifiers, one for each class. After identifying high performing attack settings, we then produce results for all 1000 classes.
|
| 75 |
+
|
| 76 |
+
The architecture of all auxiliary models is the same, regardless of model, layer, or class. Each is a 2-hidden layer NN with a single output unit. There are 200 neurons in each hidden layer and the number of input units matches the size of the input feature map. To train the auxiliary models, unbiased batches from the whole ImageNet-1k training set are pushed through the truncated pretrained model $\left( f _ { l } \right)$ , and the extracted features are used to train the auxiliary model parameters.
|
| 77 |
+
|
| 78 |
+
Experimental procedure. Since we have three pre-trained models, there are 6 blackbox transfer scenarios to evaluate (no self-transfers). We use the ImageNet-1K validation set as the test dataset. Because $F D A + m s$ requires both the source and target class distributions, for the targeted attack evaluations we only use source samples from the 10 trained classes, and for each sample, target each of the other 9 classes. For baseline attacks, we use targeted random-start Projected Gradient Descent (tpgd) (Madry et al., 2018; Kurakin et al., 2018), targeted NeurIPS2017 competition winning momentum iterative method (tmim) (Dong et al., 2018), and the Activation Attack (AA) (Inkawhich et al., 2019). Further, all targeted adversarial examples are constrained by $\ell _ { \infty } \epsilon = 1 6 / 2 5 5$ as described in (Dong et al., 2018; Kurakin et al., 2018). As experimentally found, $\lambda = 0 . 8$ in (2) and $\eta = 1 \mathrm { e } { - 6 }$ in (3). Finally, as measured over the initially correctly classified subset of the test dataset (by both the whitebox and blackbox models), attack success is captured in two metrics. Error is the percentage of examples that the blackbox misclassifies and Targeted Success Rate (tSuc) is the percentage of examples that the blackbox misclassifies as the target label.
|
| 79 |
+
|
| 80 |
+
# 5 EMPIRICAL RESULTS
|
| 81 |
+
|
| 82 |
+
# 5.1 10-CLASS IMAGENET RESULTS
|
| 83 |
+
|
| 84 |
+
The primary axis of interest is how attack success rate varies with the layer depth from which the feature distributions are attacked. Figure 2 shows the transfer results between all pairs of whitebox and blackbox models. Each plot shows a metric of attack success versus relative layer depth of the generated attack. The notation $\mathrm { D N } 1 2 1 \mathrm { V G G } 1 9$ indicates adversarial examples were generated with a DN121 whitebox model and transferred to a VGG19 blackbox model.
|
| 85 |
+
|
| 86 |
+
Similar to Inkawhich et al. (2019), transferability trends for $F D A s$ from a given whitebox model appear blackbox model agnostic (e.g. the shape of the curves from $\mathrm { D N } 1 2 1 \mathrm { R N } 5 0$ are the same as $\mathrm { D N } 1 2 1 \mathrm { V G G } 1 9 $ ). This is a positive property, as once the optimal transfer layer for a whitebox model is found, evidence shows it will be the same for any blackbox model architecture. Further, the most powerful transfers come from perturbations of intermediate features, rather than perturbations of classification layer information. Another global trend is that in tSuc, $F D A + f d$ performs best, $F D A$ performs worst, $F D A + m s$ is in-between, and all $F D A s$ significantly outperform the other baselines. In the error metric, $F D A + f d$ is best in early layers, $F D A + m s$ is best in later layers, and $F D A$ routinely under-performs the AA baseline. Although all attacks are targeted, it is relevant to report error as it is still an indication of attack strength. Also, it is clearly beneficial for the targeted attack objective to include a term that encourages the adversarial example to move far away from its starting place ( $F D A + m s$ & $F D A + f d )$ in addition to moving toward the target region.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: Targeted adversarial attack transfer results. The $\mathbf { X }$ -axis of each plot is the relative layer depth at which the adversarial example was generated from. Each row is a different whitebox model.
|
| 90 |
+
|
| 91 |
+
We now compare performance across whitebox models. For a DN121 whitebox, $F D A + f d$ from $D N 1 2 1 _ { l = 7 }$ is the optimal targeted attack with an average tSuc of $34 \%$ . For $\mathrm { D N } 1 2 1 \mathrm { R N } 5 0$ , this attack outperforms the best baseline by $14 \%$ and $32 \%$ in error and tSuc, respectively. For a VGG19 whitebox, $F D A + f d$ from $V G G 1 9 _ { l = 5 }$ is the optimal targeted attack with an average tSuc of $2 . 3 \%$ . For $\mathrm { V G G 1 9 \to R N } 5 0$ , this attack outperforms the best baseline by $15 \%$ and $2 \%$ in error and tSuc, respectively. For a RN50 whitebox, $F D A + f d$ from $R N 5 0 _ { l = 8 }$ is the optimal targeted attack with an average tSuc of $18 \%$ . For $\mathrm { R N } 5 0 \mathrm { D N } 1 2 1$ , this attack outperforms the best baseline by $27 \%$ and $17 \%$ in error and tSuc, respectively.
|
| 92 |
+
|
| 93 |
+
# 5.2 1000-CLASS IMAGENET RESULTS
|
| 94 |
+
|
| 95 |
+
Table 1: Transferability rates for 1000-class targeted attack tests using optimal layers.
|
| 96 |
+
|
| 97 |
+
<table><tr><td>attack</td><td>DN121→VGG19 error</td><td>tSuc</td><td>DN121→RN50 error</td><td>tSuc</td><td>RN50 → error</td><td>DN121 tSuc</td><td>RN50 error</td><td>→VGG19 tSuc</td></tr><tr><td>tpgd</td><td>23.1</td><td>0.3</td><td>21.4</td><td>0.6</td><td>20.2</td><td>0.5</td><td>22.4</td><td>0.3</td></tr><tr><td>tmim</td><td>48.6</td><td>1.4</td><td>45.5</td><td>2.2</td><td>44.3</td><td>2.9</td><td>46.7</td><td>1.3</td></tr><tr><td>FDA</td><td>64.9</td><td>15.5</td><td>64.3</td><td>18.1</td><td>56.4</td><td>12.6</td><td>54.6</td><td>6.9</td></tr><tr><td>FDA+ms</td><td>91.9</td><td>21.7</td><td>91.9</td><td>23.4</td><td>87.3</td><td>15.9</td><td>85.3</td><td>10.2</td></tr><tr><td>FDA+fd</td><td>81.2</td><td>29.0</td><td>81.7</td><td>30.9</td><td>82.6</td><td>24.3</td><td>78.9</td><td>15.9</td></tr></table>
|
| 98 |
+
|
| 99 |
+
Recall, due to the computational complexity of training one auxiliary model per class per layer per model, we ran the previous experiments using 10 randomly sampled ImageNet-1k classes. In reality, this may be a realistic attack scenario because an adversary would likely only be interested in attacking certain source-target pairs. However, to show that the 10 chosen classes are not special, and the previously identified optimal transfer layers are still valid, we train all 1000 class auxiliary models for $D N 1 2 1 _ { l = 7 }$ and $R N 5 0 _ { l = 8 }$ . We exclude VGG19 because of its inferior performance in previous tests. Table 1 shows results for the four transfer scenarios. Attack success rates are all averaged over four random $1 0 \mathrm { k }$ splits and the standard deviation of all measurements is less than $1 \%$ . In these tests, for each source sample, a random target class is chosen. As expected, the 1000-class results closely match the previously reported 10-class results.
|
| 100 |
+
|
| 101 |
+
# 6 ANALYSIS OF TRANSFER PROPERTIES
|
| 102 |
+
|
| 103 |
+
We now investigate why a given layer and/or whitebox model is better for creating transferable adversarial examples. We also explore the hypothesis that the layer-wise transfer properties of a
|
| 104 |
+
|
| 105 |
+
DNN implicate the transition of intermediate features from task/data-specific to model-specific. Intuitively, early layers of DNNs trained for classification may be working to optimally construct a task/data-specific feature set (Zeiler & Fergus, 2014; Yosinski et al., 2014). However, once the necessary feature hierarchy is built to model the data, further layers may perform extra processing to best suit the classification functionality of the model. This additional processing may be what makes the features model-specific. We posit that the peak of the tSuc curve for a given transfer directly encodes the inflection point from task/data-specific to model-specific features in the whitebox model. Instinctively, to achieve targeted attack success, the layer at which the attacks are generated must have captured the concepts of the classes for the general task of classification, without being overly specific to the architecture. Thus, layers prior to the inflection point may not have solidified the class concepts, whereas layers after the inflection point may have established the class concepts and are further processing them for the model output. This may also be considered an extension of the convergent learning theory of Li et al. (2016) and general-to-specific theory of Yosinski et al. (2014).
|
| 106 |
+
|
| 107 |
+
# 6.1 INTERMEDIATE DISRUPTION
|
| 108 |
+
|
| 109 |
+
One way to measure why and how adversarial attacks work is to observe how the intermediate representations change as a result of perturbations to the input. Our trained auxiliary models afford a novel way to monitor the effects of such perturbations in deep feature space. To measure how much a layer’s features have changed as a result of a (targeted) adversarial perturbation, we define layerwise disruption as the difference between the target class probability before and after perturbation, as measured in layer $l$ of model $f$ : disruption $= p ( y = y _ { t g t } | f _ { l } ( x + \delta ) ) - p ( y = y _ { t g t } | f _ { l } ( x ) )$ .
|
| 110 |
+
|
| 111 |
+
Figure 3 shows the average disruption caused in each transfer scenario, using both logit-based (tmim) and feature-based $( F D A + f d )$ adversarial attacks. Each row plots the disruption versus layer depth from a single whitebox model to each blackbox model (e.g. the top row results from $\mathrm { D N } 1 2 1 $ VGG19 and $\mathrm { D N } 1 2 1 \mathrm { R N } 5 0$ transfers). Each line represents the average disruption caused by some adversarial attack, where all FDAs are $F D A + f d$ . The first column of plots shows the impact of each attack on the whitebox model’s feature distributions while the second and third columns shows impacts on the blackbox models’ feature distributions.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Disruption versus layer depth for all transfer scenarios. Each row uses a different whitebox model. Each line is a different attack, where all FDAs are $F D A + f d$ .
|
| 115 |
+
|
| 116 |
+
It appears FDAs generated from early layers (e.g. $D N 1 2 1 _ { l = 0 }$ , $V G G 1 9 _ { l = 0 }$ , $R N 5 0 _ { l = 0 }$ ) disrupt features the most in early layers and less so in deeper layers. Therefore, a sample resembling class $y _ { t g t }$ in an early layer does not mean it will ultimately be classified as $y _ { t g t }$ . However, recall from Figure 2 that attacks from early layers create very powerful untargeted adversarial examples (error). This indicates that early layer perturbations are amplified as they proceed through the model (Lin et al., 2019), just not in a class-specific manner. Next, as expected, attacks that use information from the last layers of a whitebox model (e.g. tmim, $D N 1 2 1 _ { l = 1 3 }$ , $V G G 1 9 _ { l = 9 }$ , $R N 5 0 _ { l = 1 2 }$ ) create the largest disruption in the last layers of the whitebox, but not necessarily at the last layers of the blackbox models. However, the optimal transfer attacks $\langle D N 1 2 1 _ { l = 7 }$ , $V G G 1 9 _ { l = 5 }$ , $R N 5 0 _ { l = 8 }$ ) have high disruption all throughout the models, not just at the last layer. This is further evidence that perturbations of classification-layer features are overly model-specific and perturbations of optimal transfer-layer features are more specific to the data/task. Finally, notice that the maximum disruption caused in any blackbox model layer from VGG19 whitebox transfers is around $40 \%$ (row 2). For the DN121 and RN50 whitebox models, the maximum disruption is around $80 \%$ . This may explain VGG19 being an inferior whitebox model to transfer from, as the perturbation of intermediate VGG features does not in-turn cause significant disruption of blackbox model features.
|
| 117 |
+
|
| 118 |
+
# 6.2 AUXILIARY MODEL CORRELATION WITH FULL MODEL
|
| 119 |
+
|
| 120 |
+
Another point of analysis is to investigate the correlation/discrepancy between the auxiliary models at a given layer and the output of the whitebox model. This may also indicate a transition from task/data-specific to model-specific features. We discuss discrepancy as an indication of how different the auxiliary model outputs are from the whitebox model outputs. Then correlation is the inverse of discrepancy so that when the auxiliary model outputs align well with the whitebox model outputs, the discrepancy is low and correlation is high. To evaluate discrepancy at a given layer $l$ for input $x$ , we aggregate the logit values (i.e. pre-sigmoid/softmax) for each class in $\mathcal { C }$ , as measured by the auxiliary models $g _ { l , c }$ and the whitebox model $f$ , into separate vectors. Then, a softmax (smax) operation is performed on each vector to establish two proper probability distributions over the classes in $\mathcal { C }$ . Discrepancy is then defined as the Kullback-Leibler divergence $( D _ { \mathrm { K L } } )$ between the two distributions, or discrepancy $= \ D _ { \mathrm { K L } } \big ( \mathrm { s m a x } ( \big [ g _ { l , c } ( f _ { l } ( x ) ) \big ] _ { \forall c \in \mathcal { C } } ) \ \big \| \ \mathrm { s m a x } ( \big [ f ( x ) [ c ] \big ] _ { \forall c \in \mathcal { C } } ) \big )$ . Here, $f ( x ) [ c ]$ is the class $c$ logit value from the whitebox model $f$ given input $x$ . Figure 4 shows the layer-wise auxiliary model correlations with the whitebox model outputs as measured from the average discrepancy over 500 input samples of classes in $\mathcal { C }$ .
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: Correlation of a layer’s auxiliary models with the whitebox model output.
|
| 124 |
+
|
| 125 |
+
Note, the shapes of the curves are more informative than the actual values. Also, VGG19 layers have been shifted in notation by $+ 4$ so that layer depth 13 is the logit layer of each model. As expected, the auxiliary models in early layers have little correlation with the model output, while auxiliary models in later layers have high correlation with the model output. Importantly, the optimal transfer layers $( { \star } )$ mark a transition in the trendlines after which correlation increases sharply. This effect may directly explain why layers after the optimal layer are suboptimal, because the auxiliary models become highly correlated with the model output and begin to overfit the architecture. Since the auxiliary models are not highly-correlated with the output layer at the optimal-transfer-layers, we may surmise that the captured features are still mostly task/data specific.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 5: Saliency maps of auxiliary models on several interesting inputs across model depth.
|
| 129 |
+
|
| 130 |
+
# 6.3 AUXILIARY MODEL SALIENCY
|
| 131 |
+
|
| 132 |
+
For a more qualitative analysis, we may inspect the auxiliary model saliency maps. Given an image of class $y _ { s r c }$ , we visualize in Figure 5 what is salient to the $y _ { s r c }$ auxiliary models at several DN121 layer depths using SmoothGrad (Smilkov et al., 2017) (see Appendix E for additional saliency examples for RN50). Notice, an observable transition occurs at the high-performing transfer layers from Figure 2 $( D N 1 2 1 _ { l = 5 , 7 } )$ . The salient regions move from large areas around the whole image (e.g. $D N 1 2 1 _ { l = 0 , 3 }$ ) to specific regions that are also salient in the classification layer $( D N 1 2 1 _ { l = 1 3 } )$ ). The saliency and correlation transitions together show that the well-transferring layers have learned similar salient features as the classification layer while not being overly correlated with the model output. Therefore, perturbations focused on these salient regions significantly impact the final classification without being too specific to the generating architecture.
|
| 133 |
+
|
| 134 |
+
# 6.4 CLASS DISTRIBUTION SEPARABILITY
|
| 135 |
+
|
| 136 |
+
Finally, our trained auxiliary models afford new ways of measuring class-wise feature entanglement/separability for the purpose of explaining transfer performance. We adopt the definition of entanglement from Frosst et al. (2019) which states that highly entangled features have a “lack of separation of class manifolds in representation space,” and define separability as the inverse of entanglement. One way to measure the separability between class distributions in a layer using the auxiliary models is to gauge how far a sample has to “move” to enter a region of high class confidence. We define intra-class distance as the distance a sample has to move to enter a highconfidence region of its source class’s distribution. Similarly, we define inter-class distance as the distance a sample has to move to enter a high-confidence region of a target class distribution, where $y _ { s r c } \neq y _ { t g t }$ . Then, separability in a layer is the difference between average inter-class and intra-class distances. In practice, for a given sample, given model, chosen target class, and chosen layer, we iteratively perturb the sample using $F D A$ with a small step size (e.g. 5e-5) until the confidence of the target distribution auxiliary network is over a threshold (e.g. $9 9 . 9 \%$ ). The number of perturbation steps it takes to reach the confidence threshold encodes the distance of the sample to the targeted class’s distribution.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 6: Class separability versus layer depth for each whitebox.
|
| 140 |
+
|
| 141 |
+
Results for the three whitebox models are shown in Figure 6, where the vertical axis is the separability in units of perturbation steps, and the horizontal axis is the layer-depth of each model. We see that there is some separability in all layers, for all models, indicating that even features very close to the input layer are somewhat class-specific. Further, VGG19’s features are much less separable than DN121 and RN50, indicating why VGG19 may have performed much worse as a whitebox model in the transferability tests. In the same vein, DN121 has generally the most separated features which further indicates why it may be a superior whitebox model. Intuitively, if a model/layer has highly class-separable feature distributions, FDA attacks may be more transferable because there is less ambiguity between the target class’s distribution and other class distributions during generation.
|
| 142 |
+
|
| 143 |
+
# 7 CONCLUSIONS
|
| 144 |
+
|
| 145 |
+
We present a new targeted blackbox transfer-based adversarial attack methodology that achieves state-of-the-art success rates for ImageNet classifiers. The presented attacks leverage learned classwise and layer-wise intermediate feature distributions of modern DNNs. Critically, the depth at which features are perturbed has a large impact on the transferability of those perturbations, which may be linked to the transition from task/data-specific to model-specific features in an architecture. We further leverage the learned feature distributions to measure the entanglement/separability of class manifolds in the representation space and the correlations of the intermediate feature distributions with the model output. Interestingly, we find the optimal attack transfer layers have feature distributions that are class-specific and highly-separable, but are not overly-correlated with the whitebox model output. We also find that highly transferable attacks induce large disruptions in the intermediate feature space of the blackbox models.
|
| 146 |
+
|
| 147 |
+
# ACKNOWLEDGMENTS
|
| 148 |
+
|
| 149 |
+
The research was supported in part by AFRL (FA8750-18-2-0057), DARPA, DOE, NIH, NSF and ONR.
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, pp. 39–57. IEEE Computer Society, 2017.
|
| 154 |
+
|
| 155 |
+
Shuyu Cheng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Improving black-box adversarial attacks with a transfer-based prior. CoRR, abs/1906.06919, 2019.
|
| 156 |
+
|
| 157 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248–255. IEEE Computer Society, 2009.
|
| 158 |
+
|
| 159 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In CVPR, pp. 9185–9193. IEEE Computer Society, 2018.
|
| 160 |
+
|
| 161 |
+
Nicholas Frosst, Nicolas Papernot, and Geoffrey E. Hinton. Analyzing and improving representations with the soft nearest neighbor loss. In ICML, volume 97 of Proceedings of Machine Learning Research, pp. 2012–2020. PMLR, 2019.
|
| 162 |
+
|
| 163 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 164 |
+
|
| 165 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pp. 770–778. IEEE Computer Society, 2016.
|
| 166 |
+
|
| 167 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, pp. 2261–2269. IEEE Computer Society, 2017.
|
| 168 |
+
|
| 169 |
+
Nathan Inkawhich, Wei Wen, Hai Li, and Yiran Chen. Feature space perturbations yield more transferable adversarial examples. In CVPR. IEEE Computer Society, 2019.
|
| 170 |
+
|
| 171 |
+
Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In ICLR. OpenReview.net, 2017.
|
| 172 |
+
|
| 173 |
+
Alexey Kurakin, Ian J. Goodfellow, Samy Bengio, Yinpeng Dong, Fangzhou Liao, Ming Liang, Tianyu Pang, Jianfeng Zhu, Xiaolin C. Hu, Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, Alan Loddon Yuille, Sangxia Huang, Yao Zhao, Yuzhe Zhao, Zhonglin Han, Junjiajia Long, Yerkebulan Berdibekov, Takuya Akiba, Seiya Tokui, and Motoki Abe. Adversarial attacks and defences competition. arXiv, abs/1804.00097, 2018.
|
| 174 |
+
|
| 175 |
+
Yixuan Li, Jason Yosinski, Jeff Clune, Hod Lipson, and John E. Hopcroft. Convergent learning: Do different neural networks learn the same representations? In ICLR, 2016.
|
| 176 |
+
|
| 177 |
+
Ji Lin, Chuang Gan, and Song Han. Defensive quantization: When efficiency meets robustness. In ICLR. OpenReview.net, 2019.
|
| 178 |
+
|
| 179 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In ICLR. OpenReview.net, 2017.
|
| 180 |
+
|
| 181 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR. OpenReview.net, 2018.
|
| 182 |
+
|
| 183 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In CVPR, pp. 2574–2582. IEEE Computer Society, 2016.
|
| 184 |
+
|
| 185 |
+
Nina Narodytska and Shiva Prasad Kasiviswanathan. Simple black-box adversarial attacks on deep neural networks. In CVPR Workshops, pp. 1310–1318. IEEE Computer Society, 2017.
|
| 186 |
+
|
| 187 |
+
Nicolas Papernot, Patrick D. McDaniel, and Ian J. Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv, abs/1605.07277, 2016.
|
| 188 |
+
Nicolas Papernot, Patrick D. McDaniel, Ian J. Goodfellow, Somesh Jha, Z. Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In AsiaCCS, pp. 506–519. ACM, 2017.
|
| 189 |
+
Sara Sabour, Yanshuai Cao, Fartash Faghri, and David J. Fleet. Adversarial manipulation of deep representations. In ICLR, 2016.
|
| 190 |
+
Yash Sharma, Tien-Dung Le, and Moustafa Alzantot. CAAD 2018: Generating transferable adversarial examples. CoRR, abs/1810.01268, 2018.
|
| 191 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 192 |
+
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda B. Viegas, and Martin Wattenberg. Smooth- ´ grad: removing noise by adding noise. arXiv, abs/1706.03825, 2017.
|
| 193 |
+
Jiawei Su, Danilo Vasconcellos Vargas, and Kouichi Sakurai. One pixel attack for fooling deep neural networks. arXiv, abs/1710.08864, 2017.
|
| 194 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 195 |
+
Florian Tramer, Nicolas Papernot, Ian J. Goodfellow, Dan Boneh, and Patrick D. McDaniel. The \` space of transferable adversarial examples. arXiv, abs/1704.03453, 2017.
|
| 196 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian J. Goodfellow, Dan Boneh, and Patrick D. \` McDaniel. Ensemble adversarial training: Attacks and defenses. In ICLR. OpenReview.net, 2018.
|
| 197 |
+
Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L. Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In CVPR. IEEE Computer Society, 2019.
|
| 198 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In NIPS, pp. 3320–3328, 2014.
|
| 199 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV (1), volume 8689 of Lecture Notes in Computer Science, pp. 818–833. Springer, 2014.
|
| 200 |
+
Wen Zhou, Xin Hou, Yongjun Chen, Mengyun Tang, Xiangqi Huang, Xiang Gan, and Yong Yang. Transferable adversarial perturbations. In ECCV (14), volume 11218 of Lecture Notes in Computer Science, pp. 471–486. Springer, 2018.
|
| 201 |
+
|
| 202 |
+
# APPENDIX
|
| 203 |
+
|
| 204 |
+
A. LAYER DECODING
|
| 205 |
+
|
| 206 |
+
Table 2: Whitebox Model Layer Decoding Table
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Layer</td><td>DenseNet-121</td><td>VGG19bn</td><td>ResNet-50</td></tr><tr><td>0</td><td>6,2</td><td>512</td><td>3,1</td></tr><tr><td>1</td><td>6,10</td><td>512</td><td>3,2</td></tr><tr><td>2</td><td>6,12</td><td>512</td><td>3,3</td></tr><tr><td>3</td><td>6,12,2</td><td>512</td><td>3,4</td></tr><tr><td>4</td><td>6,12,14</td><td>512</td><td>3,4,1</td></tr><tr><td>5</td><td>6,12,20</td><td>512</td><td>3,4,2</td></tr><tr><td>6</td><td>6,12,22</td><td>512</td><td>3,4,3</td></tr><tr><td>7</td><td>6,12,24</td><td>512</td><td>3,4,4</td></tr><tr><td>8</td><td>6,12,24,2</td><td>FC2</td><td>3,4,5</td></tr><tr><td>9</td><td>6,12,24,8</td><td>FC3</td><td>3,4,6</td></tr><tr><td>10</td><td>6,12,24,12</td><td></td><td>3,4,6,1</td></tr><tr><td>11</td><td>6,12,24,14</td><td></td><td>3,4,6,2</td></tr><tr><td>12</td><td>6,12,24,16</td><td></td><td>3,4,6,3</td></tr><tr><td>13</td><td>6,12,24,16,FC</td><td></td><td>3,4,6,3,FC</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 2 is the layer number look-up-table that corresponds to the layer notation used in the paper. DenseNet-121 (DN121), VGG19bn (VGG), and ResNet-50 (RN50) appear because they are the model architectures used for the main results. The DN121 notation follows the implementation here: https://github.com/pytorch/vision/blob/master/torchvision/ models/densenet.py. In english, layer 0 shows that the output of the truncated model comes from the $2 ^ { n d }$ denseblock of the $2 ^ { { \overset { \vartriangle } { n } } d }$ denselayer. Layer 11 means the output of the truncated model comes from the $1 4 ^ { t h }$ denseblock in the $4 ^ { t h }$ denselayer. Layer 13 indicates the output comes from the final FC layer of the model.
|
| 211 |
+
|
| 212 |
+
The VGG model does not have denseblocks or dense layers so we use another notation. In the implementation at https://github.com/pytorch/vision/blob/master/ torchvision/models/vgg.py, the VGG19bn model is constructed from the layer array: $[ 6 4 , 6 4 , ^ { \prime } M ^ { \prime }$ , 128, 128,0 $M ^ { \prime }$ , 256, 256, 256, 256,0 $M ^ { \prime }$ , 512, 512, 512, 512,0 $M ^ { \prime }$ , 512, 512, 512, 512, $^ { \prime } M ^ { \prime } , F C 1 , F C 2 , F C 3 ]$ , and we follow this convention in the table. In the array, each number corresponds to a convolutional layer with that number of filters, the M’s represent max-pooling layers, and the FCs represent the linear layers at the end of the model. Notice, in these tests we do not consider the first 11 layers of VGG19 as they were shown to have very little impact on classification when perturbed.
|
| 213 |
+
|
| 214 |
+
The RN50 notation follows the implementation here: https://github.com/pytorch/ vision/blob/master/torchvision/models/resnet.py. As designed, the model has 4 layer groups with [3,4,6,3] Bottlenecks in each, respectively. Thus, layer 0 means the output of the truncated model comes from the $1 ^ { s t }$ Bottleneck of layer group 2. Layer 12 means the output comes from the $3 ^ { r d }$ Bottleneck of layer group 4, and layer 13 means the output comes from the final FC layer (i.e. output layer) of the model.
|
| 215 |
+
|
| 216 |
+
# B. FULL TARGETED TRANSFER RESULTS
|
| 217 |
+
|
| 218 |
+
Figure 7 shows the full targeted attack transfer results from which the Figure 2 were extracted. These full results include two additional metrics of attack success. Untargeted Transfer Rate (uTR) is the rate at which examples that fool the whitebox also fool the blackbox (encodes likelihood of misclassification). Targeted Transfer Rate (tTR) is the rate at which successful targeted examples on the whitebox are also successful targeted examples on the blackbox (encodes likelihood of targeted misclassification). Error and tSuc are described in Section 4.
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 7: Full targeted adversarial attack transfer results. Each row is a unique transfer scenario and each column is a different attack success metric. The $\mathbf { X }$ -axis of each plot is the layer depth at which the adversarial example was generated from. Note, top two rows are transfers from DN121 whitebox model, middle two rows are from VGG19 whitebox model, and bottow two rows are from RN50 whitebox.
|
| 222 |
+
|
| 223 |
+
# C. UNTARGETED FEATURE DISTRIBUTION ATTACKS
|
| 224 |
+
|
| 225 |
+
The goal of an untargeted attack is to generate an adversarial noise $\delta$ that when added to a clean sample $x$ of class $y _ { s r c }$ , the classification result of $x + \delta$ is not $y _ { s r c }$ . The key intuition for feature distribution-based untargeted attacks is that if a sample’s features are made to be outside of the feature distribution of class $y _ { s r c }$ at some layer of intermediate feature space, then it will likely not be classified as $y _ { s r c }$ .
|
| 226 |
+
|
| 227 |
+
uFDA The first untargeted attack variant is uFDA which is described as
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\operatorname* { m i n } _ { \delta } p ( y = y _ { s r c } | f _ { l } ( x + \delta ) ) .
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
uFDA minimizes the probability that the layer $l$ features of the perturbed sample $x + \delta$ are from the source class $y _ { s r c }$ distribution. Unlike the targeted samples which drive towards high confidence regions of a target class feature distribution, this objective drives the sample towards low confidence regions of the source class feature distribution.
|
| 234 |
+
|
| 235 |
+
$u F D A + f d$ The second untargeted variant $u F D A + f d$ is described as
|
| 236 |
+
|
| 237 |
+
$$
|
| 238 |
+
\operatorname* { m i n } _ { \delta } p _ { l } ( y = y _ { s r c } | f _ { l } ( x + \delta ) ) - \eta \frac { \| f _ { l } ( x + \delta ) - f _ { l } ( x ) \| _ { 2 } } { \| f _ { l } ( x ) \| _ { 2 } } .
|
| 239 |
+
$$
|
| 240 |
+
|
| 241 |
+
$u F D A + f d$ also carries a feature disruption term so that the objective drives the perturbed sample towards low confidence regions of the source class feature distribution and maximal distance from the original sample’s feature representation.
|
| 242 |
+
|
| 243 |
+
fd-only The final untargeted attack fd-only is described as
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\operatorname* { m a x } _ { \delta } \frac { \| f _ { l } ( x + \delta ) - f _ { l } ( x ) \| _ { 2 } } { \| f _ { l } ( x ) \| _ { 2 } } .
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
Notice, fd-only is simply the feature disruption term and is a reasonable standalone untargeted attack objective because making features maximally different may intuitively cause misclassification.
|
| 250 |
+
|
| 251 |
+
To test attack success, we generate untargeted adversarial examples from both DN121 and RN50 whiteboxes and test transfers to a VGG19 blackbox model. It is common to evaluate untargeted attacks with a tighter noise constraint (Kurakin et al., 2018; Dong et al., 2018) as the task is simpler, so in these tests we use $\ell _ { \infty } \epsilon = 4 / 2 5 5$ and $\epsilon = 8 / 2 5 5$ (rather than $\epsilon = 1 6 / 2 5 5$ used for targeted tests). For baselines, we use the Madry et al. (2018) random start PGD attack (upgd) and the Dong et al. (2018) competition winning momentum iterative attack (umim). Similar to the layer-wise targeted evaluations, each ”clean” source sample belongs to the same set of 10 previously modeled classes. Figure 8 shows the error rates versus layer depth for the attacks.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 8: Error versus layer depth plots caused by untargeted adversarial attacks for $\mathrm { D N } 1 2 1 $ VGG19 and $\mathrm { R N } 5 0 \mathrm { V G G } 1 9$ transfer scenarios at two different attack strengths $\epsilon = 4 , 8$ .
|
| 255 |
+
|
| 256 |
+
As expected, the error rate increases with epsilon and the layer depth at which feature-based attacks are generated from has a large impact on attack success rate. In general, $u F D A + f d$ is the top performer, followed by fd-only, then uFDA. However, uFDA often under-performs the umim baseline, further indicating that for adversarial attacks in feature space it is beneficial to include a term that prioritizes feature disruption (e.g. $u F D A +$ fd & fd-only).
|
| 257 |
+
|
| 258 |
+
On average across models, at $\epsilon = 4 / 2 5 5$ , the optimal layer $u F D A + f d$ has an untargeted error rate of $37 \%$ , which is $9 \%$ higher than the best baseline. At $\epsilon = 8 / 2 5 5$ , the optimal layer $u F D A + f d$ has an untargeted error rate of $79 \%$ , which is $27 \%$ higher than the best baseline. Also, both whitebox models perform similarly in terms of attack success rate, however the performance of fd-only varies between the two (especially at $\epsilon = 8 / 2 5 5 )$ . Surprisingly, fd-only which simply disrupts the original feature map is the optimal attack for the DN121 whitebox (by a small margin). Finally, note that the optimal transfer layers from the targeted attacks (i.e. $D N 1 2 1 _ { l = 7 }$ and $R N 5 0 _ { l = 8 }$ ) are also high performing layers for the untargeted attacks.
|
| 259 |
+
|
| 260 |
+
# D. ADVERSARIAL EXAMPLE GENERATION PROCESS
|
| 261 |
+
|
| 262 |
+
Recall, because the auxiliary models are NNs, the optimization objectives described for both the targeted and untargeted attacks can be solved with an iterative gradient descent procedure. For any version of the FDA attacks, we first build a ”composite” model which includes the truncated whitebox model $f _ { l }$ and the appropriate auxiliary model $g _ { l , c }$ , as shown in Figure 1(bottom). An attack loss function $L _ { F D A }$ is then defined which includes a BCELoss term and any additional term which is trivially incorporated (e.g. the feature disruption term). We then iteratively perturb the source image for $K$ iterations using the sign of a collected momentum term. Similar to Dong et al. (2018) and Inkawhich et al. (2019), momentum is calculated as
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
m _ { k + 1 } = m _ { k } + \frac { \nabla _ { I _ { k } } L _ { F D A } ( I _ { k } ; \theta ) } { | | \nabla _ { I _ { k } } L _ { F D A } ( I _ { k } ; \theta ) | | _ { 1 } } ,
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
where $m _ { 0 } = \mathbf { 0 }$ and $I _ { k }$ is the perturbed source image at iteration $k$ . The perturbation method for this $\ell _ { \infty }$ constrained attack is then
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
I _ { k + 1 } = C l i p ( I _ { k } - \alpha * s i g n ( m _ { k + 1 } ) , 0 , 1 ) .
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
In this work, all attacks perturb for $K = 1 0$ iterations and $\alpha = \epsilon / K$ .
|
| 275 |
+
|
| 276 |
+
# E. ADDITIONAL SALIENCY
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 9: SmoothGrad saliency maps for RN50 auxiliary models.
|
md/train/rkl85oRqYX/rkl85oRqYX.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rklOg6EFwS/rklOg6EFwS.md
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING ADVERSARIAL ROBUSTNESS REQUIRES REVISITING MISCLASSIFIED EXAMPLES
|
| 2 |
+
|
| 3 |
+
Yisen Wang1∗, Difan $\mathbf { Z o u } ^ { 2 } ;$ ∗ Jinfeng $\mathbf { Y _ { i } ^ { \bullet } }$ , James Bailey4, Xingjun $\mathbf { M a ^ { 4 } }$ †, Quanquan $\mathbf { G } \mathbf { u } ^ { 2 \dag }$
|
| 4 |
+
|
| 5 |
+
1Shanghai Jiao Tong University 2University of California, Los Angles 3JD.com 4The University of Melbourne eewangyisen@gmail.com, {knowzou, qgu}@cs.ucla.edu, yijinfeng@jd.com, {baileyj, xingjun.ma}@unimelb.edu.au
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Deep neural networks (DNNs) are vulnerable to adversarial examples crafted by imperceptible perturbations. A range of defense techniques have been proposed to improve DNN robustness to adversarial examples, among which adversarial training has been demonstrated to be the most effective. Adversarial training is often formulated as a min-max optimization problem, with the inner maximization for generating adversarial examples. However, there exists a simple, yet easily overlooked fact that adversarial examples are only defined on correctly classified (natural) examples, but inevitably, some (natural) examples will be misclassified during training. In this paper, we investigate the distinctive influence of misclassified and correctly classified examples on the final robustness of adversarial training. Specifically, we find that misclassified examples indeed have a significant impact on the final robustness. More surprisingly, we find that different maximization techniques on misclassified examples may have a negligible influence on the final robustness, while different minimization techniques are crucial. Motivated by the above discovery, we propose a new defense algorithm called Misclassification Aware adveRsarial Training (MART), which explicitly differentiates the misclassified and correctly classified examples during the training. We also propose a semi-supervised extension of MART, which can leverage the unlabeled data to further improve the robustness. Experimental results show that MART and its variant could significantly improve the state-of-the-art adversarial robustness.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Despite their great success in applications such as computer vision (He et al., 2016), speech recognition (Wang et al., 2017) and natural language processing (Devlin et al., 2018; Zeng et al., 2019), deep neural networks (DNNs) are extremely vulnerable to adversarial examples crafted by adding small adversarial perturbations to natural examples (Szegedy et al., 2013; Goodfellow et al., 2015; Wu et al., 2020). Given a DNN classifier $h _ { \theta }$ with parameter $\pmb \theta$ and a correctly classified natural example $\mathbf { x }$ with class label $y$ $( h _ { \pmb \theta } ( \mathbf x ) = y )$ , an adversarial example $\mathbf { x } ^ { \prime }$ can be generated by perturbing x such that $h _ { \pmb { \theta } } ( \mathbf { x } ^ { \prime } ) \neq y$ , i.e., the natural example is correctly classified before perturbation but misclassified after perturbation. The perturbation required for misclassification is often small and bounded by an $L _ { p }$ -norm $\| \mathbf { x } ^ { \prime } - \mathbf { x } \| _ { p } \leq \bar { \epsilon }$ , which keeps $\mathbf { x } ^ { \prime }$ within the $\epsilon$ -ball centered at $\mathbf { x }$ , so that it is visually the “same” for human observers. This vulnerability of DNNs raises serious security concerns about their practicability in security critical applications (Chen et al., 2015; Kurakin et al., 2016; Jiang et al., 2019; Finlayson et al., 2019; Ma et al., 2019).
|
| 14 |
+
|
| 15 |
+
Compared with pre/post-processing methods such as feature squeezing $\mathrm { { X u } }$ et al., 2017), input denoising (Guo et al., 2018; Liao et al., 2018; Samangouei et al., 2018; Bai et al., 2019) and adversarial detection (Feinman et al., 2017; Ma et al., 2018; Lee et al., 2018), several defense techniques have been proposed to train DNNs that are inherently robust to adversarial examples including defensive distillation (Papernot et al., 2016), gradient regularization (Gu & Rigazio, 2014; Papernot et al., 2017; Ross & Doshi-Velez, 2018; Tramèr et al., 2018), model compression (Das et al., 2018; Liu et al., 2018) and activation pruning (Dhillon et al., 2018; Rakin et al., 2018), among which adversarial training has been demonstrated to be the most effective (Athalye et al., 2018). Adversarial training can be regarded as a data augmentation technique that trains DNNs on adversarial examples, and can be viewed as solving the following min-max optimization problem (Madry et al., 2018):
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: The distinctive influence of misclassified examples $( S ^ { - } )$ versus correctly classified ones $( S ^ { + } )$ on the robustness of adversarial training. We test the white-box robustness of different strategies on either subset of examples: (a) using them directly for training (“not perturb”); (b) using weak attack (FGSM) in the inner maximization; and (c) using “regularized CE” loss in the outer minimization.
|
| 19 |
+
|
| 20 |
+
$$
|
| 21 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \operatorname* { m a x } _ { \| \mathbf { x } _ { i } ^ { \prime } - \mathbf { x } _ { i } \| _ { p } \leq \epsilon } \ell \big ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) , y _ { i } \big ) ,
|
| 22 |
+
$$
|
| 23 |
+
|
| 24 |
+
where $n$ is the number of training examples and $\ell ( \cdot )$ is the classification loss, such as the commonly used cross-entropy (CE) loss. The inner maximization generates adversarial examples that can be used by the outer minimization to train robust DNNs. Recently, adversarial training with adversarial examples generated by Projected Gradient Descent (PGD) (Madry et al., 2018) has been demonstrated to be the only method that can train moderately robust DNNs without being fully attacked (Athalye et al., 2018). However, there is still a significant gap between adversarial robustness (test accuracy on adversarial examples) and natural accuracy (test accuracy on natural examples), even for simple image datasets like CIFAR-10 (Krizhevsky & Hinton, 2009).
|
| 25 |
+
|
| 26 |
+
Compared with natural training (on natural examples), training adversarially robust DNNs is particularly difficult (Madry et al., 2018). Nakkiran (2019) showed that a model requires more capacity to be robust (i.e., simple models can have high natural accuracy but are less likely to be robust). In addition, the sample complexity of adversarial training can be significantly higher than that of natural training, that is, training robust DNNs tends to require more data either labeled (Schmidt et al., 2018) or unlabeled ones (Uesato et al., 2019; Carmon et al., 2019; Najafi et al., 2019; Zhai et al., 2019). Moreover, Tsipras et al. (2019); Zhang et al. (2019) demonstrated that adversarial robustness may be inherently at odds with natural accuracy. Parallel to these studies, in this paper, we provide some new insights on the adversarial examples used for adversarial training.
|
| 27 |
+
|
| 28 |
+
Recall that the formal definition of an adversarial example is conditioned on it being correctly classified∗ (Carlini et al., 2019). From this perspective, adversarial examples generated from misclassified examples are “undefined”. Most adversarial training variants neglect this distinction, where all training examples are treated equally in both the maximization and the minimization processes, regardless of whether or not they are correctly classified. The only exception we are aware of is Ding et al. (2018), which proposes to use maximal margin optimization for correctly classified examples. Yet they did not pay sufficient attention to misclassified examples. A deeper understanding about the influence of misclassified and correctly classified examples on the robustness is still missing in the literature. Therefore, we raise the following questions:
|
| 29 |
+
|
| 30 |
+
Are the adversarial examples generated from i) misclassified and ii) correctly classified examples, equally important for adversarial robustness? If not, how can one make better use of the difference to improve robustness?
|
| 31 |
+
|
| 32 |
+
In this paper, we investigate this intriguing, yet thus far overlooked aspect of adversarial training, and find that misclassified and correctly classified examples exhibit a distinctive influence on the final robustness. To illustrate this phenomenon, we conduct a proof-of-concept experiment on CIFAR10 in a white-box setting with $L _ { \infty }$ maximum perturbation $\epsilon = 8 / 2 5 5$ . We first train an 8-layer
|
| 33 |
+
|
| 34 |
+
Convolutional Neural Network (CNN) using standard adversarial training with 10-step PGD $( \mathrm { P G D ^ { 1 0 } } )$ ) and step size $\epsilon / 4$ , then use this network $( 8 7 \%$ training accuracy) to select two subsets of natural training examples to investigate: 1) a subset of misclassified examples $S ^ { - }$ $1 3 \%$ of training data), and 2) a subset of correctly classified examples $S ^ { + }$ (also $1 3 \%$ of training data, $| S ^ { + } | = | S ^ { - } |$ ). Using these two subsets, we explore different ways to re-train the same network, and evaluate its robustness against white-box $\mathrm { P G D ^ { 2 0 } }$ (step size $\epsilon / 1 0 $ ) attacks on the test dataset.
|
| 35 |
+
|
| 36 |
+
In Figure 1(a), we find that misclassified examples have a significant impact on the final robustness. Compared with standard adversarial training (dashed blue line), the final robustness drops drastically, if examples in subset $S ^ { - }$ are not perturbed (solid green line) during adversarial training (other examples are still perturbed by $\mathrm { P G } \bar { \mathrm { D } } ^ { 1 0 }$ ). In contrast, the same operation on subset $S ^ { + }$ only slightly affects the final robustness (solid orange line). Previous work has found that removing a small proportion of training examples does not reduce the robustness (Ding et al., 2019), which seems to be true for correctly classified examples, but is apparently not true for misclassified examples.
|
| 37 |
+
|
| 38 |
+
To further understand the distinctive influence of misclassified and correctly classified examples, we test different techniques on them within either the maximization or the minimization process of adversarial training. Firstly, we apply different maximization techniques while keeping the minimization loss CE unchanged. As shown in Figure 1(b), the final robustness is barely affected when we use a weak attack (e.g., Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2015)) to perturb misclassified examples $S ^ { - }$ (all other training examples are still perturbed by $\mathrm { P G D ^ { 1 0 } }$ ). This suggests that different maximization techniques on misclassified examples $S ^ { - }$ may have a negligible influence on the final robustness, provided that the inner maximization problem is solved to a moderate precision (Wang et al., 2019). However, for subset $S ^ { + }$ , a weak attack for the maximization tends to degenerate the robustness. Secondly, we test different minimization techniques with the inner maximization still solved by $\mathrm { P G D ^ { 1 0 } }$ . Interestingly, we find that different minimization techniques on misclassified examples make a significant difference to the final robustness. As shown in Figure 1(c), compared with standard adversarial training (dashed blue line) with the CE loss, the final robustness is significantly improved when the outer minimization on misclassified examples is “regularized” (solid green line) by an additional term (a KL-divergence term that was used previously in Zheng et al. (2016); Zhang et al. (2019)). The same regularization applied to correctly classified examples also helps the final robustness (solid orange line), though not as significantly as for misclassified examples.
|
| 39 |
+
|
| 40 |
+
Motivated by the above observations, we reformulate the adversarial risk to incorporate an explicit differentiation of misclassified examples in a form of regularization. We then propose a new defense algorithm to achieve this in a dynamic way during adversarial training. Our main contributions are:
|
| 41 |
+
|
| 42 |
+
• We investigate the distinctive influence of misclassified and correctly classified examples on the final robustness of adversarial training. We find that the manipulation on misclassified examples has more impact on the final robustness, and the minimization techniques are more crucial than maximization ones under the min-max optimization framework.
|
| 43 |
+
• We propose a regularized adversarial risk which incorporates an explicit differentiation of misclassified examples as a regularizer. Based on that, we further propose a new defense algorithm, called Misclassification Aware adveRsarial Training (MART).
|
| 44 |
+
• Experimentally, we show that adversarial robustness can be significantly improved over the stateof-the-art, by a specific focus on misclassified examples. It also helps improve recently proposed adversarial training with unlabeled data.
|
| 45 |
+
|
| 46 |
+
# 2 MISCLASSIFICATION AWARE ADVERSARIAL RISK
|
| 47 |
+
|
| 48 |
+
In this section, we propose a regularized adversarial risk that incorporates an explicit differentiation of misclassified examples.
|
| 49 |
+
|
| 50 |
+
# 2.1 PRELIMINARIES
|
| 51 |
+
|
| 52 |
+
We first define some notations. We use lower case and lower case bold face to denote scalars and vectors, respectively. We use upper case calligraphic symbols to denote sets.
|
| 53 |
+
|
| 54 |
+
For a $K$ -class $X \geq 2$ ) classification problem, given a dataset $\{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 , \ldots , n }$ with $\mathbf { x } _ { i } \in \mathbb { R } ^ { d }$ as a natural example and $y _ { i } \in \{ 1 , \ldots , \bar { K } \}$ as its associated label, a DNN classifier $h _ { \theta }$ with model
|
| 55 |
+
|
| 56 |
+
parameter $\pmb \theta$ predicts the class of an input example $\mathbf { x } _ { i }$ :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
h _ { \theta } ( \mathbf { x } _ { i } ) = \underset { k = 1 , \ldots , K } { \arg \operatorname* { m a x } } { \mathbf { p } } _ { k } ( \mathbf { x } _ { i } , \theta ) , \quad \mathbf { p } _ { k } ( \mathbf { x } _ { i } , \theta ) = \exp ( \mathbf { z } _ { k } ( \mathbf { x } _ { i } , \theta ) ) / \sum _ { k ^ { \prime } = 1 } ^ { K } \exp ( \mathbf { z } _ { k ^ { \prime } } ( \mathbf { x } _ { i } , \theta ) ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where ${ \bf z } _ { k } ( { \bf x } _ { i } , \mathbf { \boldsymbol { \theta } } )$ is the logits output of the network with respect to class $k$ , and $\mathbf { p } _ { k } ( \mathbf { x } _ { i } , \mathbf { \boldsymbol { \theta } } )$ is the probability (softmax on logits) of $\mathbf { x } _ { i }$ belonging to class $k$ .
|
| 63 |
+
|
| 64 |
+
The adversarial risk (Madry et al., 2018) on dataset $\{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 , \ldots , n }$ and classifier $h _ { \theta }$ can be defined with respect to the 0-1 loss (Zhang et al., 2019) as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathcal { R } ( h _ { \pmb { \theta } } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in \mathcal { B } _ { \epsilon } ( \mathbf { x } _ { i } ) } \mathbb { 1 } \big ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) \neq y _ { i } \big ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathbb { 1 } ( \cdot )$ is the indicator function and $B _ { \epsilon } ( \mathbf { x } _ { i } ) = \{ \mathbf { x } : \| \mathbf { x } - \mathbf { x } _ { i } \| _ { p } \leq \epsilon \}$ denotes the $L _ { p }$ -norm ball centered at $\mathbf { x } _ { i }$ with radius $\epsilon$ . We will focus on the $L _ { \infty }$ -ball in this paper.
|
| 71 |
+
|
| 72 |
+
# 2.2 MISCLASSIFICATION AWARE REGULARIZATION
|
| 73 |
+
|
| 74 |
+
Note that the adversarial risk in (3) is defined on adversarial examples within the $\epsilon$ -ball of all natural examples, regardless of whether they are correctly classified $( \bar { h _ { \pmb { \theta } } } ( \mathbf { x } _ { i } ) = y _ { i } )$ ) or misclassified $( h _ { \pmb \theta } ( \mathbf { x } _ { i } ) \neq y _ { i } )$ by the current model $h _ { \theta }$ . To differentiate, we reformulate the adversarial risk based on the prediction of the current network $h _ { \theta }$ . Specifically, natural training examples can be divided into two subsets with respect to $h _ { \theta }$ , with one subset of correctly classified examples $( S _ { h _ { \pmb \theta } } ^ { + } )$ and one subset of misclassified examples $( S _ { h _ { \pmb { \theta } } } ^ { - } )$ :
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
S _ { h _ { \theta } } ^ { + } = \{ i : i \in [ n ] , h _ { \theta } ( \mathbf { x } _ { i } ) = y _ { i } \} \quad \mathrm { a n d } \quad S _ { h _ { \theta } } ^ { - } = \{ i : i \in [ n ] , h _ { \theta } ( \mathbf { x } _ { i } ) \neq y _ { i } \} .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Then we are going to define adversarial risk separately for correctly classified and misclassified examples. As we observed in Figure 1(c), regularization on misclassified examples can significantly improve robustness. Therefore, for misclassified examples, we formulate the adversarial risk as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathcal { R } ^ { - } ( h _ { \pmb { \theta } } , \mathbf { x } _ { i } ) : = \mathbb { 1 } \big ( h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \neq y _ { i } \big ) + \mathbb { 1 } \big ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \big ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where the adversarial example $\hat { \mathbf { x } } _ { i } ^ { \prime }$ is generated by solving
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\hat { \mathbf { x } } _ { i } ^ { \prime } = \underset { \mathbf { x } _ { i } ^ { \prime } \in B _ { \epsilon } ( \mathbf { x } _ { i } ) } { \arg \operatorname* { m a x } } 1 ( h _ { \theta } ( \mathbf { x } _ { i } ^ { \prime } ) \neq y _ { i } ) .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
We remark that the first and second terms on the R.H.S. of (4) correspond to the standard adversarial risk and the regularization term respectively. Moreover, we would like to clarify that the regularization term $1 1 ( h _ { \pmb \theta } ( \mathbf x _ { i } ) \neq h _ { \pmb \theta } ( \hat { \mathbf x } _ { i } ^ { \prime } ) )$ aims to encourage the output of neural network to be stable against misclassified adversarial examples. For misclassified examples, direct minimization of the standard adversarial risk may be too hard, as themselves cannot be classified correctly, even without any perturbations. A similar idea has been used in stability training on all training examples (Zheng et al., 2016; Kannan et al., 2018; Zhang et al., 2019).
|
| 93 |
+
|
| 94 |
+
Then we consider correctly classified examples. As can be observed in Figure 1(c), regularization on correctly classified examples cannot provide as significant improvement as achieved by that on misclassified ones. Moreover, in this case it can be found that $\mathbb { 1 } \big ( h _ { \pmb { \theta } } \big ( \mathbf { \bar { x } } _ { i } \big ) \neq h _ { \pmb { \theta } } \big ( \hat { \mathbf { x } } _ { i } ^ { \prime } \big ) \big ) = \mathbb { 1 } \big ( h _ { \pmb { \theta } } \big ( \hat { \mathbf { x } } _ { i } ^ { \prime } \big ) \neq y _ { i } \big )$ since we have $h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) = y _ { i }$ , which implies that the regularizer has exactly same form as the adversarial risk. Therefore, for correctly classified example, we simply use the standard adversarial risk, i.e.,
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { R } ^ { + } ( h _ { \pmb { \theta } } , \mathbf { x } _ { i } ) : = \operatorname* { m a x } _ { \mathbf { x } _ { i } ^ { \prime } \in \mathcal { B } _ { \epsilon } ( \mathbf { x } _ { i } ) } \mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) \neq y _ { i } ) = \mathbb { 1 } ( h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \neq y _ { i } ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where the adversarial example $\hat { \mathbf { x } } _ { i } ^ { \prime }$ is defined in (5).
|
| 101 |
+
|
| 102 |
+
Finally, combining the proposed two adversarial risks for correctly classified examples and misclassified examples in an adversarial training framework, we can train a network that minimizes the following risk:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r l } & { \operatorname* { m i n } _ { \pmb { \theta } } \mathcal { R } _ { \mathrm { m i s c } } ( h _ { \pmb { \theta } } ) : = \frac { 1 } { n } \bigg ( \sum _ { i \in S _ { h _ { \pmb { \theta } } } ^ { + } } \mathcal { R } ^ { + } ( h _ { \pmb { \theta } } , \mathbf { x } _ { i } ) + \sum _ { i \in S _ { h _ { \pmb { \theta } } } ^ { - } } \mathcal { R } ^ { - } ( h _ { \pmb { \theta } } , \mathbf { x } _ { i } ) \bigg ) } \\ & { \quad \quad \quad \quad \quad \quad = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \Big \{ \mathbb { 1 } ( h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \neq y _ { i } ) + \mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) ) \cdot \mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq y _ { i } ) \Big \} , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\hat { \mathbf { x } } _ { i } ^ { \prime }$ is defined in (5) and the second equality follows from the definition of $S _ { h _ { \theta } ^ { + } }$ and $S _ { h _ { \theta } ^ { - } }$ . The new risk defined above is a regularized adversarial risk with regularization term $1 / n \textstyle \sum _ { i = 1 } ^ { n } 1 ( h _ { \pmb \theta } ( \mathbf { x } _ { i } ) \neq$ $h _ { \pmb \theta } ( \hat { \mathbf x } _ { i } ^ { \prime } ) ) \cdot \mathbb { 1 } \left( h _ { \pmb \theta } ( \mathbf x _ { i } ) \neq y _ { i } \right)$ , which we call the misclassification aware regularization.
|
| 109 |
+
|
| 110 |
+
# 3 PROPOSED DEFENSE: MISCLASSIFICATION AWARE ADVERSARIAL TRAINING (MART)
|
| 111 |
+
|
| 112 |
+
In the previous section, we derived the misclassification aware adversarial risk based on 0-1 loss. However, optimization over 0-1 loss is intractable in practice. We next propose a Misclassification Aware adveRsarial Training (MART) algorithm, by replacing the 0-1 losses with proper surrogate loss functions which are both physical meaningful and computationally tractable. Following that, we further analyze the difference of MART to existing work, and propose a semi-supervised extension.
|
| 113 |
+
|
| 114 |
+
# 3.1 THE PROPOSED DEFENSE ALGORITHM
|
| 115 |
+
|
| 116 |
+
Surrogate Loss for Outer Minimization. As presented in (7), the minimization consists of three indicator functions: (1) $\mathbb { 1 } \left( h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \neq y _ { i } \right)$ ; (2) $\mathbb { 1 } ( \bar { h } _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) )$ ; and (3) $\mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq y _ { i } )$ .
|
| 117 |
+
|
| 118 |
+
For the first indicator function $\mathbb { 1 } ( h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) \neq y _ { i } )$ , we propose to use a boosted cross entropy (BCE) loss as the surrogate loss, instead of the commonly used CE loss in (Madry et al., 2018; Wang et al., 2019). This is largely because classifying adversarial examples requires a stronger classifier than natural examples, as the presence of adversarial examples makes the classification decision boundary become more complicated. This is pointed out by (Madry et al., 2018), where they increase the model capacity for a stronger classifier. The benefit of using BCE compared to CE will shortly be presented in the experiment section. The proposed BCE loss is defined as:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathrm { B C E } \big ( \mathbf { p } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) , y _ { i } \big ) = - \log \big ( \mathbf { p } _ { y _ { i } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) \big ) - \log \big ( 1 - \operatorname* { m a x } _ { k \neq y _ { i } } \mathbf { p } _ { k } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) \big ) ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $\mathbf { p } _ { k } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb \theta )$ is the probability output defined in (2), the first term $- \log \left( \mathbf { p } _ { y _ { i } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) \right)$ is the commonly used CE loss, denoted $\mathrm { C E } ( \mathbf { p } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) , y _ { i } )$ , and the second term $- \log \left( 1 - \operatorname* { m a x } _ { k \neq y _ { i } } \mathbf { p } _ { k } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb { \theta } ) \right)$ is a margin term used to improve the decision margin of the classifier. A similar idea has been used for improving adversarial strength by Carlini & Wagner (2017). Note that BCE is just a simple boost that works well in our experiments and other boosted losses could also work here.
|
| 125 |
+
|
| 126 |
+
For the second indicator function $1 [ \boldsymbol { h } _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } ) )$ , we can use KL divergence as the surrogate loss function (Zhang et al., 2019; Zheng et al., 2016), since $h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq h _ { \pmb { \theta } } ( \hat { \mathbf { x } } _ { i } ^ { \prime } )$ implies that adversarial examples have different output distributions to that of natural examples. Thus, we have
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathrm { K L } \big ( \mathbf { p } ( \mathbf { x } _ { i } , \pmb \theta ) \| \mathbf { p } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb \theta ) \big ) = \sum _ { k = 1 } ^ { K } \mathbf { p } _ { k } ( \mathbf { x } _ { i } , \pmb \theta ) \log \frac { \mathbf { p } _ { k } ( \mathbf { x } _ { i } , \pmb \theta ) } { \mathbf { p } _ { k } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \pmb \theta ) } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
The third indicator function $\mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq y _ { i } )$ is a condition that emphasizes learning on misclassified examples. However, the condition cannot be directly optimized if we conduct a hard decision during the training process (Ding et al. (2019) uses hard decision and does not optimize the condition). Instead, we propose to use a soft decision scheme by replacing $\mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ) \neq y _ { i } )$ with the output probability $1 - \mathbf { p } _ { y _ { i } } ( \mathbf { x } _ { i } , \pmb { \theta } )$ . This will be large for misclassified examples and small for correctly classified examples.
|
| 133 |
+
|
| 134 |
+
Surrogate Loss for Inner Maximization. The goal of inner maximization is to generate adversarial example $\hat { \mathbf { x } } _ { i } ^ { \prime }$ for natural example $\mathbf { x } _ { i }$ by solving (5). Therefore, we aim to find a surrogate loss function for the indicator function $\mathbb { 1 } ( h _ { \pmb { \theta } } ( \mathbf { x } _ { i } ^ { \prime } ) \neq y _ { i } )$ . Here, we leverage the commonly used CE loss as the surrogate loss and find the adversarial example $\hat { \mathbf { x } } _ { i } ^ { \prime \dagger }$ as follows:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\hat { \mathbf { x } } _ { i } ^ { \prime } = \underset { \mathbf { x } _ { i } ^ { \prime } \in \mathcal { B } _ { \epsilon } ( \mathbf { x } _ { i } ) } { \arg \operatorname* { m a x } } \mathrm { C E } \big ( \mathbf { p } ( \mathbf { x } _ { i } ^ { \prime } , \pmb { \theta } ) , y _ { i } \big ) .
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Following our findings in Figure 1(b) that a strong attack can help robustness (though is negligible for misclassified examples), we propose to use the (strong) PGD attack to maximize the CE loss for both the correctly classified and misclassified examples, the same as standard adversarial training. Note that other surrogate loss functions, such as those exploited in (Athalye et al., 2018; Carlini & Wagner, 2017) for adversarial attack, could also be used here.
|
| 141 |
+
|
| 142 |
+
The Overall Objective. Based on the surrogate loss functions, we can state the final objective function for our proposed Misclassification Aware adveRsarial Training (MART) defense:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathcal { L } ^ { \mathrm { M A R T } } ( \pmb { \theta } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell ( \mathbf { x } _ { i } , y _ { i } , \pmb { \theta } ) ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $\ell ( \mathbf x _ { i } , y _ { i } , \pmb \theta )$ is defined as
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\ell ( \mathbf { x } _ { i } , y _ { i } , \boldsymbol { \theta } ) : = \mathrm { B C E } \big ( \mathbf { p } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \boldsymbol { \theta } ) , y _ { i } \big ) + \lambda \cdot \mathrm { K L } \big ( \mathbf { p } ( \mathbf { x } _ { i } , \boldsymbol { \theta } ) \| \mathbf { p } ( \hat { \mathbf { x } } _ { i } ^ { \prime } , \boldsymbol { \theta } ) \big ) \cdot \big ( 1 - \mathbf { p } _ { y _ { i } } ( \mathbf { x } _ { i } , \boldsymbol { \theta } ) \big ) .
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Here the adversarial example $\hat { \mathbf { x } } _ { i } ^ { \prime }$ is generated by (10), and $\lambda$ is a tunable scaling parameter that balances the two parts of the final loss, and is fixed for all training examples. The complete training procedure of MART is described in Appendix A.
|
| 155 |
+
|
| 156 |
+
# 3.2 RELATION TO EXISTING WORK
|
| 157 |
+
|
| 158 |
+
In this section, we briefly discuss the difference between our MART and existing defense methods including standard adversarial training (Standard) (Madry et al., 2018), logit pairing methods (Kannan et al., 2018), max-margin adversarial training (MMA) (Ding et al., 2018) and TRADES (Zhang et al., 2019), as presented in Table 1.
|
| 159 |
+
|
| 160 |
+
Table 1: Loss function comparison with existing work. The adversarial example $\hat { \mathbf { x } } ^ { \prime }$ is generated by (10) for all defense methods except TRADES and MMA. The adversarial example in TRADES is generated by maximizing its regularization term (KL-divergence), and the adversarial example in MMA is generated by solving (10) with different perturbation limit $( i . e . , \epsilon )$ .
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Defense Method</td><td>Loss Function</td></tr><tr><td>Standard</td><td>CE(p(x',0),y)</td></tr><tr><td>ALP</td><td>CE(p(x',0),y)+)·Ip(x',0)-p(x,0)/²</td></tr><tr><td>CLP</td><td>CE(p(x,0),y)+λ·||p(x',0)-p(x,0)ll2</td></tr><tr><td>TRADES</td><td>CE(p(x,0),y)+λ·KL(p(x,0)||p(x',0))</td></tr><tr><td>MMA</td><td>CE(p(x',0),y)·1(he(x)= y)+CE(p(x,0),y) ·1(h(x)≠y)</td></tr><tr><td>MART</td><td>BCE(p(x',0),y)+λ·KL(p(x,0)||p(x',0)):(1-Py(x,0))</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Specifically, the Standard algorithm was designed to minimize the standard adversarial loss, i.e., cross-entropy loss on adversarial examples. Logit pairing methods, consisting of adversarial logit pairing (ALP) and clean logit pairing (CLP), introduce a regularization term enclosing both natural examples and their adversarial counterparts. The objective function of TRADES is also a linear combination of natural loss and regularization terms on the output probabilities corresponding to natural examples and their adversarial counterparts using KL divergence. However, none of these algorithms differentiates the misclassified examples and correctly classified examples.
|
| 165 |
+
|
| 166 |
+
The most relevant work is MMA, which proposes to use maximal margin optimization for correctly classified examples while keeping the optimization on misclassified examples unchanged. Specifically, for correctly classified examples, MMA adopts cross-entropy loss on adversarial examples, which are generated by solving (10) with example-dependent perturbation limit. For misclassified examples, MMA directly applies cross-entropy loss on natural examples. We emphasize that our MART is different from MMA in the following aspects: (1) MMA performs hard decision to identify misclassified examples from training data, while MART uses soft decision scheme on training data based on the corresponding output probabilities $( \mathbf { p } ( \hat { \mathbf { x } } ^ { \prime } , \pmb \theta ) )$ , which can be jointly learned during the training process; (2) for correctly classified examples, MMA adopts cross-entropy loss on adversarial examples with different perturbation limits, while MART utilizes the proposed BCE loss on the adverarial examples with the same perturbation limit; (3) for misclassified examples, MMA adopts cross-entropy loss on natural examples, while MART adopts a regularized adversarial loss involving both adversarial and natural examples. Because of these differences, we later will show that MART outperforms MMA in the experiments.
|
| 167 |
+
|
| 168 |
+
# 3.3 SEMI-SUPERVISED EXTENSION WITH UNLABELED DATA
|
| 169 |
+
|
| 170 |
+
Recent work has shown that semi-supervised learning with additional unlabeled data can improve the adversarial robustness (Uesato et al., 2019; Carmon et al., 2019; Najafi et al., 2019; Zhai et al., 2019). Specifically, the training loss function applied in these semi-supervised learning methods is typically
|
| 171 |
+
|
| 172 |
+
defined as a weighted sum of the supervised loss (loss on the labeled data) and the unsupervised one (loss on the unlabeled data), i.e.,
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\mathcal { L } ( \pmb \theta ) = \mathcal { L } _ { \mathrm { s u p } } ( \pmb \theta ) + \gamma \cdot \mathcal { L } _ { \mathrm { u n s u p } } ( \pmb \theta ) ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
where $\gamma > 0$ is the weight of unsupervised loss. As pointed out in Uesato et al. (2019), there are multiple choices of the unsupervised loss function $\mathcal { L } _ { \mathrm { u n s u p } } ( \pmb { \theta } )$ , leading to different defense methods, among which the most effective defense method is $\mathrm { U A T + + }$ . In particular, $\mathrm { U A T + + }$ first trains a natural model on labeled data, and then use this model to generate pseudo labels for unlabeled data. Moreover, given a training data $\left( \mathbf { x } , y \right)$ (which can be either labeled or unlabeled data), the supervised and unsupervised loss functions adopted in $\mathrm { U A T + + }$ are defined as‡
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\ell _ { \mathrm { s u p } } ^ { \mathrm { U A T } + } ( \mathbf { x } , y ; \pmb \theta ) = \ell _ { \mathrm { u n s u p } } ^ { \mathrm { U A T } + } ( \mathbf { x } , y ; \pmb \theta ) = \operatorname* { m a x } _ { \mathbf { x } ^ { \prime } \in B _ { \epsilon } } \mathrm { C E } ( \mathbf { p } ( \mathbf { x } ^ { \prime } , \pmb \theta ) , y ) + \lambda \cdot \operatorname* { m a x } _ { \mathbf { x } ^ { \prime } \in B _ { \epsilon } } \mathrm { K L } ( \mathbf { p } ( \mathbf { x } , \pmb \theta ) | | \mathbf { p } ( \mathbf { x } ^ { \prime } , \pmb \theta ) ) ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
where $\lambda$ is a tunable hyperparameter. A similar idea was also proposed in a concurrent work (Carmon et al., 2019), leading to another semi-supervised defense method called RST. The first stage of RST is also to generate pseudo labels for unlabeled data by training a natural model on the labeled data. Then in the second stage, RST applies TRADES loss to train the robust model based on both labeled and unlabeled data, i.e., given a training data $\left( \mathbf { x } , y \right)$ , the supervised and unsupervised loss functions adopted in RST is defined as
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\ell _ { \mathrm { s u p } } ^ { \mathrm { R S T } } ( \mathbf { x } , y ; \pmb \theta ) = \ell _ { \mathrm { u n s u p } } ^ { \mathrm { R S T } } ( \mathbf { x } , y ; \pmb \theta ) = \mathrm { C E } ( \mathbf { p } ( \mathbf { x } , \pmb \theta ) , y ) + \lambda \cdot \operatorname* { m a x } _ { \mathbf { x } ^ { \prime } \in \mathcal { B } _ { \epsilon } } \mathrm { K L } ( \mathbf { p } ( \mathbf { x } , \pmb \theta ) | | \mathbf { p } ( \mathbf { x } ^ { \prime } , \pmb \theta ) ) .
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
As we pointed out in Figure 1(b) and the following experiment section, the maximization technique has a neglectable influence on the robustness. Therefore, the major difference between $\mathrm { U A T + + }$ and RST is the objective function for minimization. Considering MART is also an objective function, it thus could be easily combined with semi-supervised learning with unlabeled data. Following RST, we propose the following semi-supervised version of MART:
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\mathcal { L } _ { \mathrm { s e m i } } ^ { \mathrm { M A R T } } ( \pmb { \theta } ) = \sum _ { i \in S _ { \mathrm { s u p } } } \mathcal { L } _ { \mathrm { s u p } } ^ { \mathrm { M A R T } } ( \mathbf { x } _ { i } , y _ { i } ; \pmb { \theta } ) + \gamma \cdot \sum _ { i \in S _ { \mathrm { u n s u p } } } \mathcal { L } _ { \mathrm { u n s u p } } ^ { \mathrm { M A R T } } ( \mathbf { x } _ { i } , y _ { i } ; \pmb { \theta } )
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
with supervised and unsupervised loss function defined as follows,
|
| 197 |
+
|
| 198 |
+
\` $\operatorname { s u b } \operatorname { N L P } ( \mathbf { x } , y ; \theta ) = \ell _ { \operatorname { u n s u p } } ^ { \mathrm { M A R T } } ( \mathbf { x } , y ; \theta ) = \mathrm { B C E } ( \mathbf { p } ( \hat { \mathbf { x } } ^ { \prime } , \theta ) , y ) + \lambda \cdot \mathrm { K L } ( \mathbf { p } ( \mathbf { x } , \theta ) | | \mathbf { p } ( \hat { \mathbf { x } } ^ { \prime } , \theta ) ) \cdot ( 1 - \mathbf { p } _ { y } ( \mathbf { x } , \theta ) ) ,$ where the adversarial example $\hat { \mathbf { x } } ^ { \prime }$ is generated by solving (10), and $ { S _ { \mathrm { s u p } } }$ and $ { S _ { \mathrm { u n s u p } } }$ denote the set of labeled data and unlabeled data respectively.
|
| 199 |
+
|
| 200 |
+
# 4 EXPERIMENTS
|
| 201 |
+
|
| 202 |
+
In this section, we first conduct a set of experiments to provide a comprehensive understanding of our proposed defense MART, and then evaluate its robustness on benchmark datasets in both white-box and black-box settings. Finally, we benchmark the state-of-the-art robustness and explore using unlabeled data for further improvement.
|
| 203 |
+
|
| 204 |
+
# 4.1 UNDERSTANDING THE PROPOSED MART
|
| 205 |
+
|
| 206 |
+
Here, we investigate MART from 4 different perspectives: (1) removing components of the MART loss function, (2) replacing components of the MART loss function, (3) misclassification aware loss on certain proportions of training data, and (4) sensitivity to regularization parameter $\lambda$ .
|
| 207 |
+
|
| 208 |
+
Experimental Setup. We train ResNet-18 (He et al., 2016) with different variants of MART on CIFAR-10 (Krizhevsky & Hinton, 2009). All the models are trained using SGD with momentum 0.9, weight decay $2 \times 1 0 ^ { - 4 }$ and an initial learning rate of 0.1, which is divided by 10 at the 75-th and 90-th epoch. All natural images are normalized into [0, 1], and simple data augmentations including 4-pixel padding with $3 2 \times 3 2$ random crop and random horizontal flip. The maximum perturbation $\epsilon = 8 / 2 5 5$ and parameter $\lambda = 6$ . The training attack is $\mathrm { P G D ^ { 1 0 } }$ with random start and step size $\epsilon / 4$ , while the test attack is $\mathrm { P G D ^ { 2 0 } }$ with random start and step size $\epsilon / 1 0$ .
|
| 209 |
+
|
| 210 |
+
Removing Components of MART. Recalling the objective function of MART in (11), it has three terms in the loss function: BCE, KL and $1 - p ^ { \ S }$ . As illustrated in Figure 2(a), removing $1 - p$ or KL or both all leads to a significant robustness degradation. In particular, we found that the soft decision term $1 - p$ has a constant robustness improvement throughout the training process, while the KL term can help mitigate overfitting at a later stage of training (after 80 epochs). When the two terms are combined together, they boost the final robustness considerably without causing overfitting.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 2: The comprehensive ablation experiments of MART. In each plot, the dashed blue line represents the original MART method.
|
| 214 |
+
|
| 215 |
+
Replacing Components of MART. As we show in Figure 2(b), when the BCE component is either replaced by a CE term or redefined on natural examples $\left( \mathbf { x } _ { n a t } \right)$ , the final robustness decreases by a substantial amount. It suggests that learning with CE instead of our proposed BCE suffers from insufficient learning with lower robustness throughout the entire training process. On the other hand, learning with BCE on natural examples exhibits severe overfitting at the later stage (solid green line). We did not observe any benefit when replacing CE by KL in the inner maximization of adversarial min-max framework (solid red line), an observation that is consistent with Figure 1(b).
|
| 216 |
+
|
| 217 |
+
Ablation on Training Data. Here, we show the contribution of our proposed misclassification aware regularization (e.g., the $\mathrm { K L } \cdot ( 1 - p )$ term in (11)) to the final robustness with respect to the training data. Specifically, we gradually increase the proportion of training examples that are trained using the proposed misclassification aware regularization term, and display the corresponding robustness in Figure 2(c). The training examples using the proposed regularization are randomly selected, and the BCE term is still defined on all training (adversarial) examples. As can be observed, the robustness can be improved steadily when the proposed regularization is applied on more data. This verifies the benefit of the differentiation of correctly classified and misclassified examples.
|
| 218 |
+
|
| 219 |
+
Sensitivity to Regularization Parameter $\lambda$ . We further investigate the parameter $\lambda$ in MART objective function defined in (11) which controls the strength of the regularization. We also test the regularization parameter $\lambda$ of TRADES (please refer to Table 1). We present the results in Figure $2 ( \mathrm { d } ) ^ { \bullet }$ for different $\lambda \in [ 1 / 2 , 5 0 ]$ . By explicitly differentiating the misclassified and correctly classified examples, MART achieves good stability and robustness across different choices of $\lambda$ , which is also consistently better and more stable than that of TRADES.
|
| 220 |
+
|
| 221 |
+
# 4.2 ROBUSTNESS EVALUATION AND ANALYSIS
|
| 222 |
+
|
| 223 |
+
In this part, we evaluate the robustness of MART on both MNIST (LeCun et al., 1998) and CIFAR-10 (Krizhevsky & Hinton, 2009) datasets against various white-box and black-box attacks.
|
| 224 |
+
|
| 225 |
+
Baselines.k (1) Standard (Madry et al., 2018); (2) MMA (Ding et al., 2019); (3) Dynamic (Wang et al., 2019); and (4) TRADES (Zhang et al., 2019). We only compare with adversarial training variants, since they are the most effective defense to date (Athalye et al., 2018).
|
| 226 |
+
|
| 227 |
+
Defense Settings. For MNIST, all defense models are built on a 4-layer CNN and trained using SGD with momentum 0.9. The initial learning rate is 0.01 and divided by 10 at the 20-th and 40-th epoch. For CIFAR-10, we use SGD with momentum 0.9, weight decay $3 . 5 \times 1 0 ^ { - 3 }$ and an initial learning rate of 0.01, which is divided by 10 at the 75-th and 90-th epoch. For the training attack, it is also the $\mathrm { P G D ^ { 1 0 } }$ with random start and step size $\epsilon / 4$ . The perturbation limit $\epsilon = 0 . 3$ for MNIST, and $\epsilon = 8 / 2 5 5$ for CIFAR-10. For MART, we set $\lambda = 5$ . Hyperparameters of the baselines are configured as per their original papers: max margin is set to 0.45 (MNIST) or 12/255 (CIFAR-10) for MMA, maximum criterion value $c _ { \mathrm { m a x } } = 0 . 5$ for $D$ ynamic and $\lambda = 4$ for TRADES.
|
| 228 |
+
|
| 229 |
+
Table 2: White-box robustness (accuracy $( \% )$ on white-box test attacks) on MNIST and CIFAR-10.
|
| 230 |
+
|
| 231 |
+
<table><tr><td rowspan="2">Defense</td><td colspan="4">MNIST</td><td colspan="4">CIFAR-10</td></tr><tr><td>Natural</td><td>FGSM</td><td>PGD20</td><td>CW</td><td>Natural</td><td>FGSM</td><td>PGD20</td><td>CW8</td></tr><tr><td>Standard</td><td>99.11</td><td>97.17</td><td>94.62</td><td>94.25</td><td>84.44</td><td>61.89</td><td>47.55</td><td>45.98</td></tr><tr><td>MMA</td><td>98.92</td><td>97.25</td><td>95.25</td><td>94.77</td><td>84.76</td><td>62.08</td><td>48.33</td><td>45.77</td></tr><tr><td>Dynamic</td><td>98.96</td><td>97.34</td><td>95.27</td><td>94.85</td><td>83.33</td><td>62.47</td><td>49.40</td><td>46.94</td></tr><tr><td>TRADES</td><td>99.25</td><td>96.67</td><td>94.58</td><td>94.03</td><td>82.90</td><td>62.82</td><td>50.25</td><td>48.29</td></tr><tr><td>MART</td><td>98.74</td><td>97.87</td><td>96.48</td><td>96.10</td><td>83.07</td><td>65.65</td><td>55.57</td><td>54.87</td></tr></table>
|
| 232 |
+
|
| 233 |
+
Table 3: Black-box robustness (accuracy $( \% )$ on black-box test attacks) on MNIST and CIFAR-10.
|
| 234 |
+
|
| 235 |
+
<table><tr><td rowspan="2">Defense</td><td colspan="4">MNIST</td><td colspan="4">CIFAR-10</td></tr><tr><td>FGSM</td><td>PGD10</td><td>PGD20</td><td>CW8</td><td>FGSM</td><td>PGD10</td><td>PGD20</td><td>CW8</td></tr><tr><td>Standard</td><td>96.12</td><td>95.73</td><td>95.47</td><td>96.34</td><td>79.98</td><td>80.27</td><td>80.01</td><td>80.85</td></tr><tr><td>MMA</td><td>96.11</td><td>95.94</td><td>95.81</td><td>96.87</td><td>80.28</td><td>80.52</td><td>80.48</td><td>81.32</td></tr><tr><td>Dynamic</td><td>97.60</td><td>96.25</td><td>95.82</td><td>97.03</td><td>81.37</td><td>81.71</td><td>81.38</td><td>82.05</td></tr><tr><td>TRADES</td><td>97.49</td><td>96.03</td><td>95.73</td><td>97.20</td><td>81.52</td><td>81.73</td><td>81.53</td><td>82.11</td></tr><tr><td>MART</td><td>97.77</td><td>96.96</td><td>96.97</td><td>98.36</td><td>82.75</td><td>82.93</td><td>82.70</td><td>82.95</td></tr></table>
|
| 236 |
+
|
| 237 |
+
White-box Robustness. We evaluate the robustness of all defense models against three types of attacks for both MNIST and CIFAR-10: FGSM, $\mathrm { P G D ^ { 2 0 } }$ (20-step PGD with step size $\epsilon / 1 0 $ ), and $\mathrm { C W } _ { \infty }$ $L _ { \infty }$ version of CW optimized by PGD). All attacks have full access to model parameters and are constrained by the same perturbation limit . The white-box robustness of all defense models are reported in Table 2, where “Natural” denotes the accuracy on natural test images. Our proposed defense MART achieves the best robustness against all three types of attacks on both MNIST and CIFAR-10. Compared with MNIST, the robustness improvements of MART over other baselines are more significant on CIFAR-10. This is because adversarial training on CIFAR-10 is a more challenging problem that may have more misclassified examples during training, and MART can better handle those misclassified examples due to its regularization term in (11). Note that the robustness improvement of MART is not caused by the so-called “obfuscated gradients” (Athalye et al., 2018). This can be verified by two phenomenons: (1) strong test attacks (e.g., $\mathrm { P G D ^ { 2 0 } }$ ) have higher success rates (lower accuracies) than weak test attacks (e.g., FGSM), and (2) white-box test attacks have higher success rates than back-box test attacks (comparing Table 2 with Table 3). Besides, we conduct an additional check using a gradient-free attack SPSA (Uesato et al., 2018). SPSA attack does not obtain lower accuracy than gradient-based attacks like PGD, which confirms that the robustness of MART trained models are not due to gradient masking.
|
| 238 |
+
|
| 239 |
+
Black-box Robustness. Black-box test attacks are crafted from the natural test images by attacking a surrogate model with an architecture that is either a copy of the defense model (MNIST) or a more complex ResNet-50 model (CIFAR-10). Both surrogate models are trained separately from the defense models on the original training sets. The attacking methods used here are: FGSM, $\mathrm { P G D ^ { 1 0 } }$ , $\mathrm { P G D ^ { 2 0 } }$ , and $\mathbf { C W } _ { \infty }$ . The black-box robustness of all defense models are reported in Table 3. Again, the proposed defense MART achieves higher robustness than other baselines. Compared with the white-box results, all defense methods achieve much better robustness against black-box attacks, even close to the natural accuracy. This suggests that adversarial training is indeed a very practical choice for defense scenarios where the target model can be kept secret from potential attackers. It is also observed that robustness on strong attacks like $\mathrm { C W } _ { \infty }$ is higher than weak attacks like FGSM, which indicates that strong attacks have less transferability than weak attacks (Madry et al., 2018).
|
| 240 |
+
|
| 241 |
+
# 4.3 BENCHMARKING THE STATE-OF-THE-ART ROBUSTNESS
|
| 242 |
+
|
| 243 |
+
In this part, we conduct more experiments on a large-capacity network WideResNet (Zagoruyko & Komodakis, 2016) to benchmark the state-of-the-art robustness, and also explore using unlabeled data for further robustness boost.
|
| 244 |
+
|
| 245 |
+
Performance on WideResNet. We employ WideResNet-34-10 (depth 34 and width 10) to explore the full power of our proposed MART defense method, and also benchmark the state-of-the-art robustness on CIFAR-10. The robustness of all defense models are tested against white-box FGSM, $\mathrm { P G D ^ { 2 0 } }$ , $\mathrm { P G D ^ { 1 0 0 } }$ and $\mathrm { C W } _ { \infty }$ attacks, under the same settings as Section 4.1. We report the robustness of both the best and the last epoch models obtained during training in Table $4 \parallel$ . For each defense method against each attack, the “best” refers to the highest robustness that ever achieved at different checkpoints. Specifically, against FGSM attack, the best model was found at the last epoch (e.g., "best" is also "last") for all defense methods, while against $\mathrm { P G D ^ { 2 0 } }$ , $\mathrm { P G D ^ { 1 0 0 } }$ and $\mathbf { C W } _ { \infty }$ attacks, the best model was found at the epoch right after the first time learning rate decay (i.e., epoch 76). Our proposed MART outperforms all baseline methods in terms of the robustness of both the best and the last epoch models. Particularly under the most common comparison setting (against $\mathrm { P G D ^ { 2 0 } }$ attacks on CIFAR-10), MART improved $\sim 8 \%$ over Standard, and $\sim 4 \%$ even over TRADES for the last epoch model. A similar trend of improvement is also observed for the best epoch model results. Considering the worst case accuracies against all attacks, MART still gains $\sim 6 \%$ and $\sim 3 . 5 \%$ robustness improvement over Standard and TRADES respectively.
|
| 246 |
+
|
| 247 |
+
Table 4: White-box robustness $( \% )$ on CIFAR-10 using the WideResNet-34-10.
|
| 248 |
+
|
| 249 |
+
<table><tr><td></td><td></td><td colspan="2">FGSM</td><td colspan="2">PGD20</td><td colspan="2">PGD100</td><td colspan="2">CW8</td></tr><tr><td>Defense</td><td>Natural</td><td>Best</td><td>Last</td><td>Best</td><td>Last</td><td>Best</td><td>Last</td><td>Best</td><td>Last</td></tr><tr><td>Standard</td><td>87.30</td><td>56.10</td><td>56.10</td><td>52.68</td><td>49.31</td><td>51.55</td><td>49.03</td><td>50.73</td><td>48.47</td></tr><tr><td>Dynamic</td><td>84.51</td><td>63.53</td><td>63.53</td><td>55.03</td><td>51.70</td><td>54.12</td><td>50.07</td><td>51.34</td><td>49.27</td></tr><tr><td>TRADES</td><td>84.22</td><td>64.70</td><td>64.70</td><td>56.40</td><td>53.16</td><td>55.68</td><td>51.27</td><td>51.98</td><td>51.12</td></tr><tr><td>MART</td><td>84.17</td><td>67.51</td><td>67.51</td><td>58.56</td><td>57.39</td><td>57.88</td><td>55.04</td><td>54.58</td><td>54.53</td></tr></table>
|
| 250 |
+
|
| 251 |
+
Table 5: White-box robustness $( \% )$ on WideResNet with additional unlabeled data. a ) WideResNet-34-8 with 100K unlabeled data b ) WideResNet-28-10 with 500K unlabeled data
|
| 252 |
+
|
| 253 |
+
<table><tr><td>Defense</td><td>Natural</td><td>PGD20</td><td>Defense</td><td>Natural</td><td>PGD20</td></tr><tr><td>UAT++</td><td>86.04</td><td>59.41</td><td>UAT++</td><td>86.21</td><td>62.76</td></tr><tr><td>RST</td><td>88.24</td><td>59.60</td><td>RST</td><td>89.70</td><td>63.10</td></tr><tr><td>MART</td><td>86.68</td><td>61.88</td><td>MART</td><td>86.30</td><td>65.04</td></tr></table>
|
| 254 |
+
|
| 255 |
+
Boosting with Additional Unlabeled Data. Here, we evaluate the proposed semi-supervised version of MART and show that it can also benefit from additional unlabeled data and achieves better robustness. Following the exact settings in $\mathrm { U A T + + }$ (Uesato et al., 2019) and RST (Carmon et al., 2019), we compare the robustness of MART with them on WideResNet-34-8 and WideResNet-28-10 against $\mathrm { P G D ^ { 2 0 } }$ $\mathrm { ( F G S M ^ { 2 0 } }$ ) respectively (in the same setting as reported in their paper). The dataset is CIFAR-10 with 100K and $5 0 0 \mathrm { K }$ unlabeled data extracted from the 80 Million Tiny Images dataset (Torralba et al., 2008). As confirmed in Table 5, our proposed defense MART can also benefit from unlabeled data, and further improves the $\mathrm { U A T + + }$ and RST defenses. This again verifies the benefit of differentiating misclassified and correctly classified examples for improving robustness, and further demonstrates the superiority of our proposed method.
|
| 256 |
+
|
| 257 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 258 |
+
|
| 259 |
+
In this paper, we investigated the interesting observation that misclassified examples have a recognizable impact on the final robustness of adversarial training, especially for the outer minimization process. Based on this observation, we designed a misclassification aware adversarial risk, which is formulated as adding an misclassification aware regularization to the standard adversarial risk. Following the regularized adversarial risk, we proposed a new defense algorithm, called Misclassification Aware adveRsarial Training (MART), with appropriate surrogate loss functions. Experimental results demonstrated that MART can achieve significantly improved adversarial robustness with respect to the state-of-the-art, and can also achieves better robustness with additional unlabeled data.
|
| 260 |
+
|
| 261 |
+
In the future, we plan to investigate the effect of differentiation of correctly classified/misclassified training examples in the recently proposed certified/provable robustness framework (Cohen et al., 2019; Salman et al., 2019) and explore the potential improvements brought by the differentiation of training examples.
|
| 262 |
+
|
| 263 |
+
# ACKNOWLEDGEMENT
|
| 264 |
+
|
| 265 |
+
We thank the anonymous reviewers and area chair for their helpful comments. Part of the experiments were done on JD AI Platform “NeuHub” when Yisen Wang was at JD.com.
|
| 266 |
+
|
| 267 |
+
REFERENCES
|
| 268 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018.
|
| 269 |
+
Yang Bai, Yan Feng, Yisen Wang, Tao Dai, Shu-Tao Xia, and Yong Jiang. Hilbert-based generative defense for adversarial examples. In ICCV, 2019.
|
| 270 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In S&P, 2017.
|
| 271 |
+
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, and Aleksander Madry. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 272 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. arXiv preprint arXiv:1905.13736, 2019.
|
| 273 |
+
Chenyi Chen, Ari Seff, Alain Kornhauser, and Jianxiong Xiao. Deepdriving: Learning affordance for direct perception in autonomous driving. In CVPR, 2015.
|
| 274 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. arXiv preprint arXiv:1902.02918, 2019.
|
| 275 |
+
Nilaksh Das, Madhuri Shanbhogue, Shang-Tse Chen, Fred Hohman, Siwei Li, Li Chen, Michael E Kounavis, and Duen Horng Chau. Compression to the rescue: Defending from adversarial attacks across modalities. In KDD, 2018.
|
| 276 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 277 |
+
Guneet S Dhillon, Kamyar Azizzadenesheli, Zachary C Lipton, Jeremy Bernstein, Jean Kossaifi, Aran Khanna, and Anima Anandkumar. Stochastic activation pruning for robust adversarial defense. ICLR, 2018.
|
| 278 |
+
Gavin Weiguang Ding, Yash Sharma, Kry Yik Chau Lui, and Ruitong Huang. Max-margin adversarial (mma) training: Direct input space margin maximization through adversarial training. arXiv preprint arXiv:1812.02637, 2018.
|
| 279 |
+
Gavin Weiguang Ding, Kry Yik Chau Lui, Xiaomeng Jin, Luyu Wang, and Ruitong Huang. On the sensitivity of adversarial robustness to input data distributions. ICLR, 2019.
|
| 280 |
+
Reuben Feinman, Ryan R. Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
|
| 281 |
+
Samuel G Finlayson, John D Bowers, Joichi Ito, Jonathan L Zittrain, Andrew L Beam, and Isaac S Kohane. Adversarial attacks on medical machine learning. Science, 363(6433):1287–1289, 2019.
|
| 282 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 283 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
|
| 284 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. In ICLR, 2018.
|
| 285 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 286 |
+
Linxi Jiang, Xingjun Ma, Shaoxiang Chen, James Bailey, and Yu-Gang Jiang. Black-box adversarial attacks on video recognition models. In ACM MM, pp. 864–872, 2019.
|
| 287 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
|
| 288 |
+
|
| 289 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical Report, University of Toronto, 2009.
|
| 290 |
+
|
| 291 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 292 |
+
|
| 293 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 294 |
+
|
| 295 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS, pp. 7167–7177, 2018.
|
| 296 |
+
|
| 297 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In CVPR, 2018.
|
| 298 |
+
|
| 299 |
+
Qi Liu, Tao Liu, Zihao Liu, Yanzhi Wang, Yier Jin, and Wujie Wen. Security analysis and enhancement of model compressed deep learning systems under adversarial attacks. arXiv preprint arXiv:1802.05193, 2018.
|
| 300 |
+
|
| 301 |
+
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 ICLR, 2018.
|
| 302 |
+
|
| 303 |
+
Xingjun Ma, Yuhao Niu, Lin Gu, Yisen Wang, Yitian Zhao, James Bailey, and Feng Lu. Understanding adversarial attacks on deep learning based medical image analysis systems. arXiv preprint arXiv:1907.10456, 2019.
|
| 304 |
+
|
| 305 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 306 |
+
|
| 307 |
+
Amir Najafi, Shin-ichi Maeda, Masanori Koyama, and Takeru Miyato. Robustness to adversarial perturbations in learning from incomplete data. arXiv preprint arXiv:1905.13021, 2019.
|
| 308 |
+
|
| 309 |
+
Preetum Nakkiran. Adversarial robustness may be at odds with simplicity. arXiv preprint arXiv:1901.00532, 2019.
|
| 310 |
+
|
| 311 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In S&P, 2016.
|
| 312 |
+
|
| 313 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Asia CCS, 2017.
|
| 314 |
+
|
| 315 |
+
Adnan Siraj Rakin, Jinfeng Yi, Boqing Gong, and Deliang Fan. Defend deep neural networks against adversarial examples via fixed anddynamic quantized activation functions. arXiv preprint arXiv:1807.06714, 2018.
|
| 316 |
+
|
| 317 |
+
Andrew Slavin Ross and Finale Doshi-Velez. Improving the adversarial robustness and interpretability of deep neural networks by regularizing their input gradients. In AAAI, 2018.
|
| 318 |
+
|
| 319 |
+
Hadi Salman, Greg Yang, Jerry Li, Pengchuan Zhang, Huan Zhang, Ilya Razenshteyn, and Sebastien Bubeck. Provably robust deep learning via adversarially trained smoothed classifiers. arXiv preprint arXiv:1906.04584, 2019.
|
| 320 |
+
|
| 321 |
+
Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. In ICLR, 2018.
|
| 322 |
+
|
| 323 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In NeurIPS, 2018.
|
| 324 |
+
|
| 325 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 326 |
+
|
| 327 |
+
Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(11):1958–1970, 2008.
|
| 328 |
+
|
| 329 |
+
Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. In ICLR, 2018.
|
| 330 |
+
|
| 331 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In ICLR, 2019.
|
| 332 |
+
|
| 333 |
+
Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. arXiv preprint arXiv:1802.05666, 2018.
|
| 334 |
+
|
| 335 |
+
Jonathan Uesato, Jean-Baptiste Alayrac, Po-Sen Huang, Robert Stanforth, Alhussein Fawzi, Pushmeet Kohli, et al. Are labels required for improving adversarial robustness? arXiv preprint arXiv:1905.13725, 2019.
|
| 336 |
+
|
| 337 |
+
Yisen Wang, Xuejiao Deng, Songbai Pu, and Zhiheng Huang. Residual convolutional ctc networks for automatic speech recognition. arXiv preprint arXiv:1702.07793, 2017.
|
| 338 |
+
|
| 339 |
+
Yisen Wang, Xingjun Ma, James Bailey, Jinfeng Yi, Bowen Zhou, and Quanquan Gu. On the convergence and robustness of adversarial training. In ICML, 2019.
|
| 340 |
+
|
| 341 |
+
Dongxian Wu, Yisen Wang, Shu-Tao Xia, James Bailey, and Xingjun Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. In ICLR, 2020.
|
| 342 |
+
|
| 343 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 344 |
+
|
| 345 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 346 |
+
|
| 347 |
+
Min Zeng, Yisen Wang, and Yuan Luo. Dirichlet latent variable hierarchical recurrent encoder-decoder in dialogue generation. In EMNLP, 2019.
|
| 348 |
+
|
| 349 |
+
Runtian Zhai, Tianle Cai, Di He, Chen Dan, Kun He, John Hopcroft, and Liwei Wang. Adversarially robust generalization just requires more unlabeled data. arXiv preprint arXiv:1906.00555, 2019.
|
| 350 |
+
|
| 351 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoretically principled trade-off between robustness and accuracy. In ICML, 2019.
|
| 352 |
+
|
| 353 |
+
Stephan Zheng, Yang Song, Thomas Leung, and Ian Goodfellow. Improving the robustness of deep neural networks via stability training. In CVPR, 2016.
|
| 354 |
+
|
| 355 |
+
# A MART ALGORITHM
|
| 356 |
+
|
| 357 |
+
# Algorithm 1 Misclassification Aware adveRsarial Training (MART)
|
| 358 |
+
|
| 359 |
+
1: Input: Training data $\{ \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 , \ldots , n }$ , outer iteration number $T _ { O }$ , inner iteration number $T _ { I }$ ,
|
| 360 |
+
maximum perturbation , step size for inner optimization $\eta _ { I }$ , step size for outer optimization $\eta _ { O }$
|
| 361 |
+
2: Initialization: Standard random initialization of $h _ { \theta }$
|
| 362 |
+
3: for $t = 1 , \ldots , T _ { O }$ do
|
| 363 |
+
4: Uniformly sample a minibatch of training data $B ^ { ( t ) }$
|
| 364 |
+
5: for $\mathbf { x } _ { i } \in B ^ { ( t ) }$ do
|
| 365 |
+
6: $\mathbf { x } _ { i } ^ { \prime } = \mathbf { x } _ { i } + \boldsymbol \epsilon \cdot \boldsymbol \xi$ , with $\xi \sim \mathcal { U } ( - 1 , 1 )$ # $\mathcal { U }$ is a uniform distribution
|
| 366 |
+
7: for $s = 1 , \dots , T _ { I }$ do
|
| 367 |
+
8: $\mathbf { x } _ { i } ^ { \prime } \Pi _ { \mathcal { B } _ { \epsilon } ( \mathbf { x } _ { i } ) } \bigl ( \mathbf { x } _ { i } ^ { \prime } + \eta _ { I } \cdot \mathrm { s i g n } \bigl ( \nabla _ { \mathbf { x } _ { i } ^ { \prime } } \mathrm { C E } \bigl ( \mathbf { p } ( \mathbf { x } _ { i } ^ { \prime } , \pmb \theta ) , y _ { i } ) \bigr ) \bigr )$ # Π(·) is the projection operator
|
| 368 |
+
9: end for
|
| 369 |
+
10: $\hat { \mathbf { x } } _ { i } ^ { \prime } \gets \mathbf { x } _ { i } ^ { \prime }$
|
| 370 |
+
11: end for
|
| 371 |
+
12: $\begin{array} { r } { \pmb { \theta } \pmb { \theta } - \eta _ { O } \sum _ { \mathbf { x } _ { i } \in B ^ { ( t ) } } \nabla _ { \pmb { \theta } } \mathcal { L } \big ( \mathbf { x } _ { i } , y _ { i } , \hat { \mathbf { x } } _ { i } ^ { \prime } ; \pmb { \theta } \big ) } \end{array}$
|
| 372 |
+
13: end for
|
| 373 |
+
14: Output: Robust classifier $h _ { \theta }$
|
| 374 |
+
|
| 375 |
+
# B EXPLANATIONS ABOUT THE RESULTS OF TRADES
|
| 376 |
+
|
| 377 |
+
To make a fair comparison with the latest method TRADES (Zhang et al., 2019), our code is built upon the TRADES framework. We would like to point out that the robustness reported in their paper is the \*best\* robustness that occurred during training. To avoid questioning of our results, we have reported both the \*best\* and the \*last\* results in Table 4, and the \*best\* results for TRADES match their original paper.
|
md/train/rkl_f6EFPS/rkl_f6EFPS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/roNqYL0_XP/roNqYL0_XP.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING MESH-BASED SIMULATION WITH GRAPH NETWORKS
|
| 2 |
+
|
| 3 |
+
Tobias Pfaff∗, Meire Fortunato∗, Alvaro Sanchez-Gonzalez∗, Peter W. Battaglia Deepmind, London, UK {tpfaff,meirefortunato,alvarosg,peterbattaglia}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Mesh-based simulations are central to modeling complex physical systems in many disciplines across science and engineering. Mesh representations support powerful numerical integration methods and their resolution can be adapted to strike favorable trade-offs between accuracy and efficiency. However, highdimensional scientific simulations are very expensive to run, and solvers and parameters must often be tuned individually to each system studied. Here we introduce MESHGRAPHNETS, a framework for learning mesh-based simulations using graph neural networks. Our model can be trained to pass messages on a mesh graph and to adapt the mesh discretization during forward simulation. Our results show it can accurately predict the dynamics of a wide range of physical systems, including aerodynamics, structural mechanics, and cloth. The model’s adaptivity supports learning resolution-independent dynamics and can scale to more complex state spaces at test time. Our method is also highly efficient, running 1-2 orders of magnitude faster than the simulation on which it is trained. Our approach broadens the range of problems on which neural network simulators can operate and promises to improve the efficiency of complex, scientific modeling tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
State-of-the art modeling of complex physical systems, such as deforming surfaces and volumes, often employs mesh representations to solve the underlying partial differential equations (PDEs). Mesh-based finite element simulations underpin popular methods in structural mechanics [31, 48], aerodynamics [13, 34], electromagnetics [32], geophysics [35, 39], and acoustics [26]. Meshes also support adaptive representations, which enables optimal use of the resource budget by allocating greater resolution to regions of the simulation domain where strong gradients are expected or more accuracy is required, such as the tip of an airfoil in an aerodynamics simulation. Adaptive meshing enables running simulations at accuracy and resolution levels impossible with regular discretization schemes [8, 27] (Figure 3b).
|
| 12 |
+
|
| 13 |
+
Despite their advantages, mesh representations have received relatively little attention in machine learning. While meshes are sometimes used for learned geometry processing [9] and generative models of shapes [15, 29], most work on predicting high-dimensional physical systems focuses on grids, owing to the popularity and hardware support for CNN architectures [19]. We introduce a method for predicting dynamics of physical systems, which capitalizes on the advantages of adaptive mesh representations. Our method works by encoding the simulation state into a graph, and performing computations in two separate spaces: the mesh-space, spanned by the simulation mesh, and the Euclidean world-space in which the simulation manifold is embedded (see Figure 3a). By passing messages in mesh-space, we can approximate differential operators that underpin the internal dynamics of most physical systems. Message-passing in world-space can estimate external dynamics, not captured by the mesh-space interactions, such as contact and collision. Unstructured irregular meshes, as opposed to regular grids, support learning dynamics which are independent of resolution, allowing variable resolution and scale at runtime. By learning a map of desired resolution over the mesh (sizing field), together with a local remesher, our method can even adaptively change the discretization during rollouts, budgeting greater computational resources for important regions of the simulation domain.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Diagram of MESHGRAPHNETS operating on our SPHEREDYNAMIC domain (video). The model uses an Encode-Process-Decode architecture trained with one-step supervision, and can be applied iteratively to generate long trajectories at inference time. The encoder transforms the input mesh $M ^ { t }$ into a graph, adding extra world-space edges. The processor performs several rounds of message passing along mesh edges and world edges, updating all node and edge embeddings. The decoder extracts the acceleration for each node, which is used to update the mesh to produce $\cdot M ^ { t + 1 }$ .
|
| 17 |
+
|
| 18 |
+
Together, our method allows us to learn the dynamics of vastly different physical systems, from cloth simulation over structural mechanics to fluid dynamics directly from data, providing only very general biases such as spatial equivariance. We demonstrate that by using mesh-space computation we can reliably model materials with a rest state such as elastics, which are challenging for meshfree prediction models [37]. MESHGRAPHNETS outperform particle- and grid-based baselines, and can generalize to more complex dynamics than those on which it was trained.
|
| 19 |
+
|
| 20 |
+
# 2 RELATED WORK
|
| 21 |
+
|
| 22 |
+
Modelling high-dimensional physics problems with deep learning algorithms has become an area of great research interest in fields such as computational fluid dynamics. High resolution simulations are often very slow, and learned models can provide faster predictions, reducing turnaround time for workflows in engineering and science [16, 6, 49, 20, 1]. Short run times are also a desirable property for fluid simulation in visualization and graphics [46, 41, 47]. Learned simulations can be useful for real-world predictions where the physical model, parameters or boundary conditions are not fully known [12]. Conversely, the accuracy of predictions can be increased by including specialized knowledge about the system modelled in the form of loss terms [43, 23], or by physics-informed feature normalization [40].
|
| 23 |
+
|
| 24 |
+
The methods mentioned above are based on convolutional architectures on regular grids. Although this is by far the most widespread architecture for learning high-dimensional physical systems, recently there has been an increased interest in particle-based representations, which are particularly attractive for modelling the dynamics of free-surface liquids and granular materials. Ladicky et al. [22] use random forests to speed up liquid simulations. Various works [24, 42, 37] use graph neural networks (GNNs) [38, 4] to model particle-based granular materials and fluids, as well as glassy dynamics [3]. Learned methods can improve certain aspects of classical FEM simulations, e.g. more accurate handling of strongly nonlinear displacements [25] or learned elements which directly map between forces and displacements [10]. Finally, dynamics of high dimensional systems can be learned in reduced spaces. Holden et al. [18] performs PCA decomposition on cloth data, and learns a correction model to improve accuracy of subspace simulation. These models are however very domain-specific, and the expression range is limited due to the use of the linear subspace.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 2: Our model can predict dynamics of vastly different physical systems, from structural mechanics over cloth to fluid dynamics. We demonstrate this by simulating (a) a flag waving in the wind, (b) a deforming plate, (c) flow of water around a cylinder obstacle, and (d) the dynamics of air around the cross-section of an aircraft wing (videos). The color map shows the von-Mises stress in (b), and the $\mathbf { X }$ -component of the velocity field in (c),(d).
|
| 28 |
+
|
| 29 |
+
There is increased attention in using meshes for learned geometry and shape processing [9, 29, 17]. But despite mesh-based simulations being the tool of choice in mechanical engineering and related disciplines, adaptive mesh representations have not seen much use in machine learning for physics prediction, with a few notable exceptions [5, 2]. Belbute-Peres et al. [5] embed a differentiable aerodynamics solver in a graph convolution (GCN) [21] prediction pipeline for super-resolution in aerodynamics predictions. Our method has similarities, but without a solver in the loop, which potentially makes it easier to use and adapt to new systems. In Section 5 we show that MESHGRAPHNETS are better suited for dynamical prediction than GCN-based architectures. Finally, Graph Element Networks [2] uses meshes over 2D grid domains to more efficiently compute predictions and scene representations. Notably they use small planar systems $\mathit { \Theta } _ { \mathrm { ~ < ~ } 5 0 }$ nodes), while we show how to scale mesh-based predictions to complex 3D systems with thousands of nodes.
|
| 30 |
+
|
| 31 |
+
# 3 MODEL
|
| 32 |
+
|
| 33 |
+
We describe the state of the system at time $t$ using a simulation mesh $M ^ { t } = ( V , E ^ { M } )$ with nodes $V$ connected by mesh edges $\cdot _ { E ^ { M } }$ . Each node $i \in V$ is associated with a reference mesh-space coordinate $\mathbf { u } _ { i }$ which spans the simulation mesh, and additional dynamical quantities $\mathbf { q } _ { i }$ that we want to model. Eulerian systems (Figure 2c,d) model the evolution of continuous fields such as velocity over a fixed mesh, and $\mathbf { q } _ { i }$ sample these fields at the mesh nodes. In Lagrangian systems, the mesh represents a moving and deforming surface or volume (e.g. Figure 2a,b), and contains an extra world-space coordinate $\mathbf { x } _ { i }$ describing the dynamic state of the mesh in 3D space, in addition to the fixed mesh-space coordinate $\mathbf { u } _ { i }$ (Figure 3a).
|
| 34 |
+
|
| 35 |
+
# 3.1 LEARNING FORWARD DYNAMICS
|
| 36 |
+
|
| 37 |
+
The task is to learn a forward model of the dynamic quantities of the mesh at time $t { + } 1$ given the current mesh $M ^ { t }$ and (optionally) a history of previous meshes $\{ M ^ { t - 1 } , . . . , M ^ { t - h } \}$ . We propose MESHGRAPHNETS, a graph neural network model with an Encode-Process-Decode architecture [4, 37], followed by an integrator. Figure 1 shows a visual scheme of the MESHGRAPHNETS architecture. Domain specific information on the encoding and integration can be found in Section 4.
|
| 38 |
+
|
| 39 |
+
Encoder The encoder encodes the current mesh $M ^ { t }$ into a multigraph $G = ( V , E _ { . . } ^ { M } , E ^ { W } )$ . Mesh nodes become graph nodes $V$ , and mesh edges become bidirectional mesh-edges $E ^ { M }$ in the graph. This serves to compute the internal dynamics of the mesh. For Lagrangian systems, we add world edges $E ^ { W }$ to the graph, to enable learning external dynamics such as (self-) collision and contact, which are non-local in mesh-space.1 World-space edges are created by spatial proximity: that is, given a fixed-radius $r _ { W }$ on the order of the smallest mesh edge lengths, we add a world edge between nodes $i$ and $j$ if $\left| { \bf x } _ { i } - { \bf x } _ { j } \right| < r _ { W }$ , excluding node pairs already connected in the mesh. This encourages using world edges to pass information between nodes that are spatially close, but distant in mesh space (Figure 3a).
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Simulation of a cloth interacting with a sphere. (a) In red, we highlight two nodes which are close in world-space but far in mesh-space, between which a world edge may be created. (b) With the same number of nodes, adaptive remeshing enables significantly more accurate simulations than a regular mesh with the same number of nodes.
|
| 43 |
+
|
| 44 |
+
Next, we encode features into graph nodes and edges. To achieve spatial equivariance, positional features are provided as relative edge features. We encode the relative displacement vector in mesh space uij = ui −uj and its norm |uij | into the mesh edges eMij ∈ EM . Then, we encode the relative world-space displacement vector $\mathbf { x } _ { i j }$ and its norm $\left| { { \bf { x } } _ { i j } } \right|$ into both mesh edges ${ \mathbf e } _ { i j } ^ { M } \in E ^ { M }$ and world edges type, ${ \mathbf { e } } _ { i j } ^ { W } \in E ^ { W }$ . All remaining dynd as node features in ical features . $\mathbf { q } _ { i }$ , as well as a one-hot vector indicating node $\mathbf { v } _ { i }$
|
| 45 |
+
|
| 46 |
+
Finally, the concatenated features and edge, using the encoder MLPs $\epsilon ^ { M } , \epsilon ^ { W } , \epsilon ^ { V }$ ncoded into a latfor mesh edges ${ \mathbf { e } } _ { i j } ^ { M }$ vector of size, world edges $\mathbf { e } _ { i j } ^ { W }$ 8 at each no, and nodes $\mathbf { v } _ { i }$ respectively. See sections 4 and A.1 for more details on input encoding.
|
| 47 |
+
|
| 48 |
+
Processor The processor consists of $L$ identical message passing blocks, which generalize GraphNet blocks [36] to multiple edge sets. Each block contains a separate set of network parameters, and is applied in sequence to the output of the previous block, updating the mesh edge $\mathbf { \bar { e } } _ { i j } ^ { M }$ , world edge ${ \mathbf { e } } _ { i j } ^ { W }$ , and node $\mathbf { v } _ { i }$ embeddings to ${ \mathbf e } _ { i j } ^ { \prime M } , { \mathbf e } _ { i j } ^ { \prime W }$ $\mathbf { v } _ { \ i } ^ { \prime }$ respectively by
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathbf { e } ^ { \prime M } \gets f ^ { M } ( \mathbf { e } _ { i j } ^ { M } , \mathbf { v } _ { i } , \mathbf { v } _ { j } ) , \quad \mathbf { e } _ { i j } ^ { \prime W } \gets f ^ { W } ( \mathbf { e } _ { i j } ^ { W } , \mathbf { v } _ { i } , \mathbf { v } _ { j } ) , \quad \mathbf { v } _ { i } ^ { \prime } \gets f ^ { V } ( \mathbf { v } _ { i } , \sum _ { j } \mathbf { e } _ { i j } ^ { \prime M } , \sum _ { j } \mathbf { e } _ { i j } ^ { \prime W } )
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $f ^ { M } , f ^ { W } , f ^ { V }$ are implemented using MLPs with a residual connection.
|
| 55 |
+
|
| 56 |
+
Decoder and state updater For predicting the time $t { + } 1$ state from the time $t$ input, the decoder uses an MLP $\delta ^ { V }$ to transform the latent node features $\mathbf { v } _ { i }$ after the final processing step into one or more output features $\mathbf { p } _ { i }$ .
|
| 57 |
+
|
| 58 |
+
We can interpret the output features $\mathbf { p } _ { i }$ as (higher-order) derivatives of $\mathbf { q } _ { i }$ , and integrate them using a forward-Euler integrator with $\Delta t = 1$ to compute the next-step dynamical quantity $\mathbf { q } _ { i } ^ { t + 1 }$ . For firstorder systems the output $\mathbf { p } _ { i }$ is integrated once to update $\mathbf { q } _ { i } ^ { t + 1 } = \mathbf { p } _ { i } + \mathbf { q } _ { i } ^ { t }$ , while for second-order integration happens twice: $\mathbf { q } _ { i } ^ { t + 1 } = \mathbf { p } _ { i } + 2 \mathbf { q } _ { i } ^ { t } - \mathbf { q } ^ { t - 1 }$ . Additional output features $\mathbf { p } _ { i }$ are also used to make direct predictions of auxiliary quantities such as pressure or stress. For domain-specific details on decoding, see Section 4. Finally, the output mesh nodes $V$ are updated using $\mathbf { q } _ { i } ^ { \mathsf { ^ { t + 1 } } }$ to produce $M ^ { t + 1 }$ . For some systems, we dynamically adapt the mesh after each prediction step; this is explained in the following section.
|
| 59 |
+
|
| 60 |
+
# 3.2 ADAPTIVE REMESHING
|
| 61 |
+
|
| 62 |
+
Adaptive remeshing algorithms generally consist of two parts: identifying which regions of the simulation domain need coarse or fine resolution, and adapting the nodes and their connections to this target resolution. Only the first part requires domain knowledge of the type of physical system, which usually comes in the form of heuristics. For instance, in cloth simulation, one common heuristic is the refinement of areas with high curvature to ensure smooth bending dynamics (Figure 3b), while in computational fluid dynamics, it is common to refine around wall boundaries where high gradients of the velocity field are expected.
|
| 63 |
+
|
| 64 |
+
In this work we adopt the sizing field methodology [27]. The sizing field tensor $\mathbf { S } ( \mathbf { u } ) \in \mathbb { R } ^ { 2 \times 2 }$ specifies the desired local resolution by encoding the maximally allowed oriented, edge lengths in the simulation mesh. An edge $\mathbf { u } _ { i j }$ is valid if and only if $\mathbf { u } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i } \mathbf { u } _ { i j } \leq 1$ , otherwise it is too long, and needs to be split2. Given the sizing field, a generic local remeshing algorithm can simply split all invalid edges to refine the mesh, and collapse as many edges as possible, without creating new invalid edges, to coarsen the mesh. We denote this remeshing process as $M ^ { \prime } = \mathcal { R } ( M , \mathbf { S } )$ .
|
| 65 |
+
|
| 66 |
+
Learned remeshing To leverage the advantages in efficiency and accuracy of dynamic remeshing, we need to be able to adapt the mesh at test time. Since remeshing requires domain knowledge, we would however need to call the specific remesher used to generate the training data at each step during the model rollout, reducing the benefits of learning the model. Instead, we learn a model of the sizing field (the only domain-specific part of remeshing) using the same architecture as in Section 3.1 and train a decoder output $\mathbf { p } _ { i }$ to produce a sizing tensor for each node. At test time, for each time step we predict both the next simulation state and the sizing field, and use a generic, domainindependent remesher $\mathcal { R }$ to compute the adapted next-step mesh as $M ^ { t + 1 } = \mathcal { R } ( \bar { \hat { M } } ^ { t + 1 } , \hat { \mathbf { S } } ^ { t + 1 } )$ . We demonstrate this on triangular meshes, Section A.3 describes the simple generic remesher that we use for this purpose. While the sizing field is agnostic to the mesh type, other mesh types may require different local remeshers; for tetrahedral meshes a method such as Wicke et al. [45] could be used, while quad meshes can simply be split into triangular meshes.
|
| 67 |
+
|
| 68 |
+
# 3.3 MODEL TRAINING
|
| 69 |
+
|
| 70 |
+
We trained our dynamics model by supervising on the per-node output features $\mathbf { p } _ { i }$ produced by the decoder using a $L _ { 2 }$ loss between $\mathbf { p } _ { i }$ and the corresponding ground truth values $\bar { \bf p } _ { i }$ . Similarly, the sizing field model is trained with an $L _ { 2 }$ loss on the ground truth sizing field. If sizing information is not available in the training data, e.g. not exposed by the ground truth simulator, we can still estimate a compatible sizing field from samples of simulator meshes, and use this estimate as labels (details in Section A.3.1).
|
| 71 |
+
|
| 72 |
+
# 4 EXPERIMENTAL DOMAINS
|
| 73 |
+
|
| 74 |
+
We evaluated our method on a variety of systems with different underlying PDEs, including cloth, structural mechanics, incompressible and compressible fluids (Figure 2). Training and test data was produced by a different simulator for each domain. The simulation meshes range from regular to highly irregular: the edge lengths of dataset AIRFOIL range between $2 \cdot 1 0 ^ { - 4 } \mathrm { m }$ to $3 . 5 \mathrm { m }$ , and we also simulate meshes which dynamically change resolution over the course of a trajectory. Full details on the datasets can be found in Section A.1.
|
| 75 |
+
|
| 76 |
+
Our structural mechanics experiments involve a hyper-elastic plate, deformed by a kinematic actuator, simulated with a quasi-static simulator (DEFORMINGPLATE). Both actuator and plate are part of the Lagrangian tetrahedral mesh, and are distinguished by a one-hot vector for the corresponding node type ${ \bf n } _ { i }$ . We encode the node quantities $\mathbf { u } _ { i } , \mathbf { x } _ { i } , \mathbf { n } _ { i }$ in the mesh, and predict the Lagrangian velocity $\dot { \mathbf { x } } _ { i }$ , which is integrated once to form the next position $\mathbf { x } _ { i } ^ { t + 1 }$ . As a second output, the model predicts the von-Mises stress $\sigma _ { i }$ at each node.
|
| 77 |
+
|
| 78 |
+
Our cloth experiments involve a flag blowing in the wind (FLAGDYNAMIC) and a piece of cloth interacting with a kinematic sphere (SPHEREDYNAMIC) on an adaptive triangular mesh, which changes resolution at each time step. The dataset FLAGSIMPLE shares the setup of FLAGDYNAMIC, but uses a static mesh and ignores collisions. The node type ${ \bf n } _ { i }$ distinguishes cloth and obstacle/boundary nodes, and we encode inputs $\mathbf { u } _ { i } , \mathbf { x } _ { i } , \mathbf { n } _ { i }$ as above, but since this is a fully dynamic second order system, we additionally provide $h = 1$ steps of history, by including the velocity estimate $\dot { \mathbf { x } } _ { i } ^ { t } = \mathbf { x } _ { i } ^ { \dot { t } } - \mathbf { x } _ { i } ^ { t - 1 }$ as a node feature. The decoder outputs acceleration $\ddot { \mathbf { x } } _ { i }$ which is integrated twice.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 4: (a) Rollout of our model versus ground truth on dataset AIRFOIL. Adaptive meshing allows us to accurately predict dynamics at large and small scales. The grid-based U-Net baseline is capable of making good predictions at large scales, but it cannot resolve the smaller scales, despite using four times more cells than our model (video). (b) At inference time, our model can be scaled up to significantly larger and more complex setups than seen during training (video).
|
| 82 |
+
|
| 83 |
+
Our incompressible fluid experiments use the CYLINDERFLOW dataset, which simulates the flow of water around a cylinder on a fixed 2D Eulerian mesh. The mesh contains the node quantities $\mathbf { u } _ { i } , \mathbf { n } _ { i } , \mathbf { w } _ { i }$ , where $\mathbf { w } _ { i }$ is a sample of the momentum field at the mesh nodes. In all fluid domains, the node type distinguishes fluid nodes, wall nodes and inflow/outflow boundary nodes. The network predicts change in momentum $\dot { \mathbf { w } } _ { i }$ , which is integrated once, and a direct prediction of the pressure field $p$ .
|
| 84 |
+
|
| 85 |
+
Our compressible fluid experiments use the AIRFOIL dataset, which simulates the aerodynamics around the cross-section of an airfoil wing. We model the evolution of momentum3 w and density $\rho$ fields, and hence the 2D Eulerian mesh encodes the quantities $\mathbf { u } _ { i } , \mathbf { n } _ { i } , \mathbf { w } _ { i } , \rho _ { i }$ . We treat this as a first order system and predict change in momentum $\dot { \mathbf { w } } _ { i }$ and density $\dot { \rho } _ { i }$ , as well as pressure $p _ { i }$ .
|
| 86 |
+
|
| 87 |
+
# 5 RESULTS
|
| 88 |
+
|
| 89 |
+
We tested our MESHGRAPHNETS model on our four experimental domains (Section 4), and compared it to three different baseline models. Our main findings are that MESHGRAPHNETS are able to produce high-quality rollouts on all domains, outperforming particle- and grid-based baselines, while being significantly faster than the ground truth simulator, and generalizing to much larger and more complex settings at test time.
|
| 90 |
+
|
| 91 |
+
Videos of rollouts, as well as comparisons, can be found at https://sites.google.com/view/ meshgraphnets. Visually the dynamics remain plausible and faithful to the ground truth. Table 1 shows 1-step prediction and rollout errors in all of our datasets, while qualitative and quantitative comparisons are provided in Figure 4 and Figure 5. Even though our model was trained on next-step predictions, model rollouts remain stable for thousands of steps. This video shows a model trained on trajectories of 400 steps rolled out for 40000 steps.
|
| 92 |
+
|
| 93 |
+
Learned remeshing We trained both a dynamics and a sizing field model to perform learned dynamic remeshing during rollout on FLAGDYNAMIC and SPHEREDYNAMIC. We compare learned remeshing variants with sizing model learned from labeled sizing data, as in Section 3.2, as well as from estimated targets, as in Section A.3.1. As a baseline, we ran our forward model on the ground truth mesh sequence. As observed in the video, all learned remeshing variants are able to shift the resolution to the new folds as they appear in the cloth, yield equally plausible dynamics, and are on $\mathrm { p a r } ^ { 4 }$ in terms of quantitative performance (Figure 5c). Thus, our learned remeshing method provides the benefits of adaptive remeshing, which can be substantive in some domains, without requiring a domain-specific remesher in the loop.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 5: (a) Our model outperforms GCN and CNN-based baselines. (b) GNS diverges on cloth datasets; providing mesh-space positions (GNS+mesh-pos) helps, but still fails on dynamic meshes. (c) Remeshing with learned or estimated sizing fields produces accurate rollouts. (d) Taking sufficient message passing steps is crucial for good performance, and limiting history size increases accuracy by preventing overfitting.
|
| 97 |
+
|
| 98 |
+
Computational efficiency Our approach is consistently faster than ground truth solvers by one to two orders of magnitude on all domains (Table 1). We believe this is due to our model being able to take much larger timesteps than classical solvers, and avoiding performance bottlenecks. Additionally, classical general-purpose solvers on irregular domains, such as those studied in this paper, often do not scale well on hardware accelerators, while our model is built from neural network building blocks, highly suitable for hardware acceleration. A more detailed breakdown of performance on e.g. hardware setup is available in the appendix (section A.5.1). Our model’s strong efficiency advantage means it may be applicable in situations where computing costs are otherwise prohibitive.
|
| 99 |
+
|
| 100 |
+
Generalization Our MESHGRAPHNETS model generalizes well outside of the training distribution, with respect to underlying system parameters, mesh shapes, and mesh size. This is because the architectural choice of using relative encoding on graphs has shown to be very conducive to
|
| 101 |
+
|
| 102 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1># nodes(avg.)</td><td rowspan=1 colspan=1>#steps</td><td rowspan=1 colspan=1>tmodelms/step</td><td rowspan=1 colspan=1>tfullms/step</td><td rowspan=1 colspan=1>tGTms/step</td><td rowspan=1 colspan=1>RMSE1-step×10-3</td><td rowspan=1 colspan=1>RMSErollout-50×10-3</td><td rowspan=1 colspan=1>RMSErollout-all×10-3</td></tr><tr><td rowspan=1 colspan=1>FLAGSIMPLE</td><td rowspan=1 colspan=1>1579</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>4166</td><td rowspan=1 colspan=1>1.08 ± 0.02</td><td rowspan=1 colspan=1>92.6±5.0</td><td rowspan=1 colspan=1>139.0 ± 2.7</td></tr><tr><td rowspan=1 colspan=1>FLAGDYNAMIC</td><td rowspan=1 colspan=1>2767</td><td rowspan=1 colspan=1>250</td><td rowspan=1 colspan=1>43</td><td rowspan=1 colspan=1>837</td><td rowspan=1 colspan=1>26199</td><td rowspan=1 colspan=1>1.57 ± 0.02</td><td rowspan=1 colspan=1>72.4± 4.3</td><td rowspan=1 colspan=1>151.1 ± 5.3</td></tr><tr><td rowspan=1 colspan=1>SPHEREDYNAMIC</td><td rowspan=1 colspan=1>1373</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>140</td><td rowspan=1 colspan=1>1610</td><td rowspan=1 colspan=1>0.292±0.005</td><td rowspan=1 colspan=1>11.5± 0.9</td><td rowspan=1 colspan=1>28.3± 2.6</td></tr><tr><td rowspan=1 colspan=1>DEFORMINGPLATE</td><td rowspan=1 colspan=1>1271</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>2893</td><td rowspan=1 colspan=1>0.25±0.05</td><td rowspan=1 colspan=1>1.8 ± 0.5</td><td rowspan=1 colspan=1>15.1 ± 4.0</td></tr><tr><td rowspan=1 colspan=1>CYLINDERFLOW</td><td rowspan=1 colspan=1>1885</td><td rowspan=1 colspan=1>600</td><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>820</td><td rowspan=1 colspan=1>2.34 ± 0.12</td><td rowspan=1 colspan=1>6.3±0.7</td><td rowspan=1 colspan=1>40.88±7.2</td></tr><tr><td rowspan=1 colspan=1>AIRFOIL</td><td rowspan=1 colspan=1>5233</td><td rowspan=1 colspan=1>600</td><td rowspan=1 colspan=1>37</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>11015</td><td rowspan=1 colspan=1>314±36</td><td rowspan=1 colspan=1>582 ±37</td><td rowspan=1 colspan=1>11529 ± 1203</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 1: Left: Inference timings of our model per step on a single GPU, for pure neural network inference $\bf ( t _ { m o d e l } )$ and including remeshing and graph recomputation $\mathbf { \Pi } ( \mathbf { t } _ { \mathbf { f u l l } } )$ . Our model has a significantly lower running cost compared to the ground truth simulation $\mathbf { \Gamma } ( \mathbf { t } _ { \mathbf { G T } } )$ . A more detailed breakdown can be found in the section A.5.1. Right: Errors of our methods for a single prediction step (1-step), 50-step rollouts, and rollout of the whole trajectory.
|
| 105 |
+
|
| 106 |
+
generalization [37]. Also, by forcing the network to make predictions on very irregularly-shaped and dynamically changing meshes, we encourage learning resolution-independent physics.
|
| 107 |
+
|
| 108 |
+
In AIRFOIL, we evaluate the model on steeper angles $( - 3 5 ^ { \circ } . . . 3 5 ^ { \circ }$ vs $- 2 5 ^ { \circ } . . . 2 5 ^ { \circ }$ in training) and higher inflow speeds (Mach number 0.7...0.9 vs 0.2...0.7 in training). In both cases, the behavior remains plausible (video) and RMSE raises only slightly from 11.5 at training to 12.4 for steeper angles and 13.1 for higher inflow speeds. We also trained a model on a FLAGDYNAMIC variant with wind speed and directions varying between trajectories, but constant within each trajectory. At inference time, we can then vary wind speed and direction freely (video). This shows that the local physical laws our models learns can extrapolate to untrained parameter ranges.
|
| 109 |
+
|
| 110 |
+
We also trained a model in the FLAGDYNAMIC domain containing only simple rectangular cloth, and tested its performance on three disconnected fish-shaped flags (video). Both the learned dynamics model and the learned remesher generalized to the new shape, and the predicted dynamics were visually similar to the ground truth sequence. In a more extreme version of this experiment, we test that same model on a windsock with tassels (Figure 4b, video). Not only has the model never seen a non-flat starting state during training, but the dimensions are also much larger — the mesh averages at $2 0 \mathrm { k }$ nodes, an order of magnitude more than seen in training. This result shows the strength of learning resolution and scale-independent models: we do not necessarily need to train on costly high-resolution simulation data; we may be able to learn to simulate large systems that would be too slow on conventional simulators, by training on smaller examples and scaling up at inference time. A more in-depth analysis on scaling can be found in the appendix A.5.3.
|
| 111 |
+
|
| 112 |
+
Comparison to mesh-free GNS model We compared our method to the particle-based method GNS [37] on the fixed-mesh dataset FLAGSIMPLE to study the importance of mesh-space embedding and message-passing. As in GNS, the encoder builds a graph with fixed radius connectivity (10-20 neighbors per node), and relative world-space position embedded as edge features. As GNS lacks the notion of cloth’s resting state, error accumulates dramatically and the simulation becomes unstable, with slight improvements if providing 5 steps of history (Figure 5b).
|
| 113 |
+
|
| 114 |
+
We also explored a hybrid method (GNS $+$ mesh-pos) which adds a mesh-space relative position feature $\mathbf { u } _ { i j }$ to the GNS edges. This yields rollout errors on par with our method (flattening after 50 steps due to decoherence in both cases), however, it tends to develop artifacts such as entangled triangles, which indicate a lack of reliable understanding of the mesh surface (video). On irregularly spaced meshes (FLAGSIMPLE), GNS+mesh-pos was not able to produce stable rollouts at all. A fixed connectivity radius will always oversample high-res regions, and undersample low-res regions of the mesh, leading to instabilities and high rollout errors (Figure 5b, right). We conclude that both having access to mesh-space positions as well as passing messages along the mesh edges are crucial for making predictions on irregularly spaced meshes.
|
| 115 |
+
|
| 116 |
+
Conversely, we found that passing message purely in mesh-space, without any world-space edges, also produces substandard results. On FLAGDYNAMIC and SPHEREDYNAMIC we observe an increase in rollout RMSE of $5 1 \%$ and $9 2 \%$ respectively, as (self-)collisions are harder to predict without world edges. In the latter case this is particularly easy to see: the obstacle mesh and cloth mesh are not connected, so without world edges, the model cannot compute their interaction at all.
|
| 117 |
+
|
| 118 |
+
Comparison to GCNs To study the role of the graph network architecture, we tested our model against GCNs [21], which do not compute messages on edges. We adopted the GCN architecture from Belbute-Peres et al. [5] (without the super-resolution component) and trained it in the same setup as in our approach, including e.g. training noise and integration. We replicated results on the aerodynamical steady-state prediction task it was designed for (see Section A.4.2). On the much richer AIRFOIL task, however, GCN was unable to obtain stable rollouts. This is not simply a question of capacity; we created a hybrid (GCN-MLP) with our model (linear layers replaced by 2-hidden-layer MLPs $^ +$ LayerNorm; 15 GCN blocks instead of 6), but the rollout quality was still poor (Figure 5a, video). We also ran an ablation of MESHGRAPHNETS without relative encoding in edges, for which absolute positional values are used as node features. This version performed much worse than our main model, yielding visual artifacts in the rollouts, and a rollout RMSE of 26.5 in AIRFOIL. This is consistent with our hypothesis that the GCN performs worse due to the lack of relative encoding and message computing, which makes the GCN less likely to learn local physical laws and more prone to overfitting.
|
| 119 |
+
|
| 120 |
+
Comparison to grid-based methods (CNNs) Arguably the most popular methods for predicting physical systems are grid-based convolutional architectures. It is fundamentally hard to simulate Lagrangian deforming meshes with such methods, but we can compare to grid-based methods on the Eulerian 2D domains CYLINDERFLOW and AIRFOIL, by interpolating the ROI onto a $1 2 8 \times 1 2 8$ grid. We implemented the UNet architecture from Thurey et al. [ ¨ 40], and found that on both datasets, MESHGRAPHNETS outperforms the UNet in terms of RMSE (Figure 5a). While the UNet was able to make reasonable predictions on larger scales on AIRFOIL, it undersampled the important wake region around the wingtip (Figure 4a), even while using four times more cells to span a region 16 times smaller than our method (Figure A.1). We observe similar behavior around the obstacle in CYLINDERFLOW. Additionally, as seen in the video, the UNet tends to develop fluctuations during rollout. This indicates that predictions over meshes presents advantages even in flat 2D domains.
|
| 121 |
+
|
| 122 |
+
Key hyperparameters We tested several architecture variants and found our method is not very sensitive to many choices, such as latent vector width, number of MLP layers and their sizes. Nonetheless we identified two key parameters which influence performance (Figure 5d). Increasing the number of graph net blocks (message passing steps) generally improves performance, but it incurs a higher computational cost. We found that a value of 15 provides a good efficiency/accuracy trade-off for all the systems considered. Second, the model performs best given the shortest possible history $\mathrm { h } { = } 1$ to estimate $\dot { \mathbf { x } }$ in cloth experiments, $\scriptstyle \mathrm { h = } 0$ otherwise), with any extra history leading to overfitting. This differs from GNS [37], which used $h \in 2 . . . 5$ for best performance.
|
| 123 |
+
|
| 124 |
+
# 6 CONCLUSION
|
| 125 |
+
|
| 126 |
+
MESHGRAPHNETS are a general-purpose mesh-based method which can accurately and efficiently model a wide range of physical systems, generalizes well, and can be scaled up at inference time. Our method may allow more efficient simulations than traditional simulators, and because it is differentiable, it may be useful for design optimization or optimal control tasks. Variants tailored to specific physical domains, with physics-based auxiliary loss terms, or energy-conserving integration schemes have the potential to increase the performance further. Finally, learning predictions on meshes opens the door for further work on resolution-adaptivity. For example, instead of learning adaptive meshing from ground truth data, we could learn a discretization which directly optimizes for prediction accuracy, or even performance on a downstream task. This work represents an important step forward in learnable simulation, and offers key advantages for modeling complex systems in science and engineering.
|
| 127 |
+
|
| 128 |
+
# ACKNOWLEDGMENTS
|
| 129 |
+
|
| 130 |
+
We would like to thank Danilo Rezende, Jonathan Godwin, Charlie Nash, Oriol Vinyals, Matt Hoffman, Kimberly Stachenfeld, Jessica Hamrick, Piotr Trochim, Emre Karagozler and our reviewers for valuable discussions, implementation help and feedback on the work and manuscript.
|
| 131 |
+
|
| 132 |
+
# REFERENCES
|
| 133 |
+
|
| 134 |
+
[1] MS Albergo, G Kanwar, and PE Shanahan. Flow-based generative models for markov chain monte carlo in lattice field theory. Physical Review D, 100(3):034515, 2019.
|
| 135 |
+
[2] Ferran Alet, Adarsh Keshav Jeewajee, Maria Bauza Villalonga, Alberto Rodriguez, Tomas Lozano-Perez, and Leslie Kaelbling. Graph element networks: adaptive, structured computation and memory. In International Conference on Machine Learning, pp. 212–222, 2019.
|
| 136 |
+
[3] V Bapst, T Keck, A Grabska-Barwinska, C Donner, ED Cubuk, SS Schoenholz, A Obika, AWR Nelson, T Back, D Hassabis, et al. Unveiling the predictive power of static structure in glassy systems (vol 16, pg 448, 2020). NATURE PHYSICS, 16(6):702–702, 2020.
|
| 137 |
+
[4] Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 138 |
+
|
| 139 |
+
[5] Filipe de Avila Belbute-Peres, Thomas D. Economon, and J. Zico Kolter. Combining differentiable PDE solvers and graph neural networks for fluid flow prediction. In Proceedings of the 37th International Conference on Machine Learning ICML 2020, 2020.
|
| 140 |
+
|
| 141 |
+
[6] Saakaar Bhatnagar, Yaser Afshar, Shaowu Pan, Karthik Duraisamy, and Shailendra Kaushik. Prediction of aerodynamic flow fields using convolutional neural networks. Computational Mechanics, 64(2):525–545, 2019.
|
| 142 |
+
|
| 143 |
+
[7] Frank J Bossen and Paul S Heckbert. A pliant method for anisotropic mesh generation. In 5th Intl. Meshing Roundtable, pp. 63–74. Citeseer, 1996.
|
| 144 |
+
|
| 145 |
+
[8] Ricardo Branco, FV Antunes, and JD Costa. A review on 3d-fe adaptive remeshing techniques for crack growth modelling. Engineering Fracture Mechanics, 141:170–195, 2015.
|
| 146 |
+
|
| 147 |
+
[9] Michael M. Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. CoRR, abs/1611.08097, 2016.
|
| 148 |
+
|
| 149 |
+
[10] German Capuano and Julian J Rimoli. Smart finite elements: A novel machine learning application. Computer Methods in Applied Mechanics and Engineering, 345:363–381, 2019.
|
| 150 |
+
|
| 151 |
+
[11] Comsol. Comsol multiphysics $\textsuperscript { \textregistered }$ v. 5.4. http://comsol.com, 2020.
|
| 152 |
+
|
| 153 |
+
[12] Emmanuel de Bezenac, Arthur Pajot, and Patrick Gallinari. Deep learning for physical processes: Incorporating prior scientific knowledge. Journal of Statistical Mechanics: Theory and Experiment, 2019(12):124009, 2019.
|
| 154 |
+
|
| 155 |
+
[13] Thomas D Economon, Francisco Palacios, Sean R Copeland, Trent W Lukaczyk, and Juan J Alonso. Su2: An open-source suite for multiphysics simulation and design. Aiaa Journal, 54 (3):828–846, 2016.
|
| 156 |
+
|
| 157 |
+
[14] Exxact. ANSYS Mechanical GPU Benchmarks. https://blog.exxactcorp.com/ ansys-mechanical-benchmarks-comparing-nvidia-rtx-6000-vs-tesla-v100s-gpu-vs-cpu-only, 2020.
|
| 158 |
+
|
| 159 |
+
[15] Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mach ˆ e approach to learning 3d surface generation. In ´ Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 216–224, 2018.
|
| 160 |
+
|
| 161 |
+
[16] Xiaoxiao Guo, Wei Li, and Francesco Iorio. Convolutional neural networks for steady flow approximation. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 481–490, 2016.
|
| 162 |
+
|
| 163 |
+
[17] Rana Hanocka, Amir Hertz, Noa Fish, Raja Giryes, Shachar Fleishman, and Daniel Cohen-Or. Meshcnn: a network with an edge. ACM Transactions on Graphics (TOG), 38(4):1–12, 2019.
|
| 164 |
+
|
| 165 |
+
[18] Daniel Holden, Bang Chi Duong, Sayantan Datta, and Derek Nowrouzezahrai. Subspace neural physics: Fast data-driven interactive simulation. In Proceedings of the 18th annual ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 1–12, 2019.
|
| 166 |
+
|
| 167 |
+
[19] Sara Hooker. The hardware lottery. arXiv preprint arXiv:2009.06489, 2020.
|
| 168 |
+
|
| 169 |
+
[20] Gurtej Kanwar, Michael S. Albergo, Denis Boyda, Kyle Cranmer, Daniel C. Hackett, Sebastien ´ Racaniere, Danilo Jimenez Rezende, and Phiala E. Shanahan. Equivariant flow-based sampling \` for lattice gauge theory. Phys. Rev. Lett., 125:121601, Sep 2020. doi: 10.1103/PhysRevLett. 125.121601.
|
| 170 |
+
|
| 171 |
+
[21] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 172 |
+
|
| 173 |
+
[22] L’ubor Ladicky, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. \` Data-driven fluid simulations using regression forests. ACM Transactions on Graphics (TOG), 34(6):1–9, 2015.
|
| 174 |
+
|
| 175 |
+
[23] Sangseung Lee and Donghyun You. Data-driven prediction of unsteady flow over a circular cylinder using deep learning. Journal of Fluid Mechanics, 879:217–254, 2019. doi: 10.1017/ jfm.2019.700.
|
| 176 |
+
|
| 177 |
+
[24] Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B. Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In International Conference on Learning Representations, 2019.
|
| 178 |
+
|
| 179 |
+
[25] Ran Luo, Tianjia Shao, Huamin Wang, Weiwei Xu, Xiang Chen, Kun Zhou, and Yin Yang. Nnwarp: Neural network-based nonlinear deformation. IEEE transactions on visualization and computer graphics, 2018.
|
| 180 |
+
|
| 181 |
+
[26] Steffen Marburg and Bodo Nolte. Computational acoustics of noise propagation in fluids: finite and boundary element methods, volume 578. Springer, 2008.
|
| 182 |
+
|
| 183 |
+
[27] Rahul Narain, Armin Samii, and James F. O’Brien. Adaptive anisotropic remeshing for cloth simulation. ACM Trans. Graph., 31(6), 2012.
|
| 184 |
+
|
| 185 |
+
[28] Rahul Narain, Tobias Pfaff, and James F. O’Brien. Folding and crumpling adaptive sheets. ACM Trans. Graph., 32(4), 2013.
|
| 186 |
+
|
| 187 |
+
[29] Charlie Nash, Yaroslav Ganin, SM Eslami, and Peter W Battaglia. Polygen: An autoregressive generative model of 3d meshes. In International Conference on Machine Learning, 2020.
|
| 188 |
+
|
| 189 |
+
[30] nVidia. GPU-accelerated ANSYS FLUENT. https://www.nvidia.com/en-us/data-center/ gpu-accelerated-applications/ansys-fluent, 2019.
|
| 190 |
+
|
| 191 |
+
[31] SK Panthi, N Ramakrishnan, KK Pathak, and JS Chouhan. An analysis of springback in sheet metal bending using finite element method (fem). Journal of Materials Processing Technology, 186(1-3):120–124, 2007.
|
| 192 |
+
|
| 193 |
+
[32] D Pardo, L Demkowicz, C Torres-Verdin, and M Paszynski. A self-adaptive goal-oriented hpfinite element method with electromagnetic applications. part ii: Electrodynamics. Computer methods in applied mechanics and engineering, 196(37-40):3585–3597, 2007.
|
| 194 |
+
|
| 195 |
+
[33] Tobias Pfaff, Rahul Narain, Juan Miguel De Joya, and James F O’Brien. Adaptive tearing and cracking of thin sheets. ACM Transactions on Graphics (TOG), 33(4):1–9, 2014.
|
| 196 |
+
|
| 197 |
+
[34] Ravi Ramamurti and William Sandberg. Simulation of flow about flapping airfoils using finite element incompressible flow solver. AIAA journal, 39(2):253–260, 2001.
|
| 198 |
+
|
| 199 |
+
[35] Zhengyong Ren and Jingtian Tang. 3d direct current resistivity modeling with unstructured mesh by adaptive finite-element method. Geophysics, 75(1):H7–H17, 2010.
|
| 200 |
+
|
| 201 |
+
[36] Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In Proceedings of the 35th International Conference on Machine Learning, ICML, pp. 4467–4476, 2018.
|
| 202 |
+
|
| 203 |
+
[37] Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter W. Battaglia. Learning to simulate complex physics with graph networks. In Proceedings of the 37th International Conference on Machine Learning ICML 2020, 2020.
|
| 204 |
+
|
| 205 |
+
[38] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
|
| 206 |
+
|
| 207 |
+
[39] Christoph Schwarzbach, Ralph-Uwe Borner, and Klaus Spitzer. Three-dimensional adap- ¨ tive higher order finite element simulation for geo-electromagnetics—a marine csem example. Geophysical Journal International, 187(1):63–74, 2011.
|
| 208 |
+
|
| 209 |
+
[40] Nils Thuerey, Konstantin Weißenow, Lukas Prantl, and Xiangyu Hu. Deep learning methods for reynolds-averaged navier–stokes simulations of airfoil flows. AIAA Journal, 58(1):25–36, 2020.
|
| 210 |
+
|
| 211 |
+
[41] Kiwon Um, Xiangyu Hu, and Nils Thuerey. Liquid splash modeling with neural networks. In Computer Graphics Forum, volume 37, pp. 171–182. Wiley Online Library, 2018.
|
| 212 |
+
|
| 213 |
+
[42] Benjamin Ummenhofer, Lukas Prantl, Nils Thurey, and Vladlen Koltun. Lagrangian fluid ¨ simulation with continuous convolutions. In International Conference on Learning Representations, 2020.
|
| 214 |
+
|
| 215 |
+
[43] Rui Wang, Karthik Kashinath, Mustafa Mustafa, Adrian Albert, and Rose Yu. Towards physics-informed deep learning for turbulent flow prediction. In ACM SIGKDD international conference on knowledge discovery and data mining, 2020.
|
| 216 |
+
|
| 217 |
+
[44] Emo Welzl. Smallest enclosing disks (balls and ellipsoids). In New results and new trends in computer science, pp. 359–370. Springer, 1991.
|
| 218 |
+
|
| 219 |
+
[45] Martin Wicke, Daniel Ritchie, Bryan M. Klingner, Sebastian Burke, Jonathan R. Shewchuk, and James F. O’Brien. Dynamic local remeshing for elastoplastic simulation. ACM Trans. Graph., 29(4), 2010.
|
| 220 |
+
|
| 221 |
+
[46] Steffen Wiewel, Moritz Becher, and Nils Thuerey. Latent space physics: Towards learning the temporal evolution of fluid flow. In Computer Graphics Forum, pp. 71–82. Wiley Online Library, 2019.
|
| 222 |
+
|
| 223 |
+
[47] You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. Tempogan: A temporally coherent, volumetric gan for super-resolution fluid flow. ACM Trans. Graph., 37(4), July 2018.
|
| 224 |
+
|
| 225 |
+
[48] Abdelaziz Yazid, Nabbou Abdelkader, and Hamouine Abdelmadjid. A state-of-the-art review of the $\mathbf { X }$ -fem for computational fracture mechanics. Applied Mathematical Modelling, 33(12): 4269–4282, 2009.
|
| 226 |
+
|
| 227 |
+
[49] Yao Zhang, Woong Je Sung, and Dimitri N Mavris. Application of convolutional neural network to predict airfoil lift coefficient. In 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference, pp. 1903, 2018.
|
| 228 |
+
|
| 229 |
+
A APPENDIX
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure A.1: Many of our datasets have highly irregular meshing, which allows us to predict dynamics at several scales. With only $5 \mathrm { k }$ nodes, the dataset AIRFOIL spans a large region around the wing (left: entire simulation domain), while still providing high resolution around the airfoil (middle: ROI for visual comparison and RMSE computation), down to sub-millimeter details around the wing tip (right).
|
| 233 |
+
|
| 234 |
+
# A.1 DATASET DETAILS
|
| 235 |
+
|
| 236 |
+
Below we list details for all of our datasets. “System” describes the underlying PDE: cloth, hyperelasticity or compressible and incompressible Navier-Stokes flow. We used ArcSim [27] for simulating the cloth datasets, SU2 [13] for compressible flows, and COMSOL [11] for incompressible flow and hyperelastic simulations. Hyper-elasticity and cloth are simulated using linear elements. Each dataset consists of 1000 training, 100 validation and 100 test trajectories, each containing 250- 600 time steps. Meshing can be either regular, i.e. all edges having similar length, irregular, i.e. edge lengths vary strongly in different regions of the mesh or dynamic, i.e. change at each step of the simulation trajectory. For Lagrangian systems, the world edge radius $r _ { W }$ is provided. Our model operates on the simulation time step $\Delta t$ listed below. However, for each output time step, the solvers compute several internal time steps (16 for ArcSim, 100 for SU2, adaptive for COMSOL). As a quasi-static simulation, DEFORMINGPLATE does not have a time step.
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>System</td><td rowspan=1 colspan=1>Solver</td><td rowspan=1 colspan=1>Mesh type</td><td rowspan=1 colspan=1>Meshing</td><td rowspan=1 colspan=1># steps</td><td rowspan=1 colspan=1>△tS</td><td rowspan=1 colspan=1>rw</td></tr><tr><td rowspan=1 colspan=1>FLAGSIMPLE</td><td rowspan=1 colspan=1>cloth</td><td rowspan=1 colspan=1>ArcSim</td><td rowspan=1 colspan=1>triangle 3D</td><td rowspan=1 colspan=1>regular</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>0.02</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>FLAGDYNAMIC</td><td rowspan=1 colspan=1>cloth</td><td rowspan=1 colspan=1>ArcSim</td><td rowspan=1 colspan=1>triangle 3D</td><td rowspan=1 colspan=1>dynamic</td><td rowspan=1 colspan=1>250</td><td rowspan=1 colspan=1>0.02</td><td rowspan=1 colspan=1>0.05</td></tr><tr><td rowspan=1 colspan=1>SPHEREDYNAMIC</td><td rowspan=1 colspan=1>cloth</td><td rowspan=1 colspan=1>ArcSim</td><td rowspan=1 colspan=1>triangle 3D</td><td rowspan=1 colspan=1>dynamic</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.05</td></tr><tr><td rowspan=1 colspan=1>DEFORMINGPLATE</td><td rowspan=1 colspan=1>hyper-el.</td><td rowspan=1 colspan=1>COMSOL</td><td rowspan=1 colspan=1>tetrahedral 3D</td><td rowspan=1 colspan=1>irregular</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>0.03</td></tr><tr><td rowspan=1 colspan=1>CYLINDERFLOW</td><td rowspan=1 colspan=1>incompr. NS</td><td rowspan=1 colspan=1>COMSOL</td><td rowspan=1 colspan=1>triangle 2D</td><td rowspan=1 colspan=1>irregular</td><td rowspan=1 colspan=1>600</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>AIRFOIL</td><td rowspan=1 colspan=1>compr. NS</td><td rowspan=1 colspan=1>SU2</td><td rowspan=1 colspan=1>triangle 2D</td><td rowspan=1 colspan=1>irregular</td><td rowspan=1 colspan=1>600</td><td rowspan=1 colspan=1>0.008</td><td rowspan=1 colspan=1>一</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Next, we list input encoding for mesh edges ${ \mathbf { e } } _ { i j } ^ { M }$ , world edges ${ \bf e } _ { i j } ^ { W }$ and nodes $\mathbf { v } _ { i }$ , as well as the predicted output for each system.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=1>System</td><td rowspan=1 colspan=1>Type</td><td rowspan=1 colspan=5>inputse</td><td rowspan=1 colspan=2>inputse</td><td rowspan=1 colspan=1>inputsVi</td><td rowspan=1 colspan=1> outputsPi</td><td rowspan=1 colspan=1>historyh</td></tr><tr><td rowspan=1 colspan=1>Cloth</td><td rowspan=1 colspan=1>Lagrangian</td><td rowspan=1 colspan=1>uij,</td><td rowspan=1 colspan=1>uij</td><td rowspan=1 colspan=2>uijl Xij,</td><td rowspan=1 colspan=1>|xijl</td><td rowspan=1 colspan=1>Xij,|Xijl</td><td></td><td rowspan=1 colspan=1>n,(x-x-1)</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Hyper-El.</td><td rowspan=1 colspan=1>Lagrangian</td><td rowspan=1 colspan=1>uij,</td><td rowspan=1 colspan=1>uijl</td><td rowspan=1 colspan=2>,Xij,</td><td rowspan=1 colspan=1>xij</td><td rowspan=1 colspan=1>Xij,Xij</td><td></td><td rowspan=1 colspan=1>ni</td><td rowspan=1 colspan=1>文i,Oi</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Incomp. NS</td><td rowspan=1 colspan=1>Eulerian</td><td rowspan=1 colspan=2>uij,</td><td rowspan=1 colspan=1>uij</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>ni,Wi</td><td rowspan=1 colspan=1>Wi,Pi</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Compr. NS</td><td rowspan=1 colspan=1>Eulerian</td><td rowspan=1 colspan=2>uij,uij</td><td rowspan=1 colspan=1>Uij</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>ni,Wi, pi</td><td rowspan=1 colspan=1>Wi,pi,Pi</td><td rowspan=1 colspan=1>0</td></tr></table>
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure A.2: Beside output quantities such as position or momentum, which are integrated and fed back into the model as an input during rollout, we can also predict auxiliary output quantities, such as pressure or stress. These quantities can be useful for further analyzing the dynamics of the system. Here, we show a snapshot of auxiliary predictions of the pressure field in CYLINDERFLOW.
|
| 246 |
+
|
| 247 |
+
All second-derivative output quantities $( \ddot { \bigcirc } )$ are integrated twice, while first derivative outputs $( \dot { \bigtriangledown } )$ are integrated once as described in Section 3.1; all other outputs are direct predictions, and are not integrated. The one-hot node type vector ${ \bf n } _ { i }$ allows the model to distinguish between normal and kinematic nodes. Normal nodes are simulated, while kinematic either remain fixed in space (such as the two nodes which keep the cloth from falling), or follow scripted motion (as the actuator in DEFORMINGPLATE). For scripted kinematic nodes, we additionally provide the next-step worldspace velocity $\mathbf { x } _ { i } ^ { t + 1 } - \mathbf { x } _ { i } ^ { t }$ as input; this allows the model to predict next-step positions which are consistent with the movement of the actuator. In the variant of FLAGDYNAMIC with varying wind speeds (generalization experiment in Section 5), the wind speed vector is appended to the node features.
|
| 248 |
+
|
| 249 |
+
In the dynamically meshed datasets (FLAGDYNAMIC, SPHEREDYANMIC), the mesh changes between steps, and there is no 1:1 correspondence between nodes. In this case, we interpolate dynamical quantities from previous meshes $\mathbf { \bar { \boldsymbol { M } } } ^ { t - 1 } , . . . , \boldsymbol { M } ^ { t - h }$ as well as $M ^ { t + 1 }$ into the current mesh $M ^ { t }$ using barycentric interpolation in mesh-space, in order to provide history and targets for each node.
|
| 250 |
+
|
| 251 |
+
# A.2 ADDITIONAL MODEL DETAILS
|
| 252 |
+
|
| 253 |
+
# A.2.1 ARCHITECTURE AND TRAINING
|
| 254 |
+
|
| 255 |
+
The MLPs of the Encoder $\epsilon ^ { M }$ , $\epsilon ^ { W }$ , $\epsilon ^ { V }$ , the Processor $f ^ { M } , \ f ^ { W } , \ j$ $f ^ { V }$ , and Decoder $\delta ^ { V }$ are ReLUactivated two-hidden-layer MLPs with layer and output size of 128, except for $\delta ^ { V }$ whose output size matches the prediction $\mathbf { p } _ { i }$ . All MLPs outputs except $\delta ^ { V }$ are normalized by a LayerNorm. All input and target features are normalized to zero-mean, unit variance, using dataset statistics.
|
| 256 |
+
|
| 257 |
+
For training, we only supervise on the next step in sequence; to make our model robust to rollouts of hundreds of steps we use training noise (see Section A.2.2). Models are trained on a single v100 GPU with the Adam optimizer for 10M training steps, using an exponential learning rate decay from $1 0 ^ { - 4 }$ to $1 0 ^ { - 6 }$ over 5M steps.
|
| 258 |
+
|
| 259 |
+
# A.2.2 TRAINING NOISE
|
| 260 |
+
|
| 261 |
+
We used the same training noise strategy as in GNS [37] to make our model robust to rollouts of hundreds of steps. We add random normal noise of zero mean and fixed variance to the most recent value of the corresponding dynamical variable (Section A.2.3). When choosing how much noise to add, we looked at the one-step model error (usually related to the standard deviation of the targets in the dataset) and scanned the noise magnitude around that value on a logarithmic scale using two values for each factor of 10. For the exact numbers for each dataset, see Table A.2.3.
|
| 262 |
+
|
| 263 |
+
In the cases where the dataset is modelled as a first-order system (all, except cloth domains); we adjust the targets according to the noise, so that the model decoder produces an output that after integration would have corrected the noise at the inputs. For example, in DEFORMINGPLATE, assume the current position of a node is $x _ { i } ^ { t } = 2$ , and $\hat { x } _ { i } ^ { t } = 2 . 1$ after adding noise. If the next position is $x _ { i } ^ { t + 1 } = 3$ , the target velocity for the decoder ${ \dot { x } } _ { i } = 1$ will be adjusted to $\tilde { \dot { x } } _ { i } = 0 . 9$ , so that after integration, the model output $\tilde { x } _ { i } ^ { t + 1 }$ matches the next step $\boldsymbol { x } _ { i } ^ { t + 1 }$ effectively correcting for the added noise, i.e. : $\tilde { x } _ { i } ^ { t + 1 } = \tilde { x } _ { i } ^ { t } + \tilde { \dot { x } } _ { i } = \dot { 3 } \equiv x _ { i } ^ { t + 1 }$ .
|
| 264 |
+
|
| 265 |
+
In the second-order domains (cloth), the model decoder outputs acceleration ${ \ddot { x } } _ { i }$ from the input position $\boldsymbol { x } _ { i } ^ { t }$ and velocity $\dot { x } _ { i } ^ { t } = \dot { x } _ { i } ^ { t } - \dot { x } _ { i } ^ { t - 1 }$ (as in GNS). As with other systems, we add noise to the position $\boldsymbol { x } _ { i } ^ { t }$ , which indirectly results on a noisy derivative $\dot { x } _ { i } ^ { t }$ estimate. In this case, due to the strong dependency between position and velocity, it is impossible to adjust the targets to simultaneously correct for noise in both values. For instance, assume $x _ { i } ^ { t - 1 } = \bar { 1 . 4 } , x _ { i } ^ { t } = 2 , x _ { i } ^ { t + 1 } = 3$ , which implies $\dot { x } _ { i } ^ { t } = 0 . 6 , \dot { x } _ { i } ^ { t + 1 } = 1$ , and ground truth acceleration $\ddot { x } _ { i } = 0 . 4$ . After adding 0.1 of noise the inputs are $\tilde { x } _ { i } ^ { t } = 2 . 1 \Rightarrow \tilde { \dot { x } } _ { i } ^ { t } = 0 . 7 $ . At this point, we could use a modified acceleration target of $\tilde { \ddot { x } } _ { i } ^ { P } = 0 . 2$ , so that after integration, the next velocity is $\tilde { \dot { x } } _ { i } ^ { t + 1 } = \tilde { \dot { x } } _ { i } ^ { t } + \tilde { \dot { x } } ^ { P } = 0 . 9$ , and the next position $\tilde { x } _ { i } ^ { t + 1 } = \tilde { x } _ { i } ^ { t } + \tilde { { x } } _ { i } ^ { t + 1 } = 3 \equiv x _ { i } ^ { t + 1 }$ , effectively correcting for the noise added to the position. However, note that in this case the predicted next step velocity x˜˙ t+1i = 0.9 does not match the ground truth $\dot { x } _ { i } ^ { t + 1 } = 1$ . Similarly, if we chose a modified target acceleration of $\tilde { \ddot { x } } _ { i } ^ { V } = 0 . 3$ , the next step velocity $\tilde { \dot { x } } _ { i } ^ { t + 1 } = 1$ would match the ground truth, correcting the noise in velocity, but the same would not be true for the next step position $\tilde { x } _ { i } ^ { t + 1 } = 3 . 1$ . Empirically, we treated how to correct the noise for cloth simulation as a hyperparameter $\gamma \in [ 0 , 1 ]$ which parametrizes a weighted average between the two options: $\tilde { \ddot { x } } _ { i } = \gamma \tilde { \dot { x } } _ { i } ^ { P } + ( 1 - \gamma ) \tilde { \dot { x } } _ { i } ^ { V }$ . Best performance was achieved with $\gamma = 0 . 1$ .
|
| 266 |
+
|
| 267 |
+
Finally, when the model takes more than one step of history $( h > 1 )$ (e.g. in the ablation from Figure 5d on FLAGDYNAMIC), the noise is added in a random walk manner with a per-step variance such as the variance at the last step matches the target variance (in accordance with GNS [37]).
|
| 268 |
+
|
| 269 |
+
# A.2.3 HYPERPARAMETERS
|
| 270 |
+
|
| 271 |
+
Table 2: Training noise parameters and batch size.
|
| 272 |
+
|
| 273 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>Noise scale</td></tr><tr><td rowspan=1 colspan=1>FLAGSIMPLE</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>pos: 1e-3</td></tr><tr><td rowspan=1 colspan=1>FLAGDYNAMIC</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>pos: 3e-3</td></tr><tr><td rowspan=1 colspan=1>SPHEREDYNAMIC</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>pos:1e-3</td></tr><tr><td rowspan=1 colspan=1>DEFORMINGPLATE</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>pos: 3e-3</td></tr><tr><td rowspan=1 colspan=1>CYLINDERFLOW</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>momentum:2e-2</td></tr><tr><td rowspan=1 colspan=1>AIRFOIL</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>momentum: le1, density:1e-2</td></tr></table>
|
| 274 |
+
|
| 275 |
+
# A.3 A DOMAIN-INVARIANT LOCAL REMESHER FOR TRIANGULAR MESHES
|
| 276 |
+
|
| 277 |
+
A local remesher [27, 28, 33] changes the mesh by iteratively applying one of three fundamental operations: splitting an edge to refine the mesh, collapsing an edge to coarsen it, and flipping an edge to change orientation and to preserve a sensible aspect ratio of its elements. Edge splits create a new node whose attributes (position, etc.), as well as the associated sizing tensor, are obtained by averaging values of the two nodes forming the split edge. Collapsing removes a node from the mesh, while edge flips leave nodes unaffected.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
|
| 281 |
+
Given the sizing field tensor $\mathbf { S } _ { i }$ at each node $i$ , we can define the following conditions for performing edge operations:
|
| 282 |
+
|
| 283 |
+
• An edge connecting node $i$ and $j$ should be split if it is invalid, i.e. $\mathbf { u } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i j } \mathbf { u } _ { i j } > 1$ with the averaged sizing tensor $\begin{array} { r } { { \bf S } _ { i j } = \frac { 1 } { 2 } ( { \bf S } _ { i } + { \bf S } _ { j } ) } \end{array}$ .
|
| 284 |
+
|
| 285 |
+
• An edge should be collapsed, if the collapsing operation does not create any new invalid edges.
|
| 286 |
+
|
| 287 |
+
• An edge should be flipped if the an-isotropic Delaunay criterion [7]
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
( \mathbf { u } _ { j k } \times \mathbf { u } _ { i k } ) \mathbf { u } _ { i l } ^ { T } \mathbf { S } _ { A } \mathbf { u } _ { j l } < \mathbf { u } _ { j k } ^ { T } \mathbf { S } _ { A } \mathbf { u } _ { i k } ( \mathbf { u } _ { i l } \times \mathbf { u } _ { j l } ) , \qquad \mathbf { S } _ { A } = \frac { 1 } { 4 } ( \mathbf { S } _ { i } + \mathbf { S } _ { j } + \mathbf { S } _ { k } + \mathbf { S } _ { l } )
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
is satisfied. This optimizes the directional aspect ratio of the mesh elements.
|
| 294 |
+
|
| 295 |
+
We can now implement a simple local remesher by applying these operations in sequence. First, we split all possible mesh edges to refine the mesh (in descending order of the metric $\mathbf { \dot { u } } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i j } \mathbf { u } _ { i j } )$ , then flip all edges which should be flipped. Next, we collapse all edges we can collapse (in ascending order of the metric $\mathbf { u } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i j } \mathbf { u } _ { i j } )$ to coarsen the mesh as much as possible, and finally again flip all possible edges to improve mesh quality.
|
| 296 |
+
|
| 297 |
+
# A.3.1 ESTIMATING SIZING FIELD TARGETS
|
| 298 |
+
|
| 299 |
+
If no sizing field is available to train the sizing model, we can estimate it from a sequence of meshes. That is, for two consecutive meshes $M ^ { t }$ , $M ^ { \tilde { t } + 1 }$ we want to find the sizing field $\mathbf { S }$ that would have induced this transition with a local remesher, i.e. $M ^ { t + 1 } = \mathcal { R } ( M ( t ) , \mathbf { S } )$ . To do this, we assume that the remesher is near-optimal, that is, all resulting edges are valid, yet maximum-length under the metric S. For each $\mathbf { S } _ { i }$ associated with the node $i$ , this can be expressed as:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\mathbf { S } _ { i } = \mathrm { a r g m a x } \sum _ { j \in \mathcal { N } _ { i } } \mathbf { u } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i } \mathbf { u } _ { i j } , \quad s . t . \forall j \in \mathcal { N } _ { i } : \mathbf { u } _ { i j } ^ { \mathrm { T } } \mathbf { S } _ { i } \mathbf { u } _ { i j } \leq 1
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
This problem corresponds to finding the minimum-area, zero-centred ellipse containing the points $\mathbf { u } _ { i j }$ , and can be solved efficiently using the MINIDISK algorithm [44].
|
| 306 |
+
|
| 307 |
+
# A.4 ADDITIONAL BASELINE DETAILS
|
| 308 |
+
|
| 309 |
+
# A.4.1 BASELINE TRAINING
|
| 310 |
+
|
| 311 |
+
Baseline architectures were trained within our general training framework, sharing the same normalization, noise and state-update strategies. We optimized the training hyperparameters separately in each case.
|
| 312 |
+
|
| 313 |
+
# A.4.2 GCN BASELINE
|
| 314 |
+
|
| 315 |
+
We re-implemented the base GCN architecture (without the super-resolution component) from Belbute-Peres et al. [5]. To replicate the results, and ensure correctness of our implementation of the baseline, we created a dataset AIRFOILSTEADY which matches the dataset studied in their work. It uses the same solver and a similar setup as our dataset AIRFOIL, except that it has a narrower range of angle of attack $( - 1 0 ^ { \circ } . . . 1 0 ^ { \circ }$ vs $- 2 5 ^ { \circ } . . . 2 5 ^ { \circ }$ in AIRFOIL). The biggest difference is that the prediction task studied in their paper is not a dynamical simulation as our experiments, but a steady-state prediction task. That is, instead of unrolling a dynamics model for hundreds of time steps, this task consists of directly predicting the final steady-state momentum, density and pressure fields, given only two scalars (Mach number $m$ , angle of attack $\alpha$ ) as well as the target mesh positions $\mathbf { u } _ { i }$ — essentially learning a parametrized distribution.
|
| 316 |
+
|
| 317 |
+
In AIRFOILSTEADY, the GCN predictions are visually indistinguishable to the ground truth, and qualitatively match the results reported in Belbute-Peres et al. [5] for their ”interpolation regime” experiments. We also trained our model in AIRFOILSTEADY, as a one-step direct prediction model (without an integrator), with encoding like in AIRFOIL (see Section A.1), but where each node is conditioned on the global Mach number $m$ and angle of attack $\alpha$ ), instead of density and momentum. Again, results are visually indistinguishable from the ground truth (video), and our model outperforms GCN in terms of RMSE (ours 0.116 vs GCN 0.159). This is remarkable, as our models’ spatial equivariance bias works against this task of directly predicting a global field. This speaks of the flexibility of our architecture, and indicates that it can be used for tasks beyond learning local physical laws for which it was designed.
|
| 318 |
+
|
| 319 |
+
# A.4.3 GRID (CNN) BASELINE
|
| 320 |
+
|
| 321 |
+
We re-implemented the UNet architecture of Thurey et al. [40] to exactly match their open-sourced version of the code. We used a batch size of 10. The noise parameters from Section A.2.3 are absolute noise scale on momentum 6e-2 for CYLINDERFLOW, and 1e1 on momentum and 1.5e-2 on density in the AIRFOIL dataset.
|
| 322 |
+
|
| 323 |
+
# A.5 ADDITIONAL ANALYSIS
|
| 324 |
+
|
| 325 |
+
# A.5.1 PERFORMANCE
|
| 326 |
+
|
| 327 |
+
In the table below, we show a detailed breakdown of per-step timings of our model run on CPU (8-core workstation) or a single v100 GPU. tmodel measures inference time of the graph neural network, while $\mathbf { t } _ { \mathbf { f u l l } }$ measures the complete rollout, including remeshing and graph recomputation. The ground truth simulation $\mathbf { \Gamma } ( \mathbf { t } _ { \mathbf { G T } } )$ was run on the same 8-core workstation CPU. On our datasets, inference uses between 1-2.5GB of memory, including model variables and system overhead.
|
| 328 |
+
|
| 329 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>CPUtmodelms/step</td><td rowspan=1 colspan=1>CPUtfullms/step</td><td rowspan=1 colspan=1>GPUtmodelms/step</td><td rowspan=1 colspan=1>GPUtfullms/step</td><td rowspan=1 colspan=1>tGTms/step</td><td rowspan=1 colspan=1>CPUspeedup</td><td rowspan=1 colspan=1>GPUspeedup</td></tr><tr><td rowspan=1 colspan=1>FLAGSIMPLE</td><td rowspan=1 colspan=1>186</td><td rowspan=1 colspan=1>187</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>4166</td><td rowspan=1 colspan=1>22.3</td><td rowspan=1 colspan=1>214.7</td></tr><tr><td rowspan=1 colspan=1>FLAGDYNAMIC</td><td rowspan=1 colspan=1>534</td><td rowspan=1 colspan=1>1593</td><td rowspan=1 colspan=1>43</td><td rowspan=1 colspan=1>837</td><td rowspan=1 colspan=1>26199</td><td rowspan=1 colspan=1>16.4</td><td rowspan=1 colspan=1>31.3</td></tr><tr><td rowspan=1 colspan=1>SPHEREDYNAMIC</td><td rowspan=1 colspan=1>221</td><td rowspan=1 colspan=1>402</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>140</td><td rowspan=1 colspan=1>1610</td><td rowspan=1 colspan=1>4.0</td><td rowspan=1 colspan=1>11.5</td></tr><tr><td rowspan=1 colspan=1>DEFORMINGPLATE</td><td rowspan=1 colspan=1>172</td><td rowspan=1 colspan=1>174</td><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>2893</td><td rowspan=1 colspan=1>16.6</td><td rowspan=1 colspan=1>89.0</td></tr><tr><td rowspan=1 colspan=1>CYLINDERFLOW</td><td rowspan=1 colspan=1>166</td><td rowspan=1 colspan=1>168</td><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>820</td><td rowspan=1 colspan=1>4.9</td><td rowspan=1 colspan=1>35.3</td></tr><tr><td rowspan=1 colspan=1>AIRFOIL</td><td rowspan=1 colspan=1>497</td><td rowspan=1 colspan=1>499</td><td rowspan=1 colspan=1>37</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>11015</td><td rowspan=1 colspan=1>22.1</td><td rowspan=1 colspan=1>289.1</td></tr></table>
|
| 330 |
+
|
| 331 |
+
The NN bulding blocks used in our model are highly optimized for hardware acceleration. However, our ground truth solvers (ArcSim, COMSOL and SU2) do not support GPUs; and more broadly, solvers have varying levels of optimization for different hardware, so we find it hard to provide a ’true’ hardware-agnostic performance comparison. We do note a few trends.
|
| 332 |
+
|
| 333 |
+
In the simulation regime studied in this paper (i.e. general-purpose simulations on complex, irregular domains) classical GPU solvers tend to be comparably hard to implement and they do not scale very well, thus many packages do not provide such support. As an example of a general-purpose solver with partial GPU support, ANSYS shows limited speedups of $2 \mathbf { X } ^ { - 4 } \mathbf { X }$ on GPU, even under optimal conditions [30, 14]. On the other hand, evaluating our model on the same CPU hardware as the ground truth solvers, it still achieves speedups between $4 \mathrm { x } - 2 2 \mathrm { x }$ , even in this setting which is suboptimal for NN models.
|
| 334 |
+
|
| 335 |
+
In practice, using a single GPU, we see speedups of $1 1 \mathrm { x } \mathrm { - } 2 9 0 \mathrm { x }$ compared to ArcSim, COMSOL and SU2, and users of such simulators with access to a GPU could benefit from these speedups.
|
| 336 |
+
|
| 337 |
+
# A.5.2 ERROR METRICS
|
| 338 |
+
|
| 339 |
+
Rollout RMSE is calculated as the root mean squared error of the position in the Lagrangian systems and of the momentum in the Eulerian systems, taking the mean for all spatial coordinates, all mesh nodes, all steps in each trajectory, and all 100 trajectories in the test dataset. The error bounds in Table 1 and the error bars in Figure 5(a-c) indicate standard error of the RMSE across 100 trajectories. Error bars in Figure 5(d) correspond to min/median/max performance across 3 seeds.
|
| 340 |
+
|
| 341 |
+
In FLAGSIMPLE and FLAGDYNAMIC, we observed decoherence after the first 50 steps (Figure 5b), due to the chaotic nature of cloth simulation. Since the dynamics of these domains are stationary, we use the rollout error in the first 50 steps of the trajectory for the comparison shown in the bar plots, as a more discerning metric for result quality. However, the reported trends also hold when measured over the whole trajectory.
|
| 342 |
+
|
| 343 |
+
In AIRFOIL, we compute the RMSE in a region of interest around the wing (Figure A.1 middle), which corresponds to the region shown in figures and videos. For comparisons with grid-based methods, we map the predictions on the grid to the ground truth mesh to compute the error.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure A.3: A model trained on the regular-sized FLAGDYNAMIC domain was run on variants of FLAGDYNAMIC, WINDSOCK, FISHFLAG with different scale and resolutions. We show the RMSE for 50-step (left) and full-trajectory rollout (right) as a function of the simulation node count.
|
| 347 |
+
|
| 348 |
+
# A.5.3 ADDITIONAL ANALYSIS ON GENERALIZATION AND SCALING
|
| 349 |
+
|
| 350 |
+
We ran inference of our model trained on the FLAGDYNAMIC domain (with learned remeshing), on several scaled-up and scaled-down versions of FLAGDYNAMIC, and the generalization experiment WINDSOCK and FISHFLAG (see Section 5). In Figure A.3, we report the error compared to the respective ground-truth simulations.
|
| 351 |
+
|
| 352 |
+
When evaluating the 50-step RMSE rollout error in FLAGDYNAMIC we do not observe systematic trends of the error as function of the simulation size, indicating that the model performs similarly well on larger and smaller systems. The error when generalizing to new shapes (WINDSOCK, FISHFLAG) is slightly higher, but comparable.
|
| 353 |
+
|
| 354 |
+
The RMSE rollout error evaluated on the full trajectory shows a stronger correlation with the system size. However, we believe this simply tracks the systematic positional error incurred due to decoherence (e.g. a small angle perturbation due to decoherence incurs a higher positional error at the tip of the flag the larger the flag is), and as shown in Figure 5b, decoherence becomes the main source of error after the first 50 steps of the simulation in this domain.
|
md/train/sqZ-b0a6Wm/sqZ-b0a6Wm.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning Student-Friendly Teacher Networks for Knowledge Distillation
|
| 2 |
+
|
| 3 |
+
Dae Young Park∗,1, Moon-Hyun $\mathrm { { C h a } ^ { 1 } }$ , Changwook Jeong1, Dae Sin $\mathrm { K i m ^ { 1 } }$ , and Bohyung $\mathrm { H a n } ^ { * , 2 }$
|
| 4 |
+
|
| 5 |
+
1DIT Center, Samsung Electronics, Korea 2ECE & ASRI, Seoul National University, Korea {p30.daeyoung, moonhyun.cha, chris.jeong, daesin.kim}@samsung.com bhhan@snu.ac.kr
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We propose a novel knowledge distillation approach to facilitate the transfer of dark knowledge from a teacher to a student. Contrary to most of the existing methods that rely on effective training of student models given pretrained teachers, we aim to learn the teacher models that are friendly to students and, consequently, more appropriate for knowledge transfer. In other words, at the time of optimizing a teacher model, the proposed algorithm learns the student branches jointly to obtain student-friendly representations. Since the main goal of our approach lies in training teacher models and the subsequent knowledge distillation procedure is straightforward, most of the existing knowledge distillation methods can adopt this technique to improve the performance of diverse student models in terms of accuracy and convergence speed. The proposed algorithm demonstrates outstanding accuracy in several well-known knowledge distillation techniques with various combinations of teacher and student models even in the case that their architectures are heterogeneous and there is no prior knowledge about student models at the time of training teacher networks.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Knowledge distillation [1] is a well-known technique to learn compact deep neural network models with competitive accuracy, where a smaller network (student) is trained to simulate the representations of a larger one (teacher). The popularity of knowledge distillation is mainly due to its simplicity and generality; it is straightforward to learn a student model based on a teacher and there is no restriction about the network architectures of both models. The main goal of most approaches is how to transfer dark knowledge to student models effectively, given predefined and pretrained teacher networks.
|
| 14 |
+
|
| 15 |
+
Although knowledge distillation is a promising and convenient method, it sometimes fails to achieve satisfactory performance in terms of accuracy. This is partly because the model capacity of a student is too limited compared to that of a teacher and knowledge distillation algorithms are suboptimal [2, 3]. In addition to this reason, we claim that the consistency of teacher and student features is critical to knowledge transfer and the inappropriate representation learning of a teacher often leads to the suboptimality of knowledge distillation.
|
| 16 |
+
|
| 17 |
+
We are interested in making a teacher network hold better transferable knowledge by providing the teacher with a snapshot of the student model at the time of its training. We take advantage of the typical structures of convolutional neural networks with multiple blocks and make the representations of each block in teachers easy to be transferred to students. The proposed approach aims to train teacher models friendly to students for facilitating knowledge distillation; we call the teacher model trained by this strategy student-friendly teacher network (SFTN). SFTN is deployed in arbitrary distillation algorithms easily due to its generality for training models and transferring knowledge.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Comparison between the standard knowledge distillation and our approach. (a) The standard knowledge distillation trains teachers alone and then distill knowledge to students. (b) The proposed student-friendly teacher network trains teachers along with student branches, and then distill more easy-to-transfer knowledge to students.
|
| 21 |
+
|
| 22 |
+
SFTN is partly related to collaborative learning methods [4, 5, 6], which may suffer from the correlation between the models trained jointly and fail to fully exploit knowledge in teacher models. On the other hand, SFTN is free from the limitation since it performs knowledge transfer from a teacher to a student in one direction via a two-stage learning procedure—student-aware training of teacher network followed by knowledge distillation from a teacher to a student. Although the structure of a teacher network depends on target student models, it is sufficiently generic to be adopted by students with various architectures. Figure 1 demonstrates the main difference between the proposed algorithm and the standard knowledge distillation methods.
|
| 23 |
+
|
| 24 |
+
The following is the list of our main contributions:
|
| 25 |
+
|
| 26 |
+
• We adopt a student-aware teacher learning procedure before knowledge distillation, which enables teacher models to transfer their representations to students more effectively. • The proposed approach is applicable to diverse architectures of teacher and students while it can be incorporated into various knowledge distillation algorithms. • We demonstrate that the integration of SFTN into various baseline algorithms and models improve accuracy consistently with substantial margins.
|
| 27 |
+
|
| 28 |
+
The rest of the paper is organized as follows. We first discuss the existing knowledge distillation techniques in Section 2. Section 3 describes the details of the proposed SFTN including the knowledge distillation algorithm. The experimental results with in-depth analyses are presented in Section 4, and we make the conclusion in Section 5.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Although deep learning has shown successful outcomes in various fields, it is still difficult to apply deep neural networks to real-world tasks due to their excessive requirement for computation and memory. There have been many attempts to reduce the computational cost of deep learning models, and knowledge distillation is one of the examples. Various computer vision [7, 8, 9, 10] and natural language processing [11, 12, 13, 14] tasks often employ knowledge distillation to obtain efficient models. Recently, some cross-modal tasks [15, 16, 17] transfer knowledge across domains. This section summarizes the research efforts to improve performance of models via knowledge distillation.
|
| 33 |
+
|
| 34 |
+
# 2.1 What to distill
|
| 35 |
+
|
| 36 |
+
Since Hinton et al. [1] introduce the basic concept of knowledge distillation, where the dark knowledge in teacher models is given by the temperature-scaled representations of the softmax function, various kinds of information have been employed as the sources of knowledge for distillation from teachers to students. FitNets [18] distills intermediate features of a teacher network, where the student network transforms the intermediate features using guided layers and then calculates the difference between the guided layers and the intermediate features of teacher network. The position of distillation is shifted to the layers before the ReLU operations in [19], which also proposes the novel activation function and the partial $L _ { 2 }$ loss function for effective knowledge transfer. Zagoruyko and Komodakis [20] argue importance of attention and propose an attention transfer (AT) method from teachers to students while Kim et al. [21] compute the factor information of the teacher representations using an autoencoder, which is decoded by students for knowledge transfer. Relational knowledge distillation (RKD) [22] introduces a technique to transfer relational information such as distances and angles of features.
|
| 37 |
+
|
| 38 |
+
CRD [23] maximizes mutual information between a teacher and a student via contrastive learning. There exist a couple of methods to perform knowledge distillation without teacher models. For example, ONE [24] distills knowledge from an ensemble of multiple students while BYOT [25] transfers knowledge from deeper layers to shallower ones. Besides, SSKD [26] distills self-supervised features of teachers to students for transferring richer knowledge.
|
| 39 |
+
|
| 40 |
+
# 2.2 How to distill
|
| 41 |
+
|
| 42 |
+
Several recent knowledge distillation methods focus on the strategy of knowledge distillation. Born again network (BAN) [27] presents the effectiveness of sequential knowledge distillation via the networks with an identical architecture. A curriculum learning method [28] employs the optimization trajectory of a teacher model to train students. Collaborative learning approaches [4, 5, 6] attempt to learn multiple models with distillation jointly, but their concept is not well-suited for asymmetric teacher-student relationship, which may lead to suboptimal convergence of student models.
|
| 43 |
+
|
| 44 |
+
The model capacity gap between a teacher and a student is addressed in [2, 29, 3]. TAKD [3] employs an extra network to reduce model capacity gap between teacher and student models, where a teacher transfers knowledge to a student via a teaching assistant network with an intermediate size. An early stopping technique for training teacher networks is proposed to obtain better transferable representations and a neural architecture search is employed to identify a student model with the optimal size [2]. Our work proposes a novel student-friendly learning technique of a teacher network to facilitate knowledge distillation.
|
| 45 |
+
|
| 46 |
+
# 3 Student-Friendly Knowledge Distillation
|
| 47 |
+
|
| 48 |
+
This section describes the details of the student-friendly teacher network (SFTN), which transfers the features of teacher models to student networks more effectively than the standard distillation. Figure 2 illustrates the main idea of our method.
|
| 49 |
+
|
| 50 |
+
# 3.1 Overview
|
| 51 |
+
|
| 52 |
+
The conventional knowledge distillation approaches attempt to find the way of teaching student networks given the architecture of teacher networks. The teacher network is trained with the loss with respect to the ground-truth, but the objective is not necessarily beneficial for knowledge distillation to students. To the contrary, SFTN framework aims to improve the effectiveness of knowledge distillation from the teacher to the student models.
|
| 53 |
+
|
| 54 |
+
Modularizing teacher and student networks We modularize teacher and student networks into multiple blocks based on the depth of layers and the feature map sizes. This is because knowledge distillation is often performed at every 3 or 4 blocks for accurate extraction and transfer of knowledge in teacher models. Figure 2 presents the case that both networks are modularized into 3 blocks, denoted by $\{ B _ { \mathrm { T } } ^ { 1 } , B _ { \mathrm { T } } ^ { 2 } , \bar { B _ { \mathrm { T } } ^ { 3 } } \}$ and $\{ B _ { \mathrm { S } } ^ { 1 } , B _ { \mathrm { S } } ^ { 2 } , B _ { \mathrm { S } } ^ { 3 } \}$ for a teacher and a student, respectively.
|
| 55 |
+
|
| 56 |
+
Adding student branches SFTN augments student branches to a teacher model for the joint training of both parts. Each student branch is composed of a teacher network feature transform layer $\tau$ and a student network blocks. Note that $\tau$ is similar to a guided layer in FitNets [18] and transforms the dimensionality of the channel in $\mathbf { F } _ { \mathrm { T } } ^ { i }$ into that of $B _ { \mathrm { S } } ^ { i + 1 }$ . Depending on the configuration of teacher and student networks, the transformation need to increase or decrease the size of the feature maps. We employ $3 \times 3$ convolutions to reduce the size of $\mathbf { F } _ { \mathrm { T } } ^ { i }$ while $4 \times 4$ transposed convolutions are used to increase its size. Also, $1 \times 1$ convolutions is used when we do not need to change the size of $\mathbf { F } _ { \mathrm { T } } ^ { i }$ . The features transformed to a student branch is forwarded separately to compute the logit of the branch. For example, as shown in Figure 2(a), ${ \bf F } _ { \mathrm { T } } ^ { 1 }$ in the teacher stream is transformed to fit $B _ { \mathrm { S } } ^ { 2 }$ which initiates a student branch to derive $\mathbf { \bar { q } } _ { \mathrm { R } } ^ { 1 }$ while another student branch starts from the transformed features of ${ \bf F } _ { \mathrm { T } } ^ { 2 }$ . Note that ${ \bf F } _ { \mathrm { T } } ^ { 3 }$ has no trailing teacher network block in the figure and has no associated student branch because it is directly utilized to compute the logit of the main teacher network.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: Overview of the student-friendly teacher network (SFTN). In this figure, $\mathbf { F } , B , \tau .$ , and q denote a feature map, a network block, a teacher network feature transform layer, and a softmax output, respectively, where the superscript means the network block index and the subscript S, T, and R respectively indicate the student network, the teacher network, and the student branch in the teacher model. The loss for teacher network ${ \mathcal { L } } _ { \mathrm { T } }$ is given by (4) while Kullback-Leibler loss ${ \mathcal { L } } _ { \mathbb { R } } ^ { \mathrm { K L } }$ and cross entropy loss are defined in (5) and (6), respectively. (a) When training a teacher, SFTN optimizes $\dot { \mathbf { F } } _ { \mathrm { T } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ for better knowledge transfer to student networks. (b) In the distillation stage, the features in the teacher network, $\mathbf { F } _ { \mathrm { T } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ , are distilled to student networks with existing knowledge distillation algorithms straightforwardly.
|
| 60 |
+
|
| 61 |
+
Training SFTN The teacher network is trained along with multiple student branches corresponding to individual blocks in the teacher, where we minimize the differences in the representations between the teacher and the student branches. Our loss function is composed of three terms: loss in the teacher network ${ \mathcal { L } } _ { \mathrm { T } }$ , Kullback-Leibler loss ${ \mathcal { L } } _ { \mathbb { R } } ^ { \mathrm { K L } }$ in the student branch, and cross-entropy loss $\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } }$ in the student branch. The main loss term, ${ \mathcal { L } } _ { \mathrm { T } }$ , minimizes the error between ${ \bf q } _ { \mathrm { T } }$ and the ground-truth while ${ \mathcal { L } } _ { \mathrm { R } } ^ { \mathrm { K L } }$ enforces ${ \bf q } _ { \mathrm { R } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ to be similar to each other and $\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } }$ makes $\mathbf { q } _ { \mathrm { { R } } } ^ { i }$ fit the ground-truth.
|
| 62 |
+
|
| 63 |
+
Distillation using SFTN As shown in Figure 2(b), the conventional knowledge distillation technique is employed to simulate $\mathbf { F } _ { \mathrm { T } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ by $\mathbf { \bar { F } } _ { \mathrm { S } } ^ { i }$ and qS respectively. The actual knowledge distillation step is straightforward because the representations of $\mathbf { F } _ { \mathrm { T } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ have already been learned properly at the time of training SFTN. We expect the performance of the student network distilled from the SFTN to be better than the one obtained from the conventional teacher network.
|
| 64 |
+
|
| 65 |
+
# 3.2 Network Architecture
|
| 66 |
+
|
| 67 |
+
SFTN consists of a teacher network and multiple student branches. The teacher and student networks are divided into $N$ blocks, where a set of blocks in the teacher is given by $\mathbb { B } _ { \mathrm { T } } = \{ B _ { \mathrm { T } } ^ { i } \} _ { i = 1 } ^ { N }$ while the blocks in the student is denoted by $\mathbb { B } _ { \mathrm { S } } = \{ B _ { \mathrm { S } } ^ { i } \} _ { i = 1 } ^ { N }$ . Note that the last block in the teacher network does not have the associated student branch.
|
| 68 |
+
|
| 69 |
+
Given an input of the network, $\mathbf { x }$ , the output of the softmax function for the main teacher network, ${ \bf q } _ { \mathrm { T } }$ , is given by
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
{ \displaystyle { \bf q } _ { \mathrm { T } } ( { \bf x } ; \tau ) = \mathrm { s o f t m a x } \left( \frac { \mathcal { F } _ { \mathrm { T } } ( { \bf x } ) } { \tau } \right) , }
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\mathcal { F } _ { \mathrm { T } }$ denotes the logit of the teacher network and $\tau$ is the temperature of the softmax function. On the other hand, the output of the softmax function in the $i ^ { \mathrm { t h } }$ student branch, ${ \bf q } _ { \mathrm { R } } ^ { i }$ , is given by
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
{ \bf q } _ { \mathrm { R } } ^ { i } ( { \bf F } _ { \mathrm { T } } ^ { i } ; \tau ) = \mathrm { s o f t m a x } \left( \frac { \mathcal { F } _ { \mathrm { S } } ^ { i } ( \mathcal { T } ^ { i } ( { \bf F } _ { \mathrm { T } } ^ { i } ) ) } { \tau } \right) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { F } _ { \mathrm { S } } ^ { i }$ denotes the logit of the $i ^ { \mathrm { { t h } } }$ student branch.
|
| 82 |
+
|
| 83 |
+
# 3.3 Loss Functions
|
| 84 |
+
|
| 85 |
+
The teacher network in the conventional knowledge distillation framework is traned only with ${ \mathcal { L } } _ { \mathrm { T } }$ . However, SFTN has additional loss terms such as $\mathcal { \bar { L } } _ { \mathrm { R } } ^ { \mathrm { K L } }$ and $\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } }$ as described in Section 3.1. The total loss function of SFTN, denoted by $\mathcal { L } _ { \mathrm { S F T N } }$ , is given by
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } _ { \mathrm { S F I N } } = \lambda _ { \mathrm { T } } \mathcal { L } _ { \mathrm { T } } + \lambda _ { \mathrm { R } } ^ { \mathrm { K L } } \mathcal { L } _ { \mathrm { R } } ^ { \mathrm { K L } } + \lambda _ { \mathrm { R } } ^ { \mathrm { C E } } \mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\lambda _ { \mathrm { T } } , \lambda _ { R } ^ { \mathrm { K L } }$ and $\lambda _ { \mathrm { R } } ^ { \mathrm { C E } }$ are the weights of individual loss terms.
|
| 92 |
+
|
| 93 |
+
Each loss term is defined as follows. First, ${ \mathcal { L } } _ { \mathrm { T } }$ is given by the cross-entropy between the teacher’s prediction ${ \bf q } _ { \mathrm { T } }$ and the ground-truth label $\mathbf { y }$ as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal { L } _ { \mathrm { T } } = \mathrm { C r o s s E n t r o p y } ( \mathbf { q } _ { \mathrm { T } } , \mathbf { y } )
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
The knowledge distillation loss, denoted by ${ \mathcal { L } } _ { \mathrm { R } } ^ { \mathrm { K L } }$ , employs the KL divergence between ${ \bf q } _ { \mathrm { R } } ^ { i }$ and ${ \bf q } _ { \mathrm { T } }$ where $N - 1$ student branches except for the last block in the teacher network are considered together as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { K L } } = \frac { 1 } { N - 1 } \sum _ { i = 1 } ^ { N - 1 } \mathrm { K L } ( \tilde { \mathbf { q } } _ { \mathrm { R } } ^ { i } | | \tilde { \mathbf { q } } _ { \mathrm { T } } ) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\tilde { \mathbf { q } } _ { \mathrm { R } } ^ { i }$ and $\tilde { \bf q } _ { \mathrm { T } }$ denote smoother softmax function outputs with a larger temperature, $\tilde { \tau }$ . The cross-entropy loss of the student network, $\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } }$ , is obtained by the average cross-entropy loss from all the student branches, which is given by
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } } = \frac { 1 } { N - 1 } \sum _ { i = 1 } ^ { N - 1 } \mathrm { C r o s s E n t r o p y } ( \mathbf { q } _ { \mathrm { R } } ^ { i } , \mathbf { y } ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Note that we set $\tau$ to 1 for both the cross-entropy loss, ${ \mathcal { L } } _ { \mathrm { T } }$ and $\mathcal { L } _ { \mathrm { R } } ^ { \mathrm { C E } }$
|
| 112 |
+
|
| 113 |
+
# 4 Experiments
|
| 114 |
+
|
| 115 |
+
We evaluate the performance of SFTN in comparison to existing methods and analyze the characteristics of SFTN in various aspects. We first describe our experiment setting in Section 4.1. Then, we compare results between SFTNs and the standard teacher networks with respect to classification accuracy in various knowledge distillation algorithms in Section 4.2. The results from ablative experiments for SFTN and transfer learning are discussed in the rest of this section.
|
| 116 |
+
|
| 117 |
+
# 4.1 Experiment Setting
|
| 118 |
+
|
| 119 |
+
We perform evaluation on multiple well-known datasets including ImageNet [30] and CIFAR-100 [31] using several different backbone networks such as ResNet [32], WideResNet [33], VGG [34], ShuffleNetV1 [35], and ShuffleNetV2 [36]. For comprehensive evaluation, we adopt various knowledge distillation techniques, which include KD [1], FitNets [18], AT [20], SP [37], VID [38], RKD [22], PKT [39], AB [40], FT [21], CRD [23], SSKD [26], and OH [19]. Among these methods, the feature distillation methods [18, 20, 37, 38, 22, 39, 40, 21, 19] conduct joint distillation with conventional KD [1] during student training, which results in higher accuracy in practice than the feature distillation only. We also include comparisons with collaborative learning methods such as DML [4] and KDCL [5], and a curriculum learning technique, RCO [28]. We have reproduced the results from the existing methods using the implementations provided by the authors of the papers.
|
| 120 |
+
|
| 121 |
+
Table 1: Comparisons between SFTN and the standard teacher models on CIFAR-100 dataset when the architectures of the teacher-student pairs are homogeneous. In all the tested algorithms, the students distilled from the teacher models given by SFTN outperform the ones trained from the standard teacher models. All the reported results are based on the outputs of 3 independent runs.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Teacher/Student Teacher training</td><td colspan="2">WRN40-2/WRN16-2</td><td colspan="2">WRN40-2/WRN40-1</td><td colspan="2"></td><td colspan="2">resnet32x4/resnet8x4 SFTN</td><td colspan="3">resnet32x4/resnet8x2</td></tr><tr><td>Teacher Acc.</td><td>Stan. 76.30</td><td>SFTN 78.20</td><td>△</td><td>Stan. 76.30</td><td>SFTN 77.62</td><td>△</td><td>Stan. 79.25 79.41</td><td>△</td><td>Stan. 79.25</td><td>SFTN △</td></tr><tr><td>Student Acc.w/o KD</td><td></td><td>73.41</td><td></td><td></td><td>72.16</td><td></td><td>72.38</td><td></td><td>68.19</td><td>77.89</td></tr><tr><td>KD[1]</td><td>75.46</td><td>76.25</td><td>+0.79</td><td>73.73</td><td>75.09 +1.36</td><td>73.39</td><td>76.09</td><td>+2.70</td><td>67.43 69.17</td><td>+1.74</td></tr><tr><td>FitNets [18]</td><td>75.72</td><td>76.73</td><td>+1.01</td><td>74.14 75.54</td><td>+1.40</td><td>75.34</td><td>76.89</td><td>+1.55 69.80</td><td>71.07</td><td>+1.27</td></tr><tr><td>AT[20]</td><td>75.85</td><td>76.82</td><td>+0.97</td><td>74.56 75.86</td><td>+1.30</td><td>74.98</td><td>76.91</td><td>+1.93</td><td>68.79 70.90</td><td>+2.11</td></tr><tr><td>SP[37]</td><td>75.43</td><td>76.77</td><td>+1.34</td><td>74.51</td><td>75.31 +0.80</td><td>74.06</td><td>76.37</td><td>+2.31</td><td>68.39 70.03</td><td>+1.64</td></tr><tr><td>VID [38]</td><td>75.63</td><td>76.79</td><td>+1.16</td><td>74.21</td><td>75.76 +1.55</td><td>74.86</td><td>77.00</td><td>+2.14</td><td>69.53 71.08</td><td>+1.55</td></tr><tr><td>RKD [22]</td><td>75.48</td><td>76.49</td><td>+1.01</td><td>73.86</td><td>75.11 +1.25</td><td>74.12</td><td>76.62</td><td>+2.50</td><td>68.54 70.91</td><td>+2.36</td></tr><tr><td>PKT[39]</td><td>75.71</td><td>76.57</td><td>+0.86</td><td>74.43</td><td>75.49 +1.06</td><td>74.70</td><td>76.57</td><td>+1.87</td><td>69.29 70.75</td><td>+1.45</td></tr><tr><td>AB [40]</td><td>70.12</td><td>70.76</td><td>+0.64</td><td>74.38</td><td>75.51 +1.13</td><td>74.73</td><td>76.51</td><td>+1.78</td><td>69.76 71.05</td><td>+1.29</td></tr><tr><td>FT[21]</td><td>75.6</td><td>76.51</td><td>+0.91</td><td>74.49 75.11</td><td>+0.62</td><td>74.89</td><td>77.02</td><td>+2.13</td><td>69.70 71.11</td><td>+1.40</td></tr><tr><td>CRD[23]</td><td>75.91</td><td>77.23</td><td>+1.32</td><td>74.93</td><td>76.09 +1.16</td><td>75.54</td><td>76.95</td><td>+1.41</td><td>70.34 71.34</td><td>+1.00</td></tr><tr><td>SSKD[26]</td><td>75.96</td><td>76.80</td><td>+0.84</td><td>75.72</td><td>76.03 +0.31</td><td>75.95</td><td>76.85</td><td>+0.90</td><td>69.34 70.29</td><td>+0.96</td></tr><tr><td>OH[19]</td><td>76.00</td><td>76.39</td><td>+0.39</td><td>74.79</td><td>75.62 +0.83</td><td>75.04</td><td>76.65</td><td>+1.61</td><td>68.10 69.69</td><td>+1.59</td></tr><tr><td>Best</td><td>76.00</td><td>77.23</td><td>+1.23</td><td>75.72</td><td>76.09 +0.37</td><td>75.95</td><td>77.02</td><td>+1.07</td><td>70.34 71.34</td><td>+1.00</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 124 |
+
|
| 125 |
+
Table 2: Comparisons between SFTN and the standard teacher models on CIFAR-100 dataset when the architectures of the teacher-student pairs are heterogeneous. In all the tested algorithms, the student models distilled from the teacher models given by SFTN outperform the ones trained from the standard teacher models. All the reported results are based on the outputs of 3 independent runs.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Teacher/Student</td><td colspan="3">resnet32x4/ShuffleV1</td><td colspan="3">resnet32x4/ShufffleV2</td><td colspan="3">ResNet50/VGG8</td><td colspan="3">WRN40-2/ShuffleV2</td></tr><tr><td>Teacher training</td><td>Stan.</td><td>SFTN</td><td>△</td><td>Stan.</td><td>SFTN</td><td>△</td><td>Stan.</td><td>SFTN</td><td>△</td><td>Stan.</td><td>SFTN</td><td>△</td></tr><tr><td>Teacher Acc.</td><td>79.25</td><td>80.03</td><td></td><td>79.25</td><td>79.58</td><td></td><td>78.70</td><td>82.52</td><td></td><td>76.30</td><td>78.21</td><td></td></tr><tr><td>Student Acc.w/o KD</td><td></td><td>71.95</td><td></td><td></td><td>73.21</td><td></td><td></td><td>71.12</td><td></td><td></td><td>73.21</td><td></td></tr><tr><td>KD[1]</td><td>74.26</td><td>77.93</td><td>+3.67</td><td>75.25</td><td>78.07</td><td>+2.82</td><td>73.82</td><td>74.92</td><td>+1.10</td><td>76.68</td><td>78.06</td><td>+1.38</td></tr><tr><td>FitNets [18]</td><td>75.95</td><td>78.75</td><td>+2.80</td><td>77.00</td><td>79.68</td><td>+2.68</td><td>73.22</td><td>74.80</td><td>+1.58</td><td>77.31</td><td>79.21</td><td>+1.90</td></tr><tr><td>AT[20]</td><td>76.12</td><td>78.63</td><td>+2.51</td><td>76.57</td><td>78.79</td><td>+2.22</td><td>73.56</td><td>74.05</td><td>+0.49</td><td>77.41</td><td>78.29</td><td>+0.88</td></tr><tr><td>SP[37]</td><td>75.80</td><td>78.36</td><td>+2.56</td><td>76.11</td><td>78.38</td><td>+2.27</td><td>74.02</td><td>75.37</td><td>+1.35</td><td>76.93</td><td>78.12</td><td>+1.19</td></tr><tr><td>VID[38]</td><td>75.16</td><td>78.03</td><td>+2.87</td><td>75.70</td><td>78.49</td><td>+2.79</td><td>73.59</td><td>74.76</td><td>+1.17</td><td>77.27</td><td>78.78</td><td>+1.51</td></tr><tr><td>RKD [22]</td><td>74.84</td><td>77.72</td><td>+2.88</td><td>75.48</td><td>77.77</td><td>+2.29</td><td>73.54</td><td>74.70</td><td>+1.16</td><td>76.69</td><td>78.11</td><td>+1.42</td></tr><tr><td>PKT[39]</td><td>75.05</td><td>77.46</td><td>+2.41</td><td>75.79</td><td>78.28</td><td>+2.49</td><td>73.79</td><td>75.17</td><td>+1.38</td><td>76.86</td><td>78.28</td><td>+1.42</td></tr><tr><td>AB[40]</td><td>75.95</td><td>78.53</td><td>+2.58</td><td>76.25</td><td>78.68</td><td>+2.43</td><td>73.72</td><td>74.77</td><td>+1.05</td><td>77.28</td><td>78.77</td><td>+1.49</td></tr><tr><td>FT[21]</td><td>75.58</td><td>77.84</td><td>+2.26</td><td>76.42</td><td>78.37</td><td>+1.95</td><td>73.34</td><td>74.77</td><td>+1.43</td><td>76.80</td><td>77.65</td><td>+0.85</td></tr><tr><td>CRD [23]</td><td>75.60</td><td>78.20</td><td>+2.60</td><td>76.35</td><td>78.43</td><td>+2.08</td><td>74.52</td><td>75.41</td><td>+0.89</td><td>77.52</td><td>78.81</td><td>+1.29</td></tr><tr><td>SSKD [26]</td><td>78.05</td><td>79.10 79.56</td><td>+1.05 +2.05</td><td>78.66 78.08</td><td>79.65</td><td>+0.99 +1.90</td><td>76.03</td><td>76.95</td><td>+0.92</td><td>77.81</td><td>78.34</td><td>+0.53</td></tr><tr><td>OH[19] Best</td><td>77.51 78.05</td><td>79.56</td><td>+1.51</td><td>78.66</td><td>79.98 79.98</td><td>+1.32</td><td>74.55 76.03</td><td>75.95 76.95</td><td>+1.40 +0.92</td><td>77.82 77.82</td><td>79.14</td><td>+1.32</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>79.21</td><td>+1.39</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 4.2 Main Results
|
| 130 |
+
|
| 131 |
+
To show effectiveness of SFTN, we incorporate SFTN into various existing knowledge distillation algorithms and evaluate accuracy. We present implementation details and experimental results on CIFAR-100 [31] and ImageNet [30] datasets.
|
| 132 |
+
|
| 133 |
+
# 4.2.1 CIFAR-100
|
| 134 |
+
|
| 135 |
+
CIFAR-100 [31] consists of 50K training images and 10K testing images in 100 classes. We select 12 state-of-the art distillation methods to compare accuracy of SFTNs with the standard teacher networks. To show the generality of the proposed approach, 8 pairs of teacher and student models have been tested in our experiment. The experiment setup for CIFAR-100 is identical to the one performed in $\mathrm { C R } \mathsf { D } ^ { 2 }$ ; most experiments employ the SGD optimizer with learning rate 0.05, weight decay 0.0005 and momentum 0.9 while learning rate is set to 0.01 in the ShuffleNet experiments. The hyperparameters for the loss function are set as $\lambda _ { \mathrm { T } } = 1$ , $\lambda _ { \mathrm { R } } ^ { \mathrm { C E } } = 1$ , $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } } = 3$ , and $\tilde { \tau } = 1$ in student-aware training while $\tau = 4$ in knowledge distillation.
|
| 136 |
+
|
| 137 |
+
Table 1 and 2 demonstrate the full results on the CIFAR-100 dataset. Table 1 presents the distillation performance of all the compared algorithms when teacher and student pairs have the same architecture type while Table 2 shows the results from teacher-student pairs with heterogeneous architecture styles. Both tables clearly demonstrate that SFTN is consistently better than the standard teacher network in all algorithms. The average difference between SFTN and the standard teacher is $1 . 5 8 \%$ points, and the average difference between best student accuracy of SFTN and the standard teacher is $1 . 1 0 \%$ points. We note that the outstanding performance of SFTN is not only driven by the higher accuracy of teacher models achieved by our student-aware learning technique. As observed in Table 1 and 2, the proposed approach often presents substantial improvement compared to the standard distillation methods despite similar or lower teacher accuracies. Refer to Section 4.4 for the further discussion about the relation of accuracy between teacher and student networks.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Accuracy comparison of the best students from SFTN with the standard teacher on CIFAR100. The four best student models of SFTN (blue) outperform the standard teachers (gray) while the only one best student of the standard teacher (red) achieves higher accuracy than its teacher (gray).
|
| 141 |
+
|
| 142 |
+
Table 3: Top-1 and Top-5 validation accuracy on ImageNet of SFTN in comparison to other methods.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Teacher/Student</td><td colspan="5">ResNet50/ResNet34</td></tr><tr><td rowspan="2">Teacher training</td><td></td><td>Top-1</td><td></td><td>Top-5</td><td></td></tr><tr><td>Standard</td><td>SFTN</td><td>△</td><td>Standard SFTN</td><td>△</td></tr><tr><td>Teacher Acc. Student Acc.w/o KD</td><td>76.45</td><td>77.43</td><td></td><td>93.15 93.75</td><td></td></tr><tr><td>KD[1]</td><td></td><td>73.79</td><td></td><td>91.74</td><td></td></tr><tr><td>FitNets [18]</td><td>73.55</td><td>74.14</td><td>+0.59</td><td>91.81 92.21</td><td>+0.40</td></tr><tr><td></td><td>74.56</td><td>75.01</td><td>+0.45</td><td>92.31 92.51</td><td>+0.20</td></tr><tr><td>SP[37]</td><td>74.95</td><td>75.53</td><td>+0.58</td><td>92.54 92.69</td><td>+0.15</td></tr><tr><td>CRD[23]</td><td>75.01</td><td>75.39</td><td>+0.38</td><td>92.56 92.67</td><td>+0.11</td></tr><tr><td>OH[19]</td><td>74.56</td><td>75.01</td><td>+0.45</td><td>92.36</td><td>92.56 +0.20</td></tr><tr><td>Best</td><td>75.01</td><td>75.53</td><td>+0.52</td><td>92.56</td><td>92.69 +0.13</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Figure 3 illustrates the accuracies of the best student models of the standard teacher and SFTN given teacher and student architecture pairs. Despite the small capacity of the students, the best student models of SFTN sometimes outperform the standard teachers while the only one best student of the standard teacher shows higher accuracy than its teacher.
|
| 147 |
+
|
| 148 |
+
# 4.2.2 ImageNet
|
| 149 |
+
|
| 150 |
+
ImageNet [30] consists of 1.2M training images and 50K validation images for 1K classes. We adopt the standard Pytorch set-up for ImageNet training for this experiment3. The optimization is given by SGD with learning rate 0.1, weight decay 0.0001 and momentum 0.9.
|
| 151 |
+
|
| 152 |
+
The coefficients of individual loss terms are set as $\lambda _ { \mathrm { T } } = 1$ , $\lambda _ { \mathrm { R } } ^ { \mathrm { C E } } = 1$ , and $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } } = 1$ , where $\tilde { \tau } = 1$ models based on ResNet50 transfer knowledge to student networks with ResNet34.
|
| 153 |
+
|
| 154 |
+
As presented in Table 3, SFTN consistently outperforms the standard teacher network in all settings. The best student accuracy of SFTN achieves the higher top-1 accuracy than the standard teacher model by approximately $0 . 5 \%$ points. This results implies that the proposed algorithm has great potential on large datasets as well.
|
| 155 |
+
|
| 156 |
+
# 4.3 Comparison with Collaborative and Curriculum Learning Methods
|
| 157 |
+
|
| 158 |
+
Contrary to traditional knowledge distillation methods based on static pretrained teachers, collaborative learning approaches employ dynamic teacher networks trained jointly with students and curriculum learning methods keep track of the optimization history of teachers for distillation. Table 4 shows that SFTN outperforms the collaborative learning techniques such as DML [4] and KDCL [5];
|
| 159 |
+
|
| 160 |
+
Table 4: Comparision with collaborative and curriculum learning approaches on CIFAR-100. We employ KDCL-Naïve for ensemble logits of KDCL. RCO is based on the one-stage EEI (equal epoch interval) while RCO-EEI-4 adopts 4 anchor points selection with the EEI strategy. Note that both RCO-EEI-4 and SFTN-4 are trained for $2 4 0 \times 4$ epochs.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Teacher Student</td><td colspan="2">WRN40-2 WRN16-2</td><td colspan="2">WRN40-2 WRN40-1</td><td colspan="2">resnet32x4 resnet8x4</td><td colspan="2">resnet32x4 ShuffleV1</td><td colspan="2">resnet32x4 ShuffleV2</td><td colspan="2">ResNet50 VGG8</td></tr><tr><td rowspan="3">Standard teacher Acc. Student Acc.w/o KD</td><td colspan="2">76.30</td><td colspan="2">76.30</td><td colspan="2">79.25</td><td colspan="2">79.25</td><td colspan="2">79.25</td><td colspan="2">78.70</td></tr><tr><td colspan="2">73.41</td><td colspan="2">72.16</td><td colspan="2">72.38</td><td colspan="2">71.95</td><td colspan="2">73.21</td><td colspan="2">71.12</td></tr><tr><td>Stu.</td><td>△</td><td>Stu.</td><td>A</td><td>Stu.</td><td>△</td><td>Stu.</td><td>△</td><td>Stu.</td><td>△</td><td>Stu.</td><td>△</td></tr><tr><td>Standard</td><td>75.46</td><td>+2.05</td><td>73.73</td><td>+1.57</td><td>73.39</td><td>+1.01</td><td>74.26</td><td>+2.31</td><td>75.25</td><td>+2.04</td><td>73.82</td><td>+2.70</td></tr><tr><td>DML[4]</td><td>75.30</td><td>+1.89</td><td>74.08</td><td>+1.92</td><td>74.34</td><td>+1.96</td><td>73.37</td><td>+1.42</td><td>73.80</td><td>+0.59</td><td>73.01</td><td>+1.89</td></tr><tr><td>KDCL [5]</td><td>75.45</td><td>+2.04</td><td>74.65</td><td>+2.49</td><td>75.21</td><td>+2.83</td><td>73.98</td><td>+2.03</td><td>74.30</td><td>+1.09</td><td>73.48</td><td>+2.36</td></tr><tr><td>RCO[28]</td><td>75.36</td><td>+1.95</td><td>74.29</td><td>+2.13</td><td>74.06</td><td>+1.68</td><td>76.62</td><td>+4.67</td><td>77.40</td><td>+4.19</td><td>74.30</td><td>+3.18</td></tr><tr><td>SFTN</td><td>76.25</td><td>+2.84</td><td>75.09</td><td>+2.93</td><td>76.09</td><td>+3.71</td><td>77.93</td><td>+5.98</td><td>78.07</td><td>+4.86</td><td>74.92</td><td>+3.80</td></tr><tr><td>RCO-EEI-4 [28]</td><td>75.69</td><td>+2.28</td><td>74.87</td><td>+2.71</td><td>73.73</td><td>+1.35</td><td>76.97</td><td>+5.02</td><td>76.89</td><td>+3.68</td><td>74.24</td><td>+3.12</td></tr><tr><td>SFTN-4</td><td>76.96</td><td>+3.55</td><td>76.31</td><td>+4.15</td><td>76.67</td><td>+4.29</td><td>79.11</td><td>+7.16</td><td>78.95</td><td>+5.74</td><td>75.52</td><td>+4.40</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 5: Effect of varying $\tilde { \tau }$ in the KL-divergence loss of the student-aware training tested on CIFAR100, where $\tau$ for the knowledge distillation is set to 4. The student accuracy is fairly stable over a wide range of the hyperparameter. Note that the accuracies of SFTNs and the student model are rather inversely correlated, which implies that the maximization of teacher models is not necessarily ideal for knowledge distillation.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td colspan="4">Accuracy of SFTN</td><td colspan="4"></td></tr><tr><td>Teacher</td><td colspan="2">resnet32x4</td><td colspan="2">WRN40-2</td><td rowspan="2"></td><td colspan="2">resnet32x4</td><td rowspan="2">WRN40-2</td><td rowspan="2">Avg.</td></tr><tr><td>Student</td><td>ShuffleV1</td><td>ShuffleV2</td><td>WRN16-2 WRN40-1</td><td>Avg. ShuffleV1</td><td>ShuffleV2 WRN16-2</td><td>WRN40-1</td></tr><tr><td>=1</td><td>81.19</td><td>80.26</td><td>78.23</td><td>78.14</td><td>78.85</td><td>76.05</td><td>77.18</td><td>76.30 74.75</td><td>75.58</td></tr><tr><td>=5</td><td>81.23</td><td>81.56</td><td>79.22</td><td>78.31</td><td>79.54</td><td>75.36</td><td>75.59</td><td>73.64</td><td>75.10</td></tr><tr><td>=10</td><td>81.27</td><td>81.98</td><td>78.81</td><td>78.38</td><td>79.58</td><td>74.47</td><td>75.93</td><td>73.62</td><td>74.76</td></tr><tr><td>=15</td><td>81.89</td><td>81.74</td><td>79.27</td><td>78.63</td><td>79.74</td><td>74.78</td><td>75.65</td><td>73.49</td><td>74.81</td></tr><tr><td>=20</td><td>81.60</td><td>81.70</td><td>78.84</td><td>78.45</td><td>79.59</td><td>74.62</td><td>75.88</td><td>75.79 75.82 74.03</td><td>74.95</td></tr></table>
|
| 167 |
+
|
| 168 |
+
the heterogeneous architectures turn out to be effective for mutual learning. On the other hand, the accuracy of SFTN is consistently higher than that of the curriculum learning method, RCO [28], under the same and even harsher training condition in terms of the number of epochs. Although the identification of the optimal checkpoints may be challenging in the trajectory-based learning, SFTN improves its accuracy substantially with more iterations as shown in the results for SFTN-4.
|
| 169 |
+
|
| 170 |
+
# 4.4 Effect of Hyperparameters
|
| 171 |
+
|
| 172 |
+
SFTN computes the KL-divergence loss, ${ \mathcal { L } } _ { \mathrm { R } } ^ { \mathrm { K L } }$ , to minimize the difference between the softmax outputs of teacher and student branches, which involves two hyperparameters, temperature of the softmax function, $\tau$ , and weight for KL-divergence loss term, $\lambda _ { \mathrm { R } } ^ { \dot { \mathrm { K L } } }$ . We discuss the impact and trade-off issue of the two hyperparameters. In particular, we present our observations that the student-aware learning is indeed helpful to improve the accuracy of student models while maximizing performance of teacher models may be suboptimal for knowledge distillation.
|
| 173 |
+
|
| 174 |
+
Temperature of softmax function The temperature parameter of the KL-divergence loss in (5), denoted by $\tilde { \tau }$ , controls the softness of $\tilde { \bf q } _ { \mathrm { T } }$ and $\tilde { \mathbf { q } } _ { \mathrm { R } } ^ { \bar { i } }$ ; as $\tilde { \tau }$ gets higher, the output of the softmax function becomes smoother. Despite the fluctuation in teacher accuracy, student models given by knowledge distillation via SFTN maintain fairly consistent results. Table 5 also shows that the performance of SFTNs and the student models is rather inversely correlated. This result implies that a loosely optimized teacher model may be more effective for knowledge distillation according to this ablation study.
|
| 175 |
+
|
| 176 |
+
Weight for KL-divergence loss The hyperparameter $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } }$ facilitates knowledge distillation by making $\tilde { \bf q } _ { \mathrm { T } }$ similar to $\bar { \tilde { \mathbf { q } } } _ { \mathrm { R } } ^ { i }$ . However, it affects the accuracy of teacher network negatively. Table 6 shows that the average accuracy gaps between SFTNs and the corresponding student models drop gradually as $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } }$ increases. One interesting observation is the student accuracy via SFTN with $\bar { \lambda } _ { \mathrm { R } } ^ { \mathrm { K L } } = \bar { 1 0 }$ Rin comparison to its counterpart via the standard teacher; even though the standard teacher network is more accurate than SFTN by a large margin, its corresponding student accuracy is lower than that of SFTN.
|
| 177 |
+
|
| 178 |
+
Table 6: Effect of varying $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } }$ in the knowledge distillation via SFTN tested on CIFAR-100. The accuracies of SFTNs and the corresponding students are not correlated while the accuracy gaps of the two models drop as $\lambda _ { \mathrm { R } } ^ { \mathrm { K L } }$ increases.
|
| 179 |
+
|
| 180 |
+
<table><tr><td></td><td colspan="5">Accuracy of SFTN</td><td colspan="5">Student accuracy by KD</td></tr><tr><td>Teacher</td><td colspan="2">resnet32x4</td><td colspan="2">WRN40-2</td><td rowspan="2">Avg.</td><td colspan="2">resnet32x4</td><td colspan="2">WRN40-2</td><td rowspan="2">Avg.</td></tr><tr><td>Student</td><td>ShuffleV1</td><td>ShuffleV2</td><td>WRN16-2</td><td>WRN40-1</td><td>ShufleV1</td><td>ShuffleV2</td><td>WRN16-2</td><td>WRN40-1</td></tr><tr><td>=1</td><td>81.19</td><td>80.26</td><td>78.23</td><td>78.14</td><td>79.46</td><td>76.05</td><td>77.18</td><td>76.30</td><td>74.75</td><td>76.07</td></tr><tr><td>=3</td><td>78.70</td><td>79.80</td><td>77.83</td><td>77.57</td><td>78.48</td><td>77.36</td><td>78.56</td><td>76.20</td><td>74.71</td><td>76.71</td></tr><tr><td>=6</td><td>78.29</td><td>78.29</td><td>77.28</td><td>76.05</td><td>77.48</td><td>77.33</td><td>77.70</td><td>76.02</td><td>74.67</td><td>76.43</td></tr><tr><td>= 10</td><td>73.02</td><td>75.01</td><td>75.03</td><td>73.51</td><td>74.14</td><td>75.57</td><td>76.62</td><td>74.19</td><td>73.08</td><td>74.87</td></tr><tr><td>Standard</td><td>79.25</td><td>79.25</td><td>76.30</td><td>76.30</td><td>77.78</td><td>74.31</td><td>75.25</td><td>75.28</td><td>73.56</td><td>74.60</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 7: Effectiveness of knowledge distillation via SFTN when student models have different capacity compared to the one used in the student-aware training. This experiment is conducted on CIFAR-100. The numbers in bold and red denote the best and the second-best results. SB denotes student branch. (M1: resnet8x2, M2: resnet8x4, M3: resnet32x4, M4: WRN16-1, M5:WRN16-2, M6: WRN40-2, M7: ShuffleV2)
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Teacher/Student</td><td colspan="7">WRN40-2/WRN16-2 (M6/M5)</td><td colspan="7">resnet32x4/ResNet8x4 (M3/M2)</td></tr><tr><td>SB capacity</td><td>N/A</td><td>Smaller</td><td></td><td>Equal/similar</td><td></td><td>Larger</td><td></td><td>N/A</td><td>Smaller</td><td></td><td>Equal/similar</td><td></td><td>Larger</td><td></td></tr><tr><td>SB model</td><td>N/A</td><td>M1</td><td>M4</td><td>M5</td><td>M7</td><td>M3</td><td>M6</td><td>N/A</td><td>M4</td><td>M1</td><td>M2</td><td>M7</td><td>M3</td><td>M6</td></tr><tr><td>SB Acc.</td><td>1</td><td>68.19</td><td>67.10</td><td>73.41</td><td>73.21</td><td>79.25</td><td>76.30</td><td>1</td><td>67.10</td><td>68.19</td><td>72.38</td><td>73.21</td><td>79.25</td><td>76.30</td></tr><tr><td>Teacher Acc.</td><td>76.30</td><td>76.22</td><td>75.98</td><td>78.20</td><td>78.21</td><td>78.82</td><td>78.69</td><td>79.25</td><td>76.53</td><td>77.89</td><td>79.41</td><td>79.58</td><td>80.85</td><td>80.30</td></tr><tr><td>KD[1]</td><td>75.46</td><td>74.67</td><td>74.73</td><td>76.25</td><td>75.68</td><td>75.56</td><td>75.63</td><td>73.39</td><td>74.71</td><td>75.19</td><td>76.09</td><td>75.82</td><td>75.19</td><td>75.03</td></tr><tr><td>SP[37]</td><td>75.43</td><td>74.75</td><td>75.29</td><td>76.77</td><td>76.56</td><td>76.13</td><td>76.08</td><td>74.06</td><td>75.31</td><td>75.76</td><td>76.37</td><td>76.09</td><td>75.62</td><td>75.36</td></tr><tr><td>FT[21]</td><td>75.60</td><td>74.61</td><td>75.23</td><td>76.51</td><td>76.66</td><td>76.47</td><td>76.23</td><td>74.89</td><td>75.79</td><td>76.54</td><td>77.02</td><td>76.62</td><td>76.48</td><td>76.63</td></tr><tr><td>CRD[23]</td><td>75.91</td><td>76.14</td><td>76.07</td><td>77.23</td><td>77.45</td><td>77.06</td><td>76.70</td><td>75.54</td><td>76.38</td><td>76.72</td><td>76.95</td><td>76.64</td><td>76.54</td><td>76.46</td></tr><tr><td>SSKD [26]</td><td>75.96</td><td>74.35</td><td>74.41</td><td>76.80</td><td>76.49</td><td>76.73</td><td>76.72</td><td>75.95</td><td>75.06</td><td>75.77</td><td>76.85</td><td>76.22</td><td>76.67</td><td>76.24</td></tr><tr><td>OH[19]</td><td>76.00</td><td>74.95</td><td>74,.97</td><td>76.39</td><td>76.49</td><td>76.27</td><td>76.15</td><td>75.04</td><td>75.65</td><td>75.69</td><td>76.65</td><td>76.48</td><td>76.38</td><td>76.44</td></tr><tr><td>Average</td><td>75.73</td><td>74.91</td><td>75.12</td><td>76.66</td><td>76.56</td><td>76.37</td><td>76.25</td><td>74.81</td><td>75.48</td><td>75.95</td><td>76.66</td><td>76.31</td><td>76.15</td><td>76.03</td></tr><tr><td>Best</td><td>76.00</td><td>76.14</td><td>76.07</td><td>77.23</td><td>77.45</td><td>77.06</td><td>76.72</td><td>75.95</td><td>76.38</td><td>76.72</td><td>77.02</td><td>76.64</td><td>76.67</td><td>76.63</td></tr></table>
|
| 185 |
+
|
| 186 |
+
# 4.5 Versatility of SFTN
|
| 187 |
+
|
| 188 |
+
Although our teacher network obtained from the student-aware training procedure is specialized for a specific student model, it is also effective to transfer knowledge to the students models with substantially different architectures. Table 7 shows that the benefit of our method is also preserved well as long as the student branch has similar capacity to the student models, where the model capacity is defined by the achievable accuracy via independent training without distillation. In addition, it presents that larger students branches are often effective to enhance distillation performance while smaller student branches are not always helpful. In summary, these results imply that a teacher network in SFTN trained for a specific architecture of student network has the potential to transfer its knowledge to other types of student networks.
|
| 189 |
+
|
| 190 |
+
# 4.6 Use of Pretrained Teachers
|
| 191 |
+
|
| 192 |
+
The main goal of knowledge distillation is to maximize the benefit in student networks, and the additional training cost may not be critical in many real applications. However, the increase of training cost originated from the student branch of the teacher network is still undesirable. We can sidestep this limitation by adopting pretrained teacher networks in the student-aware training stage. The training cost of SFTN teacher networks is reduced significantly by using pretrained models, and Table 8 presents the tendency clearly. Compared to 240 epochs for the standard student-aware training, fine-tuning pretrained teacher networks only needs 60 epochs for convergence; we train the student branches only for the first 30 epochs and fine-tune the whole network for the remaining 30 epochs. Table 9 shows that fine-tuned pretrained teacher networks have potential to enhance distillation performance. They achieve almost same accuracy with the full SFTN in 6 knowledge distillation algorithms.
|
| 193 |
+
|
| 194 |
+
# 4.7 Similarity between Teacher and Student Representations
|
| 195 |
+
|
| 196 |
+
The similarity between teacher and student models is an important measure for knowledge distillation performance in the sense that a student network aims to resemble the output representations of a teacher network. We employ KL-divergence and CKA [41] as similarity metrics, where lower KL-divergence and higher CKA indicate higher similarity.
|
| 197 |
+
|
| 198 |
+
Table 8: Training time of SFTN teachers with pretrained models. The additional training time in each SFTN with a pretrained teacher model is presented in the last column; it is significantly reduced compared to the standard SFTN teacher (the second-last column).
|
| 199 |
+
|
| 200 |
+
<table><tr><td rowspan="2">Models (teacher/student)</td><td colspan="4">Training time (sec)</td></tr><tr><td>Teacher</td><td>Student</td><td>SFTN teacher</td><td>SFTN teacher with a pretrained model</td></tr><tr><td>resnet32x4/ShuffleV1</td><td>6.005</td><td>5.624</td><td>10,910</td><td>2,298</td></tr><tr><td>resnet32x4/ShuffleV2</td><td>6.005</td><td>6,221</td><td>10.949</td><td>2.370</td></tr><tr><td>WRN40-2/WRN16-2</td><td>3,940</td><td>1,745</td><td>6.028</td><td>1,178</td></tr><tr><td>WRN40-2/WRN40-1</td><td>3,940</td><td>3,698</td><td>7,431</td><td>1,621</td></tr></table>
|
| 201 |
+
|
| 202 |
+
Table 9: Performance of SFTN fine-tuned from a pretrained teacher (SFTN-FT) on CIFAR-100.
|
| 203 |
+
|
| 204 |
+
<table><tr><td>Teacher/Student</td><td colspan="3">resnet32x4/ShuffleV2</td></tr><tr><td>Teacher training method</td><td>Standard</td><td>SFTN</td><td>SFTN+FT</td></tr><tr><td>Teacher Acc.</td><td>79.25</td><td>80.03</td><td>80.41</td></tr><tr><td>Student Acc. w/o KD</td><td></td><td>71.95</td><td></td></tr><tr><td>KD[1]</td><td>75.25</td><td>78.07</td><td>78.12</td></tr><tr><td>SP [37]</td><td>76.11</td><td>78.38</td><td>78.51</td></tr><tr><td>FT[21]</td><td>76.42</td><td>78.37</td><td>77.90</td></tr><tr><td>CRD[23]</td><td>76.35</td><td>78.43</td><td>78.88</td></tr><tr><td>SSKD [26]</td><td>78.66</td><td>79.65</td><td>79.15</td></tr><tr><td>OH[19]</td><td>78.08</td><td>79.98</td><td>79.68</td></tr><tr><td>Average</td><td>76.81</td><td>78.81</td><td>78.71</td></tr><tr><td>Best</td><td>78.66</td><td>79.98</td><td>79.68</td></tr></table>
|
| 205 |
+
|
| 206 |
+
Table 10: Similarity measurements between teachers and students on CIFAR-100.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Models (teacher/student)</td><td colspan="3">resnet32x4/ShuffleV2</td></tr><tr><td>Similaritymetric Teacher training method</td><td>KL-divergence Standard SFTN</td><td colspan="2">CKA Standard</td></tr><tr><td></td><td></td><td></td><td>SFTN</td></tr><tr><td>KD [1] FitNets [18]</td><td>1.10 0.47</td><td>0.88</td><td>0.95 0.95</td></tr><tr><td>SP[37]</td><td>0.79 0.38 0.45</td><td>0.89</td><td>0.95</td></tr><tr><td>VID[38]</td><td>0.95 0.88 0.45</td><td>0.89 0.88</td><td>0.95</td></tr><tr><td>CRD[23]</td><td>0.81 0.43</td><td>0.88</td><td>0.95</td></tr><tr><td>SSKD[26]</td><td>0.26</td><td>0.92</td><td>0.97</td></tr><tr><td></td><td>0.54 0.37</td><td>0.90</td><td>0.96</td></tr><tr><td>OH[19]</td><td>0.85</td><td></td><td>0.96</td></tr><tr><td>AVG</td><td>0.84</td><td>0.39</td><td>0.89</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 10 presents the similarities between the representations of a teacher and a student based on $\mathrm { R e s N e t } 3 2 { \times } 4$ and ShuffleV2, respectively, which are given by various algorithms on the CIFAR-100 test set. The results show that the distillations from SFTNs always give higher similarity to the student models with respect to the corresponding teacher networks; SFTN reduces the KL-divergence by more than $50 \%$ in average while improving the average CKA by $7 \%$ points compared to the standard teacher network. The improved similarity of SFTN is natural since it is trained with student branches to obtain student-friendly representations via the KL-divergence loss.
|
| 211 |
+
|
| 212 |
+
# 5 Conclusion
|
| 213 |
+
|
| 214 |
+
We proposed a simple but effective knowledge distillation approach by introducing the novel studentfriendly teacher network (SFTN). Our strategy sheds a light in a new direction to knowledge distillation by focusing on the stage to train teacher networks. We train teacher networks along with their student branches, and then perform distillation from teachers to students. The proposed strategy turns out to achieve outstanding performance, and can be incorporated into various knowledge distillation algorithms easily. For the demonstration of the effectiveness of our strategy, we conducted comprehensive experiments in diverse environments, which show consistent performance gains compared to the standard teacher networks regardless of architectural and algorithmic variations.
|
| 215 |
+
|
| 216 |
+
The proposed approach is effective for achieving higher accuracy with reduced model sizes, but it is not sufficiently verified in the unexpected situations with out-of-distribution inputs, domain shifts, lack of training examples, etc. Also, it still rely on a large number of training examples and still has the limitation of high computational cost and potential privacy issue.
|
| 217 |
+
|
| 218 |
+
# 6 Acknowledgments and Disclosure of Funding
|
| 219 |
+
|
| 220 |
+
This work was partly supported by Samsung Electronics Co., Ltd. (IO200626-07474-01) and Institute for Information & Communications Technology Promotion (IITP) grant funded by the Korea government (MSIT) [2017-0-01779; XAI, 2021-0-01343; Artificial Intelligence Graduate School Program (Seoul National University)].
|
| 221 |
+
|
| 222 |
+
# References
|
| 223 |
+
|
| 224 |
+
[1] Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the Knowledge in a Neural Network. In NeurIPS Deep Learning and Representation Learning Workshop, 2015.
|
| 225 |
+
|
| 226 |
+
[2] Minsoo Kang, Jonghwan Mun, and Bohyung Han. Towards oracle knowledge distillation with neural architecture search. In AAAI, 2020.
|
| 227 |
+
[3] Seyed-Iman Mirzadeh, Mehrdad Farajtabar, Ang Li, and Hassan Ghasemzadeh. Improved knowledge distillation via teacher assistant: Bridging the gap between student and teacher. In AAAI, 2020.
|
| 228 |
+
[4] Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep Mutual Learning. In CVPR, 2018.
|
| 229 |
+
[5] Qiushan Guo, Xinjiang Wang, Yichao Wu, Zhipeng Yu, Ding Liang, Xiaolin Hu, and Ping Luo. Online knowledge distillation via collaborative learning. In CVPR, 2020.
|
| 230 |
+
[6] Guile Wu and Shaogang Gong. Peer collaborative learning for online knowledge distillation. In arXiv 2006.04147, 2020.
|
| 231 |
+
[7] Guobin Chen, Wongun Choi, Xiangdong Chen, Tony X. Han, and Manmohan Krishna Chandraker. Learning Efficient Object Detection Models with Knowledge Distillation. In NeurIPS, 2017.
|
| 232 |
+
[8] Ping Luo, Zhenyao Zhu, Ziwei Liu, Xiaogang Wang, and Xiaoou Tang. Face Model Compression by Distilling Knowledge from Neurons. In AAAI, 2016. [9] Ancong Wu, Wei-Shi Zheng, Xiaowei Guo, and Jian-Huang Lai. Distilled person re-identification: Towards a more scalable system. In CVPR, 2019.
|
| 233 |
+
[10] Huan Wang, Yijun Li, Yuehai Wang, Haoji Hu, and Ming-Hsuan Yang. Collaborative distillation for ultra-resolution universal style transfer. In CVPR, 2020.
|
| 234 |
+
[11] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling BERT for natural language understanding. In arXiv:1909.10351, 2019.
|
| 235 |
+
[12] Jonghwan Mun, Kimin Lee, Jinwoo Shin, and Bohyung Han. Learning to Specialize with Knowledge Distillation for Visual Question Answering. In NeurIPS, 2018.
|
| 236 |
+
[13] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of BERT: smaller, faster, cheaper and lighter. CoRR, 2019.
|
| 237 |
+
[14] Siddhartha Arora, Mitesh M. Khapra, and Harish G. Ramaswamy. On knowledge distillation from complex networks for response prediction. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, NAACL, 2019.
|
| 238 |
+
[15] Fida Mohammad Thoker and Juergen Gall. Cross-modal knowledge distillation for action recognition. In ICIP, 2019.
|
| 239 |
+
[16] Mingmin Zhao, Tianhong Li, Mohammad Abu Alsheikh, Yonglong Tian, Hang Zhao, Antonio Torralba, and Dina Katabi. Through-wall human pose estimation using radio signals. In CVPR, 2018.
|
| 240 |
+
[17] Brady Zhou, Nimit Kalra, and Philipp Krähenbühl. Domain adaptation through task distillation. In ECCV, 2020.
|
| 241 |
+
[18] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. FitNets: Hints for Thin Deep Nets. In ICLR, 2015.
|
| 242 |
+
[19] Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, and Jin Young Choi. A comprehensive overhaul of feature distillation. In ICCV, 2019.
|
| 243 |
+
[20] Sergey Zagoruyko and Nikos Komodakis. Paying More Attention to Attention: Improving the Performance of Convolutional Neural Networks via Attention Transfer. In ICLR, 2017.
|
| 244 |
+
[21] Jangho Kim, SeongUk Park, and Nojun Kwak. Paraphrasing Complex Network: Network Compression via Factor Transfer. In NeurIPS, 2018.
|
| 245 |
+
[22] Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational Knowledge Distillation. In CVPR, 2019.
|
| 246 |
+
[23] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In ICLR, 2020.
|
| 247 |
+
[24] Xu Lan, Xiatian Zhu, and Shaogang Gong. Knowledge Distillation by On-the-Fly Native Ensemble. In NeurIPS, 2018.
|
| 248 |
+
[25] Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In ICCV, 2019.
|
| 249 |
+
[26] Guodong Xu, Ziwei Liu, Xiaoxiao Li, and Chen Change Loy. Knowledge distillation meets self-supervision. In ECCV, 2020.
|
| 250 |
+
[27] Tommaso Furlanello, Zachary Chase Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born-again neural networks. In ICML, 2018.
|
| 251 |
+
[28] Xiao Jin, Baoyun Peng, Yichao Wu, Yu Liu, Jiaheng Liu, Ding Liang, Junjie Yan, and Xiaolin Hu. Knowledge distillation via route constrained optimization. In ICCV, 2019.
|
| 252 |
+
[29] Jang Hyun Cho and Bharath Hariharan. On the efficacy of knowledge distillation. In ICCV, 2019.
|
| 253 |
+
[30] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. Int. J. Comput. Vis., 115(3):211–252, 2015.
|
| 254 |
+
[31] Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images. Technical report, Citeseer, 2009.
|
| 255 |
+
[32] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016.
|
| 256 |
+
[33] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
|
| 257 |
+
[34] Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. In ICLR, 2015.
|
| 258 |
+
[35] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018.
|
| 259 |
+
[36] Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V. Le. Mnasnet: Platform-aware neural architecture search for mobile. In CVPR, 2019.
|
| 260 |
+
[37] Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In ICCV, 2019.
|
| 261 |
+
[38] Sungsoo Ahn, Shell Xu Hu, Andreas C. Damianou, Neil D. Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In CVPR, 2019.
|
| 262 |
+
[39] Nikolaos Passalis and Anastasios Tefas. Learning deep representations with probabilistic knowledge transfer. In ECCV, 2018.
|
| 263 |
+
[40] Byeongho Heo, Minsik Lee, Sangdoo Yun, and Jin Young Choi. Knowledge transfer via distillation of activation boundaries formed by hidden neurons. In AAAI, 2019.
|
| 264 |
+
[41] Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey E. Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
md/train/tKlYQJLYN8v/tKlYQJLYN8v.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DSelect-k: Differentiable Selection in the Mixture of Experts with Applications to Multi-Task Learning
|
| 2 |
+
|
| 3 |
+
Hussein Hazimeh1, Zhe Zhao1, Aakanksha Chowdhery1, Maheswaran Sathiamoorthy1 Yihua Chen1, Rahul Mazumder2, Lichan Hong1, Ed H. Chi1
|
| 4 |
+
|
| 5 |
+
1Google, {hazimeh,zhezhao,chowdhery,nlogn,yhchen,lichan,edchi}@google.com 2Massachusetts Institute of Technology, rahulmaz@mit.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
The Mixture-of-Experts (MoE) architecture is showing promising results in improving parameter sharing in multi-task learning (MTL) and in scaling high-capacity neural networks. State-of-the-art MoE models use a trainable “sparse gate” to select a subset of the experts for each input example. While conceptually appealing, existing sparse gates, such as Top- $\mathbf { \nabla } \cdot \mathbf { k }$ , are not smooth. The lack of smoothness can lead to convergence and statistical performance issues when training with gradientbased methods. In this paper, we develop DSelect-k: a continuously differentiable and sparse gate for MoE, based on a novel binary encoding formulation. The gate can be trained using first-order methods, such as stochastic gradient descent, and offers explicit control over the number of experts to select. We demonstrate the effectiveness of DSelect-k on both synthetic and real MTL datasets with up to 128 tasks. Our experiments indicate that DSelect-k can achieve statistically significant improvements in prediction and expert selection over popular MoE gates. Notably, on a real-world, large-scale recommender system, DSelect-k achieves over $2 2 \%$ improvement in predictive performance compared to Top-k. We provide an open-source implementation of DSelect- $\mathbf { \cdot k } ^ { 1 }$ .
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
The Mixture of Experts (MoE) [14] is the basis of many state-of-the-art deep learning models. For example, MoE-based layers are being used to perform efficient computation in high-capacity neural networks and to improve parameter sharing in multi-task learning (MTL) [32, 22, 21]. In its simplest form, a MoE consists of a set of experts (neural networks) and a trainable gate. The gate assigns weights to the experts on a per-example basis, and the MoE outputs a weighted combination of the experts. This per-example weighting mechanism allows experts to specialize in different partitions of the input space, which has the potential to improve predictive performance and interpretability. In Figure 1 (left), we show an example of a simple MoE architecture that can be used as a standalone learner or as a layer in a neural network.
|
| 14 |
+
|
| 15 |
+
The literature on the MoE has traditionally focused on softmax-based gates, in which all experts are assigned nonzero weights [17]. To enhance the computational efficiency and interpretability of MoE models, recent works use sparse gates that assign nonzero weights to only a small subset of the experts [1, 32, 28, 21]. Existing sparse gates are not differentiable, and reinforcement learning algorithms are commonly used for training [1, 28]. In an exciting work, [32] introduced a new sparse gate (Top-k gate) and proposed training it using stochastic gradient descent (SGD). The ability to train the gate using SGD is appealing because it enables end-to-end training. However, the Top-k gate is not continuous, which can lead to convergence issues in SGD that affect statistical performance (as we demonstrate in our experiments).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (Left): An example of a MoE that can be used as a standalone learner or layer in a neural network. Here “Ei” denotes the $i$ -th expert. (Right): A multi-gate MoE for learning two tasks simultaneously. “Task i NN” is a neural network that generates the output of Task i.
|
| 19 |
+
|
| 20 |
+
In this paper, we introduce DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ : a continuously differentiable and sparse gate for MoE. Given a user-specified parameter $k$ , the gate selects at most $k$ out of the $n$ experts. This explicit control over sparsity leads to a cardinality-constrained optimization problem, which is computationally challenging. To circumvent this challenge, we propose a novel, unconstrained reformulation that is equivalent to the original problem. The reformulated problem uses a binary encoding scheme to implicitly enforce the cardinality constraint. We demonstrate that by carefully smoothing the binary encoding variables, the reformulated problem can be effectively optimized using first-order methods such as SGD. DSelect-k has a unique advantage over existing methods in terms of compactness and computational efficiency. The number of parameters used by DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ is logarithmic in the number of experts, as opposed to linear in existing gates such as Top-k. Moreover, DSelect-k’s output can be computed efficiently via a simple, closed-form expression. In contrast, state-of-the-art differentiable methods for stochastic $\mathbf { k }$ -subset selection and Top-k relaxations, such as [25, $3 9 ] ^ { 2 }$ , require solving an optimization subproblem (for each input example) to compute the gate’s output.
|
| 21 |
+
|
| 22 |
+
DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ supports two gating mechanisms: per-example and static. Per-example gating is the classical gating technique used in MoE models, in which the weights assigned to the experts are a function of the input example [14, 32]. In static gating, a subset of experts is selected and the corresponding weights do not depend on the input [28]. Based on our experiments, each gating mechanism can outperform the other in certain settings. Thus, we study both mechanisms and advocate for experimenting with each.
|
| 23 |
+
|
| 24 |
+
MTL is an important area where MoE models in general, and our gate in particular, can be useful. The goal of MTL is to learn multiple tasks simultaneously by using a shared model. Compared to the usual single task learning, MTL can achieve better generalization performance through exploiting task relationships [4]. One key problem in MTL is how to share model parameters between tasks [30]. For instance, sharing parameters between unrelated tasks can potentially degrade performance. The multi-gate MoE [22] is a flexible architecture that allows for learning what to share between tasks. Figure 1 (right) shows an example of a multi-gate MoE, in the simple case of two tasks. Here, each task has its own gate that adaptively controls the extent of parameter sharing. In our experiments, we study the effectiveness of DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ in the context of the multi-gate MoE.
|
| 25 |
+
|
| 26 |
+
Contributions: On a high-level, our main contribution is DSelect-k: a new continuously differentiable and sparse gate for MoE, which can be directly trained using first-order methods. Our technical contributions can be summarized as follows. (i) The gate selects (at most) $k$ out of the $n$ experts, where $k$ is a user-specified parameter. This leads to a challenging, cardinality-constrained optimization problem. To deal with this challenge, we develop a novel, unconstrained reformulation, and we prove that it is equivalent to the original problem. The reformulation uses a binary encoding scheme that implicitly imposes the cardinality constraint using learnable binary codes. (ii) To make the unconstrained reformulation smooth, we relax and smooth the binary variables. We demonstrate that, with careful initialization and regularization, the resulting problem can be optimized with first-order methods such as SGD. (iii) We carry out a series of experiments on synthetic and real MTL datasets, which show that our gate is competitive with state-of-the-art gates in terms of parameter sharing and predictive performance. (iv) We provide an open-source implementation of DSelect-k.
|
| 27 |
+
|
| 28 |
+
# 1.1 Related Work
|
| 29 |
+
|
| 30 |
+
MoE and Conditional Computation: Since MoE was introduced by [14], an exciting body of work has extended and studied this model, e.g., see [17, 13, 16]. Recently, MoE-based models are showing success in deep learning. For example, [32] introduced the sparse Top-k gate for MoE and showed significant computational improvements on machine translation tasks; we discuss exact connections to this gate in Section 2. The Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate has also been utilized in several state-of-the-art deep learning models that considered MTL tasks, e.g., [21, 27, 9]. Our work is also related to the conditional computation models that activate parts of the neural network based on the input [2, 1, 32, 12, 35]. Unlike DSelect-k, these works are based on non-differentiable models, or heuristics where the training and inference models are different.
|
| 31 |
+
|
| 32 |
+
Stochastic $\mathbf { k }$ -Subset Selection and Top-k Relaxation: A related line of work focuses on stochastic $\mathbf { k }$ -subset selection in neural networks, e.g., see [25, 5, 38] and the references therein. Specifically, these works propose differentiable methods for sampling $k$ -subsets from a categorical distribution, based on extensions or generalizations of the Gumbel-softmax trick [23, 15]. However, in the MoE we consider deterministic subset selection—determinism is a common assumption in MoE models that can improve interpretability and allows for efficient implementations [14, 17, 32]. In contrast, the stochastic approaches described above are suitable in applications where there is an underlying sampling distribution, such as in variational inference [19]. Another related work is the differentiable relaxation of the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ operator proposed by [39]. All the aforementioned works perform dense training (i.e., the gradients of all experts, even if not selected, will have to be computed during backpropagation), whereas DSelect-k can (to an extent) exploit sparsity to speed up training, as we will discuss in Sections 2 and 3. Moreover, the stochastic $\mathbf { k }$ -subset selection framework in [25] (which encompasses several previous works) and the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ relaxation in [39] require solving an optimization subproblem to compute the gate output–each example will require solving a separate subproblem in the per-example gating setting, which can be computationally prohibitive. In contrast, DSelect-k’s output is computed efficiently via a closed-form expression.
|
| 33 |
+
|
| 34 |
+
Sparse Transformations to the Simplex: These are sparse variants of the softmax function that can output sparse probability vectors, e.g., see [24, 26, 6, 3]. While similar to our work in that they output sparse probability vectors, these transformations cannot control the sparsity level precisely as DSelect-k does (through a cardinality constraint). Thus, these transformations may assign some examples or tasks sparse combinations and others dense combinations.
|
| 35 |
+
|
| 36 |
+
MTL: In Appendix A, we review related literature on MTL.
|
| 37 |
+
|
| 38 |
+
# 2 Gating in the Mixture of Experts
|
| 39 |
+
|
| 40 |
+
In this section, we first review the MoE architecture and popular gates, and then discuss how these gates compare to our proposal. We will assume that the inputs to the MoE belong to a space $\mathcal { X } \subset \mathbb { R } ^ { p }$ . In its simplest form, the MoE consists of a set of $n$ experts (neural networks) $f _ { i } : \mathcal { X } \to \mathbb { R } ^ { u }$ , $i \in \{ 1 , 2 , \ldots , n \}$ , and a gate $g : \mathcal { X } \mathbb { R } ^ { n }$ that assigns weights to the experts. The gate’s output is assumed to be a probability vector, i.e., $g ( x ) \geq 0$ and $\begin{array} { r } { \sum _ { i = 1 } ^ { n ^ { \prime } } g ( x ) _ { i } = 1 } \end{array}$ , for any $x \in \mathcal { X }$ . Given an example $x \in \mathcal { X }$ , the corresponding output of the MoE is a weighted combination of the experts:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\sum _ { i = 1 } ^ { n } f _ { i } ( x ) g ( x ) _ { i } .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Next, we discuss two popular choices for the gate $g ( . )$ that can be directly optimized using SGD.
|
| 47 |
+
|
| 48 |
+
Softmax Gate: A classical model for $g ( x )$ is the softmax gate: $\sigma ( A x + b )$ , where $\sigma ( . )$ is the softmax function, $A \in \mathbb { R } ^ { n \times p }$ is a trainable weight matrix, and $b \in \mathbb { R } ^ { n }$ is a bias vector [17]. This gate is dense, in the sense that all experts are assigned nonzero probabilities. Note that static gating (i.e., gating which does not depend on the input example) can be obtained by setting $A = 0$ .
|
| 49 |
+
|
| 50 |
+
Top-k Gate: This is a sparse variant of the softmax gate that returns a probability vector with only $\mathrm { k }$ nonzero entries [32]. The Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate is defined by $\sigma ( K e e p T o p K ( A x + b ) )$ , where for any vector $v$ $K e e p T o p K ( v ) _ { i } : = v _ { i }$ if $v _ { i }$ is in the top $\mathrm { k }$ elements of $v$ , and $K e e p T o p K ( v ) _ { i } : = - \infty$ otherwise3. This gate is conceptually appealing since it allows for direct control over the number of experts to select and is trained using SGD. Moreover, the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate supports conditional training: in backpropagation, for each input example, only the gradients of the loss w.r.t. top $\mathbf { k }$ elements need to be computed. With a careful implementation, conditional training can lead to computational savings. However, the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate is not continuous, which implies that the gradient does not exist at certain inputs. This can be problematic when training is done using gradient-based methods. To gain more insight, in Figure 2 (left), we plot the expert weights chosen by the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate during training with SGD. The results indicate an oscillatory behavior in the output of the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gate, which can be attributed to its discontinuous nature: a small change in the input can lead to “jumps” in the output.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Expert weights output by Top- $\mathbf { \nabla } \cdot \mathbf { k }$ (left) and DSelect-k (right) during training on synthetic data generated from a MoE, under static gating. Each color represents a separate expert. Here DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ recovers the true experts used by the data-generating model, whereas Top-k does not recover and exhibits oscillatory behavior. See Appendix C.2 for details on the data and setup.
|
| 54 |
+
|
| 55 |
+
Comparison with DSelect-k: We develop DSelect-k in Section 3. Here we present a high-level comparison between DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ and Top-k. Similar to Top-k, DSelect-k can select $k$ out of the $n$ experts and can be trained using gradient-based optimization methods. A major advantage of DSelectk over Top- $\mathbf { \nabla } \cdot \mathbf { k }$ is that it is continuously differentiable, which leads to more stable selection of experts during training—see Figure 2 (right). During inference, DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ only needs to evaluate a subset of the experts, which can lead to computational savings. However, DSelect-k supports conditional training only partially. At the start of training, it uses all the available experts, so conditional training is not possible. As we discuss in Section 3, after a certain point during training, DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ converges to a small subset of the experts, and then conditional training becomes possible. Our experiments indicate that DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ can have a significant edge over Top- $\mathbf { \nabla } \cdot \mathbf { k }$ in terms of prediction and expert selection performance, so the full support for conditional training in Top- $\mathbf { \nabla } \cdot \mathbf { k }$ seems to come at the expense of statistical performance.
|
| 56 |
+
|
| 57 |
+
# 3 Differentiable and Sparse Gating
|
| 58 |
+
|
| 59 |
+
In this section, we develop DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ , for both the static and per-example gating settings. First, we introduce the problem setup and notation. To simplify the presentation, we will develop the gate for a single supervised learning task, and we note that the same gate can be used in MTL models. We assume that the task has an input space $\mathcal { X } \subset \mathbb { R } ^ { p }$ , an output space $\mathcal { V }$ , and an associated loss function $\ell : \mathcal { V } \times \mathbb { R } \to \mathbb { R }$ . We denote the set of $N$ training examples by $\mathcal { D } = \{ ( x _ { i } , y _ { i } ) \in \mathcal { X } \times \mathcal { Y } \} _ { i = 1 } ^ { N }$ . We consider a learning model defined by the MoE in Equation (1). For simplicity, we assume that the experts are scalar-valued and belong to a class of continuous functions $\mathcal { H }$ . We assume that the number of experts $n = 2 ^ { m }$ for some integer $m$ —in Appendix B.2, we discuss how the gate can be extended to arbitrary $n$ . For convenience, given a non-negative integer $i$ , we denote the set $\{ 1 , 2 , \ldots , i \}$ by [i].
|
| 60 |
+
|
| 61 |
+
In Section 3.1, we develop DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ for static gating setting. Then, in Section 3.2, we generalize it to the per-example setting.
|
| 62 |
+
|
| 63 |
+
# 3.1 DSelect-k for Static Gating
|
| 64 |
+
|
| 65 |
+
Our goal here is to develop a static gate that selects a convex combination of at most $k$ out of the $n$ experts. The output of the gate can be thought of as a probability vector $w$ with at most $k$ nonzero entries, where $w _ { i }$ is the weight assigned to the expert $f _ { i }$ . A natural way to minimize the empirical risk of the MoE model is by solving the following problem:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r l } { \underset { f _ { 1 } , \ldots f _ { n } , w } { \mathrm { m i n } } } & { \displaystyle \frac { 1 } { N } \sum _ { ( x , y ) \in { \cal D } } \ell \Big ( y , \displaystyle \sum _ { i = 1 } ^ { n } f _ { i } ( x ) w _ { i } \Big ) } \\ { \mathrm { s . t . } } & { \| w \| _ { 0 } \leq k } \\ & { \displaystyle \sum _ { i = 1 } ^ { n } w _ { i } = 1 , w \geq 0 . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
In the above, the $L _ { 0 }$ norm of $w$ , $\| w \| _ { 0 }$ , is equal to the number of nonzero entries in $w$ . Thus, the cardinality constraint (2b) ensures that the gate selects at most $k$ experts. Problem (2) is a combinatorial optimization problem that is not amenable to SGD due to the cardinality constraint (2b) and the simplex constraints in (2c). In what follows of this section, we first transform Problem (2) into an equivalent unconstrained optimization problem, based on a binary encoding scheme. However, the unconstrained problem cannot be directly handled using SGD due to the presence of binary variables. Thus, in a second transformation, we smooth the binary variables, which leads to an optimization problem that is amenable to SGD.
|
| 72 |
+
|
| 73 |
+
Road map: In Section 3.1.1, we introduce the single expert selector: a construct for choosing 1 out of $n$ experts by using binary encoding. In Section 3.1.2, we leverage the single expert selector to transform Problem (2) into an unconstrained one. Then, in Section 3.1.3, we smooth the unconstrained problem and discuss how SGD can be applied.
|
| 74 |
+
|
| 75 |
+
# 3.1.1 Single Expert Selection using Binary Encoding
|
| 76 |
+
|
| 77 |
+
The single expert selector (selector, for short) is a fundamental construct that we will later use to convert Problem (2) to an unconstrained optimization problem. At a high-level, the single expert selector chooses the index of 1 out of the $n$ experts and returns a one-hot encoding of the choice. For example, in the case of 4 experts, the selector can choose the first expert by returning the binary vector $[ 1 \dot { 0 } 0 0 ] ^ { T }$ . Generally, the selector can choose any of the experts, and its choice is determined by a set of binary encoding variables, as we will describe next.
|
| 78 |
+
|
| 79 |
+
The selector is parameterized by $m$ (recall that $m = \log _ { 2 } n )$ binary variables, $z _ { 1 } , z _ { 2 } , \ldots , z _ { m }$ , where we view these variables collectively as a binary number: $z _ { m } z _ { m - 1 } \ldots z _ { 1 }$ . The integer represented by the latter binary number determines which expert to select. More formally, let $l$ be the integer represented by the binary number $z _ { m } z _ { m - 1 } \ldots z _ { 1 }$ . The selector is a function $r : \dot { \mathbb { R } ^ { m } } \to \{ 0 , 1 \} ^ { n }$ which maps $z : = [ \dot { z _ { 1 } } , z _ { 2 } , \dots , \dot { z _ { m } } ] ^ { T }$ to a one-hot encoding of the integer $( l + 1 )$ . For example, if all the $z _ { i }$ ’s are 0, then the selector returns a one-hot encoding of the integer 1. Next, we define the selector $r ( z )$ . For easier exposition, we start with the special case of 4 experts and then generalize to $n$ experts.
|
| 80 |
+
|
| 81 |
+
Special case of 4 experts: In this case, the selector uses two binary variables $z _ { 1 }$ and $z _ { 2 }$ . Let $l$ be the integer represented by the binary number $z _ { 2 } z _ { 1 }$ . Then, the selector should return a one-hot encoding of the integer $( l + 1 )$ . To achieve this, we define the selector $r ( z )$ as follows:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
r ( z ) = \left[ \bar { z _ { 1 } } \bar { z _ { 2 } } , z _ { 1 } \bar { z _ { 2 } } , \bar { z _ { 1 } } z _ { 2 } , z _ { 1 } z _ { 2 } \right] ^ { T }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\bar { z } _ { i } : = 1 - z _ { i }$ . By construction, exactly one entry in $r ( z )$ is 1 (specifically, $r ( z ) _ { l + 1 } = 1 ,$ ) and the rest of the entries are zero. For example, if $z _ { 1 } = z _ { 2 } = 0$ , then $r ( z ) _ { 1 } = 1$ and $r ( z ) _ { i } = 0$ , $i \in \{ 2 , 3 , 4 \}$ .
|
| 88 |
+
|
| 89 |
+
General case of $n$ experts: Here we generalize the selector $r ( z )$ to the case of $n$ experts. To aid in the presentation, we make the following definition. For any non-negative integer $l$ , we define $B ( l )$ as the set of indices of the nonzero entries in the binary representation of $l$ (where we assume that the least significant bit is indexed by 1). For example, $\bar { B ( 0 ) } = \varnothing , \bar { B ( 1 ) } = \{ 1 \} , \bar { B ( 2 ) } = \{ $ , and $B ( 3 ) = \{ 1 , \bar { 2 } \}$ . For every $i \in [ n ]$ , we define the $i$ -th entry of $r ( z )$ as follows:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
r ( z ) _ { i } = \prod _ { j \in \mathcal { B } ( i - 1 ) } ( z _ { j } ) \prod _ { j \in [ m ] \setminus \mathcal { B } ( i - 1 ) } ( 1 - z _ { j } )
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
In the above, $r ( z ) _ { i }$ is a product of $m$ binary variables, which is equal to 1 iff the integer $( i - 1 )$ is represented by the binary number $z _ { m } z _ { m - 1 } \ldots z _ { 1 }$ . Therefore, $r ( z )$ returns a one-hot encoding of the index of the selected expert. Note that when $n = 4$ , definitions (3) and (4) are equivalent.
|
| 96 |
+
|
| 97 |
+
# 3.1.2 Multiple Expert Selection via Unconstrained Minimization
|
| 98 |
+
|
| 99 |
+
In this section, we develop a combinatorial gate that allows for transforming Problem (2) into an unconstrained optimization problem. We design this gate by creating $k$ instances of the single expert selector $r ( . )$ , and then taking a convex combination of these $k$ instances. More formally, for every $i \in [ k ]$ , let $\mathcal { z } ^ { ( i ) } \in \{ 0 , 1 \} ^ { m }$ be a (learnable) binary vector, so that the output of the $i$ -th instance of the selector is $r \big ( z ^ { ( i ) } \big )$ . Let $Z$ be a $k \times m$ matrix whose $i$ -th row is $z ^ { ( i ) }$ . Moreover, let $\boldsymbol { \alpha } \in \mathbb { R } ^ { k }$ be a vector of learnable parameters. We define the combinatorial gate $q$ as follows:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\boldsymbol { q } ( \alpha , Z ) = \sum _ { i = 1 } ^ { k } \sigma ( \alpha ) _ { i } r ( \boldsymbol { z } ^ { ( i ) } ) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where we recall that $\sigma ( . )$ is the softmax function. Since for every $i \in [ k ]$ , $r \big ( z ^ { ( i ) } \big )$ is a one-hot vector, we have $\| q ( \alpha , Z ) \| _ { 0 } \leq k$ . Moreover, since the weights of the selectors are obtained using a softmax, we have $q ( \alpha , Z ) \ge 0$ and $\begin{array} { r } { \sum _ { i = 1 } ^ { n } q ( \alpha , Z ) _ { i } = 1 } \end{array}$ . Thus, $q ( \alpha , Z )$ has the same interpretation of $w$ in Problem (2), without requiring any constraints. Therefore, we propose replacing $w$ in the objective of Problem (2) with $q ( \alpha , Z )$ and removing all the constraints. This replacement leads to an equivalent unconstrained optimization problem, as we state in the next proposition.
|
| 106 |
+
|
| 107 |
+
Proposition 1. Problem (2) is equivalent4 to:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { c l } { \displaystyle \underset { f _ { 1 } , \ldots f _ { n } , \alpha , Z } { \operatorname* { m i n } } } & { \displaystyle \frac { 1 } { N } \sum _ { ( x , y ) \in { \mathcal { D } } } \ell \Big ( y , \displaystyle \sum _ { i = 1 } ^ { n } f _ { i } ( x ) q ( \alpha , Z ) _ { i } \Big ) } \\ & { z ^ { ( i ) } \in \{ 0 , 1 \} ^ { m } , ~ i \in [ k ] } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
The proof of Proposition 1 is in Appendix B.1. Unlike Problem (2), Problem (5) does not involve any constraints, aside from requiring binary variables. However, these binary variables cannot be directly handled using first-order methods. Next, we discuss how to smooth the binary variables in order to obtain a continuous relaxation of Problem (5).
|
| 114 |
+
|
| 115 |
+
# 3.1.3 Smooth Gating
|
| 116 |
+
|
| 117 |
+
In this section, we present a procedure to smooth the binary variables in Problem (5) and discuss how the resulting problem can be optimized using first-order methods. The procedure relies on the smooth-step function, which we define next.
|
| 118 |
+
|
| 119 |
+
Smooth-step Function: This is a continuously differentiable and S-shaped function, similar in shape to the logistic function. However, unlike the logistic function, the smooth-step function can output 0 and 1 exactly for sufficiently large magnitudes of the input. The smooth-step and logistic functions are depicted in Appendix B.3. More formally, given a non-negative scaling parameter $\gamma$ the smooth-step function, $S : \mathbb { R } \mathbb { R }$ , is a cubic piecewise polynomial defined as follows:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
S ( t ) = \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t \leq - \gamma / 2 } \\ { - \frac { 2 } { \gamma ^ { 3 } } t ^ { 3 } + \frac { 3 } { 2 \gamma } t + \frac { 1 } { 2 } } & { \mathrm { i f ~ } - \gamma / 2 \leq t \leq \gamma / 2 } \\ { 1 } & { \mathrm { i f ~ } t \geq \gamma / 2 } \end{array} \right.
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
The parameter $\gamma$ controls the width of the fractional region (i.e., the region where the function is strictly between 0 and 1). Note that $S ( t )$ is continuously differentiable at all points—this follows since at the boundary points $\pm \gamma / 2$ , we have: $S ^ { \prime } ( - \gamma / 2 ) \stackrel { } { = } S ^ { \prime } ( \gamma / 2 ) = 0$ . This function has been recently used for conditional computation in soft trees [11] and is popular in the computer graphics literature [8, 29].
|
| 126 |
+
|
| 127 |
+
Smoothing: We obtain DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ from the combinatorial gate $q ( \alpha , Z )$ by (i) relaxing every binary variable in $Z$ to be continuous in the range $( - \infty , + \infty )$ , i.e., $Z \in \mathbb { R } ^ { k \times m }$ , and (ii) applying the smooth-step function to $Z$ element-wise. Formally, DSelect-k is a function $\tilde { q }$ defined as follows:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\tilde { q } ( \alpha , Z ) : = q ( \alpha , S ( Z ) ) = \sum _ { i = 1 } ^ { k } \sigma ( \alpha ) _ { i } r \bigl ( S ( z ^ { ( i ) } ) \bigr ) ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where the matrix $S ( Z )$ is obtained by applying $S ( \cdot )$ to $Z$ element-wise. Note that $\tilde { q } ( \alpha , Z )$ is continuously differentiable so it is amenable to first-order methods. If $S ( Z )$ is binary, then $\tilde { q } ( \alpha , Z )$
|
| 134 |
+
|
| 135 |
+
selects at most $k$ experts (this holds since $\tilde { q } ( \alpha , Z ) = q ( \alpha , S ( Z ) )$ , and from Section 3.1.2, $q$ selects at most $k$ experts when its encoding matrix is binary). However, when $S ( Z )$ has any non-binary entries, then more than $k$ experts can be potentially selected, meaning that the cardinality constraint will not be respected. In what follows, we discuss how the gate can be optimized using first-order methods, while ensuring that $S ( Z )$ converges to a binary matrix so that the cardinality constraint is enforced.
|
| 136 |
+
|
| 137 |
+
We propose using $\tilde { q } ( \alpha , Z )$ in MoE, which leads to the following optimization problem:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\operatorname* { m i n } _ { f _ { 1 } , \dots f _ { n } , \alpha , Z } \quad \frac { 1 } { N } \sum _ { ( x , y ) \in \mathcal { D } } \ell \Big ( y , \sum _ { i = 1 } ^ { n } f _ { i } ( x ) \tilde { q } ( \alpha , Z ) _ { i } \Big ) .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
Problem (7) can be viewed as a continuous relaxation of Problem (5). If the experts are differentiable, then the objective of Problem (7) is differentiable. Thus, we propose optimizing MoE end-to-end using first-order methods. We note that $\tilde { q } ( \alpha , Z )$ uses $\left( k + k \log n \right)$ learnable parameters. In contrast, the Top- $\mathbf { \nabla } \cdot \mathbf { k }$ and softmax gates (discussed in Section 2) use $n$ parameters. Thus, for relatively small $k$ , our proposal uses a smaller number of parameters. Next, we discuss how DSelect-k’s parameters should be initialized in order to ensure that it is trainable.
|
| 144 |
+
|
| 145 |
+
Initialization: By the definition of the smooth-step function, if $S ( Z _ { i j } )$ is binary then $S ^ { \prime } ( Z _ { i j } ) = 0$ , and consequently $\begin{array} { r } { \frac { \partial \ell } { \partial Z _ { i j } } = 0 } \end{array}$ . This implies that, during optimization, if $S ( Z _ { i j } )$ becomes binary, the variable $Z _ { i j }$ will not be updated in any subsequent iteration. Thus, we have to be careful about the initialization of $Z$ . For example, if $Z$ is initialized so that $S ( Z )$ is a binary matrix then the gate will not be trained. To ensure that the gate is trainable, we initialize each $Z _ { i j }$ so that $0 < S ( Z _ { i j } ) < 1$ . This way, the $Z _ { i j }$ ’s can have nonzero gradients at the start of optimization.
|
| 146 |
+
|
| 147 |
+
Accelerating Convergence to Binary Solutions: Recall that we need $S ( Z )$ to converge to a binary matrix, in order for the gate $\tilde { q }$ to respect the cardinality constraint (i.e., to select at most $k$ experts). Empirically, we observe that if the optimizer runs for a sufficiently large number of iterations, then $S ( Z )$ typically converges to a binary matrix. However, early stopping of the optimizer can be desired in practice for computational and statistical considerations, and this can prevent $S ( Z )$ from converging. To encourage faster convergence towards a binary $S ( Z )$ , we will add an entropy regularizer to Problem (7). The following proposition is needed before we introduce the regularizer.
|
| 148 |
+
|
| 149 |
+
Proposition 2. For any $z \in \mathbb { R } ^ { m }$ , $\alpha \in \mathbb { R } ^ { k }$ , and $Z \in \mathbb { R } ^ { k \times m }$ , $r ( S ( z ) )$ and $\tilde { q } ( \alpha , Z )$ belong to the probability simplex.
|
| 150 |
+
|
| 151 |
+
The proof of the proposition is in Appendix B.1. Proposition 2 implies that, during training, the output of each single expert selector used by $\tilde { q } ( \alpha , Z )$ , i.e., $r ( S ( z ^ { ( i ) } ) )$ for $i \in [ k ]$ , belongs to the probability simplex. Note that the entropy of each $r ( S ( z ^ { ( i ) } ) )$ is minimized by any one-hot encoded vector. Thus, for each $r ( S ( z ^ { ( i ) } ) )$ , we add an entropy regularization term that encourages convergence towards one-hot encoded vectors; equivalently, this encourages convergence towards a binary $S ( Z )$ . Specifically, we solve the following regularized variant of Problem (7):
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\operatorname* { m i n } _ { f _ { 1 } , \dots f _ { n } , \alpha , Z } \quad \sum _ { ( x , y ) \in \mathcal { D } } \frac { 1 } { N } \ell \Big ( y , \sum _ { i = 1 } ^ { n } f _ { i } ( x ) \tilde { q } ( \alpha , Z ) _ { i } \Big ) + \lambda \Omega ( Z )
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $\begin{array} { r } { \Omega ( Z ) : = \sum _ { i = 1 } ^ { k } h \big ( r ( S ( z ^ { ( i ) } ) ) \big ) } \end{array}$ and $h ( . )$ is the entropy function. The hyperparameter $\lambda$ is non-negative and controls how fast each selector converges to a one-hot encoding. In our experiments, we tune over a range of $\lambda$ values. When selecting the best hyperparameters from tuning, we disregard any $\lambda$ whose corresponding solution does not have a binary $S ( Z )$ . In Appendix C.3, we report the number of training steps required for $S ( Z )$ to converge to a binary matrix, on several real datasets. Other alternatives to ensure that $S ( Z )$ converges to a binary matrix are also possible. One alternative is to regularize the entropy of each entry in $S ( Z )$ separately. Another alternative is to anneal the parameter $\gamma$ of the smooth-step function towards zero.
|
| 158 |
+
|
| 159 |
+
Softmax-based Alternative to Binary Encoding: Recall that our proposed selectors in (6), i.e., $r \big ( S ( z ^ { ( i ) } ) \big ) , i \in [ k ]$ , learn one-hot vectors exactly (by using binary encoding). One practical alternative for learning a one-hot vector is by using a softmax function with temperature annealing. Theoretically, this alternative cannot return a one-hot vector, but after training, the softmax output can be transformed to a one-hot vector using a heuristic (e.g., by taking an argmax). In Appendix C.1, we perform an ablation study in which we replace the selectors in DSelect-k with softmax functions (along with temperature annealing or entropy regularization).
|
| 160 |
+
|
| 161 |
+
# 3.2 DSelect-k for Per-example Gating
|
| 162 |
+
|
| 163 |
+
In this section, we generalize the static version of DSelect- $\mathbf { \cdot k }$ , $\tilde { q } ( \alpha , Z )$ , to the per-example gating setting. The key idea is to make the gate’s parameters $\alpha$ and $Z$ functions of the input, so that the gate can make decisions on a per-example basis. Note that many functional forms are possible for these parameters. For simplicity and based on our experiments, we choose to make $\alpha$ and $Z$ linear functions of the input example. More formally, let $\bar { G } \in \mathbb { R } ^ { k \times p }$ , $W ^ { ( i ) } \in \mathbb { R } ^ { m \times p }$ , $i \in [ k ]$ , be a set of learnable parameters. Given an input example $x \in \mathbb { R } ^ { p }$ , we set $\alpha = G x$ and $z ^ { ( i ) } = W ^ { ( i ) } x$ in $\tilde { q } ( \alpha , Z )$ (to simplify the presentation, we do not include bias terms). Thus, the per-example version of DSelect- $\mathbf { k }$ is a function $v$ defined as follows:
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
v ( G , W , x ) = \sum _ { i = 1 } ^ { k } \sigma ( G x ) _ { i } r \big ( S ( W ^ { ( i ) } x ) \big ) .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
In the above, the term $r \big ( S ( W ^ { ( i ) } x ) \big )$ represents the $i$ -th single expert selector, whose output depends on the example $x$ ; thus different examples are free to select different experts. The term $\sigma ( G x ) _ { i }$ determines the input-dependent weight assigned to the $i$ -th selector. The gate $v ( G , W , x )$ is continuously differentiable in the parameters $G$ and $W$ , so we propose optimizing it using first-order methods. Similar to the case of static gating, if $S ( W ^ { ( i ) } x )$ is binary for all $i \in [ k ]$ , then each $r \big ( S ( W ^ { ( i ) } x ) \big )$ will select exactly one expert, and the example $x$ will be assigned to at most $k$ experts.
|
| 170 |
+
|
| 171 |
+
To encourage $S ( W ^ { ( i ) } x )$ , $i \in [ k ]$ to become binary, we introduce an entropy regularizer, similar in essence to that in static gating. However, unlike static gating, the regularizer here should be on a per-example basis, so that each example respects the cardinality constraint. By Proposition 2, for any $i \in [ k ]$ , $r \big ( S ( W ^ { ( i ) } x ) \big )$ belongs to the probability simplex. Thus, for each example $x$ in the training data, we introduce a regularization term of the form: $\begin{array} { r } { \Omega ( W , x ) : = \sum _ { i \in [ k ] } h \Big ( r \big ( S ( W ^ { ( i ) } x ) \big ) \Big ) } \end{array}$ , and minimize the following objective function:
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\sum _ { ( x , y ) \in \mathcal { D } } \bigg ( \frac { 1 } { N } \ell \Big ( y , \sum _ { i = 1 } ^ { n } f _ { i } ( x ) v ( G , W , x ) _ { i } \Big ) + \lambda \Omega ( W , x ) \bigg ) ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where $\lambda$ is a non-negative hyperparameter. Similar to the case of static gating, we tune over a range of $\lambda$ values, and we only consider the choices of $\lambda$ that force the average number of selected experts per example to be less than or equal to $k$ . If the application requires that the cardinality constraint be satisfied strictly for every example (not only on average), then annealing $\gamma$ in the smooth-step function towards zero enforces this.
|
| 178 |
+
|
| 179 |
+
# 4 Experiments
|
| 180 |
+
|
| 181 |
+
We study the performance of DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ in the context of MTL and compare with state-of-the-art gates and baselines. In the rest of this section, we present experiments on the following real MTL datasets: MovieLens, Multi-MNIST, Multi-Fashion MNIST, and on a real-world, large-scale recommender system. Moreover, in Appendix C, we present an additional experiment on synthetic data (with up to 128 tasks), in which we study statistical performance and perform ablation studies.
|
| 182 |
+
|
| 183 |
+
Competing Methods: We focus on a multi-gate MoE, and study the DSelect-k and Top-k gates in both the static and per-example gating settings. For static gating, we also consider a Gumbelsoftmax based gate [33]–unlike DSelect-k this gate cannot control the sparsity level explicitly (see the supplementary for details). In addition, we consider two MTL baselines. The first baseline is a MoE with a softmax gate (which uses all the available experts). The second is a shared bottom model [4], where all tasks share the same bottom layers, which are in turn connected to task-specific neural nets.
|
| 184 |
+
|
| 185 |
+
Experimental Setup: All competing models were implemented in TensorFlow 2. We used Adam [18] and Adagrad [7] for optimization, and we tuned the key hyperparameters using random grid search (with an average of 5 trials per grid point). Full details on the setup are in Appendix D.
|
| 186 |
+
|
| 187 |
+
# 4.1 MovieLens
|
| 188 |
+
|
| 189 |
+
Dataset: MovieLens [10] is a movie recommendation dataset containing records for 4,000 movies and 6,000 users. Following [36], for every user-movie pair, we construct two tasks. Task 1 is a binary classification problem for predicting whether the user will watch a particular movie. Task 2 is a regression problem to predict the user’s rating (in $\{ 1 , 2 , \ldots , 5 \} )$ ) for a given movie. We use 1.6 million examples for training and 200, 000 for each of the validation and testing sets.
|
| 190 |
+
|
| 191 |
+
Experimental Details: We use the cross-entropy and squared error losses for tasks 1 and 2, respectively. We optimize a weighted average of the two losses, i.e., the final loss function is $\bar { \alpha } ( \mathrm { L o s s \ o f \ T a s k \ 1 } ) \bar { + } ( 1 - \alpha ) ( \mathrm { L o s s \ o f \ T a s k \ 2 } ) ,$ , and we report the results for $\alpha \in \{ 0 . 1 , 0 . 5 , 0 . 9 \}$ . The same loss function is also used for tuning and testing. The architecture consists of a multi-gate MoE with 8 experts, where each of the experts and the task-specific networks is composed of ReLUactivated dense layers. For each $\alpha$ , we tune over the optimization and gate-specific hyperparameters, including the number of experts to select (i.e., k in DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ and Top-k). After tuning, we train each model for 100 repetitions (using random initialization) and report the averaged results. For full details, see Appendix D.1.
|
| 192 |
+
|
| 193 |
+
Results: In Table 1, we report the test loss and the average number of selected experts. The results indicate that for all values of $\alpha$ , either one of our DSelect-k gates (static or per-example) outperforms the competing methods, in terms of both the test loss and the number of selected experts. In the static gating setting, there does not seem to be a clear winner among the three competing methods (Top- $\mathbf { \nabla } \cdot \mathbf { k }$ , DSelect-k, and Gumbel Softmax), but we note that DSelect-k outperforms both Top- $\mathbf { \nabla } \cdot \mathbf { k }$ and Gumbel Softmax for two out of the three choices of $\alpha$ . Notably, the softmax MoE is uniformly outperformed by the DSelect-k and Top- $\mathbf { \nabla } \cdot \mathbf { k }$ gates, so sparsity in gating seems to be beneficial on this dataset. Our hypothesis is that softmax MoE is overfitting and the sparse gating methods are mitigating this issue. In Table C.2 in the appendix, we additionally report the individual task metrics (loss and accuracy).
|
| 194 |
+
|
| 195 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="2">α=0.1</td><td colspan="2">a=0.5</td><td colspan="2">α=0.9</td></tr><tr><td>Loss</td><td>Experts</td><td>Loss</td><td>Experts</td><td>Loss</td><td>Experts</td></tr><tr><td rowspan="3">Static</td><td>DSelect-k</td><td>4015±5</td><td>2.7</td><td>3804±3</td><td>1.5</td><td>3690±2</td><td>1.3</td></tr><tr><td>Top-k</td><td>4012±4</td><td>2.0</td><td>3818±2</td><td>2.0</td><td>3693±6</td><td>2.0</td></tr><tr><td>Gumbel Softmax</td><td>4171±3</td><td>2.7</td><td>3898±2</td><td>2.6</td><td>3688±4</td><td>3.6</td></tr><tr><td rowspan="2">Per-example</td><td>DSelect-k</td><td>4006±6</td><td>1.5</td><td>3823±3</td><td>1.2</td><td>3679±2</td><td>1.1</td></tr><tr><td>Top-k</td><td>4027±8</td><td>2.0</td><td>3841±4</td><td>2.0</td><td>3741±3</td><td>2.0</td></tr><tr><td rowspan="2">Baselines</td><td>Softmax MoE</td><td>4090±1</td><td>8.0</td><td>3960±3</td><td>8.0</td><td>3847±10</td><td>8.0</td></tr><tr><td>Shared Bottom</td><td>4037± 2</td><td>-</td><td>3868±2</td><td>-</td><td>3687±1</td><td>-</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Table 1: Test loss (with standard error) and average number of selected experts on MovieLens. The parameter $\alpha$ is the weight of Task 1’s loss (see text for details). The test loss is multiplied by $1 0 ^ { 4 }$ .
|
| 198 |
+
|
| 199 |
+
# 4.2 Multi-MNIST and Multi-Fashion MNIST
|
| 200 |
+
|
| 201 |
+
Datasets: We consider two image classification datasets: Multi-MNIST and Multi-Fashion [31], which are multi-task variants of the MNIST [20] and Fashion MNIST [37] datasets. We construct the Multi-MNIST dataset similar to [31]: uniformly sample two images from MNIST and overlay them on top of each other, and (ii) shift one digit towards the top-left corner and the other digit towards the bottom-right corner (by 4 pixels in each direction). This procedure leads to $3 6 \times 3 6$ images with some overlap between the digits. The Multi-Fashion is constructed in a similar way by overlaying images from the Fashion MNIST dataset. For each dataset, we consider two classification tasks: Task 1 is to classify the top-left item and Task 2 is to classify the bottom-right item. We use 100,000 examples for training, and 20,000 examples for each of the validation and testing sets.
|
| 202 |
+
|
| 203 |
+
Experimental Details: We use cross-entropy loss for each task and optimize the sum of the losses5. The model is a multi-gate MoE with 8 experts, where each expert is a convolutional neural network and each task-specific network is composed of a number of dense layers. We tune the optimization and gate-specific hyperparameters, including the number of experts to select, and use the average of the task accuracies as the tuning metric. After tuning, we train each model for 100 repetitions (using random initialization) and report the averaged results. For full details, see Appendix D.2.
|
| 204 |
+
|
| 205 |
+
Results: In Table 2, we report the test accuracy and the number of selected experts for the MultiMNIST and Multi-Fashion datasets. On Multi-MNIST, DSelect- $\mathbf { k }$ (static) outperforms Top-k and Gumbel Softmax, in terms of both task accuracies and number of selected experts. For example, it achieves over $1 \%$ improvement in Task 2’s accuracy compared to Top-k (static). DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ (static) comes close to the performance of the Softmax MoE, but uses less experts (1.7 vs. 8 experts). Here DSelect-k (per-example) does not offer improvement over the static variant (unlike the MovieLens dataset). On Multi-Fashion, we again see that DSelect-k (static) performs best in terms of accuracy.
|
| 206 |
+
|
| 207 |
+
Table 2: Test accuracy (with standard error) and number of selected experts on Multi-MNIST/Fashion.
|
| 208 |
+
|
| 209 |
+
<table><tr><td rowspan="2"></td><td rowspan="2"></td><td colspan="3">Multi-MNIST</td><td colspan="3">Multi-FashionMNIST</td></tr><tr><td>Accuracy 1</td><td>Accuracy 2</td><td>Experts</td><td>Accuracy 1</td><td>Accuracy 2</td><td>Experts</td></tr><tr><td rowspan="3">Static</td><td>DSelect-k</td><td>92.56±0.03</td><td>90.98 ± 0.04</td><td>1.7</td><td>83.78±0.05</td><td>83.34±0.05</td><td>1.8</td></tr><tr><td>Top-k</td><td>91.93 ± 0.06</td><td>90.03 ±0.08</td><td>4</td><td>83.44 ± 0.07</td><td>82.66±0.08</td><td>4</td></tr><tr><td>Gumbel Softmax</td><td>92.3 ±0.05</td><td>90.63± 0.05</td><td>1.8</td><td>83.66 ± 0.07</td><td>83.28 ±0.05</td><td>1.5</td></tr><tr><td rowspan="2">Per-example</td><td>DSelect-k</td><td>92.42 ±0.03</td><td>90.7±0.03</td><td>1.5</td><td>83.69± 0.04</td><td>83.13± 0.04</td><td>1.5</td></tr><tr><td>Top-k</td><td>92.27 ±0.03</td><td>90.45± 0.03</td><td>4</td><td>83.66 ±0.04</td><td>83.15 ± 0.04</td><td>4</td></tr><tr><td rowspan="2">Baselines</td><td>Softmax MoE</td><td>92.61±0.03</td><td>91.0±0.03</td><td>8</td><td>83.48±0.04</td><td>82.81 ± 0.04</td><td>8</td></tr><tr><td>Shared Bottom</td><td>91.3 ± 0.04</td><td>89.47 ± 0.04</td><td>1</td><td>82.05 ± 0.05</td><td>81.37 ± 0.06</td><td>-</td></tr></table>
|
| 210 |
+
|
| 211 |
+
Table 3: Average performance (AUC and RMSE) and standard error on a real-world recommender system with 8 tasks: “E.” and “S.” denote engagement and satisfaction tasks, respectively.
|
| 212 |
+
|
| 213 |
+
<table><tr><td rowspan=1 colspan=1>Tasks/Methods</td><td rowspan=1 colspan=1>DSelect-k</td><td rowspan=1 colspan=1>Top-k</td></tr><tr><td rowspan=1 colspan=1>E. Task 1 (AUC)</td><td rowspan=1 colspan=1>0.8103 ±0.0002</td><td rowspan=1 colspan=1>0.7481 ± 0.0198</td></tr><tr><td rowspan=1 colspan=1>E. Task 2 (AUC)</td><td rowspan=1 colspan=1>0.8161± 0.0002</td><td rowspan=1 colspan=1>0.7624 ± 0.0169</td></tr><tr><td rowspan=1 colspan=1>E.Task 3 (RMSE)</td><td rowspan=1 colspan=1>0.2874± 0.0002</td><td rowspan=1 colspan=1>0.3406 ± 0.0180</td></tr><tr><td rowspan=1 colspan=1>E. Task 4 (RMSE)</td><td rowspan=1 colspan=1>0.8781± 0.0014</td><td rowspan=1 colspan=1>1.1213 ± 0.0842</td></tr><tr><td rowspan=1 colspan=1>E. Task 5 (AUC)</td><td rowspan=1 colspan=1>0.7524± 0.0003</td><td rowspan=1 colspan=1>0.5966± 0.0529</td></tr><tr><td rowspan=1 colspan=1>S. Task 1(AUC)</td><td rowspan=1 colspan=1>0.6133± 0.0066</td><td rowspan=1 colspan=1>0.5080± 0.0047</td></tr><tr><td rowspan=1 colspan=1>S.Task 2 (AUC)</td><td rowspan=1 colspan=1>0.8468 ± 0.0289</td><td rowspan=1 colspan=1>0.5981 ± 0.0616</td></tr><tr><td rowspan=1 colspan=1>S.Task 3 (AUC)</td><td rowspan=1 colspan=1>0.9259± 0.0008</td><td rowspan=1 colspan=1>0.6665± 0.0091</td></tr></table>
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 3: Expert weights of the DSelect-k gates on the recommender system.
|
| 217 |
+
|
| 218 |
+
# 4.3 A Large-scale Recommender System
|
| 219 |
+
|
| 220 |
+
We study the performance of DSelect-k and Top-k in a real-word, large-scale content recommendation system. The system encompasses hundreds of millions of unique items and billions of users.
|
| 221 |
+
|
| 222 |
+
Architecture and Dataset: The system consists of a candidate generator followed by a multi-task ranking model, and it adopts a framework similar to [40, 34]. The ranking model makes predictions for 6 classification and 2 regression tasks. These can be classified into two categories: (i) engagement tasks (e.g., predicting user clicks, bad clicks, engagement time), and (ii) satisfaction tasks (e.g., predicting user satisfaction behaviors such as likes and dislikes). We construct the dataset from the system’s user logs (which contain historical information about the user and labels for the 8 tasks). The dataset consists of billions of examples (we do not report the exact number for confidentiality). We use a random 90/10 split for the training and evaluation sets.
|
| 223 |
+
|
| 224 |
+
Experimental Details: We use the cross-entropy and squared error losses for the classification and regression tasks, respectively. The ranking model is based on a multi-gate MoE, in which each task uses a separate static gate. The MoE uses 8 experts, each composed of dense layers. For both the DSelect-k and Top-k based models, we tune the learning rate and the experts’ architecture. Then, using the best hyperparameters, we train the final models for 5 repetitions (using random initialization). For additional details, see Appendix D.3.
|
| 225 |
+
|
| 226 |
+
Results: In Table 3, we report the out-of-sample performance metrics for the 8 tasks. The results indicate that DSelect- $\mathbf { \nabla } \cdot \mathbf { k }$ outperforms Top-k on all tasks, with the improvements being most pronounced on the satisfaction tasks. In Figure 3, we show a heatmap of the expert weights chosen by the DSelect$\mathbf { k }$ gates. Notably, for DSelect-k, all engagement tasks share at least one expert, and two of the satisfaction tasks share the same expert.
|
| 227 |
+
|
| 228 |
+
# 5 Conclusion
|
| 229 |
+
|
| 230 |
+
We introduced DSelect-k: a continuously differentiable and sparse gate for MoE, which can be trained using first-order methods. Given a user-specified parameter $k$ , the gate selects at most $k$ of the $n$ experts. Such direct control over the sparsity level is typically handled in the literature by adding a cardinality constraint to the optimization problem. One of the key ideas we introduced is a binary encoding scheme that allows for selecting $k$ experts, without requiring any constraints in the optimization problem. We studied the performance of DSelect-k in MTL settings, on both synthetic and real datasets. Our experiments indicate that DSelect-k can achieve significant improvements in prediction and expert selection, compared to state-of-the-art MoE gates and MTL baselines.
|
| 231 |
+
|
| 232 |
+
Societal Impact: MoE models are used in various applications (as discussed in the introduction). DSelect-k can improve the interpretability and efficiency of MoE models, thus benefiting the underlying applications. We do not see direct, negative societal impacts from our proposal.
|
| 233 |
+
|
| 234 |
+
Acknowledgements: The research was conducted while Hussein Hazimeh was at Google, and part of the writing was done during his time at MIT. At MIT, Hussein Hazimeh and Rahul Mazumder acknowledge research funding from the Office of Naval Research [Grant ONR-N000141812298].
|
| 235 |
+
|
| 236 |
+
References
|
| 237 |
+
[1] Emmanuel Bengio, Pierre-Luc Bacon, Joelle Pineau, and Doina Precup. Conditional computation in neural networks for faster models. CoRR, abs/1511.06297, 2015. URL http: //arxiv.org/abs/1511.06297.
|
| 238 |
+
[2] Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 239 |
+
[3] Mathieu Blondel, Andre Martins, and Vlad Niculae. Learning classifiers with fenchel-young losses: Generalized entropies, margins, and algorithms. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 606–615. PMLR, 2019.
|
| 240 |
+
[4] Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997.
|
| 241 |
+
[5] Jianbo Chen, Le Song, Martin Wainwright, and Michael Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In International Conference on Machine Learning, pages 883–892. PMLR, 2018.
|
| 242 |
+
[6] Gonçalo M Correia, Vlad Niculae, and André FT Martins. Adaptively sparse transformers. 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), pages 2174–2184, 2019.
|
| 243 |
+
[7] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, 12(7), 2011.
|
| 244 |
+
[8] David S Ebert, F Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley. Texturing & modeling: a procedural approach. Morgan Kaufmann, 2003.
|
| 245 |
+
[9] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021.
|
| 246 |
+
[10] F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. Acm transactions on interactive intelligent systems (tiis), 5(4):1–19, 2015.
|
| 247 |
+
[11] Hussein Hazimeh, Natalia Ponomareva, Petros Mol, Zhenyu Tan, and Rahul Mazumder. The tree ensemble layer: Differentiability meets conditional computation. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 4138–4148, Virtual, 13–18 Jul 2020. PMLR.
|
| 248 |
+
[12] Yani Ioannou, Duncan Robertson, Darko Zikic, Peter Kontschieder, Jamie Shotton, Matthew Brown, and Antonio Criminisi. Decision forests, convolutional networks and the models in-between. arXiv preprint arXiv:1603.01250, 2016.
|
| 249 |
+
[13] Robert A Jacobs. Bias/variance analyses of mixtures-of-experts architectures. Neural computation, 9(2):369–383, 1997.
|
| 250 |
+
[14] Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 251 |
+
[15] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 252 |
+
[16] Wenxin Jiang and Martin A Tanner. On the identifiability of mixtures-of-experts. Neural Networks, 12(9):1253–1258, 1999.
|
| 253 |
+
[17] Michael I Jordan and Robert A Jacobs. Hierarchical mixtures of experts and the em algorithm. Neural computation, 6(2):181–214, 1994.
|
| 254 |
+
|
| 255 |
+
[18] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 256 |
+
|
| 257 |
+
[19] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 258 |
+
|
| 259 |
+
[20] Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
|
| 260 |
+
|
| 261 |
+
[21] Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 262 |
+
|
| 263 |
+
[22] Jiaqi Ma, Zhe Zhao, Xinyang Yi, Jilin Chen, Lichan Hong, and Ed H Chi. Modeling task relationships in multi-task learning with multi-gate mixture-of-experts. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1930–1939, 2018.
|
| 264 |
+
|
| 265 |
+
[23] 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.
|
| 266 |
+
|
| 267 |
+
[24] Andre Martins and Ramon Astudillo. From softmax to sparsemax: A sparse model of attention and multi-label classification. In International Conference on Machine Learning, pages 1614– 1623. PMLR, 2016.
|
| 268 |
+
|
| 269 |
+
[25] Max Paulus, Dami Choi, Daniel Tarlow, Andreas Krause, and Chris J Maddison. Gradient estimation with stochastic softmax tricks. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 5691–5704. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/3df80af53dce8435cf9ad6c3e7a403fd-Paper.pdf.
|
| 270 |
+
|
| 271 |
+
[26] Ben Peters, Vlad Niculae, and André FT Martins. Sparse sequence-to-sequence models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1504–1519, 2019.
|
| 272 |
+
|
| 273 |
+
[27] Prajit Ramachandran and Quoc V Le. Diversity and depth in per-example routing models. In International Conference on Learning Representations, 2018.
|
| 274 |
+
|
| 275 |
+
[28] Clemens Rosenbaum, Tim Klinger, and Matthew Riemer. Routing networks: Adaptive selection of non-linear functions for multi-task learning. In International Conference on Learning Representations, 2018.
|
| 276 |
+
|
| 277 |
+
[29] Randi J Rost, Bill Licea-Kane, Dan Ginsburg, John Kessenich, Barthold Lichtenbelt, Hugh Malan, and Mike Weiblen. OpenGL shading language. Pearson Education, 2009.
|
| 278 |
+
|
| 279 |
+
[30] Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017.
|
| 280 |
+
|
| 281 |
+
[31] Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in neural information processing systems, pages 3856–3866, 2017.
|
| 282 |
+
|
| 283 |
+
[32] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-ofexperts layer. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 284 |
+
|
| 285 |
+
[33] Ximeng Sun, Rameswar Panda, Rogerio Feris, and Kate Saenko. Adashare: Learning what to share for efficient deep multi-task learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 8728–8740. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/634841a6831464b64c072c8510c7f35c-Paper.pdf.
|
| 286 |
+
|
| 287 |
+
[34] Hongyan Tang, Junning Liu, Ming Zhao, and Xudong Gong. Progressive layered extraction (ple): A novel multi-task learning (mtl) model for personalized recommendations. In Fourteenth ACM Conference on Recommender Systems, pages 269–278, 2020.
|
| 288 |
+
[35] Xin Wang, Fisher Yu, Zi-Yi Dou, Trevor Darrell, and Joseph E Gonzalez. Skipnet: Learning dynamic routing in convolutional networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 409–424, 2018.
|
| 289 |
+
[36] Yuyan Wang, Zhe Zhao, Bo Dai, Christopher Fifty, Dong Lin, Lichan Hong, and Ed H Chi. Small towers make big differences. arXiv preprint arXiv:2008.05808, 2020.
|
| 290 |
+
[37] 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 |
+
[38] Sang Michael Xie and Stefano Ermon. Reparameterizable subset sampling via continuous relaxations. In International Joint Conference on Artificial Intelligence, 2019.
|
| 292 |
+
[39] Yujia Xie, Hanjun Dai, Minshuo Chen, Bo Dai, Tuo Zhao, Hongyuan Zha, Wei Wei, and Tomas Pfister. Differentiable top-k with optimal transport. Advances in Neural Information Processing Systems, 33, 2020.
|
| 293 |
+
[40] Zhe Zhao, Lichan Hong, Li Wei, Jilin Chen, Aniruddh Nath, Shawn Andrews, Aditee Kumthekar, Maheswaran Sathiamoorthy, Xinyang Yi, and Ed Chi. Recommending what video to watch next: a multitask ranking system. In Proceedings of the 13th ACM Conference on Recommender Systems, pages 43–51, 2019.
|
md/train/uys9OcmXNtU/uys9OcmXNtU.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MQTRANSFORMER: MULTI-HORIZON FORECASTS WITH CONTEXT DEPENDENT AND FEEDBACK-AWARE ATTENTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent advances in neural forecasting have produced major improvements in accuracy for probabilistic demand prediction. In this work, we propose novel improvements to the current state of the art by incorporating changes inspired by recent advances in Transformer architectures for Natural Language Processing. We develop a novel decoder-encoder attention for context-alignment, improving forecasting accuracy by allowing the network to study its own history based on the context for which it is producing a forecast. We also present a novel positional encoding that allows the neural network to learn context-dependent seasonality functions as well as arbitrary holiday distances. Finally we show that the current state of the art MQ-Forecaster (Wen et al., 2017) models display excess variability by failing to leverage previous errors in the forecast to improve accuracy. We propose a novel decoder-self attention scheme for forecasting that produces significant improvements in the excess variation of the forecast.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Time series forecasting is a fundamental problem in machine learning with relevance to many application domains including supply chain management, finance, healthcare analytics, and more. Modern forecasting applications require predictions of many correlated time series over multiple horizons. In multi-horizon forecasting, the learning objective is to produce forecasts for multiple future horizons at each time-step. Beyond simple point estimation, decision making problems require a measure of uncertainty about the forecasted quantity. Access to the full distribution is usually unnecessary, and several quantiles are sufficient (many problems in Operations Research use the $5 0 ^ { t \check { h } }$ and $9 0 ^ { t h }$ percentiles, for example).
|
| 12 |
+
|
| 13 |
+
As a motivating example, consider a large e-commerce retailer with a system to produce forecasts of the demand distribution for a set of products at a target time $T$ . Using these forecasts as an input, the retailer can then optimize buying and placement decisions to maximize revenue and/or customer value. Accurate forecasts are important, but – perhaps less obviously – forecasts that don’t exhibit excess volatility as a target date approaches minimize costly, bull-whip effects in a supply chain (Chen et al., 2000; Bray and Mendelson, 2012).
|
| 14 |
+
|
| 15 |
+
Recent work applying deep learning to time-series forecasting focuses primarily on the use of recurrent and convolutional architectures (Nascimento et al., 2019; Yu et al., 2017; Gasparin et al., 2019; Mukhoty et al., 2019; Wen et al., 2017)1. These are Seq2Seq architectures (Sutskever et al., 2014) – which consist of an encoder which takes an input sequence and summarizes it into a fixedlength context vector, and a decoder which produces an output sequence. It is well known that Seq2Seq models suffer from an information bottleneck by transmitting information from encoder to decoder via a single hidden state. To address this Bahdanau et al. (2014) introduces a method called attention, allowing the decoder to take as input a weighted combination of relevant latent encoder states at each output time step, rather than using a single context to produce all decoder outputs. While NLP is the predominate application of attention architectures, in this paper we show how novel attention modules and positional embeddings can be used to introduce proper inductive biases for probabilistic time-series forecasting to the model architecture.
|
| 16 |
+
|
| 17 |
+
Even with these shortcomings, this line of work has lead to major advances in forecast accuracy for complex problems, and real-world forecasting systems increasingly rely on neural nets. Accordingly, a need for black-box forecasting system diagnostics has arisen. Stine and Foster (2020b;a) use probabilistic martingales to study the dynamics of forecasts produced by an arbitrary forecasting system. They can be used to detect the degree to which forecasts adhere to the martingale model of forecast evolution (Heath and Jackson, 1994) and to detect unnecessary volatility (above and beyond any inherent uncertainty) in the forecasts produced. Thus, Stine and Foster (2020b;a) describe a way to connect the excess variation of a forecast to accuracy misses against the realized target.
|
| 18 |
+
|
| 19 |
+
While, multi-horizon forecasting networks such as (Wen et al., 2017; Madeka et al., 2018), minimize quantile loss - the network architectures do not explicitly handle excess variation, since forecasts on any particular date are not made aware of errors in the forecast for previous dates. In short, such tools can be used to detect flaws in forecasts, but the question of how to incorporate that information into model design is unexplored.
|
| 20 |
+
|
| 21 |
+
Our Contributions In this paper, we are concerned with both improving forecast accuracy and reducing excess forecast volatility. We present a set of novel architectures that seek to remedy some of inductive biases that are currently missing in state of the art MQ-Forecasters (Wen et al., 2017). The major contributions of this paper are
|
| 22 |
+
|
| 23 |
+
1. Positional Encoding from Event Indicators: Current MQ-Forecasters use explicitly engineered holiday “distances” to provide the model with information about the seasonality of the time series. We introduce a novel positional encoding mechanism that allows the network to learn a seasonality function depending on other information of the time series being forecasted, and demonstrate that its a strict generalization of conventional position encoding schemes.
|
| 24 |
+
2. Horizon-Specific Decoder-Encoder Attention: Wen et al. (2017); Madeka et al. (2018) and other MQ-Forecasters learn a single encoder representation for all future dates and periods being forecasted. We present a novel horizon-specific decoder-encoder attention scheme that allows the network to learn a representation of the past that depends on which period is being forecasted.
|
| 25 |
+
3. Decoder Self-Attention for Forecast Evolution: To the best of our knowledge, this is the first work to consider the impacts of network architecture design on forecast evolution. Importantly, we accomplish this by using attention mechanisms to introduce the right inductive biases, and not by explicitly penalizing a measure of forecast variability. This allows us to maintain a single objective function without needing to make trade-offs between accuracy and volatility.
|
| 26 |
+
|
| 27 |
+
By providing MQ-Forecasters with the structure necessary to learn context information dependent encodings, we observe major increases in accuracy $3 . 9 \%$ in overall P90 quantile loss throughout the year, and up to $60 \%$ during peak periods) on our demand forecasting application along with a significant reduction in excess volatility $52 \%$ reduction in excess volatility at P50 and $30 \%$ at P90). We also apply MQTransformer to four public datasets, and show parity with the state-of-the-art on simple, univariate tasks. On a substantially more complex public dataset (retail forecasting) we demonstrate a $38 \%$ improvement over the previously reported state-of-the-art, and a $5 \%$ improvement in $\mathrm { P 5 0 0 L }$ , $11 \%$ in P90 QL versus our baseline. Because our innovations are compatible with efficient training schemes, our architecture also achieves a significant speedup (several orders of magnitude greater throughput) over earlier transformer models for time-series forecasting.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 30 |
+
|
| 31 |
+
# 2.1 TIME SERIES FORECASTING
|
| 32 |
+
|
| 33 |
+
Formally, the task considered in our work is the high-dimensional regression problem
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
p ( y _ { t + 1 , i } , . . . , y _ { t + H , i } | \mathbf { y } _ { : t , i } , \mathbf { x } _ { : t , i } ^ { ( h ) } , \mathbf { x } _ { : t , i } ^ { ( f ) } , \mathbf { x } _ { i } ^ { ( s ) } ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $y _ { t + s , i } , \mathbf { y } _ { : t , i } , \mathbf { x } _ { : t , i } ^ { ( h ) } , \mathbf { x } _ { t : , i } ^ { ( f ) } , \mathbf { x } ^ { ( s ) }$ )i , x(f)t:,i , x(s) denote future observations of the target time series i, observations of the target time series observed up until time $t$ , the past covariates, known future information, and static covariates, respectively.
|
| 40 |
+
|
| 41 |
+
For sequence modeling problems, Seq2Seq (Sutskever et al., 2014) is the canonical deep learning framework and although applied this architecture to neural machine translation (NMT) tasks, it has since been adapted to time series forecasting (Nascimento et al., 2019; Yu et al., 2017; Gasparin et al., 2019; Mukhoty et al., 2019; Wen et al., 2017; Salinas et al., 2020; Wen and Torkkola, 2019). The MQ-Forecaster framework (Wen et al., 2017) solves (1) above by treating each series $i$ as a sample from a joint stochastic process and feeding into a neural network which predicts $Q$ quantiles for each horizon. These types of models, however, inherit from the Seq2Seq contextual information available to the decoder as it produces each estimate $y _ { t + s , i } ^ { q }$ cture, the $q ^ { t h }$ e limitedquantile of the distribution of the target at time $t + s y _ { t + s , i }$ . Seq2Seq models rely on a single encoded context to produce forecasts for all horizons, imposing an information bottleneck and making it difficult for the model to understand long term dependencies.
|
| 42 |
+
|
| 43 |
+
Our MQTransformer architecture, like other MQ-Forecasters, uses the direct strategy: the model outputs the quantiles of interest directly, rather than the parameters of a distribution from which samples are to be generated. This has been shown (Wen et al., 2017) to outperform parametric models, like DeepAR (Salinas et al., 2020), on a wide variety of tasks. Recently, Lim et al. (2019) consider an application of attention to multi-horizon forecasting, but their method still produces a single context for all horizons. Furthermore, by using an RNN decoder their models do not enjoy the same scaling properties as MQ-Forecaster models. To the best of our knowledge, our work is the first to devise attention mechanisms for this problem that readily scale.
|
| 44 |
+
|
| 45 |
+
# 2.2 ATTENTION MECHANISMS
|
| 46 |
+
|
| 47 |
+
Bahdanau et al. (2014) introduced the concept of an attention mechanism to solve the information bottleneck and sequence alignment problems in Seq2Seq architectures for NMT. Recently, attention has enjoyed success across a diverse range of applications including natural language processing (NLP), computer vision (CV) and time-series forecasting tasks (Galassi et al., 2019; Xu et al., 2015; Shun-Yao Shih and Fan-Keng Sun and Hung-yi Lee, 2019; Kim and Kang, 2019; Cinar et al., 2017; Li et al., 2019; Lim et al., 2019). Many variants have been proposed including self-attention and dot-product attention (Luong et al., 2015; Cheng et al., 2016; Vaswani et al., 2017; Devlin et al., 2019), and transformer architectures (end-to-end attention with no recurrent layers) achieve state-of-the-art performance on most NLP tasks.
|
| 48 |
+
|
| 49 |
+
Time series forecasting applications exhibit seasonal trends and the absolute position encodings commonly used in the literature cannot be applied. Our work differs from previous work on relative position encodings (Dai et al., 2019; Huang et al., 2018; Shaw et al., 2018) in that we learn a representation from a time series of indicator variables which encode events relevant to the target application (such as holidays and promotions). If event indicators relevant to the application are provided, then this imposes a strong inductive bias that will allow the model to generalize well to future observations. Existing encoding schemes either involve feature engineering (e.g. sinusoidal encodings) or have a maximum input sequence length, ours requires no feature engineering – the model learns it directly from raw data – and it extends to arbitrarily long sequences.
|
| 50 |
+
|
| 51 |
+
In the vanilla transformer (Vaswani et al., 2017), a sinusoidal position embedding is added to the network input and each encoder layer consists of a multi-headed attention block followed by a feed-forward sub-layer. For each head $i$ , the attention score between query $q _ { s }$ and key $k _ { t }$ is defined as follows for the input layer
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
A _ { s , t } ^ { h } = ( \mathbf { x } _ { s } + \mathbf { r } _ { s } ) ^ { \top } \mathbf { W } _ { q } ^ { h , \top } \mathbf { W } _ { k } ^ { h } ( \mathbf { x } _ { t } + \mathbf { r } _ { t } )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\mathbf { x } _ { s } , \mathbf { r } _ { s }$ are the observation of the time series and the position encoding, respectively, at time $s$ Section 3 introduces attention mechanisms that differ in their treatment of the position dependent biases. See Appendix A for additional discussion of attention mechanisms.
|
| 58 |
+
|
| 59 |
+
# 2.3 MARTINGALE DIAGNOSTICS
|
| 60 |
+
|
| 61 |
+
Originally the martingale model of forecast evolution (MMFE) was conceived as a way to simulate demand forecasts used in inventory planning problems (Heath and Jackson, 1994). Denoting by $\widehat { Y } _ { T \mid t }$ the forecast for $Y _ { T }$ made at time $t \leq T$ , the MMFE assumes that the forecast process $\{ \widehat { Y } _ { T | t } \} _ { t }$ is martingale. Informally, a martingale captures the notion that a forecast should use all information available to the forecasting system at time $t$ . Mathematically, a discrete time martingale is a stochastic process $\{ X _ { t } \}$ such that $\mathbb { E } [ X _ { t + 1 } | X _ { t } , \ldots , X _ { 1 } ] = X _ { t }$ . We assume a working knowledge of martingales and direct the reader to Williams (1991) for a thorough coverage in discrete time.
|
| 62 |
+
|
| 63 |
+
Taleb (2018) describe how martingale forecasts correspond to rational updating, then expanded by Augenblick and Rabin (2019). Taleb (2018), Taleb and Madeka (2019) and Augenblick and Rabin (2019) go on to develop tests for forecasts that rule out martingality and indicate irrational or predictable updating for binary bets. Stine and Foster (2020a;b) further extend these ideas to quantile forecasts. Specifically, they consider the coverage probability process $p _ { t } : = \mathbb { P } [ Y _ { T } \leq \tau | Y _ { s } , \dot { s } \leq t ] =$ $\mathbb { E } [ I ( Y _ { T } \leq \bar { \tau } ) | Y _ { s } , s \leq t ]$ , where $\tau$ denotes the forecast announced in the first period $t = 0$ . Because {pt} is also a martingale, the authors show that E[(pT − π)2] = PTt=1 E[(pt − pt−1)2] = π(1 − π), the coverage process. In the context of quantile forecasting, $\pi$ is simply the quantile forecasted. The measure of excess volatility proposed is the quadratic variation process associated with $\{ p _ { t } \}$ , $\begin{array} { r } { Q _ { s } : = \sum _ { t = 0 } ^ { s } ( p _ { t } - p _ { t - 1 } ) ^ { 2 } } \end{array}$ . While this process is not a martingale, we do know that under the MMFE assumption, $\mathbb { E } [ Q _ { T } ] = \pi ( 1 - \pi )$ .
|
| 64 |
+
|
| 65 |
+
A second quantity of interest is the martingale $V _ { t } : = Q _ { t } - ( p _ { t } - \pi ) ^ { 2 }$ which follows the typical structure of subtracting the compensator to turn a sub-martingale into a martingale. In Section 4 we leverage the properties of $\{ V _ { t } \}$ and $\{ Q _ { t } \}$ to compare the dynamics of forecasts produced by a variety of models, demonstrating that our feedback-aware decoder self-attention units reduce excess forecast volatility.
|
| 66 |
+
|
| 67 |
+
# 3 METHODOLOGY
|
| 68 |
+
|
| 69 |
+
As mentioned, this work is motivated in part by the needs of the consumers of forecasting systems. We therefore care about whether or not our innovations can be used in practice. Our methodology must scale to forecasting tens of thousands or millions of signals, at hundreds of horizons. We extend the MQ-Forecaster family of models (Wen et al., 2017) because it, unlike many other architectures considered in the literature, can be applied at a large-scale (millions of samples) due to its use of forking sequences – a technique to dramatically increase the effective batch size during training and avoid expensive data augmentation. In this section we present our MQTransformer architecture, building upon the MQ-Forecaster framework.
|
| 70 |
+
|
| 71 |
+
For ease of exposition, we reformulate the generic probabilistic forecasting problem in (1) as $p ( y _ { t + 1 , i } , \ldots , y _ { t + H , i } \vert \mathbf { y } _ { : t , i } , \mathbf { x } _ { : t , i } , \mathbf { x } _ { i } ^ { ( l ) } , \mathbf { x } ^ { ( g ) } , \mathbf { s } _ { i } )$ $\mathbf { x } _ { i } ^ { ( l ) } = \{ \mathbf { x } _ { s , i } ^ { ( l ) } \} _ { s = 1 } ^ { \infty }$ are known covariates specific to time-series , where $\mathbf { x } _ { : t , i }$ are past observations of all covariates, $i .$ , $\mathbf { x } ^ { ( g ) } = \{ \mathbf { x } _ { s } ^ { ( g ) } \} _ { s = 1 } ^ { \infty }$ are the global, known covariates. In this setting, known signifies that the model has access to (potentially noisy) observations of past and future values. Note that this formulation is equivalent to (1), and that known covariates can be included in the past covariates $\mathbf { x } _ { : t }$ . When it can be inferred from context, the time series index $i$ is omitted.
|
| 72 |
+
|
| 73 |
+
# 3.1 LEARNING OBJECTIVE
|
| 74 |
+
|
| 75 |
+
We train a quantile regression model to minimize the quantile loss, summed over all forecast creation dates and quantiles $\begin{array} { r } { \sum _ { t } \sum _ { q } \sum _ { k } L _ { q } ( y _ { t + k } , \widehat { y } _ { t + k } ^ { ( q ) } ) } \end{array}$ , where $L _ { q } ( y , \widehat { y } ) = q ( y - \widehat { y } ) _ { + } + ( 1 - q ) ( \widehat { y } - y ) _ { + }$ $( \cdot ) _ { + }$ is the positive part operator, $q$ denotes a quantile, and $k$ denotes the horizon.
|
| 76 |
+
|
| 77 |
+
# 3.2 NETWORK ARCHITECTURE
|
| 78 |
+
|
| 79 |
+
The design of the architecture is similar to MQ-RNN (Wen et al., 2017), and consists of encoder, decoder and position encoding blocks (see Figure 4 in Appendix B). The position encoding outputs, for each time step $t$ , are a representation of global position information, $\mathbf { r } _ { t } ^ { \mathsf { ( } g \mathsf { ) } } = \mathbf { P } \mathbf { E } _ { t } ^ { ( g ) } ( \mathbf { x } _ { i } ^ { ( g ) } )$ x(g)i ), as well as time-series specific context information, $\mathbf { r } _ { t } ^ { ( l ) } = \mathbf { P E } _ { t } ^ { ( l ) } ( \mathbf { x } _ { i } ^ { ( l ) } )$ . Intuitively, $\mathbf { r } _ { t } ^ { ( g ) }$ captures position information that is independent of the time-series $i$ (such as holidays), whereas $\mathbf { r } _ { t } ^ { ( l ) }$ encodes timeseries specific context information (such as promotions). In both cases, the inputs are a time series of indicator variables and require no feature-engineering or handcrafted functions.
|
| 80 |
+
|
| 81 |
+
The encoder then summarizes past observations of the covariates into a sequence of hidden states $\mathbf { h } _ { t } : = \mathrm { e n c o d e r } ( \mathbf { y } _ { : t } , \mathbf { x } _ { : t } , \mathbf { r } _ { : t } ^ { ( g ) } , \mathbf { r } _ { : t } ^ { ( \bar { l } ) } , \mathbf { s } )$ . Using these representations, the decoder produces an $H \times Q$ matrix of forecasts $\widehat { \mathbf { Y } } _ { t } = \operatorname* { d e c o d e r } ( \mathbf { h } _ { : t } , \mathbf { r } ^ { ( g ) } , \mathbf { r } ^ { ( l ) } )$ . Note that in the decoder, the model has access to position encodings.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 1: Position encoding learned from daily-grain event indicators
|
| 85 |
+
|
| 86 |
+
In this section we focus on our novel attention blocks and position encodings; the reader is directed to Appendix B for the other architecture details.
|
| 87 |
+
|
| 88 |
+
MQTransformer Now we describe a design, evaluated in Section 4, following the generic pattern given above. We define the combined position encoding as $\mathbf { r } : = [ \mathbf { r } ^ { ( g ) } ; \mathbf { r } ^ { ( l ) } ]$ . In the encoder we use a stack of dilated temporal convolutions (van den Oord et al., 2016; Wen et al., 2017) to encode historical time-series and a multi-layer perceptron to encode the static features as (3).
|
| 89 |
+
|
| 90 |
+
Table 1: MQTransformer encoder and decoder
|
| 91 |
+
|
| 92 |
+
<table><tr><td>ENCODER</td><td colspan="2">DECODER CONTEXTS</td></tr><tr><td>h𝑡 = TEMPORALCONV(y:t,X:t,r:t)(3)</td><td>ct,h = HSATTENTION(h:t, r) hs</td><td>(4)</td></tr><tr><td>h² =FEEDFORWARD(S)</td><td>Ct =FEEDFORWARD(ht,r)</td><td></td></tr><tr><td>ht =[h²;h²],</td><td>Ct =[e,1..;ctH;ce]</td><td></td></tr><tr><td></td><td></td><td>Ct,h = DSATTENTION(C:t,h:t,r),</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Our decoder incorporates our horizon specific and decoder self-attention blocks, and consists of two branches. The first (global) branch summarizes the encoded representations into horizon-specific $( \mathbf { c } _ { t , h } ^ { h s } )$ and horizon agnostic $( \mathbf { c } _ { t } ^ { a } )$ contexts. Formally, the global branch $\mathbf { c } _ { t } : = m _ { G } ( \cdot )$ is given by (4).
|
| 95 |
+
|
| 96 |
+
The output branch consists of a self-attention block followed by a local MLP, which produces outputs using the same weights for each horizon. For FCT $t$ and horizon $h$ , the output is given by $( \widehat { { y } } _ { t + h } ^ { 1 } , \ldots , \widehat { { y } } _ { t + h } ^ { \bar { Q } } ) = m _ { L } ( { \mathbf { c } } _ { t } ^ { a } , { \mathbf { c } } _ { t , h } ^ { h s } , \widetilde { { \mathbf { c } } } _ { t , h } , { \mathbf { r } } _ { t + h } )$ , where $\mathbf { c } _ { : t }$ denotes the output of the global branch, up b bthrough the FCT $t$ e. Next we describe the specifics of our position encoding and attention blocks.
|
| 97 |
+
|
| 98 |
+
# 3.3 LEARNING POSITION AND CONTEXT REPRESENTATIONS FROM EVENT INDICATORS
|
| 99 |
+
|
| 100 |
+
Prior work typically uses a variant on one of two approaches to provide attention blocks with position information: (1) a handcrafted representation (such as sinusoidal encodings) or (2) a matrix $\mathbf { \hat { M } } \in \mathbb { R } ^ { L \times d }$ of position encoding where $L$ is the maximum sequence length and each row corresponds to the position encoding for time point.
|
| 101 |
+
|
| 102 |
+
In contrast, our novel encoding scheme maps sequences of indicator variables to a $d$ -dimensional representations. For demand forecasting, this enables our model to learn an arbitrary function of events (like holidays and promotions) to encode position information. As noted above, our model includes two position encodings: $r _ { t } ^ { ( g ) } : = P E _ { t } ^ { ( g ) } \big ( \mathbf { x } ^ { ( g ) } \big )$ and $r _ { t } ^ { ( l ) } : = P E _ { t } ^ { ( l ) } ( \mathbf { x } ^ { ( l ) } )$ , one that is shared among all time-series $i$ and one that is specific. For the design we use in Section 4, $P E ^ { ( g ) }$ is implemented as a bidirectional 1-D convolution (looking both forward and backward in time) and $P \bar { E } ^ { ( l ) }$ is an MLP applied separately at each time step. Figure 1 shows an example of $P E ^ { ( g ) }$ learned from holiday indicator variables. For reference, MQ-(C)RNN (Wen et al., 2017) uses linear holiday and promotion distances to represent position information.
|
| 103 |
+
|
| 104 |
+
Connection to matrix embeddings Another way to view our position encoding scheme is as a form of set based indexing into rows of an infinite dimensional matrix. We note that the traditional method of learning a matrix embedding $\mathbf { M }$ can be recovered as a special case of our approach. Consider a sequence of length $L$ , and take $\mathbf { x } ^ { ( g ) } : = [ \mathbf { e } _ { 1 } , \ldots , \mathbf { e } _ { L } ]$ where $\mathbf { e } _ { s }$ is used to denote the vector in $\mathbb { R } ^ { L }$ with a 1 in the $s ^ { t h }$ position and 0s elsewhere. To recover the matrix embedding scheme, we define $\mathrm { P E } _ { t } ^ { \mathrm { m a t r i x } } ( \mathbf { x } ^ { ( g ) } ) : = \mathbf { x } _ { t } ^ { ( g ) , \top } \mathbf { M }$ . Thus we see that our scheme is a strict generalization of the matrix embedding approach commonly used in the NLP community.
|
| 105 |
+
|
| 106 |
+
# 3.4 CONTEXT DEPENDENT AND FEEDBACK-AWARE ATTENTION
|
| 107 |
+
|
| 108 |
+
Table 2: Attention weight and output computations for blocks introduced in Section 3.4
|
| 109 |
+
|
| 110 |
+
<table><tr><td>BLOCK</td><td>ATTENTION WEIGHTS</td><td colspan="2">OUTPUT</td></tr><tr><td>DECODER-ENCODER ATTENTION</td><td>A, =qTWWkks q =[ht;rt;rt+h] ks =[hs;rs]</td><td>ch (5)</td><td>t AV M s=t-L</td></tr><tr><td>DECODER SELF-ATTENTION</td><td>Vs =hs A,s,r =qhW,TWk,r (7) qt,h=[ht;Ch;rtrt+h] ks,r= [cr;rs;rs+r] hs Vs,r= hs</td><td>=∑ (s,r)∈H(t,h) H(t,h):={(s,r)|s+r=t+h}</td><td>At,rVs,, (8)</td></tr></table>
|
| 111 |
+
|
| 112 |
+
Horizon-Specific Decoder-Encoder Attention Our horizon-specific attention mechanism is a multi-headed attention mechanism where the projection weights are shared across all horizons. Each head corresponds to a different horizon. It differs from a traditional multi-headed attention mechanism in that its purpose is to attend over representations of past time points to produce a representation specific to the target period. In our architecture, the inputs to the block are the encoder hidden states and position encodings. Mathematically, for time $s$ and horizon $h$ , the attention weight for the value at time $t$ is computed as (5).
|
| 113 |
+
|
| 114 |
+
Observe that there are two key differences between these attention scores and those in the vanilla transformer architecture: (a) projection weights are shared by all $H$ heads, (b) the addition of the position encoding of the target horizon $h$ to the query. The output of our horizon specific decoderencoder attention block, $\mathbf { c } _ { t , h } ^ { h s }$ , is obtained by taking a weighted sum of the encoder hidden contexts, up to a maximum look-back of $L$ periods as in (6).
|
| 115 |
+
|
| 116 |
+
Decoder Self-Attention The martingale diagnostic tools developed in (Stine and Foster, 2020b) indicate a deep connection between accuracy and volatility. We leverage this connection to develop a novel decoder self-attention scheme for multi-horizon forecasting. To motivate the development, consider a model which forecasts values of 40, 60 when the demand has constantly been 50 units. We would consider this model to have excess volatility. Similarly, a model forecasting 40, 60 when demand jumps between 40 and 60 units would not be considered to have excess volatility. This is because the first model fails to learn from its past forecasts - it continues jumping between 40, 60 when the demand is 50 units.
|
| 117 |
+
|
| 118 |
+
In order to ameliorate this, we need to pass the information of the previous forecast errors into the current forecast. For each FCT $t$ and horizon $h$ , the model attends on the previous forecasts using a query containing the demand information for that period. The attention mechanism has a separate head for each horizon.
|
| 119 |
+
|
| 120 |
+
Rather than attend on the demand information and prior outputs directly, a richer representations of the scontext e information is used: the demand information at time and previous forecasts are represented via the correspon $t$ is incorporated via the encoing horizon-specific context $\mathbf { h } _ { t }$ $\mathbf { c } _ { s , r } ^ { h s }$ – in the absence of decoder-self attention $\mathbf { c } _ { s , r } ^ { h s }$ would be passed through the local MLP to generate the forecasts. Formally, the attention scores are given by (7). The horizon-specific and feedback-aware outputs, $\widetilde { \mathbf { c } } _ { t , h } ^ { h s }$ , are given by (8). Note how we sum only over previous forecasts of the same period.
|
| 121 |
+
|
| 122 |
+
Table 3: Aggregate Quantile Loss Metrics
|
| 123 |
+
|
| 124 |
+
<table><tr><td>MODEL</td><td>ALL LTSP</td><td>LTSP 0/4</td><td>SEASONAL PEAK1</td><td>POST-PEAK RAMPDOWN</td><td>PROMOTION TYPE1</td></tr><tr><td>BASELINE</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>DEC-ENC</td><td>0.984</td><td>0.931</td><td>0.748</td><td>0.712</td><td>0.706</td></tr><tr><td>DEC-ENC + DEC-SELF</td><td>0.989</td><td>0.908</td><td>0.698</td><td>0.639</td><td>0.670</td></tr></table>
|
| 125 |
+
|
| 126 |
+
# 4 EMPIRICAL RESULTS
|
| 127 |
+
|
| 128 |
+
# 4.1 LARGE-SCALE DEMAND FORECASTING
|
| 129 |
+
|
| 130 |
+
First, we evaluate our architecture on a demand forecasting problem for a large-scale e-commerce retailer with the objective of producing multi-horizon forecasts that span up to one year. Each horizon is specified by a lead time (LT), number of periods from the FCT to the start of the horizon, and a span (SP), number of periods covered by the forecast, combination. To assess the effects of each innovation, we ablate by removing components one at a time. MQTransformer is denoted as Dec-Enc & Dec-Self Att, Dec-Enc Att – which contains only the horizon-specific decoder-encoder unit – and Baseline – the vanilla MQ-CNN model. MQ-CNN is selected as the baseline since prior work2 demonstrate that MQ-CNN outperforms MQ-RNN and DeepAR on this dataset, and as can be seen in Table 4, MQ-CNN similarly outperforms MQ-RNN and DeepAR on public datasets.
|
| 131 |
+
|
| 132 |
+
We conduct our experiments on a subset of products $\sim 2$ million products) in the US store. Each model is trained using a single machine with 8 NVIDIA V100 Tensor Core GPUs, on three years of demand data (2015-2018); one year (2018-2019) is held out for back-testing.
|
| 133 |
+
|
| 134 |
+
Forecast Accuracy Table 3 summarizes several key metrics that demonstrate the accuracy improvements achieved by adding our proposed attention mechanisms to the MQ-CNN architecture – the full set of results can be found in Appendix C. Introducing the Horizon-Specific Decoder-Encoder attention alone yields improvements along all metrics evaluated. Overall we see a $1 . 6 \%$ improvement in P50 QL and a $3 . 9 \%$ improvement in P90 QL. Notably, the attention mechanism yields significant improvements on short LT-SP (LT-SP 0/4).
|
| 135 |
+
|
| 136 |
+
Further, Table 3 demonstrates improved performance on seasonal peaks and promotions. Observe that while MQ-CNN performs well on some seasonal peaks, it also is misaligned and fails to ramp-down post-peak – post-peak ramp-down issues occur when the model continues to forecast high for target weeks after the peak week. By including MQTransformer’s attention mechanisms in the architecture, we see a $43 \%$ improvement for Seasonal Peak 1 and a $56 \%$ improvement on Post-Peak Rampdown. In retail, promotions are used to provide a demand lift for products. Accordingly, a model should be able to react to the upcoming promotion and forecast an accurate lift in demand for the target weeks in which the promotion is placed. From Table 3 we see that MQTransformer achieves a see a $49 \%$ on items with Promotion Type 1 versus the baseline.
|
| 137 |
+
|
| 138 |
+
Forecast Volatility We study the effect of our proposed attention mechanisms on excess forecast volatility using diagnostic tools recently proposed by Stine and Foster (2020b;a). Figure 2 plots the process $\left\{ V _ { t } \right\}$ (see Section 2). In the plot, the lines should appear horizontal under the MMFE. Any deviation above this (on an aggregate level) indicates excess volatility in the forecast evolution. We can observe that while none of the models produce ideal forecasts, both attention models outperform the Baseline with the attention model with both proposed attention mechanisms performing the best in terms of these evolution diagnostics.
|
| 139 |
+
|
| 140 |
+
The green line corresponds to the attention model with only the horizon-specific decoder-encoder attention. We can see that compared to the baseline, this model achieves up to $2 7 \%$ reduction in excess volatility at P50 and $7 \%$ at P90. By also adding decoder-self attention we see a further reduction in excess volatility of an additional $20 \%$ at P50 and $21 \%$ at P90.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Martingale diagnostic process $\{ V _ { t } \}$ averaged over all weeks in test period (2018-2019)
|
| 146 |
+
Figure 3: Forecast evolution analysis on the retail dataset. Left: Martingale Diagnostic Process $\{ \hat { V _ { t } } \}$ . Right: QL by lead time, averaged over target dates from 2016-03-01 through 2016-05-01; QL trajectories are centered around 0.
|
| 147 |
+
|
| 148 |
+
# 4.2 PUBLICLY AVAILABLE DATASETS
|
| 149 |
+
|
| 150 |
+
Following Lim et al. (2019), we consider applications to brick-and-mortar retail sales, electricity load, securities volatility and traffic forecasting. For the retail task, we predict the next 30 days of sales, given the previous 90 days of history. This dataset contains a rich set of static, time series, and known features. At the other end of the spectrum, the electricity load dataset is univariate. See Appendix D for additional information about these tasks. Table 4 compares MQTransformer’s performance with other recent works3 – DeepAR (Salinas et al., 2020), ConvTrans (Li et al., 2019), MQ-RNN (Wen et al., 2017), and TFT (Lim et al., 2019).
|
| 151 |
+
|
| 152 |
+
Our MQTransformer architecture is competitive with or beats the state-of-the-art on the electricity load, volatility and traffic prediction tasks, as shown in Table 4. On the most challenging task, it dramatically outperforms the previously reported state of the art by $38 \%$ and the MQ-CNN baseline by $5 \%$ at P50 and $11 \%$ at P90. Because MQ-CNN and MQTransformer are trained using forking sequences, we can use the entire training population, rather than downsample as is required to train TFT (Lim et al., 2019) – see Appendix D. To ascertain what portion of the gain is due to learning from more trajectories, versus our innovations alone, we retrain the optimal MQTransformer architecture using a random sub-sample of 450K trajectories (the same sampling procedure as TFT) and without using forking sequences – the results are indicated in parentheses in Table 4. We can observe that MQTransformer still dramatically outperforms TFT, and its performance is similar to the MQ-CNN baseline trained on all trajectories.
|
| 153 |
+
|
| 154 |
+
Furthermore, on the Favorita retail forecasting task, Figure 3 shows that as expected, MQTransformer substantially reduces excess volatility in the forecast evolution compared to the MQ-CNN baseline. Somewhat surprisingly, TFT exhibits much lower volatility than does MQTransformer. In Figure 3, the right hand plot displays quantile loss as the target date approaches – trajectories for each model are zero centered to emphasize the trends exhibited. While TFT is less volatile, it is also less accurate as it fails to incorporate newly available information. By contrast, MQTransformer is both less volatile and more accurate when compared with MQ-CNN. See Appendix D for more details on the experiment setup and training procedure used.
|
| 155 |
+
|
| 156 |
+
Table 4: P50 (50th percentile) and P90 (90th percentile) QL on electricity and retail datasets with the best results on each task emphasized. For the retail task, MQTransformer has results in parentheses, which correspond to training without forking sequences on 450K trajectories only.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">TASK</td><td colspan="6">P50 QL</td></tr><tr><td>DEEPAR</td><td>CONVTRANS</td><td>MQ-RNN</td><td>MQ-CNN</td><td>TFT</td><td>MQTRANSFORMER</td></tr><tr><td>ELECTRICITY</td><td>0.075</td><td>0.059</td><td>0.077</td><td>0.076</td><td>0.055</td><td>0.057</td></tr><tr><td>RETAIL</td><td>0.574</td><td>0.429</td><td>0.379</td><td>0.269</td><td>0.354</td><td>0.256 (0.2645)</td></tr><tr><td>VOLATILITY</td><td>0.050</td><td>0.047</td><td>0.042</td><td>0.042</td><td>0.039</td><td>0.039</td></tr><tr><td>TRAFFIC</td><td>0.161</td><td>0.122</td><td>0.117</td><td>0.115</td><td>0.095</td><td>0.101</td></tr><tr><td rowspan="2"></td><td colspan="6">P90 QL</td></tr><tr><td>DEEPAR</td><td>CONVTRANS</td><td>MQ-RNN</td><td>MQ-CNN</td><td>TFT</td><td>MQTRANSFORMER</td></tr><tr><td>ELECTRICITY</td><td>0.040</td><td>0.034</td><td>0.036</td><td>0.035</td><td>0.027</td><td>0.027</td></tr><tr><td>RETAIL</td><td>0.230</td><td>0.192</td><td>0.152</td><td>0.118</td><td>0.147</td><td>0.106 (0.109)</td></tr><tr><td>VOLATILITY</td><td>0.024</td><td>0.024</td><td>0.021</td><td>0.020</td><td>0.020</td><td>0.019</td></tr><tr><td>TRAFFIC</td><td>0.099</td><td>0.081</td><td>0.082</td><td>0.077</td><td>0.070</td><td>0.068</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Computational Efficiency For purposes of illustration, consider the Retail dataset. Prior work (Lim et al., 2019) was only able to make use of 450K out of 20M trajectories, and the optimal TFT architecture required 13 minutes per epoch (minimum validation error at epoch $6 ) $ using a single V100 GPU. By contrast, our innovations are compatible with forking sequences, and thus our architecture can make use of all available trajectories. To train, MQTransformer requires only 5 minutes per epoch (on 20M trajectories) using a single V100 GPU (minimum validation error reached after 5 epochs). Of course, some of the differences in runtime can be attributed to use of different deep learning frameworks, but it is clear that MQTransformer (and other MQForecasters) can be trained much more efficiently than models like TFT and DeepAR.
|
| 161 |
+
|
| 162 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 163 |
+
|
| 164 |
+
In this work, we present three novel architecture enhancements that improve bottlenecks in state of the art MQ-Forecasters. We presented a series of architectural innovations for probabilistic time-series forecasting including a novel alignment decoder-encoder attention, as well as a decoder self-attention scheme tailored to the problem of multi-horizon forecasting. To the best of our knowledge, this is the first work to consider the impact of model architecture on forecast evolution. We also demonstrated how position embeddings can be learned directly from domain-specific event indicators and horizonspecific contexts can improve performance for difficult sub-problems such as promotions or seasonal peaks. Together, these innovations produced significant improvements in the excess variation of the forecast and accuracy across different dimensions. Finally, we applied our model to several public datasets, where it outperformed the baseline architecture by $5 \%$ at P50, $11 \%$ at P90 and the previous reported state-of-the-art (TFT) by $38 \%$ on the most complex task. On the three less complex public datasets, our architecture achieved parity or slightly exceeded previous state of the art results. Beyond accuracy gains, by making our architecture innovations compatible with forking sequences, our model achieves massive increases in throughput compared to existing transformer architectures for time-series forecasting. An interesting direction we intend to explore in future work is incorporating encoder self-attention so that the model can leverage arbitrarily long historical time series, rather than the fixed length consumed by the convolution encoder.
|
| 165 |
+
|
| 166 |
+
REFERENCES
|
| 167 |
+
AUGENBLICK, N. and RABIN, M. (2019). Belief movement, uncertainty reduction, and rational updating. Tech. rep., Haas School of Business, University of California, Berkeley.
|
| 168 |
+
BAHDANAU, D., CHO, K. and BENGIO, Y. (2014). Neural machine translation by jointly learning to align and translate. arXiv:1409.0473.
|
| 169 |
+
BENIDIS, K., RANGAPURAM, S. S., FLUNKERT, V., WANG, B., MADDIX, D., TURKMEN, C., GASTHAUS, J., BOHLKE-SCHNEIDER, M., SALINAS, D., STELLA, L. ET AL. (2020). Neural forecasting: Introduction and literature overview. arXiv:2004.10240.
|
| 170 |
+
BRAY, R. L. and MENDELSON, H. (2012). Information Transmission and the Bullwhip Effect: An Empirical Investigation. Management Science 58 860–875.
|
| 171 |
+
CHEN, F., DREZNER, Z., RYAN, J. K. and SIMCHI-LEVI, D. (2000). Quantifying the Bullwhip Effect in a Simple Supply Chain: The Impact of Forecasting, Lead Times, and Information. Management Science 46 436–443.
|
| 172 |
+
CHENG, J., DONG, L. and LAPATA, M. (2016). Long short-term memory-networks for machine reading. arXiv:1601.06733.
|
| 173 |
+
CINAR, Y. G., MIRISAEE, H., GOSWAMI, P., GAUSSIER, E., AIT-BACHIR, A. and STRIJOV, V. (2017). Position-based content attention for time series forecasting with sequence-to-sequence rnns. In ICONIP.
|
| 174 |
+
DAI, Z., YANG, Z., YANG, Y., CARBONELL, J., LE, Q. V. and SALAKHUTDINOV, R. (2019). Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context. In ACL.
|
| 175 |
+
DEVLIN, J., CHANG, M.-W., LEE, K. and TOUTANOVA, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL-HLT.
|
| 176 |
+
GALASSI, A., LIPPI, M. and TORRONI, P. (2019). Attention, please! a critical review of neural attention models in natural language processing. arXiv:1902.02181.
|
| 177 |
+
GASPARIN, A., LUKOVIC, S. and ALIPPI, C. (2019). Deep Learning for Time Series Forecasting: The Electric Load Case. arXiv:1907.09207.
|
| 178 |
+
HEATH, D. C. and JACKSON, P. L. (1994). Modeling the evolution of demand forecasts with application to safety stock analysis in production/distribution systems. IIE transactions 26 17–30.
|
| 179 |
+
HUANG, C.-Z. A., VASWANI, A., USZKOREIT, J., SHAZEER, N., SIMON, I., HAWTHORNE, C., DAI, A. M., HOFFMAN, M. D., DINCULESCU, M. and ECK, D. (2018). Music Transformer: Generating Music with Long-Term Structure. arXiv:1809.04281.
|
| 180 |
+
KIM, S. and KANG, M. (2019). Financial series prediction using Attention LSTM. arXiv:1902.10877.
|
| 181 |
+
KINGMA, D. P. and BA, J. (2015). Adam: A Method for Stochastic Optimization. In ICLR.
|
| 182 |
+
LI, S., JIN, X., XUAN, Y., ZHOU, X., CHEN, W., WANG, Y.-X. and YAN., X. (2019). Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In NIPS.
|
| 183 |
+
LIM, B., ARIK, S. O., LOEFF, N. and PFISTER, T. (2019). Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting. arXiv:1912.09363.
|
| 184 |
+
LUONG, M.-T., PHAM, H. and MANNING, C. D. (2015). Effective approaches to attention-based neural machine translation. arXiv:1508.04025.
|
| 185 |
+
MADEKA, D., SWINIARSKI, L., FOSTER, D., RAZOUMOV, L., TORKKOLA, K. and WEN, R. (2018). Sample path generation for probabilistic demand forecasting. In ICML workshop on Theoretical Foundations and Applications of Deep Generative Models.
|
| 186 |
+
MUKHOTY, B. P., MAURYA, V. and SHUKLA, S. K. (2019). Sequence to sequence deep learning models for solar irradiation forecasting. In IEEE Milan PowerTech.
|
| 187 |
+
NASCIMENTO, R. C., SOUTO, Y. M., OGASAWARA, E., PORTO, F. and BEZERRA, E. (2019). STConvS2S: Spatiotemporal Convolutional Sequence to Sequence Network for weather forecasting. arXiv:1912.00134.
|
| 188 |
+
SALINAS, D., FLUNKERT, V., GASTHAUS, J. and JANUSCHOWSKI, T. (2020). Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting 36 1181–1191.
|
| 189 |
+
SHAW, P., USZKOREIT, J. and VASWANI, A. (2018). Self-Attention with Relative Position Representations. In NAACL.
|
| 190 |
+
SHUN-YAO SHIH AND FAN-KENG SUN AND HUNG-YI LEE (2019). Temporal pattern attention for multivariate time series forecasting. Machine Learning 108 1421–1441.
|
| 191 |
+
STINE, R. and FOSTER, D. (2020a). Martingale Descriptions of the Evolution of Forecasts. Tech. rep., Manuscript in preparation.
|
| 192 |
+
STINE, R. and FOSTER, D. (2020b). Martingale Diagnostics. Tech. rep., Manuscript in preparation.
|
| 193 |
+
SUTSKEVER, I., VINYALS, O. and LE, Q. V. (2014). Sequence to sequence learning with neural networks. In NIPS.
|
| 194 |
+
TALEB, N. N. (2018). Election predictions as martingales: an arbitrage approach. Quantitative Finance 18 1–5.
|
| 195 |
+
TALEB, N. N. and MADEKA, D. (2019). All roads lead to quantitative finance. Quantitative Finance 19 1775–1776.
|
| 196 |
+
VAN DEN OORD, A., DIELEMAN, S., ZEN, H., SIMONYAN, K., VINYALS, O., GRAVES, A., KALCHBRENNER, N., SENIOR, A. and KAVUKCUOGLU, K. (2016). Wavenet: A generative model for raw audio. arXiv:1609.03499.
|
| 197 |
+
VASWANI, A., SHAZEER, N., PARMAR, N., USZKOREIT, J., JONES, L., GOMEZ, A. N., KAISER, L., and POLOSUKHIN, I. (2017). Attention is all you need. In NIPS.
|
| 198 |
+
WEN, R. and TORKKOLA, K. (2019). Deep Generative Quantile-Copula Models for Probabilistic Forecasting. In ICML Time Series Workshop.
|
| 199 |
+
WEN, R., TORKKOLA, K., NARAYANASWAMY, B. and MADEKA, D. (2017). A multi-horizon quantile recurrent forecaster. In NIPS Time Series Workshop.
|
| 200 |
+
WILLIAMS, D. (1991). Probability with Martingales. Cambridge University Press.
|
| 201 |
+
XU, K., BA, J., KIROS, R., CHO, K., COURVILLE, A., SALAKHUDINOV, R., ZEMEL, R. and BENGIO, Y. (2015). Show, attend and tell: Neural image caption generation with visual attention. In ICML.
|
| 202 |
+
YU, R., ZHENG, S., ANANDKUMAR, A. and YUE, Y. (2017). Long-term Forecasting using Higher Order Tensor RNNs. arXiv:1711.00073.
|
| 203 |
+
|
| 204 |
+
# A ADDITIONAL BACKGROUND AND RELATED WORK
|
| 205 |
+
|
| 206 |
+
# A.1 ATTENTION MECHANISMS
|
| 207 |
+
|
| 208 |
+
Attention mechanisms can be viewed as a form of content based addressing, that computes an alignment between a set of queries and keys to extract a value. Formally, let $\mathbf { q } _ { 1 } , \ldots , \mathbf { q } _ { t }$ , $\mathbf { k } _ { 1 } , \ldots , \mathbf { k } _ { t }$ and $\mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { t }$ be a series of queries, keys and values, respectively. The $\bar { s } ^ { t h }$ attended value is defined as $\begin{array} { r } { \mathbf { c } _ { s } = \sum _ { i = 1 } ^ { t } \mathrm { s c o r e } ( \mathbf { q } _ { s } , \mathbf { k } _ { t } ) \mathbf { v } _ { t } } \end{array}$ , where score is a scoring function – commonly score $( \mathbf { u } , \mathbf { v } ) : = \mathbf { u } ^ { \top } \mathbf { v }$ In the vanilla transformer model, $\mathbf { q } _ { s } = \mathbf { k } _ { s } = \mathbf { v } _ { s } = \mathbf { h } _ { s }$ , where $\mathbf { h } _ { s }$ is the hidden state at time $s$ . Because attention mechanisms have no concept of absolute or relative position, some sort of position information must be provided. Vaswani et al. (2017) uses a sinusoidal positional encoding added to the input to an attention block, providing each token’s position in the input time series.
|
| 209 |
+
|
| 210 |
+
# B MQTRANSFORMER ARCHITECTURE DETAILS
|
| 211 |
+
|
| 212 |
+
In this section we describe in detail the layers in our MQTransformer architecture, which is based off of the MQ-Forecaster framework (Wen et al., 2017) and uses a wavenet encoder (van den Oord et al., 2016) for time-series covariates. Before describing the layers in each component, Figure 4 outlines the MQTransformer architecture. On different datasets, we consider the following variations: choice of encoding for categorical variables, a tunable parameter $d _ { h }$ (dimension of hidden layers), dropout rate $p _ { d r o p }$ , a list of dilation rates for the wavenet encoder, and a list of dilation rates for the position encoding. The ReLU activation function is used throughout the network.
|
| 213 |
+
|
| 214 |
+
# B.1 INPUT EMBEDDINGS AND POSITION ENCODING
|
| 215 |
+
|
| 216 |
+
Static categorical variables are encoded using either one-hot encoding or an embedding layer. Timeseries categorical variables are one-hot encoded, and then passed through a single feed-forward layer of dimension $d _ { h }$ .
|
| 217 |
+
|
| 218 |
+
The global position encoding module takes as input the known time-series covariates, and consist of a stack of dilated, bi-directional 1-D convolution layers with $d _ { h }$ filters. After each convolution is a ReLU activation, followed by a dropout layer with rate $p _ { d r o p }$ , and the local position encoding is implemented as a single dense layer of dimension $d _ { h }$ .
|
| 219 |
+
|
| 220 |
+
# B.2 ENCODER
|
| 221 |
+
|
| 222 |
+
After categorical encodings are applied, the inputs are passed through the encoder block. The encoder consists of two components: a single dense layer to encode the static features, and a stack of dilated, temporal convolutions. The the time-series covariates are concatenated with the position encoding to form the input to the convolution stack. The output of the encoder block is produced by replicating the encoded static features across all time steps and concatenating with the output of the convolution.
|
| 223 |
+
|
| 224 |
+
# B.3 DECODER
|
| 225 |
+
|
| 226 |
+
Please see Table 1 for a description of the blocks in the decoder. The dimension of each head’s in both the horizon-specific and decoder self-attention blocks is $\lceil d _ { h } / 8 \rceil$ . The dense layer used to compute $\mathbf { } c _ { t } ^ { a }$ has dimension $d _ { h }$ . The output block is two layer MLP with hidden layer dimension $d _ { h }$ , and weights are shared across all time points and horizons. The output layer has one output per horizon, quantile pair.
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 4: MQTransformer architecture with learned global/local positional encoding, horizon-specific decoder-encoder attention, and decoder self-attention
|
| 230 |
+
|
| 231 |
+
# C LARGE SCALE DEMAND FORECASTING EXPERIMENTS
|
| 232 |
+
|
| 233 |
+
# C.1 EXPERIMENT SETUP
|
| 234 |
+
|
| 235 |
+
In this section we describe the details of the model architecture and training procedure used in the experiments on the large-scale demand forecasting application.
|
| 236 |
+
|
| 237 |
+
# TRAINING PROCEDURE
|
| 238 |
+
|
| 239 |
+
Because we did not have enough history available to set aside a true holdout set, all models are trained for 100 epochs, and the final model is evaluated on the test set. For the same reason, no hyperparameter tuning was performed.
|
| 240 |
+
|
| 241 |
+
# ARCHITECTURE AND HYPERPARAMETERS
|
| 242 |
+
|
| 243 |
+
The categorical variables consist of static features of the item, and the timeseries categorical variables are event indicators (e.g. holidays). The parameters are summarized in Table 5.
|
| 244 |
+
|
| 245 |
+
Table 5: Parameter settings for Large Scale Demand Forecasting Experiments
|
| 246 |
+
|
| 247 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Encoder Convolution Dilation Rates</td><td>[1,2,4,8,16,32]</td></tr><tr><td>Position Encoding Dilation Rates</td><td>[1,2,4,8,16,20]</td></tr><tr><td>Static Categorical</td><td>One-Hot</td></tr><tr><td>Time-Series Categorical</td><td>One-Hot</td></tr><tr><td>Static Encoder Dimension</td><td>64</td></tr><tr><td>Convolution Filters</td><td>64</td></tr><tr><td>AttentionBlockHeads</td><td>52</td></tr><tr><td>Attention Block Head Dimension</td><td>8</td></tr><tr><td>Dropout Rate</td><td>0.15</td></tr><tr><td>Activation Function</td><td>ReLU</td></tr></table>
|
| 248 |
+
|
| 249 |
+
# C.2 RESULTS
|
| 250 |
+
|
| 251 |
+
Tables 6, 7, and 8 contain the full set of results on the large scale demand forecasting task. Per the discussion in Section 4, we use MQ-CNN as the baseline model and we did not compare to TFT due to scaling issues and the fact that on the public task that was most similar (retail), MQ-CNN significantly outperformed TFT.
|
| 252 |
+
|
| 253 |
+
Quantile loss by horizon Table 6 demonstrates how the attention mechanism yields significant improvements in shorter LTSP (e.g. LTSP 3/1 and LTSP $0 / 4$ ), $7 \%$ improvement in P90 QL for LTSP 3/1 and $7 . 6 \%$ improvement in P90 QL for LTSP 0/4. We still see improvements for longer LTSP, but they are less substantial: $3 . 8 \%$ improvement in P90 QL for LTSP 12/3 and $3 . 9 \%$ improvement in P90 QL for LTSP 0/33. By also adding decoder-self attention, we continue to see improved results for shorter LTSP compared to only decoder-encoder attention, but we do see slight degradations for longer LTSP when comparing to decoder-encoder attention.
|
| 254 |
+
|
| 255 |
+
Promotions Performance In Table 8 we see that MQTransformer outperforms the prior state of the art on all promotion types. After adding the horizon-specific decoder-encoder and decoder-self attentions, versus the baseline, we see a $49 \%$ improvement for Promotion Type 1 products, a $31 \%$ improvement for Promotion Type 2 products, and a $17 \%$ improvement for Promotion Type 3 products.
|
| 256 |
+
|
| 257 |
+
Peak Performance Table 3 illustrates that while MQCNN performs well on some seasonal peaks, it also is misaligned and fails to rampdown post-peak – ramp-down issues occur when the model continues to forecast high for target weeks after the peak week. By including MQTransformer’s attention mechanisms in the architecture, we see a $43 \%$ improvement for Seasonal Peak 1, a $21 \%$ improvement for Seasonal Peak 2, a $7 \%$ improvement for Seasonal Peak 3, and a $56 \%$ improvement on Post-Peak Rampdown.
|
| 258 |
+
|
| 259 |
+
Table 6: 52-week aggregate quantile loss metrics with for a set of representative lead times and spans
|
| 260 |
+
|
| 261 |
+
<table><tr><td>MODEL</td><td colspan="2">ALL LTSP</td><td colspan="2">LTSP 3/1</td><td colspan="2">LTSP 0/4</td></tr><tr><td></td><td>P50</td><td>P90</td><td>P50</td><td>P90</td><td>P50</td><td>P90</td></tr><tr><td>BASELINE</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>DEC-ENC</td><td>0.984</td><td>0.960</td><td>0.950</td><td>0.927</td><td>0.963</td><td>0.931</td></tr><tr><td>DEC-ENC & DEC-SELF</td><td>0.989</td><td>0.984</td><td>0.934</td><td>0.911</td><td>0.948</td><td>0.908</td></tr><tr><td>MODEL</td><td>LTSP 12/3</td><td></td><td>LTSP 0/33</td><td></td><td></td><td></td></tr><tr><td></td><td>P50</td><td>P90</td><td>P50</td><td>P90</td><td></td><td></td></tr><tr><td>BASELINE DEC-ENC</td><td>1.000 0.975</td><td>1.000 0.957</td><td>1.000 0.982</td><td>1.000 0.963</td><td></td><td></td></tr><tr><td></td><td></td><td>0.964</td><td>0.982</td><td>0.981</td><td></td><td></td></tr><tr><td>DEC-ENC & DEC-SELF</td><td>0.960</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 262 |
+
|
| 263 |
+
Table 7: P90 quantile loss metrics on seasonal peak target weeks
|
| 264 |
+
|
| 265 |
+
<table><tr><td>MODEL</td><td>SEASONAL PEAK 1</td><td>SEASONAL PEAK 2</td><td>SEASONAL PEAK 3</td><td>POST-PEAK RAMPDOWN</td></tr><tr><td>BASELINE</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>DEC-ENC</td><td>0.748</td><td>0.817</td><td>0.962</td><td>0.712</td></tr><tr><td>DEC-ENC +DEC-SELF</td><td>0.698</td><td>0.826</td><td>0.931</td><td>0.639</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 8: P90 quantile loss metrics on item, weeks with promotions
|
| 268 |
+
|
| 269 |
+
<table><tr><td>MODEL</td><td>PROMOTION TYPE 1</td><td>PROMOTION TYPE 2</td><td>PROMOTION TYPE 3</td></tr><tr><td>BASELINE</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>DEC-ENC</td><td>0.706</td><td>0.769</td><td>0.865</td></tr><tr><td>DEC-ENC + DEC-SELF</td><td>0.670</td><td>0.763</td><td>0.851</td></tr></table>
|
| 270 |
+
|
| 271 |
+
# D EXPERIMENTS ON PUBLIC DATASETS
|
| 272 |
+
|
| 273 |
+
In this section we describe the experiment setup used for the public datasets in Section 4.
|
| 274 |
+
|
| 275 |
+
# D.1 DATASETS
|
| 276 |
+
|
| 277 |
+
We evaluate our MQTransformer on four public datasets. We summarize the datasets and preprocessing logic below; the reader is referred to Lim et al. (2019) for more details.
|
| 278 |
+
|
| 279 |
+
# RETAIL
|
| 280 |
+
|
| 281 |
+
This dataset is provided by the Favorita Corporacion (a major Grocery chain in Ecuador) as part of a Kaggle5 to predict sales for thousands of items at multiple brick-and-mortar locations. In total there are 135K items (item, store combinations are treated as distinct entities), and the dataset contains a variety of features including: local, regional and national holidays; static features about each item; total sales volume at each location. The task is to predict log-sales for each (item, store) combination over the next 30 days, using the previous 90 days of history. The training period is January 1, 2015 through December 1, 2015. The following 30 days are used as a validation set, and the 30 days after that as the test set. These 30 day windows correspond to a single forecast creation time. While Lim et al. (2019) extract only 450K samples from the histories during the train window, there are in fact 20M trajectories avalaible for training – because our models can produce forecasts for multiple trajectories (FCDs) simultaneously, we train using all available data from the training window.
|
| 282 |
+
|
| 283 |
+
For the volatility analysis presented in Figure 3, we used a 60 day validation window (March 1, 2016 through May 1, 2016), which corresponds to 30 forecast creation times.
|
| 284 |
+
|
| 285 |
+
# ELECTRICITY
|
| 286 |
+
|
| 287 |
+
This dataset consists of time series for 370 customers of at an hourly grain. The univariate data is augmented with a day-of-week, hour-of-day and offset from a fixed time point. The task is to predict hourly load over the next 24 hours for each customer, given the past seven days of usage. From the training period (January 1, 2014 through September, 1 2019) 500K samples are extracted.
|
| 288 |
+
|
| 289 |
+
# TRAFFIC
|
| 290 |
+
|
| 291 |
+
This dataset consists of lane occupancy information for 440 San Francisco area freeways. The data is aggregated to an hourly grain, and the task is to predict the hourly occupancy over the next 24 hours given the past seven days. The training period consist of all data before 2008-06-15, with the final 7 days used as a validation set. The 7 days immediately following the training window is used for evaluation. The model takes as input lane occupancy, hour of day, day of week, hours from start and an entity identifier.
|
| 292 |
+
|
| 293 |
+
# VOLATILITY
|
| 294 |
+
|
| 295 |
+
The volatility dataset consists of 5 minute sub-sampled realized volatility measurements from 2000- 01-03 to 2019-06-28. Using the past one year’s worth of daily measurements, the goal is to predict the next week’s (5 business days) volatility. The period ending on 2015-12-31 is used as the training set, 2016-2017 as the validation set, and 2018-01-01 through 2019-06-28 as the evaluation set. The region identifier is provided as a static covariate, along with time-varying covariates daily returns, day-of-week, week-of-year and month. A log transformation is applied to the target.
|
| 296 |
+
|
| 297 |
+
# D.2 TRAINING PROCEDURE
|
| 298 |
+
|
| 299 |
+
We only consider tuning two hyper-parameters, size of hidden layer $d _ { h } \in \{ 3 2 , 6 4 , 1 2 8 \}$ and learning rate $\alpha \stackrel { \bullet } { \in } \{ 1 \times 1 0 ^ { - 2 } , 1 \stackrel { \smile } { \times } 1 0 ^ { - 3 } , \stackrel { \bullet } { 1 } \times \stackrel { \cdot } { 1 } 0 ^ { - 4 } \}$ . The model is trained using the ADAM optimizer Kingma and Ba (2015) with parameters $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , $\epsilon = 1 e - 8$ and a minibatch size of 256, for a maximum of 100 epochs and an early stopping patience of 5 epochs.
|
| 300 |
+
|
| 301 |
+
We train a model for each hyperparameter setting in the search grid (6 combinations), select the one with the minimal validation loss and report the selected model’s test-set error in Table 4.
|
| 302 |
+
|
| 303 |
+
# D.3 ARCHITECTURE DETAILS
|
| 304 |
+
|
| 305 |
+
Our MQTransformer architecture used for these experiments contain a single tune-able hyperparameter – hidden layer dimension $d _ { h }$ . Dataset specific settings are used for the dilation rates. For static categorical covariates we use an embedding layer with dimension $d _ { h }$ and use one-hot encoding for time-series covariates. A dropout rate of 0.15 and ReLU activations are used throughout the network. The only difference between this variant and the one used for the non-public large scale demand forecasting task is the use of an embedding layer for static, categorical covariates rather than one-hot encoding.
|
| 306 |
+
|
| 307 |
+
# D.4 REPORTED MODEL PARAMETERS
|
| 308 |
+
|
| 309 |
+
The optimal parameters for each task are given in Table 9.
|
| 310 |
+
|
| 311 |
+
Table 9: Parameter settings of reported MQTransformer model on each public dataset.
|
| 312 |
+
|
| 313 |
+
<table><tr><td>Name</td><td>dh</td><td>a</td><td>Enc.Dilation Rates</td><td>Pos.Dilation Rates</td></tr><tr><td>Electricity</td><td>128</td><td>1×10-3</td><td>[1,2,4,8,16,32]</td><td>[1,2,4,8,8]</td></tr><tr><td>Traffic</td><td>64</td><td>1×10-3</td><td>[1,2,4,8,16,32]</td><td>[1,2,4,8,8]</td></tr><tr><td>Volatility</td><td>128</td><td>1 ×10-3</td><td>[1,2,4,8,16,32,64]</td><td>[1,1,2]</td></tr><tr><td>Retail</td><td>64</td><td>1×10-4</td><td>[1,2,4,8,16,32]</td><td>[1,2,4,8,14]</td></tr></table>
|
md/train/xgGS6PmzNq6/xgGS6PmzNq6.md
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON DYADIC FAIRNESS: EXPLORING AND MITIGATING BIAS IN GRAPH CONNECTIONS
|
| 2 |
+
|
| 3 |
+
Peizhao $\mathbf { L i } ^ { 1 }$ , Yifei Wang1, Han Zhao2, Pengyu $\mathbf { H o n g ^ { 1 } }$ , Hongfu Liu1 1Brandeis University, 2University of Illinois at Urbana-Champaign {peizhaoli,yifeiwang,hongpeng,hongfuliu}@brandeis.edu hanzhao@illinois.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Disparate impact has raised serious concerns in machine learning applications and its societal impacts. In response to the need of mitigating discrimination, fairness has been regarded as a crucial property in algorithmic designs. In this work, we study the problem of disparate impact on graph-structured data. Specifically, we focus on dyadic fairness, which articulates a fairness concept that a predictive relationship between two instances should be independent of the sensitive attributes. Based on this, we theoretically relate the graph connections to dyadic fairness on link predictive scores in learning graph neural networks, and reveal that regulating weights on existing edges in a graph contributes to dyadic fairness conditionally. Subsequently, we propose our algorithm, FairAdj, to empirically learn a fair adjacency matrix with proper graph structural constraints for fair link prediction, and in the meanwhile preserve predictive accuracy as much as possible. Empirical validation demonstrates that our method delivers effective dyadic fairness in terms of various statistics, and at the same time enjoys a favorable fairness-utility tradeoff.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The scale of graph-structured data has grown explosively across disciplines (e.g., social networks, telecommunication networks, and citation networks), calling for robust computational techniques to model, discover, and extract complex structural patterns hidden in big graph data. Research work has been proposed for inference learning on potential connections (Liben-Nowell & Kleinberg, 2007), and corresponding algorithms can be used for high-quality link prediction and recommendations (Adamic & Adar, 2003; Sarwar et al., 2001; Qi et al., 2006). In this work, we study the potential disparate impact in the prediction of dyadic relationships between two instances within a homogeneous graph.
|
| 12 |
+
|
| 13 |
+
Despite the wide applications of link prediction algorithms, serious concerns raised by disparate impact (Angwin et al., 2016; Barocas & Selbst, 2016; Bose & Hamilton, 2019a; Liao et al., 2020) should also be reckoned with by algorithm designers. In an algorithmic context, disparate impact often describes the disparity in influential decisions which essentially derives from the characteristics protected by anti-discrimination laws or social norms. Unfortunately, this negative impact derived from biased data and conventional algorithms occurs in many applications including link prediction. One example is that a user recommender system follows the proximity principle (individuals are more likely to interact with similar individuals) or existing connections with intrinsic bias. Such an operating mode would deliver biased recommendations dominated by sensitive attributes. For example, users with the same religion or ethnic group are more likely to be recommended to a user, and consequently generate segregation in social relations by long-term accumulation (Hofstra et al., 2017). Another example can be noticed in news streaming. When a news app has collected the political profile from a user, in pursuit of the user preference in news streaming, the system might only deliver politicking that the user is predisposed to agree with, therefore skews a user’s scope and narrows the view by selectively displaying reality (Pariser, 2011). To alleviate these concerns, an algorithm should perform a link prediction without being biased by the sensitive attribute of the two instances, and should also stream diverse and preferred recommendations.
|
| 14 |
+
|
| 15 |
+
Motivated by the potential bias in real cases, in this paper we propose dyadic fairness for the link prediction problem in homogeneous graphs, where the dyadic fairness criterion expects the predictions to be statistically independent of the sensitive attributes from the given two vertices. We focus our scope on Graph Neural Networks (GNNs), which have already shown remarkable capacity in graph representation learning by message passing along the graph structure (Xu et al., 2018; 2020; Ying et al., 2018; Wang et al., 2019; Fan et al., 2019; Li et al., 2020). Within the pipeline of GNNs, given an arbitrary graph, we theoretically analyze the relationship between dyadic fairness and the graph connections. Our findings suggest adapting weights on existing edges in a graph can contribute to dyadic fairness conditionally. Continuing with our theoretical findings, we propose FairAdj, an algorithm to empirically learn a fair adjacency matrix by updating the normalized adjacency matrix while keeping the original graph structure unchanged. Integrating with a utility objective function, the proposed algorithm seeks supplied dyadic fairness and link predictive utility simultaneously.
|
| 16 |
+
|
| 17 |
+
Our definition of dyadic fairness in a graph context is inspired by the statistical metrics in group fairness (Dwork et al., 2012; Kusner et al., 2017). First, vertices in a graph are categorized into several groups according to a protected attribute. Then, the dyadic fairness criterion asks some standard statistics such as positive outcomes or false positive rate on link score to be approximately equalized across intra and inter groups. Essentially, such a requirement asks for a more diverse prediction between and within different groups defined by the protected attribute, hence it also allows to mitigate social segregation by asking for more interactions across different protected groups in the graph.
|
| 18 |
+
|
| 19 |
+
Empirically, we present studies on six real-world social and citation networks to demonstrate the effectiveness of the proposed method. We conduct evaluations towards seven measurements of both utility and dyadic fairness. Comparing to other baseline methods (Kipf & Welling, 2016b; Grover & Leskovec, 2016; Rahman et al., 2019; Bose & Hamilton, 2019b), we consistently observe improvements from two aspects. First, dyadic fairness metrics verify that our method can minimize the statistical gap between the predictions of intra and inter links. Second, in terms of utility, our results are consistent with the existing literature (Zhao & Gordon, 2019; Fish et al., 2016; Calders et al., 2009), that satisfying fairness can potentially lead to a decrease in utility. However, our algorithm enjoys a more favorable fairness-utility tradeoff (same in fairness but less sacrifice in utility, and vice versa) when compared to previous works. Additionally, to approach the real application cases, we also showcase a direct product that comes from dyadic fairness: our method can effectively stream more diverse recommendations containing instances holding different kinds of sensitive attributes.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
In this section we mainly review some closely related work in both fair machine learning and graph representation learning. We also briefly describe and discuss several existing works on learning fair node representations.
|
| 24 |
+
|
| 25 |
+
Fair Machine Learning. Various types of fairness notions have been proposed and studied, including group fairness (Kusner et al., 2017; Kearns et al., 2018; 2019), individual fairness (Dwork et al., 2012), and preference-based notions (Zafar et al., 2017a; Ustun et al., 2019). Embracing these definitions, relevant algorithms involving fair constraints have been proposed. Zemel et al. (2013) propose a method to find a good representation to maximize utility while preserving both group and individual fairness. Following works on fair representation learning use autoencoder (Madras et al., 2018) or adversarial training (Zhao & Gordon, 2019; Zhao et al., 2019; Edwards & Storkey, 2015; Louizos et al., 2016) to simultaneously remove the sensitive patterns while preserving enough information for prediction. Zafar et al. (2017b) optimize for decision boundary fairness through regularization in logistic regression and support vector machines, and some other works achieve fairness by optimal transport between sensitive groups (Gordaliza et al., 2019; Jiang et al., 2019) and fair kernel methods (Donini et al., 2018). However, most proposed learning algorithms for fairness are mainly built on independent and identically distributed data, which are not suitable to be directly applied to graph-structured data with dyadic fairness.
|
| 26 |
+
|
| 27 |
+
Graph Representation Learning. Representation learning on graphs is formulated to convert a structural graph into a low-dimensional space while preserving the discriminative and structural representations. Efficient graph analytic methods (Von Luxburg, 2007; Tang et al., 2015; Perozzi et al., 2014; Grover & Leskovec, 2016; Xu et al., 2019) can benefit a series of downstream applications including node classification (Wang et al., 2017), node clustering (Nie et al., 2017), link prediction (Zhang & Chen, 2018) and graph classification as well. Recently, Graph Neural Networks (GNNs) have shown remarkable capacity in graph representation learning, with emergent varieties (Kipf & Welling, 2016a; Velickovi ˇ c et al., 2017; Hamilton et al., 2017) consistently deliver- ´ ing promising results. Our work uses GNNs for graph representation learning but targets improving dyadic fairness in link prediction.
|
| 28 |
+
|
| 29 |
+
Fair Graph Embedding. As fairness in graph-structured data a relatively new topic for research, only a few studies have investigated the fair issues in graph representation learning. Rahman et al. (2019) first proposed Fairwalk, a random walk based graph embedding method that revises the transition probability according to the vertex’s sensitive attributes. Following the idea of adversarially removing sensitive patterns (Madras et al., 2018), Liao et al. (2020) proposed to use adversarial training on vertex representations to minimize the marginal discrepancy. This work mainly focuses on learning node representations that are free of sensitive attributes, which is different from ours. Other works includes fair collaborative filtering (Yao & Huang, 2017), item recommendation (Steck, 2018; Chakraborty et al., 2019) in bipartite graphs, and fair graph covering problem (Rahmattalabi et al., 2019).
|
| 30 |
+
|
| 31 |
+
# 3 PRELIMINARIES
|
| 32 |
+
|
| 33 |
+
Let $\mathcal { G } : = ( \nu , \mathcal { E } )$ as a graph with a fix set of vertices $\nu$ and edges $\mathcal { E }$ , where vertex features with $M$ dimensions are represented by $X \in \mathbb { R } ^ { N \times M }$ . A nonnegative adjacency matrix $A \in \mathbb { R } ^ { N \times N }$ describes the relations between every pair of vertices. The element $a _ { v u }$ in $A$ represents the weight on the linkage bridging $v$ and $u$ , and is set to zero if no link exists. Every vertex holds a sensitive attribute, and we use $S ( v )$ to denotes the sensitive attribute as well as the sensitive group membership of $v$ . Let $\Gamma ( v )$ be the set of 1-hop neighbors of $v$ including self-loop. Edge $( v , u )$ is called intra if $S ( v ) = S ( u )$ , and inter implies $S ( v ) \neq S ( u )$ . $| S |$ denotes the cardinality of group $S$ . For a binary sensitive attribute with two groups $S _ { 0 }$ and $S _ { 1 }$ separated from the graph, $\widetilde { S _ { 0 } } : = \{ v \in S _ { 0 } \mid \Gamma ( v ) \cap S _ { 1 } \neq \emptyset \}$ represents the set of vertices in $S _ { 0 }$ which locate on the boundary and has connections with $S _ { 1 }$ , and the same for $\widetilde { S _ { 1 } }$ . Set $U$ to be the discrete uniform distribution over the set of vertices $\nu$ . Suppose a bivariate flink prediction function $g ( \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } ^ { D } \to \mathbb { R }$ , that given two vectors of the embedded vertices representations, a value is obtained showing the model belief that these two vertices are potentially linked.
|
| 34 |
+
|
| 35 |
+
Having these basic notations, we consider the disparity in link prediction bridging on intra and inter sensitive groups. The general purpose of dyadic fairness is to predict links independently of whether two vertices having the same sensitive attribute or not. We extend from demographic parity (Edwards & Storkey, 2015; Kipf & Welling, 2016b; Madras et al., 2018; Zemel et al., 2013) to formulate a specific criteria for dyadic fairness. In a binary classification problem, demographic parity expects a classifier gives positive outcomes to two sensitive groups at the same rate. We turn the two groups in the content of demographic parity into the groups of intra and inter links. Ideally, achieving dyadic fairness will bring intra and inter link predictions at the same rate from a bag of candidate links.
|
| 36 |
+
|
| 37 |
+
Having vertices representation $v$ and $u$ , dyadic fairness can be mathematically formulated as
|
| 38 |
+
|
| 39 |
+
Definition 3.1. A link prediction algorithm satisfies dyadic fairness if the predictive score satisfy
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { P r } ( g ( u , v ) | S ( u ) = S ( v ) ) = \operatorname* { P r } ( g ( u , v ) | S ( u ) \neq S ( v ) )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
To quantify the fairness, we establish dyadic fairness on link prediction upon a fixed set of vertices, and models the expectation of absolute difference in score outcome across the groups of intra and inter links. Note that we also comprehensively evaluate our model on fairness by other four statistics gap extended from (Hardt et al., 2016) in Section 6.
|
| 46 |
+
|
| 47 |
+
# 4 HOW GRAPH CONNECTIONS AFFECT FAIRNESS
|
| 48 |
+
|
| 49 |
+
In this section, we propose a chain of theoretical analyses1 established on a variant of demographic parity and graph neural networks to associate dyadic fairness with graph connections. We first demonstrate demographic parity in the outcomes of link prediction can be sufficiently reduced to the achievement of fair vertex representations when employing an inner product function for link prediction. Suggested by the sufficiency, we reveal how the pipeline of a one-layer graph neural network can affect the demographic parity, and draw the conclusion that for an arbitrary graph using GNNs for embedding, properly regulating the weights on existing graph connections can contribute to fairness conditionally. The theoretical findings motivate our algorithmic design as presented in the next section. Without loss of generality, in this section, we consider the sensitive attribute to be binary, where two sensitive groups $S _ { 0 }$ and $S _ { 1 }$ can be separated from the graph, but show the cases with sensitive attributes in multiple categorical values in our experimental section.
|
| 50 |
+
|
| 51 |
+
Proposition 4.1. For a link prediction function $g ( \cdot , \cdot )$ modeled as inner product $g ( v , u ) = v ^ { \top } \Sigma u$ where $\Sigma \in \mathbb { S } _ { + + } ^ { M }$ is a positive-definite matrix, $\exists Q > 0 , \forall v \sim \mathcal { V }$ , $\| v \| _ { 2 } \le Q$ , for $\mathbb { E } _ { v \sim U } [ v ] \in \mathbb { R } ^ { M }$ , for dyadic fairness based on demographic parity, if $\| \mathbb { E } _ { v \sim U } [ v \mid v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ v \mid v \in S _ { 1 } ] \| _ { 2 } \leq \delta$ ,
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \lambda _ { \mathrm { D P } } : = \left| \mathbb { E } _ { ( v , u ) \sim U \times U } [ g ( v , u ) \mid S ( v ) = S ( u ) ] - \mathbb { E } _ { ( v , u ) \sim U \times U } [ g ( v , u ) \mid S ( v ) \neq S ( u ) ] \right| \leq Q \| { \Sigma } \| _ { 2 } \cdot \delta . } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Remark 1. Proposition 4.1 can be applied for a general inner product function in Euclidean space, where $\Sigma$ directionally and differently scales two input vectors. When setting $\Sigma$ to an identity matrix, function $g ( \cdot , \cdot )$ reduces to dot product and is widely used in a series of research work on link prediction (Kipf & Welling, 2016b; Trouillon et al., 2016; Yao & Huang, 2017).
|
| 58 |
+
|
| 59 |
+
The above proposition implies fair vertex representations is a sufficient condition to achieve demographic parity in link prediction. Suggested by the sufficiency, the approach to fairness could be reduced to achieving vertex representations with a small discrepancy between sensitive groups. With the proposition, we are ready to proceed to understand fairness within graph neural networks and reveal how the structure or connections of a graph could affect demographic parity.
|
| 60 |
+
|
| 61 |
+
A single layer GNN can be generically written as $\mathrm { G N N } _ { \theta } ( X , { \widetilde { A } } ) : = \rho ( { \widetilde { A } } X W _ { \theta } ) $ , where $\rho$ is a nonlinear activation function, A is the normalized adjacency matrix, and $W _ { \theta }$ is the trainable weight matrix. One GNN layer can be decomposed into two disjoint phases: a vertex feature smoothing phase over the graph using $\widetilde { A }$ , and a feature embedding phase using $W _ { \theta }$ and $\rho$ . Concretely, we consider left normalization $\widetilde { A } = D ^ { - 1 } A$ $D$ is the degree matrix) for feature smoothing. Equivalently, at an individual level, for each vertex it is one-hop mean-aggregation $\begin{array} { r } { \operatorname { A g g } ( v ) : = \bar { \deg _ { w } } ( v ) ^ { - 1 } \sum _ { u \in \Gamma ( v ) } a _ { v u } u } \end{array}$ where $\begin{array} { r } { \deg _ { w } ( v ) : = \sum _ { u \in \Gamma ( v ) } a _ { v u } } \end{array}$ stands for the weighted degree of vertex $v$ .
|
| 62 |
+
|
| 63 |
+
We respectively abbreviate $\mathbb { E } _ { v \sim U } [ v | v \in S _ { 0 } ]$ and $\mathbb { E } _ { v \sim U } [ v | v \in S _ { 1 } ]$ as $\mu _ { 0 }$ and $\mu _ { 1 }$ . Let $\sigma$ denotes the maximal deviation of vertex representations, namely, $\forall v \in S _ { 0 }$ , $\| v - \mu _ { 0 } \| _ { \infty } \leq \sigma$ , and $\forall v \in S _ { 1 }$ , $\| v - \mu _ { 1 } \| _ { \infty } \leq \sigma$ . Let $D _ { \mathrm { m a x } } : = \operatorname* { m a x } _ { v \in \mathcal { V } } \deg _ { w } ( v )$ be the maximal weighted degree in $\mathcal { G }$ , $m _ { w } : =$ P S(v)6=S(u) avu be the summation of weights on inter links. With these notations, we show how the discrepancy between $\mu _ { 0 }$ and $\mu _ { 1 }$ changes after conducting feature smoothing for one time over the graph.
|
| 64 |
+
|
| 65 |
+
Theorem 4.1. For an arbitrary graph with nonnegative link weights, after conducting one mean$\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } : = \Vert \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 1 } ] \Vert _ { 2 }$ ancy between two sensitive groupsis bounded by √
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { \operatorname* { m a x } \{ \alpha _ { \mathrm { m i n } } \| \mu _ { 0 } - \mu _ { 1 } \| _ { \infty } - 2 \sigma , 0 \} \leq \Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } \leq \alpha _ { \mathrm { m a x } } \| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 } + 2 \sqrt { M } \sigma , } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r } { \iota _ { \mathrm { m i n } } = \operatorname* { m i n } \{ \alpha _ { 1 } , \alpha _ { 2 } \} , \alpha _ { \mathrm { m a x } } = \operatorname* { m a x } \{ \alpha _ { 1 } , \alpha _ { 2 } \} , \alpha _ { 1 } = | 1 - \frac { m _ { w } } { D _ { \mathrm { a a x } } } \left( \frac { 1 } { | S _ { 0 } | } + \frac { 1 } { | S _ { 1 } | } \right) | , \alpha _ { 2 } = | 1 - \frac { | \widetilde { S _ { 0 } } | } { | S _ { 0 } | } - \frac { | \widetilde { S _ { 1 } } | } { | S _ { 1 } | } | . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Remark 2. Theorem 4.1 shows the lower and upper bound given by the graph structure and the maximum deviation $\sigma$ of vertex representations in each sensitive group on demographic parity after conducting one aggregation function on vertices. The contraction coefficient $\alpha _ { \mathrm { m a x } }$ is a maximum of two absolute terms $\alpha _ { 1 }$ and $\alpha _ { 2 }$ , where $\alpha _ { 2 }$ is a constant predetermined by the graph connections. It is worth pointing out that although in the worst case $\alpha _ { \mathrm { m a x } }$ could be 1, e.g., in a complete bipartite graph, in most practical graphs it is strictly less than 1, hence the above upper bound corresponds to a contraction lemma but under some additional error introduced by deviation $\sigma$ . We also provide several illustrative graph diagrams for the contraction of this theorem in Appendix B.
|
| 76 |
+
|
| 77 |
+
To approximate demographic parity after feature smoothing, Theorem 4.1 inspires a strategy to regulate the weights on graph connections to change $\alpha _ { 1 }$ in $\alpha _ { \mathrm { m a x } }$ so as to minimize the upper bound
|
| 78 |
+
|
| 79 |
+
Input: vertex features $X$ , adjacency matrix $A$ , GNNs parameters $\theta$ , learning rates $\eta _ { \theta }$ and $\eta _ { \widetilde { A } }$
|
| 80 |
+
Normalize adjacency matrix $\widetilde { A } D ^ { - 1 } A$
|
| 81 |
+
Fix the elements with zero in $\widetilde { A }$ and select the non-zero elements for optimization
|
| 82 |
+
while $\theta$ or $\widetilde { A }$ has not converged do for $t = 1$ to $T _ { 1 } \triangleright$ optimize for utility do $\lfloor$ Compute ${ \mathcal L } _ { \mathrm { u t i l } }$ by Eq. (5), $g _ { \theta } \gets \nabla _ { \theta } \mathcal { L } _ { \mathrm { u t i l } } , \quad \theta \gets \theta + \eta _ { \theta } \cdot \mathrm { A d a m } ( \theta , g _ { \theta } )$ for $t = 1$ to $T _ { 2 } \triangleright$ optimize for fairness do $Z \gets \mathbf { G } \mathbf { N } \mathbf { N } _ { \theta } ( X , \widetilde { A } )$ , $\hat { A } Z Z ^ { \top } \triangleright$ reconstruct graph connections Compute ${ \mathcal { L } } _ { \mathrm { f a i r } }$ by Eq. (6), $g _ { \widetilde { A } } \gets \nabla _ { \widetilde { A } } \mathcal { L } _ { \mathrm { f a i r } }$ for $v = 1$ to $N \triangleright$ e eprojected gradient descent do Sort $n$ non-zero elements in $[ \widetilde { A } - \eta _ { \widetilde { A } } g _ { \widetilde { A } } ] _ { v , * }$ in descending order: $e _ { 1 } \geq e _ { 2 } \geq \cdot \cdot \cdot e _ { n }$ $\begin{array} { r } { \gamma \sum _ { j = 1 } ^ { n } \mathbf { 1 } ( e _ { j } + \frac { 1 } { j } ( 1 - \sum _ { i = 1 } ^ { j } e _ { i } ) \geq 0 ) \triangleright \textbf { 1 } } \end{array}$ $\pmb { 1 } ( \cdot )$ :the indicator function $\textstyle { \beta \gets { \frac { 1 } { \rho } } \big ( 1 - \sum _ { i = 1 } ^ { \gamma } \bar { e _ { i } } \big ) }$ for $u = 1$ to $n \triangleright$ update $\widetilde { A }$ do $_ { - } \left[ \widetilde { A } \right] _ { v , u } \gets \operatorname* { m a x } \{ [ \widetilde { A } - \eta _ { \widetilde { A } } g _ { \widetilde { A } } ] _ { v , u } + \beta , 0 \}$
|
| 83 |
+
|
| 84 |
+
Output: Link predictive score between vertex $v$ and $u \gets \mathrm { s i g m o i d } ( \mathbf { G } \mathbf { N } \mathbf { N } _ { \theta } ( v , \widetilde { A } ) ^ { \top } \mathbf { G } \mathbf { N } \mathbf { N } _ { \theta } ( u , \widetilde { A } ) )$
|
| 85 |
+
|
| 86 |
+
for one-layer mean-aggregation. For term $\alpha _ { 1 }$ , obviously if the summation of inter weights are too small $( m _ { w } 0 )$ ) or too large $( m _ { w } D _ { w } \cdot \operatorname* { m i n } \{ | S _ { 0 } | , | S _ { 1 } | \} )$ , $\alpha _ { 1 }$ will approximate to 1. This indicates that increasing the weights on inter links cannot always guarantee to achieve a better demographic parity although inter group connections are always the minority in links, but should regulate this part to a proper range depending on the size of sensitive groups and the connected situation of a graph.
|
| 87 |
+
|
| 88 |
+
We combine the upper bound with the second feature embedding phase. Here we denote $\mu _ { i } ^ { \prime } : =$ $\mathbb { E } _ { v \sim U } [ \mathbf { G } \mathrm { N N } _ { \theta } ( v , \widetilde { A } ) \mid v \in S _ { i } ] , i = 0 , 1 , Q ^ { \prime } : = \operatorname* { s u p } \{ \| \mathbf { G } \mathrm { N N } _ { \theta } ( v , \widetilde { A } ) \| _ { 2 } \mid v \in \mathcal { V } \} .$ .
|
| 89 |
+
|
| 90 |
+
Corollary 4.1. For $\Delta _ { \mathrm { D P } }$ on vertices after passing one layer $\mathrm { { G N N } } _ { \theta } ( X , { \widetilde { A } } ) = \rho ( { \widetilde { A } } X W _ { \theta } )$ , we have:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\Delta _ { \mathrm { D P } } \leq Q ^ { \prime } \| \Sigma \| _ { 2 } \cdot \| \mu _ { 0 } ^ { \prime } - \mu _ { 1 } ^ { \prime } \| _ { 2 } \leq Q L ^ { 2 } \| \Sigma \| _ { 2 } \| W _ { \theta } \| _ { 2 } ^ { 2 } \cdot ( \alpha \| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 } + 2 \sqrt { M } \sigma ) ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $L$ is the Lipschitz constant for $\rho$ . The first inequality holds by Proposition 4.1, the second one is by Theorem 4.1 and the definition of spectral norm and Lipschitz constant, also realizing that $Q ^ { \prime } \leq L \bar { | | } W _ { \theta } | | _ { 2 } Q$ . Multiple layers of GNNs can be reasoned out similarly.
|
| 97 |
+
|
| 98 |
+
From the above theorem, we see $\Delta _ { \mathrm { D P } }$ can be processed with a tighter upper bound by regulating the weights on edges, and it is also dependent on the property of $W _ { \theta }$ , $\rho _ { ; }$ , and the error term $O ( \sigma )$ . When setting $W _ { \theta }$ fixed, our theoretical findings provide a feasible solution that regulating weights on graph connections can achieve better demographic parity on link prediction, and as supplementary, also indicate where or when it cannot perform well with finite layers of GNNs: (1) The solution cannot guarantee arbitrary fairness if we want to preserve the graph structure due to the resistance of $\alpha _ { 1 }$ in lower bound in Theorem 4.1. (2) When it is already fair enough in the original graph data, which means $\| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 }$ is small and additional error $O ( \sigma )$ is comparable to it, the upper bound cannot be reduced significantly and the solution may not further mitigate the bias. We include a dataset to investigate the potential limitations empirically in response to the above analysis in Appendix D. In the following sections, we implement the inspired algorithm and demonstrate that multiple real-world networks accept this solution with favorable results and a better fairness-utility tradeoff.
|
| 99 |
+
|
| 100 |
+
# 5 LEARNING FAIR GRAPH CONNECTIONS
|
| 101 |
+
|
| 102 |
+
The above discussion indicates that when employing GNNs for graph embedding, adjusting the adjacency matrix can assist the model with achieving fairness conditionally. However, searching for the optimal adjacency matrix within hierarchical graph neural networks is a non-trivial problem. In this section, continuing with the preceding analysis, we develop FairAdj algorithm to adjust the graph connections and learn a fair adjacency matrix by updating $\widetilde { A }$ while preserving the original graph structure unchanged. In overview, we implement the algorithm by separately optimizing the parameter $W _ { \theta }$ of GNNs towards utility, and adjusting $\widetilde { A }$ towards dyadic fairness by gradient descent and empirical risk minimization with structural and right stochastic constraints. Therefore, FairAdj is able to pursue the supplied dyadic fairness and link predictive utility simultaneously.
|
| 103 |
+
|
| 104 |
+
We employ variational graph autoencoder (Kipf & Welling, 2016b) for feature embedding. A two-layer graph neural network is used as inference model $\operatorname { G N N } _ { \theta } ( \cdot , \cdot )$ . $Z$ denotes the embedded representations, and dot product between embedded representations is the generative model $p ( \cdot )$ . The KL-divergence term $K \bar { L } [ \cdot | | \cdot ]$ punishes the discrepancy between latent distribution and a Gaussian prior. The objective function to reconstruct graph connections from latent variable can be written as:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\operatorname* { m a x } _ { \theta } \quad \mathcal { L } _ { \operatorname* { u i l } } : = \mathbb { E } _ { \operatorname { G N N } _ { \theta } ( Z | X , \widetilde { A } ) } [ \log p ( A \mid Z ) ] - K L [ \operatorname { G N N } _ { \theta } ( Z \mid X , \widetilde { A } ) \| \mathcal { N } ( 0 , 1 ) ] .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
For fairness, we impel ${ \mathcal { L } } _ { \mathrm { f a i r } }$ to empirically seek for better graph connections, then update $\widetilde { A }$ with constraints. Specifically, we optimize the normalized adjacency matrix $\widetilde { A }$ as follows:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { r l } { \underset { \ b { \widetilde { A } } } { \mathrm { m i n } } } & { ~ \mathcal { L } _ { \mathrm { f a i r } } : = \Vert \mathbb { E } _ { \boldsymbol { v } , \boldsymbol { u } \sim \boldsymbol { U } \times \boldsymbol { U } } [ \hat { a } _ { \boldsymbol { v } \boldsymbol { u } } \mid S ( \boldsymbol { v } ) = S ( \boldsymbol { u } ) ] - \mathbb { E } _ { \boldsymbol { v } , \boldsymbol { u } \sim \boldsymbol { U } \times \boldsymbol { U } } [ \hat { a } _ { \boldsymbol { v } \boldsymbol { u } } \mid S ( \boldsymbol { v } ) \neq S ( \boldsymbol { u } ) ] \Vert ^ { 2 } , } \\ { \mathrm { s . t . } } & { ~ ( 1 ) . [ \widetilde { A } ] _ { \boldsymbol { v } \boldsymbol { u } } = 0 , \mathrm { ~ i f ~ } [ A ] _ { \boldsymbol { v } \boldsymbol { u } } = 0 , \quad ( 2 ) . \widetilde { A } \mathbb { 1 } = \mathbb { 1 } , \widetilde { A } \geq 0 , } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\hat { a } _ { v u }$ takes value in $\hat { A } = Z Z ^ { \top }$ and $\mathbb { 1 }$ is the all-one vector with size $N$ . The two constraints are necessary for optimizing $\widetilde { A }$ : (1) Elements with zero value should be maintained, meaning no new links can be established during optimization. This restriction is proposed to preserve utility, due to adding fictitious links might mislead the directions of message passing, and further corrupt the representation learning. Therefore, we only adapt weights on existing edges and preserve the original graph structure. (2) In consistent with the initial left normalization $\widetilde { A } = D ^ { - 1 } A$ , the optimized matrix should still remain a right stochastic matrix. This can restrict the largest eigenvalue of adjacency matrix $\| \widetilde { A } \| _ { 2 } = 1$ , hence avoid numerical instabilities and exploding gradients when training $W _ { \theta }$ towards $\mathcal { L } _ { \mathrm { u t i l } }$ . In practice, we observe explosions during training with no constraints applied on $\widetilde { A }$ .
|
| 117 |
+
|
| 118 |
+
For the first constraint in Eq. (6), we only compute gradients and update the elements in $\widetilde { A }$ which have non-zero initialization. For the second one, after selecting the variable to optimize, we employ projected gradient descent by (Wang & Carreira-Perpinán, 2013) to satisfy the constraint while minimizing ${ \mathcal { L } } _ { \mathrm { f a i r } }$ . Once given computed gradients on $\bar { \tilde { A } }$ denoted as $\nabla _ { \widetilde { A } } \mathcal { L } _ { \mathrm { f a i r } }$ , with the corresponding learning rate $\eta _ { \widetilde { A } }$ , we have the following optimization problem that update $\widetilde { A }$ by projecting $\widetilde { A } -$ $\eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } \mathcal { L } _ { \mathrm { f a i r } }$ einto the feasible region with the minimum Euclidean distance:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r l } { \displaystyle \operatorname* { m i n } _ { \widetilde { A } - ( \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } { \mathcal E } _ { \mathrm { f a i r } } ) ^ { \prime } } } & { ~ \displaystyle \sum _ { v } \| [ \widetilde { A } - \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } { \mathcal E } _ { \mathrm { f a i r } } ] _ { v , * } - [ \widetilde { A } - ( \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } { \mathcal E } _ { \mathrm { f a i r } } ) ^ { \prime } ] _ { v , * } \| ^ { 2 } } \\ { \mathrm { s . t . ~ } } & { ( \widetilde { A } - ( \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } { \mathcal E } _ { \mathrm { f a i r } } ) ^ { \prime } ) \mathbb { 1 } = \mathbb { 1 } \mathrm { ~ a n d ~ } \widetilde { A } - ( \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } { \mathcal E } _ { \mathrm { f a i r } } ) ^ { \prime } \geq 0 , } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $[ \widetilde { A } ] _ { v , * }$ are the row-wise elements for $\widetilde { A }$ , namely, all the connections on $v$ . $\widetilde { A } - ( \eta _ { \widetilde { A } } \nabla _ { \widetilde { A } } \mathcal { L } _ { \mathrm { f a i r } } ) ^ { \prime }$ is the update for $\widetilde { A }$ after projection. Since $\widetilde { A }$ is row-wise independent and the objective function is strictly convex for this quadratic program, there exists a unique solution for each row. Solution details for projected gradient descent are restated as a part of our algorithmic pipeline.
|
| 125 |
+
|
| 126 |
+
The algorithmic routine is elaborated in Algorithm 1. $\theta$ and $\widetilde { A }$ are optimized iteratively with $T _ { 1 }$ and $T _ { 2 }$ epochs for co-adaptation. Compared to adversarial training method on graph embedding (Bose & Hamilton, 2019b), which requires a hyperparameter to control the fairness-utility tradeoff, we also find regulating the convergence of $\widetilde { A }$ has a similar effect as well. That is because the more $\widetilde { A }$ changes, the further $\widetilde { A }$ is away from the original graph connections, and consequently, the more damage in utility but more enhancement in fairness. Thanks to this favorable property, in experiments, comparing to adversarially remove sensitive attributes, we present multiple options for $T _ { 2 }$ to control the convergence and observe a more favorable fairness-utility tradeoff shown by our method.
|
| 127 |
+
|
| 128 |
+
Table 1: Statistic for datasets in experiments.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Dataset</td><td>#Vertex</td><td>#Edge</td><td># Class</td><td>#Intra</td><td>#Inter</td><td>Intra Ratio</td><td>Inter Ratio</td><td>Dis.Ratio</td></tr><tr><td>Oklahoma97</td><td>3,111</td><td>73,230</td><td></td><td>46,368</td><td>26.862</td><td>1.92e-2</td><td>1.11e-2</td><td>1.73</td></tr><tr><td>UNC28</td><td>4,018</td><td>65,287</td><td></td><td>36,212</td><td>29,075</td><td>8.76e-3</td><td>7.38e-3</td><td>1.19</td></tr><tr><td>Facebook#1684</td><td>786</td><td>14,024</td><td></td><td>7,989</td><td>6,035</td><td>4.76e-2</td><td>4.30e-2</td><td>1.11</td></tr><tr><td>Cora</td><td>2,708</td><td>5,278</td><td></td><td>4,275</td><td>1,003</td><td>6.51e-3</td><td>3.30e-4</td><td>19.73</td></tr><tr><td>Citeseer</td><td>3,312</td><td>4,660</td><td>22276</td><td>2,089</td><td>2,571</td><td>2.13e-3</td><td>5.70e-4</td><td>3.74</td></tr><tr><td>Pubmed</td><td>19,717</td><td>44,327</td><td>3</td><td>33,443</td><td>10,884</td><td>4.80e-4</td><td>9.00e-5</td><td>5.33</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 2: Experimental results on UNC28.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Method</td><td>AUC↑</td><td>AP个</td><td>△DP</td><td>△true↓</td><td>△false</td><td>△FNR√</td><td>△TNR←</td></tr><tr><td>VGAE</td><td>87.63 ± 0.56</td><td>88.69 ± 0.65</td><td>2.24 ± 0.42</td><td>1.50 ± 0.41</td><td>0.44 ± 0.36</td><td>7.62 ±0.84</td><td>2.18 ± 0.72</td></tr><tr><td>node2vec</td><td>87.22 ± 0.30</td><td>87.10 ± 0.37</td><td>2.75 ±0.78</td><td>1.30 ± 0.53</td><td>1.05 ± 0.93</td><td>12.56 ± 1.12</td><td>2.24 ± 0.92</td></tr><tr><td>Fairwalk</td><td>87.18 ± 0.30</td><td>87.07 ± 0.37</td><td>2.79 ±0.70</td><td>1.17 ± 0.49</td><td>0.90 ± 0.92</td><td>12.71 ± 1.11</td><td>2.20 ± 0.96</td></tr><tr><td>FairAdjr2=5</td><td>86.98 ± 0.54</td><td>87.75 ± 0.65</td><td>1.53 ± 0.35</td><td>0.32 ± 0.29</td><td>0.41 ± 0.35</td><td>2.84 ± 0.74</td><td>2.22 ± 0.68</td></tr><tr><td>FairAdjT2=20</td><td>87.04 ± 0.55</td><td>87.80 ± 0.65</td><td>1.57 ± 0.36</td><td>0.34 ± 0.31</td><td>0.42 ± 0.35</td><td>2.76 ± 0.75</td><td>2.16 ± 0.73</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 6 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
We present empirical analysis on six real-world datasets, compared with baseline methods in terms of seven evaluative metrics on both fairness and utility. Approaching to applications, we testify that our method can enhance the diversity in recommendations. Due to the space limitation, we only showcase partial results but defer the rest in Appendix D. Moreover, as an intermediate result, we demonstrate vertex representations are embedded more fairly assessed by fair clustering in Appendix E.
|
| 139 |
+
|
| 140 |
+
# 6.1 SETTINGS
|
| 141 |
+
|
| 142 |
+
Datasets. We conduct experiments on real-world social networks and citation networks including Oklahoma97, UNC28 (Traud et al., 2011), Facebook#1684, Cora, Citeseer, and Pubmed. Oklahoma97 and UNC28 are two school social networks. A link represents a friendship relation in social media, and every user has a profile for vertex features, including student/faculty status, gender (sensitive attribute), major, etc. Facebook#1684 is a social ego network from Facebook app. As the rest three citation networks, each vertex represents an article with bag-of-words descriptions as features. A link stands for a citation regardless the direction. We set the category of an article as the sensitive attribute. Statistic for datasets are summarized in Table 1, where #Class is the number of sensitive groups, #Intra/Inter Ratio represents the ratio that the number of actual intra/inter links v.s. the number of links if the graph is fully connected. These two terms show the density of intra/inter links. Dis. Ratio (abbreviated from disparity ratio) is calculated by divide intra ratio into inter ratio. Dis. Ratio equaling to one implies intra/inter connections are perfectly balanced in existing graph, and the degree of deviation from 1 indicates how skew the link connections are.
|
| 143 |
+
|
| 144 |
+
Baselines and Protocols. We involve four baseline methods. Variational graph autoencoder (VGAE) (Kipf & Welling, 2016b) inherits from variational autoencoder, which uses two GNNlayer as the inference model and leverages latent variables to reconstruct the graph connections. Node2vec (Grover & Leskovec, 2016) is a widely used graph embedding approach based on random walk. Fairwalk (Rahman et al., 2019) is built upon node2vec and designed specifically for fairness issues. It modifies the transition probability for one vertex according to the sensitive attribute of its neighbors. The last one is adversarial training on vertex representations (Bose & Hamilton, 2019b), which aims to minimize the discrepancy between different sensitive groups by optimizing parameters in GNN. Besides the standard pipeline for utility, it additionally trains the networks to confuse a discriminator, meanwhile training the discriminator to distinguish the embedded features with different sensitive attributes. A hyperparameter $\lambda$ is used in the overall objective function to balance the tradeoff between utility and fairness. We vary $\lambda$ in experiments and make comparisons to various results given by adversarial training. For all experiments, we randomly remove $10 \%$ links from the graph and reserve them for evaluation, and equivalently, the same number of false links are sampled in the evaluation phase. For one dataset, we repeat experiments with different train/test splits for 20 times. Full experimental configurations are available in Appendix C.
|
| 145 |
+
|
| 146 |
+
Table 3: Experimental results on Citeseer.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Method</td><td>AUC↑</td><td>AP个</td><td>△DP↓</td><td>△true</td><td>△false</td><td>△FNR</td><td>△TNR√</td></tr><tr><td>VGAE</td><td>81.77 ± 1.23</td><td>85.57 ± 1.39</td><td>11.24 ± 1.83</td><td>3.37 ± 2.33</td><td>2.14 ± 1.26</td><td>10.81 ± 3.61</td><td>11.31 ± 2.99</td></tr><tr><td>node2vec</td><td>81.21 ± 1.35</td><td>84.69 ± 1.26</td><td>14.49 ± 3.38</td><td>4.02 ± 2.74</td><td>6.82 ± 4.62</td><td>7.37 ± 3.07</td><td>12.50 ± 4.21</td></tr><tr><td>Fairwalk</td><td>81.69 ± 1.50</td><td>84.97 ± 1.23</td><td>13.50 ± 2.97</td><td>3.30 ± 2.49</td><td>5.33 ± 3.83</td><td>7.26 ± 3.30</td><td>11.34 ± 3.19</td></tr><tr><td>FairAdjT2=2</td><td>80.45 ± 1.34</td><td>84.47 ± 1.43</td><td>9.57 ± 1.84</td><td>2.55 ± 2.02</td><td>1.70 ± 1.47</td><td>9.87 ± 3.17</td><td>10.27 ± 3.23</td></tr><tr><td>FairAdjT2=20</td><td>78.84 ± 1.38</td><td>82.74 ± 1.46</td><td>7.81 ± 1.80</td><td>1.85 ± 1.66</td><td>1.30 ± 1.41</td><td>9.22 ± 2.95</td><td>10.01 ± 3.13</td></tr></table>
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 1: Comparison with adversarial training method (Bose & Hamilton, 2019b) in terms of the tradeoff between utility and fairness. Left: UNC28; Right: Citeseer. Blue points denote FairAdj with different $T _ { 2 }$ values, red points represent (Bose & Hamilton, 2019b) with different $\lambda$ values.
|
| 152 |
+
|
| 153 |
+
Metrics. We evaluate the utility of link prediction using Area Under the Curve (AUC) and Average Precision (AP). Fairness is evaluated towards $\Delta _ { \mathrm { D P } }$ , as well as the disparity on the expected score on all the true samples $\Delta _ { \mathrm { t r u e } }$ and false samples $\Delta _ { \mathrm { f a l s e } }$ . Besides these, following the suggested fairness notions (Hardt et al., 2016), we compute the maximum gap of true negative rate (TNR) and false negative rate (FNR). Illustratively, let the conditional cumulative distribution function of score $R$ be evaluated by a threshold $\tau$ with a given label written as $F _ { y } ^ { s } ( \tau ) : = \operatorname* { P r } ( R { \le } \tau | Y { = } y , S { = } s )$ , $y { \in } \{ 0 , 1 \}$ , $s { \in } \{ \mathrm { i n t r a , i n t e r } \}$ . With these notations, the maximum gap in true negative rate can be expressed as $\begin{array} { r } { \dot { \Delta } _ { \mathrm { T N R } } : = \dot { \mathrm { m a x } } _ { \tau } | F _ { 0 } ^ { \mathrm { i n t r a } } ( \tau ) - F _ { 0 } ^ { \mathrm { i n t e r } } ( \tau ) | } \end{array}$ , and similar for false positive rate $\Delta _ { \mathrm { F N R } } : =$ $\begin{array} { r } { \operatorname* { m a x } _ { \tau } | F _ { 1 } ^ { \mathrm { i n t r a } } ( \tau ) - F _ { 1 } ^ { \mathrm { i n t e r } } ( \tau ) | } \end{array}$ . These two terms also reflect the disparity in true positive rate (TPR) and false positive rate (FPR) due to $\mathrm { T P R } = 1 - \mathrm { F N R }$ and $\mathrm { F P R } = 1 - \mathrm { T N R }$ .
|
| 154 |
+
|
| 155 |
+
# 6.2 RESULTS AND ANALYSIS
|
| 156 |
+
|
| 157 |
+
Table 2 and 3 list quantitative results on UNC28 and Citeseer comparing to VGAE, node2vec, and Fairwalk. Two choices of $T _ { 2 }$ are presented here, where $T _ { 2 }$ in a smaller value pursues a comparable performance in utility (a little bit lower in AUC but higher in AP) to random walk based methods, and at the same time performs much better in fairness. We also present $T _ { 2 } = 2 0$ since we observe a convergence on the adjacency matrix. The results indicate that FairAdj achieves the best on various statistics for dyadic fairness and with only a small sacrifice in predictive utility.
|
| 158 |
+
|
| 159 |
+
A Better Tradeoff. Figure 1 plots every experimental result for our method and adversarial training with various fairness-utility regulated hyperparameters. Two observations explain why our method surpasses the adversarial technique. (1) Blue dots are closer to the left top corner than the red on the whole, meaning the same level of fairness is achieved with less sacrifice in utility. An explanation for this favorable property is that, the adversarial training method neglects the graph connections and only diminish the group discrepancy, where two irrelevant instances with no connection but from different groups may be closely mapped, thus greatly damage the utility. The optimization on $\widetilde { A }$ does facilitate the feature smoothing across groups which is not indicated in the original adjacency matrix, but still considers the graph connections. (2) Additionally, blue dots are more aggregated, suggesting our methods escape from the instability of min-max optimization and acting more robust to different train/test splits. However, as shown, FairAdj cannot achieve arbitrary small in $\Delta _ { \mathrm { D P } }$ as red dots do. This is indicated in Section 4 as the first potential limitation.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 2: Diversity and utility in recommendations. Left: UNC28; Right: Citeseer. X-axis ‘proportion’ means we investigate the top $\mathbf { \boldsymbol { x } } \%$ valued links and check the ratio between inter and intra links that presented in y-axis.
|
| 163 |
+
|
| 164 |
+
Diversity in Recommendations. We examine the top-scored links in evaluation at a certain proportion in terms of its diversity and utility, shown in Figure 2. This exploration can be useful when conducting recommendations according to scores in descending order. For a fixed proportion, we report the diversity as the number of inter links divided by the number of intra links, and the utility as the recall rate among these recommendations. Figures show that as a direct product by dyadic fairness, FairAdj enhances the diversity in recommendations but is achieved at a sacrifice of utility.
|
| 165 |
+
|
| 166 |
+
# 7 CONCLUSION
|
| 167 |
+
|
| 168 |
+
We studied the dyadic fairness in graph-structured data. We theoretically analyzed how the connections in graph links affect dyadic fairness of demographic parity when employing graph neural networks for representation learning. On the basis of the foregoing analysis, we proposed FairAdj to learn a fair adjacency matrix, and pursued the dyadic fairness and prediction utility simultaneously. Empirical validations demonstrated the achievement of fairness and a better fairness-utility tradeoff.
|
| 169 |
+
|
| 170 |
+
# ACKNOWLEDGEMENT
|
| 171 |
+
|
| 172 |
+
We would like to thank Zizhang Chen and Wei Lu for the helpful discussions, and Lizi Liao for providing the Oklahoma97/UNC28 datasets. This work is partially supported by NSF OAC 1920147.
|
| 173 |
+
|
| 174 |
+
# REFERENCES
|
| 175 |
+
|
| 176 |
+
Lada A Adamic and Eytan Adar. Friends and neighbors on the web. Social networks, 25(3):211–230, 2003.
|
| 177 |
+
|
| 178 |
+
Julia Angwin, Jeff Larson, Surya Mattu, and Lauren Kirchner. Machine bias. ProPublica, May, 23: 2016, 2016.
|
| 179 |
+
|
| 180 |
+
Solon Barocas and Andrew D Selbst. Big data’s disparate impact. Calif. L. Rev., 104:671, 2016.
|
| 181 |
+
|
| 182 |
+
Avishek Bose and William Hamilton. Compositional fairness constraints for graph embeddings. In International Conference on Machine Learning, pp. 715–724. PMLR, 2019a.
|
| 183 |
+
|
| 184 |
+
Avishek Bose and William Hamilton. Compositional fairness constraints for graph embeddings. 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. 715–724, Long Beach, California, USA, 09–15 Jun 2019b. PMLR. URL http://proceedings.mlr.press/v97/bose19a.html.
|
| 185 |
+
|
| 186 |
+
Toon Calders, Faisal Kamiran, and Mykola Pechenizkiy. Building classifiers with independency constraints. In 2009 IEEE International Conference on Data Mining Workshops, pp. 13–18. IEEE, 2009.
|
| 187 |
+
|
| 188 |
+
Abhijnan Chakraborty, Gourab K Patro, Niloy Ganguly, Krishna P Gummadi, and Patrick Loiseau. Equality of voice: Towards fair representation in crowdsourced top-k recommendations. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pp. 129–138, 2019.
|
| 189 |
+
|
| 190 |
+
Michele Donini, Luca Oneto, Shai Ben-David, John S Shawe-Taylor, and Massimiliano Pontil. Empirical risk minimization under fairness constraints. In Advances in Neural Information Processing Systems, pp. 2791–2801, 2018.
|
| 191 |
+
|
| 192 |
+
Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pp. 214–226, 2012.
|
| 193 |
+
|
| 194 |
+
Harrison Edwards and Amos Storkey. Censoring representations with an adversary. arXiv preprint arXiv:1511.05897, 2015.
|
| 195 |
+
|
| 196 |
+
Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. Graph neural networks for social recommendation. In The World Wide Web Conference, pp. 417–426, 2019.
|
| 197 |
+
|
| 198 |
+
Benjamin Fish, Jeremy Kun, and Ádám D Lelkes. A confidence-based approach for balancing fairness and accuracy. In Proceedings of the 2016 SIAM International Conference on Data Mining, pp. 144–152. SIAM, 2016.
|
| 199 |
+
|
| 200 |
+
Paula Gordaliza, Eustasio Del Barrio, Gamboa Fabrice, and Jean-Michel Loubes. Obtaining fairness using optimal transport theory. In International Conference on Machine Learning, pp. 2357–2365, 2019.
|
| 201 |
+
|
| 202 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864, 2016.
|
| 203 |
+
|
| 204 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017.
|
| 205 |
+
|
| 206 |
+
Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. In Advances in neural information processing systems, pp. 3315–3323, 2016.
|
| 207 |
+
|
| 208 |
+
Bas Hofstra, Rense Corten, Frank Van Tubergen, and Nicole B Ellison. Sources of segregation in social networks: A novel approach using facebook. American Sociological Review, 82(3):625–656, 2017.
|
| 209 |
+
|
| 210 |
+
Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein fair classification. arXiv preprint arXiv:1907.12059, 2019.
|
| 211 |
+
|
| 212 |
+
Michael Kearns, Seth Neel, Aaron Roth, and Zhiwei Steven Wu. Preventing fairness gerrymandering: Auditing and learning for subgroup fairness. In International Conference on Machine Learning, pp. 2564–2572, 2018.
|
| 213 |
+
|
| 214 |
+
Michael Kearns, Seth Neel, Aaron Roth, and Zhiwei Steven Wu. An empirical study of rich subgroup fairness for machine learning. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pp. 100–109, 2019.
|
| 215 |
+
|
| 216 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016a.
|
| 217 |
+
|
| 218 |
+
Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016b.
|
| 219 |
+
|
| 220 |
+
Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In Advances in Neural Information Processing Systems, pp. 4066–4076, 2017.
|
| 221 |
+
|
| 222 |
+
Peizhao Li, Han Zhao, and Hongfu Liu. Deep fair clustering for visual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9070–9079, 2020.
|
| 223 |
+
|
| 224 |
+
Peiyuan Liao, Han Zhao, Keyulu Xu, Tommi Jaakkola, Geoffrey Gordon, Stefanie Jegelka, and Ruslan Salakhutdinov. Graph adversarial networks: Protecting information against adversarial attacks. arXiv preprint arXiv:2009.13504, 2020.
|
| 225 |
+
|
| 226 |
+
David Liben-Nowell and Jon Kleinberg. The link-prediction problem for social networks. Journal of the American society for information science and technology, 58(7):1019–1031, 2007.
|
| 227 |
+
|
| 228 |
+
Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard S. Zemel. The variational fair autoencoder. In ICLR, 2016. URL http://arxiv.org/abs/1511.00830.
|
| 229 |
+
|
| 230 |
+
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially fair and transferable representations. arXiv preprint arXiv:1802.06309, 2018.
|
| 231 |
+
|
| 232 |
+
Feiping Nie, Wei Zhu, and Xuelong Li. Unsupervised large graph embedding. In Thirty-first AAAI conference on artificial intelligence, 2017.
|
| 233 |
+
|
| 234 |
+
Eli Pariser. The filter bubble: How the new personalized web is changing what we read and how we think. Penguin, 2011.
|
| 235 |
+
|
| 236 |
+
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, pp. 701–710, 2014.
|
| 237 |
+
|
| 238 |
+
Yanjun Qi, Ziv Bar-Joseph, and Judith Klein-Seetharaman. Evaluation of different biological data and computational classification methods for use in protein interaction prediction. Proteins: Structure, Function, and Bioinformatics, 63(3):490–500, 2006.
|
| 239 |
+
|
| 240 |
+
Tahleen Rahman, Bartlomiej Surma, Michael Backes, and Yang Zhang. Fairwalk: towards fair graph embedding. In Proceedings of the 28th International Joint Conference on Artificial Intelligence, pp. 3289–3295. AAAI Press, 2019.
|
| 241 |
+
|
| 242 |
+
Aida Rahmattalabi, Phebe Vayanos, Anthony Fulginiti, Eric Rice, Bryan Wilder, Amulya Yadav, and Milind Tambe. Exploring algorithmic fairness in robust graph covering problems. In Advances in Neural Information Processing Systems, pp. 15750–15761, 2019.
|
| 243 |
+
|
| 244 |
+
Badrul Sarwar, George Karypis, Joseph Konstan, and John Riedl. Item-based collaborative filtering recommendation algorithms. In Proceedings of the 10th international conference on World Wide Web, pp. 285–295, 2001.
|
| 245 |
+
|
| 246 |
+
Harald Steck. Calibrated recommendations. In Proceedings of the 12th ACM conference on recommender systems, pp. 154–162, 2018.
|
| 247 |
+
|
| 248 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th international conference on world wide web, pp. 1067–1077, 2015.
|
| 249 |
+
|
| 250 |
+
Amanda L Traud, Eric D Kelsic, Peter J Mucha, and Mason A Porter. Comparing community structure to characteristics in online collegiate social networks. SIAM review, 53(3):526–543, 2011.
|
| 251 |
+
|
| 252 |
+
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. International Conference on Machine Learning (ICML), 2016.
|
| 253 |
+
|
| 254 |
+
Berk Ustun, Yang Liu, and David Parkes. Fairness without harm: Decoupled classifiers with preference guarantees. In International Conference on Machine Learning, pp. 6373–6382, 2019.
|
| 255 |
+
|
| 256 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 257 |
+
|
| 258 |
+
Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007.
|
| 259 |
+
|
| 260 |
+
Weiran Wang and Miguel A Carreira-Perpinán. Projection onto the probability simplex: An efficient algorithm with a simple proof, and an application. arXiv preprint arXiv:1309.1541, 2013.
|
| 261 |
+
|
| 262 |
+
Xiang Wang, Xiangnan He, Meng Wang, Fuli Feng, and Tat-Seng Chua. Neural graph collaborative filtering. In Proceedings of the 42nd international ACM SIGIR conference on Research and development in Information Retrieval, pp. 165–174, 2019.
|
| 263 |
+
|
| 264 |
+
Xiao Wang, Peng Cui, Jing Wang, Jian Pei, Wenwu Zhu, and Shiqiang Yang. Community preserving network embedding. In Thirty-first AAAI conference on artificial intelligence, 2017.
|
| 265 |
+
|
| 266 |
+
Hongteng Xu, Dixin Luo, Hongyuan Zha, and Lawrence Carin Duke. Gromov-wasserstein learning for graph matching and node embedding. In International Conference on Machine Learning, pp. 6932–6941, 2019.
|
| 267 |
+
|
| 268 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 269 |
+
|
| 270 |
+
Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du, Ken ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ rJxbJeHFPS.
|
| 271 |
+
|
| 272 |
+
Sirui Yao and Bert Huang. Beyond parity: Fairness objectives for collaborative filtering. In Advances in Neural Information Processing Systems, pp. 2921–2930, 2017.
|
| 273 |
+
|
| 274 |
+
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 and Data Mining, pp. 974–983, 2018.
|
| 275 |
+
|
| 276 |
+
Muhammad Bilal Zafar, Isabel Valera, Manuel Rodriguez, Krishna Gummadi, and Adrian Weller. From parity to preference-based notions of fairness in classification. In Advances in Neural Information Processing Systems, pp. 229–239, 2017a.
|
| 277 |
+
|
| 278 |
+
Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rogriguez, and Krishna P Gummadi. Fairness constraints: Mechanisms for fair classification. In Artificial Intelligence and Statistics, pp. 962–970. PMLR, 2017b.
|
| 279 |
+
|
| 280 |
+
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International Conference on Machine Learning, pp. 325–333, 2013.
|
| 281 |
+
|
| 282 |
+
Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pp. 5165–5175, 2018.
|
| 283 |
+
|
| 284 |
+
Han Zhao and Geoff Gordon. Inherent tradeoffs in learning fair representations. In Advances in neural information processing systems, pp. 15649–15659, 2019.
|
| 285 |
+
|
| 286 |
+
Han Zhao, Amanda Coston, Tameem Adel, and Geoffrey J Gordon. Conditional learning of fair representations. arXiv preprint arXiv:1910.07162, 2019.
|
| 287 |
+
|
| 288 |
+
In Appendix, we present proofs in Section A, illustrative diagrams for Theorem 4.1 in Section B, experimental configurations in Section C, deferred results in Section D, and the demonstration of fair vertex representation in Section E.
|
| 289 |
+
|
| 290 |
+
# A PROOF
|
| 291 |
+
|
| 292 |
+
Proposition 4.1. For a link prediction function $g ( \cdot , \cdot )$ modeled as inner product $g ( v , u ) = v ^ { \top } \Sigma u$ , where $\Sigma \in \mathbb { S } _ { + + } ^ { M }$ is a positive-definite matrix, $\exists Q > 0 , \forall v \sim \mathcal { V }$ , $\| v \| _ { 2 } \le Q$ , for $\mathbb { E } _ { v \sim U } [ v ] \stackrel { \cdot } { \in } \mathbb { R } ^ { M }$ , for dyadic fairness based on demographic parity, if $\| \mathbb { E } _ { v \sim U } [ v \mid v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ v \mid v \in S _ { 1 } ] \| _ { 2 } \leq \delta$ ,
|
| 293 |
+
|
| 294 |
+
$\begin{array} { r l } & { \lambda _ { \mathrm { D P } } : = \left| \mathbb { E } _ { ( v , u ) \sim U \times U } [ g ( v , u ) \mid S ( v ) = S ( u ) ] - \mathbb { E } _ { ( v , u ) \sim U \times U } [ g ( v , u ) \mid S ( v ) \neq S ( u ) ] \right| \leq Q \| { \Sigma } \| _ { 2 } \cdot \delta . } \end{array}$
|
| 295 |
+
|
| 296 |
+
Proof. To simplify the notations, we use $p : = \mathbb { E } _ { v \sim U } [ v \mid v \in S _ { 0 } ] \in \mathbb { R } ^ { M }$ and $q : = \mathbb { E } _ { v \sim U } [ v \mid v \in$ $S _ { 1 } ] \in \mathbb { R } ^ { M }$ to denote the expectations in representations for $S _ { 0 }$ and $S _ { 1 }$ respectively.
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { r l } & { | \mathbb { E } _ { \mathrm { i n t r a } } - \mathbb { E } _ { \mathrm { i n t e r } } | = \left| \mathbb { E } [ v ^ { \top } \Sigma u \mid v \in S _ { 0 } , u \in S _ { 1 } ] - \mathbb { E } [ v ^ { \top } \Sigma u \mid v \in S _ { 0 } , u \in S _ { 0 } \vee v \in S _ { 1 } , u \in S _ { 1 } ] \right| } \\ & { \qquad = \left| p ^ { \top } \Sigma q - \left( \frac { | S _ { 0 } | ^ { 2 } } { | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } } p ^ { \top } \Sigma p + \frac { | S _ { 1 } | ^ { 2 } } { | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } } q ^ { \top } \Sigma q \right) \right| } \\ & { \qquad = \left| ( q - p ) ^ { \top } \left( \frac { | S _ { 0 } | ^ { 2 } } { | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } } \Sigma p - \frac { | S _ { 1 } | ^ { 2 } } { | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } } \Sigma q \right) \right| } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
To simplify the notation, we will use $\alpha : = | S _ { 0 } | ^ { 2 } / ( | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } )$ and $\beta : = | S _ { 1 } | ^ { 2 } / ( | S _ { 0 } | ^ { 2 } + | S _ { 1 } | ^ { 2 } )$
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r l } & { \leq \| q - p \| _ { 2 } \cdot \| \alpha \Sigma p - \beta \Sigma q \| _ { 2 } } \\ & { \leq \delta \cdot \| \Sigma \| _ { 2 } \cdot ( \| \alpha p \| _ { 2 } + \| \beta q \| _ { 2 } ) } \\ & { = Q \| \Sigma \| _ { 2 } \cdot \delta , } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
which completes the proof. The first inequality above is due to Cauchy-Schwarz, and the second one is by the definition of spectral norm. The last equality holds by the linearity of expectation: if $\forall v \in \mathcal { V } , \| v \| _ { 2 } \leq Q$ , then $\| \mathbb { E } [ v ] \| _ { 2 } \leq \mathbb { E } [ \| v \| _ { 2 } ] \leq Q$ .
|
| 309 |
+
|
| 310 |
+
Theorem 4.1. For an arbitrary graph with nonnegative link weights, after conducting one meanaggregation over the graph, the consequent representation discrepancy between two sensitive groups $\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } : = \Vert \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 1 } ] \Vert _ { 2 }$ is bounded by
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { r } { \operatorname* { m a x } \{ \alpha _ { \mathrm { m i n } } \| \mu _ { 0 } - \mu _ { 1 } \| _ { \infty } - 2 \sigma , 0 \} \leq \Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } \leq \alpha _ { \mathrm { m a x } } \| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 } + 2 \sqrt { M } \sigma , } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\begin{array} { r } { \alpha _ { \operatorname* { m i n } } = \operatorname* { m i n } \{ \alpha _ { 1 } , \alpha _ { 2 } \} , \alpha _ { \operatorname* { m a x } } = \operatorname* { m a x } \{ \alpha _ { 1 } , \alpha _ { 2 } \} , \alpha _ { 1 } = \left| 1 - \frac { m _ { w } } { D _ { \operatorname* { m a x } } } \big ( \frac { 1 } { \left| S _ { 0 } \right| } + \frac { 1 } { \left| S _ { 1 } \right| } \big ) \right| , \alpha _ { 2 } = \left| 1 - \frac { \left| \widetilde { S _ { 0 } } \right| } { \left| S _ { 0 } \right| } - \frac { \left| \widetilde { S _ { 1 } } \right| } { \left| S _ { 1 } \right| } \right| . } \end{array}
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
Proof. The feature representation of $v$ after conducting one mean-aggregation is
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\mathrm { A g g } ( v ) = \frac { 1 } { \deg _ { w } ( v ) } \sum _ { u \in \Gamma ( u ) } a _ { v u } u = \frac { 1 } { \deg _ { w } ( v ) } \big ( \sum _ { u \in \Gamma ( u ) \cap S _ { 0 } } a _ { v u } u + \sum _ { u \in \Gamma ( u ) \cap S _ { 1 } } a _ { v u } u \big ) .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Here we separate the summation of neighbor features into two parts in terms of the sensitive attribute.
|
| 327 |
+
|
| 328 |
+
We use the bracket notation to abbreviate the range of a vector. That is, if a vector $u$ satisfies $\mu - \sigma \leq u \leq \mu + \sigma$ , we abbreviate this as $u \in [ \mu \pm \sigma ]$ .
|
| 329 |
+
|
| 330 |
+
Consider the unilateral case $v \in S _ { 0 }$ , we have
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
\begin{array} { l } { \displaystyle \mathbf { A g g } ( v ) \in [ \frac { \sum _ { u \in \Gamma ( v ) \cap S _ { 0 } } a _ { v u } \mu _ { 0 } + \frac { \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } \mu _ { 1 } \pm \sigma \cdot \mathbb { 1 } } { \deg _ { w } \left( v \right) } a _ { v u } \mu _ { 1 } \pm \sigma \cdot \mathbb { 1 } ] } { \deg _ { w } \left( v \right) } } \\ { \displaystyle \qquad \in [ ( \mu _ { 0 } + \frac { \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } } { \deg _ { w } \left( v \right) } ( \mu _ { 1 } - \mu _ { 0 } ) ) \pm \sigma \cdot \mathbb { 1 } ] } \end{array}
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
where $\mathbb { 1 }$ is the all-one vector with proper size.
|
| 337 |
+
|
| 338 |
+
The first derivation is due to the fact that each $u \in S _ { 0 }$ lies in the range of $[ \mu _ { 0 } \pm \sigma \cdot \mathbb { 1 } ]$ and each $u \in S _ { 1 }$ lies in the range of $[ \mu _ { 1 } \pm \sigma \cdot \mathbb { 1 } ]$ . The second one is by the definition of weighted degree.
|
| 339 |
+
|
| 340 |
+
Using $\begin{array} { r } { \beta _ { v } = \sum _ { v \in \Gamma ( v ) \cap S _ { \mathrm { o p p } ( v ) } } a _ { v u } / \mathrm { d e g } _ { w } ( v ) } \end{array}$ where $S _ { \mathrm { o p p } ( v ) }$ is the opposite sensitive group where $v$ belongs. The expectation of $\operatorname { A g g } ( v )$ for $S _ { 0 }$ is
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r } { \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 0 } ] \in [ ( \frac { 1 } { | S _ { 0 } | } \displaystyle \sum _ { v \in S _ { 0 } } ( \mu _ { 0 } + \beta _ { v } ( \mu _ { 1 } - \mu _ { 0 } ) ) ) \pm \sigma \cdot \mathbb { 1 } ] } \\ { \in [ ( \mu _ { 0 } + \frac { 1 } { | S _ { 0 } | } \displaystyle \sum _ { v \in S _ { 0 } } \beta _ { v } ( \mu _ { 1 } - \mu _ { 0 } ) ) \pm \sigma \cdot \mathbb { 1 } ] . } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
And for $v \in S _ { 1 }$ we have
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 1 } ] \in [ ( \mu _ { 1 } + \frac { 1 } { | S _ { 1 } | } \sum _ { v \in S _ { 1 } } \beta _ { v } ( \mu _ { 0 } - \mu _ { 1 } ) ) \pm \sigma \cdot \mathbb { 1 } ] .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Based on the above two terms, the gap in expectation of two groups after passing one meanaggregation layer becomes
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\mathfrak { L } _ { v \sim U } [ \mathrm { A g g } ( v ) \ | \ v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ \mathrm { A g g } ( v ) \ | \ v \in S _ { 1 } ] \in [ ( 1 - ( \frac { 1 } { | S _ { 0 } | } \sum _ { v \in S _ { 0 } } \beta _ { v } + \frac { 1 } { | S _ { 1 } | } \sum _ { v \in S _ { 1 } } \beta _ { v } ) ) \cdot ( \mu _ { 0 } - \mu _ { 1 } + \mu _ { 0 } ) ]
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Next we study the range of $\begin{array} { r } { \alpha ^ { \prime } : = 1 - ( | S _ { 0 } | ^ { - 1 } \sum _ { v \in S _ { 0 } } \beta _ { v } + | S _ { 1 } | ^ { - 1 } \sum _ { v \in S _ { 1 } } \beta _ { v } ) } \end{array}$ . First we consider the term $| S _ { 0 } | ^ { - 1 } \textstyle \sum _ { v \in S _ { 0 } } \beta _ { v }$ . Since $\deg _ { w } ( v ) \leq D _ { \mathrm { m a x } } , \forall v \in \mathcal { V }$ , we have
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\sum _ { v \in S _ { 0 } } \beta _ { v } = \sum _ { v \in S _ { 0 } } \frac { \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } } { \deg _ { w } ( v ) } \geq \frac { 1 } { D _ { \operatorname* { m a x } } } \sum _ { v \in S _ { 0 } } \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } = \frac { m _ { w } } { D _ { \operatorname* { m a x } } } .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
For non-negative weights,
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
D _ { \operatorname* { m a x } } \geq \mathrm { d e g } _ { w } ( v ) = \sum _ { u \in \Gamma ( v ) \cap S _ { 0 } } a _ { v u } + \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } \geq \sum _ { u \in \Gamma ( v ) \cap S _ { 1 } } a _ { v u } .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
This means for $v \in S _ { 0 }$ ,
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\beta _ { v } = \frac { \sum _ { u \in \Gamma ( u ) \cap S _ { 1 } } a _ { v u } } { \deg _ { w } ( u ) } \leq 1 ,
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
thus,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\sum _ { v \in S _ { 0 } } \beta _ { v } = \sum _ { v \in \widetilde { S _ { 0 } } } \beta _ { v } \le | \widetilde { S _ { 0 } } | .
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
The first equality holds because $\beta _ { v } = 0$ when $v \in S _ { 0 } / \widetilde { S _ { 0 } }$ , meaning $v$ doesn’t contain any inter-edges.
|
| 383 |
+
|
| 384 |
+
Since the analysis for $S _ { 1 }$ is similar, we derive the lower and upper bounds for $\begin{array} { r } { | S _ { i } | ^ { - 1 } \sum _ { v \in S _ { i } } \beta _ { v } , i = } \end{array}$ $0 , 1$
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\frac { 1 } { | S _ { i } | } \cdot \frac { m _ { w } } { D _ { \operatorname* { m a x } } } \leq \frac { 1 } { | S _ { i } | } \sum _ { v \in S _ { i } } \beta _ { v } \leq ( \frac { | \widetilde { S } _ { i } | } { | S _ { i } | } ) , \quad i = 0 , 1 .
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
Based on the above results, we give the bound for $\alpha ^ { \prime }$ as follows:
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\alpha ^ { \prime } \in [ 1 - ( \frac { | \widetilde { S _ { 0 } } | } { | S _ { 0 } | } + \frac { | \widetilde { S _ { 1 } } | } { | S _ { 1 } | } ) , 1 - \frac { m _ { w } } { D _ { \operatorname* { m a x } } } ( \frac { 1 } { | S _ { 0 } | } + \frac { 1 } { | S _ { 1 } | } ) ] ,
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
Let $\alpha _ { \mathrm { { m i n } } }$ and $\alpha _ { \mathrm { m a x } }$ be lower bound and upper bower of $\left| \alpha ^ { \prime } \right|$ , we have
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { l l } { \alpha _ { \mathrm { m a x } } = \displaystyle \operatorname* { m a x } \{ 1 - ( \frac { | \widetilde { S _ { 0 } } | } { | S _ { 0 } | } + \frac { | \widetilde { S _ { 1 } } | } { | S _ { 1 } | } ) , ~ 1 - \frac { m _ { w } } { D _ { \mathrm { m a x } } } ( \frac { 1 } { | S _ { 0 } | } + \frac { 1 } { | S _ { 1 } | } ) \} } \\ { \alpha _ { \mathrm { m i n } } = \displaystyle \operatorname* { m i n } \{ 1 - ( \frac { | \widetilde { S _ { 0 } } | } { | S _ { 0 } | } + \frac { | \widetilde { S _ { 1 } } | } { | S _ { 1 } | } ) , ~ 1 - \frac { m _ { w } } { D _ { \mathrm { m a x } } } ( \frac { 1 } { | S _ { 0 } | } + \frac { 1 } { | S _ { 1 } | } ) \} } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Thus we give the upper bound of $\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } }$
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } \leq \alpha _ { \mathrm { m a x } } \| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 } + 2 \sqrt { M } \sigma
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
where the second part in RHS is due to $2 \sigma \cdot \| \mathbb { 1 } \| _ { 2 } = 2 \sqrt { M } \sigma$ .
|
| 409 |
+
|
| 410 |
+
Next we consider $i$ -th entrance of $\mu _ { 0 }$ and $\mu _ { 1 }$ , denoted as $\mu _ { 0 } ^ { i }$ and $\mu _ { 1 } ^ { i }$ respectively. The $i$ -the entrance of $\mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) \mid v \in S _ { 1 } ]$ take nonzero values if and only if
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
| ( 1 - ( \frac { 1 } { | S _ { 0 } | } \sum _ { v \in S _ { 0 } } \beta _ { v } + \frac { 1 } { | S _ { 1 } | } \sum _ { v \in S _ { 1 } } \beta _ { v } ) ) \cdot ( \mu _ { 0 } ^ { i } - \mu _ { 1 } ^ { i } ) | \ge 2 \sigma
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
Thus we obtain the lower bound of $\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } }$
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\Delta _ { \mathrm { D P } } ^ { \mathrm { A g g r } } \geq \operatorname* { m a x } \{ \alpha _ { \mathrm { m i n } } \Vert \mu _ { 0 } - \mu _ { 1 } \Vert _ { \infty } - 2 \sigma , 0 \}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
which completes the proof.
|
| 423 |
+
|
| 424 |
+
# B COMPLEMENTARY DIAGRAMS TO THEOREM 4.1
|
| 425 |
+
|
| 426 |
+
We provide diagrams to help better understand the upper bound in Theorem 4.1.
|
| 427 |
+
|
| 428 |
+
Figure 3 provides a common case that the gap in expectation between two sensitive groups shrinks after mean-aggregation. Here the maximal deviation term $\sigma$ can be neglected since it is much smaller than the expectation gap.
|
| 429 |
+
|
| 430 |
+
Figure 4 provides a case that the term $\sigma$ is not negligible against the expectation gap between two sensitive groups. Here $\sigma = 1 0 0$ and the gap equals to 0. After aggregation, we see the new expectation gap becomes 20, showing that the discrepancy in representations increases.
|
| 431 |
+
|
| 432 |
+
Figure 5 provides another case that the contraction coefficient $\alpha$ equals to 1 due to the resistance of $\alpha _ { 2 }$ . Here all vertices possess inter links, and the graph is a complete bipartite graph. Then the aggregation fully exchanges the sensitive information, and thus the representation discrepancy remains unchanged.
|
| 433 |
+
|
| 434 |
+
Cases in Figure 4 and 5 are also pointed out by the analysis in Section 4.
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
Figure 3: An illustrative graph example with two protected groups $S _ { 0 }$ and $S _ { 1 }$ . All vertices have selfloop. The expectation gap shrinks after mean aggregation. Here, $| \mathbb { E } _ { v \sim U } [ v | v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ v | v \in$ $S _ { 1 } ] | = 2 0$ , $\sigma = 2$ and all link weights are equal. After aggregation, $| \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) | v \in S _ { 0 } ] -$ $\begin{array} { r } { \mathbb { E } _ { v \sim U } [ \mathbf { A g g } ( v ) | v \in S _ { 1 } ] | = | 6 . 1 5 - ( - 6 . 1 5 ) | = \bar { 1 } 2 . 3 < 2 0 } \end{array}$ .
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 4: Case 1: The maximal deviation term $O ( \sigma )$ is not negligible. Here $\sigma = 1 0 0$ and all link weights are equal. All vertices have self-loop. $| \mathbb { E } _ { v \sim U } [ v | v \in S _ { 0 } ] - \mathbb { E } _ { v \sim U } [ v | v \in S _ { 1 } ] | = 0 .$ But after mean-aggregation, $| \mathbb { E } _ { v \sim U } [ \mathrm { A g g } ( v ) | v \in S _ { 0 } ] - \bar { \mathbb { E } } _ { v \sim U } [ \mathrm { A g g } ( v ) | v \in S _ { 1 } ] | = | \hat { 5 } - 2 5 | = \bar { 2 } 0 > 0$ .
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 5: Case 2: The contraction coefficient $\alpha$ equals to 1. This happens when the graph is a complete bipartite graph. Mean-aggregation fully exchanges the sensitive information and the gap of two groups remains unchanged.
|
| 444 |
+
|
| 445 |
+
# C EXPERIMENTAL CONFIGURATIONS
|
| 446 |
+
|
| 447 |
+
For all experiments, we set $T _ { 1 } = 5 0$ and the total epochs which contain $T _ { 1 }$ and $T _ { 2 }$ equal to 4. Graph neural networks are applied with two hidden layers with size 32 and 16 respectively. $\eta _ { \theta }$ is set to 0.01. For $\eta _ { \widetilde { A } }$ for different datasets, we have: Oklahoma97: 0.1; UNC28: 0.1; Cora: 0.2; Citeseer: 0.5. eExperiments are conducted on Nvidia Titan RTX graphics card.
|
| 448 |
+
|
| 449 |
+
# D ADDITIONAL RESULTS
|
| 450 |
+
|
| 451 |
+
We present experimental results for Citeseer and UNC28 in this section. All the results deliver similar conclusions as we state in the main body of this paper. Additionally, we include another dataset Facebook#1684 in response to the second limitation as indicated in Section 4. In this case, $\Delta _ { \mathrm { D P } }$ , $\Delta _ { \mathrm { t r u e } }$ , $\Delta _ { \mathrm { f a l s e } }$ are already small as given by VGAE, and FairAdj is not able to further minimize the gap.
|
| 452 |
+
|
| 453 |
+
Table 4: Experimental results on Oklahoma97.
|
| 454 |
+
|
| 455 |
+
<table><tr><td>Method</td><td>AUC↑</td><td>AP个</td><td>△DP←</td><td>△true</td><td>△false</td><td>△FNR√</td><td>△TNR</td></tr><tr><td>VGAE node2vec</td><td>90.13 ± 0.32</td><td>91.24 ± 0.37</td><td>8.73 ± 0.38</td><td>8.56 ± 0.44</td><td>0.40 ± 0.32</td><td>36.51 ± 1.41</td><td>2.26 ± 0.92</td></tr><tr><td>Fairwalk</td><td>86.49 ± 0.35</td><td>84.09 ± 0.50</td><td>7.23 ± 0.64</td><td>3.35 ± 0.45</td><td>1.08 ± 0.97</td><td>32.55 ± 1.32</td><td>2.36 ±0.69</td></tr><tr><td></td><td>86.56 ± 0.32</td><td>84.23 ± 0.44</td><td>7.31 ± 0.62</td><td>3.49 ± 0.47</td><td>1.13 ± 0.85</td><td>32.77 ± 1.20</td><td>2.18 ± 0.69</td></tr><tr><td>FairAdjr2=5</td><td>84.92 ± 0.81</td><td>85.07 ± 0.92</td><td>3.60 ± 0.35</td><td>0.40 ±0.32</td><td>0.33 ± 0.28</td><td>4.00 ± 0.88</td><td>2.02 ± 0.76</td></tr><tr><td>FairAdjT2=20</td><td>81.01 ± 1.01</td><td>80.79 ± 0.93</td><td>2.96 ± 0.30</td><td>0.38 ± 0.31</td><td>0.32 ± 0.25</td><td>5.61 ± 1.06</td><td>2.03 ± 0.92</td></tr></table>
|
| 456 |
+
|
| 457 |
+
Table 5: Experimental results on Cora.
|
| 458 |
+
|
| 459 |
+
<table><tr><td>Method</td><td>AUC↑</td><td>AP个</td><td>△DP↓</td><td>△true</td><td>△false</td><td>△FNR↓</td><td>△TNR↓</td></tr><tr><td rowspan="3">VGAE node2vec</td><td>88.48 ± 0.88</td><td>90.81 ± 0.78</td><td>26.74 ± 1.51</td><td>9.99 ± 2.32</td><td>10.26 ± 1.59</td><td>28.25 ± 4.46</td><td>26.71 ± 3.83</td></tr><tr><td>87.93 ± 0.75</td><td>87.82 ± 1.06</td><td>39.99 ± 2.75</td><td>6.63 ± 3.58</td><td>27.86 ± 4.94</td><td>23.66 ± 4.73</td><td>32.96 ± 5.24</td></tr><tr><td>88.04 ±0.84</td><td>88.10 ± 1.20</td><td>40.49 ± 2.58</td><td>7.30 ± 3.28</td><td>29.43 ± 4.86</td><td>23.74 ± 4.19</td><td>33.79 ± 5.08</td></tr><tr><td rowspan="2">FairAdjT2=5 FairAdjr2=20</td><td>86.00 ± 1.12</td><td>88.32 ± 0.86</td><td>21.05 ± 1.26</td><td>6.99 ± 2.24</td><td>6.14 ± 1.59</td><td>20.72 ± 3.62</td><td>19.46 ± 3.62</td></tr><tr><td>83.85 ± 1.07</td><td>86.08 ± 0.93</td><td>17.87 ± 1.18</td><td>5.40 ± 2.23</td><td>3.74 ± 1.46</td><td>16.75 ± 4.87</td><td>15.37 ± 3.84</td></tr></table>
|
| 460 |
+
|
| 461 |
+
Table 6: Experimental results on Pubmed.
|
| 462 |
+
|
| 463 |
+
<table><tr><td>Method</td><td>AUC↑</td><td>AP个</td><td>△DP↓</td><td>△true</td><td>△false</td><td>△FNR↓</td><td>△TNR↓</td></tr><tr><td rowspan="2">VGAE node2vec</td><td>91.20 ± 0.85</td><td>91.26 ± 0.80</td><td>20.88 ± 1.48</td><td>4.19 ± 0.93</td><td>8.04 ± 1.83</td><td>12.01 ± 2.92</td><td>19.18 ± 4.16</td></tr><tr><td>74.27 ± 1.23</td><td>79.24 ± 1.29</td><td>19.14 ± 0.93</td><td>3.38 ± 2.57</td><td>8.90 ± 2.56</td><td>6.65 ± 2.21</td><td>10.91 ± 1.88</td></tr><tr><td rowspan="2">fairwalk FairAdjT2 = 5</td><td>73.43 ± 1.11</td><td>78.96 ± 1.24</td><td>18.42 ± 1.65</td><td>3.11 ± 1.84</td><td>7.79 ± 3.49</td><td>6.61 ± 2.28</td><td>10.93 ± 2.54</td></tr><tr><td>88.64 ± 1.09</td><td>88.21 ± 1.22</td><td>16.06 ± 0.98</td><td>1.96 ± 0.82</td><td>4.40 ± 1.28</td><td>8.93 ± 2.90</td><td>12.75 ± 1.56</td></tr><tr><td rowspan="2">FairAdjr2 = 20</td><td>87.53 ± 1.03</td><td>87.10 ± 1.17</td><td>14.73 ± 0.98</td><td>1.39 ± 0.92</td><td>3.17 ± 1.10</td><td>9.09 ± 2.10</td><td>10.46 ± 1.73</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 6: Compare to adversarial training on vertex representations. Left: Oklahoma97; Right: Cora.
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
Figure 7: Diversity and utility in recommendations. Left: Oklahoma97; Right: Cora.
|
| 470 |
+
|
| 471 |
+
Table 7: Experimental results on Facebook#1684.
|
| 472 |
+
|
| 473 |
+
<table><tr><td>Method</td><td>AUC</td><td>AP</td><td>△DP</td><td>△true</td><td>△false</td><td>△FNR</td><td>△TNR</td></tr><tr><td rowspan="3">VGAE node2vec fairwalk</td><td>94.66 ± .55</td><td>93.91 ±.68</td><td>2.03 ±.81</td><td>0.59 ± .49</td><td>0.90 ± .57</td><td>4.48 ± 1.57</td><td>4.94 ± 1.32</td></tr><tr><td>90.57 ± .74</td><td>85.61 ± 1.09</td><td>1.70 ± 1.43</td><td>0.52 ± .49</td><td>2.47 ± 1.52</td><td>6.51 ± 2.04</td><td>5.06 ± 1.36</td></tr><tr><td>90.56 ± .63</td><td>85.58 ±.87</td><td>1.97 ± 1.51</td><td>0.62 ±.47</td><td>2.14 ± 1.77</td><td>6.92 ± 2.19</td><td>5.03 ± 1.46</td></tr><tr><td rowspan="2">FairAdjT2 =1 FairAdjr2 = 20</td><td>94.68 ± .48</td><td>93.94 ± .62</td><td>2.02 ±.82</td><td>0.60 ±.50</td><td>0.93 ± .60</td><td>4.42 ± 1.57</td><td>4.82 ± 1.54</td></tr><tr><td>94.63 ±.49</td><td>93.84 ±.64</td><td>1.77 ±.81</td><td>0.53 ± .41</td><td>0.92 ± .49</td><td>5.00 ± 1.52</td><td>4.86 ± 1.41</td></tr></table>
|
| 474 |
+
|
| 475 |
+
# E FAIR VERTEX REPRESENTATION
|
| 476 |
+
|
| 477 |
+
As an intermediate result, we inspect the fairness in vertex representation in Figure 8. To quantify that, we conduct $\mathbf { K }$ -means clustering on vertex representation and evaluate the ratio of samples from different sensitive groups within each clusters, and the ratio is called balance. We range the number of clusters from 4 to 8 and report the average balance across all clusters. In general, the higher the balance, the fairer in vertex representations. Overall the series of FairAdj achieves a higher balance, which shows the invariant representations on vertices across different sensitive groups.
|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
Figure 8: Evaluations on balance of clusters. Left: Oklahoma97; Right: UNC28.
|
| 481 |
+
|
| 482 |
+
# F EXTEND COROLLARY 4.1 TO TWO-LAYER GNNS
|
| 483 |
+
|
| 484 |
+
For $\Delta _ { D P } ^ { ( 2 ) }$ on vertices after passing two layer ${ \bf G N N } _ { \theta } ^ { ( 2 ) } ( X , \widetilde { A } ) : = ( \widetilde { A } ( { \bf G N N } _ { \theta } ^ { ( 1 ) } ( X , \widetilde { A } ) ) W _ { \theta } ^ { ( 2 ) } ) = $ $\rho ( \widetilde { A } \rho ( \widetilde { A } X W _ { \theta } ^ { ( 1 ) } ) W _ { \theta } ^ { ( 2 ) } )$ . Here we denote $\mu _ { i } ^ { \prime } : = \mathbb { E } _ { v \sim U } [ \mathrm { G N N } _ { \theta } ^ { ( 1 ) } ( v , \widetilde { A } ) | v \ \in \ S$ ei], $i \ = \ 0 , 1$ , $Q ^ { \prime } : = \mathsf { s u p } \{ \| \mathbf { G N N } _ { \theta } ^ { ( 1 ) } ( v , \widetilde { A } ) \| _ { 2 } \ | \ v \ \in \ \mathcal { V } \}$ . $\mu _ { i } ^ { \prime \prime } : = \mathbb { E } _ { v \sim U } [ \mathrm { G N N } _ { \theta } ^ { ( 2 ) } ( v , \widetilde { A } ) | v \in S _ { i } ]$ , $i \ = \ 0 , 1$ , $Q ^ { \prime \prime } : = \mathrm { s u p } \{ \| \mathbf { G N N } _ { \theta } ^ { ( 2 ) } ( v , \widetilde { A } ) \| _ { 2 } | v \in \mathcal { V } \}$ . Let $\sigma _ { 1 }$ be the maximal deviation of $\{ v | v \in \mathcal { V } \}$ , and $\sigma _ { 2 }$ be the maximal deviation of $\{ \mathrm { G N N } _ { \theta } ^ { ( 1 ) } ( v , \widetilde { A } ) | v ~ \in ~ \mathcal { V } \}$ . We have $Q ^ { \prime } ~ \leq ~ L \| W _ { \theta } ^ { ( 1 ) } \| _ { 2 } Q$ , $Q ^ { \prime \prime } \leq L \| W _ { \theta } ^ { ( 2 ) } \| _ { 2 } Q ^ { \prime } \leq L ^ { 2 } \| W _ { \theta } ^ { ( 1 ) } \| _ { 2 } \| W _ { \theta } ^ { ( 2 ) } \| _ { 2 } Q$ .
|
| 485 |
+
|
| 486 |
+
Then
|
| 487 |
+
|
| 488 |
+
And
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { r l } & { \Delta _ { D P } ^ { ( 2 ) } \leq Q ^ { \prime \prime } | | \Sigma | | _ { 2 } \cdot \| \mu _ { 0 } ^ { \prime \prime } - \mu _ { 1 } ^ { \prime \prime } \| _ { 2 } \leq Q L ^ { 3 } | | W _ { \theta } ^ { ( 2 ) } | | _ { 2 } ^ { 2 } \| W _ { \theta } ^ { ( 1 ) } \| _ { 2 } ( \alpha \| \mu _ { 0 } ^ { \prime } - \mu _ { 1 } ^ { \prime } \| _ { 2 } + 2 \sqrt { M } \sigma _ { 2 } ) } \\ & { } \\ & { \qquad \| \mu _ { 0 } ^ { \prime } - \mu _ { 1 } ^ { \prime } \| _ { 2 } \leq L | | W _ { \theta } ^ { ( 1 ) } | | _ { 2 } ( \alpha \| \mu _ { 0 } - \mu _ { 1 } \| _ { 2 } + 2 \sqrt { M } \sigma _ { 1 } ) } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
Finally we have:
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\begin{array} { r } { \Sigma _ { D P } ^ { ( 2 ) } \leq Q L ^ { 4 } | | W _ { \theta } ^ { ( 2 ) } | | _ { 2 } ^ { 2 } | | W _ { \theta } ^ { ( 1 ) } | | _ { 2 } ^ { 2 } \alpha ^ { 2 } | | \mu _ { 0 } - \mu _ { 1 } | | _ { 2 } + 2 \sqrt { M } Q L ^ { 3 } | | W _ { \theta } ^ { ( 2 ) } | | _ { 2 } ^ { 2 } | | W _ { \theta } ^ { ( 1 ) } | | _ { 2 } ( L | | W _ { \theta } ^ { ( 1 ) } | | _ { 2 } \cdot \sigma _ { 1 } + \sigma _ { 2 } ) } \end{array}
|
| 498 |
+
$$
|